SettingView.xaml 161 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543
  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="40" />
  1992. </Grid.RowDefinitions>
  1993. <!-- 相机拍照次数 -->
  1994. <TextBlock Grid.Row="0"
  1995. Grid.Column="0"
  1996. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1997. VerticalAlignment="Center"
  1998. HorizontalAlignment="Right"
  1999. Margin="0,6,10,6"
  2000. Text="下相机拍照次数:" />
  2001. <mah:NumericUpDown Grid.Row="0"
  2002. Grid.Column="1"
  2003. Margin="0,6"
  2004. Value="{Binding DowmCameraNum,Mode=TwoWay}"
  2005. Minimum="0"
  2006. Maximum="100"
  2007. FontSize="{DynamicResource Font.Size.Body3}" />
  2008. <!-- 上相机取料拍照次数 -->
  2009. <TextBlock Grid.Row="1"
  2010. Grid.Column="0"
  2011. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2012. VerticalAlignment="Center"
  2013. HorizontalAlignment="Right"
  2014. Margin="0,6,10,6"
  2015. Text="上相机取料拍照次数:" />
  2016. <mah:NumericUpDown Grid.Row="1"
  2017. Grid.Column="1"
  2018. Margin="0,6"
  2019. Value="{Binding UpCameraPickNum,Mode=TwoWay}"
  2020. Minimum="0"
  2021. Maximum="100"
  2022. FontSize="{DynamicResource Font.Size.Body3}" />
  2023. <!-- 上相机放料拍照次数 -->
  2024. <TextBlock Grid.Row="2"
  2025. Grid.Column="0"
  2026. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2027. VerticalAlignment="Center"
  2028. HorizontalAlignment="Right"
  2029. Margin="0,6,10,6"
  2030. Text="上相机放料拍照次数:" />
  2031. <mah:NumericUpDown Grid.Row="2"
  2032. Grid.Column="1"
  2033. Margin="0,6"
  2034. Value="{Binding UpCameraPutNum,Mode=TwoWay}"
  2035. Minimum="0"
  2036. Maximum="100"
  2037. FontSize="{DynamicResource Font.Size.Body3}" />
  2038. <!-- 上相机锁附/组装次数 -->
  2039. <TextBlock Grid.Row="3"
  2040. Grid.Column="0"
  2041. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2042. VerticalAlignment="Center"
  2043. HorizontalAlignment="Right"
  2044. Margin="0,6,10,6"
  2045. Text="上相机锁附/组装次数:" />
  2046. <mah:NumericUpDown Grid.Row="3"
  2047. Grid.Column="1"
  2048. Margin="0,6"
  2049. Value="{Binding UPCameracheckNum,Mode=TwoWay}"
  2050. Minimum="0"
  2051. Maximum="100"
  2052. FontSize="{DynamicResource Font.Size.Body3}" />
  2053. <!-- 取料固定位置拍产品相机数量 -->
  2054. <TextBlock Grid.Row="4"
  2055. Grid.Column="0"
  2056. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2057. VerticalAlignment="Center"
  2058. HorizontalAlignment="Right"
  2059. Margin="0,6,10,6"
  2060. Text="取料固定位置拍产品相机数量:" />
  2061. <mah:NumericUpDown Grid.Row="4"
  2062. Grid.Column="1"
  2063. Margin="0,6"
  2064. Value="{Binding FixedCameraPickNum,Mode=TwoWay}"
  2065. Minimum="0"
  2066. Maximum="10"
  2067. FontSize="{DynamicResource Font.Size.Body3}" />
  2068. <!-- 锁附/组装固定位置拍产品相机数量 -->
  2069. <TextBlock Grid.Row="5"
  2070. Grid.Column="0"
  2071. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2072. VerticalAlignment="Center"
  2073. HorizontalAlignment="Right"
  2074. Margin="0,6,10,6"
  2075. Text="锁附/组装固定位置拍产品相机数量:" />
  2076. <mah:NumericUpDown Grid.Row="5"
  2077. Grid.Column="1"
  2078. Margin="0,6"
  2079. Value="{Binding FixedCameraPutNum,Mode=TwoWay}"
  2080. Minimum="0"
  2081. Maximum="10"
  2082. FontSize="{DynamicResource Font.Size.Body3}" />
  2083. <!-- 固定相机检测锁附/组装次数 -->
  2084. <TextBlock Grid.Row="6"
  2085. Grid.Column="0"
  2086. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2087. VerticalAlignment="Center"
  2088. HorizontalAlignment="Right"
  2089. Margin="0,6,10,6"
  2090. Text="固定相机检测锁附/组装次数:" />
  2091. <mah:NumericUpDown Grid.Row="6"
  2092. Grid.Column="1"
  2093. Margin="0,6"
  2094. Value="{Binding FixedCameracheckNum,Mode=TwoWay}"
  2095. Minimum="0"
  2096. Maximum="100"
  2097. FontSize="{DynamicResource Font.Size.Body3}" />
  2098. <!-- 工作模式 -->
  2099. <TextBlock Grid.Row="7"
  2100. Grid.Column="0"
  2101. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2102. VerticalAlignment="Center"
  2103. HorizontalAlignment="Right"
  2104. Margin="0,6,10,6"
  2105. Text="工作模式 :" />
  2106. <mah:NumericUpDown Grid.Row="7"
  2107. Grid.Column="1"
  2108. Margin="0,6"
  2109. Value="{Binding WorkMode,Mode=TwoWay}"
  2110. Minimum="0"
  2111. Maximum="100"
  2112. FontSize="{DynamicResource Font.Size.Body3}" />
  2113. <!-- 取料位置 -->
  2114. <TextBlock Grid.Row="8"
  2115. Grid.Column="0"
  2116. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2117. VerticalAlignment="Center"
  2118. HorizontalAlignment="Right"
  2119. Margin="0,6,10,6"
  2120. Text="取料位置:" />
  2121. <mah:NumericUpDown Grid.Row="8"
  2122. Grid.Column="1"
  2123. Margin="0,6"
  2124. Value="{Binding PickPointNum,Mode=TwoWay}"
  2125. Minimum="0"
  2126. Maximum="100"
  2127. FontSize="{DynamicResource Font.Size.Body3}" />
  2128. <!-- 保存按钮 -->
  2129. <StackPanel Grid.Row="9"
  2130. Grid.ColumnSpan="3"
  2131. Orientation="Horizontal"
  2132. HorizontalAlignment="Right"
  2133. VerticalAlignment="Center"
  2134. Margin="0,10,0,0">
  2135. <Button Style="{StaticResource MaterialDesignRaisedButton}"
  2136. materialDesign:ButtonAssist.CornerRadius="10"
  2137. MinWidth="120"
  2138. Command="{Binding SaveSystemParametersCommand}"
  2139. IsEnabled="{Binding IsAllowEdit}">
  2140. <StackPanel Orientation="Horizontal"
  2141. HorizontalAlignment="Center">
  2142. <materialDesign:PackIcon Kind="ContentSaveCheck"
  2143. Margin="0,0,6,0" />
  2144. <TextBlock VerticalAlignment="Center"
  2145. Text="保存系统参数" />
  2146. </StackPanel>
  2147. </Button>
  2148. </StackPanel>
  2149. </Grid>
  2150. </StackPanel>
  2151. </TabItem>
  2152. <!--生产排班-->
  2153. <TabItem>
  2154. <TabItem.Header>
  2155. <StackPanel HorizontalAlignment="Stretch">
  2156. <materialDesign:PackIcon Width="24"
  2157. Height="24"
  2158. HorizontalAlignment="Center"
  2159. Kind="LanConnect" />
  2160. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2161. FontSize="{DynamicResource Font.Size.Body2}"
  2162. Text="{lex:Loc 生产排班}"
  2163. HorizontalAlignment="Stretch" />
  2164. </StackPanel>
  2165. </TabItem.Header>
  2166. <StackPanel Margin="16">
  2167. <TextBlock Margin="0,0,0,8"
  2168. Style="{StaticResource MaterialDesignHeadline5TextBlock}"
  2169. FontSize="{DynamicResource Font.Size.Body3}"
  2170. Text="{lex:Loc 白夜班}" />
  2171. </StackPanel>
  2172. </TabItem>
  2173. <!--字体-->
  2174. <TabItem>
  2175. <TabItem.Header>
  2176. <StackPanel HorizontalAlignment="Stretch">
  2177. <materialDesign:PackIcon Width="24"
  2178. Height="24"
  2179. HorizontalAlignment="Center"
  2180. Kind="FontSize" />
  2181. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2182. FontSize="{DynamicResource Font.Size.Body2}"
  2183. Text="{lex:Loc 字体}"
  2184. HorizontalAlignment="Stretch" />
  2185. </StackPanel>
  2186. </TabItem.Header>
  2187. <ScrollViewer>
  2188. <Grid Margin="20">
  2189. <Grid.RowDefinitions>
  2190. <RowDefinition Height="auto" />
  2191. <RowDefinition Height="auto" />
  2192. <RowDefinition Height="auto" />
  2193. <RowDefinition Height="auto" />
  2194. <RowDefinition Height="auto" />
  2195. <RowDefinition Height="auto" />
  2196. <RowDefinition Height="auto" />
  2197. <RowDefinition Height="auto" />
  2198. <RowDefinition Height="auto" />
  2199. <RowDefinition Height="auto" />
  2200. <RowDefinition Height="auto" />
  2201. <RowDefinition Height="auto" />
  2202. </Grid.RowDefinitions>
  2203. <Grid.ColumnDefinitions>
  2204. <ColumnDefinition Width="auto" />
  2205. <ColumnDefinition Width="auto" />
  2206. </Grid.ColumnDefinitions>
  2207. <Grid.Resources>
  2208. <Style TargetType="TextBlock">
  2209. <Setter Property="FontSize"
  2210. Value="{DynamicResource Font.Size.Body2}" />
  2211. <Setter Property="VerticalAlignment"
  2212. Value="Center" />
  2213. <Setter Property="HorizontalAlignment"
  2214. Value="Right" />
  2215. </Style>
  2216. <Style TargetType="mah:NumericUpDown">
  2217. <Setter Property="FontSize"
  2218. Value="{DynamicResource Font.Size.Body2}" />
  2219. <Setter Property="Margin"
  2220. Value="5,2" />
  2221. <Setter Property="MinWidth"
  2222. Value="100" />
  2223. <Setter Property="HorizontalContentAlignment"
  2224. Value="Center" />
  2225. <Setter Property="VerticalContentAlignment"
  2226. Value="Center" />
  2227. <Setter Property="Minimum"
  2228. Value="6" />
  2229. <Setter Property="Interval"
  2230. Value="2" />
  2231. <Setter Property="Maximum"
  2232. Value="62" />
  2233. <Setter Property="StringFormat"
  2234. Value="{}{0:N0}" />
  2235. </Style>
  2236. </Grid.Resources>
  2237. <!--1-->
  2238. <TextBlock Grid.Row="0"
  2239. Grid.Column="0"
  2240. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  2241. <mah:NumericUpDown Grid.Row="0"
  2242. Grid.Column="1"
  2243. materialDesign:HintAssist.Hint="Font Size"
  2244. Value="{Binding Title1,Mode=TwoWay}" />
  2245. <!--2-->
  2246. <TextBlock Grid.Row="1"
  2247. Grid.Column="0"
  2248. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  2249. <mah:NumericUpDown Grid.Row="1"
  2250. Grid.Column="1"
  2251. materialDesign:HintAssist.Hint="Font Size"
  2252. Value="{Binding Title2,Mode=TwoWay}" />
  2253. <!--3-->
  2254. <TextBlock Grid.Row="2"
  2255. Grid.Column="0"
  2256. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  2257. <mah:NumericUpDown Grid.Row="2"
  2258. Grid.Column="1"
  2259. materialDesign:HintAssist.Hint="Font Size"
  2260. Value="{Binding Title3,Mode=TwoWay}" />
  2261. <!--4-->
  2262. <TextBlock Grid.Row="3"
  2263. Grid.Column="0"
  2264. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  2265. <mah:NumericUpDown Grid.Row="3"
  2266. Grid.Column="1"
  2267. materialDesign:HintAssist.Hint="Font Size"
  2268. Value="{Binding Title4,Mode=TwoWay}" />
  2269. <!--5-->
  2270. <TextBlock Grid.Row="4"
  2271. Grid.Column="0"
  2272. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  2273. <mah:NumericUpDown Grid.Row="4"
  2274. Grid.Column="1"
  2275. materialDesign:HintAssist.Hint="Font Size"
  2276. Value="{Binding Body1,Mode=TwoWay}" />
  2277. <!--6-->
  2278. <TextBlock Grid.Row="5"
  2279. Grid.Column="0"
  2280. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  2281. <mah:NumericUpDown Grid.Row="5"
  2282. Grid.Column="1"
  2283. materialDesign:HintAssist.Hint="Font Size"
  2284. Value="{Binding Body2,Mode=TwoWay}" />
  2285. <!--7-->
  2286. <TextBlock Grid.Row="6"
  2287. Grid.Column="0"
  2288. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  2289. <mah:NumericUpDown Grid.Row="6"
  2290. Grid.Column="1"
  2291. materialDesign:HintAssist.Hint="Font Size"
  2292. Value="{Binding Body3,Mode=TwoWay}" />
  2293. <!--8-->
  2294. <TextBlock Grid.Row="7"
  2295. Grid.Column="0"
  2296. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  2297. <mah:NumericUpDown Grid.Row="7"
  2298. Grid.Column="1"
  2299. materialDesign:HintAssist.Hint="Font Size"
  2300. Value="{Binding Body4,Mode=TwoWay}" />
  2301. <!--9-->
  2302. <TextBlock Grid.Row="8"
  2303. Grid.Column="0"
  2304. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  2305. <mah:NumericUpDown Grid.Row="8"
  2306. Grid.Column="1"
  2307. materialDesign:HintAssist.Hint="Font Size"
  2308. Value="{Binding Captions1,Mode=TwoWay}" />
  2309. <!--10-->
  2310. <TextBlock Grid.Row="9"
  2311. Grid.Column="0"
  2312. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  2313. <mah:NumericUpDown Grid.Row="9"
  2314. Grid.Column="1"
  2315. materialDesign:HintAssist.Hint="Font Size"
  2316. Value="{Binding Captions2,Mode=TwoWay}" />
  2317. <!--11-->
  2318. <TextBlock Grid.Row="10"
  2319. Grid.Column="0"
  2320. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  2321. <mah:NumericUpDown Grid.Row="10"
  2322. Grid.Column="1"
  2323. materialDesign:HintAssist.Hint="Font Size"
  2324. Value="{Binding Captions3,Mode=TwoWay}" />
  2325. <!--12-->
  2326. <TextBlock Grid.Row="11"
  2327. Grid.Column="0"
  2328. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  2329. <mah:NumericUpDown Grid.Row="11"
  2330. Grid.Column="1"
  2331. materialDesign:HintAssist.Hint="Font Size"
  2332. Value="{Binding Captions4,Mode=TwoWay}" />
  2333. </Grid>
  2334. </ScrollViewer>
  2335. </TabItem>
  2336. <!--语言-->
  2337. <TabItem>
  2338. <TabItem.Header>
  2339. <StackPanel HorizontalAlignment="Stretch">
  2340. <materialDesign:PackIcon Width="24"
  2341. Height="24"
  2342. HorizontalAlignment="Center"
  2343. Kind="TranslateVariant" />
  2344. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2345. FontSize="{DynamicResource Font.Size.Body2}"
  2346. Text="{lex:Loc SettingView_Language_Text}"
  2347. HorizontalAlignment="Stretch" />
  2348. </StackPanel>
  2349. </TabItem.Header>
  2350. <StackPanel Margin="20"
  2351. Orientation="Horizontal"
  2352. VerticalAlignment="Top">
  2353. <!--中文简体-->
  2354. <Button MinWidth="100"
  2355. materialDesign:ButtonAssist.CornerRadius="10"
  2356. ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}"
  2357. FontSize="{DynamicResource Font.Size.Body1}"
  2358. Command="{Binding SelectLanguageCommand}"
  2359. CommandParameter="ChineseSimplified">
  2360. <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
  2361. <Button.Style>
  2362. <Style TargetType="Button"
  2363. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2364. <Setter Property="Foreground"
  2365. Value="#000000" />
  2366. <Style.Triggers>
  2367. <DataTrigger Binding="{Binding CurrentLanguage}"
  2368. Value="{x:Static enums:Language.ChineseSimplified}">
  2369. <Setter Property="Background"
  2370. Value="Green" />
  2371. <Setter Property="BorderBrush"
  2372. Value="Green" />
  2373. </DataTrigger>
  2374. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  2375. Value="{x:Static enums:Language.English}">
  2376. <Setter Property="Background"
  2377. Value="#e4ff54" />
  2378. <Setter Property="BorderBrush"
  2379. Value="#e4ff54" />
  2380. </DataTrigger>-->
  2381. </Style.Triggers>
  2382. </Style>
  2383. </Button.Style>
  2384. </Button>
  2385. <!--中文繁体-->
  2386. <Button MinWidth="100"
  2387. Margin="20.0"
  2388. materialDesign:ButtonAssist.CornerRadius="10"
  2389. ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}"
  2390. FontSize="{DynamicResource Font.Size.Body1}"
  2391. Command="{Binding SelectLanguageCommand}"
  2392. CommandParameter="ChineseTraditional">
  2393. <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
  2394. <Button.Style>
  2395. <Style TargetType="Button"
  2396. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2397. <Setter Property="Foreground"
  2398. Value="#000000" />
  2399. <Style.Triggers>
  2400. <DataTrigger Binding="{Binding CurrentLanguage}"
  2401. Value="{x:Static enums:Language.ChineseTraditional}">
  2402. <Setter Property="Background"
  2403. Value="Green" />
  2404. <Setter Property="BorderBrush"
  2405. Value="Green" />
  2406. </DataTrigger>
  2407. </Style.Triggers>
  2408. </Style>
  2409. </Button.Style>
  2410. </Button>
  2411. <!--英语-->
  2412. <Button MinWidth="100"
  2413. Margin="20.0"
  2414. materialDesign:ButtonAssist.CornerRadius="10"
  2415. ToolTip="{lex:Loc SettingView_Language_English}"
  2416. FontSize="{DynamicResource Font.Size.Body1}"
  2417. Command="{Binding SelectLanguageCommand}"
  2418. CommandParameter="English">
  2419. <TextBlock Text="{lex:Loc SettingView_Language_English}" />
  2420. <Button.Style>
  2421. <Style TargetType="Button"
  2422. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2423. <Setter Property="Foreground"
  2424. Value="#000000" />
  2425. <Style.Triggers>
  2426. <DataTrigger Binding="{Binding CurrentLanguage}"
  2427. Value="{x:Static enums:Language.English}">
  2428. <Setter Property="Background"
  2429. Value="Green" />
  2430. <Setter Property="BorderBrush"
  2431. Value="Green" />
  2432. </DataTrigger>
  2433. </Style.Triggers>
  2434. </Style>
  2435. </Button.Style>
  2436. </Button>
  2437. <!--日语-->
  2438. <Button MinWidth="100"
  2439. Margin="20.0"
  2440. materialDesign:ButtonAssist.CornerRadius="10"
  2441. ToolTip="{lex:Loc SettingView_Language_Japanese}"
  2442. FontSize="{DynamicResource Font.Size.Body1}"
  2443. Command="{Binding SelectLanguageCommand}"
  2444. CommandParameter="Japanese">
  2445. <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
  2446. <Button.Style>
  2447. <Style TargetType="Button"
  2448. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  2449. <Setter Property="Foreground"
  2450. Value="#000000" />
  2451. <Style.Triggers>
  2452. <DataTrigger Binding="{Binding CurrentLanguage}"
  2453. Value="{x:Static enums:Language.Japanese}">
  2454. <Setter Property="Background"
  2455. Value="Green" />
  2456. <Setter Property="BorderBrush"
  2457. Value="Green" />
  2458. </DataTrigger>
  2459. </Style.Triggers>
  2460. </Style>
  2461. </Button.Style>
  2462. </Button>
  2463. </StackPanel>
  2464. </TabItem>
  2465. </TabControl>
  2466. </Grid>
  2467. </UserControl>