SettingView.xaml 231 KB

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