SettingView.xaml 162 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559
  1. <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:prism="http://prismlibrary.com/"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  7. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  9. xmlns:sysio="clr-namespace:System.IO.Ports;assembly=System"
  10. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels"
  11. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  12. xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
  13. xmlns:enums1="clr-namespace:Team.FFFeederService;assembly=Team.FFFeederService"
  14. xmlns:valRules="clr-namespace:TeamAAS_VP.Identity"
  15. xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
  16. xmlns:c="clr-namespace:TeamAAS_VP.ValueConverter"
  17. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  18. xmlns:coreLights="clr-namespace:TeamAAS_VP.Core.Lights"
  19. xmlns:io="clr-namespace:System.IO.Ports;assembly=System"
  20. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  21. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  22. lex:LocalizeDictionary.DesignCulture="zh-CN"
  23. mc:Ignorable="d"
  24. d:DataContext="{d:DesignInstance Type=vm:SettingViewModel}"
  25. d:Height="1080"
  26. d:Width="1024"
  27. d:Background="White"
  28. x:Class="TeamAAS_VP.Views.SettingView"
  29. prism:ViewModelLocator.AutoWireViewModel="True"
  30. FontFamily="{DynamicResource DefaultFont}">
  31. <b:Interaction.Triggers>
  32. <b:EventTrigger EventName="Loaded">
  33. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  34. </b:EventTrigger>
  35. </b:Interaction.Triggers>
  36. <UserControl.Resources>
  37. <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverter" />
  38. <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverterInverse"
  39. 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"
  43. TargetType="TextBlock">
  44. <Setter Property="TextWrapping"
  45. Value="NoWrap" />
  46. <Setter Property="TextTrimming"
  47. Value="CharacterEllipsis" />
  48. <Setter Property="HorizontalAlignment"
  49. Value="Center" />
  50. <Setter Property="VerticalAlignment"
  51. Value="Center" />
  52. </Style>
  53. <ObjectDataProvider x:Key="Parity"
  54. MethodName="GetValues"
  55. ObjectType="{x:Type sys:Enum}">
  56. <ObjectDataProvider.MethodParameters>
  57. <x:Type TypeName="sysio:Parity" />
  58. </ObjectDataProvider.MethodParameters>
  59. </ObjectDataProvider>
  60. <ObjectDataProvider x:Key="StopBits"
  61. MethodName="GetValues"
  62. ObjectType="{x:Type sys:Enum}">
  63. <ObjectDataProvider.MethodParameters>
  64. <x:Type TypeName="sysio:StopBits" />
  65. </ObjectDataProvider.MethodParameters>
  66. </ObjectDataProvider>
  67. </UserControl.Resources>
  68. <Grid>
  69. <TabControl materialDesign:NavigationRailAssist.ShowSelectionBackground="True"
  70. SnapsToDevicePixels="True"
  71. Style="{StaticResource MaterialDesignNavigationRailTabControl}"
  72. TabStripPlacement="Left">
  73. <materialDesign:NavigationRailAssist.FloatingContent>
  74. <Button Margin="8"
  75. Content="{materialDesign:PackIcon Kind=OfficeBuildingCogOutline}"
  76. Style="{StaticResource MaterialDesignFloatingActionSecondaryButton}" />
  77. </materialDesign:NavigationRailAssist.FloatingContent>
  78. <!--相机配置-->
  79. <TabItem Margin="5,0">
  80. <TabItem.Header>
  81. <StackPanel HorizontalAlignment="Stretch">
  82. <materialDesign:PackIcon Width="24"
  83. Height="24"
  84. HorizontalAlignment="Center"
  85. Kind="CameraPlusOutline" />
  86. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  87. FontSize="{DynamicResource Font.Size.Body2}"
  88. Text="{lex:Loc SettingView_Camera_Text}"
  89. HorizontalAlignment="Stretch" />
  90. </StackPanel>
  91. </TabItem.Header>
  92. <Grid Margin="16">
  93. <Grid.RowDefinitions>
  94. <RowDefinition Height="50" />
  95. <RowDefinition Height="*" />
  96. </Grid.RowDefinitions>
  97. <Grid.ColumnDefinitions>
  98. <ColumnDefinition Width="auto" />
  99. <ColumnDefinition Width="*" />
  100. </Grid.ColumnDefinitions>
  101. <!--增删改查-->
  102. <StackPanel Grid.ColumnSpan="2"
  103. IsEnabled="{Binding IsAllowEdit}"
  104. Orientation="Horizontal">
  105. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  106. ToolTip="{lex:Loc SettingView_Camera_btnAddCamera}"
  107. Command="{Binding AddCameraCommand}">
  108. <materialDesign:PackIcon Kind="Plus" />
  109. </Button>
  110. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  111. ToolTip="{lex:Loc SettingView_Camera_btnEditCamera}"
  112. Margin="20,0"
  113. Command="{Binding EditCameraCommand}">
  114. <materialDesign:PackIcon Kind="PuzzleEditOutline" />
  115. </Button>
  116. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  117. ToolTip="{lex:Loc SettingView_Camera_btnRemoveCamera}"
  118. Command="{Binding RemoveCameraCommand}">
  119. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  120. </Button>
  121. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  122. Margin="20,0"
  123. ToolTip="{lex:Loc 保存}"
  124. Command="{Binding SaveCamerasCommand}">
  125. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  126. </Button>
  127. </StackPanel>
  128. <!--相机列表-->
  129. <TreeView Grid.Row="1"
  130. Grid.Column="0"
  131. SelectedItemChanged="TreeView_SelectedItemChanged">
  132. <TreeViewItem Header="{lex:Loc SettingView_Camera_CameraList}"
  133. FontSize="{DynamicResource Font.Size.Title4}"
  134. FontWeight="Bold"
  135. IsExpanded="True"
  136. ItemsSource="{Binding CameraList}">
  137. <TreeViewItem.ItemTemplate>
  138. <HierarchicalDataTemplate>
  139. <StackPanel Orientation="Vertical">
  140. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  141. <TextBlock.Text>
  142. <MultiBinding StringFormat="{}{0}. {1}">
  143. <Binding Path="CameraNo" />
  144. <Binding Path="CameraName" />
  145. </MultiBinding>
  146. </TextBlock.Text>
  147. </TextBlock>
  148. <StackPanel Orientation="Horizontal">
  149. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  150. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  151. FontSize="{DynamicResource Font.Size.Body3}" />
  152. <TextBlock Text="{Binding CameraBrand}"
  153. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  154. FontSize="{DynamicResource Font.Size.Body3}" />
  155. <TextBlock Text="-"
  156. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  157. FontSize="{DynamicResource Font.Size.Body3}" />
  158. <TextBlock Text="{Binding ManufacturerName}"
  159. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  160. FontSize="{DynamicResource Font.Size.Body3}" />
  161. </StackPanel>
  162. <StackPanel Orientation="Horizontal">
  163. <TextBlock Text="{lex:Loc 型号, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  164. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  165. FontSize="{DynamicResource Font.Size.Body3}" />
  166. <TextBlock Text="{Binding Model,Mode=TwoWay}"
  167. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  168. FontSize="{DynamicResource Font.Size.Body3}" />
  169. <TextBlock Text="{lex:Loc 序列号,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  170. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  171. FontSize="{DynamicResource Font.Size.Body3}"
  172. Margin="10,0,0,0" />
  173. <TextBlock Text="{Binding SerialNumber,Mode=TwoWay}"
  174. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  175. FontSize="{DynamicResource Font.Size.Body3}" />
  176. </StackPanel>
  177. <StackPanel Orientation="Horizontal">
  178. <TextBlock Text="{lex:Loc 类型, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  179. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  180. FontSize="{DynamicResource Font.Size.Body3}" />
  181. <TextBlock Text="{Binding CameraType}"
  182. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  183. FontSize="{DynamicResource Font.Size.Body3}" />
  184. <TextBlock Text="IP: "
  185. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  186. FontSize="{DynamicResource Font.Size.Body3}"
  187. Margin="10,0,0,0" />
  188. <TextBlock Text="{Binding CameraIp}"
  189. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  190. FontSize="{DynamicResource Font.Size.Body3}" />
  191. </StackPanel>
  192. <Border Height="2"
  193. Margin="0"
  194. BorderThickness="2"
  195. BorderBrush="Green" />
  196. </StackPanel>
  197. </HierarchicalDataTemplate>
  198. </TreeViewItem.ItemTemplate>
  199. </TreeViewItem>
  200. </TreeView>
  201. </Grid>
  202. </TabItem>
  203. <!--机器人-->
  204. <TabItem>
  205. <TabItem.Header>
  206. <StackPanel HorizontalAlignment="Stretch">
  207. <materialDesign:PackIcon Width="24"
  208. Height="24"
  209. HorizontalAlignment="Center"
  210. Kind="RobotIndustrialOutline" />
  211. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  212. FontSize="{DynamicResource Font.Size.Body2}"
  213. Text="{lex:Loc 机器人}"
  214. HorizontalAlignment="Stretch" />
  215. </StackPanel>
  216. </TabItem.Header>
  217. <Grid Margin="16">
  218. <Grid.RowDefinitions>
  219. <RowDefinition Height="50" />
  220. <RowDefinition Height="*" />
  221. </Grid.RowDefinitions>
  222. <Grid.ColumnDefinitions>
  223. <ColumnDefinition Width="auto" />
  224. <ColumnDefinition Width="*" />
  225. </Grid.ColumnDefinitions>
  226. <!--增删改查-->
  227. <StackPanel Grid.ColumnSpan="2"
  228. IsEnabled="{Binding IsAllowEdit}"
  229. Orientation="Horizontal">
  230. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  231. ToolTip="{lex:Loc 增加机器人}"
  232. Command="{Binding AddRobotCommand}">
  233. <materialDesign:PackIcon Kind="Plus" />
  234. </Button>
  235. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  236. ToolTip="{lex:Loc 移除机器人}"
  237. Margin="20,0"
  238. Command="{Binding RemoveCommand}">
  239. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  240. </Button>
  241. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  242. ToolTip="{lex:Loc 保存}"
  243. Command="{Binding SaveRobotsCommand}">
  244. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  245. </Button>
  246. </StackPanel>
  247. <!--机器人列表-->
  248. <TreeView Grid.Row="1"
  249. Grid.Column="0"
  250. SelectedItemChanged="TreeView_SelectedItemChanged">
  251. <TreeViewItem Header="{lex:Loc 机器人列表}"
  252. FontSize="{DynamicResource Font.Size.Title4}"
  253. FontWeight="Bold"
  254. IsExpanded="True"
  255. ItemsSource="{Binding RobotList}">
  256. <TreeViewItem.ItemTemplate>
  257. <HierarchicalDataTemplate>
  258. <StackPanel Orientation="Vertical">
  259. <StackPanel Orientation="Horizontal">
  260. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  261. <TextBlock.Text>
  262. <MultiBinding StringFormat="{}{0}. {1}">
  263. <Binding Path="RobotNo" />
  264. <Binding Path="RobotName" />
  265. </MultiBinding>
  266. </TextBlock.Text>
  267. </TextBlock>
  268. </StackPanel>
  269. <StackPanel Orientation="Horizontal">
  270. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  271. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  272. FontSize="{DynamicResource Font.Size.Captions3}" />
  273. <TextBlock Text="{Binding RobotBrand,Mode=TwoWay}"
  274. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  275. FontSize="{DynamicResource Font.Size.Captions3}" />
  276. <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  277. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  278. FontSize="{DynamicResource Font.Size.Captions3}"
  279. Margin="10,0,0,0"
  280. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  281. <TextBlock Text="{Binding ConnectType,Mode=TwoWay}"
  282. VerticalAlignment="Center"
  283. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  284. FontSize="{DynamicResource Font.Size.Captions3}"
  285. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  286. <!--PLC-->
  287. <TextBlock Text="PLC: "
  288. Margin="10,0,0,0"
  289. FontSize="{DynamicResource Font.Size.Captions3}"
  290. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  291. d:Visibility="Collapsed"
  292. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  293. <TextBlock Text="{Binding PLC,Converter={StaticResource PlcIdToNameConverter}}"
  294. FontSize="{DynamicResource Font.Size.Captions3}"
  295. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  296. d:Visibility="Collapsed"
  297. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  298. </StackPanel>
  299. <StackPanel Orientation="Horizontal"
  300. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  301. <TextBlock Text="{Binding IP,StringFormat=IP:{0},Mode=TwoWay}"
  302. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  303. FontSize="{DynamicResource Font.Size.Captions3}" />
  304. <TextBlock Text="{Binding Port,StringFormat=Port:{0},Mode=TwoWay}"
  305. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  306. FontSize="{DynamicResource Font.Size.Captions3}"
  307. Margin="10,0" />
  308. <TextBlock Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  309. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  310. FontSize="{DynamicResource Font.Size.Captions3}" />
  311. <TextBlock Text="{Binding Terminator,Mode=TwoWay}"
  312. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  313. FontSize="{DynamicResource Font.Size.Captions3}" />
  314. </StackPanel>
  315. <Border Height="2"
  316. Margin="0"
  317. BorderThickness="2"
  318. BorderBrush="Green" />
  319. </StackPanel>
  320. </HierarchicalDataTemplate>
  321. </TreeViewItem.ItemTemplate>
  322. </TreeViewItem>
  323. </TreeView>
  324. <!--参数详情-->
  325. <ScrollViewer Grid.Row="1"
  326. Grid.Column="1"
  327. IsEnabled="{Binding IsAllowEdit}"
  328. Margin="20"
  329. Visibility="{Binding SelectRobot,Converter={StaticResource ObjectToVisibilityConverter}}">
  330. <Grid HorizontalAlignment="Stretch"
  331. VerticalAlignment="Top">
  332. <Grid.RowDefinitions>
  333. <RowDefinition />
  334. <RowDefinition />
  335. <RowDefinition />
  336. <RowDefinition />
  337. <RowDefinition />
  338. <RowDefinition />
  339. <RowDefinition />
  340. <RowDefinition />
  341. </Grid.RowDefinitions>
  342. <Grid.ColumnDefinitions>
  343. <ColumnDefinition Width="auto" />
  344. <ColumnDefinition Width="auto" />
  345. <ColumnDefinition Width="*" />
  346. </Grid.ColumnDefinitions>
  347. <!--id-->
  348. <TextBlock Text="Id: "
  349. Grid.Row="0"
  350. Grid.Column="0"
  351. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  352. HorizontalAlignment="Right"
  353. VerticalAlignment="Center"
  354. FontSize="{DynamicResource Font.Size.Body3}" />
  355. <TextBlock x:Name="txt_Id"
  356. Text="{Binding SelectRobot.Id,Mode=TwoWay}"
  357. Grid.Row="0"
  358. Grid.Column="1"
  359. Margin="10,0"
  360. HorizontalAlignment="Left"
  361. VerticalAlignment="Center"
  362. FontSize="{DynamicResource Font.Size.Body3}" />
  363. <!--名称-->
  364. <TextBlock Text="{lex:Loc 名称,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  365. Grid.Row="1"
  366. Grid.Column="0"
  367. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  368. HorizontalAlignment="Right"
  369. VerticalAlignment="Center"
  370. FontSize="{DynamicResource Font.Size.Body3}" />
  371. <TextBox Grid.Row="1"
  372. Grid.Column="1"
  373. Margin="10,0"
  374. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  375. FontSize="{DynamicResource Font.Size.Body3}"
  376. MinWidth="80"
  377. TextAlignment="Center"
  378. HorizontalAlignment="Left"
  379. VerticalAlignment="Center">
  380. <TextBox.Text>
  381. <Binding Path="SelectRobot.RobotName"
  382. Mode="TwoWay">
  383. <Binding.ValidationRules>
  384. <valRules:NameValidationRule />
  385. </Binding.ValidationRules>
  386. </Binding>
  387. </TextBox.Text>
  388. </TextBox>
  389. <!--机器人品牌-->
  390. <TextBlock Text="{lex:Loc 品牌,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  391. Grid.Row="2"
  392. Grid.Column="0"
  393. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  394. FontSize="{DynamicResource Font.Size.Body3}"
  395. HorizontalAlignment="Right"
  396. VerticalAlignment="Center" />
  397. <ComboBox Grid.Row="2"
  398. Grid.Column="1"
  399. Margin="10,0"
  400. FontSize="{DynamicResource Font.Size.Body3}"
  401. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  402. MinWidth="80"
  403. SelectedItem="{Binding SelectRobot.RobotBrand,Mode=TwoWay}"
  404. ItemsSource="{ext:EnumBindingSource EnumType=enums:RobotBrand}"
  405. HorizontalContentAlignment="Center"
  406. HorizontalAlignment="Left"
  407. VerticalAlignment="Center" />
  408. <!--通讯方式-->
  409. <TextBlock Text="{lex:Loc 通讯方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  410. Grid.Row="3"
  411. Grid.Column="0"
  412. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  413. FontSize="{DynamicResource Font.Size.Body3}"
  414. HorizontalAlignment="Right"
  415. VerticalAlignment="Center"
  416. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  417. <ComboBox Grid.Row="3"
  418. Grid.Column="1"
  419. Margin="10,0"
  420. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  421. MinWidth="80"
  422. SelectedItem="{Binding SelectRobot.ConnectType,Mode=TwoWay}"
  423. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  424. FontSize="{DynamicResource Font.Size.Body3}"
  425. HorizontalContentAlignment="Center"
  426. HorizontalAlignment="Left"
  427. VerticalAlignment="Center"
  428. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  429. <!--IP地址-->
  430. <TextBlock Text="IP: "
  431. Grid.Row="4"
  432. Grid.Column="0"
  433. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  434. FontSize="{DynamicResource Font.Size.Body3}"
  435. HorizontalAlignment="Right"
  436. VerticalAlignment="Center"
  437. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  438. <TextBox Grid.Row="4"
  439. Grid.Column="1"
  440. Margin="10,0"
  441. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  442. FontSize="{DynamicResource Font.Size.Body3}"
  443. MinWidth="80"
  444. TextAlignment="Center"
  445. HorizontalAlignment="Left"
  446. VerticalAlignment="Center"
  447. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  448. <TextBox.Text>
  449. <Binding Path="SelectRobot.IP"
  450. Mode="TwoWay">
  451. <Binding.ValidationRules>
  452. <valRules:IPValidationRule />
  453. </Binding.ValidationRules>
  454. </Binding>
  455. </TextBox.Text>
  456. </TextBox>
  457. <!--端口号-->
  458. <TextBlock Text="Port: "
  459. Grid.Row="5"
  460. Grid.Column="0"
  461. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  462. FontSize="{DynamicResource Font.Size.Body3}"
  463. HorizontalAlignment="Right"
  464. VerticalAlignment="Center"
  465. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  466. <TextBox Grid.Row="5"
  467. Grid.Column="1"
  468. Margin="10,0"
  469. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  470. FontSize="{DynamicResource Font.Size.Body3}"
  471. MinWidth="80"
  472. TextAlignment="Center"
  473. HorizontalAlignment="Left"
  474. VerticalAlignment="Center"
  475. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  476. <TextBox.Text>
  477. <Binding Path="SelectRobot.Port"
  478. Mode="TwoWay">
  479. <Binding.ValidationRules>
  480. <valRules:PortValidationRule />
  481. </Binding.ValidationRules>
  482. </Binding>
  483. </TextBox.Text>
  484. </TextBox>
  485. <!--结束符-->
  486. <TextBlock Text="{lex:Loc 结束符,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  487. Grid.Row="6"
  488. Grid.Column="0"
  489. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  490. FontSize="{DynamicResource Font.Size.Body3}"
  491. HorizontalAlignment="Right"
  492. VerticalAlignment="Center"
  493. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  494. <ComboBox SelectedItem="{Binding SelectRobot.Terminator,Mode=TwoWay}"
  495. Grid.Row="6"
  496. Grid.Column="1"
  497. Margin="10,0"
  498. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  499. MinWidth="80"
  500. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  501. FontSize="{DynamicResource Font.Size.Body3}"
  502. HorizontalContentAlignment="Center"
  503. HorizontalAlignment="Left"
  504. VerticalAlignment="Center"
  505. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  506. <!--编码格式-->
  507. <TextBlock Grid.Row="7"
  508. Grid.Column="0"
  509. Text="{lex:Loc 编码解码,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  510. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  511. FontSize="{DynamicResource Font.Size.Body3}"
  512. HorizontalAlignment="Right"
  513. VerticalAlignment="Center"
  514. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  515. <ComboBox SelectedItem="{Binding SelectRobot.DataEncoding,Mode=TwoWay}"
  516. Grid.Row="7"
  517. Grid.Column="1"
  518. Margin="10,0"
  519. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  520. MinWidth="80"
  521. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  522. FontSize="{DynamicResource Font.Size.Body3}"
  523. HorizontalContentAlignment="Center"
  524. HorizontalAlignment="Left"
  525. VerticalAlignment="Center"
  526. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  527. <!--PLC-->
  528. <TextBlock Grid.Row="3"
  529. Grid.Column="0"
  530. Text="PLC: "
  531. HorizontalAlignment="Right"
  532. VerticalAlignment="Center"
  533. d:Visibility="Collapsed"
  534. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  535. <ComboBox SelectedItem="{Binding RobotSelectedPlc}"
  536. Grid.Row="3"
  537. Grid.Column="1"
  538. Margin="10,5"
  539. ItemsSource="{Binding PlcList}"
  540. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  541. MinWidth="80"
  542. HorizontalContentAlignment="Center"
  543. HorizontalAlignment="Left"
  544. VerticalAlignment="Center"
  545. d:Visibility="Collapsed"
  546. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  547. <ComboBox.ItemTemplate>
  548. <DataTemplate>
  549. <TextBlock Text="{Binding Name}" />
  550. </DataTemplate>
  551. </ComboBox.ItemTemplate>
  552. </ComboBox>
  553. <!--<ScrollViewer Grid.RowSpan="8"
  554. Grid.Column="2"
  555. HorizontalScrollBarVisibility="Auto"
  556. VerticalScrollBarVisibility="Auto"
  557. d:Visibility="Collapsed"
  558. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  559. <Grid Margin="5">
  560. <Grid.RowDefinitions>
  561. <RowDefinition Height="Auto" />
  562. <RowDefinition Height="Auto" />
  563. <RowDefinition Height="Auto" />
  564. <RowDefinition Height="Auto" />
  565. <RowDefinition Height="Auto" />
  566. <RowDefinition Height="Auto" />
  567. <RowDefinition Height="Auto" />
  568. <RowDefinition Height="Auto" />
  569. <RowDefinition Height="Auto" />
  570. <RowDefinition Height="Auto" />
  571. <RowDefinition Height="Auto" />
  572. <RowDefinition Height="Auto" />
  573. <RowDefinition Height="Auto" />
  574. <RowDefinition Height="Auto" />
  575. <RowDefinition Height="Auto" />
  576. <RowDefinition Height="Auto" />
  577. <RowDefinition Height="Auto" />
  578. <RowDefinition Height="Auto" />
  579. <RowDefinition Height="Auto" />
  580. <RowDefinition Height="Auto" />
  581. <RowDefinition Height="Auto" />
  582. <RowDefinition Height="Auto" />
  583. <RowDefinition Height="Auto" />
  584. <RowDefinition Height="Auto" />
  585. </Grid.RowDefinitions>
  586. <Grid.ColumnDefinitions>
  587. <ColumnDefinition Width="auto" />
  588. <ColumnDefinition Width="*" />
  589. </Grid.ColumnDefinitions>
  590. <Grid.Resources>
  591. <Style TargetType="TextBlock">
  592. <Setter Property="FontSize"
  593. Value="{DynamicResource Font.Size.Body3}" />
  594. <Setter Property="Margin"
  595. Value="5" />
  596. <Setter Property="VerticalAlignment"
  597. Value="Center" />
  598. </Style>
  599. <Style TargetType="TextBox">
  600. <Setter Property="FontSize"
  601. Value="{DynamicResource Font.Size.Body3}" />
  602. <Setter Property="Margin"
  603. Value="5" />
  604. <Setter Property="HorizontalAlignment"
  605. Value="Stretch" />
  606. <Setter Property="VerticalAlignment"
  607. Value="Center" />
  608. </Style>
  609. </Grid.Resources>
  610. <TextBlock Grid.Row="0"
  611. FontWeight="Bold"
  612. Text="{lex:Loc 状态参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  613. <TextBlock Grid.Row="1"
  614. Text="{lex:Loc X坐标}" />
  615. <DockPanel Grid.Row="1"
  616. Grid.Column="1"
  617. LastChildFill="True">
  618. <TextBlock Text="{Binding ResultsValues[0]}"
  619. MinWidth="50" />
  620. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.X}" />
  621. </DockPanel>
  622. <TextBlock Grid.Row="2"
  623. Text="{lex:Loc Y坐标}" />
  624. <DockPanel Grid.Row="2"
  625. Grid.Column="1"
  626. LastChildFill="True">
  627. <TextBlock Text="{Binding ResultsValues[1]}"
  628. MinWidth="50" />
  629. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Y}" />
  630. </DockPanel>
  631. <TextBlock Grid.Row="3"
  632. Text="{lex:Loc Z坐标}" />
  633. <DockPanel Grid.Row="3"
  634. Grid.Column="1"
  635. LastChildFill="True">
  636. <TextBlock Text="{Binding ResultsValues[2]}"
  637. MinWidth="50" />
  638. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Z}" />
  639. </DockPanel>
  640. <TextBlock Grid.Row="4"
  641. Text="{lex:Loc U坐标}" />
  642. <DockPanel Grid.Row="4"
  643. Grid.Column="1"
  644. LastChildFill="True">
  645. <TextBlock Text="{Binding ResultsValues[3]}"
  646. MinWidth="50" />
  647. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.U}" />
  648. </DockPanel>
  649. <TextBlock Grid.Row="5"
  650. Text="{lex:Loc 运动结束}" />
  651. <DockPanel Grid.Row="5"
  652. Grid.Column="1"
  653. LastChildFill="True">
  654. <TextBlock Text="{Binding ResultsValues[4]}"
  655. MinWidth="50" />
  656. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.MoveFinish}" />
  657. </DockPanel>
  658. <TextBlock Grid.Row="6"
  659. Text="{lex:Loc 错误}" />
  660. <DockPanel Grid.Row="6"
  661. Grid.Column="1"
  662. LastChildFill="True">
  663. <TextBlock Text="{Binding ResultsValues[5]}"
  664. MinWidth="50" />
  665. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Error}" />
  666. </DockPanel>
  667. <TextBlock Grid.Row="7"
  668. Text="{lex:Loc 吸真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  669. <DockPanel Grid.Row="7"
  670. Grid.Column="1"
  671. LastChildFill="True">
  672. <TextBlock Text="{Binding ResultsValues[6]}"
  673. MinWidth="50" />
  674. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOn}" />
  675. </DockPanel>
  676. <TextBlock Grid.Row="8"
  677. Text="{lex:Loc 破真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  678. <DockPanel Grid.Row="8"
  679. Grid.Column="1"
  680. LastChildFill="True">
  681. <TextBlock Text="{Binding ResultsValues[7]}"
  682. MinWidth="50" />
  683. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOff}" />
  684. </DockPanel>
  685. <TextBlock Grid.Row="9"
  686. FontWeight="Bold"
  687. Text="{lex:Loc 命令参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  688. <TextBlock Grid.Row="10"
  689. Text="{lex:Loc X坐标}" />
  690. <TextBox Grid.Row="10"
  691. Grid.Column="1"
  692. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.X}" />
  693. <TextBlock Grid.Row="11"
  694. Text="{lex:Loc Y坐标}" />
  695. <TextBox Grid.Row="11"
  696. Grid.Column="1"
  697. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Y}" />
  698. <TextBlock Grid.Row="12"
  699. Text="{lex:Loc Z坐标}" />
  700. <TextBox Grid.Row="12"
  701. Grid.Column="1"
  702. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Z}" />
  703. <TextBlock Grid.Row="13"
  704. Text="{lex:Loc U坐标}" />
  705. <TextBox Grid.Row="13"
  706. Grid.Column="1"
  707. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.U}" />
  708. <TextBlock Grid.Row="14"
  709. Text="{lex:Loc 吸真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  710. <TextBox Grid.Row="14"
  711. Grid.Column="1"
  712. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOn}" />
  713. <TextBlock Grid.Row="15"
  714. Text="{lex:Loc 破真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  715. <TextBox Grid.Row="15"
  716. Grid.Column="1"
  717. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOff}" />
  718. <TextBlock Grid.Row="16"
  719. Text="{lex:Loc Z轴限高}" />
  720. <TextBox Grid.Row="16"
  721. Grid.Column="1"
  722. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Limz}" />
  723. <TextBlock Grid.Row="17"
  724. Text="{lex:Loc 执行运动}" />
  725. <TextBox Grid.Row="17"
  726. Grid.Column="1"
  727. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.ExecuteMove}" />
  728. <TextBlock Grid.Row="18"
  729. Text="{lex:Loc 吸真空}" />
  730. <TextBox Grid.Row="18"
  731. Grid.Column="1"
  732. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOn}" />
  733. <TextBlock Grid.Row="19"
  734. Text="{lex:Loc 破真空}" />
  735. <TextBox Grid.Row="19"
  736. Grid.Column="1"
  737. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOff}" />
  738. <TextBlock Grid.Row="20"
  739. Text="{lex:Loc 步进距离,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  740. <TextBox Grid.Row="20"
  741. Grid.Column="1"
  742. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Distance}" />
  743. <TextBlock Grid.Row="21"
  744. Text="{lex:Loc 点动命令,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  745. <TextBox Grid.Row="21"
  746. Grid.Column="1"
  747. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.JogCmd}" />
  748. </Grid>
  749. </ScrollViewer>-->
  750. </Grid>
  751. </ScrollViewer>
  752. </Grid>
  753. </TabItem>
  754. <!--Feeder-->
  755. <TabItem>
  756. <TabItem.Header>
  757. <StackPanel HorizontalAlignment="Stretch">
  758. <materialDesign:PackIcon Width="24"
  759. Height="24"
  760. HorizontalAlignment="Center"
  761. Kind="Vibrate" />
  762. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  763. FontSize="{DynamicResource Font.Size.Body2}"
  764. Text="Feeder"
  765. HorizontalAlignment="Stretch" />
  766. </StackPanel>
  767. </TabItem.Header>
  768. <Grid Margin="16">
  769. <Grid.RowDefinitions>
  770. <RowDefinition Height="50" />
  771. <RowDefinition Height="*" />
  772. </Grid.RowDefinitions>
  773. <Grid.ColumnDefinitions>
  774. <ColumnDefinition Width="auto" />
  775. <ColumnDefinition Width="*" />
  776. </Grid.ColumnDefinitions>
  777. <!--增删改查-->
  778. <StackPanel Grid.ColumnSpan="2"
  779. IsEnabled="{Binding IsAllowEdit}"
  780. Orientation="Horizontal">
  781. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  782. ToolTip="{lex:Loc 增加Feeder}"
  783. Command="{Binding AddFeederCommand}">
  784. <materialDesign:PackIcon Kind="Plus" />
  785. </Button>
  786. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  787. ToolTip="{lex:Loc 移除Feeder}"
  788. Margin="20,0"
  789. Command="{Binding RemoveFeederCommand}">
  790. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  791. </Button>
  792. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  793. ToolTip="{lex:Loc 保存}"
  794. Command="{Binding SaveFeedersCommand}">
  795. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  796. </Button>
  797. </StackPanel>
  798. <!--Feeder列表-->
  799. <TreeView Grid.Row="1"
  800. Grid.Column="0"
  801. SelectedItemChanged="TreeView_SelectedItemChanged">
  802. <TreeViewItem Header="{lex:Loc Feeder列表}"
  803. FontSize="{DynamicResource Font.Size.Title4}"
  804. FontWeight="Bold"
  805. IsExpanded="True"
  806. ItemsSource="{Binding FeederList}">
  807. <TreeViewItem.ItemTemplate>
  808. <HierarchicalDataTemplate>
  809. <StackPanel Orientation="Vertical">
  810. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  811. <TextBlock.Text>
  812. <MultiBinding StringFormat="{}{0}. {1}">
  813. <Binding Path="FeederNo" />
  814. <Binding Path="FeederName" />
  815. </MultiBinding>
  816. </TextBlock.Text>
  817. </TextBlock>
  818. <StackPanel Orientation="Horizontal">
  819. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  820. FontSize="{DynamicResource Font.Size.Captions3}"
  821. Style="{StaticResource MaterialDesignCaptionTextBlock}" />
  822. <TextBlock Text="{Binding FeederBrand,Mode=TwoWay}"
  823. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  824. FontSize="{DynamicResource Font.Size.Captions3}" />
  825. <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  826. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  827. FontSize="{DynamicResource Font.Size.Captions3}"
  828. Margin="10,0,0,0" />
  829. <TextBlock Text="{Binding ConnectType,Mode=TwoWay}"
  830. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  831. FontSize="{DynamicResource Font.Size.Captions3}" />
  832. </StackPanel>
  833. <StackPanel Orientation="Horizontal">
  834. <TextBlock Text="{Binding IP,StringFormat=IP:{0},Mode=TwoWay}"
  835. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  836. FontSize="{DynamicResource Font.Size.Captions3}" />
  837. <TextBlock Text="{Binding Port,StringFormat=Port:{0},Mode=TwoWay}"
  838. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  839. FontSize="{DynamicResource Font.Size.Captions3}"
  840. Margin="10,0" />
  841. </StackPanel>
  842. <Border Height="2"
  843. Margin="0"
  844. BorderThickness="2"
  845. BorderBrush="Green" />
  846. </StackPanel>
  847. </HierarchicalDataTemplate>
  848. </TreeViewItem.ItemTemplate>
  849. </TreeViewItem>
  850. </TreeView>
  851. <!--参数详情-->
  852. <ScrollViewer Grid.Row="1"
  853. IsEnabled="{Binding IsAllowEdit}"
  854. Grid.Column="1"
  855. Margin="20"
  856. HorizontalAlignment="Left"
  857. VerticalAlignment="Top"
  858. Visibility="{Binding SelectFeeder,Converter={StaticResource ObjectToVisibilityConverter}}">
  859. <Grid Height="300">
  860. <Grid.RowDefinitions>
  861. <RowDefinition />
  862. <RowDefinition />
  863. <RowDefinition />
  864. <RowDefinition />
  865. <RowDefinition />
  866. <RowDefinition />
  867. <RowDefinition />
  868. </Grid.RowDefinitions>
  869. <Grid.ColumnDefinitions>
  870. <ColumnDefinition Width="auto" />
  871. <ColumnDefinition Width="*" />
  872. </Grid.ColumnDefinitions>
  873. <!--id-->
  874. <TextBlock Text="Id: "
  875. Grid.Row="0"
  876. Grid.Column="0"
  877. FontSize="{DynamicResource Font.Size.Body3}"
  878. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  879. HorizontalAlignment="Right"
  880. VerticalAlignment="Center" />
  881. <TextBlock x:Name="txt_Feeder_Id"
  882. Text="{Binding SelectFeeder.Id,Mode=TwoWay}"
  883. Grid.Row="0"
  884. Grid.Column="1"
  885. FontSize="{DynamicResource Font.Size.Body3}"
  886. Margin="10,0"
  887. HorizontalAlignment="Left"
  888. VerticalAlignment="Center" />
  889. <!--名称-->
  890. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  891. Grid.Row="1"
  892. Grid.Column="0"
  893. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  894. FontSize="{DynamicResource Font.Size.Body3}"
  895. HorizontalAlignment="Right"
  896. VerticalAlignment="Center" />
  897. <TextBox Grid.Row="1"
  898. Grid.Column="1"
  899. Margin="10,0"
  900. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  901. FontSize="{DynamicResource Font.Size.Body3}"
  902. MinWidth="80"
  903. TextAlignment="Center"
  904. HorizontalAlignment="Left"
  905. VerticalAlignment="Center">
  906. <TextBox.Text>
  907. <Binding Path="SelectFeeder.FeederName"
  908. Mode="TwoWay">
  909. <Binding.ValidationRules>
  910. <valRules:NameValidationRule />
  911. </Binding.ValidationRules>
  912. </Binding>
  913. </TextBox.Text>
  914. </TextBox>
  915. <!--Feeder品牌-->
  916. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  917. Grid.Row="2"
  918. Grid.Column="0"
  919. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  920. FontSize="{DynamicResource Font.Size.Body3}"
  921. HorizontalAlignment="Right"
  922. VerticalAlignment="Center" />
  923. <ComboBox SelectedItem="{Binding SelectFeeder.FeederBrand,Mode=TwoWay}"
  924. Grid.Row="2"
  925. Grid.Column="1"
  926. Margin="10,0"
  927. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  928. FontSize="{DynamicResource Font.Size.Body3}"
  929. MinWidth="80"
  930. ItemsSource="{ext:EnumBindingSource EnumType=enums1:FeederBrand}"
  931. HorizontalContentAlignment="Center"
  932. HorizontalAlignment="Left"
  933. VerticalAlignment="Center" />
  934. <!--通讯方式-->
  935. <TextBlock Text="{lex:Loc 通讯方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  936. Grid.Row="3"
  937. Grid.Column="0"
  938. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  939. FontSize="{DynamicResource Font.Size.Body3}"
  940. HorizontalAlignment="Right"
  941. VerticalAlignment="Center" />
  942. <ComboBox SelectedItem="{Binding SelectFeeder.ConnectType,Mode=TwoWay}"
  943. Grid.Row="3"
  944. Grid.Column="1"
  945. Margin="10,0"
  946. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  947. MinWidth="80"
  948. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  949. FontSize="{DynamicResource Font.Size.Body3}"
  950. HorizontalContentAlignment="Center"
  951. HorizontalAlignment="Left"
  952. VerticalAlignment="Center" />
  953. <!--IP地址-->
  954. <TextBlock Text="IP: "
  955. Grid.Row="4"
  956. Grid.Column="0"
  957. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  958. FontSize="{DynamicResource Font.Size.Body3}"
  959. HorizontalAlignment="Right"
  960. VerticalAlignment="Center" />
  961. <TextBox Grid.Row="4"
  962. Grid.Column="1"
  963. Margin="10,0"
  964. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  965. FontSize="{DynamicResource Font.Size.Body3}"
  966. MinWidth="80"
  967. TextAlignment="Center"
  968. HorizontalAlignment="Left"
  969. VerticalAlignment="Center">
  970. <TextBox.Text>
  971. <Binding Path="SelectFeeder.IP"
  972. Mode="TwoWay">
  973. <Binding.ValidationRules>
  974. <valRules:IPValidationRule />
  975. </Binding.ValidationRules>
  976. </Binding>
  977. </TextBox.Text>
  978. </TextBox>
  979. <!--端口号-->
  980. <TextBlock Text="Port: "
  981. Grid.Row="5"
  982. Grid.Column="0"
  983. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  984. FontSize="{DynamicResource Font.Size.Body3}"
  985. HorizontalAlignment="Right"
  986. VerticalAlignment="Center" />
  987. <TextBox Grid.Row="5"
  988. Grid.Column="1"
  989. Margin="10,0"
  990. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  991. FontSize="{DynamicResource Font.Size.Body3}"
  992. MinWidth="80"
  993. TextAlignment="Center"
  994. HorizontalAlignment="Left"
  995. VerticalAlignment="Center">
  996. <TextBox.Text>
  997. <Binding Path="SelectFeeder.Port"
  998. Mode="TwoWay">
  999. <Binding.ValidationRules>
  1000. <valRules:PortValidationRule />
  1001. </Binding.ValidationRules>
  1002. </Binding>
  1003. </TextBox.Text>
  1004. </TextBox>
  1005. </Grid>
  1006. </ScrollViewer>
  1007. </Grid>
  1008. </TabItem>
  1009. <!--PLC-->
  1010. <TabItem>
  1011. <TabItem.Header>
  1012. <StackPanel HorizontalAlignment="Stretch">
  1013. <materialDesign:PackIcon Width="24"
  1014. Height="24"
  1015. HorizontalAlignment="Center"
  1016. Kind="CellphoneLink" />
  1017. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1018. FontSize="{DynamicResource Font.Size.Body2}"
  1019. Text="PLC"
  1020. HorizontalAlignment="Stretch" />
  1021. </StackPanel>
  1022. </TabItem.Header>
  1023. <Grid Margin="16">
  1024. <Grid.RowDefinitions>
  1025. <RowDefinition Height="50" />
  1026. <RowDefinition Height="*" />
  1027. </Grid.RowDefinitions>
  1028. <Grid.ColumnDefinitions>
  1029. <ColumnDefinition Width="auto" />
  1030. <ColumnDefinition Width="*" />
  1031. </Grid.ColumnDefinitions>
  1032. <!--增删改查-->
  1033. <StackPanel Grid.ColumnSpan="2"
  1034. IsEnabled="{Binding IsAllowEdit}"
  1035. Orientation="Horizontal">
  1036. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1037. ToolTip="{lex:Loc 增加PLC}"
  1038. Command="{Binding AddPlcCommand}">
  1039. <materialDesign:PackIcon Kind="Plus" />
  1040. </Button>
  1041. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1042. ToolTip="{lex:Loc 移除PLC}"
  1043. Margin="20,0"
  1044. Command="{Binding RemovePlcCommand}">
  1045. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1046. </Button>
  1047. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1048. ToolTip="{lex:Loc 保存}"
  1049. Command="{Binding SavePlcsCommand}">
  1050. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1051. </Button>
  1052. </StackPanel>
  1053. <!--PLC列表-->
  1054. <TreeView Grid.Row="1"
  1055. Grid.Column="0"
  1056. SelectedItemChanged="TreeView_SelectedItemChanged">
  1057. <TreeViewItem Header="{lex:Loc PLC列表}"
  1058. FontSize="{DynamicResource Font.Size.Title4}"
  1059. FontWeight="Bold"
  1060. IsExpanded="True"
  1061. ItemsSource="{Binding PlcList}">
  1062. <TreeViewItem.ItemTemplate>
  1063. <HierarchicalDataTemplate>
  1064. <StackPanel Orientation="Vertical">
  1065. <TextBlock Text="{Binding Name,Mode=TwoWay}"
  1066. FontSize="{DynamicResource Font.Size.Title4}" />
  1067. <StackPanel Orientation="Horizontal">
  1068. <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1069. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1070. FontSize="{DynamicResource Font.Size.Captions3}"
  1071. Margin="10,0,0,0" />
  1072. <TextBlock Text="{Binding CommunicationType,Mode=TwoWay}"
  1073. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1074. FontSize="{DynamicResource Font.Size.Captions3}" />
  1075. </StackPanel>
  1076. <StackPanel Orientation="Horizontal">
  1077. <TextBlock Text="{Binding EndpointUrl,StringFormat=Endpoint Url:{0},Mode=TwoWay}"
  1078. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1079. FontSize="{DynamicResource Font.Size.Captions3}" />
  1080. </StackPanel>
  1081. <Border Height="2"
  1082. Margin="0"
  1083. BorderThickness="2"
  1084. BorderBrush="Green" />
  1085. </StackPanel>
  1086. </HierarchicalDataTemplate>
  1087. </TreeViewItem.ItemTemplate>
  1088. </TreeViewItem>
  1089. </TreeView>
  1090. <!--参数详情-->
  1091. <ScrollViewer Grid.Row="1"
  1092. IsEnabled="{Binding IsAllowEdit}"
  1093. Grid.Column="1"
  1094. Margin="20"
  1095. HorizontalAlignment="Left"
  1096. VerticalAlignment="Top"
  1097. Visibility="{Binding SelectPlc,Converter={StaticResource ObjectToVisibilityConverter}}">
  1098. <Grid Height="200">
  1099. <Grid.RowDefinitions>
  1100. <RowDefinition />
  1101. <RowDefinition />
  1102. <RowDefinition />
  1103. <RowDefinition />
  1104. <RowDefinition />
  1105. </Grid.RowDefinitions>
  1106. <Grid.ColumnDefinitions>
  1107. <ColumnDefinition Width="auto" />
  1108. <ColumnDefinition Width="*" />
  1109. </Grid.ColumnDefinitions>
  1110. <!--id-->
  1111. <TextBlock Text="Id: "
  1112. Grid.Row="0"
  1113. Grid.Column="0"
  1114. FontSize="{DynamicResource Font.Size.Body3}"
  1115. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1116. HorizontalAlignment="Right"
  1117. VerticalAlignment="Center" />
  1118. <TextBlock x:Name="txt_plc_Id"
  1119. Text="{Binding SelectPlc.Id,Mode=TwoWay}"
  1120. Grid.Row="0"
  1121. Grid.Column="1"
  1122. FontSize="{DynamicResource Font.Size.Body3}"
  1123. Margin="10,0"
  1124. HorizontalAlignment="Left"
  1125. VerticalAlignment="Center" />
  1126. <!--名称-->
  1127. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1128. Grid.Row="1"
  1129. Grid.Column="0"
  1130. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1131. FontSize="{DynamicResource Font.Size.Body3}"
  1132. HorizontalAlignment="Right"
  1133. VerticalAlignment="Center" />
  1134. <TextBox Grid.Row="1"
  1135. Grid.Column="1"
  1136. Margin="10,0"
  1137. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1138. FontSize="{DynamicResource Font.Size.Body3}"
  1139. MinWidth="80"
  1140. TextAlignment="Center"
  1141. HorizontalAlignment="Left"
  1142. VerticalAlignment="Center">
  1143. <TextBox.Text>
  1144. <Binding Path="SelectPlc.Name"
  1145. Mode="TwoWay">
  1146. <Binding.ValidationRules>
  1147. <valRules:NameValidationRule />
  1148. </Binding.ValidationRules>
  1149. </Binding>
  1150. </TextBox.Text>
  1151. </TextBox>
  1152. <!--通讯方式-->
  1153. <TextBlock Text="{lex:Loc 通讯方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1154. Grid.Row="2"
  1155. Grid.Column="0"
  1156. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1157. FontSize="{DynamicResource Font.Size.Body3}"
  1158. HorizontalAlignment="Right"
  1159. VerticalAlignment="Center" />
  1160. <ComboBox SelectedItem="{Binding SelectPlc.CommunicationType,Mode=TwoWay}"
  1161. Grid.Row="2"
  1162. Grid.Column="1"
  1163. Margin="10,0"
  1164. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1165. MinWidth="80"
  1166. ItemsSource="{ext:EnumBindingSource EnumType=enums:CommunicationType}"
  1167. FontSize="{DynamicResource Font.Size.Body3}"
  1168. HorizontalContentAlignment="Center"
  1169. HorizontalAlignment="Left"
  1170. VerticalAlignment="Center" />
  1171. <!--Endpoint Url地址-->
  1172. <TextBlock Text="Endpoints Url: "
  1173. Grid.Row="3"
  1174. Grid.Column="0"
  1175. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1176. FontSize="{DynamicResource Font.Size.Body3}"
  1177. HorizontalAlignment="Right"
  1178. VerticalAlignment="Center" />
  1179. <TextBox Grid.Row="3"
  1180. Grid.Column="1"
  1181. Margin="10,0"
  1182. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1183. FontSize="{DynamicResource Font.Size.Body3}"
  1184. MinWidth="80"
  1185. TextAlignment="Center"
  1186. HorizontalAlignment="Left"
  1187. VerticalAlignment="Center"
  1188. Text="{Binding SelectPlc.EndpointUrl}" />
  1189. <!--节点头-->
  1190. <TextBlock Text="{lex:Loc 节点头, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1191. Grid.Row="4"
  1192. Grid.Column="0"
  1193. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1194. FontSize="{DynamicResource Font.Size.Body3}"
  1195. HorizontalAlignment="Right"
  1196. VerticalAlignment="Center" />
  1197. <TextBox Grid.Row="4"
  1198. Grid.Column="1"
  1199. FontSize="{DynamicResource Font.Size.Body3}"
  1200. Margin="10,0"
  1201. MinWidth="80"
  1202. TextAlignment="Center"
  1203. HorizontalAlignment="Left"
  1204. VerticalAlignment="Center"
  1205. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1206. Text="{Binding SelectPlc.NodeHeader,Mode=TwoWay}" />
  1207. </Grid>
  1208. </ScrollViewer>
  1209. </Grid>
  1210. </TabItem>
  1211. <!--光源控制器-->
  1212. <TabItem>
  1213. <TabItem.Header>
  1214. <StackPanel HorizontalAlignment="Stretch">
  1215. <materialDesign:PackIcon Width="24"
  1216. Height="24"
  1217. HorizontalAlignment="Center"
  1218. Kind="TelevisionAmbientLight" />
  1219. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1220. FontSize="{DynamicResource Font.Size.Body2}"
  1221. Text="{lex:Loc 光源控制器}"
  1222. HorizontalAlignment="Stretch" />
  1223. </StackPanel>
  1224. </TabItem.Header>
  1225. <Grid Margin="16">
  1226. <Grid.RowDefinitions>
  1227. <RowDefinition Height="50" />
  1228. <RowDefinition Height="*" />
  1229. </Grid.RowDefinitions>
  1230. <Grid.ColumnDefinitions>
  1231. <ColumnDefinition Width="auto" />
  1232. <ColumnDefinition Width="*" />
  1233. </Grid.ColumnDefinitions>
  1234. <!--增删改查-->
  1235. <StackPanel Grid.ColumnSpan="2"
  1236. IsEnabled="{Binding IsAllowEdit}"
  1237. Orientation="Horizontal">
  1238. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1239. ToolTip="{lex:Loc 增加光源控制器}"
  1240. Command="{Binding AddLightControllerCommand}">
  1241. <materialDesign:PackIcon Kind="Plus" />
  1242. </Button>
  1243. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1244. ToolTip="{lex:Loc 移除光源控制器}"
  1245. Margin="20,0"
  1246. Command="{Binding RemoveLightControllerCommand}">
  1247. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1248. </Button>
  1249. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1250. ToolTip="{lex:Loc 保存}"
  1251. Command="{Binding SaveLightControllersCommand}">
  1252. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1253. </Button>
  1254. </StackPanel>
  1255. <!--控制器列表-->
  1256. <TreeView Grid.Row="1"
  1257. Grid.Column="0"
  1258. SelectedItemChanged="TreeView_SelectedItemChanged">
  1259. <TreeViewItem Header="{lex:Loc 光源控制器列表}"
  1260. FontSize="{DynamicResource Font.Size.Title4}"
  1261. FontWeight="Bold"
  1262. IsExpanded="True"
  1263. ItemsSource="{Binding LightControllerList}">
  1264. <TreeViewItem.ItemTemplate>
  1265. <HierarchicalDataTemplate>
  1266. <StackPanel Orientation="Vertical">
  1267. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  1268. <TextBlock.Text>
  1269. <MultiBinding StringFormat="{}{0}. {1}">
  1270. <Binding Path="Id" />
  1271. <Binding Path="Name" />
  1272. </MultiBinding>
  1273. </TextBlock.Text>
  1274. </TextBlock>
  1275. <StackPanel Orientation="Horizontal">
  1276. <TextBlock Text="{lex:Loc 型号, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1277. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1278. FontSize="{DynamicResource Font.Size.Captions3}"
  1279. Margin="10,0,0,0" />
  1280. <TextBlock Text="{Binding LightModel,Mode=TwoWay}"
  1281. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1282. FontSize="{DynamicResource Font.Size.Captions3}" />
  1283. </StackPanel>
  1284. <StackPanel Orientation="Horizontal">
  1285. <TextBlock Text="{lex:Loc 通道数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1286. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1287. FontSize="{DynamicResource Font.Size.Captions3}"
  1288. Margin="10,0,0,0" />
  1289. <TextBlock Text="{Binding ChannelCount,Mode=TwoWay}"
  1290. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1291. FontSize="{DynamicResource Font.Size.Captions3}" />
  1292. </StackPanel>
  1293. <Border Height="2"
  1294. Margin="0"
  1295. BorderThickness="2"
  1296. BorderBrush="Green" />
  1297. </StackPanel>
  1298. </HierarchicalDataTemplate>
  1299. </TreeViewItem.ItemTemplate>
  1300. </TreeViewItem>
  1301. </TreeView>
  1302. <!--参数详情-->
  1303. <ScrollViewer Grid.Row="1"
  1304. IsEnabled="{Binding IsAllowEdit}"
  1305. Grid.Column="1"
  1306. Margin="20"
  1307. HorizontalAlignment="Left"
  1308. VerticalAlignment="Top"
  1309. Visibility="{Binding SelectLightController,Converter={StaticResource ObjectToVisibilityConverter}}">
  1310. <Grid>
  1311. <Grid.RowDefinitions>
  1312. <RowDefinition Height="Auto" />
  1313. <RowDefinition Height="Auto" />
  1314. <RowDefinition Height="Auto" />
  1315. <RowDefinition Height="Auto" />
  1316. <RowDefinition Height="Auto" />
  1317. <RowDefinition Height="*" />
  1318. </Grid.RowDefinitions>
  1319. <Grid.ColumnDefinitions>
  1320. <ColumnDefinition Width="auto" />
  1321. <ColumnDefinition Width="*" MinWidth="200"/>
  1322. </Grid.ColumnDefinitions>
  1323. <!-- Id -->
  1324. <TextBlock Text="Id: "
  1325. Grid.Row="0"
  1326. Grid.Column="0"
  1327. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1328. HorizontalAlignment="Right"
  1329. VerticalAlignment="Center" />
  1330. <TextBlock Text="{Binding SelectLightController.Id}"
  1331. Grid.Row="0"
  1332. Grid.Column="1"
  1333. Margin="10,0"
  1334. VerticalAlignment="Center" />
  1335. <!-- Name -->
  1336. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1337. Grid.Row="1"
  1338. Grid.Column="0"
  1339. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1340. HorizontalAlignment="Right"
  1341. VerticalAlignment="Center" />
  1342. <TextBox Grid.Row="1"
  1343. Grid.Column="1"
  1344. Margin="10,0"
  1345. Text="{Binding SelectLightController.Name,Mode=TwoWay}" />
  1346. <!-- Model -->
  1347. <TextBlock Text="{lex:Loc 型号, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1348. Grid.Row="2"
  1349. Grid.Column="0"
  1350. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1351. HorizontalAlignment="Right"
  1352. VerticalAlignment="Center" />
  1353. <ComboBox Grid.Row="2"
  1354. Grid.Column="1"
  1355. Margin="10,0"
  1356. SelectedItem="{Binding SelectLightController.LightModel,Mode=TwoWay}"
  1357. ItemsSource="{ext:EnumBindingSource EnumType=coreLights:LightModel}" />
  1358. <!-- Channel count -->
  1359. <TextBlock Text="{lex:Loc 通道数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1360. Grid.Row="3"
  1361. Grid.Column="0"
  1362. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1363. HorizontalAlignment="Right"
  1364. VerticalAlignment="Center" />
  1365. <TextBox Grid.Row="3"
  1366. Grid.Column="1"
  1367. Margin="10,0"
  1368. Text="{Binding SelectLightController.ChannelCount,Mode=TwoWay}"
  1369. IsReadOnly="True" />
  1370. <!-- Channel configs list -->
  1371. <TextBlock Text="{lex:Loc 通道配置}"
  1372. Grid.Row="4"
  1373. Grid.Column="0"
  1374. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1375. HorizontalAlignment="Right"
  1376. VerticalAlignment="Top" />
  1377. <ItemsControl Grid.Row="4"
  1378. Grid.Column="1"
  1379. Margin="10,0"
  1380. ItemsSource="{Binding SelectLightController.ChannelConfigs}">
  1381. <ItemsControl.ItemTemplate>
  1382. <DataTemplate>
  1383. <StackPanel Orientation="Horizontal"
  1384. Margin="0,4">
  1385. <TextBlock Text="{Binding LocalIndex}"
  1386. Width="30"
  1387. VerticalAlignment="Center" />
  1388. <TextBox Text="{Binding Name,Mode=TwoWay}"
  1389. Width="180"
  1390. Margin="6,0" />
  1391. <TextBlock Text="亮度:"
  1392. VerticalAlignment="Center"
  1393. Margin="6,0" />
  1394. <TextBox Text="{Binding DefaultBrightness,Mode=TwoWay}"
  1395. Width="80" />
  1396. </StackPanel>
  1397. </DataTemplate>
  1398. </ItemsControl.ItemTemplate>
  1399. </ItemsControl>
  1400. <!-- Serial port config (visible for serial model) -->
  1401. <GroupBox Grid.Row="5"
  1402. Grid.ColumnSpan="2"
  1403. Header="{lex:Loc 串口配置}"
  1404. Margin="0,12,0,0">
  1405. <GroupBox.Style>
  1406. <Style TargetType="GroupBox">
  1407. <Setter Property="Visibility"
  1408. Value="Collapsed" />
  1409. <Style.Triggers>
  1410. <DataTrigger Binding="{Binding SelectLightController.LightModel}"
  1411. Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
  1412. <Setter Property="Visibility"
  1413. Value="Visible" />
  1414. </DataTrigger>
  1415. </Style.Triggers>
  1416. </Style>
  1417. </GroupBox.Style>
  1418. <Grid Margin="10">
  1419. <Grid.ColumnDefinitions>
  1420. <ColumnDefinition Width="auto" />
  1421. <ColumnDefinition Width="*" />
  1422. </Grid.ColumnDefinitions>
  1423. <Grid.RowDefinitions>
  1424. <RowDefinition Height="Auto" />
  1425. <RowDefinition Height="Auto" />
  1426. <RowDefinition Height="Auto" />
  1427. <RowDefinition Height="Auto" />
  1428. <RowDefinition Height="Auto" />
  1429. </Grid.RowDefinitions>
  1430. <TextBlock Text="PortName:"
  1431. Grid.Row="0"
  1432. Grid.Column="0"
  1433. HorizontalAlignment="Right" />
  1434. <TextBox Text="{Binding SelectLightController.SerialPortConfig.PortName,Mode=TwoWay}"
  1435. Grid.Row="0"
  1436. Grid.Column="1"
  1437. Margin="6,0" />
  1438. <TextBlock Text="BaudRate:"
  1439. Grid.Row="1"
  1440. Grid.Column="0"
  1441. HorizontalAlignment="Right" />
  1442. <TextBox Text="{Binding SelectLightController.SerialPortConfig.BaudRate,Mode=TwoWay}"
  1443. Grid.Row="1"
  1444. Grid.Column="1"
  1445. Margin="6,0" />
  1446. <TextBlock Text="Parity:"
  1447. Grid.Row="2"
  1448. Grid.Column="0"
  1449. HorizontalAlignment="Right" />
  1450. <ComboBox Grid.Row="2"
  1451. Grid.Column="1"
  1452. SelectedItem="{Binding SelectLightController.SerialPortConfig.Parity,Mode=TwoWay}"
  1453. ItemsSource="{Binding Source={StaticResource Parity}}"/>
  1454. <TextBlock Text="StopBits:"
  1455. Grid.Row="3"
  1456. Grid.Column="0"
  1457. HorizontalAlignment="Right" />
  1458. <ComboBox Grid.Row="3"
  1459. Grid.Column="1"
  1460. SelectedItem="{Binding SelectLightController.SerialPortConfig.StopBits,Mode=TwoWay}"
  1461. ItemsSource="{Binding Source={StaticResource StopBits}}" />
  1462. <TextBlock Text="DataBits:"
  1463. Grid.Row="4"
  1464. Grid.Column="0"
  1465. HorizontalAlignment="Right" />
  1466. <TextBox Text="{Binding SelectLightController.SerialPortConfig.DataBits,Mode=TwoWay}"
  1467. Grid.Row="4"
  1468. Grid.Column="1"
  1469. Margin="6,0" />
  1470. </Grid>
  1471. </GroupBox>
  1472. <!-- TCP config (visible for non-serial models) -->
  1473. <GroupBox Grid.Row="5"
  1474. Grid.ColumnSpan="2"
  1475. Header="{lex:Loc TCP配置}"
  1476. Margin="0,12,0,0">
  1477. <GroupBox.Style>
  1478. <Style TargetType="GroupBox">
  1479. <Setter Property="Visibility"
  1480. Value="Visible" />
  1481. <Style.Triggers>
  1482. <DataTrigger Binding="{Binding SelectLightController.LightModel}"
  1483. Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
  1484. <Setter Property="Visibility"
  1485. Value="Collapsed" />
  1486. </DataTrigger>
  1487. </Style.Triggers>
  1488. </Style>
  1489. </GroupBox.Style>
  1490. <Grid Margin="10">
  1491. <Grid.ColumnDefinitions>
  1492. <ColumnDefinition Width="auto" />
  1493. <ColumnDefinition Width="*" />
  1494. </Grid.ColumnDefinitions>
  1495. <Grid.RowDefinitions>
  1496. <RowDefinition Height="Auto" />
  1497. <RowDefinition Height="Auto" />
  1498. </Grid.RowDefinitions>
  1499. <TextBlock Text="IP:"
  1500. Grid.Row="0"
  1501. Grid.Column="0"
  1502. HorizontalAlignment="Right" />
  1503. <TextBox Text="{Binding SelectLightController.TcpConfig.IP,Mode=TwoWay}"
  1504. Grid.Row="0"
  1505. Grid.Column="1"
  1506. Margin="6,0" />
  1507. <TextBlock Text="Port:"
  1508. Grid.Row="1"
  1509. Grid.Column="0"
  1510. HorizontalAlignment="Right" />
  1511. <TextBox Text="{Binding SelectLightController.TcpConfig.Port,Mode=TwoWay}"
  1512. Grid.Row="1"
  1513. Grid.Column="1"
  1514. Margin="6,0" />
  1515. </Grid>
  1516. </GroupBox>
  1517. </Grid>
  1518. </ScrollViewer>
  1519. </Grid>
  1520. </TabItem>
  1521. <!--螺丝供料器-->
  1522. <TabItem>
  1523. <TabItem.Header>
  1524. <StackPanel HorizontalAlignment="Stretch">
  1525. <materialDesign:PackIcon Width="24"
  1526. Height="24"
  1527. HorizontalAlignment="Center"
  1528. Kind="Screwdriver" />
  1529. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1530. FontSize="{DynamicResource Font.Size.Body2}"
  1531. Text="{lex:Loc 螺丝供料器}"
  1532. HorizontalAlignment="Stretch" />
  1533. </StackPanel>
  1534. </TabItem.Header>
  1535. <Grid Margin="16">
  1536. <Grid.RowDefinitions>
  1537. <RowDefinition Height="50" />
  1538. <RowDefinition Height="*" />
  1539. </Grid.RowDefinitions>
  1540. <Grid.ColumnDefinitions>
  1541. <ColumnDefinition Width="auto" />
  1542. <ColumnDefinition Width="*" />
  1543. </Grid.ColumnDefinitions>
  1544. <!--增删改查-->
  1545. <StackPanel Grid.ColumnSpan="2"
  1546. IsEnabled="{Binding IsAllowEdit}"
  1547. Orientation="Horizontal">
  1548. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1549. ToolTip="增加螺丝供料器"
  1550. Command="{Binding AddScrewFeederCommand}">
  1551. <materialDesign:PackIcon Kind="Plus" />
  1552. </Button>
  1553. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1554. ToolTip="移除螺丝供料器"
  1555. Margin="20,0"
  1556. Command="{Binding RemoveScrewFeederCommand}">
  1557. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1558. </Button>
  1559. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1560. ToolTip="{lex:Loc 保存}"
  1561. Command="{Binding SaveScrewFeedersCommand}">
  1562. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1563. </Button>
  1564. </StackPanel>
  1565. <!--PLC列表-->
  1566. <TreeView Grid.Row="1"
  1567. Grid.Column="0"
  1568. SelectedItemChanged="TreeView_SelectedItemChanged">
  1569. <TreeViewItem Header="螺丝供料器列表"
  1570. FontSize="{DynamicResource Font.Size.Title4}"
  1571. FontWeight="Bold"
  1572. IsExpanded="True"
  1573. ItemsSource="{Binding ScrewFeederList}">
  1574. <TreeViewItem.ItemTemplate>
  1575. <HierarchicalDataTemplate>
  1576. <StackPanel Orientation="Vertical">
  1577. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  1578. <TextBlock.Text>
  1579. <MultiBinding StringFormat="{}{0} . {1}">
  1580. <Binding Path="FeederNumber" />
  1581. <Binding Path="Name" />
  1582. </MultiBinding>
  1583. </TextBlock.Text>
  1584. </TextBlock>
  1585. <StackPanel Orientation="Horizontal">
  1586. <TextBlock Text="每包螺丝的数量:"
  1587. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1588. FontSize="{DynamicResource Font.Size.Captions3}"
  1589. Margin="10,0,0,0" />
  1590. <TextBlock Text="{Binding PackSize,Mode=TwoWay}"
  1591. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1592. FontSize="{DynamicResource Font.Size.Captions3}" />
  1593. </StackPanel>
  1594. <StackPanel Orientation="Horizontal">
  1595. <TextBlock Text="低量报警阈值:"
  1596. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1597. FontSize="{DynamicResource Font.Size.Captions3}"
  1598. Margin="10,0,0,0" />
  1599. <TextBlock Text="{Binding LowLevelThreshold,Mode=TwoWay}"
  1600. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1601. FontSize="{DynamicResource Font.Size.Captions3}" />
  1602. </StackPanel>
  1603. <StackPanel Orientation="Horizontal">
  1604. <TextBlock Text="是否启用低量报警:"
  1605. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1606. FontSize="{DynamicResource Font.Size.Captions3}"
  1607. Margin="10,0,0,0" />
  1608. <CheckBox IsChecked="{Binding LowLevelAlarmEnabled,Mode=TwoWay}"
  1609. IsEnabled="False"
  1610. FontSize="{DynamicResource Font.Size.Captions3}" />
  1611. </StackPanel>
  1612. <Border Height="2"
  1613. Margin="0"
  1614. BorderThickness="2"
  1615. BorderBrush="Green" />
  1616. </StackPanel>
  1617. </HierarchicalDataTemplate>
  1618. </TreeViewItem.ItemTemplate>
  1619. </TreeViewItem>
  1620. </TreeView>
  1621. <!--参数详情-->
  1622. <ScrollViewer Grid.Row="1"
  1623. IsEnabled="{Binding IsAllowEdit}"
  1624. Grid.Column="1"
  1625. Margin="20"
  1626. HorizontalAlignment="Left"
  1627. VerticalAlignment="Top"
  1628. Visibility="{Binding SelectScrewFeeder,Converter={StaticResource ObjectToVisibilityConverter}}">
  1629. <Grid>
  1630. <Grid.RowDefinitions>
  1631. <RowDefinition Height="Auto" />
  1632. <RowDefinition Height="Auto" />
  1633. <RowDefinition Height="Auto" />
  1634. <RowDefinition Height="Auto" />
  1635. <RowDefinition Height="Auto" />
  1636. <RowDefinition Height="Auto" />
  1637. <RowDefinition Height="Auto" />
  1638. <RowDefinition Height="40" />
  1639. </Grid.RowDefinitions>
  1640. <Grid.ColumnDefinitions>
  1641. <ColumnDefinition Width="auto" />
  1642. <ColumnDefinition Width="200" />
  1643. <ColumnDefinition Width="*" />
  1644. </Grid.ColumnDefinitions>
  1645. <!-- Id -->
  1646. <TextBlock Text="Id: "
  1647. Grid.Row="0"
  1648. Grid.Column="0"
  1649. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1650. HorizontalAlignment="Right"
  1651. VerticalAlignment="Center" />
  1652. <TextBlock Text="{Binding SelectScrewFeeder.Id}"
  1653. Grid.Row="0"
  1654. Grid.Column="1"
  1655. Margin="10,0"
  1656. VerticalAlignment="Center" />
  1657. <!-- Name -->
  1658. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1659. Grid.Row="1"
  1660. Grid.Column="0"
  1661. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1662. HorizontalAlignment="Right"
  1663. VerticalAlignment="Center" />
  1664. <TextBox Grid.Row="1"
  1665. Grid.Column="1"
  1666. Margin="10,0"
  1667. Text="{Binding SelectScrewFeeder.Name,Mode=TwoWay}" />
  1668. <!-- 供料器编号 -->
  1669. <!--<TextBlock Text="供料器编号:"
  1670. Grid.Row="2"
  1671. Grid.Column="0"
  1672. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1673. HorizontalAlignment="Right"
  1674. VerticalAlignment="Center" />
  1675. <TextBox Text="{Binding SelectScrewFeeder.FeederNumber,Mode=TwoWay}"
  1676. Grid.Row="2"
  1677. Grid.Column="1"
  1678. Margin="10,0"
  1679. Width="200"
  1680. TextAlignment="Center" />-->
  1681. <!-- 每包螺丝数量 -->
  1682. <TextBlock Text="每包螺丝数量:"
  1683. Grid.Row="3"
  1684. Grid.Column="0"
  1685. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1686. HorizontalAlignment="Right"
  1687. VerticalAlignment="Center" />
  1688. <mah:NumericUpDown Grid.Row="3"
  1689. Grid.Column="1"
  1690. Margin="10,0"
  1691. Width="200"
  1692. Minimum="0"
  1693. Maximum="10000"
  1694. Value="{Binding SelectScrewFeeder.PackSize,Mode=TwoWay}"
  1695. FontSize="{DynamicResource Font.Size.Body3}" />
  1696. <!-- 低量报警阈值 -->
  1697. <TextBlock Text="低量报警阈值:"
  1698. Grid.Row="4"
  1699. Grid.Column="0"
  1700. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1701. HorizontalAlignment="Right"
  1702. VerticalAlignment="Center" />
  1703. <mah:NumericUpDown Grid.Row="4"
  1704. Grid.Column="1"
  1705. Margin="10,0"
  1706. Width="200"
  1707. Minimum="0"
  1708. Maximum="10000"
  1709. Value="{Binding SelectScrewFeeder.LowLevelThreshold,Mode=TwoWay}"
  1710. FontSize="{DynamicResource Font.Size.Body3}" />
  1711. <!-- 是否启用低量报警 -->
  1712. <TextBlock Grid.Row="5"
  1713. Grid.Column="0"
  1714. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1715. HorizontalAlignment="Right"
  1716. VerticalAlignment="Center" />
  1717. <CheckBox Grid.Row="5"
  1718. Grid.Column="1"
  1719. Margin="10,0"
  1720. IsChecked="{Binding SelectScrewFeeder.LowLevelAlarmEnabled,Mode=TwoWay}"
  1721. VerticalAlignment="Center" />
  1722. </Grid>
  1723. </ScrollViewer>
  1724. </Grid>
  1725. </TabItem>
  1726. <!--通讯-->
  1727. <TabItem>
  1728. <TabItem.Header>
  1729. <StackPanel HorizontalAlignment="Stretch">
  1730. <materialDesign:PackIcon Width="24"
  1731. Height="24"
  1732. HorizontalAlignment="Center"
  1733. Kind="Lan" />
  1734. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1735. FontSize="{DynamicResource Font.Size.Body2}"
  1736. Text="{lex:Loc 通讯}"
  1737. HorizontalAlignment="Stretch" />
  1738. </StackPanel>
  1739. </TabItem.Header>
  1740. <Grid Margin="20"
  1741. IsEnabled="{Binding IsAllowEdit}">
  1742. <Grid.ColumnDefinitions>
  1743. <ColumnDefinition Width="auto" />
  1744. <ColumnDefinition Width="auto" />
  1745. </Grid.ColumnDefinitions>
  1746. <Grid.RowDefinitions>
  1747. <RowDefinition Height="auto" />
  1748. <RowDefinition Height=" auto" />
  1749. </Grid.RowDefinitions>
  1750. <Button Style="{StaticResource MaterialDesignRaisedButton}"
  1751. materialDesign:ButtonAssist.CornerRadius="10"
  1752. Width="60"
  1753. ToolTip="{lex:Loc 保存}"
  1754. HorizontalAlignment="Left"
  1755. Command="{Binding SaveCommunicateCommand}"
  1756. CommandParameter="TCPIP">
  1757. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1758. </Button>
  1759. <GroupBox Grid.Row="1"
  1760. Header="{lex:Loc 后台TCPIP服务器}"
  1761. FontSize="{DynamicResource Font.Size.Title4}"
  1762. Margin="5,5">
  1763. <Grid Margin="20">
  1764. <Grid.ColumnDefinitions>
  1765. <ColumnDefinition Width="auto" />
  1766. <ColumnDefinition Width="auto" />
  1767. </Grid.ColumnDefinitions>
  1768. <Grid.RowDefinitions>
  1769. <RowDefinition Height="auto" />
  1770. <RowDefinition Height=" auto" />
  1771. <RowDefinition Height=" auto" />
  1772. </Grid.RowDefinitions>
  1773. <!--port-->
  1774. <TextBlock Margin="0,0,0,8"
  1775. Text="Port: "
  1776. VerticalAlignment="Center"
  1777. FontSize="{DynamicResource Font.Size.Body3}"
  1778. HorizontalAlignment="Right" />
  1779. <TextBox Grid.Row="0"
  1780. Grid.Column="1"
  1781. Margin="10,4"
  1782. MinWidth="80"
  1783. FontSize="{DynamicResource Font.Size.Body3}"
  1784. TextAlignment="Center"
  1785. HorizontalAlignment="Left"
  1786. VerticalAlignment="Center">
  1787. <TextBox.Text>
  1788. <Binding Path="BgTcp.Port"
  1789. Mode="TwoWay">
  1790. <Binding.ValidationRules>
  1791. <valRules:PortValidationRule />
  1792. </Binding.ValidationRules>
  1793. </Binding>
  1794. </TextBox.Text>
  1795. </TextBox>
  1796. <!--结束符-->
  1797. <TextBlock Margin="0,0,0,8"
  1798. Grid.Row="1"
  1799. VerticalAlignment="Center"
  1800. Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1801. FontSize="{DynamicResource Font.Size.Body3}"
  1802. HorizontalAlignment="Right" />
  1803. <ComboBox SelectedItem="{Binding BgTcp.Terminator,Mode=TwoWay}"
  1804. Grid.Row="1"
  1805. Grid.Column="1"
  1806. Margin="10,4"
  1807. MinWidth="80"
  1808. HorizontalContentAlignment="Center"
  1809. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  1810. FontSize="{DynamicResource Font.Size.Body3}"
  1811. HorizontalAlignment="Left"
  1812. VerticalAlignment="Center" />
  1813. <!--编码格式-->
  1814. <TextBlock Text="{lex:Loc 编码解码, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1815. Grid.Row="2"
  1816. VerticalAlignment="Center"
  1817. Grid.Column="0"
  1818. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1819. FontSize="{DynamicResource Font.Size.Body3}"
  1820. HorizontalAlignment="Right" />
  1821. <ComboBox SelectedItem="{Binding BgTcp.DataEncoding,Mode=TwoWay}"
  1822. Grid.Row="2"
  1823. Grid.Column="1"
  1824. Margin="10,4"
  1825. MinWidth="80"
  1826. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  1827. FontSize="{DynamicResource Font.Size.Body3}"
  1828. HorizontalContentAlignment="Center"
  1829. HorizontalAlignment="Left"
  1830. VerticalAlignment="Center" />
  1831. </Grid>
  1832. </GroupBox>
  1833. <Button Grid.Column="1"
  1834. Style="{StaticResource MaterialDesignRaisedButton}"
  1835. materialDesign:ButtonAssist.CornerRadius="10"
  1836. Width="60"
  1837. ToolTip="{lex:Loc 保存}"
  1838. HorizontalAlignment="Left"
  1839. Command="{Binding SaveCommunicateCommand}"
  1840. CommandParameter="ModbusTCP">
  1841. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1842. </Button>
  1843. <materialDesign:PopupBox Grid.Column="1"
  1844. HorizontalAlignment="Right"
  1845. VerticalAlignment="Center">
  1846. <StackPanel Orientation="Vertical"
  1847. Margin="10">
  1848. <TextBlock TextWrapping="Wrap"
  1849. TextAlignment="Left"
  1850. Text="功能码 1 ReadCoils 读取DO的状态" />
  1851. <TextBlock TextWrapping="Wrap"
  1852. TextAlignment="Left"
  1853. Text="功能码 2 ReadInputs 读取DI的状态" />
  1854. <TextBlock TextWrapping="Wrap"
  1855. TextAlignment="Left"
  1856. Text="功能码 3 ReadHoldingRegisters 读取AO的值" />
  1857. <TextBlock TextWrapping="Wrap"
  1858. TextAlignment="Left"
  1859. Text="功能码 4 ReadInputRegisters 读取AI的值" />
  1860. <TextBlock TextWrapping="Wrap"
  1861. TextAlignment="Left"
  1862. Text="功能码 5 WriteSingleCoil 写入值到DO" />
  1863. <TextBlock TextWrapping="Wrap"
  1864. TextAlignment="Left"
  1865. Text="功能码 6 WriteSingleRegister 写入值到AO" />
  1866. <TextBlock TextWrapping="Wrap"
  1867. TextAlignment="Left"
  1868. Text="功能码 15 WriteMultipleCoils 写多线圈寄存器" />
  1869. <TextBlock TextWrapping="Wrap"
  1870. TextAlignment="Left"
  1871. Text="功能码 16 WriteMultipleRegisters 写多个保持寄存器" />
  1872. <TextBlock TextWrapping="Wrap"
  1873. TextAlignment="Left"
  1874. Text="功能码 23 ReadWriteMultipleRegisters 读写多个保持寄存器" />
  1875. </StackPanel>
  1876. </materialDesign:PopupBox>
  1877. <GroupBox Grid.Row="1"
  1878. Margin=" 5,5"
  1879. Grid.Column="1"
  1880. Header="{lex:Loc 后台ModbusTCPSlave}"
  1881. FontSize="{DynamicResource Font.Size.Title4}">
  1882. <Grid Margin="20">
  1883. <Grid.ColumnDefinitions>
  1884. <ColumnDefinition Width="auto" />
  1885. <ColumnDefinition Width="auto" />
  1886. </Grid.ColumnDefinitions>
  1887. <Grid.RowDefinitions>
  1888. <RowDefinition Height="auto" />
  1889. <RowDefinition Height=" auto" />
  1890. <RowDefinition Height=" auto" />
  1891. <RowDefinition Height=" auto" />
  1892. </Grid.RowDefinitions>
  1893. <!--IP-->
  1894. <TextBlock Margin="0,0,0,8"
  1895. Text="IP: "
  1896. FontSize="{DynamicResource Font.Size.Body3}"
  1897. VerticalAlignment="Center"
  1898. HorizontalAlignment="Right" />
  1899. <TextBox Grid.Row="0"
  1900. Grid.Column="1"
  1901. Margin="10,4"
  1902. MinWidth="80"
  1903. TextAlignment="Center"
  1904. HorizontalAlignment="Left"
  1905. VerticalAlignment="Center"
  1906. FontSize="{DynamicResource Font.Size.Body3}"
  1907. Text="{Binding BgModbus.IP,Mode=TwoWay}" />
  1908. <!--port-->
  1909. <TextBlock Grid.Row="1"
  1910. Margin="0,0,0,8"
  1911. Text="Port: "
  1912. FontSize="{DynamicResource Font.Size.Body3}"
  1913. VerticalAlignment="Center"
  1914. HorizontalAlignment="Right" />
  1915. <TextBox Grid.Row="1"
  1916. Grid.Column="1"
  1917. Margin="10,4"
  1918. MinWidth="80"
  1919. TextAlignment="Center"
  1920. HorizontalAlignment="Left"
  1921. VerticalAlignment="Center"
  1922. FontSize="{DynamicResource Font.Size.Body3}"
  1923. Text="{Binding BgModbus.Port,Mode=TwoWay}" />
  1924. <!--SlaveID-->
  1925. <TextBlock Grid.Row="2"
  1926. Margin="0,0,0,8"
  1927. VerticalAlignment="Center"
  1928. Text="SlaveID: "
  1929. FontSize="{DynamicResource Font.Size.Body3}"
  1930. HorizontalAlignment="Right" />
  1931. <TextBox Grid.Row="2"
  1932. Grid.Column="1"
  1933. Margin="10,4"
  1934. MinWidth="80"
  1935. TextAlignment="Center"
  1936. HorizontalAlignment="Left"
  1937. VerticalAlignment="Center"
  1938. FontSize="{DynamicResource Font.Size.Body3}"
  1939. Text="{Binding BgModbus.SlaveID,Mode=TwoWay}" />
  1940. <!--是否启用-->
  1941. <TextBlock Margin="0,0,0,8"
  1942. Grid.Row="3"
  1943. Text="{lex:Loc 是否启用, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1944. FontSize="{DynamicResource Font.Size.Body3}"
  1945. VerticalAlignment="Center"
  1946. HorizontalAlignment="Right" />
  1947. <ToggleButton Grid.Row="3"
  1948. Grid.Column="1"
  1949. Margin="10,4"
  1950. MinWidth="80"
  1951. IsChecked="{Binding BgModbus.IsEnabled,Mode=TwoWay}"
  1952. HorizontalContentAlignment="Center"
  1953. HorizontalAlignment="Left"
  1954. VerticalAlignment="Center" />
  1955. </Grid>
  1956. </GroupBox>
  1957. </Grid>
  1958. </TabItem>
  1959. <!--系统参数-->
  1960. <TabItem>
  1961. <TabItem.Header>
  1962. <StackPanel HorizontalAlignment="Stretch">
  1963. <materialDesign:PackIcon Width="24"
  1964. Height="24"
  1965. HorizontalAlignment="Center"
  1966. Kind="CellphoneSystemUpdate" />
  1967. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1968. FontSize="{DynamicResource Font.Size.Body2}"
  1969. Text="{lex:Loc 系统参数}"
  1970. HorizontalAlignment="Stretch" />
  1971. </StackPanel>
  1972. </TabItem.Header>
  1973. <StackPanel Orientation="Vertical"
  1974. Margin="20">
  1975. <Grid>
  1976. <Grid.ColumnDefinitions>
  1977. <ColumnDefinition Width="auto" />
  1978. <ColumnDefinition Width="200" />
  1979. <ColumnDefinition Width="*" />
  1980. </Grid.ColumnDefinitions>
  1981. <Grid.RowDefinitions>
  1982. <RowDefinition Height="Auto" />
  1983. <RowDefinition Height="Auto" />
  1984. <RowDefinition Height="Auto" />
  1985. <RowDefinition Height="Auto" />
  1986. <RowDefinition Height="Auto" />
  1987. <RowDefinition Height="Auto" />
  1988. <RowDefinition Height="Auto" />
  1989. <RowDefinition Height="Auto" />
  1990. <RowDefinition Height="Auto" />
  1991. <RowDefinition Height="Auto" />
  1992. <RowDefinition Height="40" />
  1993. </Grid.RowDefinitions>
  1994. <!-- 相机拍照次数 -->
  1995. <TextBlock Grid.Row="0"
  1996. Grid.Column="0"
  1997. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1998. VerticalAlignment="Center"
  1999. HorizontalAlignment="Right"
  2000. Margin="0,6,10,6"
  2001. Text="下相机拍照次数:" />
  2002. <mah:NumericUpDown Grid.Row="0"
  2003. Grid.Column="1"
  2004. Margin="0,6"
  2005. Value="{Binding DowmCameraNum,Mode=TwoWay}"
  2006. Minimum="0"
  2007. Maximum="100"
  2008. FontSize="{DynamicResource Font.Size.Body3}" />
  2009. <!-- 上相机取料拍照次数 -->
  2010. <TextBlock Grid.Row="1"
  2011. Grid.Column="0"
  2012. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2013. VerticalAlignment="Center"
  2014. HorizontalAlignment="Right"
  2015. Margin="0,6,10,6"
  2016. Text="上相机取料拍照次数:" />
  2017. <mah:NumericUpDown Grid.Row="1"
  2018. Grid.Column="1"
  2019. Margin="0,6"
  2020. Value="{Binding UpCameraPickNum,Mode=TwoWay}"
  2021. Minimum="0"
  2022. Maximum="100"
  2023. FontSize="{DynamicResource Font.Size.Body3}" />
  2024. <!-- 上相机放料拍照次数 -->
  2025. <TextBlock Grid.Row="2"
  2026. Grid.Column="0"
  2027. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2028. VerticalAlignment="Center"
  2029. HorizontalAlignment="Right"
  2030. Margin="0,6,10,6"
  2031. Text="上相机放料拍照次数:" />
  2032. <mah:NumericUpDown Grid.Row="2"
  2033. Grid.Column="1"
  2034. Margin="0,6"
  2035. Value="{Binding UpCameraPutNum,Mode=TwoWay}"
  2036. Minimum="0"
  2037. Maximum="100"
  2038. FontSize="{DynamicResource Font.Size.Body3}" />
  2039. <!-- 上相机锁附/组装次数 -->
  2040. <TextBlock Grid.Row="3"
  2041. Grid.Column="0"
  2042. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2043. VerticalAlignment="Center"
  2044. HorizontalAlignment="Right"
  2045. Margin="0,6,10,6"
  2046. Text="上相机锁附/组装次数:" />
  2047. <mah:NumericUpDown Grid.Row="3"
  2048. Grid.Column="1"
  2049. Margin="0,6"
  2050. Value="{Binding UPCameracheckNum,Mode=TwoWay}"
  2051. Minimum="0"
  2052. Maximum="100"
  2053. FontSize="{DynamicResource Font.Size.Body3}" />
  2054. <!-- 取料固定位置拍产品相机数量 -->
  2055. <TextBlock Grid.Row="4"
  2056. Grid.Column="0"
  2057. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2058. VerticalAlignment="Center"
  2059. HorizontalAlignment="Right"
  2060. Margin="0,6,10,6"
  2061. Text="取料固定位置拍产品相机数量:" />
  2062. <mah:NumericUpDown Grid.Row="4"
  2063. Grid.Column="1"
  2064. Margin="0,6"
  2065. Value="{Binding FixedCameraPickNum,Mode=TwoWay}"
  2066. Minimum="0"
  2067. Maximum="10"
  2068. FontSize="{DynamicResource Font.Size.Body3}" />
  2069. <!-- 锁附/组装固定位置拍产品相机数量 -->
  2070. <TextBlock Grid.Row="5"
  2071. Grid.Column="0"
  2072. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2073. VerticalAlignment="Center"
  2074. HorizontalAlignment="Right"
  2075. Margin="0,6,10,6"
  2076. Text="锁附/组装固定位置拍产品相机数量:" />
  2077. <mah:NumericUpDown Grid.Row="5"
  2078. Grid.Column="1"
  2079. Margin="0,6"
  2080. Value="{Binding FixedCameraPutNum,Mode=TwoWay}"
  2081. Minimum="0"
  2082. Maximum="10"
  2083. FontSize="{DynamicResource Font.Size.Body3}" />
  2084. <!-- 固定相机检测锁附/组装次数 -->
  2085. <TextBlock Grid.Row="6"
  2086. Grid.Column="0"
  2087. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2088. VerticalAlignment="Center"
  2089. HorizontalAlignment="Right"
  2090. Margin="0,6,10,6"
  2091. Text="固定相机检测锁附/组装次数:" />
  2092. <mah:NumericUpDown Grid.Row="6"
  2093. Grid.Column="1"
  2094. Margin="0,6"
  2095. Value="{Binding FixedCameracheckNum,Mode=TwoWay}"
  2096. Minimum="0"
  2097. Maximum="100"
  2098. FontSize="{DynamicResource Font.Size.Body3}" />
  2099. <!-- 工作模式 -->
  2100. <TextBlock Grid.Row="7"
  2101. Grid.Column="0"
  2102. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2103. VerticalAlignment="Center"
  2104. HorizontalAlignment="Right"
  2105. Margin="0,6,10,6"
  2106. Text="工作模式 :" />
  2107. <mah:NumericUpDown Grid.Row="7"
  2108. Grid.Column="1"
  2109. Margin="0,6"
  2110. Value="{Binding WorkMode,Mode=TwoWay}"
  2111. Minimum="0"
  2112. Maximum="100"
  2113. FontSize="{DynamicResource Font.Size.Body3}" />
  2114. <!-- 取料位置 -->
  2115. <TextBlock Grid.Row="8"
  2116. Grid.Column="0"
  2117. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2118. VerticalAlignment="Center"
  2119. HorizontalAlignment="Right"
  2120. Margin="0,6,10,6"
  2121. Text="取料位置:" />
  2122. <mah:NumericUpDown Grid.Row="8"
  2123. Grid.Column="1"
  2124. Margin="0,6"
  2125. Value="{Binding PickPointNum,Mode=TwoWay}"
  2126. Minimum="0"
  2127. Maximum="100"
  2128. FontSize="{DynamicResource Font.Size.Body3}" />
  2129. <!-- 披头矫正的模式 -->
  2130. <TextBlock Grid.Row="9"
  2131. Grid.Column="0"
  2132. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2133. VerticalAlignment="Center"
  2134. HorizontalAlignment="Right"
  2135. Margin="0,6,10,6"
  2136. Text="披头矫正的模式:" />
  2137. <mah:NumericUpDown Grid.Row="9"
  2138. Grid.Column="1"
  2139. Margin="0,6"
  2140. Value="{Binding ScrewTeachNum,Mode=TwoWay}"
  2141. Minimum="0"
  2142. Maximum="100"
  2143. FontSize="{DynamicResource Font.Size.Body3}" />
  2144. <!-- 保存按钮 -->
  2145. <StackPanel Grid.Row="10"
  2146. Grid.ColumnSpan="3"
  2147. Orientation="Horizontal"
  2148. HorizontalAlignment="Right"
  2149. VerticalAlignment="Center"
  2150. Margin="0,10,0,0">
  2151. <Button Style="{StaticResource MaterialDesignRaisedButton}"
  2152. materialDesign:ButtonAssist.CornerRadius="10"
  2153. MinWidth="120"
  2154. Command="{Binding SaveSystemParametersCommand}"
  2155. IsEnabled="{Binding IsAllowEdit}">
  2156. <StackPanel Orientation="Horizontal"
  2157. HorizontalAlignment="Center">
  2158. <materialDesign:PackIcon Kind="ContentSaveCheck"
  2159. Margin="0,0,6,0" />
  2160. <TextBlock VerticalAlignment="Center"
  2161. Text="保存系统参数" />
  2162. </StackPanel>
  2163. </Button>
  2164. </StackPanel>
  2165. </Grid>
  2166. </StackPanel>
  2167. </TabItem>
  2168. <!--生产排班-->
  2169. <TabItem>
  2170. <TabItem.Header>
  2171. <StackPanel HorizontalAlignment="Stretch">
  2172. <materialDesign:PackIcon Width="24"
  2173. Height="24"
  2174. HorizontalAlignment="Center"
  2175. Kind="LanConnect" />
  2176. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2177. FontSize="{DynamicResource Font.Size.Body2}"
  2178. Text="{lex:Loc 生产排班}"
  2179. HorizontalAlignment="Stretch" />
  2180. </StackPanel>
  2181. </TabItem.Header>
  2182. <StackPanel Margin="16">
  2183. <TextBlock Margin="0,0,0,8"
  2184. Style="{StaticResource MaterialDesignHeadline5TextBlock}"
  2185. FontSize="{DynamicResource Font.Size.Body3}"
  2186. Text="{lex:Loc 白夜班}" />
  2187. </StackPanel>
  2188. </TabItem>
  2189. <!--字体-->
  2190. <TabItem>
  2191. <TabItem.Header>
  2192. <StackPanel HorizontalAlignment="Stretch">
  2193. <materialDesign:PackIcon Width="24"
  2194. Height="24"
  2195. HorizontalAlignment="Center"
  2196. Kind="FontSize" />
  2197. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2198. FontSize="{DynamicResource Font.Size.Body2}"
  2199. Text="{lex:Loc 字体}"
  2200. HorizontalAlignment="Stretch" />
  2201. </StackPanel>
  2202. </TabItem.Header>
  2203. <ScrollViewer>
  2204. <Grid Margin="20">
  2205. <Grid.RowDefinitions>
  2206. <RowDefinition Height="auto" />
  2207. <RowDefinition Height="auto" />
  2208. <RowDefinition Height="auto" />
  2209. <RowDefinition Height="auto" />
  2210. <RowDefinition Height="auto" />
  2211. <RowDefinition Height="auto" />
  2212. <RowDefinition Height="auto" />
  2213. <RowDefinition Height="auto" />
  2214. <RowDefinition Height="auto" />
  2215. <RowDefinition Height="auto" />
  2216. <RowDefinition Height="auto" />
  2217. <RowDefinition Height="auto" />
  2218. </Grid.RowDefinitions>
  2219. <Grid.ColumnDefinitions>
  2220. <ColumnDefinition Width="auto" />
  2221. <ColumnDefinition Width="auto" />
  2222. </Grid.ColumnDefinitions>
  2223. <Grid.Resources>
  2224. <Style TargetType="TextBlock">
  2225. <Setter Property="FontSize"
  2226. Value="{DynamicResource Font.Size.Body2}" />
  2227. <Setter Property="VerticalAlignment"
  2228. Value="Center" />
  2229. <Setter Property="HorizontalAlignment"
  2230. Value="Right" />
  2231. </Style>
  2232. <Style TargetType="mah:NumericUpDown">
  2233. <Setter Property="FontSize"
  2234. Value="{DynamicResource Font.Size.Body2}" />
  2235. <Setter Property="Margin"
  2236. Value="5,2" />
  2237. <Setter Property="MinWidth"
  2238. Value="100" />
  2239. <Setter Property="HorizontalContentAlignment"
  2240. Value="Center" />
  2241. <Setter Property="VerticalContentAlignment"
  2242. Value="Center" />
  2243. <Setter Property="Minimum"
  2244. Value="6" />
  2245. <Setter Property="Interval"
  2246. Value="2" />
  2247. <Setter Property="Maximum"
  2248. Value="62" />
  2249. <Setter Property="StringFormat"
  2250. Value="{}{0:N0}" />
  2251. </Style>
  2252. </Grid.Resources>
  2253. <!--1-->
  2254. <TextBlock Grid.Row="0"
  2255. Grid.Column="0"
  2256. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  2257. <mah:NumericUpDown Grid.Row="0"
  2258. Grid.Column="1"
  2259. materialDesign:HintAssist.Hint="Font Size"
  2260. Value="{Binding Title1,Mode=TwoWay}" />
  2261. <!--2-->
  2262. <TextBlock Grid.Row="1"
  2263. Grid.Column="0"
  2264. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  2265. <mah:NumericUpDown Grid.Row="1"
  2266. Grid.Column="1"
  2267. materialDesign:HintAssist.Hint="Font Size"
  2268. Value="{Binding Title2,Mode=TwoWay}" />
  2269. <!--3-->
  2270. <TextBlock Grid.Row="2"
  2271. Grid.Column="0"
  2272. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  2273. <mah:NumericUpDown Grid.Row="2"
  2274. Grid.Column="1"
  2275. materialDesign:HintAssist.Hint="Font Size"
  2276. Value="{Binding Title3,Mode=TwoWay}" />
  2277. <!--4-->
  2278. <TextBlock Grid.Row="3"
  2279. Grid.Column="0"
  2280. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  2281. <mah:NumericUpDown Grid.Row="3"
  2282. Grid.Column="1"
  2283. materialDesign:HintAssist.Hint="Font Size"
  2284. Value="{Binding Title4,Mode=TwoWay}" />
  2285. <!--5-->
  2286. <TextBlock Grid.Row="4"
  2287. Grid.Column="0"
  2288. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  2289. <mah:NumericUpDown Grid.Row="4"
  2290. Grid.Column="1"
  2291. materialDesign:HintAssist.Hint="Font Size"
  2292. Value="{Binding Body1,Mode=TwoWay}" />
  2293. <!--6-->
  2294. <TextBlock Grid.Row="5"
  2295. Grid.Column="0"
  2296. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  2297. <mah:NumericUpDown Grid.Row="5"
  2298. Grid.Column="1"
  2299. materialDesign:HintAssist.Hint="Font Size"
  2300. Value="{Binding Body2,Mode=TwoWay}" />
  2301. <!--7-->
  2302. <TextBlock Grid.Row="6"
  2303. Grid.Column="0"
  2304. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  2305. <mah:NumericUpDown Grid.Row="6"
  2306. Grid.Column="1"
  2307. materialDesign:HintAssist.Hint="Font Size"
  2308. Value="{Binding Body3,Mode=TwoWay}" />
  2309. <!--8-->
  2310. <TextBlock Grid.Row="7"
  2311. Grid.Column="0"
  2312. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  2313. <mah:NumericUpDown Grid.Row="7"
  2314. Grid.Column="1"
  2315. materialDesign:HintAssist.Hint="Font Size"
  2316. Value="{Binding Body4,Mode=TwoWay}" />
  2317. <!--9-->
  2318. <TextBlock Grid.Row="8"
  2319. Grid.Column="0"
  2320. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  2321. <mah:NumericUpDown Grid.Row="8"
  2322. Grid.Column="1"
  2323. materialDesign:HintAssist.Hint="Font Size"
  2324. Value="{Binding Captions1,Mode=TwoWay}" />
  2325. <!--10-->
  2326. <TextBlock Grid.Row="9"
  2327. Grid.Column="0"
  2328. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  2329. <mah:NumericUpDown Grid.Row="9"
  2330. Grid.Column="1"
  2331. materialDesign:HintAssist.Hint="Font Size"
  2332. Value="{Binding Captions2,Mode=TwoWay}" />
  2333. <!--11-->
  2334. <TextBlock Grid.Row="10"
  2335. Grid.Column="0"
  2336. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  2337. <mah:NumericUpDown Grid.Row="10"
  2338. Grid.Column="1"
  2339. materialDesign:HintAssist.Hint="Font Size"
  2340. Value="{Binding Captions3,Mode=TwoWay}" />
  2341. <!--12-->
  2342. <TextBlock Grid.Row="11"
  2343. Grid.Column="0"
  2344. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  2345. <mah:NumericUpDown Grid.Row="11"
  2346. Grid.Column="1"
  2347. materialDesign:HintAssist.Hint="Font Size"
  2348. Value="{Binding Captions4,Mode=TwoWay}" />
  2349. </Grid>
  2350. </ScrollViewer>
  2351. </TabItem>
  2352. <!--语言-->
  2353. <TabItem>
  2354. <TabItem.Header>
  2355. <StackPanel HorizontalAlignment="Stretch">
  2356. <materialDesign:PackIcon Width="24"
  2357. Height="24"
  2358. HorizontalAlignment="Center"
  2359. Kind="TranslateVariant" />
  2360. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2361. FontSize="{DynamicResource Font.Size.Body2}"
  2362. Text="{lex:Loc SettingView_Language_Text}"
  2363. HorizontalAlignment="Stretch" />
  2364. </StackPanel>
  2365. </TabItem.Header>
  2366. <StackPanel Margin="20"
  2367. Orientation="Horizontal"
  2368. VerticalAlignment="Top">
  2369. <!--中文简体-->
  2370. <Button MinWidth="100"
  2371. materialDesign:ButtonAssist.CornerRadius="10"
  2372. ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}"
  2373. FontSize="{DynamicResource Font.Size.Body1}"
  2374. Command="{Binding SelectLanguageCommand}"
  2375. CommandParameter="ChineseSimplified">
  2376. <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
  2377. <Button.Style>
  2378. <Style TargetType="Button"
  2379. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2380. <Setter Property="Foreground"
  2381. Value="#000000" />
  2382. <Style.Triggers>
  2383. <DataTrigger Binding="{Binding CurrentLanguage}"
  2384. Value="{x:Static enums:Language.ChineseSimplified}">
  2385. <Setter Property="Background"
  2386. Value="Green" />
  2387. <Setter Property="BorderBrush"
  2388. Value="Green" />
  2389. </DataTrigger>
  2390. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  2391. Value="{x:Static enums:Language.English}">
  2392. <Setter Property="Background"
  2393. Value="#e4ff54" />
  2394. <Setter Property="BorderBrush"
  2395. Value="#e4ff54" />
  2396. </DataTrigger>-->
  2397. </Style.Triggers>
  2398. </Style>
  2399. </Button.Style>
  2400. </Button>
  2401. <!--中文繁体-->
  2402. <Button MinWidth="100"
  2403. Margin="20.0"
  2404. materialDesign:ButtonAssist.CornerRadius="10"
  2405. ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}"
  2406. FontSize="{DynamicResource Font.Size.Body1}"
  2407. Command="{Binding SelectLanguageCommand}"
  2408. CommandParameter="ChineseTraditional">
  2409. <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
  2410. <Button.Style>
  2411. <Style TargetType="Button"
  2412. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2413. <Setter Property="Foreground"
  2414. Value="#000000" />
  2415. <Style.Triggers>
  2416. <DataTrigger Binding="{Binding CurrentLanguage}"
  2417. Value="{x:Static enums:Language.ChineseTraditional}">
  2418. <Setter Property="Background"
  2419. Value="Green" />
  2420. <Setter Property="BorderBrush"
  2421. Value="Green" />
  2422. </DataTrigger>
  2423. </Style.Triggers>
  2424. </Style>
  2425. </Button.Style>
  2426. </Button>
  2427. <!--英语-->
  2428. <Button MinWidth="100"
  2429. Margin="20.0"
  2430. materialDesign:ButtonAssist.CornerRadius="10"
  2431. ToolTip="{lex:Loc SettingView_Language_English}"
  2432. FontSize="{DynamicResource Font.Size.Body1}"
  2433. Command="{Binding SelectLanguageCommand}"
  2434. CommandParameter="English">
  2435. <TextBlock Text="{lex:Loc SettingView_Language_English}" />
  2436. <Button.Style>
  2437. <Style TargetType="Button"
  2438. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2439. <Setter Property="Foreground"
  2440. Value="#000000" />
  2441. <Style.Triggers>
  2442. <DataTrigger Binding="{Binding CurrentLanguage}"
  2443. Value="{x:Static enums:Language.English}">
  2444. <Setter Property="Background"
  2445. Value="Green" />
  2446. <Setter Property="BorderBrush"
  2447. Value="Green" />
  2448. </DataTrigger>
  2449. </Style.Triggers>
  2450. </Style>
  2451. </Button.Style>
  2452. </Button>
  2453. <!--日语-->
  2454. <Button MinWidth="100"
  2455. Margin="20.0"
  2456. materialDesign:ButtonAssist.CornerRadius="10"
  2457. ToolTip="{lex:Loc SettingView_Language_Japanese}"
  2458. FontSize="{DynamicResource Font.Size.Body1}"
  2459. Command="{Binding SelectLanguageCommand}"
  2460. CommandParameter="Japanese">
  2461. <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
  2462. <Button.Style>
  2463. <Style TargetType="Button"
  2464. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2465. <Setter Property="Foreground"
  2466. Value="#000000" />
  2467. <Style.Triggers>
  2468. <DataTrigger Binding="{Binding CurrentLanguage}"
  2469. Value="{x:Static enums:Language.Japanese}">
  2470. <Setter Property="Background"
  2471. Value="Green" />
  2472. <Setter Property="BorderBrush"
  2473. Value="Green" />
  2474. </DataTrigger>
  2475. </Style.Triggers>
  2476. </Style>
  2477. </Button.Style>
  2478. </Button>
  2479. </StackPanel>
  2480. </TabItem>
  2481. </TabControl>
  2482. </Grid>
  2483. </UserControl>