SettingView.xaml 226 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967
  1. <UserControl
  2. x:Class="TeamAAS_VP.Views.SettingView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  6. xmlns:c="clr-namespace:TeamAAS_VP.ValueConverter"
  7. xmlns:coreLights="clr-namespace:TeamAAS_VP.Core.Lights"
  8. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  9. xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
  10. xmlns:enums1="clr-namespace:Team.FFFeederService;assembly=Team.FFFeederService"
  11. xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
  12. xmlns:io="clr-namespace:System.IO.Ports;assembly=System"
  13. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  14. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  15. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  16. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  17. xmlns:prism="http://prismlibrary.com/"
  18. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  19. xmlns:sysio="clr-namespace:System.IO.Ports;assembly=System"
  20. xmlns:valRules="clr-namespace:TeamAAS_VP.Identity"
  21. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels"
  22. d:Background="White"
  23. d:DataContext="{d:DesignInstance Type=vm:SettingViewModel}"
  24. d:Height="1080"
  25. d:Width="1024"
  26. lex:LocalizeDictionary.DesignCulture="zh-CN"
  27. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  28. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  29. prism:ViewModelLocator.AutoWireViewModel="True"
  30. FontFamily="{DynamicResource DefaultFont}"
  31. mc:Ignorable="d">
  32. <b:Interaction.Triggers>
  33. <b:EventTrigger EventName="Loaded">
  34. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  35. </b:EventTrigger>
  36. </b:Interaction.Triggers>
  37. <UserControl.Resources>
  38. <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverter" />
  39. <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverterInverse" Inverse="True" />
  40. <c:PlcIdToNameConverter x:Key="PlcIdToNameConverter" />
  41. <!-- Header text style: no wrap and trim with ellipsis, allows header to size to content -->
  42. <Style x:Key="TabHeaderTextBlockStyle" TargetType="TextBlock">
  43. <Setter Property="TextWrapping" Value="NoWrap" />
  44. <Setter Property="TextTrimming" Value="CharacterEllipsis" />
  45. <Setter Property="HorizontalAlignment" Value="Center" />
  46. <Setter Property="VerticalAlignment" Value="Center" />
  47. </Style>
  48. <ObjectDataProvider
  49. x:Key="Parity"
  50. MethodName="GetValues"
  51. ObjectType="{x:Type sys:Enum}">
  52. <ObjectDataProvider.MethodParameters>
  53. <x:Type TypeName="sysio:Parity" />
  54. </ObjectDataProvider.MethodParameters>
  55. </ObjectDataProvider>
  56. <ObjectDataProvider
  57. x:Key="StopBits"
  58. MethodName="GetValues"
  59. ObjectType="{x:Type sys:Enum}">
  60. <ObjectDataProvider.MethodParameters>
  61. <x:Type TypeName="sysio:StopBits" />
  62. </ObjectDataProvider.MethodParameters>
  63. </ObjectDataProvider>
  64. </UserControl.Resources>
  65. <Grid>
  66. <TabControl
  67. materialDesign:NavigationRailAssist.ShowSelectionBackground="True"
  68. SnapsToDevicePixels="True"
  69. Style="{StaticResource MaterialDesignNavigationRailTabControl}"
  70. TabStripPlacement="Left">
  71. <materialDesign:NavigationRailAssist.FloatingContent>
  72. <Button
  73. Margin="8"
  74. Content="{materialDesign:PackIcon Kind=OfficeBuildingCogOutline}"
  75. Style="{StaticResource MaterialDesignFloatingActionSecondaryButton}" />
  76. </materialDesign:NavigationRailAssist.FloatingContent>
  77. <!-- 相机配置 -->
  78. <TabItem Margin="5,0">
  79. <TabItem.Header>
  80. <StackPanel HorizontalAlignment="Stretch">
  81. <materialDesign:PackIcon
  82. Width="24"
  83. Height="24"
  84. HorizontalAlignment="Center"
  85. Kind="CameraPlusOutline" />
  86. <TextBlock
  87. HorizontalAlignment="Stretch"
  88. FontSize="{DynamicResource Font.Size.Body2}"
  89. Style="{StaticResource TabHeaderTextBlockStyle}"
  90. Text="{lex:Loc SettingView_Camera_Text}" />
  91. </StackPanel>
  92. </TabItem.Header>
  93. <Grid Margin="16">
  94. <Grid.RowDefinitions>
  95. <RowDefinition Height="50" />
  96. <RowDefinition Height="*" />
  97. </Grid.RowDefinitions>
  98. <Grid.ColumnDefinitions>
  99. <ColumnDefinition Width="auto" />
  100. <ColumnDefinition Width="*" />
  101. </Grid.ColumnDefinitions>
  102. <!-- 增删改查 -->
  103. <StackPanel
  104. Grid.ColumnSpan="2"
  105. IsEnabled="{Binding IsAllowEdit}"
  106. Orientation="Horizontal">
  107. <Button
  108. Command="{Binding AddCameraCommand}"
  109. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  110. ToolTip="{lex:Loc SettingView_Camera_btnAddCamera}">
  111. <materialDesign:PackIcon Kind="Plus" />
  112. </Button>
  113. <Button
  114. Margin="20,0"
  115. Command="{Binding EditCameraCommand}"
  116. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  117. ToolTip="{lex:Loc SettingView_Camera_btnEditCamera}">
  118. <materialDesign:PackIcon Kind="PuzzleEditOutline" />
  119. </Button>
  120. <Button
  121. Command="{Binding RemoveCameraCommand}"
  122. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  123. ToolTip="{lex:Loc SettingView_Camera_btnRemoveCamera}">
  124. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  125. </Button>
  126. <Button
  127. Margin="20,0"
  128. Command="{Binding SaveCamerasCommand}"
  129. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  130. ToolTip="{lex:Loc 保存}">
  131. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  132. </Button>
  133. </StackPanel>
  134. <!-- 相机列表 -->
  135. <TreeView
  136. Grid.Row="1"
  137. Grid.Column="0"
  138. SelectedItemChanged="TreeView_SelectedItemChanged">
  139. <TreeViewItem
  140. FontSize="{DynamicResource Font.Size.Title4}"
  141. FontWeight="Bold"
  142. Header="{lex:Loc SettingView_Camera_CameraList}"
  143. IsExpanded="True"
  144. ItemsSource="{Binding CameraList}">
  145. <TreeViewItem.ItemTemplate>
  146. <HierarchicalDataTemplate>
  147. <StackPanel Orientation="Vertical">
  148. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  149. <TextBlock.Text>
  150. <MultiBinding StringFormat="{}{0}. {1}">
  151. <Binding Path="CameraNo" />
  152. <Binding Path="CameraName" />
  153. </MultiBinding>
  154. </TextBlock.Text>
  155. </TextBlock>
  156. <StackPanel Orientation="Horizontal">
  157. <TextBlock
  158. FontSize="{DynamicResource Font.Size.Body3}"
  159. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  160. Text="{lex:Loc 品牌,
  161. Converter={StaticResource StringFormatConverter},
  162. ConverterParameter='{}{0}: '}" />
  163. <TextBlock
  164. FontSize="{DynamicResource Font.Size.Body3}"
  165. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  166. Text="{Binding CameraBrand}" />
  167. <TextBlock
  168. FontSize="{DynamicResource Font.Size.Body3}"
  169. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  170. Text="-" />
  171. <TextBlock
  172. FontSize="{DynamicResource Font.Size.Body3}"
  173. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  174. Text="{Binding ManufacturerName}" />
  175. </StackPanel>
  176. <StackPanel Orientation="Horizontal">
  177. <TextBlock
  178. FontSize="{DynamicResource Font.Size.Body3}"
  179. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  180. Text="{lex:Loc 型号,
  181. Converter={StaticResource StringFormatConverter},
  182. ConverterParameter='{}{0}: '}" />
  183. <TextBlock
  184. FontSize="{DynamicResource Font.Size.Body3}"
  185. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  186. Text="{Binding Model, Mode=TwoWay}" />
  187. <TextBlock
  188. Margin="10,0,0,0"
  189. FontSize="{DynamicResource Font.Size.Body3}"
  190. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  191. Text="{lex:Loc 序列号,
  192. Converter={StaticResource StringFormatConverter},
  193. ConverterParameter='{}{0}: '}" />
  194. <TextBlock
  195. FontSize="{DynamicResource Font.Size.Body3}"
  196. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  197. Text="{Binding SerialNumber, Mode=TwoWay}" />
  198. </StackPanel>
  199. <StackPanel Orientation="Horizontal">
  200. <TextBlock
  201. FontSize="{DynamicResource Font.Size.Body3}"
  202. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  203. Text="{lex:Loc 类型,
  204. Converter={StaticResource StringFormatConverter},
  205. ConverterParameter='{}{0}: '}" />
  206. <TextBlock
  207. FontSize="{DynamicResource Font.Size.Body3}"
  208. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  209. Text="{Binding CameraType}" />
  210. <TextBlock
  211. Margin="10,0,0,0"
  212. FontSize="{DynamicResource Font.Size.Body3}"
  213. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  214. Text="IP: " />
  215. <TextBlock
  216. FontSize="{DynamicResource Font.Size.Body3}"
  217. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  218. Text="{Binding CameraIp}" />
  219. </StackPanel>
  220. <Border
  221. Height="2"
  222. Margin="0"
  223. BorderBrush="Green"
  224. BorderThickness="2" />
  225. </StackPanel>
  226. </HierarchicalDataTemplate>
  227. </TreeViewItem.ItemTemplate>
  228. </TreeViewItem>
  229. </TreeView>
  230. </Grid>
  231. </TabItem>
  232. <!-- 设备信息 -->
  233. <TabItem>
  234. <TabItem.Header>
  235. <StackPanel HorizontalAlignment="Stretch">
  236. <materialDesign:PackIcon
  237. Width="24"
  238. Height="24"
  239. HorizontalAlignment="Center"
  240. Kind="RouterNetwork" />
  241. <TextBlock
  242. HorizontalAlignment="Stretch"
  243. FontSize="{DynamicResource Font.Size.Body2}"
  244. Style="{StaticResource TabHeaderTextBlockStyle}"
  245. Text="设备信息" />
  246. </StackPanel>
  247. </TabItem.Header>
  248. <Grid Margin="16">
  249. <Grid.RowDefinitions>
  250. <RowDefinition Height="50" />
  251. <RowDefinition Height="*" />
  252. </Grid.RowDefinitions>
  253. <Grid.ColumnDefinitions>
  254. <ColumnDefinition Width="auto" />
  255. <ColumnDefinition Width="*" />
  256. </Grid.ColumnDefinitions>
  257. <!-- 增删改查按钮 -->
  258. <StackPanel
  259. Grid.ColumnSpan="2"
  260. IsEnabled="{Binding IsAllowEdit}"
  261. Orientation="Horizontal">
  262. <Button
  263. Command="{Binding AddDeviceInfoCommand}"
  264. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  265. ToolTip="添加设备">
  266. <materialDesign:PackIcon Kind="Plus" />
  267. </Button>
  268. <Button
  269. Margin="20,0"
  270. Command="{Binding RemoveDeviceInfoCommand}"
  271. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  272. ToolTip="删除设备">
  273. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  274. </Button>
  275. <Button
  276. Command="{Binding SaveDeviceInfoCommand}"
  277. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  278. ToolTip="{lex:Loc 保存}">
  279. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  280. </Button>
  281. </StackPanel>
  282. <!-- 设备列表 -->
  283. <TreeView
  284. Grid.Row="1"
  285. Grid.Column="0"
  286. SelectedItemChanged="TreeView_SelectedItemChanged">
  287. <TreeViewItem
  288. FontSize="{DynamicResource Font.Size.Title4}"
  289. FontWeight="Bold"
  290. Header="设备列表"
  291. IsExpanded="True"
  292. ItemsSource="{Binding DeviceInfoList}">
  293. <TreeViewItem.ItemTemplate>
  294. <HierarchicalDataTemplate>
  295. <StackPanel Orientation="Vertical">
  296. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  297. <TextBlock.Text>
  298. <MultiBinding StringFormat="设备 {0}">
  299. <Binding Path="DeviceNo" />
  300. </MultiBinding>
  301. </TextBlock.Text>
  302. </TextBlock>
  303. <StackPanel Orientation="Horizontal">
  304. <TextBlock
  305. FontSize="{DynamicResource Font.Size.Body3}"
  306. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  307. Text="DeviceName: " />
  308. <TextBlock
  309. FontSize="{DynamicResource Font.Size.Body3}"
  310. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  311. Text="{Binding DeviceName}" />
  312. </StackPanel>
  313. <StackPanel Orientation="Horizontal">
  314. <TextBlock
  315. FontSize="{DynamicResource Font.Size.Body3}"
  316. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  317. Text="Line: " />
  318. <TextBlock
  319. FontSize="{DynamicResource Font.Size.Body3}"
  320. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  321. Text="{Binding Line}" />
  322. </StackPanel>
  323. <StackPanel Orientation="Horizontal">
  324. <TextBlock
  325. FontSize="{DynamicResource Font.Size.Body3}"
  326. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  327. Text="Station: " />
  328. <TextBlock
  329. FontSize="{DynamicResource Font.Size.Body3}"
  330. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  331. Text="{Binding Station}" />
  332. </StackPanel>
  333. <Border
  334. Height="2"
  335. Margin="0"
  336. BorderBrush="Green"
  337. BorderThickness="2" />
  338. </StackPanel>
  339. </HierarchicalDataTemplate>
  340. </TreeViewItem.ItemTemplate>
  341. </TreeViewItem>
  342. </TreeView>
  343. <!-- 参数详情 -->
  344. <ScrollViewer
  345. Grid.Row="1"
  346. Grid.Column="1"
  347. Margin="20"
  348. IsEnabled="{Binding IsAllowEdit}"
  349. Visibility="{Binding SelectDeviceInfo, Converter={StaticResource ObjectToVisibilityConverter}}">
  350. <Grid>
  351. <Grid.RowDefinitions>
  352. <RowDefinition Height="auto" />
  353. <RowDefinition Height="auto" />
  354. </Grid.RowDefinitions>
  355. <!-- 设备信息表单 -->
  356. <Grid>
  357. <Grid.RowDefinitions>
  358. <RowDefinition Height="Auto" />
  359. <RowDefinition Height="Auto" />
  360. <RowDefinition Height="Auto" />
  361. <RowDefinition Height="Auto" />
  362. <RowDefinition Height="Auto" />
  363. <RowDefinition Height="Auto" />
  364. <RowDefinition Height="Auto" />
  365. <RowDefinition Height="Auto" />
  366. <RowDefinition Height="Auto" />
  367. <RowDefinition Height="Auto" />
  368. <RowDefinition Height="Auto" />
  369. <RowDefinition Height="Auto" />
  370. <RowDefinition Height="Auto" />
  371. <RowDefinition Height="Auto" />
  372. <RowDefinition Height="Auto" />
  373. <RowDefinition Height="Auto" />
  374. <RowDefinition Height="Auto" />
  375. <RowDefinition Height="Auto" />
  376. <RowDefinition Height="Auto" />
  377. <RowDefinition Height="Auto" />
  378. <RowDefinition Height="Auto" />
  379. <RowDefinition Height="Auto" />
  380. <RowDefinition Height="Auto" />
  381. <RowDefinition Height="Auto" />
  382. <RowDefinition Height="Auto" />
  383. <RowDefinition Height="Auto" />
  384. <RowDefinition Height="Auto" />
  385. <RowDefinition Height="Auto" />
  386. <RowDefinition Height="Auto" />
  387. </Grid.RowDefinitions>
  388. <Grid.ColumnDefinitions>
  389. <ColumnDefinition Width="auto" />
  390. <ColumnDefinition Width="*" />
  391. </Grid.ColumnDefinitions>
  392. <TextBlock
  393. Grid.Row="0"
  394. Grid.Column="0"
  395. HorizontalAlignment="Right"
  396. VerticalAlignment="Center"
  397. Text="设备编号:" />
  398. <TextBlock
  399. Grid.Row="0"
  400. Grid.Column="1"
  401. Margin="6,2"
  402. VerticalAlignment="Center"
  403. Text="{Binding SelectDeviceInfo.DeviceNo}" />
  404. <TextBlock
  405. Grid.Row="1"
  406. Grid.Column="0"
  407. HorizontalAlignment="Right"
  408. VerticalAlignment="Center"
  409. Text="设备名称:" />
  410. <TextBox
  411. Grid.Row="1"
  412. Grid.Column="1"
  413. Margin="6,2"
  414. Text="{Binding SelectDeviceInfo.DeviceName, Mode=TwoWay}" />
  415. <TextBlock
  416. Grid.Row="2"
  417. Grid.Column="0"
  418. HorizontalAlignment="Right"
  419. VerticalAlignment="Center"
  420. Text="设备描述:" />
  421. <TextBox
  422. Grid.Row="2"
  423. Grid.Column="1"
  424. Margin="6,2"
  425. Text="{Binding SelectDeviceInfo.DeviceDesc, Mode=TwoWay}" />
  426. <TextBlock
  427. Grid.Row="3"
  428. Grid.Column="0"
  429. HorizontalAlignment="Right"
  430. VerticalAlignment="Center"
  431. Text="Url:" />
  432. <TextBox
  433. Grid.Row="3"
  434. Grid.Column="1"
  435. Margin="6,2"
  436. Text="{Binding SelectDeviceInfo.MesUrl, Mode=TwoWay}" />
  437. <TextBlock
  438. Grid.Row="4"
  439. Grid.Column="0"
  440. HorizontalAlignment="Right"
  441. VerticalAlignment="Center"
  442. Text="Line:" />
  443. <TextBox
  444. Grid.Row="4"
  445. Grid.Column="1"
  446. Margin="6,2"
  447. Text="{Binding SelectDeviceInfo.Line, Mode=TwoWay}" />
  448. <TextBlock
  449. Grid.Row="5"
  450. Grid.Column="0"
  451. HorizontalAlignment="Right"
  452. VerticalAlignment="Center"
  453. Text="Station:" />
  454. <TextBox
  455. Grid.Row="5"
  456. Grid.Column="1"
  457. Margin="6,2"
  458. Text="{Binding SelectDeviceInfo.Station, Mode=TwoWay}" />
  459. <TextBlock
  460. Grid.Row="6"
  461. Grid.Column="0"
  462. HorizontalAlignment="Right"
  463. VerticalAlignment="Center"
  464. Text="FixtureId:" />
  465. <TextBox
  466. Grid.Row="6"
  467. Grid.Column="1"
  468. Margin="6,2"
  469. Text="{Binding SelectDeviceInfo.FixtureId, Mode=TwoWay}" />
  470. <TextBlock
  471. Grid.Row="7"
  472. Grid.Column="0"
  473. HorizontalAlignment="Right"
  474. VerticalAlignment="Center"
  475. Text="f:" />
  476. <TextBox
  477. Grid.Row="7"
  478. Grid.Column="1"
  479. Margin="6,2"
  480. Text="{Binding SelectDeviceInfo.F, Mode=TwoWay}" />
  481. <TextBlock
  482. Grid.Row="8"
  483. Grid.Column="0"
  484. HorizontalAlignment="Right"
  485. VerticalAlignment="Center"
  486. Text="comp:" />
  487. <TextBox
  488. Grid.Row="8"
  489. Grid.Column="1"
  490. Margin="6,2"
  491. Text="{Binding SelectDeviceInfo.comp, Mode=TwoWay}" />
  492. <TextBlock
  493. Grid.Row="9"
  494. Grid.Column="0"
  495. HorizontalAlignment="Right"
  496. VerticalAlignment="Center"
  497. Text="LogUrl:" />
  498. <TextBox
  499. Grid.Row="9"
  500. Grid.Column="1"
  501. Margin="6,2"
  502. Text="{Binding SelectDeviceInfo.LogUrl, Mode=TwoWay}" />
  503. <TextBlock
  504. Grid.Row="10"
  505. Grid.Column="0"
  506. HorizontalAlignment="Right"
  507. VerticalAlignment="Center"
  508. Text="apikey:" />
  509. <TextBox
  510. Grid.Row="10"
  511. Grid.Column="1"
  512. Margin="6,2"
  513. Text="{Binding SelectDeviceInfo.ApiKey, Mode=TwoWay}" />
  514. <CheckBox
  515. Grid.Row="11"
  516. Grid.Column="1"
  517. Margin="6,2"
  518. Command="{Binding CheckStatusCommand}"
  519. Content="启用 MES"
  520. IsChecked="{Binding SelectDeviceInfo.EnableMES, Mode=TwoWay}" />
  521. <!--<CheckBox Grid.Row="10"
  522. Grid.Column="1"
  523. Content="是否启用两次产品编号"
  524. IsChecked="{Binding SelectDeviceInfo.EnableDoubleMes, Mode=TwoWay}"
  525. Margin="6,2" />-->
  526. <StackPanel
  527. Grid.Row="13"
  528. Grid.Column="1"
  529. Orientation="Horizontal">
  530. <CheckBox
  531. Margin="6,2"
  532. Command="{Binding CheckStatusCommand}"
  533. Content="是否保存CSV文件"
  534. IsChecked="{Binding SelectDeviceInfo.SaveCsv, Mode=TwoWay}" />
  535. <CheckBox
  536. Margin="6,2"
  537. Content="是否保存ppid"
  538. IsChecked="{Binding SelectDeviceInfo.SaveCsvPPID, Mode=TwoWay}" />
  539. </StackPanel>
  540. <TextBlock
  541. Grid.Row="14"
  542. Grid.Column="0"
  543. HorizontalAlignment="Right"
  544. VerticalAlignment="Center"
  545. Text="保存的CSV文件路径:" />
  546. <DockPanel
  547. Grid.Row="14"
  548. Grid.Column="1"
  549. Margin="6,2"
  550. HorizontalAlignment="Stretch">
  551. <Button
  552. HorizontalAlignment="Right"
  553. Command="{Binding SelectSaveImagePathCommand}"
  554. DockPanel.Dock="Right"
  555. ToolTip="{lex:Loc 选择路径}">
  556. <Button.Content>
  557. <materialDesign:PackIcon Kind="FolderOpenOutline" />
  558. </Button.Content>
  559. </Button>
  560. <TextBox Text="{Binding SelectDeviceInfo.SaveCsvPath, Mode=TwoWay}" />
  561. </DockPanel>
  562. <!-- CTQ 数据信息 -->
  563. <TextBlock
  564. Grid.Row="15"
  565. Grid.Column="0"
  566. HorizontalAlignment="Right"
  567. VerticalAlignment="Center"
  568. Text="PROCESS_NAME:" />
  569. <TextBox
  570. Grid.Row="15"
  571. Grid.Column="1"
  572. Margin="6,2"
  573. Text="{Binding SelectDeviceInfo.DataInfo.PROCESS_NAME, Mode=TwoWay}" />
  574. <TextBlock
  575. Grid.Row="16"
  576. Grid.Column="0"
  577. HorizontalAlignment="Right"
  578. VerticalAlignment="Center"
  579. Text="CTQ_LSL(压力下限):" />
  580. <TextBox
  581. Grid.Row="16"
  582. Grid.Column="1"
  583. Margin="6,2"
  584. Text="{Binding SelectDeviceInfo.DataInfo.CTQ_LSL_Pressure, Mode=TwoWay}" />
  585. <TextBlock
  586. Grid.Row="17"
  587. Grid.Column="0"
  588. HorizontalAlignment="Right"
  589. VerticalAlignment="Center"
  590. Text="CTQ_USL(压力上限):" />
  591. <TextBox
  592. Grid.Row="17"
  593. Grid.Column="1"
  594. Margin="6,2"
  595. Text="{Binding SelectDeviceInfo.DataInfo.CTQ_USL_Pressure, Mode=TwoWay}" />
  596. <TextBlock
  597. Grid.Row="18"
  598. Grid.Column="0"
  599. HorizontalAlignment="Right"
  600. VerticalAlignment="Center"
  601. Text="SUPPLIER_NAME:" />
  602. <TextBox
  603. Grid.Row="18"
  604. Grid.Column="1"
  605. Margin="6,2"
  606. Text="{Binding SelectDeviceInfo.DataInfo.SUPPLIER_NAME, Mode=TwoWay}" />
  607. <TextBlock
  608. Grid.Row="19"
  609. Grid.Column="0"
  610. HorizontalAlignment="Right"
  611. VerticalAlignment="Center"
  612. Text="COMMODITY_TYPE:" />
  613. <TextBox
  614. Grid.Row="19"
  615. Grid.Column="1"
  616. Margin="6,2"
  617. Text="{Binding SelectDeviceInfo.DataInfo.COMMODITY_TYPE, Mode=TwoWay}" />
  618. <TextBlock
  619. Grid.Row="20"
  620. Grid.Column="0"
  621. HorizontalAlignment="Right"
  622. VerticalAlignment="Center"
  623. Text="REVISION:" />
  624. <TextBox
  625. Grid.Row="20"
  626. Grid.Column="1"
  627. Margin="6,2"
  628. Text="{Binding SelectDeviceInfo.DataInfo.REVISION, Mode=TwoWay}" />
  629. <TextBlock
  630. Grid.Row="21"
  631. Grid.Column="0"
  632. HorizontalAlignment="Right"
  633. VerticalAlignment="Center"
  634. Text="MFG_LOT#:" />
  635. <TextBox
  636. Grid.Row="21"
  637. Grid.Column="1"
  638. Margin="6,2"
  639. Text="{Binding SelectDeviceInfo.DataInfo.MFG_LOT, Mode=TwoWay}" />
  640. <TextBlock
  641. Grid.Row="22"
  642. Grid.Column="0"
  643. HorizontalAlignment="Right"
  644. VerticalAlignment="Center"
  645. Text="MFG_ASSY_LINE:" />
  646. <TextBox
  647. Grid.Row="22"
  648. Grid.Column="1"
  649. Margin="6,2"
  650. Text="{Binding SelectDeviceInfo.DataInfo.MFG_ASSY_LINE, Mode=TwoWay}" />
  651. <TextBlock
  652. Grid.Row="23"
  653. Grid.Column="0"
  654. HorizontalAlignment="Right"
  655. VerticalAlignment="Center"
  656. Text="PROCESS_MACHINE_ID:" />
  657. <TextBox
  658. Grid.Row="23"
  659. Grid.Column="1"
  660. Margin="6,2"
  661. Text="{Binding SelectDeviceInfo.DataInfo.PROCESS_MACHINE_ID, Mode=TwoWay}" />
  662. </Grid>
  663. </Grid>
  664. </ScrollViewer>
  665. </Grid>
  666. </TabItem>
  667. <!-- 机器人 -->
  668. <TabItem>
  669. <TabItem.Header>
  670. <StackPanel HorizontalAlignment="Stretch">
  671. <materialDesign:PackIcon
  672. Width="24"
  673. Height="24"
  674. HorizontalAlignment="Center"
  675. Kind="RobotIndustrialOutline" />
  676. <TextBlock
  677. HorizontalAlignment="Stretch"
  678. FontSize="{DynamicResource Font.Size.Body2}"
  679. Style="{StaticResource TabHeaderTextBlockStyle}"
  680. Text="{lex:Loc 机器人}" />
  681. </StackPanel>
  682. </TabItem.Header>
  683. <Grid Margin="16">
  684. <Grid.RowDefinitions>
  685. <RowDefinition Height="50" />
  686. <RowDefinition Height="*" />
  687. </Grid.RowDefinitions>
  688. <Grid.ColumnDefinitions>
  689. <ColumnDefinition Width="auto" />
  690. <ColumnDefinition Width="*" />
  691. </Grid.ColumnDefinitions>
  692. <!-- 增删改查 -->
  693. <StackPanel
  694. Grid.ColumnSpan="2"
  695. IsEnabled="{Binding IsAllowEdit}"
  696. Orientation="Horizontal">
  697. <Button
  698. Command="{Binding AddRobotCommand}"
  699. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  700. ToolTip="{lex:Loc 增加机器人}">
  701. <materialDesign:PackIcon Kind="Plus" />
  702. </Button>
  703. <Button
  704. Margin="20,0"
  705. Command="{Binding RemoveCommand}"
  706. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  707. ToolTip="{lex:Loc 移除机器人}">
  708. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  709. </Button>
  710. <Button
  711. Command="{Binding SaveRobotsCommand}"
  712. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  713. ToolTip="{lex:Loc 保存}">
  714. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  715. </Button>
  716. </StackPanel>
  717. <!-- 机器人列表 -->
  718. <TreeView
  719. Grid.Row="1"
  720. Grid.Column="0"
  721. SelectedItemChanged="TreeView_SelectedItemChanged">
  722. <TreeViewItem
  723. FontSize="{DynamicResource Font.Size.Title4}"
  724. FontWeight="Bold"
  725. Header="{lex:Loc 机器人列表}"
  726. IsExpanded="True"
  727. ItemsSource="{Binding RobotList}">
  728. <TreeViewItem.ItemTemplate>
  729. <HierarchicalDataTemplate>
  730. <StackPanel Orientation="Vertical">
  731. <StackPanel Orientation="Horizontal">
  732. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  733. <TextBlock.Text>
  734. <MultiBinding StringFormat="{}{0}. {1}">
  735. <Binding Path="RobotNo" />
  736. <Binding Path="RobotName" />
  737. </MultiBinding>
  738. </TextBlock.Text>
  739. </TextBlock>
  740. </StackPanel>
  741. <StackPanel Orientation="Horizontal">
  742. <TextBlock
  743. FontSize="{DynamicResource Font.Size.Captions3}"
  744. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  745. Text="{lex:Loc 品牌,
  746. Converter={StaticResource StringFormatConverter},
  747. ConverterParameter='{}{0}: '}" />
  748. <TextBlock
  749. FontSize="{DynamicResource Font.Size.Captions3}"
  750. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  751. Text="{Binding RobotBrand, Mode=TwoWay}" />
  752. <TextBlock
  753. Margin="10,0,0,0"
  754. FontSize="{DynamicResource Font.Size.Captions3}"
  755. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  756. Text="{lex:Loc 连接方式,
  757. Converter={StaticResource StringFormatConverter},
  758. ConverterParameter='{}{0}: '}"
  759. Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  760. <TextBlock
  761. VerticalAlignment="Center"
  762. FontSize="{DynamicResource Font.Size.Captions3}"
  763. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  764. Text="{Binding ConnectType, Mode=TwoWay}"
  765. Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  766. <!-- PLC -->
  767. <TextBlock
  768. Margin="10,0,0,0"
  769. d:Visibility="Collapsed"
  770. FontSize="{DynamicResource Font.Size.Captions3}"
  771. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  772. Text="PLC: "
  773. Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  774. <TextBlock
  775. d:Visibility="Collapsed"
  776. FontSize="{DynamicResource Font.Size.Captions3}"
  777. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  778. Text="{Binding PLC, Converter={StaticResource PlcIdToNameConverter}}"
  779. Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  780. </StackPanel>
  781. <StackPanel Orientation="Horizontal" Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  782. <TextBlock
  783. FontSize="{DynamicResource Font.Size.Captions3}"
  784. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  785. Text="{Binding IP, StringFormat=IP:{0}, Mode=TwoWay}" />
  786. <TextBlock
  787. Margin="10,0"
  788. FontSize="{DynamicResource Font.Size.Captions3}"
  789. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  790. Text="{Binding Port, StringFormat=Port:{0}, Mode=TwoWay}" />
  791. <TextBlock
  792. FontSize="{DynamicResource Font.Size.Captions3}"
  793. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  794. Text="{lex:Loc 结束符,
  795. Converter={StaticResource StringFormatConverter},
  796. ConverterParameter='{}{0}: '}" />
  797. <TextBlock
  798. FontSize="{DynamicResource Font.Size.Captions3}"
  799. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  800. Text="{Binding Terminator, Mode=TwoWay}" />
  801. </StackPanel>
  802. <Border
  803. Height="2"
  804. Margin="0"
  805. BorderBrush="Green"
  806. BorderThickness="2" />
  807. </StackPanel>
  808. </HierarchicalDataTemplate>
  809. </TreeViewItem.ItemTemplate>
  810. </TreeViewItem>
  811. </TreeView>
  812. <!-- 参数详情 -->
  813. <ScrollViewer
  814. Grid.Row="1"
  815. Grid.Column="1"
  816. Margin="20"
  817. IsEnabled="{Binding IsAllowEdit}"
  818. Visibility="{Binding SelectRobot, Converter={StaticResource ObjectToVisibilityConverter}}">
  819. <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
  820. <Grid.RowDefinitions>
  821. <RowDefinition />
  822. <RowDefinition />
  823. <RowDefinition />
  824. <RowDefinition />
  825. <RowDefinition />
  826. <RowDefinition />
  827. <RowDefinition />
  828. <RowDefinition />
  829. <RowDefinition />
  830. </Grid.RowDefinitions>
  831. <Grid.ColumnDefinitions>
  832. <ColumnDefinition Width="auto" />
  833. <ColumnDefinition Width="auto" />
  834. <ColumnDefinition Width="*" />
  835. </Grid.ColumnDefinitions>
  836. <!-- id -->
  837. <TextBlock
  838. Grid.Row="0"
  839. Grid.Column="0"
  840. HorizontalAlignment="Right"
  841. VerticalAlignment="Center"
  842. FontSize="{DynamicResource Font.Size.Body3}"
  843. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  844. Text="Id: " />
  845. <TextBlock
  846. x:Name="txt_Id"
  847. Grid.Row="0"
  848. Grid.Column="1"
  849. Margin="10,0"
  850. HorizontalAlignment="Left"
  851. VerticalAlignment="Center"
  852. FontSize="{DynamicResource Font.Size.Body3}"
  853. Text="{Binding SelectRobot.Id, Mode=TwoWay}" />
  854. <!-- 名称 -->
  855. <TextBlock
  856. Grid.Row="1"
  857. Grid.Column="0"
  858. HorizontalAlignment="Right"
  859. VerticalAlignment="Center"
  860. FontSize="{DynamicResource Font.Size.Body3}"
  861. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  862. Text="{lex:Loc 名称,
  863. Converter={StaticResource StringFormatConverter},
  864. ConverterParameter='{}{0}: '}" />
  865. <TextBox
  866. Grid.Row="1"
  867. Grid.Column="1"
  868. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  869. MinWidth="80"
  870. Margin="10,0"
  871. HorizontalAlignment="Left"
  872. VerticalAlignment="Center"
  873. FontSize="{DynamicResource Font.Size.Body3}"
  874. TextAlignment="Center">
  875. <TextBox.Text>
  876. <Binding Mode="TwoWay" Path="SelectRobot.RobotName">
  877. <Binding.ValidationRules>
  878. <valRules:NameValidationRule />
  879. </Binding.ValidationRules>
  880. </Binding>
  881. </TextBox.Text>
  882. </TextBox>
  883. <!-- 机器人品牌 -->
  884. <TextBlock
  885. Grid.Row="2"
  886. Grid.Column="0"
  887. HorizontalAlignment="Right"
  888. VerticalAlignment="Center"
  889. FontSize="{DynamicResource Font.Size.Body3}"
  890. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  891. Text="{lex:Loc 品牌,
  892. Converter={StaticResource StringFormatConverter},
  893. ConverterParameter='{}{0}: '}" />
  894. <ComboBox
  895. Grid.Row="2"
  896. Grid.Column="1"
  897. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  898. MinWidth="80"
  899. Margin="10,0"
  900. HorizontalAlignment="Left"
  901. VerticalAlignment="Center"
  902. HorizontalContentAlignment="Center"
  903. FontSize="{DynamicResource Font.Size.Body3}"
  904. ItemsSource="{ext:EnumBindingSource EnumType=enums:RobotBrand}"
  905. SelectedItem="{Binding SelectRobot.RobotBrand, Mode=TwoWay}" />
  906. <!-- 通讯方式 -->
  907. <TextBlock
  908. Grid.Row="3"
  909. Grid.Column="0"
  910. HorizontalAlignment="Right"
  911. VerticalAlignment="Center"
  912. FontSize="{DynamicResource Font.Size.Body3}"
  913. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  914. Text="{lex:Loc 通讯方式,
  915. Converter={StaticResource StringFormatConverter},
  916. ConverterParameter='{}{0}: '}"
  917. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  918. <ComboBox
  919. Grid.Row="3"
  920. Grid.Column="1"
  921. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  922. MinWidth="80"
  923. Margin="10,0"
  924. HorizontalAlignment="Left"
  925. VerticalAlignment="Center"
  926. HorizontalContentAlignment="Center"
  927. FontSize="{DynamicResource Font.Size.Body3}"
  928. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  929. SelectedItem="{Binding SelectRobot.ConnectType, Mode=TwoWay}"
  930. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  931. <!-- IP地址 -->
  932. <TextBlock
  933. Grid.Row="4"
  934. Grid.Column="0"
  935. HorizontalAlignment="Right"
  936. VerticalAlignment="Center"
  937. FontSize="{DynamicResource Font.Size.Body3}"
  938. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  939. Text="IP: "
  940. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  941. <TextBox
  942. Grid.Row="4"
  943. Grid.Column="1"
  944. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  945. MinWidth="80"
  946. Margin="10,0"
  947. HorizontalAlignment="Left"
  948. VerticalAlignment="Center"
  949. FontSize="{DynamicResource Font.Size.Body3}"
  950. TextAlignment="Center"
  951. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  952. <TextBox.Text>
  953. <Binding Mode="TwoWay" Path="SelectRobot.IP">
  954. <Binding.ValidationRules>
  955. <valRules:IPValidationRule />
  956. </Binding.ValidationRules>
  957. </Binding>
  958. </TextBox.Text>
  959. </TextBox>
  960. <!-- 端口号 -->
  961. <TextBlock
  962. Grid.Row="5"
  963. Grid.Column="0"
  964. HorizontalAlignment="Right"
  965. VerticalAlignment="Center"
  966. FontSize="{DynamicResource Font.Size.Body3}"
  967. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  968. Text="Port: "
  969. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  970. <TextBox
  971. Grid.Row="5"
  972. Grid.Column="1"
  973. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  974. MinWidth="80"
  975. Margin="10,0"
  976. HorizontalAlignment="Left"
  977. VerticalAlignment="Center"
  978. FontSize="{DynamicResource Font.Size.Body3}"
  979. TextAlignment="Center"
  980. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  981. <TextBox.Text>
  982. <Binding Mode="TwoWay" Path="SelectRobot.Port">
  983. <Binding.ValidationRules>
  984. <valRules:PortValidationRule />
  985. </Binding.ValidationRules>
  986. </Binding>
  987. </TextBox.Text>
  988. </TextBox>
  989. <!-- 结束符 -->
  990. <TextBlock
  991. Grid.Row="6"
  992. Grid.Column="0"
  993. HorizontalAlignment="Right"
  994. VerticalAlignment="Center"
  995. FontSize="{DynamicResource Font.Size.Body3}"
  996. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  997. Text="{lex:Loc 结束符,
  998. Converter={StaticResource StringFormatConverter},
  999. ConverterParameter='{}{0}: '}"
  1000. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1001. <ComboBox
  1002. Grid.Row="6"
  1003. Grid.Column="1"
  1004. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  1005. MinWidth="80"
  1006. Margin="10,0"
  1007. HorizontalAlignment="Left"
  1008. VerticalAlignment="Center"
  1009. HorizontalContentAlignment="Center"
  1010. FontSize="{DynamicResource Font.Size.Body3}"
  1011. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  1012. SelectedItem="{Binding SelectRobot.Terminator, Mode=TwoWay}"
  1013. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1014. <!-- 编码格式 -->
  1015. <TextBlock
  1016. Grid.Row="7"
  1017. Grid.Column="0"
  1018. HorizontalAlignment="Right"
  1019. VerticalAlignment="Center"
  1020. FontSize="{DynamicResource Font.Size.Body3}"
  1021. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1022. Text="{lex:Loc 编码解码,
  1023. Converter={StaticResource StringFormatConverter},
  1024. ConverterParameter='{}{0}: '}"
  1025. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1026. <ComboBox
  1027. Grid.Row="7"
  1028. Grid.Column="1"
  1029. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  1030. MinWidth="80"
  1031. Margin="10,0"
  1032. HorizontalAlignment="Left"
  1033. VerticalAlignment="Center"
  1034. HorizontalContentAlignment="Center"
  1035. FontSize="{DynamicResource Font.Size.Body3}"
  1036. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  1037. SelectedItem="{Binding SelectRobot.DataEncoding, Mode=TwoWay}"
  1038. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1039. <!-- Z轴的安全高度 -->
  1040. <TextBlock
  1041. Grid.Row="8"
  1042. Grid.Column="0"
  1043. HorizontalAlignment="Right"
  1044. VerticalAlignment="Center"
  1045. FontSize="{DynamicResource Font.Size.Body3}"
  1046. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1047. Text="Z轴的安全高度: " />
  1048. <TextBox
  1049. Grid.Row="8"
  1050. Grid.Column="1"
  1051. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  1052. MinWidth="80"
  1053. Margin="10,0"
  1054. HorizontalAlignment="Left"
  1055. VerticalAlignment="Center"
  1056. HorizontalContentAlignment="Center"
  1057. FontSize="{DynamicResource Font.Size.Body3}"
  1058. Text="{Binding SelectRobot.SafeZ, Mode=TwoWay}" />
  1059. <TextBlock
  1060. Grid.Row="8"
  1061. Grid.Column="1"
  1062. Margin="0,0,-20,0"
  1063. HorizontalAlignment="Right"
  1064. VerticalAlignment="Center"
  1065. FontSize="{DynamicResource Font.Size.Body3}"
  1066. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1067. Text="mm" />
  1068. <!-- PLC -->
  1069. <TextBlock
  1070. Grid.Row="3"
  1071. Grid.Column="0"
  1072. HorizontalAlignment="Right"
  1073. VerticalAlignment="Center"
  1074. d:Visibility="Collapsed"
  1075. Text="PLC: "
  1076. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  1077. <ComboBox
  1078. Grid.Row="3"
  1079. Grid.Column="1"
  1080. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  1081. MinWidth="80"
  1082. Margin="10,5"
  1083. HorizontalAlignment="Left"
  1084. VerticalAlignment="Center"
  1085. HorizontalContentAlignment="Center"
  1086. d:Visibility="Collapsed"
  1087. ItemsSource="{Binding PlcList}"
  1088. SelectedItem="{Binding RobotSelectedPlc}"
  1089. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  1090. <ComboBox.ItemTemplate>
  1091. <DataTemplate>
  1092. <TextBlock Text="{Binding Name}" />
  1093. </DataTemplate>
  1094. </ComboBox.ItemTemplate>
  1095. </ComboBox>
  1096. <!--<ScrollViewer Grid.RowSpan="8"
  1097. Grid.Column="2"
  1098. HorizontalScrollBarVisibility="Auto"
  1099. VerticalScrollBarVisibility="Auto"
  1100. d:Visibility="Collapsed"
  1101. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  1102. <Grid Margin="5">
  1103. <Grid.RowDefinitions>
  1104. <RowDefinition Height="Auto" />
  1105. <RowDefinition Height="Auto" />
  1106. <RowDefinition Height="Auto" />
  1107. <RowDefinition Height="Auto" />
  1108. <RowDefinition Height="Auto" />
  1109. <RowDefinition Height="Auto" />
  1110. <RowDefinition Height="Auto" />
  1111. <RowDefinition Height="Auto" />
  1112. <RowDefinition Height="Auto" />
  1113. <RowDefinition Height="Auto" />
  1114. <RowDefinition Height="Auto" />
  1115. <RowDefinition Height="Auto" />
  1116. <RowDefinition Height="Auto" />
  1117. <RowDefinition Height="Auto" />
  1118. <RowDefinition Height="Auto" />
  1119. <RowDefinition Height="Auto" />
  1120. <RowDefinition Height="Auto" />
  1121. <RowDefinition Height="Auto" />
  1122. <RowDefinition Height="Auto" />
  1123. <RowDefinition Height="Auto" />
  1124. <RowDefinition Height="Auto" />
  1125. <RowDefinition Height="Auto" />
  1126. <RowDefinition Height="Auto" />
  1127. <RowDefinition Height="Auto" />
  1128. </Grid.RowDefinitions>
  1129. <Grid.ColumnDefinitions>
  1130. <ColumnDefinition Width="auto" />
  1131. <ColumnDefinition Width="*" />
  1132. </Grid.ColumnDefinitions>
  1133. <Grid.Resources>
  1134. <Style TargetType="TextBlock">
  1135. <Setter Property="FontSize"
  1136. Value="{DynamicResource Font.Size.Body3}" />
  1137. <Setter Property="Margin"
  1138. Value="5" />
  1139. <Setter Property="VerticalAlignment"
  1140. Value="Center" />
  1141. </Style>
  1142. <Style TargetType="TextBox">
  1143. <Setter Property="FontSize"
  1144. Value="{DynamicResource Font.Size.Body3}" />
  1145. <Setter Property="Margin"
  1146. Value="5" />
  1147. <Setter Property="HorizontalAlignment"
  1148. Value="Stretch" />
  1149. <Setter Property="VerticalAlignment"
  1150. Value="Center" />
  1151. </Style>
  1152. </Grid.Resources>
  1153. <TextBlock Grid.Row="0"
  1154. FontWeight="Bold"
  1155. Text="{lex:Loc 状态参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  1156. <TextBlock Grid.Row="1"
  1157. Text="{lex:Loc X坐标}" />
  1158. <DockPanel Grid.Row="1"
  1159. Grid.Column="1"
  1160. LastChildFill="True">
  1161. <TextBlock Text="{Binding ResultsValues[0]}"
  1162. MinWidth="50" />
  1163. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.X}" />
  1164. </DockPanel>
  1165. <TextBlock Grid.Row="2"
  1166. Text="{lex:Loc Y坐标}" />
  1167. <DockPanel Grid.Row="2"
  1168. Grid.Column="1"
  1169. LastChildFill="True">
  1170. <TextBlock Text="{Binding ResultsValues[1]}"
  1171. MinWidth="50" />
  1172. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Y}" />
  1173. </DockPanel>
  1174. <TextBlock Grid.Row="3"
  1175. Text="{lex:Loc Z坐标}" />
  1176. <DockPanel Grid.Row="3"
  1177. Grid.Column="1"
  1178. LastChildFill="True">
  1179. <TextBlock Text="{Binding ResultsValues[2]}"
  1180. MinWidth="50" />
  1181. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Z}" />
  1182. </DockPanel>
  1183. <TextBlock Grid.Row="4"
  1184. Text="{lex:Loc U坐标}" />
  1185. <DockPanel Grid.Row="4"
  1186. Grid.Column="1"
  1187. LastChildFill="True">
  1188. <TextBlock Text="{Binding ResultsValues[3]}"
  1189. MinWidth="50" />
  1190. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.U}" />
  1191. </DockPanel>
  1192. <TextBlock Grid.Row="5"
  1193. Text="{lex:Loc 运动结束}" />
  1194. <DockPanel Grid.Row="5"
  1195. Grid.Column="1"
  1196. LastChildFill="True">
  1197. <TextBlock Text="{Binding ResultsValues[4]}"
  1198. MinWidth="50" />
  1199. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.MoveFinish}" />
  1200. </DockPanel>
  1201. <TextBlock Grid.Row="6"
  1202. Text="{lex:Loc 错误}" />
  1203. <DockPanel Grid.Row="6"
  1204. Grid.Column="1"
  1205. LastChildFill="True">
  1206. <TextBlock Text="{Binding ResultsValues[5]}"
  1207. MinWidth="50" />
  1208. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Error}" />
  1209. </DockPanel>
  1210. <TextBlock Grid.Row="7"
  1211. Text="{lex:Loc 吸真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1212. <DockPanel Grid.Row="7"
  1213. Grid.Column="1"
  1214. LastChildFill="True">
  1215. <TextBlock Text="{Binding ResultsValues[6]}"
  1216. MinWidth="50" />
  1217. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOn}" />
  1218. </DockPanel>
  1219. <TextBlock Grid.Row="8"
  1220. Text="{lex:Loc 破真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1221. <DockPanel Grid.Row="8"
  1222. Grid.Column="1"
  1223. LastChildFill="True">
  1224. <TextBlock Text="{Binding ResultsValues[7]}"
  1225. MinWidth="50" />
  1226. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOff}" />
  1227. </DockPanel>
  1228. <TextBlock Grid.Row="9"
  1229. FontWeight="Bold"
  1230. Text="{lex:Loc 命令参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  1231. <TextBlock Grid.Row="10"
  1232. Text="{lex:Loc X坐标}" />
  1233. <TextBox Grid.Row="10"
  1234. Grid.Column="1"
  1235. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.X}" />
  1236. <TextBlock Grid.Row="11"
  1237. Text="{lex:Loc Y坐标}" />
  1238. <TextBox Grid.Row="11"
  1239. Grid.Column="1"
  1240. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Y}" />
  1241. <TextBlock Grid.Row="12"
  1242. Text="{lex:Loc Z坐标}" />
  1243. <TextBox Grid.Row="12"
  1244. Grid.Column="1"
  1245. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Z}" />
  1246. <TextBlock Grid.Row="13"
  1247. Text="{lex:Loc U坐标}" />
  1248. <TextBox Grid.Row="13"
  1249. Grid.Column="1"
  1250. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.U}" />
  1251. <TextBlock Grid.Row="14"
  1252. Text="{lex:Loc 吸真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1253. <TextBox Grid.Row="14"
  1254. Grid.Column="1"
  1255. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOn}" />
  1256. <TextBlock Grid.Row="15"
  1257. Text="{lex:Loc 破真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1258. <TextBox Grid.Row="15"
  1259. Grid.Column="1"
  1260. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOff}" />
  1261. <TextBlock Grid.Row="16"
  1262. Text="{lex:Loc Z轴限高}" />
  1263. <TextBox Grid.Row="16"
  1264. Grid.Column="1"
  1265. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Limz}" />
  1266. <TextBlock Grid.Row="17"
  1267. Text="{lex:Loc 执行运动}" />
  1268. <TextBox Grid.Row="17"
  1269. Grid.Column="1"
  1270. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.ExecuteMove}" />
  1271. <TextBlock Grid.Row="18"
  1272. Text="{lex:Loc 吸真空}" />
  1273. <TextBox Grid.Row="18"
  1274. Grid.Column="1"
  1275. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOn}" />
  1276. <TextBlock Grid.Row="19"
  1277. Text="{lex:Loc 破真空}" />
  1278. <TextBox Grid.Row="19"
  1279. Grid.Column="1"
  1280. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOff}" />
  1281. <TextBlock Grid.Row="20"
  1282. Text="{lex:Loc 步进距离,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1283. <TextBox Grid.Row="20"
  1284. Grid.Column="1"
  1285. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Distance}" />
  1286. <TextBlock Grid.Row="21"
  1287. Text="{lex:Loc 点动命令,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1288. <TextBox Grid.Row="21"
  1289. Grid.Column="1"
  1290. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.JogCmd}" />
  1291. </Grid>
  1292. </ScrollViewer>-->
  1293. </Grid>
  1294. </ScrollViewer>
  1295. </Grid>
  1296. </TabItem>
  1297. <!-- Feeder -->
  1298. <TabItem>
  1299. <TabItem.Header>
  1300. <StackPanel HorizontalAlignment="Stretch">
  1301. <materialDesign:PackIcon
  1302. Width="24"
  1303. Height="24"
  1304. HorizontalAlignment="Center"
  1305. Kind="Vibrate" />
  1306. <TextBlock
  1307. HorizontalAlignment="Stretch"
  1308. FontSize="{DynamicResource Font.Size.Body2}"
  1309. Style="{StaticResource TabHeaderTextBlockStyle}"
  1310. Text="Feeder" />
  1311. </StackPanel>
  1312. </TabItem.Header>
  1313. <Grid Margin="16">
  1314. <Grid.RowDefinitions>
  1315. <RowDefinition Height="50" />
  1316. <RowDefinition Height="*" />
  1317. </Grid.RowDefinitions>
  1318. <Grid.ColumnDefinitions>
  1319. <ColumnDefinition Width="auto" />
  1320. <ColumnDefinition Width="*" />
  1321. </Grid.ColumnDefinitions>
  1322. <!-- 增删改查 -->
  1323. <StackPanel
  1324. Grid.ColumnSpan="2"
  1325. IsEnabled="{Binding IsAllowEdit}"
  1326. Orientation="Horizontal">
  1327. <Button
  1328. Command="{Binding AddFeederCommand}"
  1329. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1330. ToolTip="{lex:Loc 增加Feeder}">
  1331. <materialDesign:PackIcon Kind="Plus" />
  1332. </Button>
  1333. <Button
  1334. Margin="20,0"
  1335. Command="{Binding RemoveFeederCommand}"
  1336. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1337. ToolTip="{lex:Loc 移除Feeder}">
  1338. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1339. </Button>
  1340. <Button
  1341. Command="{Binding SaveFeedersCommand}"
  1342. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1343. ToolTip="{lex:Loc 保存}">
  1344. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1345. </Button>
  1346. </StackPanel>
  1347. <!-- Feeder列表 -->
  1348. <TreeView
  1349. Grid.Row="1"
  1350. Grid.Column="0"
  1351. SelectedItemChanged="TreeView_SelectedItemChanged">
  1352. <TreeViewItem
  1353. FontSize="{DynamicResource Font.Size.Title4}"
  1354. FontWeight="Bold"
  1355. Header="{lex:Loc Feeder列表}"
  1356. IsExpanded="True"
  1357. ItemsSource="{Binding FeederList}">
  1358. <TreeViewItem.ItemTemplate>
  1359. <HierarchicalDataTemplate>
  1360. <StackPanel Orientation="Vertical">
  1361. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  1362. <TextBlock.Text>
  1363. <MultiBinding StringFormat="{}{0}. {1}">
  1364. <Binding Path="FeederNo" />
  1365. <Binding Path="FeederName" />
  1366. </MultiBinding>
  1367. </TextBlock.Text>
  1368. </TextBlock>
  1369. <StackPanel Orientation="Horizontal">
  1370. <TextBlock
  1371. FontSize="{DynamicResource Font.Size.Captions3}"
  1372. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1373. Text="{lex:Loc 品牌,
  1374. Converter={StaticResource StringFormatConverter},
  1375. ConverterParameter='{}{0}: '}" />
  1376. <TextBlock
  1377. FontSize="{DynamicResource Font.Size.Captions3}"
  1378. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1379. Text="{Binding FeederBrand, Mode=TwoWay}" />
  1380. <TextBlock
  1381. Margin="10,0,0,0"
  1382. FontSize="{DynamicResource Font.Size.Captions3}"
  1383. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1384. Text="{lex:Loc 连接方式,
  1385. Converter={StaticResource StringFormatConverter},
  1386. ConverterParameter='{}{0}: '}" />
  1387. <TextBlock
  1388. FontSize="{DynamicResource Font.Size.Captions3}"
  1389. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1390. Text="{Binding ConnectType, Mode=TwoWay}" />
  1391. </StackPanel>
  1392. <StackPanel Orientation="Horizontal">
  1393. <TextBlock
  1394. FontSize="{DynamicResource Font.Size.Captions3}"
  1395. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1396. Text="{Binding IP, StringFormat=IP:{0}, Mode=TwoWay}" />
  1397. <TextBlock
  1398. Margin="10,0"
  1399. FontSize="{DynamicResource Font.Size.Captions3}"
  1400. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1401. Text="{Binding Port, StringFormat=Port:{0}, Mode=TwoWay}" />
  1402. </StackPanel>
  1403. <Border
  1404. Height="2"
  1405. Margin="0"
  1406. BorderBrush="Green"
  1407. BorderThickness="2" />
  1408. </StackPanel>
  1409. </HierarchicalDataTemplate>
  1410. </TreeViewItem.ItemTemplate>
  1411. </TreeViewItem>
  1412. </TreeView>
  1413. <!-- 参数详情 -->
  1414. <ScrollViewer
  1415. Grid.Row="1"
  1416. Grid.Column="1"
  1417. Margin="20"
  1418. HorizontalAlignment="Left"
  1419. VerticalAlignment="Top"
  1420. IsEnabled="{Binding IsAllowEdit}"
  1421. Visibility="{Binding SelectFeeder, Converter={StaticResource ObjectToVisibilityConverter}}">
  1422. <Grid Height="300">
  1423. <Grid.RowDefinitions>
  1424. <RowDefinition />
  1425. <RowDefinition />
  1426. <RowDefinition />
  1427. <RowDefinition />
  1428. <RowDefinition />
  1429. <RowDefinition />
  1430. <RowDefinition />
  1431. </Grid.RowDefinitions>
  1432. <Grid.ColumnDefinitions>
  1433. <ColumnDefinition Width="auto" />
  1434. <ColumnDefinition Width="*" />
  1435. </Grid.ColumnDefinitions>
  1436. <!-- id -->
  1437. <TextBlock
  1438. Grid.Row="0"
  1439. Grid.Column="0"
  1440. HorizontalAlignment="Right"
  1441. VerticalAlignment="Center"
  1442. FontSize="{DynamicResource Font.Size.Body3}"
  1443. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1444. Text="Id: " />
  1445. <TextBlock
  1446. x:Name="txt_Feeder_Id"
  1447. Grid.Row="0"
  1448. Grid.Column="1"
  1449. Margin="10,0"
  1450. HorizontalAlignment="Left"
  1451. VerticalAlignment="Center"
  1452. FontSize="{DynamicResource Font.Size.Body3}"
  1453. Text="{Binding SelectFeeder.Id, Mode=TwoWay}" />
  1454. <!-- 名称 -->
  1455. <TextBlock
  1456. Grid.Row="1"
  1457. Grid.Column="0"
  1458. HorizontalAlignment="Right"
  1459. VerticalAlignment="Center"
  1460. FontSize="{DynamicResource Font.Size.Body3}"
  1461. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1462. Text="{lex:Loc 名称,
  1463. Converter={StaticResource StringFormatConverter},
  1464. ConverterParameter='{}{0}: '}" />
  1465. <TextBox
  1466. Grid.Row="1"
  1467. Grid.Column="1"
  1468. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1469. MinWidth="80"
  1470. Margin="10,0"
  1471. HorizontalAlignment="Left"
  1472. VerticalAlignment="Center"
  1473. FontSize="{DynamicResource Font.Size.Body3}"
  1474. TextAlignment="Center">
  1475. <TextBox.Text>
  1476. <Binding Mode="TwoWay" Path="SelectFeeder.FeederName">
  1477. <Binding.ValidationRules>
  1478. <valRules:NameValidationRule />
  1479. </Binding.ValidationRules>
  1480. </Binding>
  1481. </TextBox.Text>
  1482. </TextBox>
  1483. <!-- Feeder品牌 -->
  1484. <TextBlock
  1485. Grid.Row="2"
  1486. Grid.Column="0"
  1487. HorizontalAlignment="Right"
  1488. VerticalAlignment="Center"
  1489. FontSize="{DynamicResource Font.Size.Body3}"
  1490. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1491. Text="{lex:Loc 品牌,
  1492. Converter={StaticResource StringFormatConverter},
  1493. ConverterParameter='{}{0}: '}" />
  1494. <ComboBox
  1495. Grid.Row="2"
  1496. Grid.Column="1"
  1497. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1498. MinWidth="80"
  1499. Margin="10,0"
  1500. HorizontalAlignment="Left"
  1501. VerticalAlignment="Center"
  1502. HorizontalContentAlignment="Center"
  1503. FontSize="{DynamicResource Font.Size.Body3}"
  1504. ItemsSource="{ext:EnumBindingSource EnumType=enums1:FeederBrand}"
  1505. SelectedItem="{Binding SelectFeeder.FeederBrand, Mode=TwoWay}" />
  1506. <!-- 通讯方式 -->
  1507. <TextBlock
  1508. Grid.Row="3"
  1509. Grid.Column="0"
  1510. HorizontalAlignment="Right"
  1511. VerticalAlignment="Center"
  1512. FontSize="{DynamicResource Font.Size.Body3}"
  1513. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1514. Text="{lex:Loc 通讯方式,
  1515. Converter={StaticResource StringFormatConverter},
  1516. ConverterParameter='{}{0}: '}" />
  1517. <ComboBox
  1518. Grid.Row="3"
  1519. Grid.Column="1"
  1520. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1521. MinWidth="80"
  1522. Margin="10,0"
  1523. HorizontalAlignment="Left"
  1524. VerticalAlignment="Center"
  1525. HorizontalContentAlignment="Center"
  1526. FontSize="{DynamicResource Font.Size.Body3}"
  1527. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  1528. SelectedItem="{Binding SelectFeeder.ConnectType, Mode=TwoWay}" />
  1529. <!-- IP地址 -->
  1530. <TextBlock
  1531. Grid.Row="4"
  1532. Grid.Column="0"
  1533. HorizontalAlignment="Right"
  1534. VerticalAlignment="Center"
  1535. FontSize="{DynamicResource Font.Size.Body3}"
  1536. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1537. Text="IP: " />
  1538. <TextBox
  1539. Grid.Row="4"
  1540. Grid.Column="1"
  1541. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1542. MinWidth="80"
  1543. Margin="10,0"
  1544. HorizontalAlignment="Left"
  1545. VerticalAlignment="Center"
  1546. FontSize="{DynamicResource Font.Size.Body3}"
  1547. TextAlignment="Center">
  1548. <TextBox.Text>
  1549. <Binding Mode="TwoWay" Path="SelectFeeder.IP">
  1550. <Binding.ValidationRules>
  1551. <valRules:IPValidationRule />
  1552. </Binding.ValidationRules>
  1553. </Binding>
  1554. </TextBox.Text>
  1555. </TextBox>
  1556. <!-- 端口号 -->
  1557. <TextBlock
  1558. Grid.Row="5"
  1559. Grid.Column="0"
  1560. HorizontalAlignment="Right"
  1561. VerticalAlignment="Center"
  1562. FontSize="{DynamicResource Font.Size.Body3}"
  1563. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1564. Text="Port: " />
  1565. <TextBox
  1566. Grid.Row="5"
  1567. Grid.Column="1"
  1568. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1569. MinWidth="80"
  1570. Margin="10,0"
  1571. HorizontalAlignment="Left"
  1572. VerticalAlignment="Center"
  1573. FontSize="{DynamicResource Font.Size.Body3}"
  1574. TextAlignment="Center">
  1575. <TextBox.Text>
  1576. <Binding Mode="TwoWay" Path="SelectFeeder.Port">
  1577. <Binding.ValidationRules>
  1578. <valRules:PortValidationRule />
  1579. </Binding.ValidationRules>
  1580. </Binding>
  1581. </TextBox.Text>
  1582. </TextBox>
  1583. </Grid>
  1584. </ScrollViewer>
  1585. </Grid>
  1586. </TabItem>
  1587. <!-- PLC -->
  1588. <TabItem>
  1589. <TabItem.Header>
  1590. <StackPanel HorizontalAlignment="Stretch">
  1591. <materialDesign:PackIcon
  1592. Width="24"
  1593. Height="24"
  1594. HorizontalAlignment="Center"
  1595. Kind="CellphoneLink" />
  1596. <TextBlock
  1597. HorizontalAlignment="Stretch"
  1598. FontSize="{DynamicResource Font.Size.Body2}"
  1599. Style="{StaticResource TabHeaderTextBlockStyle}"
  1600. Text="PLC" />
  1601. </StackPanel>
  1602. </TabItem.Header>
  1603. <Grid Margin="16">
  1604. <Grid.RowDefinitions>
  1605. <RowDefinition Height="50" />
  1606. <RowDefinition Height="*" />
  1607. </Grid.RowDefinitions>
  1608. <Grid.ColumnDefinitions>
  1609. <ColumnDefinition Width="auto" />
  1610. <ColumnDefinition Width="*" />
  1611. </Grid.ColumnDefinitions>
  1612. <!-- 增删改查 -->
  1613. <StackPanel
  1614. Grid.ColumnSpan="2"
  1615. IsEnabled="{Binding IsAllowEdit}"
  1616. Orientation="Horizontal">
  1617. <Button
  1618. Command="{Binding AddPlcCommand}"
  1619. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1620. ToolTip="{lex:Loc 增加PLC}">
  1621. <materialDesign:PackIcon Kind="Plus" />
  1622. </Button>
  1623. <Button
  1624. Margin="20,0"
  1625. Command="{Binding RemovePlcCommand}"
  1626. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1627. ToolTip="{lex:Loc 移除PLC}">
  1628. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1629. </Button>
  1630. <Button
  1631. Command="{Binding SavePlcsCommand}"
  1632. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1633. ToolTip="{lex:Loc 保存}">
  1634. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1635. </Button>
  1636. </StackPanel>
  1637. <!-- PLC列表 -->
  1638. <TreeView
  1639. Grid.Row="1"
  1640. Grid.Column="0"
  1641. SelectedItemChanged="TreeView_SelectedItemChanged">
  1642. <TreeViewItem
  1643. FontSize="{DynamicResource Font.Size.Title4}"
  1644. FontWeight="Bold"
  1645. Header="{lex:Loc PLC列表}"
  1646. IsExpanded="True"
  1647. ItemsSource="{Binding PlcList}">
  1648. <TreeViewItem.ItemTemplate>
  1649. <HierarchicalDataTemplate>
  1650. <StackPanel Orientation="Vertical">
  1651. <TextBlock FontSize="{DynamicResource Font.Size.Title4}" Text="{Binding Name, Mode=TwoWay}" />
  1652. <StackPanel Orientation="Horizontal">
  1653. <TextBlock
  1654. Margin="10,0,0,0"
  1655. FontSize="{DynamicResource Font.Size.Captions3}"
  1656. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1657. Text="{lex:Loc 连接方式,
  1658. Converter={StaticResource StringFormatConverter},
  1659. ConverterParameter='{}{0}: '}" />
  1660. <TextBlock
  1661. FontSize="{DynamicResource Font.Size.Captions3}"
  1662. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1663. Text="{Binding CommunicationType, Mode=TwoWay}" />
  1664. </StackPanel>
  1665. <StackPanel Orientation="Horizontal">
  1666. <TextBlock
  1667. FontSize="{DynamicResource Font.Size.Captions3}"
  1668. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1669. Text="{Binding EndpointUrl, StringFormat=Endpoint Url:{0}, Mode=TwoWay}" />
  1670. </StackPanel>
  1671. <Border
  1672. Height="2"
  1673. Margin="0"
  1674. BorderBrush="Green"
  1675. BorderThickness="2" />
  1676. </StackPanel>
  1677. </HierarchicalDataTemplate>
  1678. </TreeViewItem.ItemTemplate>
  1679. </TreeViewItem>
  1680. </TreeView>
  1681. <!-- 参数详情 -->
  1682. <ScrollViewer
  1683. Grid.Row="1"
  1684. Grid.Column="1"
  1685. Margin="20"
  1686. HorizontalAlignment="Left"
  1687. VerticalAlignment="Top"
  1688. IsEnabled="{Binding IsAllowEdit}"
  1689. Visibility="{Binding SelectPlc, Converter={StaticResource ObjectToVisibilityConverter}}">
  1690. <Grid Height="200">
  1691. <Grid.RowDefinitions>
  1692. <RowDefinition />
  1693. <RowDefinition />
  1694. <RowDefinition />
  1695. <RowDefinition />
  1696. <RowDefinition />
  1697. </Grid.RowDefinitions>
  1698. <Grid.ColumnDefinitions>
  1699. <ColumnDefinition Width="auto" />
  1700. <ColumnDefinition Width="*" />
  1701. </Grid.ColumnDefinitions>
  1702. <!-- id -->
  1703. <TextBlock
  1704. Grid.Row="0"
  1705. Grid.Column="0"
  1706. HorizontalAlignment="Right"
  1707. VerticalAlignment="Center"
  1708. FontSize="{DynamicResource Font.Size.Body3}"
  1709. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1710. Text="Id: " />
  1711. <TextBlock
  1712. x:Name="txt_plc_Id"
  1713. Grid.Row="0"
  1714. Grid.Column="1"
  1715. Margin="10,0"
  1716. HorizontalAlignment="Left"
  1717. VerticalAlignment="Center"
  1718. FontSize="{DynamicResource Font.Size.Body3}"
  1719. Text="{Binding SelectPlc.Id, Mode=TwoWay}" />
  1720. <!-- 名称 -->
  1721. <TextBlock
  1722. Grid.Row="1"
  1723. Grid.Column="0"
  1724. HorizontalAlignment="Right"
  1725. VerticalAlignment="Center"
  1726. FontSize="{DynamicResource Font.Size.Body3}"
  1727. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1728. Text="{lex:Loc 名称,
  1729. Converter={StaticResource StringFormatConverter},
  1730. ConverterParameter='{}{0}: '}" />
  1731. <TextBox
  1732. Grid.Row="1"
  1733. Grid.Column="1"
  1734. Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
  1735. MinWidth="80"
  1736. Margin="10,0"
  1737. HorizontalAlignment="Left"
  1738. VerticalAlignment="Center"
  1739. FontSize="{DynamicResource Font.Size.Body3}"
  1740. TextAlignment="Center">
  1741. <TextBox.Text>
  1742. <Binding Mode="TwoWay" Path="SelectPlc.Name">
  1743. <Binding.ValidationRules>
  1744. <valRules:NameValidationRule />
  1745. </Binding.ValidationRules>
  1746. </Binding>
  1747. </TextBox.Text>
  1748. </TextBox>
  1749. <!-- 通讯方式 -->
  1750. <TextBlock
  1751. Grid.Row="2"
  1752. Grid.Column="0"
  1753. HorizontalAlignment="Right"
  1754. VerticalAlignment="Center"
  1755. FontSize="{DynamicResource Font.Size.Body3}"
  1756. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1757. Text="{lex:Loc 通讯方式,
  1758. Converter={StaticResource StringFormatConverter},
  1759. ConverterParameter='{}{0}: '}" />
  1760. <ComboBox
  1761. Grid.Row="2"
  1762. Grid.Column="1"
  1763. Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
  1764. MinWidth="80"
  1765. Margin="10,0"
  1766. HorizontalAlignment="Left"
  1767. VerticalAlignment="Center"
  1768. HorizontalContentAlignment="Center"
  1769. FontSize="{DynamicResource Font.Size.Body3}"
  1770. ItemsSource="{ext:EnumBindingSource EnumType=enums:CommunicationType}"
  1771. SelectedItem="{Binding SelectPlc.CommunicationType, Mode=TwoWay}" />
  1772. <!-- Endpoint Url地址 -->
  1773. <TextBlock
  1774. Grid.Row="3"
  1775. Grid.Column="0"
  1776. HorizontalAlignment="Right"
  1777. VerticalAlignment="Center"
  1778. FontSize="{DynamicResource Font.Size.Body3}"
  1779. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1780. Text="Endpoints Url: " />
  1781. <TextBox
  1782. Grid.Row="3"
  1783. Grid.Column="1"
  1784. Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
  1785. MinWidth="80"
  1786. Margin="10,0"
  1787. HorizontalAlignment="Left"
  1788. VerticalAlignment="Center"
  1789. FontSize="{DynamicResource Font.Size.Body3}"
  1790. Text="{Binding SelectPlc.EndpointUrl}"
  1791. TextAlignment="Center" />
  1792. <!-- 节点头 -->
  1793. <TextBlock
  1794. Grid.Row="4"
  1795. Grid.Column="0"
  1796. HorizontalAlignment="Right"
  1797. VerticalAlignment="Center"
  1798. FontSize="{DynamicResource Font.Size.Body3}"
  1799. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1800. Text="{lex:Loc 节点头,
  1801. Converter={StaticResource StringFormatConverter},
  1802. ConverterParameter='{}{0}: '}" />
  1803. <TextBox
  1804. Grid.Row="4"
  1805. Grid.Column="1"
  1806. Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
  1807. MinWidth="80"
  1808. Margin="10,0"
  1809. HorizontalAlignment="Left"
  1810. VerticalAlignment="Center"
  1811. FontSize="{DynamicResource Font.Size.Body3}"
  1812. Text="{Binding SelectPlc.NodeHeader, Mode=TwoWay}"
  1813. TextAlignment="Center" />
  1814. </Grid>
  1815. </ScrollViewer>
  1816. </Grid>
  1817. </TabItem>
  1818. <!-- 光源控制器 -->
  1819. <TabItem>
  1820. <TabItem.Header>
  1821. <StackPanel HorizontalAlignment="Stretch">
  1822. <materialDesign:PackIcon
  1823. Width="24"
  1824. Height="24"
  1825. HorizontalAlignment="Center"
  1826. Kind="TelevisionAmbientLight" />
  1827. <TextBlock
  1828. HorizontalAlignment="Stretch"
  1829. FontSize="{DynamicResource Font.Size.Body2}"
  1830. Style="{StaticResource TabHeaderTextBlockStyle}"
  1831. Text="{lex:Loc 光源控制器}" />
  1832. </StackPanel>
  1833. </TabItem.Header>
  1834. <Grid Margin="16">
  1835. <Grid.RowDefinitions>
  1836. <RowDefinition Height="50" />
  1837. <RowDefinition Height="*" />
  1838. </Grid.RowDefinitions>
  1839. <Grid.ColumnDefinitions>
  1840. <ColumnDefinition Width="auto" />
  1841. <ColumnDefinition Width="*" />
  1842. </Grid.ColumnDefinitions>
  1843. <!-- 增删改查 -->
  1844. <StackPanel
  1845. Grid.ColumnSpan="2"
  1846. IsEnabled="{Binding IsAllowEdit}"
  1847. Orientation="Horizontal">
  1848. <Button
  1849. Command="{Binding AddLightControllerCommand}"
  1850. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1851. ToolTip="{lex:Loc 增加光源控制器}">
  1852. <materialDesign:PackIcon Kind="Plus" />
  1853. </Button>
  1854. <Button
  1855. Margin="20,0"
  1856. Command="{Binding RemoveLightControllerCommand}"
  1857. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1858. ToolTip="{lex:Loc 移除光源控制器}">
  1859. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1860. </Button>
  1861. <Button
  1862. Command="{Binding SaveLightControllersCommand}"
  1863. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1864. ToolTip="{lex:Loc 保存}">
  1865. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1866. </Button>
  1867. </StackPanel>
  1868. <!-- 控制器列表 -->
  1869. <TreeView
  1870. Grid.Row="1"
  1871. Grid.Column="0"
  1872. SelectedItemChanged="TreeView_SelectedItemChanged">
  1873. <TreeViewItem
  1874. FontSize="{DynamicResource Font.Size.Title4}"
  1875. FontWeight="Bold"
  1876. Header="{lex:Loc 光源控制器列表}"
  1877. IsExpanded="True"
  1878. ItemsSource="{Binding LightControllerList}">
  1879. <TreeViewItem.ItemTemplate>
  1880. <HierarchicalDataTemplate>
  1881. <StackPanel Orientation="Vertical">
  1882. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  1883. <TextBlock.Text>
  1884. <MultiBinding StringFormat="{}{0}. {1}">
  1885. <Binding Path="Id" />
  1886. <Binding Path="Name" />
  1887. </MultiBinding>
  1888. </TextBlock.Text>
  1889. </TextBlock>
  1890. <StackPanel Orientation="Horizontal">
  1891. <TextBlock
  1892. Margin="10,0,0,0"
  1893. FontSize="{DynamicResource Font.Size.Captions3}"
  1894. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1895. Text="{lex:Loc 型号,
  1896. Converter={StaticResource StringFormatConverter},
  1897. ConverterParameter='{}{0}: '}" />
  1898. <TextBlock
  1899. FontSize="{DynamicResource Font.Size.Captions3}"
  1900. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1901. Text="{Binding LightModel, Mode=TwoWay}" />
  1902. </StackPanel>
  1903. <StackPanel Orientation="Horizontal">
  1904. <TextBlock
  1905. Margin="10,0,0,0"
  1906. FontSize="{DynamicResource Font.Size.Captions3}"
  1907. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1908. Text="{lex:Loc 通道数,
  1909. Converter={StaticResource StringFormatConverter},
  1910. ConverterParameter='{}{0}: '}" />
  1911. <TextBlock
  1912. FontSize="{DynamicResource Font.Size.Captions3}"
  1913. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1914. Text="{Binding ChannelCount, Mode=TwoWay}" />
  1915. </StackPanel>
  1916. <Border
  1917. Height="2"
  1918. Margin="0"
  1919. BorderBrush="Green"
  1920. BorderThickness="2" />
  1921. </StackPanel>
  1922. </HierarchicalDataTemplate>
  1923. </TreeViewItem.ItemTemplate>
  1924. </TreeViewItem>
  1925. </TreeView>
  1926. <!-- 参数详情 -->
  1927. <ScrollViewer
  1928. Grid.Row="1"
  1929. Grid.Column="1"
  1930. Margin="20"
  1931. HorizontalAlignment="Left"
  1932. VerticalAlignment="Top"
  1933. IsEnabled="{Binding IsAllowEdit}"
  1934. Visibility="{Binding SelectLightController, Converter={StaticResource ObjectToVisibilityConverter}}">
  1935. <Grid>
  1936. <Grid.RowDefinitions>
  1937. <RowDefinition Height="Auto" />
  1938. <RowDefinition Height="Auto" />
  1939. <RowDefinition Height="Auto" />
  1940. <RowDefinition Height="Auto" />
  1941. <RowDefinition Height="Auto" />
  1942. <RowDefinition Height="*" />
  1943. </Grid.RowDefinitions>
  1944. <Grid.ColumnDefinitions>
  1945. <ColumnDefinition Width="auto" />
  1946. <ColumnDefinition Width="*" MinWidth="200" />
  1947. </Grid.ColumnDefinitions>
  1948. <!-- Id -->
  1949. <TextBlock
  1950. Grid.Row="0"
  1951. Grid.Column="0"
  1952. HorizontalAlignment="Right"
  1953. VerticalAlignment="Center"
  1954. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1955. Text="Id: " />
  1956. <TextBlock
  1957. Grid.Row="0"
  1958. Grid.Column="1"
  1959. Margin="10,0"
  1960. VerticalAlignment="Center"
  1961. Text="{Binding SelectLightController.Id}" />
  1962. <!-- Name -->
  1963. <TextBlock
  1964. Grid.Row="1"
  1965. Grid.Column="0"
  1966. HorizontalAlignment="Right"
  1967. VerticalAlignment="Center"
  1968. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1969. Text="{lex:Loc 名称,
  1970. Converter={StaticResource StringFormatConverter},
  1971. ConverterParameter='{}{0}: '}" />
  1972. <TextBox
  1973. Grid.Row="1"
  1974. Grid.Column="1"
  1975. Margin="10,0"
  1976. Text="{Binding SelectLightController.Name, Mode=TwoWay}" />
  1977. <!-- Model -->
  1978. <TextBlock
  1979. Grid.Row="2"
  1980. Grid.Column="0"
  1981. HorizontalAlignment="Right"
  1982. VerticalAlignment="Center"
  1983. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1984. Text="{lex:Loc 型号,
  1985. Converter={StaticResource StringFormatConverter},
  1986. ConverterParameter='{}{0}: '}" />
  1987. <ComboBox
  1988. Grid.Row="2"
  1989. Grid.Column="1"
  1990. Margin="10,0"
  1991. ItemsSource="{ext:EnumBindingSource EnumType=coreLights:LightModel}"
  1992. SelectedItem="{Binding SelectLightController.LightModel, Mode=TwoWay}">
  1993. <b:Interaction.Triggers>
  1994. <b:EventTrigger EventName="SelectionChanged">
  1995. <b:InvokeCommandAction Command="{Binding LightModelChangedCommand}" CommandParameter="{Binding SelectLightController}" />
  1996. </b:EventTrigger>
  1997. </b:Interaction.Triggers>
  1998. </ComboBox>
  1999. <!-- Channel count -->
  2000. <TextBlock
  2001. Grid.Row="3"
  2002. Grid.Column="0"
  2003. HorizontalAlignment="Right"
  2004. VerticalAlignment="Center"
  2005. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2006. Text="{lex:Loc 通道数,
  2007. Converter={StaticResource StringFormatConverter},
  2008. ConverterParameter='{}{0}: '}" />
  2009. <TextBox
  2010. Grid.Row="3"
  2011. Grid.Column="1"
  2012. Margin="10,0"
  2013. IsReadOnly="True"
  2014. Text="{Binding SelectLightController.ChannelCount, Mode=TwoWay}" />
  2015. <!-- Channel configs list -->
  2016. <TextBlock
  2017. Grid.Row="4"
  2018. Grid.Column="0"
  2019. HorizontalAlignment="Right"
  2020. VerticalAlignment="Top"
  2021. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2022. Text="{lex:Loc 通道配置}" />
  2023. <ItemsControl
  2024. Grid.Row="4"
  2025. Grid.Column="1"
  2026. Margin="10,0"
  2027. ItemsSource="{Binding SelectLightController.ChannelConfigs}">
  2028. <ItemsControl.ItemTemplate>
  2029. <DataTemplate>
  2030. <StackPanel Margin="0,4" Orientation="Horizontal">
  2031. <TextBlock
  2032. Width="30"
  2033. VerticalAlignment="Center"
  2034. Text="{Binding LocalIndex}" />
  2035. <TextBox
  2036. Width="180"
  2037. Margin="6,0"
  2038. Text="{Binding Name, Mode=TwoWay}" />
  2039. <TextBlock
  2040. Margin="6,0"
  2041. VerticalAlignment="Center"
  2042. Text="{lex:Loc 亮度}" />
  2043. <TextBox Width="80" Text="{Binding DefaultBrightness, Mode=TwoWay}" />
  2044. </StackPanel>
  2045. </DataTemplate>
  2046. </ItemsControl.ItemTemplate>
  2047. </ItemsControl>
  2048. <!-- Serial port config (visible for serial model) -->
  2049. <GroupBox
  2050. Grid.Row="5"
  2051. Grid.ColumnSpan="2"
  2052. Margin="0,12,0,0"
  2053. Header="{lex:Loc 串口配置}">
  2054. <GroupBox.Style>
  2055. <Style TargetType="GroupBox">
  2056. <Setter Property="Visibility" Value="Collapsed" />
  2057. <Style.Triggers>
  2058. <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
  2059. <Setter Property="Visibility" Value="Visible" />
  2060. </DataTrigger>
  2061. <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC3_24V300W_8T}">
  2062. <Setter Property="Visibility" Value="Visible" />
  2063. </DataTrigger>
  2064. </Style.Triggers>
  2065. </Style>
  2066. </GroupBox.Style>
  2067. <Grid Margin="10">
  2068. <Grid.ColumnDefinitions>
  2069. <ColumnDefinition Width="auto" />
  2070. <ColumnDefinition Width="*" />
  2071. </Grid.ColumnDefinitions>
  2072. <Grid.RowDefinitions>
  2073. <RowDefinition Height="Auto" />
  2074. <RowDefinition Height="Auto" />
  2075. <RowDefinition Height="Auto" />
  2076. <RowDefinition Height="Auto" />
  2077. <RowDefinition Height="Auto" />
  2078. </Grid.RowDefinitions>
  2079. <TextBlock
  2080. Grid.Row="0"
  2081. Grid.Column="0"
  2082. HorizontalAlignment="Right"
  2083. Text="PortName:" />
  2084. <TextBox
  2085. Grid.Row="0"
  2086. Grid.Column="1"
  2087. Margin="6,0"
  2088. Text="{Binding SelectLightController.SerialPortConfig.PortName, Mode=TwoWay}" />
  2089. <TextBlock
  2090. Grid.Row="1"
  2091. Grid.Column="0"
  2092. HorizontalAlignment="Right"
  2093. Text="BaudRate:" />
  2094. <TextBox
  2095. Grid.Row="1"
  2096. Grid.Column="1"
  2097. Margin="6,0"
  2098. Text="{Binding SelectLightController.SerialPortConfig.BaudRate, Mode=TwoWay}" />
  2099. <TextBlock
  2100. Grid.Row="2"
  2101. Grid.Column="0"
  2102. HorizontalAlignment="Right"
  2103. Text="Parity:" />
  2104. <ComboBox
  2105. Grid.Row="2"
  2106. Grid.Column="1"
  2107. ItemsSource="{Binding Source={StaticResource Parity}}"
  2108. SelectedItem="{Binding SelectLightController.SerialPortConfig.Parity, Mode=TwoWay}" />
  2109. <TextBlock
  2110. Grid.Row="3"
  2111. Grid.Column="0"
  2112. HorizontalAlignment="Right"
  2113. Text="StopBits:" />
  2114. <ComboBox
  2115. Grid.Row="3"
  2116. Grid.Column="1"
  2117. ItemsSource="{Binding Source={StaticResource StopBits}}"
  2118. SelectedItem="{Binding SelectLightController.SerialPortConfig.StopBits, Mode=TwoWay}" />
  2119. <TextBlock
  2120. Grid.Row="4"
  2121. Grid.Column="0"
  2122. HorizontalAlignment="Right"
  2123. Text="DataBits:" />
  2124. <TextBox
  2125. Grid.Row="4"
  2126. Grid.Column="1"
  2127. Margin="6,0"
  2128. Text="{Binding SelectLightController.SerialPortConfig.DataBits, Mode=TwoWay}" />
  2129. </Grid>
  2130. </GroupBox>
  2131. <!-- TCP config (visible for non-serial models) -->
  2132. <GroupBox
  2133. Grid.Row="5"
  2134. Grid.ColumnSpan="2"
  2135. Margin="0,12,0,0"
  2136. Header="{lex:Loc TCP配置}">
  2137. <GroupBox.Style>
  2138. <Style TargetType="GroupBox">
  2139. <Setter Property="Visibility" Value="Visible" />
  2140. <Style.Triggers>
  2141. <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
  2142. <Setter Property="Visibility" Value="Collapsed" />
  2143. </DataTrigger>
  2144. <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC3_24V300W_8T}">
  2145. <Setter Property="Visibility" Value="Collapsed" />
  2146. </DataTrigger>
  2147. </Style.Triggers>
  2148. </Style>
  2149. </GroupBox.Style>
  2150. <Grid Margin="10">
  2151. <Grid.ColumnDefinitions>
  2152. <ColumnDefinition Width="auto" />
  2153. <ColumnDefinition Width="*" />
  2154. </Grid.ColumnDefinitions>
  2155. <Grid.RowDefinitions>
  2156. <RowDefinition Height="Auto" />
  2157. <RowDefinition Height="Auto" />
  2158. </Grid.RowDefinitions>
  2159. <TextBlock
  2160. Grid.Row="0"
  2161. Grid.Column="0"
  2162. HorizontalAlignment="Right"
  2163. Text="IP:" />
  2164. <TextBox
  2165. Grid.Row="0"
  2166. Grid.Column="1"
  2167. Margin="6,0"
  2168. Text="{Binding SelectLightController.TcpConfig.IP, Mode=TwoWay}" />
  2169. <TextBlock
  2170. Grid.Row="1"
  2171. Grid.Column="0"
  2172. HorizontalAlignment="Right"
  2173. Text="Port:" />
  2174. <TextBox
  2175. Grid.Row="1"
  2176. Grid.Column="1"
  2177. Margin="6,0"
  2178. Text="{Binding SelectLightController.TcpConfig.Port, Mode=TwoWay}" />
  2179. </Grid>
  2180. </GroupBox>
  2181. </Grid>
  2182. </ScrollViewer>
  2183. </Grid>
  2184. </TabItem>
  2185. <!-- 螺丝供料器 -->
  2186. <TabItem>
  2187. <TabItem.Header>
  2188. <StackPanel HorizontalAlignment="Stretch">
  2189. <materialDesign:PackIcon
  2190. Width="24"
  2191. Height="24"
  2192. HorizontalAlignment="Center"
  2193. Kind="Screwdriver" />
  2194. <TextBlock
  2195. HorizontalAlignment="Stretch"
  2196. FontSize="{DynamicResource Font.Size.Body2}"
  2197. Style="{StaticResource TabHeaderTextBlockStyle}"
  2198. Text="{lex:Loc 螺丝供料器}" />
  2199. </StackPanel>
  2200. </TabItem.Header>
  2201. <Grid Margin="16">
  2202. <Grid.RowDefinitions>
  2203. <RowDefinition Height="50" />
  2204. <RowDefinition Height="*" />
  2205. </Grid.RowDefinitions>
  2206. <Grid.ColumnDefinitions>
  2207. <ColumnDefinition Width="auto" />
  2208. <ColumnDefinition Width="*" />
  2209. </Grid.ColumnDefinitions>
  2210. <!-- 增删改查 -->
  2211. <StackPanel
  2212. Grid.ColumnSpan="2"
  2213. IsEnabled="{Binding IsAllowEdit}"
  2214. Orientation="Horizontal">
  2215. <Button
  2216. Command="{Binding AddScrewFeederCommand}"
  2217. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  2218. ToolTip="{lex:Loc 增加螺丝供料器}">
  2219. <materialDesign:PackIcon Kind="Plus" />
  2220. </Button>
  2221. <Button
  2222. Margin="20,0"
  2223. Command="{Binding RemoveScrewFeederCommand}"
  2224. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  2225. ToolTip="{lex:Loc 移除螺丝供料器}">
  2226. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  2227. </Button>
  2228. <Button
  2229. Command="{Binding SaveScrewFeedersCommand}"
  2230. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  2231. ToolTip="{lex:Loc 保存}">
  2232. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  2233. </Button>
  2234. </StackPanel>
  2235. <!-- 螺丝供料器列表 -->
  2236. <TreeView
  2237. Grid.Row="1"
  2238. Grid.Column="0"
  2239. SelectedItemChanged="TreeView_SelectedItemChanged">
  2240. <TreeViewItem
  2241. FontSize="{DynamicResource Font.Size.Title4}"
  2242. FontWeight="Bold"
  2243. Header="{lex:Loc 螺丝供料器列表}"
  2244. IsExpanded="True"
  2245. ItemsSource="{Binding ScrewFeederList}">
  2246. <TreeViewItem.ItemTemplate>
  2247. <HierarchicalDataTemplate>
  2248. <StackPanel Orientation="Vertical">
  2249. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  2250. <TextBlock.Text>
  2251. <MultiBinding StringFormat="{}{0} . {1}">
  2252. <Binding Path="FeederNumber" />
  2253. <Binding Path="Name" />
  2254. </MultiBinding>
  2255. </TextBlock.Text>
  2256. </TextBlock>
  2257. <StackPanel Orientation="Horizontal">
  2258. <TextBlock
  2259. Margin="10,0,0,0"
  2260. FontSize="{DynamicResource Font.Size.Captions3}"
  2261. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2262. Text="{lex:Loc 每包螺丝的数量}" />
  2263. <TextBlock
  2264. FontSize="{DynamicResource Font.Size.Captions3}"
  2265. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2266. Text="{Binding PackSize, Mode=TwoWay}" />
  2267. </StackPanel>
  2268. <StackPanel Orientation="Horizontal">
  2269. <TextBlock
  2270. Margin="10,0,0,0"
  2271. FontSize="{DynamicResource Font.Size.Captions3}"
  2272. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2273. Text="{lex:Loc 低量报警阈值}" />
  2274. <TextBlock
  2275. FontSize="{DynamicResource Font.Size.Captions3}"
  2276. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2277. Text="{Binding LowLevelThreshold, Mode=TwoWay}" />
  2278. </StackPanel>
  2279. <StackPanel Orientation="Horizontal">
  2280. <TextBlock
  2281. Margin="10,0,0,0"
  2282. FontSize="{DynamicResource Font.Size.Captions3}"
  2283. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2284. Text="{lex:Loc 是否启用低量报警}" />
  2285. <CheckBox
  2286. FontSize="{DynamicResource Font.Size.Captions3}"
  2287. IsChecked="{Binding LowLevelAlarmEnabled, Mode=TwoWay}"
  2288. IsEnabled="False" />
  2289. </StackPanel>
  2290. <Border
  2291. Height="2"
  2292. Margin="0"
  2293. BorderBrush="Green"
  2294. BorderThickness="2" />
  2295. </StackPanel>
  2296. </HierarchicalDataTemplate>
  2297. </TreeViewItem.ItemTemplate>
  2298. </TreeViewItem>
  2299. </TreeView>
  2300. <!-- 参数详情 -->
  2301. <ScrollViewer
  2302. Grid.Row="1"
  2303. Grid.Column="1"
  2304. Margin="20"
  2305. HorizontalAlignment="Left"
  2306. VerticalAlignment="Top"
  2307. IsEnabled="{Binding IsAllowEdit}"
  2308. Visibility="{Binding SelectScrewFeeder, Converter={StaticResource ObjectToVisibilityConverter}}">
  2309. <Grid>
  2310. <Grid.RowDefinitions>
  2311. <RowDefinition Height="Auto" />
  2312. <RowDefinition Height="Auto" />
  2313. <RowDefinition Height="Auto" />
  2314. <RowDefinition Height="Auto" />
  2315. <RowDefinition Height="Auto" />
  2316. <RowDefinition Height="Auto" />
  2317. <RowDefinition Height="Auto" />
  2318. <RowDefinition Height="40" />
  2319. </Grid.RowDefinitions>
  2320. <Grid.ColumnDefinitions>
  2321. <ColumnDefinition Width="auto" />
  2322. <ColumnDefinition MinWidth="200" />
  2323. <ColumnDefinition Width="*" />
  2324. </Grid.ColumnDefinitions>
  2325. <!-- Id -->
  2326. <TextBlock
  2327. Grid.Row="0"
  2328. Grid.Column="0"
  2329. HorizontalAlignment="Right"
  2330. VerticalAlignment="Center"
  2331. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2332. Text="Id: " />
  2333. <TextBlock
  2334. Grid.Row="0"
  2335. Grid.Column="1"
  2336. Margin="10,0"
  2337. VerticalAlignment="Center"
  2338. Text="{Binding SelectScrewFeeder.Id}" />
  2339. <!-- Name -->
  2340. <TextBlock
  2341. Grid.Row="1"
  2342. Grid.Column="0"
  2343. HorizontalAlignment="Right"
  2344. VerticalAlignment="Center"
  2345. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2346. Text="{lex:Loc 名称,
  2347. Converter={StaticResource StringFormatConverter},
  2348. ConverterParameter='{}{0}: '}" />
  2349. <TextBox
  2350. Grid.Row="1"
  2351. Grid.Column="1"
  2352. Margin="10,0"
  2353. Text="{Binding SelectScrewFeeder.Name, Mode=TwoWay}" />
  2354. <!-- 供料器编号 -->
  2355. <!--<TextBlock Text="供料器编号:"
  2356. Grid.Row="2"
  2357. Grid.Column="0"
  2358. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2359. HorizontalAlignment="Right"
  2360. VerticalAlignment="Center" />
  2361. <TextBox Text="{Binding SelectScrewFeeder.FeederNumber,Mode=TwoWay}"
  2362. Grid.Row="2"
  2363. Grid.Column="1"
  2364. Margin="10,0"
  2365. Width="200"
  2366. TextAlignment="Center" />-->
  2367. <!-- 每包螺丝数量 -->
  2368. <TextBlock
  2369. Grid.Row="3"
  2370. Grid.Column="0"
  2371. HorizontalAlignment="Right"
  2372. VerticalAlignment="Center"
  2373. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2374. Text="{lex:Loc 每包螺丝数量}" />
  2375. <mah:NumericUpDown
  2376. Grid.Row="3"
  2377. Grid.Column="1"
  2378. MinWidth="200"
  2379. Margin="10,5"
  2380. FontSize="{DynamicResource Font.Size.Body3}"
  2381. Maximum="10000"
  2382. Minimum="0"
  2383. Value="{Binding SelectScrewFeeder.PackSize, Mode=TwoWay}" />
  2384. <!-- 低量报警阈值 -->
  2385. <TextBlock
  2386. Grid.Row="4"
  2387. Grid.Column="0"
  2388. HorizontalAlignment="Right"
  2389. VerticalAlignment="Center"
  2390. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2391. Text="{lex:Loc 低量报警阈值}" />
  2392. <mah:NumericUpDown
  2393. Grid.Row="4"
  2394. Grid.Column="1"
  2395. MinWidth="200"
  2396. Margin="10,0"
  2397. FontSize="{DynamicResource Font.Size.Body3}"
  2398. Maximum="10000"
  2399. Minimum="0"
  2400. Value="{Binding SelectScrewFeeder.LowLevelThreshold, Mode=TwoWay}" />
  2401. <!-- 是否启用低量报警 -->
  2402. <TextBlock
  2403. Grid.Row="5"
  2404. Grid.Column="0"
  2405. HorizontalAlignment="Right"
  2406. VerticalAlignment="Center"
  2407. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2408. Text="是否启用低量报警:" />
  2409. <CheckBox
  2410. Grid.Row="5"
  2411. Grid.Column="1"
  2412. Margin="10,5"
  2413. VerticalAlignment="Center"
  2414. IsChecked="{Binding SelectScrewFeeder.LowLevelAlarmEnabled, Mode=TwoWay}" />
  2415. </Grid>
  2416. </ScrollViewer>
  2417. </Grid>
  2418. </TabItem>
  2419. <!-- 通讯 -->
  2420. <TabItem>
  2421. <TabItem.Header>
  2422. <StackPanel HorizontalAlignment="Stretch">
  2423. <materialDesign:PackIcon
  2424. Width="24"
  2425. Height="24"
  2426. HorizontalAlignment="Center"
  2427. Kind="Lan" />
  2428. <TextBlock
  2429. HorizontalAlignment="Stretch"
  2430. FontSize="{DynamicResource Font.Size.Body2}"
  2431. Style="{StaticResource TabHeaderTextBlockStyle}"
  2432. Text="{lex:Loc 通讯}" />
  2433. </StackPanel>
  2434. </TabItem.Header>
  2435. <Grid Margin="20" IsEnabled="{Binding IsAllowEdit}">
  2436. <Grid.ColumnDefinitions>
  2437. <ColumnDefinition Width="auto" />
  2438. <ColumnDefinition Width="auto" />
  2439. </Grid.ColumnDefinitions>
  2440. <Grid.RowDefinitions>
  2441. <RowDefinition Height="auto" />
  2442. <RowDefinition Height=" auto" />
  2443. </Grid.RowDefinitions>
  2444. <Button
  2445. Width="60"
  2446. HorizontalAlignment="Left"
  2447. materialDesign:ButtonAssist.CornerRadius="10"
  2448. Command="{Binding SaveCommunicateCommand}"
  2449. CommandParameter="TCPIP"
  2450. Style="{StaticResource MaterialDesignRaisedButton}"
  2451. ToolTip="{lex:Loc 保存}">
  2452. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  2453. </Button>
  2454. <GroupBox
  2455. Grid.Row="1"
  2456. Margin="5,5"
  2457. FontSize="{DynamicResource Font.Size.Title4}"
  2458. Header="{lex:Loc 后台TCPIP服务器}">
  2459. <Grid Margin="20">
  2460. <Grid.ColumnDefinitions>
  2461. <ColumnDefinition Width="auto" />
  2462. <ColumnDefinition Width="auto" />
  2463. </Grid.ColumnDefinitions>
  2464. <Grid.RowDefinitions>
  2465. <RowDefinition Height="auto" />
  2466. <RowDefinition Height=" auto" />
  2467. <RowDefinition Height=" auto" />
  2468. </Grid.RowDefinitions>
  2469. <!-- port -->
  2470. <TextBlock
  2471. Margin="0,0,0,8"
  2472. HorizontalAlignment="Right"
  2473. VerticalAlignment="Center"
  2474. FontSize="{DynamicResource Font.Size.Body3}"
  2475. Text="Port: " />
  2476. <TextBox
  2477. Grid.Row="0"
  2478. Grid.Column="1"
  2479. MinWidth="80"
  2480. Margin="10,4"
  2481. HorizontalAlignment="Left"
  2482. VerticalAlignment="Center"
  2483. FontSize="{DynamicResource Font.Size.Body3}"
  2484. TextAlignment="Center">
  2485. <TextBox.Text>
  2486. <Binding Mode="TwoWay" Path="BgTcp.Port">
  2487. <Binding.ValidationRules>
  2488. <valRules:PortValidationRule />
  2489. </Binding.ValidationRules>
  2490. </Binding>
  2491. </TextBox.Text>
  2492. </TextBox>
  2493. <!-- 结束符 -->
  2494. <TextBlock
  2495. Grid.Row="1"
  2496. Margin="0,0,0,8"
  2497. HorizontalAlignment="Right"
  2498. VerticalAlignment="Center"
  2499. FontSize="{DynamicResource Font.Size.Body3}"
  2500. Text="{lex:Loc 结束符,
  2501. Converter={StaticResource StringFormatConverter},
  2502. ConverterParameter='{}{0}: '}" />
  2503. <ComboBox
  2504. Grid.Row="1"
  2505. Grid.Column="1"
  2506. MinWidth="80"
  2507. Margin="10,4"
  2508. HorizontalAlignment="Left"
  2509. VerticalAlignment="Center"
  2510. HorizontalContentAlignment="Center"
  2511. FontSize="{DynamicResource Font.Size.Body3}"
  2512. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  2513. SelectedItem="{Binding BgTcp.Terminator, Mode=TwoWay}" />
  2514. <!-- 编码格式 -->
  2515. <TextBlock
  2516. Grid.Row="2"
  2517. Grid.Column="0"
  2518. HorizontalAlignment="Right"
  2519. VerticalAlignment="Center"
  2520. FontSize="{DynamicResource Font.Size.Body3}"
  2521. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2522. Text="{lex:Loc 编码解码,
  2523. Converter={StaticResource StringFormatConverter},
  2524. ConverterParameter='{}{0}: '}" />
  2525. <ComboBox
  2526. Grid.Row="2"
  2527. Grid.Column="1"
  2528. MinWidth="80"
  2529. Margin="10,4"
  2530. HorizontalAlignment="Left"
  2531. VerticalAlignment="Center"
  2532. HorizontalContentAlignment="Center"
  2533. FontSize="{DynamicResource Font.Size.Body3}"
  2534. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  2535. SelectedItem="{Binding BgTcp.DataEncoding, Mode=TwoWay}" />
  2536. </Grid>
  2537. </GroupBox>
  2538. <Button
  2539. Grid.Column="1"
  2540. Width="60"
  2541. HorizontalAlignment="Left"
  2542. materialDesign:ButtonAssist.CornerRadius="10"
  2543. Command="{Binding SaveCommunicateCommand}"
  2544. CommandParameter="ModbusTCP"
  2545. Style="{StaticResource MaterialDesignRaisedButton}"
  2546. ToolTip="{lex:Loc 保存}">
  2547. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  2548. </Button>
  2549. <materialDesign:PopupBox
  2550. Grid.Column="1"
  2551. HorizontalAlignment="Right"
  2552. VerticalAlignment="Center">
  2553. <StackPanel Margin="10" Orientation="Vertical">
  2554. <TextBlock
  2555. Text="功能码 1 ReadCoils 读取DO的状态"
  2556. TextAlignment="Left"
  2557. TextWrapping="Wrap" />
  2558. <TextBlock
  2559. Text="功能码 2 ReadInputs 读取DI的状态"
  2560. TextAlignment="Left"
  2561. TextWrapping="Wrap" />
  2562. <TextBlock
  2563. Text="功能码 3 ReadHoldingRegisters 读取AO的值"
  2564. TextAlignment="Left"
  2565. TextWrapping="Wrap" />
  2566. <TextBlock
  2567. Text="功能码 4 ReadInputRegisters 读取AI的值"
  2568. TextAlignment="Left"
  2569. TextWrapping="Wrap" />
  2570. <TextBlock
  2571. Text="功能码 5 WriteSingleCoil 写入值到DO"
  2572. TextAlignment="Left"
  2573. TextWrapping="Wrap" />
  2574. <TextBlock
  2575. Text="功能码 6 WriteSingleRegister 写入值到AO"
  2576. TextAlignment="Left"
  2577. TextWrapping="Wrap" />
  2578. <TextBlock
  2579. Text="功能码 15 WriteMultipleCoils 写多线圈寄存器"
  2580. TextAlignment="Left"
  2581. TextWrapping="Wrap" />
  2582. <TextBlock
  2583. Text="功能码 16 WriteMultipleRegisters 写多个保持寄存器"
  2584. TextAlignment="Left"
  2585. TextWrapping="Wrap" />
  2586. <TextBlock
  2587. Text="功能码 23 ReadWriteMultipleRegisters 读写多个保持寄存器"
  2588. TextAlignment="Left"
  2589. TextWrapping="Wrap" />
  2590. </StackPanel>
  2591. </materialDesign:PopupBox>
  2592. <GroupBox
  2593. Grid.Row="1"
  2594. Grid.Column="1"
  2595. Margin="5,5"
  2596. FontSize="{DynamicResource Font.Size.Title4}"
  2597. Header="{lex:Loc 后台ModbusTCPSlave}">
  2598. <Grid Margin="20">
  2599. <Grid.ColumnDefinitions>
  2600. <ColumnDefinition Width="auto" />
  2601. <ColumnDefinition Width="auto" />
  2602. </Grid.ColumnDefinitions>
  2603. <Grid.RowDefinitions>
  2604. <RowDefinition Height="auto" />
  2605. <RowDefinition Height=" auto" />
  2606. <RowDefinition Height=" auto" />
  2607. <RowDefinition Height=" auto" />
  2608. </Grid.RowDefinitions>
  2609. <!-- IP -->
  2610. <TextBlock
  2611. Margin="0,0,0,8"
  2612. HorizontalAlignment="Right"
  2613. VerticalAlignment="Center"
  2614. FontSize="{DynamicResource Font.Size.Body3}"
  2615. Text="IP: " />
  2616. <TextBox
  2617. Grid.Row="0"
  2618. Grid.Column="1"
  2619. MinWidth="80"
  2620. Margin="10,4"
  2621. HorizontalAlignment="Left"
  2622. VerticalAlignment="Center"
  2623. FontSize="{DynamicResource Font.Size.Body3}"
  2624. Text="{Binding BgModbus.IP, Mode=TwoWay}"
  2625. TextAlignment="Center" />
  2626. <!-- port -->
  2627. <TextBlock
  2628. Grid.Row="1"
  2629. Margin="0,0,0,8"
  2630. HorizontalAlignment="Right"
  2631. VerticalAlignment="Center"
  2632. FontSize="{DynamicResource Font.Size.Body3}"
  2633. Text="Port: " />
  2634. <TextBox
  2635. Grid.Row="1"
  2636. Grid.Column="1"
  2637. MinWidth="80"
  2638. Margin="10,4"
  2639. HorizontalAlignment="Left"
  2640. VerticalAlignment="Center"
  2641. FontSize="{DynamicResource Font.Size.Body3}"
  2642. Text="{Binding BgModbus.Port, Mode=TwoWay}"
  2643. TextAlignment="Center" />
  2644. <!-- SlaveID -->
  2645. <TextBlock
  2646. Grid.Row="2"
  2647. Margin="0,0,0,8"
  2648. HorizontalAlignment="Right"
  2649. VerticalAlignment="Center"
  2650. FontSize="{DynamicResource Font.Size.Body3}"
  2651. Text="SlaveID: " />
  2652. <TextBox
  2653. Grid.Row="2"
  2654. Grid.Column="1"
  2655. MinWidth="80"
  2656. Margin="10,4"
  2657. HorizontalAlignment="Left"
  2658. VerticalAlignment="Center"
  2659. FontSize="{DynamicResource Font.Size.Body3}"
  2660. Text="{Binding BgModbus.SlaveID, Mode=TwoWay}"
  2661. TextAlignment="Center" />
  2662. <!-- 是否启用 -->
  2663. <TextBlock
  2664. Grid.Row="3"
  2665. Margin="0,0,0,8"
  2666. HorizontalAlignment="Right"
  2667. VerticalAlignment="Center"
  2668. FontSize="{DynamicResource Font.Size.Body3}"
  2669. Text="{lex:Loc 是否启用,
  2670. Converter={StaticResource StringFormatConverter},
  2671. ConverterParameter='{}{0}: '}" />
  2672. <ToggleButton
  2673. Grid.Row="3"
  2674. Grid.Column="1"
  2675. MinWidth="80"
  2676. Margin="10,4"
  2677. HorizontalAlignment="Left"
  2678. VerticalAlignment="Center"
  2679. HorizontalContentAlignment="Center"
  2680. IsChecked="{Binding BgModbus.IsEnabled, Mode=TwoWay}" />
  2681. </Grid>
  2682. </GroupBox>
  2683. </Grid>
  2684. </TabItem>
  2685. <!-- 系统参数 -->
  2686. <TabItem>
  2687. <TabItem.Header>
  2688. <StackPanel HorizontalAlignment="Stretch">
  2689. <materialDesign:PackIcon
  2690. Width="24"
  2691. Height="24"
  2692. HorizontalAlignment="Center"
  2693. Kind="CellphoneSystemUpdate" />
  2694. <TextBlock
  2695. HorizontalAlignment="Stretch"
  2696. FontSize="{DynamicResource Font.Size.Body2}"
  2697. Style="{StaticResource TabHeaderTextBlockStyle}"
  2698. Text="{lex:Loc 系统参数}" />
  2699. </StackPanel>
  2700. </TabItem.Header>
  2701. <StackPanel Margin="20" Orientation="Vertical">
  2702. <Grid>
  2703. <Grid.RowDefinitions>
  2704. <RowDefinition Height="Auto" />
  2705. <RowDefinition Height="16" />
  2706. <RowDefinition Height="Auto" />
  2707. <RowDefinition Height="20" />
  2708. <RowDefinition Height="Auto" />
  2709. </Grid.RowDefinitions>
  2710. <Grid Margin="16">
  2711. <Grid.ColumnDefinitions>
  2712. <ColumnDefinition Width="220" />
  2713. <ColumnDefinition Width="260" />
  2714. <ColumnDefinition Width="*" />
  2715. </Grid.ColumnDefinitions>
  2716. <Grid.RowDefinitions>
  2717. <RowDefinition Height="Auto" />
  2718. <RowDefinition Height="Auto" />
  2719. <RowDefinition Height="Auto" />
  2720. <RowDefinition Height="Auto" />
  2721. <RowDefinition Height="Auto" />
  2722. <RowDefinition Height="Auto" />
  2723. <RowDefinition Height="Auto" />
  2724. <RowDefinition Height="Auto" />
  2725. <RowDefinition Height="Auto" />
  2726. <RowDefinition Height="Auto" />
  2727. <RowDefinition Height="Auto" />
  2728. <RowDefinition Height="Auto" />
  2729. </Grid.RowDefinitions>
  2730. <!-- 下相机拍照次数 -->
  2731. <TextBlock
  2732. Grid.Row="0"
  2733. Grid.Column="0"
  2734. Margin="0,8,12,8"
  2735. VerticalAlignment="Center"
  2736. Text="{lex:Loc 下相机拍照次数}" />
  2737. <mah:NumericUpDown
  2738. Grid.Row="0"
  2739. Grid.Column="1"
  2740. Margin="0,6"
  2741. FontSize="{DynamicResource Font.Size.Body3}"
  2742. Maximum="100"
  2743. Minimum="0"
  2744. Value="{Binding DowmCameraNum, Mode=TwoWay}" />
  2745. <!-- 上相机取料拍照次数 -->
  2746. <TextBlock
  2747. Grid.Row="1"
  2748. Grid.Column="0"
  2749. Margin="0,8,12,8"
  2750. VerticalAlignment="Center"
  2751. Text="{lex:Loc 上相机取料拍照次数}" />
  2752. <mah:NumericUpDown
  2753. Grid.Row="1"
  2754. Grid.Column="1"
  2755. Margin="0,6"
  2756. FontSize="{DynamicResource Font.Size.Body3}"
  2757. Maximum="100"
  2758. Minimum="0"
  2759. Value="{Binding UpCameraPickNum, Mode=TwoWay}" />
  2760. <!-- 上相机放料拍照次数 -->
  2761. <TextBlock
  2762. Grid.Row="2"
  2763. Grid.Column="0"
  2764. Margin="0,8,12,8"
  2765. VerticalAlignment="Center"
  2766. Text="{lex:Loc 上相机放料拍照次数}" />
  2767. <mah:NumericUpDown
  2768. Grid.Row="2"
  2769. Grid.Column="1"
  2770. Margin="0,6"
  2771. FontSize="{DynamicResource Font.Size.Body3}"
  2772. Maximum="100"
  2773. Minimum="0"
  2774. Value="{Binding UpCameraPutNum, Mode=TwoWay}" />
  2775. <!-- 上相机锁附/组装次数(复检) -->
  2776. <TextBlock
  2777. Grid.Row="3"
  2778. Grid.Column="0"
  2779. Margin="0,8,12,8"
  2780. VerticalAlignment="Center"
  2781. Text="上相机锁附/组装次数(复检)" />
  2782. <mah:NumericUpDown
  2783. Grid.Row="3"
  2784. Grid.Column="1"
  2785. Margin="0,6"
  2786. FontSize="{DynamicResource Font.Size.Body3}"
  2787. Maximum="100"
  2788. Minimum="0"
  2789. Value="{Binding UPCameracheckNum, Mode=TwoWay}" />
  2790. <!-- 取料固定位置拍产品相机数量 -->
  2791. <TextBlock
  2792. Grid.Row="4"
  2793. Grid.Column="0"
  2794. Margin="0,8,12,8"
  2795. VerticalAlignment="Center"
  2796. Text="{lex:Loc 取料固定位置拍产品相机数量}" />
  2797. <mah:NumericUpDown
  2798. Grid.Row="4"
  2799. Grid.Column="1"
  2800. Margin="0,6"
  2801. FontSize="{DynamicResource Font.Size.Body3}"
  2802. Maximum="10"
  2803. Minimum="0"
  2804. Value="{Binding FixedCameraPickNum, Mode=TwoWay}" />
  2805. <!-- 锁附/组装固定位置拍产品相机数量 -->
  2806. <TextBlock
  2807. Grid.Row="5"
  2808. Grid.Column="0"
  2809. Margin="0,8,12,8"
  2810. VerticalAlignment="Center"
  2811. Text="{lex:Loc 锁附组装固定位置拍产品相机数量}" />
  2812. <mah:NumericUpDown
  2813. Grid.Row="5"
  2814. Grid.Column="1"
  2815. Margin="0,6"
  2816. FontSize="{DynamicResource Font.Size.Body3}"
  2817. Maximum="10"
  2818. Minimum="0"
  2819. Value="{Binding FixedCameraPutNum, Mode=TwoWay}" />
  2820. <!-- 固定相机检测锁附/组装次数 -->
  2821. <TextBlock
  2822. Grid.Row="6"
  2823. Grid.Column="0"
  2824. Margin="0,8,12,8"
  2825. VerticalAlignment="Center"
  2826. Text="{lex:Loc 固定相机检测锁附组装次数}" />
  2827. <mah:NumericUpDown
  2828. Grid.Row="6"
  2829. Grid.Column="1"
  2830. Margin="0,6"
  2831. FontSize="{DynamicResource Font.Size.Body3}"
  2832. Maximum="100"
  2833. Minimum="0"
  2834. Value="{Binding FixedCameracheckNum, Mode=TwoWay}" />
  2835. <!-- 工作模式 -->
  2836. <TextBlock
  2837. Grid.Row="7"
  2838. Grid.Column="0"
  2839. Margin="0,8,12,8"
  2840. VerticalAlignment="Center"
  2841. Text="{lex:Loc 工作模式}" />
  2842. <mah:NumericUpDown
  2843. Grid.Row="7"
  2844. Grid.Column="1"
  2845. Margin="0,6"
  2846. materialDesign:HintAssist.HelperText="1:拍1打1 2:拍1打所有"
  2847. materialDesign:HintAssist.HelperTextFontSize="10"
  2848. FontSize="{DynamicResource Font.Size.Body3}"
  2849. Maximum="100"
  2850. Minimum="0"
  2851. Value="{Binding WorkMode, Mode=TwoWay}" />
  2852. <!-- 取料位置 -->
  2853. <TextBlock
  2854. Grid.Row="8"
  2855. Grid.Column="0"
  2856. Margin="0,8,12,8"
  2857. VerticalAlignment="Center"
  2858. Text="{lex:Loc 取料位置}" />
  2859. <mah:NumericUpDown
  2860. Grid.Row="8"
  2861. Grid.Column="1"
  2862. Margin="0,6"
  2863. materialDesign:HintAssist.HelperText="0:不需要取料 1:需要取料"
  2864. materialDesign:HintAssist.HelperTextFontSize="10"
  2865. FontSize="{DynamicResource Font.Size.Body3}"
  2866. Maximum="100"
  2867. Minimum="0"
  2868. Value="{Binding PickPointNum, Mode=TwoWay}" />
  2869. <!-- 批头矫正模式 -->
  2870. <TextBlock
  2871. Grid.Row="9"
  2872. Grid.Column="0"
  2873. Margin="0,8,12,8"
  2874. VerticalAlignment="Center"
  2875. Text="批头矫正模式" />
  2876. <mah:NumericUpDown
  2877. Grid.Row="9"
  2878. Grid.Column="1"
  2879. Margin="0,6"
  2880. materialDesign:HintAssist.HelperText="1:初始化时矫正 2:每个产品矫正一次 3:每颗螺丝矫正一次"
  2881. materialDesign:HintAssist.HelperTextFontSize="10"
  2882. FontSize="{DynamicResource Font.Size.Body3}"
  2883. Maximum="100"
  2884. Minimum="0"
  2885. ToolTip="1:初始化时矫正,2:每个产品矫正一次,3:每颗螺丝矫正一次"
  2886. Value="{Binding ScrewTeachNum, Mode=TwoWay}" />
  2887. <!-- 保存锁付曲线 -->
  2888. <TextBlock
  2889. Grid.Row="10"
  2890. Grid.Column="0"
  2891. Margin="0,8,12,8"
  2892. VerticalAlignment="Center"
  2893. Text="锁付曲线图保存" />
  2894. <Grid
  2895. Grid.Row="10"
  2896. Grid.Column="1"
  2897. Grid.ColumnSpan="2"
  2898. Margin="0,6,0,6">
  2899. <Grid.ColumnDefinitions>
  2900. <ColumnDefinition Width="Auto" />
  2901. <ColumnDefinition Width="12" />
  2902. <ColumnDefinition Width="*" />
  2903. <ColumnDefinition Width="Auto" />
  2904. </Grid.ColumnDefinitions>
  2905. <CheckBox
  2906. Grid.Column="0"
  2907. VerticalAlignment="Center"
  2908. Content="启用保存锁付曲线图"
  2909. FontSize="{DynamicResource Font.Size.Body3}"
  2910. IsChecked="{Binding IsSaveScrewCurve, Mode=TwoWay}" />
  2911. <TextBox
  2912. Grid.Column="2"
  2913. MinWidth="260"
  2914. VerticalAlignment="Center"
  2915. IsEnabled="{Binding IsSaveScrewCurve}"
  2916. Text="{Binding ScrewCurvePath, Mode=TwoWay}" />
  2917. <Button
  2918. Grid.Column="3"
  2919. Margin="8,0,0,0"
  2920. VerticalAlignment="Center"
  2921. Command="{Binding BrowseScrewCurvePathCommand}"
  2922. IsEnabled="{Binding IsSaveScrewCurve}"
  2923. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}">
  2924. <materialDesign:PackIcon Kind="FolderOpen" />
  2925. </Button>
  2926. </Grid>
  2927. <!-- 扫码流程设置 -->
  2928. <TextBlock
  2929. Grid.Row="11"
  2930. Grid.Column="0"
  2931. Margin="0,8,12,8"
  2932. VerticalAlignment="Top"
  2933. Text="扫码流程设置" />
  2934. <StackPanel
  2935. Grid.Row="11"
  2936. Grid.Column="1"
  2937. Grid.ColumnSpan="2"
  2938. Margin="0,6,0,0"
  2939. Orientation="Vertical">
  2940. <WrapPanel Margin="0,0,0,8">
  2941. <CheckBox
  2942. Margin="0,0,20,8"
  2943. Content="是否启用最后一次拍照关闭光源"
  2944. FontSize="{DynamicResource Font.Size.Body3}"
  2945. IsChecked="{Binding IsBasePartOpenLight, Mode=TwoWay}" />
  2946. <CheckBox
  2947. Margin="0,0,20,8"
  2948. Content="是否启用KB复检"
  2949. FontSize="{DynamicResource Font.Size.Body3}"
  2950. IsChecked="{Binding IsBasePartOpenLightKB, Mode=TwoWay}" />
  2951. <CheckBox
  2952. Margin="0,0,20,8"
  2953. Content="是否MES结果为1"
  2954. FontSize="{DynamicResource Font.Size.Body3}"
  2955. IsChecked="{Binding IsMesResult, Mode=TwoWay}" />
  2956. </WrapPanel>
  2957. <WrapPanel Margin="0,0,0,8">
  2958. <CheckBox
  2959. Margin="0,0,20,8"
  2960. Content="是否基于零件码获取流程码"
  2961. FontSize="{DynamicResource Font.Size.Body3}"
  2962. IsChecked="{Binding IsBasePartCodeGetSN, Mode=TwoWay}" />
  2963. <CheckBox
  2964. Margin="0,0,20,8"
  2965. Content="是否通过零件码判断螺丝型号"
  2966. FontSize="{DynamicResource Font.Size.Body3}"
  2967. IsChecked="{Binding IsBasePartCodeChooseScrew, Mode=TwoWay}" />
  2968. </WrapPanel>
  2969. <TextBox
  2970. Width="320"
  2971. HorizontalAlignment="Left"
  2972. materialDesign:HintAssist.Hint="螺丝型号匹配规则"
  2973. BorderThickness="1"
  2974. Text="{Binding ChooseScrewModel, Mode=TwoWay}"
  2975. ToolTip="螺丝型号判断,如******123**,*为忽略字符" />
  2976. </StackPanel>
  2977. </Grid>
  2978. <!-- 保存系统参数 -->
  2979. <DockPanel Grid.Row="2" LastChildFill="False">
  2980. <Button
  2981. Height="40"
  2982. MinWidth="150"
  2983. HorizontalAlignment="Right"
  2984. materialDesign:ButtonAssist.CornerRadius="10"
  2985. Command="{Binding SaveSystemParametersCommand}"
  2986. DockPanel.Dock="Right"
  2987. IsEnabled="{Binding IsAllowEdit}"
  2988. Style="{StaticResource MaterialDesignRaisedButton}">
  2989. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  2990. <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
  2991. <TextBlock VerticalAlignment="Center" Text="{lex:Loc 保存系统参数}" />
  2992. </StackPanel>
  2993. </Button>
  2994. </DockPanel>
  2995. <StackPanel
  2996. Grid.Row="5"
  2997. Margin="0,12,0,0"
  2998. Orientation="Horizontal">
  2999. <!-- 刷卡参数配置 -->
  3000. <GroupBox
  3001. Width="280"
  3002. Margin="0,0,50,0"
  3003. HorizontalAlignment="Left"
  3004. Header="刷卡器配置">
  3005. <Grid Margin="10">
  3006. <Grid.ColumnDefinitions>
  3007. <ColumnDefinition Width="auto" />
  3008. <ColumnDefinition Width="*" />
  3009. </Grid.ColumnDefinitions>
  3010. <Grid.RowDefinitions>
  3011. <RowDefinition Height="Auto" />
  3012. <RowDefinition Height="Auto" />
  3013. <RowDefinition Height="Auto" />
  3014. <RowDefinition Height="Auto" />
  3015. <RowDefinition Height="Auto" />
  3016. <RowDefinition Height="Auto" />
  3017. </Grid.RowDefinitions>
  3018. <TextBlock
  3019. Grid.Row="0"
  3020. Grid.Column="0"
  3021. HorizontalAlignment="Right"
  3022. Text="PortName:" />
  3023. <TextBox
  3024. Grid.Row="0"
  3025. Grid.Column="1"
  3026. Margin="6,0"
  3027. Text="{Binding CardReaderConfig.PortName, Mode=TwoWay}" />
  3028. <TextBlock
  3029. Grid.Row="1"
  3030. Grid.Column="0"
  3031. HorizontalAlignment="Right"
  3032. Text="BaudRate:" />
  3033. <TextBox
  3034. Grid.Row="1"
  3035. Grid.Column="1"
  3036. Margin="6,0"
  3037. Text="{Binding CardReaderConfig.BaudRate, Mode=TwoWay}" />
  3038. <TextBlock
  3039. Grid.Row="2"
  3040. Grid.Column="0"
  3041. HorizontalAlignment="Right"
  3042. Text="Parity:" />
  3043. <ComboBox
  3044. Grid.Row="2"
  3045. Grid.Column="1"
  3046. ItemsSource="{Binding Source={StaticResource Parity}}"
  3047. SelectedItem="{Binding CardReaderConfig.Parity, Mode=TwoWay}" />
  3048. <TextBlock
  3049. Grid.Row="3"
  3050. Grid.Column="0"
  3051. HorizontalAlignment="Right"
  3052. Text="StopBits:" />
  3053. <ComboBox
  3054. Grid.Row="3"
  3055. Grid.Column="1"
  3056. ItemsSource="{Binding Source={StaticResource StopBits}}"
  3057. SelectedItem="{Binding CardReaderConfig.StopBits, Mode=TwoWay}" />
  3058. <TextBlock
  3059. Grid.Row="4"
  3060. Grid.Column="0"
  3061. HorizontalAlignment="Right"
  3062. Text="DataBits:" />
  3063. <TextBox
  3064. Grid.Row="4"
  3065. Grid.Column="1"
  3066. Margin="6,0"
  3067. Text="{Binding CardReaderConfig.DataBits, Mode=TwoWay}" />
  3068. <Button
  3069. Grid.Row="5"
  3070. Grid.Column="1"
  3071. MinWidth="120"
  3072. Margin="0,6"
  3073. materialDesign:ButtonAssist.CornerRadius="10"
  3074. Command="{Binding SaveCardReaderConfigCommand}"
  3075. Style="{StaticResource MaterialDesignRaisedButton}">
  3076. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3077. <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
  3078. <TextBlock VerticalAlignment="Center" Text="保存刷卡器配置" />
  3079. </StackPanel>
  3080. </Button>
  3081. </Grid>
  3082. </GroupBox>
  3083. <GroupBox Width="280" Header="扭力测量仪配置">
  3084. <Grid Margin="10">
  3085. <Grid.ColumnDefinitions>
  3086. <ColumnDefinition Width="auto" />
  3087. <ColumnDefinition Width="*" />
  3088. </Grid.ColumnDefinitions>
  3089. <Grid.RowDefinitions>
  3090. <RowDefinition Height="Auto" />
  3091. <RowDefinition Height="Auto" />
  3092. <RowDefinition Height="Auto" />
  3093. <RowDefinition Height="Auto" />
  3094. <RowDefinition Height="Auto" />
  3095. <RowDefinition Height="Auto" />
  3096. </Grid.RowDefinitions>
  3097. <TextBlock
  3098. Grid.Row="0"
  3099. Grid.Column="0"
  3100. HorizontalAlignment="Right"
  3101. Text="PortName:" />
  3102. <TextBox
  3103. Grid.Row="0"
  3104. Grid.Column="1"
  3105. Margin="6,0"
  3106. Text="{Binding TorqueReadConfig.PortName, Mode=TwoWay}" />
  3107. <TextBlock
  3108. Grid.Row="1"
  3109. Grid.Column="0"
  3110. HorizontalAlignment="Right"
  3111. Text="BaudRate:" />
  3112. <TextBox
  3113. Grid.Row="1"
  3114. Grid.Column="1"
  3115. Margin="6,0"
  3116. Text="{Binding TorqueReadConfig.BaudRate, Mode=TwoWay}" />
  3117. <TextBlock
  3118. Grid.Row="2"
  3119. Grid.Column="0"
  3120. HorizontalAlignment="Right"
  3121. Text="Parity:" />
  3122. <ComboBox
  3123. Grid.Row="2"
  3124. Grid.Column="1"
  3125. ItemsSource="{Binding Source={StaticResource Parity}}"
  3126. SelectedItem="{Binding TorqueReadConfig.Parity, Mode=TwoWay}" />
  3127. <TextBlock
  3128. Grid.Row="3"
  3129. Grid.Column="0"
  3130. HorizontalAlignment="Right"
  3131. Text="StopBits:" />
  3132. <ComboBox
  3133. Grid.Row="3"
  3134. Grid.Column="1"
  3135. ItemsSource="{Binding Source={StaticResource StopBits}}"
  3136. SelectedItem="{Binding TorqueReadConfig.StopBits, Mode=TwoWay}" />
  3137. <TextBlock
  3138. Grid.Row="4"
  3139. Grid.Column="0"
  3140. HorizontalAlignment="Right"
  3141. Text="DataBits:" />
  3142. <TextBox
  3143. Grid.Row="4"
  3144. Grid.Column="1"
  3145. Margin="6,0"
  3146. Text="{Binding TorqueReadConfig.DataBits, Mode=TwoWay}" />
  3147. <Button
  3148. Grid.Row="5"
  3149. Grid.Column="1"
  3150. MinWidth="120"
  3151. Margin="0,6"
  3152. materialDesign:ButtonAssist.CornerRadius="10"
  3153. Command="{Binding SaveTorqueReaderConfigCommand}"
  3154. Style="{StaticResource MaterialDesignRaisedButton}">
  3155. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3156. <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
  3157. <TextBlock VerticalAlignment="Center" Text="保存扭力测量仪配置" />
  3158. </StackPanel>
  3159. </Button>
  3160. </Grid>
  3161. </GroupBox>
  3162. </StackPanel>
  3163. </Grid>
  3164. </StackPanel>
  3165. </TabItem>
  3166. <!-- 产品信息 -->
  3167. <TabItem>
  3168. <TabItem.Header>
  3169. <StackPanel HorizontalAlignment="Stretch">
  3170. <materialDesign:PackIcon
  3171. Width="24"
  3172. Height="24"
  3173. HorizontalAlignment="Center"
  3174. Kind="BallotOutline" />
  3175. <TextBlock
  3176. HorizontalAlignment="Stretch"
  3177. FontSize="{DynamicResource Font.Size.Body2}"
  3178. Style="{StaticResource TabHeaderTextBlockStyle}"
  3179. Text="产品信息" />
  3180. </StackPanel>
  3181. </TabItem.Header>
  3182. <StackPanel Margin="16">
  3183. <GroupBox
  3184. Width="400"
  3185. Margin="10,5"
  3186. HorizontalAlignment="Left"
  3187. FontSize="{DynamicResource Font.Size.Title4}"
  3188. Header="产品与mes参数绑定设置">
  3189. <Grid Margin="20">
  3190. <Grid.ColumnDefinitions>
  3191. <ColumnDefinition Width="auto" />
  3192. <ColumnDefinition Width="auto" />
  3193. </Grid.ColumnDefinitions>
  3194. <Grid.RowDefinitions>
  3195. <RowDefinition Height=" auto" />
  3196. <RowDefinition Height=" auto" />
  3197. <RowDefinition Height=" auto" />
  3198. <RowDefinition Height=" auto" />
  3199. <RowDefinition Height=" auto" />
  3200. </Grid.RowDefinitions>
  3201. <TextBlock
  3202. Margin="0,0,0,8"
  3203. HorizontalAlignment="Right"
  3204. VerticalAlignment="Center"
  3205. FontSize="{DynamicResource Font.Size.Body3}"
  3206. Text="产品名称:" />
  3207. <ComboBox
  3208. x:Name="selectProduct"
  3209. Grid.Column="1"
  3210. Width="100"
  3211. Margin="10,4"
  3212. HorizontalAlignment="Left"
  3213. materialDesign:HintAssist.Hint="{lex:Loc 选择产品}"
  3214. FontSize="14"
  3215. ItemsSource="{Binding ProductList, Mode=TwoWay}"
  3216. SelectedItem="{Binding SelectProduct, Mode=TwoWay}">
  3217. <ComboBox.ItemTemplate>
  3218. <DataTemplate>
  3219. <StackPanel Orientation="Vertical">
  3220. <StackPanel Orientation="Horizontal">
  3221. <materialDesign:PackIcon Kind="CubeOutline" />
  3222. <TextBlock Text="{Binding Name}" />
  3223. </StackPanel>
  3224. <TextBlock
  3225. MinHeight="0"
  3226. MaxWidth="300"
  3227. FontSize="{DynamicResource Font.Size.Captions4}"
  3228. Foreground="Gray"
  3229. Text="{Binding Description}"
  3230. TextTrimming="CharacterEllipsis"
  3231. TextWrapping="Wrap" />
  3232. </StackPanel>
  3233. </DataTemplate>
  3234. </ComboBox.ItemTemplate>
  3235. </ComboBox>
  3236. <TextBlock
  3237. Grid.Row="1"
  3238. Margin="0,0,0,8"
  3239. HorizontalAlignment="Right"
  3240. VerticalAlignment="Center"
  3241. FontSize="{DynamicResource Font.Size.Body3}"
  3242. Text="产品编码(model):" />
  3243. <TextBox
  3244. Grid.Row="1"
  3245. Grid.Column="1"
  3246. MinWidth="100"
  3247. Margin="10,4"
  3248. HorizontalAlignment="Left"
  3249. VerticalAlignment="Center"
  3250. FontSize="{DynamicResource Font.Size.Body3}"
  3251. TextAlignment="Center">
  3252. <TextBox.Text>
  3253. <Binding Mode="TwoWay" Path="ProMesInfo.ProductCode" />
  3254. </TextBox.Text>
  3255. </TextBox>
  3256. <TextBlock
  3257. Grid.Row="2"
  3258. Margin="0,0,0,8"
  3259. HorizontalAlignment="Right"
  3260. VerticalAlignment="Center"
  3261. FontSize="{DynamicResource Font.Size.Body3}"
  3262. Text="产品颜色:" />
  3263. <TextBox
  3264. Grid.Row="2"
  3265. Grid.Column="1"
  3266. MinWidth="100"
  3267. Margin="10,4"
  3268. HorizontalAlignment="Left"
  3269. VerticalAlignment="Center"
  3270. FontSize="{DynamicResource Font.Size.Body3}"
  3271. TextAlignment="Center">
  3272. <TextBox.Text>
  3273. <Binding Mode="TwoWay" Path="ProMesInfo.ProductColor" />
  3274. </TextBox.Text>
  3275. </TextBox>
  3276. <TextBlock
  3277. Grid.Row="3"
  3278. Margin="0,0,0,8"
  3279. HorizontalAlignment="Right"
  3280. VerticalAlignment="Center"
  3281. FontSize="{DynamicResource Font.Size.Body3}"
  3282. Text="产品类型:" />
  3283. <TextBox
  3284. Grid.Row="3"
  3285. Grid.Column="1"
  3286. MinWidth="100"
  3287. Margin="10,4"
  3288. HorizontalAlignment="Left"
  3289. VerticalAlignment="Center"
  3290. FontSize="{DynamicResource Font.Size.Body3}"
  3291. TextAlignment="Center">
  3292. <TextBox.Text>
  3293. <Binding Mode="TwoWay" Path="ProMesInfo.ProductLoadMode" />
  3294. </TextBox.Text>
  3295. </TextBox>
  3296. <StackPanel
  3297. Grid.Row="6"
  3298. Grid.ColumnSpan="2"
  3299. Margin="0,6"
  3300. HorizontalAlignment="Center"
  3301. Orientation="Horizontal">
  3302. <Button
  3303. MinWidth="100"
  3304. Margin="5"
  3305. materialDesign:ButtonAssist.CornerRadius="10"
  3306. Command="{Binding GetProWithMesCommand}"
  3307. Style="{StaticResource MaterialDesignRaisedButton}">
  3308. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3309. <materialDesign:PackIcon Margin="0,0,6,0" Kind="PuzzleEditOutline" />
  3310. <TextBlock VerticalAlignment="Center" Text="获取" />
  3311. </StackPanel>
  3312. </Button>
  3313. <Button
  3314. MinWidth="100"
  3315. Margin="5"
  3316. materialDesign:ButtonAssist.CornerRadius="10"
  3317. Command="{Binding DeleteProWithMesCommand}"
  3318. Style="{StaticResource MaterialDesignRaisedButton}">
  3319. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3320. <materialDesign:PackIcon Margin="0,0,6,0" Kind="DeleteForeverOutline" />
  3321. <TextBlock VerticalAlignment="Center" Text="删除" />
  3322. </StackPanel>
  3323. </Button>
  3324. <Button
  3325. MinWidth="100"
  3326. Margin="5"
  3327. materialDesign:ButtonAssist.CornerRadius="10"
  3328. Command="{Binding SaveProWithMesCommand}"
  3329. Style="{StaticResource MaterialDesignRaisedButton}">
  3330. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3331. <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
  3332. <TextBlock VerticalAlignment="Center" Text="保存" />
  3333. </StackPanel>
  3334. </Button>
  3335. </StackPanel>
  3336. </Grid>
  3337. </GroupBox>
  3338. </StackPanel>
  3339. </TabItem>
  3340. <!-- 生产排班 -->
  3341. <TabItem>
  3342. <TabItem.Header>
  3343. <StackPanel HorizontalAlignment="Stretch">
  3344. <materialDesign:PackIcon
  3345. Width="24"
  3346. Height="24"
  3347. HorizontalAlignment="Center"
  3348. Kind="LanConnect" />
  3349. <TextBlock
  3350. HorizontalAlignment="Stretch"
  3351. FontSize="{DynamicResource Font.Size.Body2}"
  3352. Style="{StaticResource TabHeaderTextBlockStyle}"
  3353. Text="{lex:Loc 生产排班}" />
  3354. </StackPanel>
  3355. </TabItem.Header>
  3356. <StackPanel Margin="16">
  3357. <Button
  3358. Width="60"
  3359. Margin="10"
  3360. HorizontalAlignment="Left"
  3361. materialDesign:ButtonAssist.CornerRadius="10"
  3362. Command="{Binding SaveWorkShiftCommand}"
  3363. CommandParameter="WorkShift"
  3364. Style="{StaticResource MaterialDesignRaisedButton}"
  3365. ToolTip="{lex:Loc 保存}">
  3366. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  3367. </Button>
  3368. <GroupBox
  3369. Width="320"
  3370. Margin="10,5"
  3371. HorizontalAlignment="Left"
  3372. FontSize="{DynamicResource Font.Size.Title4}"
  3373. Header="白夜班时间设置">
  3374. <Grid Margin="20">
  3375. <Grid.ColumnDefinitions>
  3376. <ColumnDefinition Width="auto" />
  3377. <ColumnDefinition Width="auto" />
  3378. <ColumnDefinition Width="auto" />
  3379. </Grid.ColumnDefinitions>
  3380. <Grid.RowDefinitions>
  3381. <RowDefinition Height="auto" />
  3382. <RowDefinition Height=" auto" />
  3383. <RowDefinition Height=" auto" />
  3384. <RowDefinition Height=" auto" />
  3385. </Grid.RowDefinitions>
  3386. <TextBlock
  3387. Margin="0,0,0,8"
  3388. HorizontalAlignment="Right"
  3389. VerticalAlignment="Center"
  3390. FontSize="{DynamicResource Font.Size.Body3}"
  3391. Text="白班开始时间:" />
  3392. <TextBox
  3393. Grid.Row="0"
  3394. Grid.Column="1"
  3395. MinWidth="80"
  3396. Margin="10,4"
  3397. HorizontalAlignment="Left"
  3398. VerticalAlignment="Center"
  3399. FontSize="{DynamicResource Font.Size.Body3}"
  3400. TextAlignment="Center">
  3401. <TextBox.Text>
  3402. <Binding Mode="TwoWay" Path="WorkShifts.DayShift" />
  3403. </TextBox.Text>
  3404. </TextBox>
  3405. <TextBlock
  3406. Grid.Row="1"
  3407. Margin="0,0,0,8"
  3408. HorizontalAlignment="Right"
  3409. VerticalAlignment="Center"
  3410. FontSize="{DynamicResource Font.Size.Body3}"
  3411. Text="白班结束时间:" />
  3412. <TextBox
  3413. Grid.Row="1"
  3414. Grid.Column="1"
  3415. MinWidth="80"
  3416. Margin="10,4"
  3417. HorizontalAlignment="Left"
  3418. VerticalAlignment="Center"
  3419. FontSize="{DynamicResource Font.Size.Body3}"
  3420. TextAlignment="Center">
  3421. <TextBox.Text>
  3422. <Binding Mode="TwoWay" Path="WorkShifts.DayShift" />
  3423. </TextBox.Text>
  3424. </TextBox>
  3425. <StackPanel
  3426. Grid.RowSpan="2"
  3427. Grid.Column="2"
  3428. Margin="10,5"
  3429. HorizontalAlignment="Center">
  3430. <ToggleButton
  3431. Width="60"
  3432. Height="40"
  3433. Margin="0,10" />
  3434. </StackPanel>
  3435. <!-- 结束符 -->
  3436. <TextBlock
  3437. Grid.Row="2"
  3438. Margin="0,0,0,8"
  3439. HorizontalAlignment="Right"
  3440. VerticalAlignment="Center"
  3441. FontSize="{DynamicResource Font.Size.Body3}"
  3442. Text="夜班开始时间:" />
  3443. <TextBox
  3444. Grid.Row="2"
  3445. Grid.Column="1"
  3446. MinWidth="80"
  3447. Margin="10,4"
  3448. HorizontalAlignment="Left"
  3449. VerticalAlignment="Center"
  3450. FontSize="{DynamicResource Font.Size.Body3}"
  3451. TextAlignment="Center">
  3452. <TextBox.Text>
  3453. <Binding Mode="TwoWay" Path="WorkShifts.NightShift" />
  3454. </TextBox.Text>
  3455. </TextBox>
  3456. <TextBlock
  3457. Grid.Row="3"
  3458. Margin="0,0,0,8"
  3459. HorizontalAlignment="Right"
  3460. VerticalAlignment="Center"
  3461. FontSize="{DynamicResource Font.Size.Body3}"
  3462. Text="夜班结束时间:" />
  3463. <TextBox
  3464. Grid.Row="3"
  3465. Grid.Column="1"
  3466. MinWidth="80"
  3467. Margin="10,4"
  3468. HorizontalAlignment="Left"
  3469. VerticalAlignment="Center"
  3470. FontSize="{DynamicResource Font.Size.Body3}"
  3471. TextAlignment="Center">
  3472. <TextBox.Text>
  3473. <Binding Mode="TwoWay" Path="WorkShifts.NightShift" />
  3474. </TextBox.Text>
  3475. </TextBox>
  3476. <ToggleButton
  3477. Grid.Row="2"
  3478. Grid.RowSpan="2"
  3479. Grid.Column="2"
  3480. Width="60"
  3481. Height="40"
  3482. Margin="10,5"
  3483. HorizontalAlignment="Center" />
  3484. </Grid>
  3485. </GroupBox>
  3486. <!--<Button Style="{StaticResource MaterialDesignRaisedButton}"
  3487. materialDesign:ButtonAssist.CornerRadius="10"
  3488. Width="60"
  3489. Margin="10"
  3490. Content="test"
  3491. HorizontalAlignment="Left"
  3492. Command="{Binding testCommand}">
  3493. </Button>-->
  3494. </StackPanel>
  3495. </TabItem>
  3496. <!-- 字体 -->
  3497. <TabItem>
  3498. <TabItem.Header>
  3499. <StackPanel HorizontalAlignment="Stretch">
  3500. <materialDesign:PackIcon
  3501. Width="24"
  3502. Height="24"
  3503. HorizontalAlignment="Center"
  3504. Kind="FontSize" />
  3505. <TextBlock
  3506. HorizontalAlignment="Stretch"
  3507. FontSize="{DynamicResource Font.Size.Body2}"
  3508. Style="{StaticResource TabHeaderTextBlockStyle}"
  3509. Text="{lex:Loc 字体}" />
  3510. </StackPanel>
  3511. </TabItem.Header>
  3512. <ScrollViewer>
  3513. <Grid Margin="20">
  3514. <Grid.RowDefinitions>
  3515. <RowDefinition Height="auto" />
  3516. <RowDefinition Height="auto" />
  3517. <RowDefinition Height="auto" />
  3518. <RowDefinition Height="auto" />
  3519. <RowDefinition Height="auto" />
  3520. <RowDefinition Height="auto" />
  3521. <RowDefinition Height="auto" />
  3522. <RowDefinition Height="auto" />
  3523. <RowDefinition Height="auto" />
  3524. <RowDefinition Height="auto" />
  3525. <RowDefinition Height="auto" />
  3526. <RowDefinition Height="auto" />
  3527. </Grid.RowDefinitions>
  3528. <Grid.ColumnDefinitions>
  3529. <ColumnDefinition Width="auto" />
  3530. <ColumnDefinition Width="auto" />
  3531. </Grid.ColumnDefinitions>
  3532. <Grid.Resources>
  3533. <Style TargetType="TextBlock">
  3534. <Setter Property="FontSize" Value="{DynamicResource Font.Size.Body2}" />
  3535. <Setter Property="VerticalAlignment" Value="Center" />
  3536. <Setter Property="HorizontalAlignment" Value="Right" />
  3537. </Style>
  3538. <Style TargetType="mah:NumericUpDown">
  3539. <Setter Property="FontSize" Value="{DynamicResource Font.Size.Body2}" />
  3540. <Setter Property="Margin" Value="5,2" />
  3541. <Setter Property="MinWidth" Value="100" />
  3542. <Setter Property="HorizontalContentAlignment" Value="Center" />
  3543. <Setter Property="VerticalContentAlignment" Value="Center" />
  3544. <Setter Property="Minimum" Value="6" />
  3545. <Setter Property="Interval" Value="2" />
  3546. <Setter Property="Maximum" Value="62" />
  3547. <Setter Property="StringFormat" Value="{}{0:N0}" />
  3548. </Style>
  3549. </Grid.Resources>
  3550. <!-- 1 -->
  3551. <TextBlock
  3552. Grid.Row="0"
  3553. Grid.Column="0"
  3554. Text="{lex:Loc 标题,
  3555. Converter={StaticResource StringFormatConverter},
  3556. ConverterParameter='{}{0}1: '}" />
  3557. <mah:NumericUpDown
  3558. Grid.Row="0"
  3559. Grid.Column="1"
  3560. materialDesign:HintAssist.Hint="Font Size"
  3561. Value="{Binding Title1, Mode=TwoWay}" />
  3562. <!-- 2 -->
  3563. <TextBlock
  3564. Grid.Row="1"
  3565. Grid.Column="0"
  3566. Text="{lex:Loc 标题,
  3567. Converter={StaticResource StringFormatConverter},
  3568. ConverterParameter='{}{0}2: '}" />
  3569. <mah:NumericUpDown
  3570. Grid.Row="1"
  3571. Grid.Column="1"
  3572. materialDesign:HintAssist.Hint="Font Size"
  3573. Value="{Binding Title2, Mode=TwoWay}" />
  3574. <!-- 3 -->
  3575. <TextBlock
  3576. Grid.Row="2"
  3577. Grid.Column="0"
  3578. Text="{lex:Loc 标题,
  3579. Converter={StaticResource StringFormatConverter},
  3580. ConverterParameter='{}{0}3: '}" />
  3581. <mah:NumericUpDown
  3582. Grid.Row="2"
  3583. Grid.Column="1"
  3584. materialDesign:HintAssist.Hint="Font Size"
  3585. Value="{Binding Title3, Mode=TwoWay}" />
  3586. <!-- 4 -->
  3587. <TextBlock
  3588. Grid.Row="3"
  3589. Grid.Column="0"
  3590. Text="{lex:Loc 标题,
  3591. Converter={StaticResource StringFormatConverter},
  3592. ConverterParameter='{}{0}4: '}" />
  3593. <mah:NumericUpDown
  3594. Grid.Row="3"
  3595. Grid.Column="1"
  3596. materialDesign:HintAssist.Hint="Font Size"
  3597. Value="{Binding Title4, Mode=TwoWay}" />
  3598. <!-- 5 -->
  3599. <TextBlock
  3600. Grid.Row="4"
  3601. Grid.Column="0"
  3602. Text="{lex:Loc 正文,
  3603. Converter={StaticResource StringFormatConverter},
  3604. ConverterParameter='{}{0}1: '}" />
  3605. <mah:NumericUpDown
  3606. Grid.Row="4"
  3607. Grid.Column="1"
  3608. materialDesign:HintAssist.Hint="Font Size"
  3609. Value="{Binding Body1, Mode=TwoWay}" />
  3610. <!-- 6 -->
  3611. <TextBlock
  3612. Grid.Row="5"
  3613. Grid.Column="0"
  3614. Text="{lex:Loc 正文,
  3615. Converter={StaticResource StringFormatConverter},
  3616. ConverterParameter='{}{0}2: '}" />
  3617. <mah:NumericUpDown
  3618. Grid.Row="5"
  3619. Grid.Column="1"
  3620. materialDesign:HintAssist.Hint="Font Size"
  3621. Value="{Binding Body2, Mode=TwoWay}" />
  3622. <!-- 7 -->
  3623. <TextBlock
  3624. Grid.Row="6"
  3625. Grid.Column="0"
  3626. Text="{lex:Loc 正文,
  3627. Converter={StaticResource StringFormatConverter},
  3628. ConverterParameter='{}{0}3: '}" />
  3629. <mah:NumericUpDown
  3630. Grid.Row="6"
  3631. Grid.Column="1"
  3632. materialDesign:HintAssist.Hint="Font Size"
  3633. Value="{Binding Body3, Mode=TwoWay}" />
  3634. <!-- 8 -->
  3635. <TextBlock
  3636. Grid.Row="7"
  3637. Grid.Column="0"
  3638. Text="{lex:Loc 正文,
  3639. Converter={StaticResource StringFormatConverter},
  3640. ConverterParameter='{}{0}4: '}" />
  3641. <mah:NumericUpDown
  3642. Grid.Row="7"
  3643. Grid.Column="1"
  3644. materialDesign:HintAssist.Hint="Font Size"
  3645. Value="{Binding Body4, Mode=TwoWay}" />
  3646. <!-- 9 -->
  3647. <TextBlock
  3648. Grid.Row="8"
  3649. Grid.Column="0"
  3650. Text="{lex:Loc 标注,
  3651. Converter={StaticResource StringFormatConverter},
  3652. ConverterParameter='{}{0}1: '}" />
  3653. <mah:NumericUpDown
  3654. Grid.Row="8"
  3655. Grid.Column="1"
  3656. materialDesign:HintAssist.Hint="Font Size"
  3657. Value="{Binding Captions1, Mode=TwoWay}" />
  3658. <!-- 10 -->
  3659. <TextBlock
  3660. Grid.Row="9"
  3661. Grid.Column="0"
  3662. Text="{lex:Loc 标注,
  3663. Converter={StaticResource StringFormatConverter},
  3664. ConverterParameter='{}{0}2: '}" />
  3665. <mah:NumericUpDown
  3666. Grid.Row="9"
  3667. Grid.Column="1"
  3668. materialDesign:HintAssist.Hint="Font Size"
  3669. Value="{Binding Captions2, Mode=TwoWay}" />
  3670. <!-- 11 -->
  3671. <TextBlock
  3672. Grid.Row="10"
  3673. Grid.Column="0"
  3674. Text="{lex:Loc 标注,
  3675. Converter={StaticResource StringFormatConverter},
  3676. ConverterParameter='{}{0}3: '}" />
  3677. <mah:NumericUpDown
  3678. Grid.Row="10"
  3679. Grid.Column="1"
  3680. materialDesign:HintAssist.Hint="Font Size"
  3681. Value="{Binding Captions3, Mode=TwoWay}" />
  3682. <!-- 12 -->
  3683. <TextBlock
  3684. Grid.Row="11"
  3685. Grid.Column="0"
  3686. Text="{lex:Loc 标注,
  3687. Converter={StaticResource StringFormatConverter},
  3688. ConverterParameter='{}{0}4: '}" />
  3689. <mah:NumericUpDown
  3690. Grid.Row="11"
  3691. Grid.Column="1"
  3692. materialDesign:HintAssist.Hint="Font Size"
  3693. Value="{Binding Captions4, Mode=TwoWay}" />
  3694. </Grid>
  3695. </ScrollViewer>
  3696. </TabItem>
  3697. <!-- 语言 -->
  3698. <TabItem>
  3699. <TabItem.Header>
  3700. <StackPanel HorizontalAlignment="Stretch">
  3701. <materialDesign:PackIcon
  3702. Width="24"
  3703. Height="24"
  3704. HorizontalAlignment="Center"
  3705. Kind="TranslateVariant" />
  3706. <TextBlock
  3707. HorizontalAlignment="Stretch"
  3708. FontSize="{DynamicResource Font.Size.Body2}"
  3709. Style="{StaticResource TabHeaderTextBlockStyle}"
  3710. Text="{lex:Loc SettingView_Language_Text}" />
  3711. </StackPanel>
  3712. </TabItem.Header>
  3713. <StackPanel
  3714. Margin="20"
  3715. VerticalAlignment="Top"
  3716. Orientation="Horizontal">
  3717. <!-- 中文简体 -->
  3718. <Button
  3719. MinWidth="100"
  3720. materialDesign:ButtonAssist.CornerRadius="10"
  3721. Command="{Binding SelectLanguageCommand}"
  3722. CommandParameter="ChineseSimplified"
  3723. FontSize="{DynamicResource Font.Size.Body1}"
  3724. ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}">
  3725. <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
  3726. <Button.Style>
  3727. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3728. <Setter Property="Foreground" Value="#000000" />
  3729. <Style.Triggers>
  3730. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.ChineseSimplified}">
  3731. <Setter Property="Background" Value="Green" />
  3732. <Setter Property="BorderBrush" Value="Green" />
  3733. </DataTrigger>
  3734. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  3735. Value="{x:Static enums:Language.English}">
  3736. <Setter Property="Background"
  3737. Value="#e4ff54" />
  3738. <Setter Property="BorderBrush"
  3739. Value="#e4ff54" />
  3740. </DataTrigger>-->
  3741. </Style.Triggers>
  3742. </Style>
  3743. </Button.Style>
  3744. </Button>
  3745. <!-- 中文繁体 -->
  3746. <Button
  3747. MinWidth="100"
  3748. Margin="20.0"
  3749. materialDesign:ButtonAssist.CornerRadius="10"
  3750. Command="{Binding SelectLanguageCommand}"
  3751. CommandParameter="ChineseTraditional"
  3752. FontSize="{DynamicResource Font.Size.Body1}"
  3753. ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}">
  3754. <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
  3755. <Button.Style>
  3756. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3757. <Setter Property="Foreground" Value="#000000" />
  3758. <Style.Triggers>
  3759. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.ChineseTraditional}">
  3760. <Setter Property="Background" Value="Green" />
  3761. <Setter Property="BorderBrush" Value="Green" />
  3762. </DataTrigger>
  3763. </Style.Triggers>
  3764. </Style>
  3765. </Button.Style>
  3766. </Button>
  3767. <!-- 英语 -->
  3768. <Button
  3769. MinWidth="100"
  3770. Margin="20.0"
  3771. materialDesign:ButtonAssist.CornerRadius="10"
  3772. Command="{Binding SelectLanguageCommand}"
  3773. CommandParameter="English"
  3774. FontSize="{DynamicResource Font.Size.Body1}"
  3775. ToolTip="{lex:Loc SettingView_Language_English}">
  3776. <TextBlock Text="{lex:Loc SettingView_Language_English}" />
  3777. <Button.Style>
  3778. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3779. <Setter Property="Foreground" Value="#000000" />
  3780. <Style.Triggers>
  3781. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.English}">
  3782. <Setter Property="Background" Value="Green" />
  3783. <Setter Property="BorderBrush" Value="Green" />
  3784. </DataTrigger>
  3785. </Style.Triggers>
  3786. </Style>
  3787. </Button.Style>
  3788. </Button>
  3789. <!-- 日语 -->
  3790. <Button
  3791. MinWidth="100"
  3792. Margin="20.0"
  3793. materialDesign:ButtonAssist.CornerRadius="10"
  3794. Command="{Binding SelectLanguageCommand}"
  3795. CommandParameter="Japanese"
  3796. FontSize="{DynamicResource Font.Size.Body1}"
  3797. ToolTip="{lex:Loc SettingView_Language_Japanese}">
  3798. <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
  3799. <Button.Style>
  3800. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3801. <Setter Property="Foreground" Value="#000000" />
  3802. <Style.Triggers>
  3803. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.Japanese}">
  3804. <Setter Property="Background" Value="Green" />
  3805. <Setter Property="BorderBrush" Value="Green" />
  3806. </DataTrigger>
  3807. </Style.Triggers>
  3808. </Style>
  3809. </Button.Style>
  3810. </Button>
  3811. <!-- 越南语 -->
  3812. <Button
  3813. MinWidth="100"
  3814. Margin="20.0"
  3815. materialDesign:ButtonAssist.CornerRadius="10"
  3816. Command="{Binding SelectLanguageCommand}"
  3817. CommandParameter="Vietnamese"
  3818. FontSize="{DynamicResource Font.Size.Body1}"
  3819. ToolTip="{lex:Loc SettingView_Language_Vietnamese}">
  3820. <TextBlock Text="{lex:Loc SettingView_Language_Vietnamese}" />
  3821. <Button.Style>
  3822. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3823. <Setter Property="Foreground" Value="#000000" />
  3824. <Style.Triggers>
  3825. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.Vietnamese}">
  3826. <Setter Property="Background" Value="Green" />
  3827. <Setter Property="BorderBrush" Value="Green" />
  3828. </DataTrigger>
  3829. </Style.Triggers>
  3830. </Style>
  3831. </Button.Style>
  3832. </Button>
  3833. </StackPanel>
  3834. </TabItem>
  3835. </TabControl>
  3836. </Grid>
  3837. </UserControl>