SettingView.xaml 113 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760
  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:vm="clr-namespace:TeamAAS_VP.ViewModels"
  10. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  11. xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
  12. xmlns:enums1="clr-namespace:Team.FFFeederService;assembly=Team.FFFeederService"
  13. xmlns:valRules="clr-namespace:TeamAAS_VP.Identity"
  14. xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
  15. xmlns:c="clr-namespace:TeamAAS_VP.ValueConverter"
  16. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  17. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  18. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  19. lex:LocalizeDictionary.DesignCulture="zh-CN"
  20. mc:Ignorable="d"
  21. d:DataContext="{d:DesignInstance Type=vm:SettingViewModel}"
  22. d:Height="600"
  23. d:Width="1024"
  24. d:Background="White"
  25. x:Class="TeamAAS_VP.Views.SettingView"
  26. prism:ViewModelLocator.AutoWireViewModel="True"
  27. FontFamily="{DynamicResource DefaultFont}">
  28. <b:Interaction.Triggers>
  29. <b:EventTrigger EventName="Loaded">
  30. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  31. </b:EventTrigger>
  32. </b:Interaction.Triggers>
  33. <UserControl.Resources>
  34. <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverter" />
  35. <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverterInverse"
  36. Inverse="True" />
  37. <c:PlcIdToNameConverter x:Key="PlcIdToNameConverter" />
  38. </UserControl.Resources>
  39. <Grid>
  40. <TabControl materialDesign:NavigationRailAssist.ShowSelectionBackground="True"
  41. SnapsToDevicePixels="True"
  42. Style="{StaticResource MaterialDesignNavigationRailTabControl}"
  43. TabStripPlacement="Left">
  44. <materialDesign:NavigationRailAssist.FloatingContent>
  45. <Button Margin="8"
  46. Content="{materialDesign:PackIcon Kind=OfficeBuildingCogOutline}"
  47. Style="{StaticResource MaterialDesignFloatingActionSecondaryButton}" />
  48. </materialDesign:NavigationRailAssist.FloatingContent>
  49. <!--相机配置-->
  50. <TabItem Margin="5,0">
  51. <TabItem.Header>
  52. <StackPanel Width="auto"
  53. Height="auto">
  54. <materialDesign:PackIcon Width="24"
  55. Height="24"
  56. HorizontalAlignment="Center"
  57. Kind="CameraPlusOutline" />
  58. <TextBlock HorizontalAlignment="Center"
  59. TextWrapping="Wrap"
  60. FontSize="{DynamicResource Font.Size.Body2}"
  61. Text="{lex:Loc SettingView_Camera_Text}" />
  62. </StackPanel>
  63. </TabItem.Header>
  64. <Grid Margin="16">
  65. <Grid.RowDefinitions>
  66. <RowDefinition Height="50" />
  67. <RowDefinition Height="*" />
  68. </Grid.RowDefinitions>
  69. <Grid.ColumnDefinitions>
  70. <ColumnDefinition Width="auto" />
  71. <ColumnDefinition Width="*" />
  72. </Grid.ColumnDefinitions>
  73. <!--增删改查-->
  74. <StackPanel Grid.ColumnSpan="2"
  75. IsEnabled="{Binding IsAllowEdit}"
  76. Orientation="Horizontal">
  77. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  78. ToolTip="{lex:Loc SettingView_Camera_btnAddCamera}"
  79. Command="{Binding AddCameraCommand}">
  80. <materialDesign:PackIcon Kind="Plus" />
  81. </Button>
  82. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  83. ToolTip="{lex:Loc SettingView_Camera_btnEditCamera}"
  84. Margin="20,0"
  85. Command="{Binding EditCameraCommand}">
  86. <materialDesign:PackIcon Kind="PuzzleEditOutline" />
  87. </Button>
  88. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  89. ToolTip="{lex:Loc SettingView_Camera_btnRemoveCamera}"
  90. Command="{Binding RemoveCameraCommand}">
  91. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  92. </Button>
  93. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  94. Margin="20,0"
  95. ToolTip="{lex:Loc 保存}"
  96. Command="{Binding SaveCamerasCommand}">
  97. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  98. </Button>
  99. </StackPanel>
  100. <!--相机列表-->
  101. <TreeView Grid.Row="1"
  102. Grid.Column="0"
  103. SelectedItemChanged="TreeView_SelectedItemChanged">
  104. <TreeViewItem Header="{lex:Loc SettingView_Camera_CameraList}"
  105. FontSize="{DynamicResource Font.Size.Title4}"
  106. FontWeight="Bold"
  107. IsExpanded="True"
  108. ItemsSource="{Binding CameraList}">
  109. <TreeViewItem.ItemTemplate>
  110. <HierarchicalDataTemplate>
  111. <StackPanel Orientation="Vertical">
  112. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  113. <TextBlock.Text>
  114. <MultiBinding StringFormat="{}{0}. {1}">
  115. <Binding Path="CameraNo" />
  116. <Binding Path="CameraName" />
  117. </MultiBinding>
  118. </TextBlock.Text>
  119. </TextBlock>
  120. <StackPanel Orientation="Horizontal">
  121. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  122. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  123. FontSize="{DynamicResource Font.Size.Body3}" />
  124. <TextBlock Text="{Binding CameraBrand}"
  125. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  126. FontSize="{DynamicResource Font.Size.Body3}" />
  127. <TextBlock Text="-"
  128. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  129. FontSize="{DynamicResource Font.Size.Body3}" />
  130. <TextBlock Text="{Binding ManufacturerName}"
  131. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  132. FontSize="{DynamicResource Font.Size.Body3}" />
  133. </StackPanel>
  134. <StackPanel Orientation="Horizontal">
  135. <TextBlock Text="{lex:Loc 型号, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  136. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  137. FontSize="{DynamicResource Font.Size.Body3}" />
  138. <TextBlock Text="{Binding Model,Mode=TwoWay}"
  139. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  140. FontSize="{DynamicResource Font.Size.Body3}" />
  141. <TextBlock Text="{lex:Loc 序列号,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  142. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  143. FontSize="{DynamicResource Font.Size.Body3}"
  144. Margin="10,0,0,0" />
  145. <TextBlock Text="{Binding SerialNumber,Mode=TwoWay}"
  146. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  147. FontSize="{DynamicResource Font.Size.Body3}" />
  148. </StackPanel>
  149. <StackPanel Orientation="Horizontal">
  150. <TextBlock Text="{lex:Loc 类型, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  151. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  152. FontSize="{DynamicResource Font.Size.Body3}" />
  153. <TextBlock Text="{Binding CameraType}"
  154. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  155. FontSize="{DynamicResource Font.Size.Body3}" />
  156. <TextBlock Text="IP: "
  157. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  158. FontSize="{DynamicResource Font.Size.Body3}"
  159. Margin="10,0,0,0" />
  160. <TextBlock Text="{Binding CameraIp}"
  161. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  162. FontSize="{DynamicResource Font.Size.Body3}" />
  163. </StackPanel>
  164. <Border Height="2"
  165. Margin="0"
  166. BorderThickness="2"
  167. BorderBrush="Green" />
  168. </StackPanel>
  169. </HierarchicalDataTemplate>
  170. </TreeViewItem.ItemTemplate>
  171. </TreeViewItem>
  172. </TreeView>
  173. </Grid>
  174. </TabItem>
  175. <!--机器人-->
  176. <TabItem>
  177. <TabItem.Header>
  178. <StackPanel>
  179. <materialDesign:PackIcon Width="24"
  180. Height="24"
  181. HorizontalAlignment="Center"
  182. Kind="RobotIndustrialOutline" />
  183. <TextBlock HorizontalAlignment="Center"
  184. TextWrapping="Wrap"
  185. FontSize="{DynamicResource Font.Size.Body2}"
  186. Text="{lex:Loc 机器人}" />
  187. </StackPanel>
  188. </TabItem.Header>
  189. <Grid Margin="16">
  190. <Grid.RowDefinitions>
  191. <RowDefinition Height="50" />
  192. <RowDefinition Height="*" />
  193. </Grid.RowDefinitions>
  194. <Grid.ColumnDefinitions>
  195. <ColumnDefinition Width="auto" />
  196. <ColumnDefinition Width="*" />
  197. </Grid.ColumnDefinitions>
  198. <!--增删改查-->
  199. <StackPanel Grid.ColumnSpan="2"
  200. IsEnabled="{Binding IsAllowEdit}"
  201. Orientation="Horizontal">
  202. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  203. ToolTip="{lex:Loc 增加机器人}"
  204. Command="{Binding AddRobotCommand}">
  205. <materialDesign:PackIcon Kind="Plus" />
  206. </Button>
  207. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  208. ToolTip="{lex:Loc 移除机器人}"
  209. Margin="20,0"
  210. Command="{Binding RemoveCommand}">
  211. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  212. </Button>
  213. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  214. ToolTip="{lex:Loc 保存}"
  215. Command="{Binding SaveRobotsCommand}">
  216. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  217. </Button>
  218. </StackPanel>
  219. <!--机器人列表-->
  220. <TreeView Grid.Row="1"
  221. Grid.Column="0"
  222. SelectedItemChanged="TreeView_SelectedItemChanged">
  223. <TreeViewItem Header="{lex:Loc 机器人列表}"
  224. FontSize="{DynamicResource Font.Size.Title4}"
  225. FontWeight="Bold"
  226. IsExpanded="True"
  227. ItemsSource="{Binding RobotList}">
  228. <TreeViewItem.ItemTemplate>
  229. <HierarchicalDataTemplate>
  230. <StackPanel Orientation="Vertical">
  231. <StackPanel Orientation="Horizontal">
  232. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  233. <TextBlock.Text>
  234. <MultiBinding StringFormat="{}{0}. {1}">
  235. <Binding Path="RobotNo" />
  236. <Binding Path="RobotName" />
  237. </MultiBinding>
  238. </TextBlock.Text>
  239. </TextBlock>
  240. </StackPanel>
  241. <StackPanel Orientation="Horizontal">
  242. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  243. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  244. FontSize="{DynamicResource Font.Size.Captions3}" />
  245. <TextBlock Text="{Binding RobotBrand,Mode=TwoWay}"
  246. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  247. FontSize="{DynamicResource Font.Size.Captions3}" />
  248. <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  249. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  250. FontSize="{DynamicResource Font.Size.Captions3}"
  251. Margin="10,0,0,0"
  252. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  253. <TextBlock Text="{Binding ConnectType,Mode=TwoWay}"
  254. VerticalAlignment="Center"
  255. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  256. FontSize="{DynamicResource Font.Size.Captions3}"
  257. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  258. <!--PLC-->
  259. <TextBlock Text="PLC: "
  260. Margin="10,0,0,0"
  261. FontSize="{DynamicResource Font.Size.Captions3}"
  262. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  263. d:Visibility="Collapsed"
  264. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  265. <TextBlock Text="{Binding PLC,Converter={StaticResource PlcIdToNameConverter}}"
  266. FontSize="{DynamicResource Font.Size.Captions3}"
  267. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  268. d:Visibility="Collapsed"
  269. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  270. </StackPanel>
  271. <StackPanel Orientation="Horizontal"
  272. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  273. <TextBlock Text="{Binding IP,StringFormat=IP:{0},Mode=TwoWay}"
  274. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  275. FontSize="{DynamicResource Font.Size.Captions3}" />
  276. <TextBlock Text="{Binding Port,StringFormat=Port:{0},Mode=TwoWay}"
  277. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  278. FontSize="{DynamicResource Font.Size.Captions3}"
  279. Margin="10,0" />
  280. <TextBlock Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  281. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  282. FontSize="{DynamicResource Font.Size.Captions3}" />
  283. <TextBlock Text="{Binding Terminator,Mode=TwoWay}"
  284. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  285. FontSize="{DynamicResource Font.Size.Captions3}" />
  286. </StackPanel>
  287. <Border Height="2"
  288. Margin="0"
  289. BorderThickness="2"
  290. BorderBrush="Green" />
  291. </StackPanel>
  292. </HierarchicalDataTemplate>
  293. </TreeViewItem.ItemTemplate>
  294. </TreeViewItem>
  295. </TreeView>
  296. <!--参数详情-->
  297. <ScrollViewer Grid.Row="1"
  298. Grid.Column="1"
  299. IsEnabled="{Binding IsAllowEdit}"
  300. Margin="20"
  301. Visibility="{Binding SelectRobot,Converter={StaticResource ObjectToVisibilityConverter}}">
  302. <Grid HorizontalAlignment="Stretch"
  303. VerticalAlignment="Top">
  304. <Grid.RowDefinitions>
  305. <RowDefinition />
  306. <RowDefinition />
  307. <RowDefinition />
  308. <RowDefinition />
  309. <RowDefinition />
  310. <RowDefinition />
  311. <RowDefinition />
  312. <RowDefinition />
  313. </Grid.RowDefinitions>
  314. <Grid.ColumnDefinitions>
  315. <ColumnDefinition Width="auto" />
  316. <ColumnDefinition Width="auto" />
  317. <ColumnDefinition Width="*" />
  318. </Grid.ColumnDefinitions>
  319. <!--id-->
  320. <TextBlock Text="Id: "
  321. Grid.Row="0"
  322. Grid.Column="0"
  323. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  324. HorizontalAlignment="Right"
  325. VerticalAlignment="Center"
  326. FontSize="{DynamicResource Font.Size.Body3}" />
  327. <TextBlock x:Name="txt_Id"
  328. Text="{Binding SelectRobot.Id,Mode=TwoWay}"
  329. Grid.Row="0"
  330. Grid.Column="1"
  331. Margin="10,0"
  332. HorizontalAlignment="Left"
  333. VerticalAlignment="Center"
  334. FontSize="{DynamicResource Font.Size.Body3}" />
  335. <!--名称-->
  336. <TextBlock Text="{lex:Loc 名称,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  337. Grid.Row="1"
  338. Grid.Column="0"
  339. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  340. HorizontalAlignment="Right"
  341. VerticalAlignment="Center"
  342. FontSize="{DynamicResource Font.Size.Body3}" />
  343. <TextBox Grid.Row="1"
  344. Grid.Column="1"
  345. Margin="10,0"
  346. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  347. FontSize="{DynamicResource Font.Size.Body3}"
  348. MinWidth="80"
  349. TextAlignment="Center"
  350. HorizontalAlignment="Left"
  351. VerticalAlignment="Center">
  352. <TextBox.Text>
  353. <Binding Path="SelectRobot.RobotName"
  354. Mode="TwoWay">
  355. <Binding.ValidationRules>
  356. <valRules:NameValidationRule />
  357. </Binding.ValidationRules>
  358. </Binding>
  359. </TextBox.Text>
  360. </TextBox>
  361. <!--机器人品牌-->
  362. <TextBlock Text="{lex:Loc 品牌,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  363. Grid.Row="2"
  364. Grid.Column="0"
  365. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  366. FontSize="{DynamicResource Font.Size.Body3}"
  367. HorizontalAlignment="Right"
  368. VerticalAlignment="Center" />
  369. <ComboBox Grid.Row="2"
  370. Grid.Column="1"
  371. Margin="10,0"
  372. FontSize="{DynamicResource Font.Size.Body3}"
  373. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  374. MinWidth="80"
  375. SelectedItem="{Binding SelectRobot.RobotBrand,Mode=TwoWay}"
  376. ItemsSource="{ext:EnumBindingSource EnumType=enums:RobotBrand}"
  377. HorizontalContentAlignment="Center"
  378. HorizontalAlignment="Left"
  379. VerticalAlignment="Center" />
  380. <!--通讯方式-->
  381. <TextBlock Text="{lex:Loc 通讯方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  382. Grid.Row="3"
  383. Grid.Column="0"
  384. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  385. FontSize="{DynamicResource Font.Size.Body3}"
  386. HorizontalAlignment="Right"
  387. VerticalAlignment="Center"
  388. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  389. <ComboBox Grid.Row="3"
  390. Grid.Column="1"
  391. Margin="10,0"
  392. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  393. MinWidth="80"
  394. SelectedItem="{Binding SelectRobot.ConnectType,Mode=TwoWay}"
  395. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  396. FontSize="{DynamicResource Font.Size.Body3}"
  397. HorizontalContentAlignment="Center"
  398. HorizontalAlignment="Left"
  399. VerticalAlignment="Center"
  400. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  401. <!--IP地址-->
  402. <TextBlock Text="IP: "
  403. Grid.Row="4"
  404. Grid.Column="0"
  405. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  406. FontSize="{DynamicResource Font.Size.Body3}"
  407. HorizontalAlignment="Right"
  408. VerticalAlignment="Center"
  409. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  410. <TextBox Grid.Row="4"
  411. Grid.Column="1"
  412. Margin="10,0"
  413. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  414. FontSize="{DynamicResource Font.Size.Body3}"
  415. MinWidth="80"
  416. TextAlignment="Center"
  417. HorizontalAlignment="Left"
  418. VerticalAlignment="Center"
  419. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  420. <TextBox.Text>
  421. <Binding Path="SelectRobot.IP"
  422. Mode="TwoWay">
  423. <Binding.ValidationRules>
  424. <valRules:IPValidationRule />
  425. </Binding.ValidationRules>
  426. </Binding>
  427. </TextBox.Text>
  428. </TextBox>
  429. <!--端口号-->
  430. <TextBlock Text="Port: "
  431. Grid.Row="5"
  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="5"
  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.Port"
  450. Mode="TwoWay">
  451. <Binding.ValidationRules>
  452. <valRules:PortValidationRule />
  453. </Binding.ValidationRules>
  454. </Binding>
  455. </TextBox.Text>
  456. </TextBox>
  457. <!--结束符-->
  458. <TextBlock Text="{lex:Loc 结束符,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  459. Grid.Row="6"
  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. <ComboBox SelectedItem="{Binding SelectRobot.Terminator,Mode=TwoWay}"
  467. Grid.Row="6"
  468. Grid.Column="1"
  469. Margin="10,0"
  470. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  471. MinWidth="80"
  472. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  473. FontSize="{DynamicResource Font.Size.Body3}"
  474. HorizontalContentAlignment="Center"
  475. HorizontalAlignment="Left"
  476. VerticalAlignment="Center"
  477. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  478. <!--编码格式-->
  479. <TextBlock Text="{lex:Loc 编码解码,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  480. Grid.Row="7"
  481. Grid.Column="0"
  482. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  483. FontSize="{DynamicResource Font.Size.Body3}"
  484. HorizontalAlignment="Right"
  485. VerticalAlignment="Center"
  486. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  487. <ComboBox SelectedItem="{Binding SelectRobot.DataEncoding,Mode=TwoWay}"
  488. Grid.Row="7"
  489. Grid.Column="1"
  490. Margin="10,0"
  491. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  492. MinWidth="80"
  493. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  494. FontSize="{DynamicResource Font.Size.Body3}"
  495. HorizontalContentAlignment="Center"
  496. HorizontalAlignment="Left"
  497. VerticalAlignment="Center"
  498. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  499. <!--PLC-->
  500. <TextBlock Grid.Row="3"
  501. Grid.Column="0"
  502. Text="PLC: "
  503. HorizontalAlignment="Right"
  504. VerticalAlignment="Center"
  505. d:Visibility="Collapsed"
  506. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  507. <ComboBox SelectedItem="{Binding RobotSelectedPlc}"
  508. Grid.Row="3"
  509. Grid.Column="1"
  510. Margin="10,5"
  511. ItemsSource="{Binding PlcList}"
  512. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  513. MinWidth="80"
  514. HorizontalContentAlignment="Center"
  515. HorizontalAlignment="Left"
  516. VerticalAlignment="Center"
  517. d:Visibility="Collapsed"
  518. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  519. <ComboBox.ItemTemplate>
  520. <DataTemplate>
  521. <TextBlock Text="{Binding Name}" />
  522. </DataTemplate>
  523. </ComboBox.ItemTemplate>
  524. </ComboBox>
  525. <ScrollViewer Grid.RowSpan="8"
  526. Grid.Column="2"
  527. HorizontalScrollBarVisibility="Auto"
  528. VerticalScrollBarVisibility="Auto"
  529. d:Visibility="Collapsed"
  530. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  531. <Grid Margin="5">
  532. <Grid.RowDefinitions>
  533. <RowDefinition Height="Auto" />
  534. <RowDefinition Height="Auto" />
  535. <RowDefinition Height="Auto" />
  536. <RowDefinition Height="Auto" />
  537. <RowDefinition Height="Auto" />
  538. <RowDefinition Height="Auto" />
  539. <RowDefinition Height="Auto" />
  540. <RowDefinition Height="Auto" />
  541. <RowDefinition Height="Auto" />
  542. <RowDefinition Height="Auto" />
  543. <RowDefinition Height="Auto" />
  544. <RowDefinition Height="Auto" />
  545. <RowDefinition Height="Auto" />
  546. <RowDefinition Height="Auto" />
  547. <RowDefinition Height="Auto" />
  548. <RowDefinition Height="Auto" />
  549. <RowDefinition Height="Auto" />
  550. <RowDefinition Height="Auto" />
  551. <RowDefinition Height="Auto" />
  552. <RowDefinition Height="Auto" />
  553. <RowDefinition Height="Auto" />
  554. <RowDefinition Height="Auto" />
  555. <RowDefinition Height="Auto" />
  556. <RowDefinition Height="Auto" />
  557. </Grid.RowDefinitions>
  558. <Grid.ColumnDefinitions>
  559. <ColumnDefinition Width="auto" />
  560. <ColumnDefinition Width="*" />
  561. </Grid.ColumnDefinitions>
  562. <Grid.Resources>
  563. <Style TargetType="TextBlock">
  564. <Setter Property="FontSize"
  565. Value="{DynamicResource Font.Size.Body3}" />
  566. <Setter Property="Margin"
  567. Value="5" />
  568. <Setter Property="VerticalAlignment"
  569. Value="Center" />
  570. </Style>
  571. <Style TargetType="TextBox">
  572. <Setter Property="FontSize"
  573. Value="{DynamicResource Font.Size.Body3}" />
  574. <Setter Property="Margin"
  575. Value="5" />
  576. <Setter Property="HorizontalAlignment"
  577. Value="Stretch" />
  578. <Setter Property="VerticalAlignment"
  579. Value="Center" />
  580. </Style>
  581. </Grid.Resources>
  582. <TextBlock Grid.Row="0"
  583. FontWeight="Bold"
  584. Text="{lex:Loc 状态参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  585. <TextBlock Grid.Row="1"
  586. Text="{lex:Loc X坐标}" />
  587. <DockPanel Grid.Row="1"
  588. Grid.Column="1"
  589. LastChildFill="True">
  590. <TextBlock Text="{Binding ResultsValues[0]}"
  591. MinWidth="50" />
  592. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.X}" />
  593. </DockPanel>
  594. <TextBlock Grid.Row="2"
  595. Text="{lex:Loc Y坐标}" />
  596. <DockPanel Grid.Row="2"
  597. Grid.Column="1"
  598. LastChildFill="True">
  599. <TextBlock Text="{Binding ResultsValues[1]}"
  600. MinWidth="50" />
  601. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Y}" />
  602. </DockPanel>
  603. <TextBlock Grid.Row="3"
  604. Text="{lex:Loc Z坐标}" />
  605. <DockPanel Grid.Row="3"
  606. Grid.Column="1"
  607. LastChildFill="True">
  608. <TextBlock Text="{Binding ResultsValues[2]}"
  609. MinWidth="50" />
  610. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Z}" />
  611. </DockPanel>
  612. <TextBlock Grid.Row="4"
  613. Text="{lex:Loc U坐标}" />
  614. <DockPanel Grid.Row="4"
  615. Grid.Column="1"
  616. LastChildFill="True">
  617. <TextBlock Text="{Binding ResultsValues[3]}"
  618. MinWidth="50" />
  619. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.U}" />
  620. </DockPanel>
  621. <TextBlock Grid.Row="5"
  622. Text="{lex:Loc 运动结束}" />
  623. <DockPanel Grid.Row="5"
  624. Grid.Column="1"
  625. LastChildFill="True">
  626. <TextBlock Text="{Binding ResultsValues[4]}"
  627. MinWidth="50" />
  628. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.MoveFinish}" />
  629. </DockPanel>
  630. <TextBlock Grid.Row="6"
  631. Text="{lex:Loc 错误}" />
  632. <DockPanel Grid.Row="6"
  633. Grid.Column="1"
  634. LastChildFill="True">
  635. <TextBlock Text="{Binding ResultsValues[5]}"
  636. MinWidth="50" />
  637. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Error}" />
  638. </DockPanel>
  639. <TextBlock Grid.Row="7"
  640. Text="{lex:Loc 吸真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  641. <DockPanel Grid.Row="7"
  642. Grid.Column="1"
  643. LastChildFill="True">
  644. <TextBlock Text="{Binding ResultsValues[6]}"
  645. MinWidth="50" />
  646. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOn}" />
  647. </DockPanel>
  648. <TextBlock Grid.Row="8"
  649. Text="{lex:Loc 破真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  650. <DockPanel Grid.Row="8"
  651. Grid.Column="1"
  652. LastChildFill="True">
  653. <TextBlock Text="{Binding ResultsValues[7]}"
  654. MinWidth="50" />
  655. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOff}" />
  656. </DockPanel>
  657. <TextBlock Grid.Row="9"
  658. FontWeight="Bold"
  659. Text="{lex:Loc 命令参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  660. <TextBlock Grid.Row="10"
  661. Text="{lex:Loc X坐标}" />
  662. <TextBox Grid.Row="10"
  663. Grid.Column="1"
  664. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.X}" />
  665. <TextBlock Grid.Row="11"
  666. Text="{lex:Loc Y坐标}" />
  667. <TextBox Grid.Row="11"
  668. Grid.Column="1"
  669. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Y}" />
  670. <TextBlock Grid.Row="12"
  671. Text="{lex:Loc Z坐标}" />
  672. <TextBox Grid.Row="12"
  673. Grid.Column="1"
  674. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Z}" />
  675. <TextBlock Grid.Row="13"
  676. Text="{lex:Loc U坐标}" />
  677. <TextBox Grid.Row="13"
  678. Grid.Column="1"
  679. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.U}" />
  680. <TextBlock Grid.Row="14"
  681. Text="{lex:Loc 吸真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  682. <TextBox Grid.Row="14"
  683. Grid.Column="1"
  684. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOn}" />
  685. <TextBlock Grid.Row="15"
  686. Text="{lex:Loc 破真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  687. <TextBox Grid.Row="15"
  688. Grid.Column="1"
  689. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOff}" />
  690. <TextBlock Grid.Row="16"
  691. Text="{lex:Loc Z轴限高}" />
  692. <TextBox Grid.Row="16"
  693. Grid.Column="1"
  694. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Limz}" />
  695. <TextBlock Grid.Row="17"
  696. Text="{lex:Loc 执行运动}" />
  697. <TextBox Grid.Row="17"
  698. Grid.Column="1"
  699. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.ExecuteMove}" />
  700. <TextBlock Grid.Row="18"
  701. Text="{lex:Loc 吸真空}" />
  702. <TextBox Grid.Row="18"
  703. Grid.Column="1"
  704. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOn}" />
  705. <TextBlock Grid.Row="19"
  706. Text="{lex:Loc 破真空}" />
  707. <TextBox Grid.Row="19"
  708. Grid.Column="1"
  709. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOff}" />
  710. <TextBlock Grid.Row="20"
  711. Text="{lex:Loc 步进距离,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  712. <TextBox Grid.Row="20"
  713. Grid.Column="1"
  714. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Distance}" />
  715. <TextBlock Grid.Row="21"
  716. Text="{lex:Loc 点动命令,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  717. <TextBox Grid.Row="21"
  718. Grid.Column="1"
  719. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.JogCmd}" />
  720. </Grid>
  721. </ScrollViewer>
  722. </Grid>
  723. </ScrollViewer>
  724. </Grid>
  725. </TabItem>
  726. <!--Feeder-->
  727. <TabItem>
  728. <TabItem.Header>
  729. <StackPanel Width="auto"
  730. Height="auto">
  731. <materialDesign:PackIcon Width="24"
  732. Height="24"
  733. HorizontalAlignment="Center"
  734. Kind="Vibrate" />
  735. <TextBlock HorizontalAlignment="Center"
  736. TextWrapping="Wrap"
  737. FontSize="{DynamicResource Font.Size.Body2}"
  738. Text="Feeder" />
  739. </StackPanel>
  740. </TabItem.Header>
  741. <Grid Margin="16">
  742. <Grid.RowDefinitions>
  743. <RowDefinition Height="50" />
  744. <RowDefinition Height="*" />
  745. </Grid.RowDefinitions>
  746. <Grid.ColumnDefinitions>
  747. <ColumnDefinition Width="auto" />
  748. <ColumnDefinition Width="*" />
  749. </Grid.ColumnDefinitions>
  750. <!--增删改查-->
  751. <StackPanel Grid.ColumnSpan="2"
  752. IsEnabled="{Binding IsAllowEdit}"
  753. Orientation="Horizontal">
  754. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  755. ToolTip="{lex:Loc 增加Feeder}"
  756. Command="{Binding AddFeederCommand}">
  757. <materialDesign:PackIcon Kind="Plus" />
  758. </Button>
  759. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  760. ToolTip="{lex:Loc 移除Feeder}"
  761. Margin="20,0"
  762. Command="{Binding RemoveFeederCommand}">
  763. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  764. </Button>
  765. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  766. ToolTip="{lex:Loc 保存}"
  767. Command="{Binding SaveFeedersCommand}">
  768. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  769. </Button>
  770. </StackPanel>
  771. <!--Feeder列表-->
  772. <TreeView Grid.Row="1"
  773. Grid.Column="0"
  774. SelectedItemChanged="TreeView_SelectedItemChanged">
  775. <TreeViewItem Header="{lex:Loc Feeder列表}"
  776. FontSize="{DynamicResource Font.Size.Title4}"
  777. FontWeight="Bold"
  778. IsExpanded="True"
  779. ItemsSource="{Binding FeederList}">
  780. <TreeViewItem.ItemTemplate>
  781. <HierarchicalDataTemplate>
  782. <StackPanel Orientation="Vertical">
  783. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  784. <TextBlock.Text>
  785. <MultiBinding StringFormat="{}{0}. {1}">
  786. <Binding Path="FeederNo" />
  787. <Binding Path="FeederName" />
  788. </MultiBinding>
  789. </TextBlock.Text>
  790. </TextBlock>
  791. <StackPanel Orientation="Horizontal">
  792. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  793. FontSize="{DynamicResource Font.Size.Captions3}"
  794. Style="{StaticResource MaterialDesignCaptionTextBlock}" />
  795. <TextBlock Text="{Binding FeederBrand,Mode=TwoWay}"
  796. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  797. FontSize="{DynamicResource Font.Size.Captions3}" />
  798. <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  799. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  800. FontSize="{DynamicResource Font.Size.Captions3}"
  801. Margin="10,0,0,0" />
  802. <TextBlock Text="{Binding ConnectType,Mode=TwoWay}"
  803. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  804. FontSize="{DynamicResource Font.Size.Captions3}" />
  805. </StackPanel>
  806. <StackPanel Orientation="Horizontal">
  807. <TextBlock Text="{Binding IP,StringFormat=IP:{0},Mode=TwoWay}"
  808. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  809. FontSize="{DynamicResource Font.Size.Captions3}" />
  810. <TextBlock Text="{Binding Port,StringFormat=Port:{0},Mode=TwoWay}"
  811. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  812. FontSize="{DynamicResource Font.Size.Captions3}"
  813. Margin="10,0" />
  814. </StackPanel>
  815. <Border Height="2"
  816. Margin="0"
  817. BorderThickness="2"
  818. BorderBrush="Green" />
  819. </StackPanel>
  820. </HierarchicalDataTemplate>
  821. </TreeViewItem.ItemTemplate>
  822. </TreeViewItem>
  823. </TreeView>
  824. <!--参数详情-->
  825. <ScrollViewer Grid.Row="1"
  826. IsEnabled="{Binding IsAllowEdit}"
  827. Grid.Column="1"
  828. Margin="20"
  829. HorizontalAlignment="Left"
  830. VerticalAlignment="Top"
  831. Visibility="{Binding SelectFeeder,Converter={StaticResource ObjectToVisibilityConverter}}">
  832. <Grid Height="300">
  833. <Grid.RowDefinitions>
  834. <RowDefinition />
  835. <RowDefinition />
  836. <RowDefinition />
  837. <RowDefinition />
  838. <RowDefinition />
  839. <RowDefinition />
  840. <RowDefinition />
  841. </Grid.RowDefinitions>
  842. <Grid.ColumnDefinitions>
  843. <ColumnDefinition Width="auto" />
  844. <ColumnDefinition Width="*" />
  845. </Grid.ColumnDefinitions>
  846. <!--id-->
  847. <TextBlock Text="Id: "
  848. Grid.Row="0"
  849. Grid.Column="0"
  850. FontSize="{DynamicResource Font.Size.Body3}"
  851. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  852. HorizontalAlignment="Right"
  853. VerticalAlignment="Center" />
  854. <TextBlock x:Name="txt_Feeder_Id"
  855. Text="{Binding SelectFeeder.Id,Mode=TwoWay}"
  856. Grid.Row="0"
  857. Grid.Column="1"
  858. FontSize="{DynamicResource Font.Size.Body3}"
  859. Margin="10,0"
  860. HorizontalAlignment="Left"
  861. VerticalAlignment="Center" />
  862. <!--名称-->
  863. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  864. Grid.Row="1"
  865. Grid.Column="0"
  866. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  867. FontSize="{DynamicResource Font.Size.Body3}"
  868. HorizontalAlignment="Right"
  869. VerticalAlignment="Center" />
  870. <TextBox Grid.Row="1"
  871. Grid.Column="1"
  872. Margin="10,0"
  873. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  874. FontSize="{DynamicResource Font.Size.Body3}"
  875. MinWidth="80"
  876. TextAlignment="Center"
  877. HorizontalAlignment="Left"
  878. VerticalAlignment="Center">
  879. <TextBox.Text>
  880. <Binding Path="SelectFeeder.FeederName"
  881. Mode="TwoWay">
  882. <Binding.ValidationRules>
  883. <valRules:NameValidationRule />
  884. </Binding.ValidationRules>
  885. </Binding>
  886. </TextBox.Text>
  887. </TextBox>
  888. <!--Feeder品牌-->
  889. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  890. Grid.Row="2"
  891. Grid.Column="0"
  892. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  893. FontSize="{DynamicResource Font.Size.Body3}"
  894. HorizontalAlignment="Right"
  895. VerticalAlignment="Center" />
  896. <ComboBox SelectedItem="{Binding SelectFeeder.FeederBrand,Mode=TwoWay}"
  897. Grid.Row="2"
  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. ItemsSource="{ext:EnumBindingSource EnumType=enums1:FeederBrand}"
  904. HorizontalContentAlignment="Center"
  905. HorizontalAlignment="Left"
  906. VerticalAlignment="Center" />
  907. <!--通讯方式-->
  908. <TextBlock Text="{lex:Loc 通讯方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  909. Grid.Row="3"
  910. Grid.Column="0"
  911. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  912. FontSize="{DynamicResource Font.Size.Body3}"
  913. HorizontalAlignment="Right"
  914. VerticalAlignment="Center" />
  915. <ComboBox SelectedItem="{Binding SelectFeeder.ConnectType,Mode=TwoWay}"
  916. Grid.Row="3"
  917. Grid.Column="1"
  918. Margin="10,0"
  919. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  920. MinWidth="80"
  921. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  922. FontSize="{DynamicResource Font.Size.Body3}"
  923. HorizontalContentAlignment="Center"
  924. HorizontalAlignment="Left"
  925. VerticalAlignment="Center" />
  926. <!--IP地址-->
  927. <TextBlock Text="IP: "
  928. Grid.Row="4"
  929. Grid.Column="0"
  930. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  931. FontSize="{DynamicResource Font.Size.Body3}"
  932. HorizontalAlignment="Right"
  933. VerticalAlignment="Center" />
  934. <TextBox Grid.Row="4"
  935. Grid.Column="1"
  936. Margin="10,0"
  937. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  938. FontSize="{DynamicResource Font.Size.Body3}"
  939. MinWidth="80"
  940. TextAlignment="Center"
  941. HorizontalAlignment="Left"
  942. VerticalAlignment="Center">
  943. <TextBox.Text>
  944. <Binding Path="SelectFeeder.IP"
  945. Mode="TwoWay">
  946. <Binding.ValidationRules>
  947. <valRules:IPValidationRule />
  948. </Binding.ValidationRules>
  949. </Binding>
  950. </TextBox.Text>
  951. </TextBox>
  952. <!--端口号-->
  953. <TextBlock Text="Port: "
  954. Grid.Row="5"
  955. Grid.Column="0"
  956. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  957. FontSize="{DynamicResource Font.Size.Body3}"
  958. HorizontalAlignment="Right"
  959. VerticalAlignment="Center" />
  960. <TextBox Grid.Row="5"
  961. Grid.Column="1"
  962. Margin="10,0"
  963. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  964. FontSize="{DynamicResource Font.Size.Body3}"
  965. MinWidth="80"
  966. TextAlignment="Center"
  967. HorizontalAlignment="Left"
  968. VerticalAlignment="Center">
  969. <TextBox.Text>
  970. <Binding Path="SelectFeeder.Port"
  971. Mode="TwoWay">
  972. <Binding.ValidationRules>
  973. <valRules:PortValidationRule />
  974. </Binding.ValidationRules>
  975. </Binding>
  976. </TextBox.Text>
  977. </TextBox>
  978. </Grid>
  979. </ScrollViewer>
  980. </Grid>
  981. </TabItem>
  982. <!--PLC-->
  983. <TabItem>
  984. <TabItem.Header>
  985. <StackPanel Width="auto"
  986. Height="auto">
  987. <materialDesign:PackIcon Width="24"
  988. Height="24"
  989. HorizontalAlignment="Center"
  990. Kind="CellphoneLink" />
  991. <TextBlock HorizontalAlignment="Center"
  992. TextWrapping="Wrap"
  993. FontSize="{DynamicResource Font.Size.Body2}"
  994. Text="PLC" />
  995. </StackPanel>
  996. </TabItem.Header>
  997. <Grid Margin="16">
  998. <Grid.RowDefinitions>
  999. <RowDefinition Height="50" />
  1000. <RowDefinition Height="*" />
  1001. </Grid.RowDefinitions>
  1002. <Grid.ColumnDefinitions>
  1003. <ColumnDefinition Width="auto" />
  1004. <ColumnDefinition Width="*" />
  1005. </Grid.ColumnDefinitions>
  1006. <!--增删改查-->
  1007. <StackPanel Grid.ColumnSpan="2"
  1008. IsEnabled="{Binding IsAllowEdit}"
  1009. Orientation="Horizontal">
  1010. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1011. ToolTip="{lex:Loc 增加PLC}"
  1012. Command="{Binding AddPlcCommand}">
  1013. <materialDesign:PackIcon Kind="Plus" />
  1014. </Button>
  1015. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1016. ToolTip="{lex:Loc 移除PLC}"
  1017. Margin="20,0"
  1018. Command="{Binding RemovePlcCommand}">
  1019. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1020. </Button>
  1021. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1022. ToolTip="{lex:Loc 保存}"
  1023. Command="{Binding SavePlcsCommand}">
  1024. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1025. </Button>
  1026. </StackPanel>
  1027. <!--PLC列表-->
  1028. <TreeView Grid.Row="1"
  1029. Grid.Column="0"
  1030. SelectedItemChanged="TreeView_SelectedItemChanged">
  1031. <TreeViewItem Header="{lex:Loc PLC列表}"
  1032. FontSize="{DynamicResource Font.Size.Title4}"
  1033. FontWeight="Bold"
  1034. IsExpanded="True"
  1035. ItemsSource="{Binding PlcList}">
  1036. <TreeViewItem.ItemTemplate>
  1037. <HierarchicalDataTemplate>
  1038. <StackPanel Orientation="Vertical">
  1039. <TextBlock Text="{Binding Name,Mode=TwoWay}"
  1040. FontSize="{DynamicResource Font.Size.Title4}" />
  1041. <StackPanel Orientation="Horizontal">
  1042. <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1043. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1044. FontSize="{DynamicResource Font.Size.Captions3}"
  1045. Margin="10,0,0,0" />
  1046. <TextBlock Text="{Binding CommunicationType,Mode=TwoWay}"
  1047. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1048. FontSize="{DynamicResource Font.Size.Captions3}" />
  1049. </StackPanel>
  1050. <StackPanel Orientation="Horizontal">
  1051. <TextBlock Text="{Binding EndpointUrl,StringFormat=Endpoint Url:{0},Mode=TwoWay}"
  1052. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1053. FontSize="{DynamicResource Font.Size.Captions3}" />
  1054. </StackPanel>
  1055. <Border Height="2"
  1056. Margin="0"
  1057. BorderThickness="2"
  1058. BorderBrush="Green" />
  1059. </StackPanel>
  1060. </HierarchicalDataTemplate>
  1061. </TreeViewItem.ItemTemplate>
  1062. </TreeViewItem>
  1063. </TreeView>
  1064. <!--参数详情-->
  1065. <ScrollViewer Grid.Row="1"
  1066. IsEnabled="{Binding IsAllowEdit}"
  1067. Grid.Column="1"
  1068. Margin="20"
  1069. HorizontalAlignment="Left"
  1070. VerticalAlignment="Top"
  1071. Visibility="{Binding SelectPlc,Converter={StaticResource ObjectToVisibilityConverter}}">
  1072. <Grid Height="200">
  1073. <Grid.RowDefinitions>
  1074. <RowDefinition />
  1075. <RowDefinition />
  1076. <RowDefinition />
  1077. <RowDefinition />
  1078. </Grid.RowDefinitions>
  1079. <Grid.ColumnDefinitions>
  1080. <ColumnDefinition Width="auto" />
  1081. <ColumnDefinition Width="*" />
  1082. </Grid.ColumnDefinitions>
  1083. <!--id-->
  1084. <TextBlock Text="Id: "
  1085. Grid.Row="0"
  1086. Grid.Column="0"
  1087. FontSize="{DynamicResource Font.Size.Body3}"
  1088. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1089. HorizontalAlignment="Right"
  1090. VerticalAlignment="Center" />
  1091. <TextBlock x:Name="txt_plc_Id"
  1092. Text="{Binding SelectPlc.Id,Mode=TwoWay}"
  1093. Grid.Row="0"
  1094. Grid.Column="1"
  1095. FontSize="{DynamicResource Font.Size.Body3}"
  1096. Margin="10,0"
  1097. HorizontalAlignment="Left"
  1098. VerticalAlignment="Center" />
  1099. <!--名称-->
  1100. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1101. Grid.Row="1"
  1102. Grid.Column="0"
  1103. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1104. FontSize="{DynamicResource Font.Size.Body3}"
  1105. HorizontalAlignment="Right"
  1106. VerticalAlignment="Center" />
  1107. <TextBox Grid.Row="1"
  1108. Grid.Column="1"
  1109. Margin="10,0"
  1110. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1111. FontSize="{DynamicResource Font.Size.Body3}"
  1112. MinWidth="80"
  1113. TextAlignment="Center"
  1114. HorizontalAlignment="Left"
  1115. VerticalAlignment="Center">
  1116. <TextBox.Text>
  1117. <Binding Path="SelectPlc.Name"
  1118. Mode="TwoWay">
  1119. <Binding.ValidationRules>
  1120. <valRules:NameValidationRule />
  1121. </Binding.ValidationRules>
  1122. </Binding>
  1123. </TextBox.Text>
  1124. </TextBox>
  1125. <!--通讯方式-->
  1126. <TextBlock Text="{lex:Loc 通讯方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1127. Grid.Row="2"
  1128. Grid.Column="0"
  1129. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1130. FontSize="{DynamicResource Font.Size.Body3}"
  1131. HorizontalAlignment="Right"
  1132. VerticalAlignment="Center" />
  1133. <ComboBox SelectedItem="{Binding SelectPlc.CommunicationType,Mode=TwoWay}"
  1134. Grid.Row="2"
  1135. Grid.Column="1"
  1136. Margin="10,0"
  1137. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1138. MinWidth="80"
  1139. ItemsSource="{ext:EnumBindingSource EnumType=enums:CommunicationType}"
  1140. FontSize="{DynamicResource Font.Size.Body3}"
  1141. HorizontalContentAlignment="Center"
  1142. HorizontalAlignment="Left"
  1143. VerticalAlignment="Center" />
  1144. <!--Endpoint Url地址-->
  1145. <TextBlock Text="Endpoints Url: "
  1146. Grid.Row="3"
  1147. Grid.Column="0"
  1148. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1149. FontSize="{DynamicResource Font.Size.Body3}"
  1150. HorizontalAlignment="Right"
  1151. VerticalAlignment="Center" />
  1152. <TextBox Grid.Row="3"
  1153. Grid.Column="1"
  1154. Margin="10,0"
  1155. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1156. FontSize="{DynamicResource Font.Size.Body3}"
  1157. MinWidth="80"
  1158. TextAlignment="Center"
  1159. HorizontalAlignment="Left"
  1160. VerticalAlignment="Center"
  1161. Text="{Binding SelectPlc.EndpointUrl}" />
  1162. </Grid>
  1163. </ScrollViewer>
  1164. </Grid>
  1165. </TabItem>
  1166. <!--通讯-->
  1167. <TabItem>
  1168. <TabItem.Header>
  1169. <StackPanel Width="auto"
  1170. Height="auto">
  1171. <materialDesign:PackIcon Width="24"
  1172. Height="24"
  1173. HorizontalAlignment="Center"
  1174. Kind="Lan" />
  1175. <TextBlock HorizontalAlignment="Center"
  1176. TextWrapping="Wrap"
  1177. FontSize="{DynamicResource Font.Size.Body2}"
  1178. Text="{lex:Loc 通讯}" />
  1179. </StackPanel>
  1180. </TabItem.Header>
  1181. <Grid Margin="20"
  1182. IsEnabled="{Binding IsAllowEdit}">
  1183. <Grid.ColumnDefinitions>
  1184. <ColumnDefinition Width="auto" />
  1185. <ColumnDefinition Width="auto" />
  1186. </Grid.ColumnDefinitions>
  1187. <Grid.RowDefinitions>
  1188. <RowDefinition Height="auto" />
  1189. <RowDefinition Height=" auto" />
  1190. </Grid.RowDefinitions>
  1191. <Button Style="{StaticResource MaterialDesignRaisedButton}"
  1192. materialDesign:ButtonAssist.CornerRadius="10"
  1193. Width="60"
  1194. ToolTip="{lex:Loc 保存}"
  1195. HorizontalAlignment="Left"
  1196. Command="{Binding SaveCommunicateCommand}"
  1197. CommandParameter="TCPIP">
  1198. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1199. </Button>
  1200. <GroupBox Grid.Row="1"
  1201. Header="{lex:Loc 后台TCPIP服务器}"
  1202. FontSize="{DynamicResource Font.Size.Title4}"
  1203. Margin="5,5">
  1204. <Grid Margin="20">
  1205. <Grid.ColumnDefinitions>
  1206. <ColumnDefinition Width="auto" />
  1207. <ColumnDefinition Width="auto" />
  1208. </Grid.ColumnDefinitions>
  1209. <Grid.RowDefinitions>
  1210. <RowDefinition Height="auto" />
  1211. <RowDefinition Height=" auto" />
  1212. <RowDefinition Height=" auto" />
  1213. </Grid.RowDefinitions>
  1214. <!--port-->
  1215. <TextBlock Margin="0,0,0,8"
  1216. Text="Port: "
  1217. VerticalAlignment="Center"
  1218. FontSize="{DynamicResource Font.Size.Body3}"
  1219. HorizontalAlignment="Right" />
  1220. <TextBox Grid.Row="0"
  1221. Grid.Column="1"
  1222. Margin="10,4"
  1223. MinWidth="80"
  1224. FontSize="{DynamicResource Font.Size.Body3}"
  1225. TextAlignment="Center"
  1226. HorizontalAlignment="Left"
  1227. VerticalAlignment="Center">
  1228. <TextBox.Text>
  1229. <Binding Path="BgTcp.Port"
  1230. Mode="TwoWay">
  1231. <Binding.ValidationRules>
  1232. <valRules:PortValidationRule />
  1233. </Binding.ValidationRules>
  1234. </Binding>
  1235. </TextBox.Text>
  1236. </TextBox>
  1237. <!--结束符-->
  1238. <TextBlock Margin="0,0,0,8"
  1239. Grid.Row="1"
  1240. VerticalAlignment="Center"
  1241. Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1242. FontSize="{DynamicResource Font.Size.Body3}"
  1243. HorizontalAlignment="Right" />
  1244. <ComboBox SelectedItem="{Binding BgTcp.Terminator,Mode=TwoWay}"
  1245. Grid.Row="1"
  1246. Grid.Column="1"
  1247. Margin="10,4"
  1248. MinWidth="80"
  1249. HorizontalContentAlignment="Center"
  1250. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  1251. FontSize="{DynamicResource Font.Size.Body3}"
  1252. HorizontalAlignment="Left"
  1253. VerticalAlignment="Center" />
  1254. <!--编码格式-->
  1255. <TextBlock Text="{lex:Loc 编码解码, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1256. Grid.Row="2"
  1257. VerticalAlignment="Center"
  1258. Grid.Column="0"
  1259. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1260. FontSize="{DynamicResource Font.Size.Body3}"
  1261. HorizontalAlignment="Right" />
  1262. <ComboBox SelectedItem="{Binding BgTcp.DataEncoding,Mode=TwoWay}"
  1263. Grid.Row="2"
  1264. Grid.Column="1"
  1265. Margin="10,4"
  1266. MinWidth="80"
  1267. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  1268. FontSize="{DynamicResource Font.Size.Body3}"
  1269. HorizontalContentAlignment="Center"
  1270. HorizontalAlignment="Left"
  1271. VerticalAlignment="Center" />
  1272. </Grid>
  1273. </GroupBox>
  1274. <Button Grid.Column="1"
  1275. Style="{StaticResource MaterialDesignRaisedButton}"
  1276. materialDesign:ButtonAssist.CornerRadius="10"
  1277. Width="60"
  1278. ToolTip="{lex:Loc 保存}"
  1279. HorizontalAlignment="Left"
  1280. Command="{Binding SaveCommunicateCommand}"
  1281. CommandParameter="ModbusTCP">
  1282. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1283. </Button>
  1284. <materialDesign:PopupBox Grid.Column="1"
  1285. HorizontalAlignment="Right"
  1286. VerticalAlignment="Center">
  1287. <StackPanel Orientation="Vertical"
  1288. Margin="10">
  1289. <TextBlock TextWrapping="Wrap"
  1290. TextAlignment="Left"
  1291. Text="功能码 1 ReadCoils 读取DO的状态" />
  1292. <TextBlock TextWrapping="Wrap"
  1293. TextAlignment="Left"
  1294. Text="功能码 2 ReadInputs 读取DI的状态" />
  1295. <TextBlock TextWrapping="Wrap"
  1296. TextAlignment="Left"
  1297. Text="功能码 3 ReadHoldingRegisters 读取AO的值" />
  1298. <TextBlock TextWrapping="Wrap"
  1299. TextAlignment="Left"
  1300. Text="功能码 4 ReadInputRegisters 读取AI的值" />
  1301. <TextBlock TextWrapping="Wrap"
  1302. TextAlignment="Left"
  1303. Text="功能码 5 WriteSingleCoil 写入值到DO" />
  1304. <TextBlock TextWrapping="Wrap"
  1305. TextAlignment="Left"
  1306. Text="功能码 6 WriteSingleRegister 写入值到AO" />
  1307. <TextBlock TextWrapping="Wrap"
  1308. TextAlignment="Left"
  1309. Text="功能码 15 WriteMultipleCoils 写多线圈寄存器" />
  1310. <TextBlock TextWrapping="Wrap"
  1311. TextAlignment="Left"
  1312. Text="功能码 16 WriteMultipleRegisters 写多个保持寄存器" />
  1313. <TextBlock TextWrapping="Wrap"
  1314. TextAlignment="Left"
  1315. Text="功能码 23 ReadWriteMultipleRegisters 读写多个保持寄存器" />
  1316. </StackPanel>
  1317. </materialDesign:PopupBox>
  1318. <GroupBox Grid.Row="1"
  1319. Margin=" 5,5"
  1320. Grid.Column="1"
  1321. Header="{lex:Loc 后台ModbusTCPSlave}"
  1322. FontSize="{DynamicResource Font.Size.Title4}">
  1323. <Grid Margin="20">
  1324. <Grid.ColumnDefinitions>
  1325. <ColumnDefinition Width="auto" />
  1326. <ColumnDefinition Width="auto" />
  1327. </Grid.ColumnDefinitions>
  1328. <Grid.RowDefinitions>
  1329. <RowDefinition Height="auto" />
  1330. <RowDefinition Height=" auto" />
  1331. <RowDefinition Height=" auto" />
  1332. <RowDefinition Height=" auto" />
  1333. </Grid.RowDefinitions>
  1334. <!--IP-->
  1335. <TextBlock Margin="0,0,0,8"
  1336. Text="IP: "
  1337. FontSize="{DynamicResource Font.Size.Body3}"
  1338. VerticalAlignment="Center"
  1339. HorizontalAlignment="Right" />
  1340. <TextBox Grid.Row="0"
  1341. Grid.Column="1"
  1342. Margin="10,4"
  1343. MinWidth="80"
  1344. TextAlignment="Center"
  1345. HorizontalAlignment="Left"
  1346. VerticalAlignment="Center"
  1347. FontSize="{DynamicResource Font.Size.Body3}"
  1348. Text="{Binding BgModbus.IP,Mode=TwoWay}" />
  1349. <!--port-->
  1350. <TextBlock Grid.Row="1"
  1351. Margin="0,0,0,8"
  1352. Text="Port: "
  1353. FontSize="{DynamicResource Font.Size.Body3}"
  1354. VerticalAlignment="Center"
  1355. HorizontalAlignment="Right" />
  1356. <TextBox Grid.Row="1"
  1357. Grid.Column="1"
  1358. Margin="10,4"
  1359. MinWidth="80"
  1360. TextAlignment="Center"
  1361. HorizontalAlignment="Left"
  1362. VerticalAlignment="Center"
  1363. FontSize="{DynamicResource Font.Size.Body3}"
  1364. Text="{Binding BgModbus.Port,Mode=TwoWay}" />
  1365. <!--SlaveID-->
  1366. <TextBlock Grid.Row="2"
  1367. Margin="0,0,0,8"
  1368. VerticalAlignment="Center"
  1369. Text="SlaveID: "
  1370. FontSize="{DynamicResource Font.Size.Body3}"
  1371. HorizontalAlignment="Right" />
  1372. <TextBox Grid.Row="2"
  1373. Grid.Column="1"
  1374. Margin="10,4"
  1375. MinWidth="80"
  1376. TextAlignment="Center"
  1377. HorizontalAlignment="Left"
  1378. VerticalAlignment="Center"
  1379. FontSize="{DynamicResource Font.Size.Body3}"
  1380. Text="{Binding BgModbus.SlaveID,Mode=TwoWay}" />
  1381. <!--是否启用-->
  1382. <TextBlock Margin="0,0,0,8"
  1383. Grid.Row="3"
  1384. Text="{lex:Loc 是否启用, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1385. FontSize="{DynamicResource Font.Size.Body3}"
  1386. VerticalAlignment="Center"
  1387. HorizontalAlignment="Right" />
  1388. <ToggleButton Grid.Row="3"
  1389. Grid.Column="1"
  1390. Margin="10,4"
  1391. MinWidth="80"
  1392. IsChecked="{Binding BgModbus.IsEnabled,Mode=TwoWay}"
  1393. HorizontalContentAlignment="Center"
  1394. HorizontalAlignment="Left"
  1395. VerticalAlignment="Center" />
  1396. </Grid>
  1397. </GroupBox>
  1398. </Grid>
  1399. </TabItem>
  1400. <!--生产排班-->
  1401. <TabItem>
  1402. <TabItem.Header>
  1403. <StackPanel Width="auto"
  1404. Height="auto">
  1405. <materialDesign:PackIcon Width="24"
  1406. Height="24"
  1407. HorizontalAlignment="Center"
  1408. Kind="LanConnect" />
  1409. <TextBlock HorizontalAlignment="Center"
  1410. TextWrapping="Wrap"
  1411. FontSize="{DynamicResource Font.Size.Body2}"
  1412. Text="{lex:Loc 生产排班}" />
  1413. </StackPanel>
  1414. </TabItem.Header>
  1415. <StackPanel Margin="16">
  1416. <TextBlock Margin="0,0,0,8"
  1417. Style="{StaticResource MaterialDesignHeadline5TextBlock}"
  1418. FontSize="{DynamicResource Font.Size.Body3}"
  1419. Text="{lex:Loc 白夜班}" />
  1420. </StackPanel>
  1421. </TabItem>
  1422. <!--字体-->
  1423. <TabItem>
  1424. <TabItem.Header>
  1425. <StackPanel>
  1426. <materialDesign:PackIcon Width="24"
  1427. Height="24"
  1428. HorizontalAlignment="Center"
  1429. Kind="FontSize" />
  1430. <TextBlock HorizontalAlignment="Center"
  1431. TextWrapping="Wrap"
  1432. FontSize="{DynamicResource Font.Size.Body2}"
  1433. Text="{lex:Loc 字体}" />
  1434. </StackPanel>
  1435. </TabItem.Header>
  1436. <ScrollViewer>
  1437. <Grid Margin="20">
  1438. <Grid.RowDefinitions>
  1439. <RowDefinition Height="auto" />
  1440. <RowDefinition Height="auto" />
  1441. <RowDefinition Height="auto" />
  1442. <RowDefinition Height="auto" />
  1443. <RowDefinition Height="auto" />
  1444. <RowDefinition Height="auto" />
  1445. <RowDefinition Height="auto" />
  1446. <RowDefinition Height="auto" />
  1447. <RowDefinition Height="auto" />
  1448. <RowDefinition Height="auto" />
  1449. <RowDefinition Height="auto" />
  1450. <RowDefinition Height="auto" />
  1451. </Grid.RowDefinitions>
  1452. <Grid.ColumnDefinitions>
  1453. <ColumnDefinition Width="auto" />
  1454. <ColumnDefinition Width="auto" />
  1455. </Grid.ColumnDefinitions>
  1456. <Grid.Resources>
  1457. <Style TargetType="TextBlock">
  1458. <Setter Property="FontSize"
  1459. Value="{DynamicResource Font.Size.Body2}" />
  1460. <Setter Property="VerticalAlignment"
  1461. Value="Center" />
  1462. <Setter Property="HorizontalAlignment"
  1463. Value="Right" />
  1464. </Style>
  1465. <Style TargetType="mah:NumericUpDown">
  1466. <Setter Property="FontSize"
  1467. Value="{DynamicResource Font.Size.Body2}" />
  1468. <Setter Property="Margin"
  1469. Value="5,2" />
  1470. <Setter Property="MinWidth"
  1471. Value="100" />
  1472. <Setter Property="HorizontalContentAlignment"
  1473. Value="Center" />
  1474. <Setter Property="VerticalContentAlignment"
  1475. Value="Center" />
  1476. <Setter Property="Minimum"
  1477. Value="6" />
  1478. <Setter Property="Interval"
  1479. Value="2" />
  1480. <Setter Property="Maximum"
  1481. Value="62" />
  1482. <Setter Property="StringFormat"
  1483. Value="{}{0:N0}" />
  1484. </Style>
  1485. </Grid.Resources>
  1486. <!--1-->
  1487. <TextBlock Grid.Row="0"
  1488. Grid.Column="0"
  1489. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  1490. <mah:NumericUpDown Grid.Row="0"
  1491. Grid.Column="1"
  1492. materialDesign:HintAssist.Hint="Font Size"
  1493. Value="{Binding Title1,Mode=TwoWay}" />
  1494. <!--2-->
  1495. <TextBlock Grid.Row="1"
  1496. Grid.Column="0"
  1497. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  1498. <mah:NumericUpDown Grid.Row="1"
  1499. Grid.Column="1"
  1500. materialDesign:HintAssist.Hint="Font Size"
  1501. Value="{Binding Title2,Mode=TwoWay}" />
  1502. <!--3-->
  1503. <TextBlock Grid.Row="2"
  1504. Grid.Column="0"
  1505. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  1506. <mah:NumericUpDown Grid.Row="2"
  1507. Grid.Column="1"
  1508. materialDesign:HintAssist.Hint="Font Size"
  1509. Value="{Binding Title3,Mode=TwoWay}" />
  1510. <!--4-->
  1511. <TextBlock Grid.Row="3"
  1512. Grid.Column="0"
  1513. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  1514. <mah:NumericUpDown Grid.Row="3"
  1515. Grid.Column="1"
  1516. materialDesign:HintAssist.Hint="Font Size"
  1517. Value="{Binding Title4,Mode=TwoWay}" />
  1518. <!--5-->
  1519. <TextBlock Grid.Row="4"
  1520. Grid.Column="0"
  1521. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  1522. <mah:NumericUpDown Grid.Row="4"
  1523. Grid.Column="1"
  1524. materialDesign:HintAssist.Hint="Font Size"
  1525. Value="{Binding Body1,Mode=TwoWay}" />
  1526. <!--6-->
  1527. <TextBlock Grid.Row="5"
  1528. Grid.Column="0"
  1529. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  1530. <mah:NumericUpDown Grid.Row="5"
  1531. Grid.Column="1"
  1532. materialDesign:HintAssist.Hint="Font Size"
  1533. Value="{Binding Body2,Mode=TwoWay}" />
  1534. <!--7-->
  1535. <TextBlock Grid.Row="6"
  1536. Grid.Column="0"
  1537. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  1538. <mah:NumericUpDown Grid.Row="6"
  1539. Grid.Column="1"
  1540. materialDesign:HintAssist.Hint="Font Size"
  1541. Value="{Binding Body3,Mode=TwoWay}" />
  1542. <!--8-->
  1543. <TextBlock Grid.Row="7"
  1544. Grid.Column="0"
  1545. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  1546. <mah:NumericUpDown Grid.Row="7"
  1547. Grid.Column="1"
  1548. materialDesign:HintAssist.Hint="Font Size"
  1549. Value="{Binding Body4,Mode=TwoWay}" />
  1550. <!--9-->
  1551. <TextBlock Grid.Row="8"
  1552. Grid.Column="0"
  1553. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  1554. <mah:NumericUpDown Grid.Row="8"
  1555. Grid.Column="1"
  1556. materialDesign:HintAssist.Hint="Font Size"
  1557. Value="{Binding Captions1,Mode=TwoWay}" />
  1558. <!--10-->
  1559. <TextBlock Grid.Row="9"
  1560. Grid.Column="0"
  1561. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  1562. <mah:NumericUpDown Grid.Row="9"
  1563. Grid.Column="1"
  1564. materialDesign:HintAssist.Hint="Font Size"
  1565. Value="{Binding Captions2,Mode=TwoWay}" />
  1566. <!--11-->
  1567. <TextBlock Grid.Row="10"
  1568. Grid.Column="0"
  1569. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  1570. <mah:NumericUpDown Grid.Row="10"
  1571. Grid.Column="1"
  1572. materialDesign:HintAssist.Hint="Font Size"
  1573. Value="{Binding Captions3,Mode=TwoWay}" />
  1574. <!--12-->
  1575. <TextBlock Grid.Row="11"
  1576. Grid.Column="0"
  1577. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  1578. <mah:NumericUpDown Grid.Row="11"
  1579. Grid.Column="1"
  1580. materialDesign:HintAssist.Hint="Font Size"
  1581. Value="{Binding Captions4,Mode=TwoWay}" />
  1582. </Grid>
  1583. </ScrollViewer>
  1584. </TabItem>
  1585. <!--语言-->
  1586. <TabItem>
  1587. <TabItem.Header>
  1588. <StackPanel Width="auto"
  1589. Height="auto">
  1590. <materialDesign:PackIcon Width="24"
  1591. Height="24"
  1592. HorizontalAlignment="Center"
  1593. Kind="TranslateVariant" />
  1594. <TextBlock HorizontalAlignment="Center"
  1595. TextWrapping="Wrap"
  1596. FontSize="{DynamicResource Font.Size.Body2}"
  1597. Text="{lex:Loc SettingView_Language_Text}" />
  1598. </StackPanel>
  1599. </TabItem.Header>
  1600. <StackPanel Margin="20"
  1601. Orientation="Horizontal"
  1602. VerticalAlignment="Top">
  1603. <!--中文简体-->
  1604. <Button MinWidth="100"
  1605. materialDesign:ButtonAssist.CornerRadius="10"
  1606. ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}"
  1607. FontSize="{DynamicResource Font.Size.Body1}"
  1608. Command="{Binding SelectLanguageCommand}"
  1609. CommandParameter="ChineseSimplified">
  1610. <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
  1611. <Button.Style>
  1612. <Style TargetType="Button"
  1613. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1614. <Setter Property="Foreground"
  1615. Value="#000000" />
  1616. <Style.Triggers>
  1617. <DataTrigger Binding="{Binding CurrentLanguage}"
  1618. Value="{x:Static enums:Language.ChineseSimplified}">
  1619. <Setter Property="Background"
  1620. Value="Green" />
  1621. <Setter Property="BorderBrush"
  1622. Value="Green" />
  1623. </DataTrigger>
  1624. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  1625. Value="{x:Static enums:Language.English}">
  1626. <Setter Property="Background"
  1627. Value="#e4ff54" />
  1628. <Setter Property="BorderBrush"
  1629. Value="#e4ff54" />
  1630. </DataTrigger>-->
  1631. </Style.Triggers>
  1632. </Style>
  1633. </Button.Style>
  1634. </Button>
  1635. <!--中文繁体-->
  1636. <Button MinWidth="100"
  1637. Margin="20.0"
  1638. materialDesign:ButtonAssist.CornerRadius="10"
  1639. ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}"
  1640. FontSize="{DynamicResource Font.Size.Body1}"
  1641. Command="{Binding SelectLanguageCommand}"
  1642. CommandParameter="ChineseTraditional">
  1643. <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
  1644. <Button.Style>
  1645. <Style TargetType="Button"
  1646. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1647. <Setter Property="Foreground"
  1648. Value="#000000" />
  1649. <Style.Triggers>
  1650. <DataTrigger Binding="{Binding CurrentLanguage}"
  1651. Value="{x:Static enums:Language.ChineseTraditional}">
  1652. <Setter Property="Background"
  1653. Value="Green" />
  1654. <Setter Property="BorderBrush"
  1655. Value="Green" />
  1656. </DataTrigger>
  1657. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  1658. Value="{x:Static enums:Language.Chinese}">
  1659. <Setter Property="Background"
  1660. Value="#e4ff54" />
  1661. <Setter Property="BorderBrush"
  1662. Value="#e4ff54" />
  1663. </DataTrigger>-->
  1664. </Style.Triggers>
  1665. </Style>
  1666. </Button.Style>
  1667. </Button>
  1668. <!--英语-->
  1669. <Button MinWidth="100"
  1670. Margin="20.0"
  1671. materialDesign:ButtonAssist.CornerRadius="10"
  1672. ToolTip="{lex:Loc SettingView_Language_English}"
  1673. FontSize="{DynamicResource Font.Size.Body1}"
  1674. Command="{Binding SelectLanguageCommand}"
  1675. CommandParameter="English">
  1676. <TextBlock Text="{lex:Loc SettingView_Language_English}" />
  1677. <Button.Style>
  1678. <Style TargetType="Button"
  1679. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1680. <Setter Property="Foreground"
  1681. Value="#000000" />
  1682. <Style.Triggers>
  1683. <DataTrigger Binding="{Binding CurrentLanguage}"
  1684. Value="{x:Static enums:Language.English}">
  1685. <Setter Property="Background"
  1686. Value="Green" />
  1687. <Setter Property="BorderBrush"
  1688. Value="Green" />
  1689. </DataTrigger>
  1690. </Style.Triggers>
  1691. </Style>
  1692. </Button.Style>
  1693. </Button>
  1694. <!--日语-->
  1695. <Button MinWidth="100"
  1696. Margin="20.0"
  1697. materialDesign:ButtonAssist.CornerRadius="10"
  1698. ToolTip="{lex:Loc SettingView_Language_Japanese}"
  1699. FontSize="{DynamicResource Font.Size.Body1}"
  1700. Command="{Binding SelectLanguageCommand}"
  1701. CommandParameter="Japanese">
  1702. <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
  1703. <Button.Style>
  1704. <Style TargetType="Button"
  1705. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1706. <Setter Property="Foreground"
  1707. Value="#000000" />
  1708. <Style.Triggers>
  1709. <DataTrigger Binding="{Binding CurrentLanguage}"
  1710. Value="{x:Static enums:Language.Japanese}">
  1711. <Setter Property="Background"
  1712. Value="Green" />
  1713. <Setter Property="BorderBrush"
  1714. Value="Green" />
  1715. </DataTrigger>
  1716. </Style.Triggers>
  1717. </Style>
  1718. </Button.Style>
  1719. </Button>
  1720. </StackPanel>
  1721. </TabItem>
  1722. </TabControl>
  1723. </Grid>
  1724. </UserControl>