SettingView.xaml 115 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780
  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. <RowDefinition />
  1079. </Grid.RowDefinitions>
  1080. <Grid.ColumnDefinitions>
  1081. <ColumnDefinition Width="auto" />
  1082. <ColumnDefinition Width="*" />
  1083. </Grid.ColumnDefinitions>
  1084. <!--id-->
  1085. <TextBlock Text="Id: "
  1086. Grid.Row="0"
  1087. Grid.Column="0"
  1088. FontSize="{DynamicResource Font.Size.Body3}"
  1089. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1090. HorizontalAlignment="Right"
  1091. VerticalAlignment="Center" />
  1092. <TextBlock x:Name="txt_plc_Id"
  1093. Text="{Binding SelectPlc.Id,Mode=TwoWay}"
  1094. Grid.Row="0"
  1095. Grid.Column="1"
  1096. FontSize="{DynamicResource Font.Size.Body3}"
  1097. Margin="10,0"
  1098. HorizontalAlignment="Left"
  1099. VerticalAlignment="Center" />
  1100. <!--名称-->
  1101. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1102. Grid.Row="1"
  1103. Grid.Column="0"
  1104. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1105. FontSize="{DynamicResource Font.Size.Body3}"
  1106. HorizontalAlignment="Right"
  1107. VerticalAlignment="Center" />
  1108. <TextBox Grid.Row="1"
  1109. Grid.Column="1"
  1110. Margin="10,0"
  1111. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1112. FontSize="{DynamicResource Font.Size.Body3}"
  1113. MinWidth="80"
  1114. TextAlignment="Center"
  1115. HorizontalAlignment="Left"
  1116. VerticalAlignment="Center">
  1117. <TextBox.Text>
  1118. <Binding Path="SelectPlc.Name"
  1119. Mode="TwoWay">
  1120. <Binding.ValidationRules>
  1121. <valRules:NameValidationRule />
  1122. </Binding.ValidationRules>
  1123. </Binding>
  1124. </TextBox.Text>
  1125. </TextBox>
  1126. <!--通讯方式-->
  1127. <TextBlock Text="{lex:Loc 通讯方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1128. Grid.Row="2"
  1129. Grid.Column="0"
  1130. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1131. FontSize="{DynamicResource Font.Size.Body3}"
  1132. HorizontalAlignment="Right"
  1133. VerticalAlignment="Center" />
  1134. <ComboBox SelectedItem="{Binding SelectPlc.CommunicationType,Mode=TwoWay}"
  1135. Grid.Row="2"
  1136. Grid.Column="1"
  1137. Margin="10,0"
  1138. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1139. MinWidth="80"
  1140. ItemsSource="{ext:EnumBindingSource EnumType=enums:CommunicationType}"
  1141. FontSize="{DynamicResource Font.Size.Body3}"
  1142. HorizontalContentAlignment="Center"
  1143. HorizontalAlignment="Left"
  1144. VerticalAlignment="Center" />
  1145. <!--Endpoint Url地址-->
  1146. <TextBlock Text="Endpoints Url: "
  1147. Grid.Row="3"
  1148. Grid.Column="0"
  1149. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1150. FontSize="{DynamicResource Font.Size.Body3}"
  1151. HorizontalAlignment="Right"
  1152. VerticalAlignment="Center" />
  1153. <TextBox Grid.Row="3"
  1154. Grid.Column="1"
  1155. Margin="10,0"
  1156. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1157. FontSize="{DynamicResource Font.Size.Body3}"
  1158. MinWidth="80"
  1159. TextAlignment="Center"
  1160. HorizontalAlignment="Left"
  1161. VerticalAlignment="Center"
  1162. Text="{Binding SelectPlc.EndpointUrl}" />
  1163. <!--节点头-->
  1164. <TextBlock Text="{lex:Loc 节点头, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1165. Grid.Row="4"
  1166. Grid.Column="0"
  1167. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1168. FontSize="{DynamicResource Font.Size.Body3}"
  1169. HorizontalAlignment="Right"
  1170. VerticalAlignment="Center" />
  1171. <TextBox Grid.Row="4"
  1172. Grid.Column="1"
  1173. FontSize="{DynamicResource Font.Size.Body3}"
  1174. Margin="10,0"
  1175. MinWidth="80"
  1176. TextAlignment="Center"
  1177. HorizontalAlignment="Left"
  1178. VerticalAlignment="Center"
  1179. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1180. Text="{Binding SelectPlc.NodeHeader,Mode=TwoWay}" />
  1181. </Grid>
  1182. </ScrollViewer>
  1183. </Grid>
  1184. </TabItem>
  1185. <!--通讯-->
  1186. <TabItem>
  1187. <TabItem.Header>
  1188. <StackPanel Width="auto"
  1189. Height="auto">
  1190. <materialDesign:PackIcon Width="24"
  1191. Height="24"
  1192. HorizontalAlignment="Center"
  1193. Kind="Lan" />
  1194. <TextBlock HorizontalAlignment="Center"
  1195. TextWrapping="Wrap"
  1196. FontSize="{DynamicResource Font.Size.Body2}"
  1197. Text="{lex:Loc 通讯}" />
  1198. </StackPanel>
  1199. </TabItem.Header>
  1200. <Grid Margin="20"
  1201. IsEnabled="{Binding IsAllowEdit}">
  1202. <Grid.ColumnDefinitions>
  1203. <ColumnDefinition Width="auto" />
  1204. <ColumnDefinition Width="auto" />
  1205. </Grid.ColumnDefinitions>
  1206. <Grid.RowDefinitions>
  1207. <RowDefinition Height="auto" />
  1208. <RowDefinition Height=" auto" />
  1209. </Grid.RowDefinitions>
  1210. <Button Style="{StaticResource MaterialDesignRaisedButton}"
  1211. materialDesign:ButtonAssist.CornerRadius="10"
  1212. Width="60"
  1213. ToolTip="{lex:Loc 保存}"
  1214. HorizontalAlignment="Left"
  1215. Command="{Binding SaveCommunicateCommand}"
  1216. CommandParameter="TCPIP">
  1217. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1218. </Button>
  1219. <GroupBox Grid.Row="1"
  1220. Header="{lex:Loc 后台TCPIP服务器}"
  1221. FontSize="{DynamicResource Font.Size.Title4}"
  1222. Margin="5,5">
  1223. <Grid Margin="20">
  1224. <Grid.ColumnDefinitions>
  1225. <ColumnDefinition Width="auto" />
  1226. <ColumnDefinition Width="auto" />
  1227. </Grid.ColumnDefinitions>
  1228. <Grid.RowDefinitions>
  1229. <RowDefinition Height="auto" />
  1230. <RowDefinition Height=" auto" />
  1231. <RowDefinition Height=" auto" />
  1232. </Grid.RowDefinitions>
  1233. <!--port-->
  1234. <TextBlock Margin="0,0,0,8"
  1235. Text="Port: "
  1236. VerticalAlignment="Center"
  1237. FontSize="{DynamicResource Font.Size.Body3}"
  1238. HorizontalAlignment="Right" />
  1239. <TextBox Grid.Row="0"
  1240. Grid.Column="1"
  1241. Margin="10,4"
  1242. MinWidth="80"
  1243. FontSize="{DynamicResource Font.Size.Body3}"
  1244. TextAlignment="Center"
  1245. HorizontalAlignment="Left"
  1246. VerticalAlignment="Center">
  1247. <TextBox.Text>
  1248. <Binding Path="BgTcp.Port"
  1249. Mode="TwoWay">
  1250. <Binding.ValidationRules>
  1251. <valRules:PortValidationRule />
  1252. </Binding.ValidationRules>
  1253. </Binding>
  1254. </TextBox.Text>
  1255. </TextBox>
  1256. <!--结束符-->
  1257. <TextBlock Margin="0,0,0,8"
  1258. Grid.Row="1"
  1259. VerticalAlignment="Center"
  1260. Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1261. FontSize="{DynamicResource Font.Size.Body3}"
  1262. HorizontalAlignment="Right" />
  1263. <ComboBox SelectedItem="{Binding BgTcp.Terminator,Mode=TwoWay}"
  1264. Grid.Row="1"
  1265. Grid.Column="1"
  1266. Margin="10,4"
  1267. MinWidth="80"
  1268. HorizontalContentAlignment="Center"
  1269. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  1270. FontSize="{DynamicResource Font.Size.Body3}"
  1271. HorizontalAlignment="Left"
  1272. VerticalAlignment="Center" />
  1273. <!--编码格式-->
  1274. <TextBlock Text="{lex:Loc 编码解码, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1275. Grid.Row="2"
  1276. VerticalAlignment="Center"
  1277. Grid.Column="0"
  1278. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1279. FontSize="{DynamicResource Font.Size.Body3}"
  1280. HorizontalAlignment="Right" />
  1281. <ComboBox SelectedItem="{Binding BgTcp.DataEncoding,Mode=TwoWay}"
  1282. Grid.Row="2"
  1283. Grid.Column="1"
  1284. Margin="10,4"
  1285. MinWidth="80"
  1286. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  1287. FontSize="{DynamicResource Font.Size.Body3}"
  1288. HorizontalContentAlignment="Center"
  1289. HorizontalAlignment="Left"
  1290. VerticalAlignment="Center" />
  1291. </Grid>
  1292. </GroupBox>
  1293. <Button Grid.Column="1"
  1294. Style="{StaticResource MaterialDesignRaisedButton}"
  1295. materialDesign:ButtonAssist.CornerRadius="10"
  1296. Width="60"
  1297. ToolTip="{lex:Loc 保存}"
  1298. HorizontalAlignment="Left"
  1299. Command="{Binding SaveCommunicateCommand}"
  1300. CommandParameter="ModbusTCP">
  1301. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1302. </Button>
  1303. <materialDesign:PopupBox Grid.Column="1"
  1304. HorizontalAlignment="Right"
  1305. VerticalAlignment="Center">
  1306. <StackPanel Orientation="Vertical"
  1307. Margin="10">
  1308. <TextBlock TextWrapping="Wrap"
  1309. TextAlignment="Left"
  1310. Text="功能码 1 ReadCoils 读取DO的状态" />
  1311. <TextBlock TextWrapping="Wrap"
  1312. TextAlignment="Left"
  1313. Text="功能码 2 ReadInputs 读取DI的状态" />
  1314. <TextBlock TextWrapping="Wrap"
  1315. TextAlignment="Left"
  1316. Text="功能码 3 ReadHoldingRegisters 读取AO的值" />
  1317. <TextBlock TextWrapping="Wrap"
  1318. TextAlignment="Left"
  1319. Text="功能码 4 ReadInputRegisters 读取AI的值" />
  1320. <TextBlock TextWrapping="Wrap"
  1321. TextAlignment="Left"
  1322. Text="功能码 5 WriteSingleCoil 写入值到DO" />
  1323. <TextBlock TextWrapping="Wrap"
  1324. TextAlignment="Left"
  1325. Text="功能码 6 WriteSingleRegister 写入值到AO" />
  1326. <TextBlock TextWrapping="Wrap"
  1327. TextAlignment="Left"
  1328. Text="功能码 15 WriteMultipleCoils 写多线圈寄存器" />
  1329. <TextBlock TextWrapping="Wrap"
  1330. TextAlignment="Left"
  1331. Text="功能码 16 WriteMultipleRegisters 写多个保持寄存器" />
  1332. <TextBlock TextWrapping="Wrap"
  1333. TextAlignment="Left"
  1334. Text="功能码 23 ReadWriteMultipleRegisters 读写多个保持寄存器" />
  1335. </StackPanel>
  1336. </materialDesign:PopupBox>
  1337. <GroupBox Grid.Row="1"
  1338. Margin=" 5,5"
  1339. Grid.Column="1"
  1340. Header="{lex:Loc 后台ModbusTCPSlave}"
  1341. FontSize="{DynamicResource Font.Size.Title4}">
  1342. <Grid Margin="20">
  1343. <Grid.ColumnDefinitions>
  1344. <ColumnDefinition Width="auto" />
  1345. <ColumnDefinition Width="auto" />
  1346. </Grid.ColumnDefinitions>
  1347. <Grid.RowDefinitions>
  1348. <RowDefinition Height="auto" />
  1349. <RowDefinition Height=" auto" />
  1350. <RowDefinition Height=" auto" />
  1351. <RowDefinition Height=" auto" />
  1352. </Grid.RowDefinitions>
  1353. <!--IP-->
  1354. <TextBlock Margin="0,0,0,8"
  1355. Text="IP: "
  1356. FontSize="{DynamicResource Font.Size.Body3}"
  1357. VerticalAlignment="Center"
  1358. HorizontalAlignment="Right" />
  1359. <TextBox Grid.Row="0"
  1360. Grid.Column="1"
  1361. Margin="10,4"
  1362. MinWidth="80"
  1363. TextAlignment="Center"
  1364. HorizontalAlignment="Left"
  1365. VerticalAlignment="Center"
  1366. FontSize="{DynamicResource Font.Size.Body3}"
  1367. Text="{Binding BgModbus.IP,Mode=TwoWay}" />
  1368. <!--port-->
  1369. <TextBlock Grid.Row="1"
  1370. Margin="0,0,0,8"
  1371. Text="Port: "
  1372. FontSize="{DynamicResource Font.Size.Body3}"
  1373. VerticalAlignment="Center"
  1374. HorizontalAlignment="Right" />
  1375. <TextBox Grid.Row="1"
  1376. Grid.Column="1"
  1377. Margin="10,4"
  1378. MinWidth="80"
  1379. TextAlignment="Center"
  1380. HorizontalAlignment="Left"
  1381. VerticalAlignment="Center"
  1382. FontSize="{DynamicResource Font.Size.Body3}"
  1383. Text="{Binding BgModbus.Port,Mode=TwoWay}" />
  1384. <!--SlaveID-->
  1385. <TextBlock Grid.Row="2"
  1386. Margin="0,0,0,8"
  1387. VerticalAlignment="Center"
  1388. Text="SlaveID: "
  1389. FontSize="{DynamicResource Font.Size.Body3}"
  1390. HorizontalAlignment="Right" />
  1391. <TextBox Grid.Row="2"
  1392. Grid.Column="1"
  1393. Margin="10,4"
  1394. MinWidth="80"
  1395. TextAlignment="Center"
  1396. HorizontalAlignment="Left"
  1397. VerticalAlignment="Center"
  1398. FontSize="{DynamicResource Font.Size.Body3}"
  1399. Text="{Binding BgModbus.SlaveID,Mode=TwoWay}" />
  1400. <!--是否启用-->
  1401. <TextBlock Margin="0,0,0,8"
  1402. Grid.Row="3"
  1403. Text="{lex:Loc 是否启用, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1404. FontSize="{DynamicResource Font.Size.Body3}"
  1405. VerticalAlignment="Center"
  1406. HorizontalAlignment="Right" />
  1407. <ToggleButton Grid.Row="3"
  1408. Grid.Column="1"
  1409. Margin="10,4"
  1410. MinWidth="80"
  1411. IsChecked="{Binding BgModbus.IsEnabled,Mode=TwoWay}"
  1412. HorizontalContentAlignment="Center"
  1413. HorizontalAlignment="Left"
  1414. VerticalAlignment="Center" />
  1415. </Grid>
  1416. </GroupBox>
  1417. </Grid>
  1418. </TabItem>
  1419. <!--生产排班-->
  1420. <TabItem>
  1421. <TabItem.Header>
  1422. <StackPanel Width="auto"
  1423. Height="auto">
  1424. <materialDesign:PackIcon Width="24"
  1425. Height="24"
  1426. HorizontalAlignment="Center"
  1427. Kind="LanConnect" />
  1428. <TextBlock HorizontalAlignment="Center"
  1429. TextWrapping="Wrap"
  1430. FontSize="{DynamicResource Font.Size.Body2}"
  1431. Text="{lex:Loc 生产排班}" />
  1432. </StackPanel>
  1433. </TabItem.Header>
  1434. <StackPanel Margin="16">
  1435. <TextBlock Margin="0,0,0,8"
  1436. Style="{StaticResource MaterialDesignHeadline5TextBlock}"
  1437. FontSize="{DynamicResource Font.Size.Body3}"
  1438. Text="{lex:Loc 白夜班}" />
  1439. </StackPanel>
  1440. </TabItem>
  1441. <!--字体-->
  1442. <TabItem>
  1443. <TabItem.Header>
  1444. <StackPanel>
  1445. <materialDesign:PackIcon Width="24"
  1446. Height="24"
  1447. HorizontalAlignment="Center"
  1448. Kind="FontSize" />
  1449. <TextBlock HorizontalAlignment="Center"
  1450. TextWrapping="Wrap"
  1451. FontSize="{DynamicResource Font.Size.Body2}"
  1452. Text="{lex:Loc 字体}" />
  1453. </StackPanel>
  1454. </TabItem.Header>
  1455. <ScrollViewer>
  1456. <Grid Margin="20">
  1457. <Grid.RowDefinitions>
  1458. <RowDefinition Height="auto" />
  1459. <RowDefinition Height="auto" />
  1460. <RowDefinition Height="auto" />
  1461. <RowDefinition Height="auto" />
  1462. <RowDefinition Height="auto" />
  1463. <RowDefinition Height="auto" />
  1464. <RowDefinition Height="auto" />
  1465. <RowDefinition Height="auto" />
  1466. <RowDefinition Height="auto" />
  1467. <RowDefinition Height="auto" />
  1468. <RowDefinition Height="auto" />
  1469. <RowDefinition Height="auto" />
  1470. </Grid.RowDefinitions>
  1471. <Grid.ColumnDefinitions>
  1472. <ColumnDefinition Width="auto" />
  1473. <ColumnDefinition Width="auto" />
  1474. </Grid.ColumnDefinitions>
  1475. <Grid.Resources>
  1476. <Style TargetType="TextBlock">
  1477. <Setter Property="FontSize"
  1478. Value="{DynamicResource Font.Size.Body2}" />
  1479. <Setter Property="VerticalAlignment"
  1480. Value="Center" />
  1481. <Setter Property="HorizontalAlignment"
  1482. Value="Right" />
  1483. </Style>
  1484. <Style TargetType="mah:NumericUpDown">
  1485. <Setter Property="FontSize"
  1486. Value="{DynamicResource Font.Size.Body2}" />
  1487. <Setter Property="Margin"
  1488. Value="5,2" />
  1489. <Setter Property="MinWidth"
  1490. Value="100" />
  1491. <Setter Property="HorizontalContentAlignment"
  1492. Value="Center" />
  1493. <Setter Property="VerticalContentAlignment"
  1494. Value="Center" />
  1495. <Setter Property="Minimum"
  1496. Value="6" />
  1497. <Setter Property="Interval"
  1498. Value="2" />
  1499. <Setter Property="Maximum"
  1500. Value="62" />
  1501. <Setter Property="StringFormat"
  1502. Value="{}{0:N0}" />
  1503. </Style>
  1504. </Grid.Resources>
  1505. <!--1-->
  1506. <TextBlock Grid.Row="0"
  1507. Grid.Column="0"
  1508. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  1509. <mah:NumericUpDown Grid.Row="0"
  1510. Grid.Column="1"
  1511. materialDesign:HintAssist.Hint="Font Size"
  1512. Value="{Binding Title1,Mode=TwoWay}" />
  1513. <!--2-->
  1514. <TextBlock Grid.Row="1"
  1515. Grid.Column="0"
  1516. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  1517. <mah:NumericUpDown Grid.Row="1"
  1518. Grid.Column="1"
  1519. materialDesign:HintAssist.Hint="Font Size"
  1520. Value="{Binding Title2,Mode=TwoWay}" />
  1521. <!--3-->
  1522. <TextBlock Grid.Row="2"
  1523. Grid.Column="0"
  1524. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  1525. <mah:NumericUpDown Grid.Row="2"
  1526. Grid.Column="1"
  1527. materialDesign:HintAssist.Hint="Font Size"
  1528. Value="{Binding Title3,Mode=TwoWay}" />
  1529. <!--4-->
  1530. <TextBlock Grid.Row="3"
  1531. Grid.Column="0"
  1532. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  1533. <mah:NumericUpDown Grid.Row="3"
  1534. Grid.Column="1"
  1535. materialDesign:HintAssist.Hint="Font Size"
  1536. Value="{Binding Title4,Mode=TwoWay}" />
  1537. <!--5-->
  1538. <TextBlock Grid.Row="4"
  1539. Grid.Column="0"
  1540. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  1541. <mah:NumericUpDown Grid.Row="4"
  1542. Grid.Column="1"
  1543. materialDesign:HintAssist.Hint="Font Size"
  1544. Value="{Binding Body1,Mode=TwoWay}" />
  1545. <!--6-->
  1546. <TextBlock Grid.Row="5"
  1547. Grid.Column="0"
  1548. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  1549. <mah:NumericUpDown Grid.Row="5"
  1550. Grid.Column="1"
  1551. materialDesign:HintAssist.Hint="Font Size"
  1552. Value="{Binding Body2,Mode=TwoWay}" />
  1553. <!--7-->
  1554. <TextBlock Grid.Row="6"
  1555. Grid.Column="0"
  1556. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  1557. <mah:NumericUpDown Grid.Row="6"
  1558. Grid.Column="1"
  1559. materialDesign:HintAssist.Hint="Font Size"
  1560. Value="{Binding Body3,Mode=TwoWay}" />
  1561. <!--8-->
  1562. <TextBlock Grid.Row="7"
  1563. Grid.Column="0"
  1564. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  1565. <mah:NumericUpDown Grid.Row="7"
  1566. Grid.Column="1"
  1567. materialDesign:HintAssist.Hint="Font Size"
  1568. Value="{Binding Body4,Mode=TwoWay}" />
  1569. <!--9-->
  1570. <TextBlock Grid.Row="8"
  1571. Grid.Column="0"
  1572. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  1573. <mah:NumericUpDown Grid.Row="8"
  1574. Grid.Column="1"
  1575. materialDesign:HintAssist.Hint="Font Size"
  1576. Value="{Binding Captions1,Mode=TwoWay}" />
  1577. <!--10-->
  1578. <TextBlock Grid.Row="9"
  1579. Grid.Column="0"
  1580. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  1581. <mah:NumericUpDown Grid.Row="9"
  1582. Grid.Column="1"
  1583. materialDesign:HintAssist.Hint="Font Size"
  1584. Value="{Binding Captions2,Mode=TwoWay}" />
  1585. <!--11-->
  1586. <TextBlock Grid.Row="10"
  1587. Grid.Column="0"
  1588. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  1589. <mah:NumericUpDown Grid.Row="10"
  1590. Grid.Column="1"
  1591. materialDesign:HintAssist.Hint="Font Size"
  1592. Value="{Binding Captions3,Mode=TwoWay}" />
  1593. <!--12-->
  1594. <TextBlock Grid.Row="11"
  1595. Grid.Column="0"
  1596. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  1597. <mah:NumericUpDown Grid.Row="11"
  1598. Grid.Column="1"
  1599. materialDesign:HintAssist.Hint="Font Size"
  1600. Value="{Binding Captions4,Mode=TwoWay}" />
  1601. </Grid>
  1602. </ScrollViewer>
  1603. </TabItem>
  1604. <!--语言-->
  1605. <TabItem>
  1606. <TabItem.Header>
  1607. <StackPanel Width="auto"
  1608. Height="auto">
  1609. <materialDesign:PackIcon Width="24"
  1610. Height="24"
  1611. HorizontalAlignment="Center"
  1612. Kind="TranslateVariant" />
  1613. <TextBlock HorizontalAlignment="Center"
  1614. TextWrapping="Wrap"
  1615. FontSize="{DynamicResource Font.Size.Body2}"
  1616. Text="{lex:Loc SettingView_Language_Text}" />
  1617. </StackPanel>
  1618. </TabItem.Header>
  1619. <StackPanel Margin="20"
  1620. Orientation="Horizontal"
  1621. VerticalAlignment="Top">
  1622. <!--中文简体-->
  1623. <Button MinWidth="100"
  1624. materialDesign:ButtonAssist.CornerRadius="10"
  1625. ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}"
  1626. FontSize="{DynamicResource Font.Size.Body1}"
  1627. Command="{Binding SelectLanguageCommand}"
  1628. CommandParameter="ChineseSimplified">
  1629. <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
  1630. <Button.Style>
  1631. <Style TargetType="Button"
  1632. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1633. <Setter Property="Foreground"
  1634. Value="#000000" />
  1635. <Style.Triggers>
  1636. <DataTrigger Binding="{Binding CurrentLanguage}"
  1637. Value="{x:Static enums:Language.ChineseSimplified}">
  1638. <Setter Property="Background"
  1639. Value="Green" />
  1640. <Setter Property="BorderBrush"
  1641. Value="Green" />
  1642. </DataTrigger>
  1643. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  1644. Value="{x:Static enums:Language.English}">
  1645. <Setter Property="Background"
  1646. Value="#e4ff54" />
  1647. <Setter Property="BorderBrush"
  1648. Value="#e4ff54" />
  1649. </DataTrigger>-->
  1650. </Style.Triggers>
  1651. </Style>
  1652. </Button.Style>
  1653. </Button>
  1654. <!--中文繁体-->
  1655. <Button MinWidth="100"
  1656. Margin="20.0"
  1657. materialDesign:ButtonAssist.CornerRadius="10"
  1658. ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}"
  1659. FontSize="{DynamicResource Font.Size.Body1}"
  1660. Command="{Binding SelectLanguageCommand}"
  1661. CommandParameter="ChineseTraditional">
  1662. <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
  1663. <Button.Style>
  1664. <Style TargetType="Button"
  1665. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1666. <Setter Property="Foreground"
  1667. Value="#000000" />
  1668. <Style.Triggers>
  1669. <DataTrigger Binding="{Binding CurrentLanguage}"
  1670. Value="{x:Static enums:Language.ChineseTraditional}">
  1671. <Setter Property="Background"
  1672. Value="Green" />
  1673. <Setter Property="BorderBrush"
  1674. Value="Green" />
  1675. </DataTrigger>
  1676. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  1677. Value="{x:Static enums:Language.Chinese}">
  1678. <Setter Property="Background"
  1679. Value="#e4ff54" />
  1680. <Setter Property="BorderBrush"
  1681. Value="#e4ff54" />
  1682. </DataTrigger>-->
  1683. </Style.Triggers>
  1684. </Style>
  1685. </Button.Style>
  1686. </Button>
  1687. <!--英语-->
  1688. <Button MinWidth="100"
  1689. Margin="20.0"
  1690. materialDesign:ButtonAssist.CornerRadius="10"
  1691. ToolTip="{lex:Loc SettingView_Language_English}"
  1692. FontSize="{DynamicResource Font.Size.Body1}"
  1693. Command="{Binding SelectLanguageCommand}"
  1694. CommandParameter="English">
  1695. <TextBlock Text="{lex:Loc SettingView_Language_English}" />
  1696. <Button.Style>
  1697. <Style TargetType="Button"
  1698. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1699. <Setter Property="Foreground"
  1700. Value="#000000" />
  1701. <Style.Triggers>
  1702. <DataTrigger Binding="{Binding CurrentLanguage}"
  1703. Value="{x:Static enums:Language.English}">
  1704. <Setter Property="Background"
  1705. Value="Green" />
  1706. <Setter Property="BorderBrush"
  1707. Value="Green" />
  1708. </DataTrigger>
  1709. </Style.Triggers>
  1710. </Style>
  1711. </Button.Style>
  1712. </Button>
  1713. <!--日语-->
  1714. <Button MinWidth="100"
  1715. Margin="20.0"
  1716. materialDesign:ButtonAssist.CornerRadius="10"
  1717. ToolTip="{lex:Loc SettingView_Language_Japanese}"
  1718. FontSize="{DynamicResource Font.Size.Body1}"
  1719. Command="{Binding SelectLanguageCommand}"
  1720. CommandParameter="Japanese">
  1721. <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
  1722. <Button.Style>
  1723. <Style TargetType="Button"
  1724. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  1725. <Setter Property="Foreground"
  1726. Value="#000000" />
  1727. <Style.Triggers>
  1728. <DataTrigger Binding="{Binding CurrentLanguage}"
  1729. Value="{x:Static enums:Language.Japanese}">
  1730. <Setter Property="Background"
  1731. Value="Green" />
  1732. <Setter Property="BorderBrush"
  1733. Value="Green" />
  1734. </DataTrigger>
  1735. </Style.Triggers>
  1736. </Style>
  1737. </Button.Style>
  1738. </Button>
  1739. </StackPanel>
  1740. </TabItem>
  1741. </TabControl>
  1742. </Grid>
  1743. </UserControl>