SettingView.xaml 163 KB

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