SettingView.xaml 136 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123
  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="600"
  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="Lan" />
  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="20"
  1536. IsEnabled="{Binding IsAllowEdit}">
  1537. <Grid.ColumnDefinitions>
  1538. <ColumnDefinition Width="auto" />
  1539. <ColumnDefinition Width="auto" />
  1540. </Grid.ColumnDefinitions>
  1541. <Grid.RowDefinitions>
  1542. <RowDefinition Height="auto" />
  1543. <RowDefinition Height=" auto" />
  1544. </Grid.RowDefinitions>
  1545. <Button Style="{StaticResource MaterialDesignRaisedButton}"
  1546. materialDesign:ButtonAssist.CornerRadius="10"
  1547. Width="60"
  1548. ToolTip="{lex:Loc 保存}"
  1549. HorizontalAlignment="Left"
  1550. Command="{Binding SaveCommunicateCommand}"
  1551. CommandParameter="TCPIP">
  1552. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1553. </Button>
  1554. <GroupBox Grid.Row="1"
  1555. Header="{lex:Loc 后台TCPIP服务器}"
  1556. FontSize="{DynamicResource Font.Size.Title4}"
  1557. Margin="5,5">
  1558. <Grid Margin="20">
  1559. <Grid.ColumnDefinitions>
  1560. <ColumnDefinition Width="auto" />
  1561. <ColumnDefinition Width="auto" />
  1562. </Grid.ColumnDefinitions>
  1563. <Grid.RowDefinitions>
  1564. <RowDefinition Height="auto" />
  1565. <RowDefinition Height=" auto" />
  1566. <RowDefinition Height=" auto" />
  1567. </Grid.RowDefinitions>
  1568. <!--port-->
  1569. <TextBlock Margin="0,0,0,8"
  1570. Text="Port: "
  1571. VerticalAlignment="Center"
  1572. FontSize="{DynamicResource Font.Size.Body3}"
  1573. HorizontalAlignment="Right" />
  1574. <TextBox Grid.Row="0"
  1575. Grid.Column="1"
  1576. Margin="10,4"
  1577. MinWidth="80"
  1578. FontSize="{DynamicResource Font.Size.Body3}"
  1579. TextAlignment="Center"
  1580. HorizontalAlignment="Left"
  1581. VerticalAlignment="Center">
  1582. <TextBox.Text>
  1583. <Binding Path="BgTcp.Port"
  1584. Mode="TwoWay">
  1585. <Binding.ValidationRules>
  1586. <valRules:PortValidationRule />
  1587. </Binding.ValidationRules>
  1588. </Binding>
  1589. </TextBox.Text>
  1590. </TextBox>
  1591. <!--结束符-->
  1592. <TextBlock Margin="0,0,0,8"
  1593. Grid.Row="1"
  1594. VerticalAlignment="Center"
  1595. Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1596. FontSize="{DynamicResource Font.Size.Body3}"
  1597. HorizontalAlignment="Right" />
  1598. <ComboBox SelectedItem="{Binding BgTcp.Terminator,Mode=TwoWay}"
  1599. Grid.Row="1"
  1600. Grid.Column="1"
  1601. Margin="10,4"
  1602. MinWidth="80"
  1603. HorizontalContentAlignment="Center"
  1604. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  1605. FontSize="{DynamicResource Font.Size.Body3}"
  1606. HorizontalAlignment="Left"
  1607. VerticalAlignment="Center" />
  1608. <!--编码格式-->
  1609. <TextBlock Text="{lex:Loc 编码解码, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1610. Grid.Row="2"
  1611. VerticalAlignment="Center"
  1612. Grid.Column="0"
  1613. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1614. FontSize="{DynamicResource Font.Size.Body3}"
  1615. HorizontalAlignment="Right" />
  1616. <ComboBox SelectedItem="{Binding BgTcp.DataEncoding,Mode=TwoWay}"
  1617. Grid.Row="2"
  1618. Grid.Column="1"
  1619. Margin="10,4"
  1620. MinWidth="80"
  1621. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  1622. FontSize="{DynamicResource Font.Size.Body3}"
  1623. HorizontalContentAlignment="Center"
  1624. HorizontalAlignment="Left"
  1625. VerticalAlignment="Center" />
  1626. </Grid>
  1627. </GroupBox>
  1628. <Button Grid.Column="1"
  1629. Style="{StaticResource MaterialDesignRaisedButton}"
  1630. materialDesign:ButtonAssist.CornerRadius="10"
  1631. Width="60"
  1632. ToolTip="{lex:Loc 保存}"
  1633. HorizontalAlignment="Left"
  1634. Command="{Binding SaveCommunicateCommand}"
  1635. CommandParameter="ModbusTCP">
  1636. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1637. </Button>
  1638. <materialDesign:PopupBox Grid.Column="1"
  1639. HorizontalAlignment="Right"
  1640. VerticalAlignment="Center">
  1641. <StackPanel Orientation="Vertical"
  1642. Margin="10">
  1643. <TextBlock TextWrapping="Wrap"
  1644. TextAlignment="Left"
  1645. Text="功能码 1 ReadCoils 读取DO的状态" />
  1646. <TextBlock TextWrapping="Wrap"
  1647. TextAlignment="Left"
  1648. Text="功能码 2 ReadInputs 读取DI的状态" />
  1649. <TextBlock TextWrapping="Wrap"
  1650. TextAlignment="Left"
  1651. Text="功能码 3 ReadHoldingRegisters 读取AO的值" />
  1652. <TextBlock TextWrapping="Wrap"
  1653. TextAlignment="Left"
  1654. Text="功能码 4 ReadInputRegisters 读取AI的值" />
  1655. <TextBlock TextWrapping="Wrap"
  1656. TextAlignment="Left"
  1657. Text="功能码 5 WriteSingleCoil 写入值到DO" />
  1658. <TextBlock TextWrapping="Wrap"
  1659. TextAlignment="Left"
  1660. Text="功能码 6 WriteSingleRegister 写入值到AO" />
  1661. <TextBlock TextWrapping="Wrap"
  1662. TextAlignment="Left"
  1663. Text="功能码 15 WriteMultipleCoils 写多线圈寄存器" />
  1664. <TextBlock TextWrapping="Wrap"
  1665. TextAlignment="Left"
  1666. Text="功能码 16 WriteMultipleRegisters 写多个保持寄存器" />
  1667. <TextBlock TextWrapping="Wrap"
  1668. TextAlignment="Left"
  1669. Text="功能码 23 ReadWriteMultipleRegisters 读写多个保持寄存器" />
  1670. </StackPanel>
  1671. </materialDesign:PopupBox>
  1672. <GroupBox Grid.Row="1"
  1673. Margin=" 5,5"
  1674. Grid.Column="1"
  1675. Header="{lex:Loc 后台ModbusTCPSlave}"
  1676. FontSize="{DynamicResource Font.Size.Title4}">
  1677. <Grid Margin="20">
  1678. <Grid.ColumnDefinitions>
  1679. <ColumnDefinition Width="auto" />
  1680. <ColumnDefinition Width="auto" />
  1681. </Grid.ColumnDefinitions>
  1682. <Grid.RowDefinitions>
  1683. <RowDefinition Height="auto" />
  1684. <RowDefinition Height=" auto" />
  1685. <RowDefinition Height=" auto" />
  1686. <RowDefinition Height=" auto" />
  1687. </Grid.RowDefinitions>
  1688. <!--IP-->
  1689. <TextBlock Margin="0,0,0,8"
  1690. Text="IP: "
  1691. FontSize="{DynamicResource Font.Size.Body3}"
  1692. VerticalAlignment="Center"
  1693. HorizontalAlignment="Right" />
  1694. <TextBox Grid.Row="0"
  1695. Grid.Column="1"
  1696. Margin="10,4"
  1697. MinWidth="80"
  1698. TextAlignment="Center"
  1699. HorizontalAlignment="Left"
  1700. VerticalAlignment="Center"
  1701. FontSize="{DynamicResource Font.Size.Body3}"
  1702. Text="{Binding BgModbus.IP,Mode=TwoWay}" />
  1703. <!--port-->
  1704. <TextBlock Grid.Row="1"
  1705. Margin="0,0,0,8"
  1706. Text="Port: "
  1707. FontSize="{DynamicResource Font.Size.Body3}"
  1708. VerticalAlignment="Center"
  1709. HorizontalAlignment="Right" />
  1710. <TextBox Grid.Row="1"
  1711. Grid.Column="1"
  1712. Margin="10,4"
  1713. MinWidth="80"
  1714. TextAlignment="Center"
  1715. HorizontalAlignment="Left"
  1716. VerticalAlignment="Center"
  1717. FontSize="{DynamicResource Font.Size.Body3}"
  1718. Text="{Binding BgModbus.Port,Mode=TwoWay}" />
  1719. <!--SlaveID-->
  1720. <TextBlock Grid.Row="2"
  1721. Margin="0,0,0,8"
  1722. VerticalAlignment="Center"
  1723. Text="SlaveID: "
  1724. FontSize="{DynamicResource Font.Size.Body3}"
  1725. HorizontalAlignment="Right" />
  1726. <TextBox Grid.Row="2"
  1727. Grid.Column="1"
  1728. Margin="10,4"
  1729. MinWidth="80"
  1730. TextAlignment="Center"
  1731. HorizontalAlignment="Left"
  1732. VerticalAlignment="Center"
  1733. FontSize="{DynamicResource Font.Size.Body3}"
  1734. Text="{Binding BgModbus.SlaveID,Mode=TwoWay}" />
  1735. <!--是否启用-->
  1736. <TextBlock Margin="0,0,0,8"
  1737. Grid.Row="3"
  1738. Text="{lex:Loc 是否启用, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1739. FontSize="{DynamicResource Font.Size.Body3}"
  1740. VerticalAlignment="Center"
  1741. HorizontalAlignment="Right" />
  1742. <ToggleButton Grid.Row="3"
  1743. Grid.Column="1"
  1744. Margin="10,4"
  1745. MinWidth="80"
  1746. IsChecked="{Binding BgModbus.IsEnabled,Mode=TwoWay}"
  1747. HorizontalContentAlignment="Center"
  1748. HorizontalAlignment="Left"
  1749. VerticalAlignment="Center" />
  1750. </Grid>
  1751. </GroupBox>
  1752. </Grid>
  1753. </TabItem>
  1754. <!--生产排班-->
  1755. <TabItem>
  1756. <TabItem.Header>
  1757. <StackPanel HorizontalAlignment="Stretch">
  1758. <materialDesign:PackIcon Width="24"
  1759. Height="24"
  1760. HorizontalAlignment="Center"
  1761. Kind="LanConnect" />
  1762. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1763. FontSize="{DynamicResource Font.Size.Body2}"
  1764. Text="{lex:Loc 生产排班}"
  1765. HorizontalAlignment="Stretch" />
  1766. </StackPanel>
  1767. </TabItem.Header>
  1768. <StackPanel Margin="16">
  1769. <TextBlock Margin="0,0,0,8"
  1770. Style="{StaticResource MaterialDesignHeadline5TextBlock}"
  1771. FontSize="{DynamicResource Font.Size.Body3}"
  1772. Text="{lex:Loc 白夜班}" />
  1773. </StackPanel>
  1774. </TabItem>
  1775. <!--字体-->
  1776. <TabItem>
  1777. <TabItem.Header>
  1778. <StackPanel HorizontalAlignment="Stretch">
  1779. <materialDesign:PackIcon Width="24"
  1780. Height="24"
  1781. HorizontalAlignment="Center"
  1782. Kind="FontSize" />
  1783. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1784. FontSize="{DynamicResource Font.Size.Body2}"
  1785. Text="{lex:Loc 字体}"
  1786. HorizontalAlignment="Stretch" />
  1787. </StackPanel>
  1788. </TabItem.Header>
  1789. <ScrollViewer>
  1790. <Grid Margin="20">
  1791. <Grid.RowDefinitions>
  1792. <RowDefinition Height="auto" />
  1793. <RowDefinition Height="auto" />
  1794. <RowDefinition Height="auto" />
  1795. <RowDefinition Height="auto" />
  1796. <RowDefinition Height="auto" />
  1797. <RowDefinition Height="auto" />
  1798. <RowDefinition Height="auto" />
  1799. <RowDefinition Height="auto" />
  1800. <RowDefinition Height="auto" />
  1801. <RowDefinition Height="auto" />
  1802. <RowDefinition Height="auto" />
  1803. <RowDefinition Height="auto" />
  1804. </Grid.RowDefinitions>
  1805. <Grid.ColumnDefinitions>
  1806. <ColumnDefinition Width="auto" />
  1807. <ColumnDefinition Width="auto" />
  1808. </Grid.ColumnDefinitions>
  1809. <Grid.Resources>
  1810. <Style TargetType="TextBlock">
  1811. <Setter Property="FontSize"
  1812. Value="{DynamicResource Font.Size.Body2}" />
  1813. <Setter Property="VerticalAlignment"
  1814. Value="Center" />
  1815. <Setter Property="HorizontalAlignment"
  1816. Value="Right" />
  1817. </Style>
  1818. <Style TargetType="mah:NumericUpDown">
  1819. <Setter Property="FontSize"
  1820. Value="{DynamicResource Font.Size.Body2}" />
  1821. <Setter Property="Margin"
  1822. Value="5,2" />
  1823. <Setter Property="MinWidth"
  1824. Value="100" />
  1825. <Setter Property="HorizontalContentAlignment"
  1826. Value="Center" />
  1827. <Setter Property="VerticalContentAlignment"
  1828. Value="Center" />
  1829. <Setter Property="Minimum"
  1830. Value="6" />
  1831. <Setter Property="Interval"
  1832. Value="2" />
  1833. <Setter Property="Maximum"
  1834. Value="62" />
  1835. <Setter Property="StringFormat"
  1836. Value="{}{0:N0}" />
  1837. </Style>
  1838. </Grid.Resources>
  1839. <!--1-->
  1840. <TextBlock Grid.Row="0"
  1841. Grid.Column="0"
  1842. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  1843. <mah:NumericUpDown Grid.Row="0"
  1844. Grid.Column="1"
  1845. materialDesign:HintAssist.Hint="Font Size"
  1846. Value="{Binding Title1,Mode=TwoWay}" />
  1847. <!--2-->
  1848. <TextBlock Grid.Row="1"
  1849. Grid.Column="0"
  1850. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  1851. <mah:NumericUpDown Grid.Row="1"
  1852. Grid.Column="1"
  1853. materialDesign:HintAssist.Hint="Font Size"
  1854. Value="{Binding Title2,Mode=TwoWay}" />
  1855. <!--3-->
  1856. <TextBlock Grid.Row="2"
  1857. Grid.Column="0"
  1858. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  1859. <mah:NumericUpDown Grid.Row="2"
  1860. Grid.Column="1"
  1861. materialDesign:HintAssist.Hint="Font Size"
  1862. Value="{Binding Title3,Mode=TwoWay}" />
  1863. <!--4-->
  1864. <TextBlock Grid.Row="3"
  1865. Grid.Column="0"
  1866. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  1867. <mah:NumericUpDown Grid.Row="3"
  1868. Grid.Column="1"
  1869. materialDesign:HintAssist.Hint="Font Size"
  1870. Value="{Binding Title4,Mode=TwoWay}" />
  1871. <!--5-->
  1872. <TextBlock Grid.Row="4"
  1873. Grid.Column="0"
  1874. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  1875. <mah:NumericUpDown Grid.Row="4"
  1876. Grid.Column="1"
  1877. materialDesign:HintAssist.Hint="Font Size"
  1878. Value="{Binding Body1,Mode=TwoWay}" />
  1879. <!--6-->
  1880. <TextBlock Grid.Row="5"
  1881. Grid.Column="0"
  1882. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  1883. <mah:NumericUpDown Grid.Row="5"
  1884. Grid.Column="1"
  1885. materialDesign:HintAssist.Hint="Font Size"
  1886. Value="{Binding Body2,Mode=TwoWay}" />
  1887. <!--7-->
  1888. <TextBlock Grid.Row="6"
  1889. Grid.Column="0"
  1890. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  1891. <mah:NumericUpDown Grid.Row="6"
  1892. Grid.Column="1"
  1893. materialDesign:HintAssist.Hint="Font Size"
  1894. Value="{Binding Body3,Mode=TwoWay}" />
  1895. <!--8-->
  1896. <TextBlock Grid.Row="7"
  1897. Grid.Column="0"
  1898. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  1899. <mah:NumericUpDown Grid.Row="7"
  1900. Grid.Column="1"
  1901. materialDesign:HintAssist.Hint="Font Size"
  1902. Value="{Binding Body4,Mode=TwoWay}" />
  1903. <!--9-->
  1904. <TextBlock Grid.Row="8"
  1905. Grid.Column="0"
  1906. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  1907. <mah:NumericUpDown Grid.Row="8"
  1908. Grid.Column="1"
  1909. materialDesign:HintAssist.Hint="Font Size"
  1910. Value="{Binding Captions1,Mode=TwoWay}" />
  1911. <!--10-->
  1912. <TextBlock Grid.Row="9"
  1913. Grid.Column="0"
  1914. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  1915. <mah:NumericUpDown Grid.Row="9"
  1916. Grid.Column="1"
  1917. materialDesign:HintAssist.Hint="Font Size"
  1918. Value="{Binding Captions2,Mode=TwoWay}" />
  1919. <!--11-->
  1920. <TextBlock Grid.Row="10"
  1921. Grid.Column="0"
  1922. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  1923. <mah:NumericUpDown Grid.Row="10"
  1924. Grid.Column="1"
  1925. materialDesign:HintAssist.Hint="Font Size"
  1926. Value="{Binding Captions3,Mode=TwoWay}" />
  1927. <!--12-->
  1928. <TextBlock Grid.Row="11"
  1929. Grid.Column="0"
  1930. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  1931. <mah:NumericUpDown Grid.Row="11"
  1932. Grid.Column="1"
  1933. materialDesign:HintAssist.Hint="Font Size"
  1934. Value="{Binding Captions4,Mode=TwoWay}" />
  1935. </Grid>
  1936. </ScrollViewer>
  1937. </TabItem>
  1938. <!--语言-->
  1939. <TabItem>
  1940. <TabItem.Header>
  1941. <StackPanel HorizontalAlignment="Stretch">
  1942. <materialDesign:PackIcon Width="24"
  1943. Height="24"
  1944. HorizontalAlignment="Center"
  1945. Kind="TranslateVariant" />
  1946. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1947. FontSize="{DynamicResource Font.Size.Body2}"
  1948. Text="{lex:Loc SettingView_Language_Text}"
  1949. HorizontalAlignment="Stretch" />
  1950. </StackPanel>
  1951. </TabItem.Header>
  1952. <StackPanel Margin="20"
  1953. Orientation="Horizontal"
  1954. VerticalAlignment="Top">
  1955. <!--中文简体-->
  1956. <Button MinWidth="100"
  1957. materialDesign:ButtonAssist.CornerRadius="10"
  1958. ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}"
  1959. FontSize="{DynamicResource Font.Size.Body1}"
  1960. Command="{Binding SelectLanguageCommand}"
  1961. CommandParameter="ChineseSimplified">
  1962. <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
  1963. <Button.Style>
  1964. <Style TargetType="Button"
  1965. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1966. <Setter Property="Foreground"
  1967. Value="#000000" />
  1968. <Style.Triggers>
  1969. <DataTrigger Binding="{Binding CurrentLanguage}"
  1970. Value="{x:Static enums:Language.ChineseSimplified}">
  1971. <Setter Property="Background"
  1972. Value="Green" />
  1973. <Setter Property="BorderBrush"
  1974. Value="Green" />
  1975. </DataTrigger>
  1976. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  1977. Value="{x:Static enums:Language.English}">
  1978. <Setter Property="Background"
  1979. Value="#e4ff54" />
  1980. <Setter Property="BorderBrush"
  1981. Value="#e4ff54" />
  1982. </DataTrigger>-->
  1983. </Style.Triggers>
  1984. </Style>
  1985. </Button.Style>
  1986. </Button>
  1987. <!--中文繁体-->
  1988. <Button MinWidth="100"
  1989. Margin="20.0"
  1990. materialDesign:ButtonAssist.CornerRadius="10"
  1991. ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}"
  1992. FontSize="{DynamicResource Font.Size.Body1}"
  1993. Command="{Binding SelectLanguageCommand}"
  1994. CommandParameter="ChineseTraditional">
  1995. <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
  1996. <Button.Style>
  1997. <Style TargetType="Button"
  1998. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1999. <Setter Property="Foreground"
  2000. Value="#000000" />
  2001. <Style.Triggers>
  2002. <DataTrigger Binding="{Binding CurrentLanguage}"
  2003. Value="{x:Static enums:Language.ChineseTraditional}">
  2004. <Setter Property="Background"
  2005. Value="Green" />
  2006. <Setter Property="BorderBrush"
  2007. Value="Green" />
  2008. </DataTrigger>
  2009. </Style.Triggers>
  2010. </Style>
  2011. </Button.Style>
  2012. </Button>
  2013. <!--英语-->
  2014. <Button MinWidth="100"
  2015. Margin="20.0"
  2016. materialDesign:ButtonAssist.CornerRadius="10"
  2017. ToolTip="{lex:Loc SettingView_Language_English}"
  2018. FontSize="{DynamicResource Font.Size.Body1}"
  2019. Command="{Binding SelectLanguageCommand}"
  2020. CommandParameter="English">
  2021. <TextBlock Text="{lex:Loc SettingView_Language_English}" />
  2022. <Button.Style>
  2023. <Style TargetType="Button"
  2024. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2025. <Setter Property="Foreground"
  2026. Value="#000000" />
  2027. <Style.Triggers>
  2028. <DataTrigger Binding="{Binding CurrentLanguage}"
  2029. Value="{x:Static enums:Language.English}">
  2030. <Setter Property="Background"
  2031. Value="Green" />
  2032. <Setter Property="BorderBrush"
  2033. Value="Green" />
  2034. </DataTrigger>
  2035. </Style.Triggers>
  2036. </Style>
  2037. </Button.Style>
  2038. </Button>
  2039. <!--日语-->
  2040. <Button MinWidth="100"
  2041. Margin="20.0"
  2042. materialDesign:ButtonAssist.CornerRadius="10"
  2043. ToolTip="{lex:Loc SettingView_Language_Japanese}"
  2044. FontSize="{DynamicResource Font.Size.Body1}"
  2045. Command="{Binding SelectLanguageCommand}"
  2046. CommandParameter="Japanese">
  2047. <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
  2048. <Button.Style>
  2049. <Style TargetType="Button"
  2050. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2051. <Setter Property="Foreground"
  2052. Value="#000000" />
  2053. <Style.Triggers>
  2054. <DataTrigger Binding="{Binding CurrentLanguage}"
  2055. Value="{x:Static enums:Language.Japanese}">
  2056. <Setter Property="Background"
  2057. Value="Green" />
  2058. <Setter Property="BorderBrush"
  2059. Value="Green" />
  2060. </DataTrigger>
  2061. </Style.Triggers>
  2062. </Style>
  2063. </Button.Style>
  2064. </Button>
  2065. </StackPanel>
  2066. </TabItem>
  2067. </TabControl>
  2068. </Grid>
  2069. </UserControl>