SettingView.xaml 136 KB

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