SettingView.xaml 203 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376
  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. <TabItem>
  204. <TabItem.Header>
  205. <StackPanel>
  206. <materialDesign:PackIcon Width="24"
  207. Height="24"
  208. HorizontalAlignment="Center"
  209. Kind="CodeArray" />
  210. <TextBlock HorizontalAlignment="Center"
  211. FontSize="{DynamicResource Font.Size.Body2}"
  212. Text="{lex:Loc 扫码枪}" />
  213. </StackPanel>
  214. </TabItem.Header>
  215. <Grid Margin="16">
  216. <Grid.RowDefinitions>
  217. <RowDefinition Height="50" />
  218. <RowDefinition Height="*" />
  219. </Grid.RowDefinitions>
  220. <Grid.ColumnDefinitions>
  221. <ColumnDefinition Width="auto" />
  222. <ColumnDefinition Width="*" />
  223. </Grid.ColumnDefinitions>
  224. <!--增删改查-->
  225. <StackPanel Grid.ColumnSpan="2"
  226. IsEnabled="{Binding IsAllowEdit}"
  227. Orientation="Horizontal">
  228. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  229. ToolTip="{lex:Loc 增加扫码枪}"
  230. Command="{Binding AddScannerCommand}">
  231. <materialDesign:PackIcon Kind="Plus" />
  232. </Button>
  233. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  234. ToolTip="{lex:Loc 修改扫码枪}"
  235. Margin="20,0"
  236. Command="{Binding EditScannerCommand}">
  237. <materialDesign:PackIcon Kind="PuzzleEditOutline" />
  238. </Button>
  239. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  240. ToolTip="{lex:Loc 移除扫码枪}"
  241. Command="{Binding RemoveScannerCommand}">
  242. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  243. </Button>
  244. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  245. ToolTip="{lex:Loc 保存扫码枪}"
  246. Margin="20,0"
  247. Command="{Binding SaveScannerCommand}">
  248. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  249. </Button>
  250. </StackPanel>
  251. <!--扫码枪列表-->
  252. <TreeView Grid.Row="1"
  253. Grid.Column="0"
  254. SelectedItemChanged="TreeView_SelectedItemChanged">
  255. <TreeViewItem Header="{lex:Loc 扫码枪列表}"
  256. FontSize="{DynamicResource Font.Size.Title4}"
  257. FontWeight="Bold"
  258. IsExpanded="True"
  259. ItemsSource="{Binding ScannerList}">
  260. <TreeViewItem.ItemTemplate>
  261. <HierarchicalDataTemplate>
  262. <StackPanel Orientation="Vertical">
  263. <TextBlock Text="{Binding Name,Mode=TwoWay}"
  264. FontSize="{DynamicResource Font.Size.Title4}" />
  265. <StackPanel Orientation="Horizontal">
  266. <TextBlock Text="{lex:Loc 名称}"
  267. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  268. FontSize="{DynamicResource Font.Size.Captions3}" />
  269. <TextBlock Text="{Binding Name,Mode=TwoWay}"
  270. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  271. FontSize="{DynamicResource Font.Size.Captions3}" />
  272. <TextBlock Text="{lex:Loc 连接方式}"
  273. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  274. FontSize="10"
  275. Margin="10,0,0,0" />
  276. <TextBlock Text="{Binding ConnectType,Mode=TwoWay}"
  277. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  278. FontSize="{DynamicResource Font.Size.Captions3}" />
  279. </StackPanel>
  280. <StackPanel Orientation="Horizontal">
  281. <TextBlock Text="{Binding IP,StringFormat=IP:{0},Mode=TwoWay}"
  282. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  283. FontSize="{DynamicResource Font.Size.Captions3}" />
  284. <TextBlock Text="{Binding Port,StringFormat=Port:{0},Mode=TwoWay}"
  285. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  286. FontSize="{DynamicResource Font.Size.Captions3}"
  287. Margin="10,0" />
  288. <TextBlock Text="{lex:Loc 结束符}"
  289. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  290. FontSize="{DynamicResource Font.Size.Captions3}" />
  291. <TextBlock Text="{Binding Terminator,Mode=TwoWay}"
  292. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  293. FontSize="{DynamicResource Font.Size.Captions3}" />
  294. </StackPanel>
  295. <Border Height="2"
  296. Margin="0"
  297. BorderThickness="2"
  298. BorderBrush="Green" />
  299. </StackPanel>
  300. </HierarchicalDataTemplate>
  301. </TreeViewItem.ItemTemplate>
  302. </TreeViewItem>
  303. </TreeView>
  304. <!--参数详情-->
  305. <ScrollViewer Grid.Row="1"
  306. Grid.Column="1"
  307. IsEnabled="{Binding IsAllowEdit}"
  308. Margin="20">
  309. <Grid MinHeight="300"
  310. HorizontalAlignment="Left"
  311. VerticalAlignment="Top">
  312. <Grid.RowDefinitions>
  313. <RowDefinition />
  314. <RowDefinition />
  315. <RowDefinition />
  316. <RowDefinition />
  317. <RowDefinition />
  318. <RowDefinition />
  319. <RowDefinition />
  320. <RowDefinition />
  321. </Grid.RowDefinitions>
  322. <Grid.ColumnDefinitions>
  323. <ColumnDefinition Width="auto" />
  324. <ColumnDefinition Width="*" />
  325. </Grid.ColumnDefinitions>
  326. <!--id-->
  327. <TextBlock Text="Id:"
  328. Grid.Row="0"
  329. Grid.Column="0"
  330. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  331. HorizontalAlignment="Right"
  332. VerticalAlignment="Center"
  333. FontSize="{DynamicResource Font.Size.Body3}" />
  334. <TextBlock x:Name="txt_ScannerId"
  335. Text="{Binding SelectScanner.Id,Mode=TwoWay}"
  336. Grid.Row="0"
  337. Grid.Column="1"
  338. Margin="10,0"
  339. HorizontalAlignment="Left"
  340. VerticalAlignment="Center"
  341. FontSize="{DynamicResource Font.Size.Body3}" />
  342. <!--名称-->
  343. <TextBlock Text="{lex:Loc 名称}"
  344. Grid.Row="1"
  345. Grid.Column="0"
  346. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  347. HorizontalAlignment="Right"
  348. VerticalAlignment="Center"
  349. FontSize="{DynamicResource Font.Size.Body3}" />
  350. <TextBox Grid.Row="1"
  351. Grid.Column="1"
  352. Margin="10,0"
  353. Width="{Binding ElementName=txt_ScannerId,Path=ActualWidth}"
  354. FontSize="{DynamicResource Font.Size.Body3}"
  355. MinWidth="80"
  356. TextAlignment="Center"
  357. HorizontalAlignment="Left"
  358. VerticalAlignment="Center"
  359. IsEnabled="False"
  360. Focusable="False"
  361. >
  362. <TextBox.Text>
  363. <Binding Path="SelectScanner.ScannerName"
  364. Mode="TwoWay">
  365. <Binding.ValidationRules>
  366. <valRules:NameValidationRule />
  367. </Binding.ValidationRules>
  368. </Binding>
  369. </TextBox.Text>
  370. </TextBox>
  371. <!--通讯方式-->
  372. <TextBlock Text="{lex:Loc 通讯方式}"
  373. Grid.Row="2"
  374. Grid.Column="0"
  375. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  376. FontSize="{DynamicResource Font.Size.Body3}"
  377. HorizontalAlignment="Right"
  378. VerticalAlignment="Center" />
  379. <ComboBox
  380. Grid.Row="2"
  381. Grid.Column="1"
  382. Margin="10,0"
  383. Width="{Binding ElementName=txt_ScannerId,Path=ActualWidth}"
  384. MinWidth="80"
  385. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  386. SelectedItem="{Binding SelectScanner.ConnectType, Mode=TwoWay}"
  387. FontSize="{DynamicResource Font.Size.Body3}"
  388. HorizontalContentAlignment="Center"
  389. HorizontalAlignment="Left"
  390. VerticalAlignment="Center"
  391. IsEnabled="False"
  392. Focusable="False"/>
  393. <!--IP地址-->
  394. <TextBlock Text="IP:"
  395. Grid.Row="3"
  396. Grid.Column="0"
  397. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  398. FontSize="{DynamicResource Font.Size.Body3}"
  399. HorizontalAlignment="Right"
  400. VerticalAlignment="Center" />
  401. <TextBox Grid.Row="3"
  402. Grid.Column="1"
  403. Margin="10,0"
  404. Width="{Binding ElementName=txt_ScannerId,Path=ActualWidth}"
  405. FontSize="{DynamicResource Font.Size.Body3}"
  406. MinWidth="80"
  407. TextAlignment="Center"
  408. HorizontalAlignment="Left"
  409. VerticalAlignment="Center"
  410. IsEnabled="False"
  411. Focusable="False">
  412. <TextBox.Text>
  413. <Binding Path="SelectScanner.IP"
  414. Mode="TwoWay">
  415. <Binding.ValidationRules>
  416. <valRules:IPValidationRule />
  417. </Binding.ValidationRules>
  418. </Binding>
  419. </TextBox.Text>
  420. </TextBox>
  421. <!--端口号-->
  422. <TextBlock Text="Port:"
  423. Grid.Row="4"
  424. Grid.Column="0"
  425. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  426. FontSize="{DynamicResource Font.Size.Body3}"
  427. HorizontalAlignment="Right"
  428. VerticalAlignment="Center" />
  429. <TextBox Grid.Row="4"
  430. Grid.Column="1"
  431. Margin="10,0"
  432. Width="{Binding ElementName=txt_ScannerId,Path=ActualWidth}"
  433. FontSize="{DynamicResource Font.Size.Body3}"
  434. MinWidth="80"
  435. TextAlignment="Center"
  436. HorizontalAlignment="Left"
  437. VerticalAlignment="Center"
  438. IsEnabled="False"
  439. Focusable="False">
  440. <TextBox.Text>
  441. <Binding Path="SelectScanner.Port"
  442. Mode="TwoWay">
  443. <Binding.ValidationRules>
  444. <valRules:PortValidationRule />
  445. </Binding.ValidationRules>
  446. </Binding>
  447. </TextBox.Text>
  448. </TextBox>
  449. <!--结束符-->
  450. <TextBlock Text="{lex:Loc 结束符}"
  451. Grid.Row="5"
  452. Grid.Column="0"
  453. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  454. FontSize="{DynamicResource Font.Size.Body3}"
  455. HorizontalAlignment="Right"
  456. VerticalAlignment="Center" />
  457. <!-- 关键修改:用 SelectedItem 绑定枚举值,ItemsSource 直接绑定枚举类型(无需 ObjectDataProvider) -->
  458. <ComboBox
  459. Grid.Row="5"
  460. Grid.Column="1"
  461. Margin="10,0"
  462. Width="{Binding ElementName=txt_ScannerId,Path=ActualWidth}"
  463. MinWidth="80"
  464. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  465. SelectedItem="{Binding SelectScanner.Terminator, Mode=TwoWay}"
  466. FontSize="{DynamicResource Font.Size.Body3}"
  467. HorizontalContentAlignment="Center"
  468. HorizontalAlignment="Left"
  469. VerticalAlignment="Center"
  470. IsEnabled="False"
  471. Focusable="False"/>
  472. </Grid>
  473. </ScrollViewer>
  474. </Grid>
  475. </TabItem>
  476. <!--设备信息-->
  477. <TabItem>
  478. <TabItem.Header>
  479. <StackPanel HorizontalAlignment="Stretch">
  480. <materialDesign:PackIcon Width="24"
  481. Height="24"
  482. HorizontalAlignment="Center"
  483. Kind="RouterNetwork" />
  484. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  485. FontSize="{DynamicResource Font.Size.Body2}"
  486. Text="{lex:Loc 设备信息}"
  487. HorizontalAlignment="Stretch" />
  488. </StackPanel>
  489. </TabItem.Header>
  490. <Grid Margin="16">
  491. <Grid.RowDefinitions>
  492. <RowDefinition Height="50" />
  493. <RowDefinition Height="*" />
  494. </Grid.RowDefinitions>
  495. <Grid.ColumnDefinitions>
  496. <ColumnDefinition Width="auto" />
  497. <ColumnDefinition Width="*" />
  498. </Grid.ColumnDefinitions>
  499. <!--增删改查按钮-->
  500. <StackPanel Grid.ColumnSpan="2"
  501. IsEnabled="{Binding IsAllowEdit}"
  502. Orientation="Horizontal">
  503. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  504. ToolTip="添加设备"
  505. Command="{Binding AddDeviceInfoCommand}">
  506. <materialDesign:PackIcon Kind="Plus" />
  507. </Button>
  508. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  509. ToolTip="删除设备"
  510. Margin="20,0"
  511. Command="{Binding RemoveDeviceInfoCommand}">
  512. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  513. </Button>
  514. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  515. ToolTip="{lex:Loc 保存}"
  516. Command="{Binding SaveDeviceInfoCommand}">
  517. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  518. </Button>
  519. </StackPanel>
  520. <!--设备列表-->
  521. <TreeView Grid.Row="1"
  522. Grid.Column="0"
  523. SelectedItemChanged="TreeView_SelectedItemChanged">
  524. <TreeViewItem Header="设备列表"
  525. FontSize="{DynamicResource Font.Size.Title4}"
  526. FontWeight="Bold"
  527. IsExpanded="True"
  528. ItemsSource="{Binding DeviceInfoList}">
  529. <TreeViewItem.ItemTemplate>
  530. <HierarchicalDataTemplate>
  531. <StackPanel Orientation="Vertical">
  532. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  533. <TextBlock.Text>
  534. <MultiBinding StringFormat="设备 {0}">
  535. <Binding Path="DeviceNo" />
  536. </MultiBinding>
  537. </TextBlock.Text>
  538. </TextBlock>
  539. <StackPanel Orientation="Horizontal">
  540. <TextBlock Text="DeviceName: "
  541. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  542. FontSize="{DynamicResource Font.Size.Body3}" />
  543. <TextBlock Text="{Binding DeviceName}"
  544. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  545. FontSize="{DynamicResource Font.Size.Body3}" />
  546. </StackPanel>
  547. <StackPanel Orientation="Horizontal">
  548. <TextBlock Text="Line: "
  549. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  550. FontSize="{DynamicResource Font.Size.Body3}" />
  551. <TextBlock Text="{Binding Line}"
  552. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  553. FontSize="{DynamicResource Font.Size.Body3}" />
  554. </StackPanel>
  555. <StackPanel Orientation="Horizontal">
  556. <TextBlock Text="Station: "
  557. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  558. FontSize="{DynamicResource Font.Size.Body3}" />
  559. <TextBlock Text="{Binding Station}"
  560. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  561. FontSize="{DynamicResource Font.Size.Body3}" />
  562. </StackPanel>
  563. <Border Height="2"
  564. Margin="0"
  565. BorderThickness="2"
  566. BorderBrush="Green" />
  567. </StackPanel>
  568. </HierarchicalDataTemplate>
  569. </TreeViewItem.ItemTemplate>
  570. </TreeViewItem>
  571. </TreeView>
  572. <!--参数详情-->
  573. <ScrollViewer Grid.Row="1"
  574. Grid.Column="1"
  575. IsEnabled="{Binding IsAllowEdit}"
  576. Margin="20"
  577. Visibility="{Binding SelectDeviceInfo,Converter={StaticResource ObjectToVisibilityConverter}}">
  578. <Grid>
  579. <Grid.RowDefinitions>
  580. <RowDefinition Height="auto" />
  581. <RowDefinition Height="auto" />
  582. </Grid.RowDefinitions>
  583. <!--设备信息表单-->
  584. <Grid>
  585. <Grid.RowDefinitions>
  586. <RowDefinition Height="Auto" />
  587. <RowDefinition Height="Auto" />
  588. <RowDefinition Height="Auto" />
  589. <RowDefinition Height="Auto" />
  590. <RowDefinition Height="Auto" />
  591. <RowDefinition Height="Auto" />
  592. <RowDefinition Height="Auto" />
  593. <RowDefinition Height="Auto" />
  594. <RowDefinition Height="Auto" />
  595. <RowDefinition Height="Auto" />
  596. <RowDefinition Height="Auto" />
  597. <RowDefinition Height="Auto" />
  598. <RowDefinition Height="Auto" />
  599. <RowDefinition Height="Auto" />
  600. <RowDefinition Height="Auto" />
  601. <RowDefinition Height="Auto" />
  602. <RowDefinition Height="Auto" />
  603. <RowDefinition Height="Auto" />
  604. <RowDefinition Height="Auto" />
  605. <RowDefinition Height="Auto" />
  606. <RowDefinition Height="Auto" />
  607. <RowDefinition Height="Auto" />
  608. <RowDefinition Height="Auto" />
  609. <RowDefinition Height="Auto" />
  610. <RowDefinition Height="Auto" />
  611. <RowDefinition Height="Auto" />
  612. <RowDefinition Height="Auto" />
  613. <RowDefinition Height="Auto" />
  614. <RowDefinition Height="Auto" />
  615. <RowDefinition Height="Auto" />
  616. <RowDefinition Height="Auto" />
  617. </Grid.RowDefinitions>
  618. <Grid.ColumnDefinitions>
  619. <ColumnDefinition Width="auto" />
  620. <ColumnDefinition Width="*" />
  621. </Grid.ColumnDefinitions>
  622. <TextBlock Grid.Row="0"
  623. Grid.Column="0"
  624. Text="设备编号:"
  625. HorizontalAlignment="Right"
  626. VerticalAlignment="Center" />
  627. <TextBlock Grid.Row="0"
  628. Grid.Column="1"
  629. Text="{Binding SelectDeviceInfo.DeviceNo}"
  630. Margin="6,2"
  631. VerticalAlignment="Center" />
  632. <TextBlock Grid.Row="1"
  633. Grid.Column="0"
  634. Text="设备名称:"
  635. HorizontalAlignment="Right"
  636. VerticalAlignment="Center" />
  637. <TextBox Grid.Row="1"
  638. Grid.Column="1"
  639. Text="{Binding SelectDeviceInfo.DeviceName, Mode=TwoWay}"
  640. Margin="6,2" />
  641. <TextBlock Grid.Row="2"
  642. Grid.Column="0"
  643. Text="设备描述:"
  644. HorizontalAlignment="Right"
  645. VerticalAlignment="Center" />
  646. <TextBox Grid.Row="2"
  647. Grid.Column="1"
  648. Text="{Binding SelectDeviceInfo.DeviceDesc, Mode=TwoWay}"
  649. Margin="6,2" />
  650. <TextBlock Grid.Row="3"
  651. Grid.Column="0"
  652. Text="Url:"
  653. HorizontalAlignment="Right"
  654. VerticalAlignment="Center" />
  655. <TextBox Grid.Row="3"
  656. Grid.Column="1"
  657. Text="{Binding SelectDeviceInfo.MesUrl, Mode=TwoWay}"
  658. Margin="6,2" />
  659. <TextBlock Grid.Row="4"
  660. Grid.Column="0"
  661. Text="Line:"
  662. HorizontalAlignment="Right"
  663. VerticalAlignment="Center" />
  664. <TextBox Grid.Row="4"
  665. Grid.Column="1"
  666. Text="{Binding SelectDeviceInfo.Line, Mode=TwoWay}"
  667. Margin="6,2" />
  668. <TextBlock Grid.Row="5"
  669. Grid.Column="0"
  670. Text="Station:"
  671. HorizontalAlignment="Right"
  672. VerticalAlignment="Center" />
  673. <TextBox Grid.Row="5"
  674. Grid.Column="1"
  675. Text="{Binding SelectDeviceInfo.Station, Mode=TwoWay}"
  676. Margin="6,2" />
  677. <TextBlock Grid.Row="6"
  678. Grid.Column="0"
  679. Text="FixtureId:"
  680. HorizontalAlignment="Right"
  681. VerticalAlignment="Center" />
  682. <TextBox Grid.Row="6"
  683. Grid.Column="1"
  684. Text="{Binding SelectDeviceInfo.FixtureId, Mode=TwoWay}"
  685. Margin="6,2" />
  686. <TextBlock Grid.Row="7"
  687. Grid.Column="0"
  688. Text="f:"
  689. HorizontalAlignment="Right"
  690. VerticalAlignment="Center" />
  691. <TextBox Grid.Row="7"
  692. Grid.Column="1"
  693. Text="{Binding SelectDeviceInfo.F, Mode=TwoWay}"
  694. Margin="6,2" />
  695. <TextBlock Grid.Row="8"
  696. Grid.Column="0"
  697. Text="comp:"
  698. HorizontalAlignment="Right"
  699. VerticalAlignment="Center" />
  700. <TextBox Grid.Row="8"
  701. Grid.Column="1"
  702. Text="{Binding SelectDeviceInfo.comp, Mode=TwoWay}"
  703. Margin="6,2" />
  704. <TextBlock Grid.Row="9"
  705. Grid.Column="0"
  706. Text="LogUrl:"
  707. HorizontalAlignment="Right"
  708. VerticalAlignment="Center" />
  709. <TextBox Grid.Row="9"
  710. Grid.Column="1"
  711. Text="{Binding SelectDeviceInfo.LogUrl, Mode=TwoWay}"
  712. Margin="6,2" />
  713. <TextBlock Grid.Row="10"
  714. Grid.Column="0"
  715. Text="apikey:"
  716. HorizontalAlignment="Right"
  717. VerticalAlignment="Center" />
  718. <TextBox Grid.Row="10"
  719. Grid.Column="1"
  720. Text="{Binding SelectDeviceInfo.ApiKey, Mode=TwoWay}"
  721. Margin="6,2" />
  722. <TextBlock Grid.Row="11"
  723. Grid.Column="0"
  724. Text="启用 MES:"
  725. HorizontalAlignment="Right"
  726. VerticalAlignment="Center" />
  727. <CheckBox Grid.Row="11"
  728. Grid.Column="1"
  729. IsChecked="{Binding SelectDeviceInfo.EnableMES, Mode=TwoWay}"
  730. Command="{Binding CheckStatusCommand}"
  731. Margin="6,2" />
  732. <CheckBox Grid.Row="12"
  733. Grid.Column="1"
  734. Content="是否启用两次产品编号"
  735. IsChecked="{Binding SelectDeviceInfo.EnableDoubleMes, Mode=TwoWay}"
  736. Margin="6,2" />
  737. <StackPanel Grid.Row="13"
  738. Grid.Column="1"
  739. Orientation="Horizontal">
  740. <CheckBox Content="是否保存CSV文件"
  741. IsChecked="{Binding SelectDeviceInfo.SaveCsv, Mode=TwoWay}"
  742. Command="{Binding CheckStatusCommand}"
  743. Margin="6,2" />
  744. <CheckBox Content="是否保存ppid"
  745. IsChecked="{Binding SelectDeviceInfo.SaveCsvPPID, Mode=TwoWay}"
  746. Margin="6,2" />
  747. <CheckBox Content="是否启用键盘相邻键保存差值"
  748. IsChecked="{Binding SelectDeviceInfo.SaveCsvkeyData, Mode=TwoWay}"
  749. Margin="6,2"/>
  750. </StackPanel>
  751. <TextBlock Grid.Row="14"
  752. Grid.Column="0"
  753. Text="保存的CSV文件路径:"
  754. HorizontalAlignment="Right"
  755. VerticalAlignment="Center" />
  756. <DockPanel HorizontalAlignment="Stretch"
  757. Grid.Row="14"
  758. Grid.Column="1"
  759. Margin="6,2">
  760. <Button DockPanel.Dock="Right"
  761. HorizontalAlignment="Right"
  762. ToolTip="{lex:Loc 选择路径}"
  763. Command="{Binding CurrentRunStatus}">
  764. <Button.Content>
  765. <materialDesign:PackIcon Kind="FolderOpenOutline" />
  766. </Button.Content>
  767. </Button>
  768. <TextBox Text="{Binding SelectDeviceInfo.SaveCsvPath, Mode=TwoWay}" />
  769. </DockPanel>
  770. <!--CTQ 数据信息-->
  771. <TextBlock Grid.Row="15"
  772. Grid.Column="0"
  773. Text="PROCESS_NAME:"
  774. HorizontalAlignment="Right"
  775. VerticalAlignment="Center" />
  776. <TextBox Grid.Row="15"
  777. Grid.Column="1"
  778. Text="{Binding SelectDeviceInfo.DataInfo.PROCESS_NAME, Mode=TwoWay}"
  779. Margin="6,2" />
  780. <!--<TextBlock Grid.Row="14"
  781. Grid.Column="0"
  782. Text="CTQ_LSL(压力下限):"
  783. HorizontalAlignment="Right"
  784. VerticalAlignment="Center" />
  785. <TextBox Grid.Row="14"
  786. Grid.Column="1"
  787. Text="{Binding SelectDeviceInfo.DataInfo.CTQ_LSL_Pressure, Mode=TwoWay}"
  788. Margin="6,2" />
  789. <TextBlock Grid.Row="15"
  790. Grid.Column="0"
  791. Text="CTQ_USL(压力上限):"
  792. HorizontalAlignment="Right"
  793. VerticalAlignment="Center" />
  794. <TextBox Grid.Row="15"
  795. Grid.Column="1"
  796. Text="{Binding SelectDeviceInfo.DataInfo.CTQ_USL_Pressure, Mode=TwoWay}"
  797. Margin="6,2" />-->
  798. <TextBlock Grid.Row="18"
  799. Grid.Column="0"
  800. Text="SUPPLIER_NAME:"
  801. HorizontalAlignment="Right"
  802. VerticalAlignment="Center" />
  803. <TextBox Grid.Row="18"
  804. Grid.Column="1"
  805. Text="{Binding SelectDeviceInfo.DataInfo.SUPPLIER_NAME, Mode=TwoWay}"
  806. Margin="6,2" />
  807. <TextBlock Grid.Row="19"
  808. Grid.Column="0"
  809. Text="COMMODITY_TYPE:"
  810. HorizontalAlignment="Right"
  811. VerticalAlignment="Center" />
  812. <TextBox Grid.Row="19"
  813. Grid.Column="1"
  814. Text="{Binding SelectDeviceInfo.DataInfo.COMMODITY_TYPE, Mode=TwoWay}"
  815. Margin="6,2" />
  816. <TextBlock Grid.Row="20"
  817. Grid.Column="0"
  818. Text="REVISION:"
  819. HorizontalAlignment="Right"
  820. VerticalAlignment="Center" />
  821. <TextBox Grid.Row="20"
  822. Grid.Column="1"
  823. Text="{Binding SelectDeviceInfo.DataInfo.REVISION, Mode=TwoWay}"
  824. Margin="6,2" />
  825. <TextBlock Grid.Row="21"
  826. Grid.Column="0"
  827. Text="MFG_LOT#:"
  828. HorizontalAlignment="Right"
  829. VerticalAlignment="Center" />
  830. <TextBox Grid.Row="21"
  831. Grid.Column="1"
  832. Text="{Binding SelectDeviceInfo.DataInfo.MFG_LOT, Mode=TwoWay}"
  833. Margin="6,2" />
  834. <TextBlock Grid.Row="22"
  835. Grid.Column="0"
  836. Text="MFG_ASSY_LINE:"
  837. HorizontalAlignment="Right"
  838. VerticalAlignment="Center" />
  839. <TextBox Grid.Row="22"
  840. Grid.Column="1"
  841. Text="{Binding SelectDeviceInfo.DataInfo.MFG_ASSY_LINE, Mode=TwoWay}"
  842. Margin="6,2" />
  843. <TextBlock Grid.Row="23"
  844. Grid.Column="0"
  845. Text="PROCESS_MACHINE_ID:"
  846. HorizontalAlignment="Right"
  847. VerticalAlignment="Center" />
  848. <TextBox Grid.Row="23"
  849. Grid.Column="1"
  850. Text="{Binding SelectDeviceInfo.DataInfo.PROCESS_MACHINE_ID, Mode=TwoWay}"
  851. Margin="6,2" />
  852. </Grid>
  853. </Grid>
  854. </ScrollViewer>
  855. </Grid>
  856. </TabItem>
  857. <!--机器人-->
  858. <TabItem>
  859. <TabItem.Header>
  860. <StackPanel HorizontalAlignment="Stretch">
  861. <materialDesign:PackIcon Width="24"
  862. Height="24"
  863. HorizontalAlignment="Center"
  864. Kind="RobotIndustrialOutline" />
  865. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  866. FontSize="{DynamicResource Font.Size.Body2}"
  867. Text="{lex:Loc 机器人}"
  868. HorizontalAlignment="Stretch" />
  869. </StackPanel>
  870. </TabItem.Header>
  871. <Grid Margin="16">
  872. <Grid.RowDefinitions>
  873. <RowDefinition Height="50" />
  874. <RowDefinition Height="*" />
  875. </Grid.RowDefinitions>
  876. <Grid.ColumnDefinitions>
  877. <ColumnDefinition Width="auto" />
  878. <ColumnDefinition Width="*" />
  879. </Grid.ColumnDefinitions>
  880. <!--增删改查-->
  881. <StackPanel Grid.ColumnSpan="2"
  882. IsEnabled="{Binding IsAllowEdit}"
  883. Orientation="Horizontal">
  884. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  885. ToolTip="{lex:Loc 增加机器人}"
  886. Command="{Binding AddRobotCommand}">
  887. <materialDesign:PackIcon Kind="Plus" />
  888. </Button>
  889. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  890. ToolTip="{lex:Loc 移除机器人}"
  891. Margin="20,0"
  892. Command="{Binding RemoveCommand}">
  893. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  894. </Button>
  895. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  896. ToolTip="{lex:Loc 保存}"
  897. Command="{Binding SaveRobotsCommand}">
  898. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  899. </Button>
  900. </StackPanel>
  901. <!--机器人列表-->
  902. <TreeView Grid.Row="1"
  903. Grid.Column="0"
  904. SelectedItemChanged="TreeView_SelectedItemChanged">
  905. <TreeViewItem Header="{lex:Loc 机器人列表}"
  906. FontSize="{DynamicResource Font.Size.Title4}"
  907. FontWeight="Bold"
  908. IsExpanded="True"
  909. ItemsSource="{Binding RobotList}">
  910. <TreeViewItem.ItemTemplate>
  911. <HierarchicalDataTemplate>
  912. <StackPanel Orientation="Vertical">
  913. <StackPanel Orientation="Horizontal">
  914. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  915. <TextBlock.Text>
  916. <MultiBinding StringFormat="{}{0}. {1}">
  917. <Binding Path="RobotNo" />
  918. <Binding Path="RobotName" />
  919. </MultiBinding>
  920. </TextBlock.Text>
  921. </TextBlock>
  922. </StackPanel>
  923. <StackPanel Orientation="Horizontal">
  924. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  925. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  926. FontSize="{DynamicResource Font.Size.Captions3}" />
  927. <TextBlock Text="{Binding RobotBrand,Mode=TwoWay}"
  928. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  929. FontSize="{DynamicResource Font.Size.Captions3}" />
  930. <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  931. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  932. FontSize="{DynamicResource Font.Size.Captions3}"
  933. Margin="10,0,0,0"
  934. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  935. <TextBlock Text="{Binding ConnectType,Mode=TwoWay}"
  936. VerticalAlignment="Center"
  937. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  938. FontSize="{DynamicResource Font.Size.Captions3}"
  939. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  940. <!--PLC-->
  941. <TextBlock Text="PLC: "
  942. Margin="10,0,0,0"
  943. FontSize="{DynamicResource Font.Size.Captions3}"
  944. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  945. d:Visibility="Collapsed"
  946. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  947. <TextBlock Text="{Binding PLC,Converter={StaticResource PlcIdToNameConverter}}"
  948. FontSize="{DynamicResource Font.Size.Captions3}"
  949. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  950. d:Visibility="Collapsed"
  951. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  952. </StackPanel>
  953. <StackPanel Orientation="Horizontal"
  954. Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  955. <TextBlock Text="{Binding IP,StringFormat=IP:{0},Mode=TwoWay}"
  956. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  957. FontSize="{DynamicResource Font.Size.Captions3}" />
  958. <TextBlock Text="{Binding Port,StringFormat=Port:{0},Mode=TwoWay}"
  959. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  960. FontSize="{DynamicResource Font.Size.Captions3}"
  961. Margin="10,0" />
  962. <TextBlock Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  963. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  964. FontSize="{DynamicResource Font.Size.Captions3}" />
  965. <TextBlock Text="{Binding Terminator,Mode=TwoWay}"
  966. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  967. FontSize="{DynamicResource Font.Size.Captions3}" />
  968. </StackPanel>
  969. <Border Height="2"
  970. Margin="0"
  971. BorderThickness="2"
  972. BorderBrush="Green" />
  973. </StackPanel>
  974. </HierarchicalDataTemplate>
  975. </TreeViewItem.ItemTemplate>
  976. </TreeViewItem>
  977. </TreeView>
  978. <!--参数详情-->
  979. <ScrollViewer Grid.Row="1"
  980. Grid.Column="1"
  981. IsEnabled="{Binding IsAllowEdit}"
  982. Margin="20"
  983. Visibility="{Binding SelectRobot,Converter={StaticResource ObjectToVisibilityConverter}}">
  984. <Grid HorizontalAlignment="Stretch"
  985. VerticalAlignment="Top">
  986. <Grid.RowDefinitions>
  987. <RowDefinition />
  988. <RowDefinition />
  989. <RowDefinition />
  990. <RowDefinition />
  991. <RowDefinition />
  992. <RowDefinition />
  993. <RowDefinition />
  994. <RowDefinition />
  995. </Grid.RowDefinitions>
  996. <Grid.ColumnDefinitions>
  997. <ColumnDefinition Width="auto" />
  998. <ColumnDefinition Width="auto" />
  999. <ColumnDefinition Width="*" />
  1000. </Grid.ColumnDefinitions>
  1001. <!--id-->
  1002. <TextBlock Text="Id: "
  1003. Grid.Row="0"
  1004. Grid.Column="0"
  1005. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1006. HorizontalAlignment="Right"
  1007. VerticalAlignment="Center"
  1008. FontSize="{DynamicResource Font.Size.Body3}" />
  1009. <TextBlock x:Name="txt_Id"
  1010. Text="{Binding SelectRobot.Id,Mode=TwoWay}"
  1011. Grid.Row="0"
  1012. Grid.Column="1"
  1013. Margin="10,0"
  1014. HorizontalAlignment="Left"
  1015. VerticalAlignment="Center"
  1016. FontSize="{DynamicResource Font.Size.Body3}" />
  1017. <!--名称-->
  1018. <TextBlock Text="{lex:Loc 名称,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1019. Grid.Row="1"
  1020. Grid.Column="0"
  1021. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1022. HorizontalAlignment="Right"
  1023. VerticalAlignment="Center"
  1024. FontSize="{DynamicResource Font.Size.Body3}" />
  1025. <TextBox Grid.Row="1"
  1026. Grid.Column="1"
  1027. Margin="10,0"
  1028. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  1029. FontSize="{DynamicResource Font.Size.Body3}"
  1030. MinWidth="80"
  1031. TextAlignment="Center"
  1032. HorizontalAlignment="Left"
  1033. VerticalAlignment="Center">
  1034. <TextBox.Text>
  1035. <Binding Path="SelectRobot.RobotName"
  1036. Mode="TwoWay">
  1037. <Binding.ValidationRules>
  1038. <valRules:NameValidationRule />
  1039. </Binding.ValidationRules>
  1040. </Binding>
  1041. </TextBox.Text>
  1042. </TextBox>
  1043. <!--机器人品牌-->
  1044. <TextBlock Text="{lex:Loc 品牌,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1045. Grid.Row="2"
  1046. Grid.Column="0"
  1047. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1048. FontSize="{DynamicResource Font.Size.Body3}"
  1049. HorizontalAlignment="Right"
  1050. VerticalAlignment="Center" />
  1051. <ComboBox Grid.Row="2"
  1052. Grid.Column="1"
  1053. Margin="10,0"
  1054. FontSize="{DynamicResource Font.Size.Body3}"
  1055. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  1056. MinWidth="80"
  1057. SelectedItem="{Binding SelectRobot.RobotBrand,Mode=TwoWay}"
  1058. ItemsSource="{ext:EnumBindingSource EnumType=enums:RobotBrand}"
  1059. HorizontalContentAlignment="Center"
  1060. HorizontalAlignment="Left"
  1061. VerticalAlignment="Center" />
  1062. <!--通讯方式-->
  1063. <TextBlock Text="{lex:Loc 通讯方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1064. Grid.Row="3"
  1065. Grid.Column="0"
  1066. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1067. FontSize="{DynamicResource Font.Size.Body3}"
  1068. HorizontalAlignment="Right"
  1069. VerticalAlignment="Center"
  1070. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1071. <ComboBox Grid.Row="3"
  1072. Grid.Column="1"
  1073. Margin="10,0"
  1074. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  1075. MinWidth="80"
  1076. SelectedItem="{Binding SelectRobot.ConnectType,Mode=TwoWay}"
  1077. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  1078. FontSize="{DynamicResource Font.Size.Body3}"
  1079. HorizontalContentAlignment="Center"
  1080. HorizontalAlignment="Left"
  1081. VerticalAlignment="Center"
  1082. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1083. <!--IP地址-->
  1084. <TextBlock Text="IP: "
  1085. Grid.Row="4"
  1086. Grid.Column="0"
  1087. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1088. FontSize="{DynamicResource Font.Size.Body3}"
  1089. HorizontalAlignment="Right"
  1090. VerticalAlignment="Center"
  1091. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1092. <TextBox Grid.Row="4"
  1093. Grid.Column="1"
  1094. Margin="10,0"
  1095. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  1096. FontSize="{DynamicResource Font.Size.Body3}"
  1097. MinWidth="80"
  1098. TextAlignment="Center"
  1099. HorizontalAlignment="Left"
  1100. VerticalAlignment="Center"
  1101. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  1102. <TextBox.Text>
  1103. <Binding Path="SelectRobot.IP"
  1104. Mode="TwoWay">
  1105. <Binding.ValidationRules>
  1106. <valRules:IPValidationRule />
  1107. </Binding.ValidationRules>
  1108. </Binding>
  1109. </TextBox.Text>
  1110. </TextBox>
  1111. <!--端口号-->
  1112. <TextBlock Text="Port: "
  1113. Grid.Row="5"
  1114. Grid.Column="0"
  1115. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1116. FontSize="{DynamicResource Font.Size.Body3}"
  1117. HorizontalAlignment="Right"
  1118. VerticalAlignment="Center"
  1119. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1120. <TextBox Grid.Row="5"
  1121. Grid.Column="1"
  1122. Margin="10,0"
  1123. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  1124. FontSize="{DynamicResource Font.Size.Body3}"
  1125. MinWidth="80"
  1126. TextAlignment="Center"
  1127. HorizontalAlignment="Left"
  1128. VerticalAlignment="Center"
  1129. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  1130. <TextBox.Text>
  1131. <Binding Path="SelectRobot.Port"
  1132. Mode="TwoWay">
  1133. <Binding.ValidationRules>
  1134. <valRules:PortValidationRule />
  1135. </Binding.ValidationRules>
  1136. </Binding>
  1137. </TextBox.Text>
  1138. </TextBox>
  1139. <!--结束符-->
  1140. <TextBlock Text="{lex:Loc 结束符,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1141. Grid.Row="6"
  1142. Grid.Column="0"
  1143. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1144. FontSize="{DynamicResource Font.Size.Body3}"
  1145. HorizontalAlignment="Right"
  1146. VerticalAlignment="Center"
  1147. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1148. <ComboBox SelectedItem="{Binding SelectRobot.Terminator,Mode=TwoWay}"
  1149. Grid.Row="6"
  1150. Grid.Column="1"
  1151. Margin="10,0"
  1152. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  1153. MinWidth="80"
  1154. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  1155. FontSize="{DynamicResource Font.Size.Body3}"
  1156. HorizontalContentAlignment="Center"
  1157. HorizontalAlignment="Left"
  1158. VerticalAlignment="Center"
  1159. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1160. <!--编码格式-->
  1161. <TextBlock Grid.Row="7"
  1162. Grid.Column="0"
  1163. Text="{lex:Loc 编码解码,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1164. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1165. FontSize="{DynamicResource Font.Size.Body3}"
  1166. HorizontalAlignment="Right"
  1167. VerticalAlignment="Center"
  1168. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1169. <ComboBox SelectedItem="{Binding SelectRobot.DataEncoding,Mode=TwoWay}"
  1170. Grid.Row="7"
  1171. Grid.Column="1"
  1172. Margin="10,0"
  1173. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  1174. MinWidth="80"
  1175. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  1176. FontSize="{DynamicResource Font.Size.Body3}"
  1177. HorizontalContentAlignment="Center"
  1178. HorizontalAlignment="Left"
  1179. VerticalAlignment="Center"
  1180. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1181. <!--PLC-->
  1182. <TextBlock Grid.Row="3"
  1183. Grid.Column="0"
  1184. Text="PLC: "
  1185. HorizontalAlignment="Right"
  1186. VerticalAlignment="Center"
  1187. d:Visibility="Collapsed"
  1188. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  1189. <ComboBox SelectedItem="{Binding RobotSelectedPlc}"
  1190. Grid.Row="3"
  1191. Grid.Column="1"
  1192. Margin="10,5"
  1193. ItemsSource="{Binding PlcList}"
  1194. Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
  1195. MinWidth="80"
  1196. HorizontalContentAlignment="Center"
  1197. HorizontalAlignment="Left"
  1198. VerticalAlignment="Center"
  1199. d:Visibility="Collapsed"
  1200. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  1201. <ComboBox.ItemTemplate>
  1202. <DataTemplate>
  1203. <TextBlock Text="{Binding Name}" />
  1204. </DataTemplate>
  1205. </ComboBox.ItemTemplate>
  1206. </ComboBox>
  1207. <!--<ScrollViewer Grid.RowSpan="8"
  1208. Grid.Column="2"
  1209. HorizontalScrollBarVisibility="Auto"
  1210. VerticalScrollBarVisibility="Auto"
  1211. d:Visibility="Collapsed"
  1212. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  1213. <Grid Margin="5">
  1214. <Grid.RowDefinitions>
  1215. <RowDefinition Height="Auto" />
  1216. <RowDefinition Height="Auto" />
  1217. <RowDefinition Height="Auto" />
  1218. <RowDefinition Height="Auto" />
  1219. <RowDefinition Height="Auto" />
  1220. <RowDefinition Height="Auto" />
  1221. <RowDefinition Height="Auto" />
  1222. <RowDefinition Height="Auto" />
  1223. <RowDefinition Height="Auto" />
  1224. <RowDefinition Height="Auto" />
  1225. <RowDefinition Height="Auto" />
  1226. <RowDefinition Height="Auto" />
  1227. <RowDefinition Height="Auto" />
  1228. <RowDefinition Height="Auto" />
  1229. <RowDefinition Height="Auto" />
  1230. <RowDefinition Height="Auto" />
  1231. <RowDefinition Height="Auto" />
  1232. <RowDefinition Height="Auto" />
  1233. <RowDefinition Height="Auto" />
  1234. <RowDefinition Height="Auto" />
  1235. <RowDefinition Height="Auto" />
  1236. <RowDefinition Height="Auto" />
  1237. <RowDefinition Height="Auto" />
  1238. <RowDefinition Height="Auto" />
  1239. </Grid.RowDefinitions>
  1240. <Grid.ColumnDefinitions>
  1241. <ColumnDefinition Width="auto" />
  1242. <ColumnDefinition Width="*" />
  1243. </Grid.ColumnDefinitions>
  1244. <Grid.Resources>
  1245. <Style TargetType="TextBlock">
  1246. <Setter Property="FontSize"
  1247. Value="{DynamicResource Font.Size.Body3}" />
  1248. <Setter Property="Margin"
  1249. Value="5" />
  1250. <Setter Property="VerticalAlignment"
  1251. Value="Center" />
  1252. </Style>
  1253. <Style TargetType="TextBox">
  1254. <Setter Property="FontSize"
  1255. Value="{DynamicResource Font.Size.Body3}" />
  1256. <Setter Property="Margin"
  1257. Value="5" />
  1258. <Setter Property="HorizontalAlignment"
  1259. Value="Stretch" />
  1260. <Setter Property="VerticalAlignment"
  1261. Value="Center" />
  1262. </Style>
  1263. </Grid.Resources>
  1264. <TextBlock Grid.Row="0"
  1265. FontWeight="Bold"
  1266. Text="{lex:Loc 状态参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  1267. <TextBlock Grid.Row="1"
  1268. Text="{lex:Loc X坐标}" />
  1269. <DockPanel Grid.Row="1"
  1270. Grid.Column="1"
  1271. LastChildFill="True">
  1272. <TextBlock Text="{Binding ResultsValues[0]}"
  1273. MinWidth="50" />
  1274. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.X}" />
  1275. </DockPanel>
  1276. <TextBlock Grid.Row="2"
  1277. Text="{lex:Loc Y坐标}" />
  1278. <DockPanel Grid.Row="2"
  1279. Grid.Column="1"
  1280. LastChildFill="True">
  1281. <TextBlock Text="{Binding ResultsValues[1]}"
  1282. MinWidth="50" />
  1283. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Y}" />
  1284. </DockPanel>
  1285. <TextBlock Grid.Row="3"
  1286. Text="{lex:Loc Z坐标}" />
  1287. <DockPanel Grid.Row="3"
  1288. Grid.Column="1"
  1289. LastChildFill="True">
  1290. <TextBlock Text="{Binding ResultsValues[2]}"
  1291. MinWidth="50" />
  1292. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Z}" />
  1293. </DockPanel>
  1294. <TextBlock Grid.Row="4"
  1295. Text="{lex:Loc U坐标}" />
  1296. <DockPanel Grid.Row="4"
  1297. Grid.Column="1"
  1298. LastChildFill="True">
  1299. <TextBlock Text="{Binding ResultsValues[3]}"
  1300. MinWidth="50" />
  1301. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.U}" />
  1302. </DockPanel>
  1303. <TextBlock Grid.Row="5"
  1304. Text="{lex:Loc 运动结束}" />
  1305. <DockPanel Grid.Row="5"
  1306. Grid.Column="1"
  1307. LastChildFill="True">
  1308. <TextBlock Text="{Binding ResultsValues[4]}"
  1309. MinWidth="50" />
  1310. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.MoveFinish}" />
  1311. </DockPanel>
  1312. <TextBlock Grid.Row="6"
  1313. Text="{lex:Loc 错误}" />
  1314. <DockPanel Grid.Row="6"
  1315. Grid.Column="1"
  1316. LastChildFill="True">
  1317. <TextBlock Text="{Binding ResultsValues[5]}"
  1318. MinWidth="50" />
  1319. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Error}" />
  1320. </DockPanel>
  1321. <TextBlock Grid.Row="7"
  1322. Text="{lex:Loc 吸真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1323. <DockPanel Grid.Row="7"
  1324. Grid.Column="1"
  1325. LastChildFill="True">
  1326. <TextBlock Text="{Binding ResultsValues[6]}"
  1327. MinWidth="50" />
  1328. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOn}" />
  1329. </DockPanel>
  1330. <TextBlock Grid.Row="8"
  1331. Text="{lex:Loc 破真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1332. <DockPanel Grid.Row="8"
  1333. Grid.Column="1"
  1334. LastChildFill="True">
  1335. <TextBlock Text="{Binding ResultsValues[7]}"
  1336. MinWidth="50" />
  1337. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOff}" />
  1338. </DockPanel>
  1339. <TextBlock Grid.Row="9"
  1340. FontWeight="Bold"
  1341. Text="{lex:Loc 命令参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  1342. <TextBlock Grid.Row="10"
  1343. Text="{lex:Loc X坐标}" />
  1344. <TextBox Grid.Row="10"
  1345. Grid.Column="1"
  1346. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.X}" />
  1347. <TextBlock Grid.Row="11"
  1348. Text="{lex:Loc Y坐标}" />
  1349. <TextBox Grid.Row="11"
  1350. Grid.Column="1"
  1351. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Y}" />
  1352. <TextBlock Grid.Row="12"
  1353. Text="{lex:Loc Z坐标}" />
  1354. <TextBox Grid.Row="12"
  1355. Grid.Column="1"
  1356. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Z}" />
  1357. <TextBlock Grid.Row="13"
  1358. Text="{lex:Loc U坐标}" />
  1359. <TextBox Grid.Row="13"
  1360. Grid.Column="1"
  1361. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.U}" />
  1362. <TextBlock Grid.Row="14"
  1363. Text="{lex:Loc 吸真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1364. <TextBox Grid.Row="14"
  1365. Grid.Column="1"
  1366. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOn}" />
  1367. <TextBlock Grid.Row="15"
  1368. Text="{lex:Loc 破真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1369. <TextBox Grid.Row="15"
  1370. Grid.Column="1"
  1371. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOff}" />
  1372. <TextBlock Grid.Row="16"
  1373. Text="{lex:Loc Z轴限高}" />
  1374. <TextBox Grid.Row="16"
  1375. Grid.Column="1"
  1376. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Limz}" />
  1377. <TextBlock Grid.Row="17"
  1378. Text="{lex:Loc 执行运动}" />
  1379. <TextBox Grid.Row="17"
  1380. Grid.Column="1"
  1381. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.ExecuteMove}" />
  1382. <TextBlock Grid.Row="18"
  1383. Text="{lex:Loc 吸真空}" />
  1384. <TextBox Grid.Row="18"
  1385. Grid.Column="1"
  1386. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOn}" />
  1387. <TextBlock Grid.Row="19"
  1388. Text="{lex:Loc 破真空}" />
  1389. <TextBox Grid.Row="19"
  1390. Grid.Column="1"
  1391. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOff}" />
  1392. <TextBlock Grid.Row="20"
  1393. Text="{lex:Loc 步进距离,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1394. <TextBox Grid.Row="20"
  1395. Grid.Column="1"
  1396. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Distance}" />
  1397. <TextBlock Grid.Row="21"
  1398. Text="{lex:Loc 点动命令,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1399. <TextBox Grid.Row="21"
  1400. Grid.Column="1"
  1401. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.JogCmd}" />
  1402. </Grid>
  1403. </ScrollViewer>-->
  1404. </Grid>
  1405. </ScrollViewer>
  1406. </Grid>
  1407. </TabItem>
  1408. <!--Feeder-->
  1409. <TabItem>
  1410. <TabItem.Header>
  1411. <StackPanel HorizontalAlignment="Stretch">
  1412. <materialDesign:PackIcon Width="24"
  1413. Height="24"
  1414. HorizontalAlignment="Center"
  1415. Kind="Vibrate" />
  1416. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1417. FontSize="{DynamicResource Font.Size.Body2}"
  1418. Text="Feeder"
  1419. HorizontalAlignment="Stretch" />
  1420. </StackPanel>
  1421. </TabItem.Header>
  1422. <Grid Margin="16">
  1423. <Grid.RowDefinitions>
  1424. <RowDefinition Height="50" />
  1425. <RowDefinition Height="*" />
  1426. </Grid.RowDefinitions>
  1427. <Grid.ColumnDefinitions>
  1428. <ColumnDefinition Width="auto" />
  1429. <ColumnDefinition Width="*" />
  1430. </Grid.ColumnDefinitions>
  1431. <!--增删改查-->
  1432. <StackPanel Grid.ColumnSpan="2"
  1433. IsEnabled="{Binding IsAllowEdit}"
  1434. Orientation="Horizontal">
  1435. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1436. ToolTip="{lex:Loc 增加Feeder}"
  1437. Command="{Binding AddFeederCommand}">
  1438. <materialDesign:PackIcon Kind="Plus" />
  1439. </Button>
  1440. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1441. ToolTip="{lex:Loc 移除Feeder}"
  1442. Margin="20,0"
  1443. Command="{Binding RemoveFeederCommand}">
  1444. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1445. </Button>
  1446. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1447. ToolTip="{lex:Loc 保存}"
  1448. Command="{Binding SaveFeedersCommand}">
  1449. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1450. </Button>
  1451. </StackPanel>
  1452. <!--Feeder列表-->
  1453. <TreeView Grid.Row="1"
  1454. Grid.Column="0"
  1455. SelectedItemChanged="TreeView_SelectedItemChanged">
  1456. <TreeViewItem Header="{lex:Loc Feeder列表}"
  1457. FontSize="{DynamicResource Font.Size.Title4}"
  1458. FontWeight="Bold"
  1459. IsExpanded="True"
  1460. ItemsSource="{Binding FeederList}">
  1461. <TreeViewItem.ItemTemplate>
  1462. <HierarchicalDataTemplate>
  1463. <StackPanel Orientation="Vertical">
  1464. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  1465. <TextBlock.Text>
  1466. <MultiBinding StringFormat="{}{0}. {1}">
  1467. <Binding Path="FeederNo" />
  1468. <Binding Path="FeederName" />
  1469. </MultiBinding>
  1470. </TextBlock.Text>
  1471. </TextBlock>
  1472. <StackPanel Orientation="Horizontal">
  1473. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1474. FontSize="{DynamicResource Font.Size.Captions3}"
  1475. Style="{StaticResource MaterialDesignCaptionTextBlock}" />
  1476. <TextBlock Text="{Binding FeederBrand,Mode=TwoWay}"
  1477. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1478. FontSize="{DynamicResource Font.Size.Captions3}" />
  1479. <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1480. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1481. FontSize="{DynamicResource Font.Size.Captions3}"
  1482. Margin="10,0,0,0" />
  1483. <TextBlock Text="{Binding ConnectType,Mode=TwoWay}"
  1484. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1485. FontSize="{DynamicResource Font.Size.Captions3}" />
  1486. </StackPanel>
  1487. <StackPanel Orientation="Horizontal">
  1488. <TextBlock Text="{Binding IP,StringFormat=IP:{0},Mode=TwoWay}"
  1489. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1490. FontSize="{DynamicResource Font.Size.Captions3}" />
  1491. <TextBlock Text="{Binding Port,StringFormat=Port:{0},Mode=TwoWay}"
  1492. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1493. FontSize="{DynamicResource Font.Size.Captions3}"
  1494. Margin="10,0" />
  1495. </StackPanel>
  1496. <Border Height="2"
  1497. Margin="0"
  1498. BorderThickness="2"
  1499. BorderBrush="Green" />
  1500. </StackPanel>
  1501. </HierarchicalDataTemplate>
  1502. </TreeViewItem.ItemTemplate>
  1503. </TreeViewItem>
  1504. </TreeView>
  1505. <!--参数详情-->
  1506. <ScrollViewer Grid.Row="1"
  1507. IsEnabled="{Binding IsAllowEdit}"
  1508. Grid.Column="1"
  1509. Margin="20"
  1510. HorizontalAlignment="Left"
  1511. VerticalAlignment="Top"
  1512. Visibility="{Binding SelectFeeder,Converter={StaticResource ObjectToVisibilityConverter}}">
  1513. <Grid Height="300">
  1514. <Grid.RowDefinitions>
  1515. <RowDefinition />
  1516. <RowDefinition />
  1517. <RowDefinition />
  1518. <RowDefinition />
  1519. <RowDefinition />
  1520. <RowDefinition />
  1521. <RowDefinition />
  1522. </Grid.RowDefinitions>
  1523. <Grid.ColumnDefinitions>
  1524. <ColumnDefinition Width="auto" />
  1525. <ColumnDefinition Width="*" />
  1526. </Grid.ColumnDefinitions>
  1527. <!--id-->
  1528. <TextBlock Text="Id: "
  1529. Grid.Row="0"
  1530. Grid.Column="0"
  1531. FontSize="{DynamicResource Font.Size.Body3}"
  1532. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1533. HorizontalAlignment="Right"
  1534. VerticalAlignment="Center" />
  1535. <TextBlock x:Name="txt_Feeder_Id"
  1536. Text="{Binding SelectFeeder.Id,Mode=TwoWay}"
  1537. Grid.Row="0"
  1538. Grid.Column="1"
  1539. FontSize="{DynamicResource Font.Size.Body3}"
  1540. Margin="10,0"
  1541. HorizontalAlignment="Left"
  1542. VerticalAlignment="Center" />
  1543. <!--名称-->
  1544. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1545. Grid.Row="1"
  1546. Grid.Column="0"
  1547. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1548. FontSize="{DynamicResource Font.Size.Body3}"
  1549. HorizontalAlignment="Right"
  1550. VerticalAlignment="Center" />
  1551. <TextBox Grid.Row="1"
  1552. Grid.Column="1"
  1553. Margin="10,0"
  1554. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  1555. FontSize="{DynamicResource Font.Size.Body3}"
  1556. MinWidth="80"
  1557. TextAlignment="Center"
  1558. HorizontalAlignment="Left"
  1559. VerticalAlignment="Center">
  1560. <TextBox.Text>
  1561. <Binding Path="SelectFeeder.FeederName"
  1562. Mode="TwoWay">
  1563. <Binding.ValidationRules>
  1564. <valRules:NameValidationRule />
  1565. </Binding.ValidationRules>
  1566. </Binding>
  1567. </TextBox.Text>
  1568. </TextBox>
  1569. <!--Feeder品牌-->
  1570. <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1571. Grid.Row="2"
  1572. Grid.Column="0"
  1573. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1574. FontSize="{DynamicResource Font.Size.Body3}"
  1575. HorizontalAlignment="Right"
  1576. VerticalAlignment="Center" />
  1577. <ComboBox SelectedItem="{Binding SelectFeeder.FeederBrand,Mode=TwoWay}"
  1578. Grid.Row="2"
  1579. Grid.Column="1"
  1580. Margin="10,0"
  1581. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  1582. FontSize="{DynamicResource Font.Size.Body3}"
  1583. MinWidth="80"
  1584. ItemsSource="{ext:EnumBindingSource EnumType=enums1:FeederBrand}"
  1585. HorizontalContentAlignment="Center"
  1586. HorizontalAlignment="Left"
  1587. VerticalAlignment="Center" />
  1588. <!--通讯方式-->
  1589. <TextBlock Text="{lex:Loc 通讯方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1590. Grid.Row="3"
  1591. Grid.Column="0"
  1592. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1593. FontSize="{DynamicResource Font.Size.Body3}"
  1594. HorizontalAlignment="Right"
  1595. VerticalAlignment="Center" />
  1596. <ComboBox SelectedItem="{Binding SelectFeeder.ConnectType,Mode=TwoWay}"
  1597. Grid.Row="3"
  1598. Grid.Column="1"
  1599. Margin="10,0"
  1600. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  1601. MinWidth="80"
  1602. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  1603. FontSize="{DynamicResource Font.Size.Body3}"
  1604. HorizontalContentAlignment="Center"
  1605. HorizontalAlignment="Left"
  1606. VerticalAlignment="Center" />
  1607. <!--IP地址-->
  1608. <TextBlock Text="IP: "
  1609. Grid.Row="4"
  1610. Grid.Column="0"
  1611. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1612. FontSize="{DynamicResource Font.Size.Body3}"
  1613. HorizontalAlignment="Right"
  1614. VerticalAlignment="Center" />
  1615. <TextBox Grid.Row="4"
  1616. Grid.Column="1"
  1617. Margin="10,0"
  1618. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  1619. FontSize="{DynamicResource Font.Size.Body3}"
  1620. MinWidth="80"
  1621. TextAlignment="Center"
  1622. HorizontalAlignment="Left"
  1623. VerticalAlignment="Center">
  1624. <TextBox.Text>
  1625. <Binding Path="SelectFeeder.IP"
  1626. Mode="TwoWay">
  1627. <Binding.ValidationRules>
  1628. <valRules:IPValidationRule />
  1629. </Binding.ValidationRules>
  1630. </Binding>
  1631. </TextBox.Text>
  1632. </TextBox>
  1633. <!--端口号-->
  1634. <TextBlock Text="Port: "
  1635. Grid.Row="5"
  1636. Grid.Column="0"
  1637. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1638. FontSize="{DynamicResource Font.Size.Body3}"
  1639. HorizontalAlignment="Right"
  1640. VerticalAlignment="Center" />
  1641. <TextBox Grid.Row="5"
  1642. Grid.Column="1"
  1643. Margin="10,0"
  1644. Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
  1645. FontSize="{DynamicResource Font.Size.Body3}"
  1646. MinWidth="80"
  1647. TextAlignment="Center"
  1648. HorizontalAlignment="Left"
  1649. VerticalAlignment="Center">
  1650. <TextBox.Text>
  1651. <Binding Path="SelectFeeder.Port"
  1652. Mode="TwoWay">
  1653. <Binding.ValidationRules>
  1654. <valRules:PortValidationRule />
  1655. </Binding.ValidationRules>
  1656. </Binding>
  1657. </TextBox.Text>
  1658. </TextBox>
  1659. </Grid>
  1660. </ScrollViewer>
  1661. </Grid>
  1662. </TabItem>
  1663. <!--PLC-->
  1664. <TabItem>
  1665. <TabItem.Header>
  1666. <StackPanel HorizontalAlignment="Stretch">
  1667. <materialDesign:PackIcon Width="24"
  1668. Height="24"
  1669. HorizontalAlignment="Center"
  1670. Kind="CellphoneLink" />
  1671. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1672. FontSize="{DynamicResource Font.Size.Body2}"
  1673. Text="PLC"
  1674. HorizontalAlignment="Stretch" />
  1675. </StackPanel>
  1676. </TabItem.Header>
  1677. <Grid Margin="16">
  1678. <Grid.RowDefinitions>
  1679. <RowDefinition Height="50" />
  1680. <RowDefinition Height="*" />
  1681. </Grid.RowDefinitions>
  1682. <Grid.ColumnDefinitions>
  1683. <ColumnDefinition Width="auto" />
  1684. <ColumnDefinition Width="*" />
  1685. </Grid.ColumnDefinitions>
  1686. <!--增删改查-->
  1687. <StackPanel Grid.ColumnSpan="2"
  1688. IsEnabled="{Binding IsAllowEdit}"
  1689. Orientation="Horizontal">
  1690. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1691. ToolTip="{lex:Loc 增加PLC}"
  1692. Command="{Binding AddPlcCommand}">
  1693. <materialDesign:PackIcon Kind="Plus" />
  1694. </Button>
  1695. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1696. ToolTip="{lex:Loc 移除PLC}"
  1697. Margin="20,0"
  1698. Command="{Binding RemovePlcCommand}">
  1699. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1700. </Button>
  1701. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1702. ToolTip="{lex:Loc 保存}"
  1703. Command="{Binding SavePlcsCommand}">
  1704. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1705. </Button>
  1706. </StackPanel>
  1707. <!--PLC列表-->
  1708. <TreeView Grid.Row="1"
  1709. Grid.Column="0"
  1710. SelectedItemChanged="TreeView_SelectedItemChanged">
  1711. <TreeViewItem Header="{lex:Loc PLC列表}"
  1712. FontSize="{DynamicResource Font.Size.Title4}"
  1713. FontWeight="Bold"
  1714. IsExpanded="True"
  1715. ItemsSource="{Binding PlcList}">
  1716. <TreeViewItem.ItemTemplate>
  1717. <HierarchicalDataTemplate>
  1718. <StackPanel Orientation="Vertical">
  1719. <TextBlock Text="{Binding Name,Mode=TwoWay}"
  1720. FontSize="{DynamicResource Font.Size.Title4}" />
  1721. <StackPanel Orientation="Horizontal">
  1722. <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1723. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1724. FontSize="{DynamicResource Font.Size.Captions3}"
  1725. Margin="10,0,0,0" />
  1726. <TextBlock Text="{Binding CommunicationType,Mode=TwoWay}"
  1727. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1728. FontSize="{DynamicResource Font.Size.Captions3}" />
  1729. </StackPanel>
  1730. <StackPanel Orientation="Horizontal">
  1731. <TextBlock Text="{Binding EndpointUrl,StringFormat=Endpoint Url:{0},Mode=TwoWay}"
  1732. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1733. FontSize="{DynamicResource Font.Size.Captions3}" />
  1734. </StackPanel>
  1735. <Border Height="2"
  1736. Margin="0"
  1737. BorderThickness="2"
  1738. BorderBrush="Green" />
  1739. </StackPanel>
  1740. </HierarchicalDataTemplate>
  1741. </TreeViewItem.ItemTemplate>
  1742. </TreeViewItem>
  1743. </TreeView>
  1744. <!--参数详情-->
  1745. <ScrollViewer Grid.Row="1"
  1746. IsEnabled="{Binding IsAllowEdit}"
  1747. Grid.Column="1"
  1748. Margin="20"
  1749. HorizontalAlignment="Left"
  1750. VerticalAlignment="Top"
  1751. Visibility="{Binding SelectPlc,Converter={StaticResource ObjectToVisibilityConverter}}">
  1752. <Grid Height="200">
  1753. <Grid.RowDefinitions>
  1754. <RowDefinition />
  1755. <RowDefinition />
  1756. <RowDefinition />
  1757. <RowDefinition />
  1758. <RowDefinition />
  1759. </Grid.RowDefinitions>
  1760. <Grid.ColumnDefinitions>
  1761. <ColumnDefinition Width="auto" />
  1762. <ColumnDefinition Width="*" />
  1763. </Grid.ColumnDefinitions>
  1764. <!--id-->
  1765. <TextBlock Text="Id: "
  1766. Grid.Row="0"
  1767. Grid.Column="0"
  1768. FontSize="{DynamicResource Font.Size.Body3}"
  1769. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1770. HorizontalAlignment="Right"
  1771. VerticalAlignment="Center" />
  1772. <TextBlock x:Name="txt_plc_Id"
  1773. Text="{Binding SelectPlc.Id,Mode=TwoWay}"
  1774. Grid.Row="0"
  1775. Grid.Column="1"
  1776. FontSize="{DynamicResource Font.Size.Body3}"
  1777. Margin="10,0"
  1778. HorizontalAlignment="Left"
  1779. VerticalAlignment="Center" />
  1780. <!--名称-->
  1781. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1782. Grid.Row="1"
  1783. Grid.Column="0"
  1784. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1785. FontSize="{DynamicResource Font.Size.Body3}"
  1786. HorizontalAlignment="Right"
  1787. VerticalAlignment="Center" />
  1788. <TextBox Grid.Row="1"
  1789. Grid.Column="1"
  1790. Margin="10,0"
  1791. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1792. FontSize="{DynamicResource Font.Size.Body3}"
  1793. MinWidth="80"
  1794. TextAlignment="Center"
  1795. HorizontalAlignment="Left"
  1796. VerticalAlignment="Center">
  1797. <TextBox.Text>
  1798. <Binding Path="SelectPlc.Name"
  1799. Mode="TwoWay">
  1800. <Binding.ValidationRules>
  1801. <valRules:NameValidationRule />
  1802. </Binding.ValidationRules>
  1803. </Binding>
  1804. </TextBox.Text>
  1805. </TextBox>
  1806. <!--通讯方式-->
  1807. <TextBlock Text="{lex:Loc 通讯方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1808. Grid.Row="2"
  1809. Grid.Column="0"
  1810. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1811. FontSize="{DynamicResource Font.Size.Body3}"
  1812. HorizontalAlignment="Right"
  1813. VerticalAlignment="Center" />
  1814. <ComboBox SelectedItem="{Binding SelectPlc.CommunicationType,Mode=TwoWay}"
  1815. Grid.Row="2"
  1816. Grid.Column="1"
  1817. Margin="10,0"
  1818. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1819. MinWidth="80"
  1820. ItemsSource="{ext:EnumBindingSource EnumType=enums:CommunicationType}"
  1821. FontSize="{DynamicResource Font.Size.Body3}"
  1822. HorizontalContentAlignment="Center"
  1823. HorizontalAlignment="Left"
  1824. VerticalAlignment="Center" />
  1825. <!--Endpoint Url地址-->
  1826. <TextBlock Text="Endpoints Url: "
  1827. Grid.Row="3"
  1828. Grid.Column="0"
  1829. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1830. FontSize="{DynamicResource Font.Size.Body3}"
  1831. HorizontalAlignment="Right"
  1832. VerticalAlignment="Center" />
  1833. <TextBox Grid.Row="3"
  1834. Grid.Column="1"
  1835. Margin="10,0"
  1836. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1837. FontSize="{DynamicResource Font.Size.Body3}"
  1838. MinWidth="80"
  1839. TextAlignment="Center"
  1840. HorizontalAlignment="Left"
  1841. VerticalAlignment="Center"
  1842. Text="{Binding SelectPlc.EndpointUrl}" />
  1843. <!--节点头-->
  1844. <TextBlock Text="{lex:Loc 节点头, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1845. Grid.Row="4"
  1846. Grid.Column="0"
  1847. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1848. FontSize="{DynamicResource Font.Size.Body3}"
  1849. HorizontalAlignment="Right"
  1850. VerticalAlignment="Center" />
  1851. <TextBox Grid.Row="4"
  1852. Grid.Column="1"
  1853. FontSize="{DynamicResource Font.Size.Body3}"
  1854. Margin="10,0"
  1855. MinWidth="80"
  1856. TextAlignment="Center"
  1857. HorizontalAlignment="Left"
  1858. VerticalAlignment="Center"
  1859. Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
  1860. Text="{Binding SelectPlc.NodeHeader,Mode=TwoWay}" />
  1861. </Grid>
  1862. </ScrollViewer>
  1863. </Grid>
  1864. </TabItem>
  1865. <!--光源控制器-->
  1866. <TabItem>
  1867. <TabItem.Header>
  1868. <StackPanel HorizontalAlignment="Stretch">
  1869. <materialDesign:PackIcon Width="24"
  1870. Height="24"
  1871. HorizontalAlignment="Center"
  1872. Kind="TelevisionAmbientLight" />
  1873. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  1874. FontSize="{DynamicResource Font.Size.Body2}"
  1875. Text="{lex:Loc 光源控制器}"
  1876. HorizontalAlignment="Stretch" />
  1877. </StackPanel>
  1878. </TabItem.Header>
  1879. <Grid Margin="16">
  1880. <Grid.RowDefinitions>
  1881. <RowDefinition Height="50" />
  1882. <RowDefinition Height="*" />
  1883. </Grid.RowDefinitions>
  1884. <Grid.ColumnDefinitions>
  1885. <ColumnDefinition Width="auto" />
  1886. <ColumnDefinition Width="*" />
  1887. </Grid.ColumnDefinitions>
  1888. <!--增删改查-->
  1889. <StackPanel Grid.ColumnSpan="2"
  1890. IsEnabled="{Binding IsAllowEdit}"
  1891. Orientation="Horizontal">
  1892. <Button Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1893. ToolTip="{lex:Loc 增加光源控制器}"
  1894. Command="{Binding AddLightControllerCommand}">
  1895. <materialDesign:PackIcon Kind="Plus" />
  1896. </Button>
  1897. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1898. ToolTip="{lex:Loc 移除光源控制器}"
  1899. Margin="20,0"
  1900. Command="{Binding RemoveLightControllerCommand}">
  1901. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1902. </Button>
  1903. <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1904. ToolTip="{lex:Loc 保存}"
  1905. Command="{Binding SaveLightControllersCommand}">
  1906. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1907. </Button>
  1908. </StackPanel>
  1909. <!--控制器列表-->
  1910. <TreeView Grid.Row="1"
  1911. Grid.Column="0"
  1912. SelectedItemChanged="TreeView_SelectedItemChanged">
  1913. <TreeViewItem Header="{lex:Loc 光源控制器列表}"
  1914. FontSize="{DynamicResource Font.Size.Title4}"
  1915. FontWeight="Bold"
  1916. IsExpanded="True"
  1917. ItemsSource="{Binding LightControllerList}">
  1918. <TreeViewItem.ItemTemplate>
  1919. <HierarchicalDataTemplate>
  1920. <StackPanel Orientation="Vertical">
  1921. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  1922. <TextBlock.Text>
  1923. <MultiBinding StringFormat="{}{0}. {1}">
  1924. <Binding Path="Id" />
  1925. <Binding Path="Name" />
  1926. </MultiBinding>
  1927. </TextBlock.Text>
  1928. </TextBlock>
  1929. <StackPanel Orientation="Horizontal">
  1930. <TextBlock Text="{lex:Loc 型号, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1931. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1932. FontSize="{DynamicResource Font.Size.Captions3}"
  1933. Margin="10,0,0,0" />
  1934. <TextBlock Text="{Binding LightModel,Mode=TwoWay}"
  1935. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1936. FontSize="{DynamicResource Font.Size.Captions3}" />
  1937. </StackPanel>
  1938. <StackPanel Orientation="Horizontal">
  1939. <TextBlock Text="{lex:Loc 通道数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1940. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1941. FontSize="{DynamicResource Font.Size.Captions3}"
  1942. Margin="10,0,0,0" />
  1943. <TextBlock Text="{Binding ChannelCount,Mode=TwoWay}"
  1944. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1945. FontSize="{DynamicResource Font.Size.Captions3}" />
  1946. </StackPanel>
  1947. <Border Height="2"
  1948. Margin="0"
  1949. BorderThickness="2"
  1950. BorderBrush="Green" />
  1951. </StackPanel>
  1952. </HierarchicalDataTemplate>
  1953. </TreeViewItem.ItemTemplate>
  1954. </TreeViewItem>
  1955. </TreeView>
  1956. <!--参数详情-->
  1957. <ScrollViewer Grid.Row="1"
  1958. IsEnabled="{Binding IsAllowEdit}"
  1959. Grid.Column="1"
  1960. Margin="20"
  1961. HorizontalAlignment="Left"
  1962. VerticalAlignment="Top"
  1963. Visibility="{Binding SelectLightController,Converter={StaticResource ObjectToVisibilityConverter}}">
  1964. <Grid>
  1965. <Grid.RowDefinitions>
  1966. <RowDefinition Height="Auto" />
  1967. <RowDefinition Height="Auto" />
  1968. <RowDefinition Height="Auto" />
  1969. <RowDefinition Height="Auto" />
  1970. <RowDefinition Height="Auto" />
  1971. <RowDefinition Height="*" />
  1972. </Grid.RowDefinitions>
  1973. <Grid.ColumnDefinitions>
  1974. <ColumnDefinition Width="auto" />
  1975. <ColumnDefinition Width="*"
  1976. MinWidth="200" />
  1977. </Grid.ColumnDefinitions>
  1978. <!-- Id -->
  1979. <TextBlock Text="Id: "
  1980. Grid.Row="0"
  1981. Grid.Column="0"
  1982. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1983. HorizontalAlignment="Right"
  1984. VerticalAlignment="Center" />
  1985. <TextBlock Text="{Binding SelectLightController.Id}"
  1986. Grid.Row="0"
  1987. Grid.Column="1"
  1988. Margin="10,0"
  1989. VerticalAlignment="Center" />
  1990. <!-- Name -->
  1991. <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  1992. Grid.Row="1"
  1993. Grid.Column="0"
  1994. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1995. HorizontalAlignment="Right"
  1996. VerticalAlignment="Center" />
  1997. <TextBox Grid.Row="1"
  1998. Grid.Column="1"
  1999. Margin="10,0"
  2000. Text="{Binding SelectLightController.Name,Mode=TwoWay}" />
  2001. <!-- Model -->
  2002. <TextBlock Text="{lex:Loc 型号, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  2003. Grid.Row="2"
  2004. Grid.Column="0"
  2005. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2006. HorizontalAlignment="Right"
  2007. VerticalAlignment="Center" />
  2008. <ComboBox Grid.Row="2"
  2009. Grid.Column="1"
  2010. Margin="10,0"
  2011. SelectedItem="{Binding SelectLightController.LightModel,Mode=TwoWay}"
  2012. ItemsSource="{ext:EnumBindingSource EnumType=coreLights:LightModel}" />
  2013. <!-- Channel count -->
  2014. <TextBlock Text="{lex:Loc 通道数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  2015. Grid.Row="3"
  2016. Grid.Column="0"
  2017. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2018. HorizontalAlignment="Right"
  2019. VerticalAlignment="Center" />
  2020. <TextBox Grid.Row="3"
  2021. Grid.Column="1"
  2022. Margin="10,0"
  2023. Text="{Binding SelectLightController.ChannelCount,Mode=TwoWay}"
  2024. IsReadOnly="True" />
  2025. <!-- Channel configs list -->
  2026. <TextBlock Text="{lex:Loc 通道配置}"
  2027. Grid.Row="4"
  2028. Grid.Column="0"
  2029. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2030. HorizontalAlignment="Right"
  2031. VerticalAlignment="Top" />
  2032. <ItemsControl Grid.Row="4"
  2033. Grid.Column="1"
  2034. Margin="10,0"
  2035. ItemsSource="{Binding SelectLightController.ChannelConfigs}">
  2036. <ItemsControl.ItemTemplate>
  2037. <DataTemplate>
  2038. <StackPanel Orientation="Horizontal"
  2039. Margin="0,4">
  2040. <TextBlock Text="{Binding LocalIndex}"
  2041. Width="30"
  2042. VerticalAlignment="Center" />
  2043. <TextBox Text="{Binding Name,Mode=TwoWay}"
  2044. Width="180"
  2045. Margin="6,0" />
  2046. <TextBlock Text="亮度:"
  2047. VerticalAlignment="Center"
  2048. Margin="6,0" />
  2049. <TextBox Text="{Binding DefaultBrightness,Mode=TwoWay}"
  2050. Width="80" />
  2051. </StackPanel>
  2052. </DataTemplate>
  2053. </ItemsControl.ItemTemplate>
  2054. </ItemsControl>
  2055. <!-- Serial port config (visible for serial model) -->
  2056. <GroupBox Grid.Row="5"
  2057. Grid.ColumnSpan="2"
  2058. Header="{lex:Loc 串口配置}"
  2059. Margin="0,12,0,0">
  2060. <GroupBox.Style>
  2061. <Style TargetType="GroupBox">
  2062. <Setter Property="Visibility"
  2063. Value="Collapsed" />
  2064. <Style.Triggers>
  2065. <DataTrigger Binding="{Binding SelectLightController.LightModel}"
  2066. Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
  2067. <Setter Property="Visibility"
  2068. Value="Visible" />
  2069. </DataTrigger>
  2070. </Style.Triggers>
  2071. </Style>
  2072. </GroupBox.Style>
  2073. <Grid Margin="10">
  2074. <Grid.ColumnDefinitions>
  2075. <ColumnDefinition Width="auto" />
  2076. <ColumnDefinition Width="*" />
  2077. </Grid.ColumnDefinitions>
  2078. <Grid.RowDefinitions>
  2079. <RowDefinition Height="Auto" />
  2080. <RowDefinition Height="Auto" />
  2081. <RowDefinition Height="Auto" />
  2082. <RowDefinition Height="Auto" />
  2083. <RowDefinition Height="Auto" />
  2084. </Grid.RowDefinitions>
  2085. <TextBlock Text="PortName:"
  2086. Grid.Row="0"
  2087. Grid.Column="0"
  2088. HorizontalAlignment="Right" />
  2089. <TextBox Text="{Binding SelectLightController.SerialPortConfig.PortName,Mode=TwoWay}"
  2090. Grid.Row="0"
  2091. Grid.Column="1"
  2092. Margin="6,0" />
  2093. <TextBlock Text="BaudRate:"
  2094. Grid.Row="1"
  2095. Grid.Column="0"
  2096. HorizontalAlignment="Right" />
  2097. <TextBox Text="{Binding SelectLightController.SerialPortConfig.BaudRate,Mode=TwoWay}"
  2098. Grid.Row="1"
  2099. Grid.Column="1"
  2100. Margin="6,0" />
  2101. <TextBlock Text="Parity:"
  2102. Grid.Row="2"
  2103. Grid.Column="0"
  2104. HorizontalAlignment="Right" />
  2105. <ComboBox Grid.Row="2"
  2106. Grid.Column="1"
  2107. SelectedItem="{Binding SelectLightController.SerialPortConfig.Parity,Mode=TwoWay}"
  2108. ItemsSource="{Binding Source={StaticResource Parity}}" />
  2109. <TextBlock Text="StopBits:"
  2110. Grid.Row="3"
  2111. Grid.Column="0"
  2112. HorizontalAlignment="Right" />
  2113. <ComboBox Grid.Row="3"
  2114. Grid.Column="1"
  2115. SelectedItem="{Binding SelectLightController.SerialPortConfig.StopBits,Mode=TwoWay}"
  2116. ItemsSource="{Binding Source={StaticResource StopBits}}" />
  2117. <TextBlock Text="DataBits:"
  2118. Grid.Row="4"
  2119. Grid.Column="0"
  2120. HorizontalAlignment="Right" />
  2121. <TextBox Text="{Binding SelectLightController.SerialPortConfig.DataBits,Mode=TwoWay}"
  2122. Grid.Row="4"
  2123. Grid.Column="1"
  2124. Margin="6,0" />
  2125. </Grid>
  2126. </GroupBox>
  2127. <!-- TCP config (visible for non-serial models) -->
  2128. <GroupBox Grid.Row="5"
  2129. Grid.ColumnSpan="2"
  2130. Header="{lex:Loc TCP配置}"
  2131. Margin="0,12,0,0">
  2132. <GroupBox.Style>
  2133. <Style TargetType="GroupBox">
  2134. <Setter Property="Visibility"
  2135. Value="Visible" />
  2136. <Style.Triggers>
  2137. <DataTrigger Binding="{Binding SelectLightController.LightModel}"
  2138. Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
  2139. <Setter Property="Visibility"
  2140. Value="Collapsed" />
  2141. </DataTrigger>
  2142. </Style.Triggers>
  2143. </Style>
  2144. </GroupBox.Style>
  2145. <Grid Margin="10">
  2146. <Grid.ColumnDefinitions>
  2147. <ColumnDefinition Width="auto" />
  2148. <ColumnDefinition Width="*" />
  2149. </Grid.ColumnDefinitions>
  2150. <Grid.RowDefinitions>
  2151. <RowDefinition Height="Auto" />
  2152. <RowDefinition Height="Auto" />
  2153. </Grid.RowDefinitions>
  2154. <TextBlock Text="IP:"
  2155. Grid.Row="0"
  2156. Grid.Column="0"
  2157. HorizontalAlignment="Right" />
  2158. <TextBox Text="{Binding SelectLightController.TcpConfig.IP,Mode=TwoWay}"
  2159. Grid.Row="0"
  2160. Grid.Column="1"
  2161. Margin="6,0" />
  2162. <TextBlock Text="Port:"
  2163. Grid.Row="1"
  2164. Grid.Column="0"
  2165. HorizontalAlignment="Right" />
  2166. <TextBox Text="{Binding SelectLightController.TcpConfig.Port,Mode=TwoWay}"
  2167. Grid.Row="1"
  2168. Grid.Column="1"
  2169. Margin="6,0" />
  2170. </Grid>
  2171. </GroupBox>
  2172. </Grid>
  2173. </ScrollViewer>
  2174. </Grid>
  2175. </TabItem>
  2176. <!--通讯-->
  2177. <TabItem>
  2178. <TabItem.Header>
  2179. <StackPanel HorizontalAlignment="Stretch">
  2180. <materialDesign:PackIcon Width="24"
  2181. Height="24"
  2182. HorizontalAlignment="Center"
  2183. Kind="Lan" />
  2184. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2185. FontSize="{DynamicResource Font.Size.Body2}"
  2186. Text="{lex:Loc 通讯}"
  2187. HorizontalAlignment="Stretch" />
  2188. </StackPanel>
  2189. </TabItem.Header>
  2190. <Grid Margin="20"
  2191. IsEnabled="{Binding IsAllowEdit}">
  2192. <Grid.ColumnDefinitions>
  2193. <ColumnDefinition Width="auto" />
  2194. <ColumnDefinition Width="auto" />
  2195. </Grid.ColumnDefinitions>
  2196. <Grid.RowDefinitions>
  2197. <RowDefinition Height="auto" />
  2198. <RowDefinition Height=" auto" />
  2199. </Grid.RowDefinitions>
  2200. <Button Style="{StaticResource MaterialDesignRaisedButton}"
  2201. materialDesign:ButtonAssist.CornerRadius="10"
  2202. Width="60"
  2203. ToolTip="{lex:Loc 保存}"
  2204. HorizontalAlignment="Left"
  2205. Command="{Binding SaveCommunicateCommand}"
  2206. CommandParameter="TCPIP">
  2207. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  2208. </Button>
  2209. <GroupBox Grid.Row="1"
  2210. Header="{lex:Loc 后台TCPIP服务器}"
  2211. FontSize="{DynamicResource Font.Size.Title4}"
  2212. Margin="5,5">
  2213. <Grid Margin="20">
  2214. <Grid.ColumnDefinitions>
  2215. <ColumnDefinition Width="auto" />
  2216. <ColumnDefinition Width="auto" />
  2217. </Grid.ColumnDefinitions>
  2218. <Grid.RowDefinitions>
  2219. <RowDefinition Height="auto" />
  2220. <RowDefinition Height=" auto" />
  2221. <RowDefinition Height=" auto" />
  2222. </Grid.RowDefinitions>
  2223. <!--port-->
  2224. <TextBlock Margin="0,0,0,8"
  2225. Text="Port: "
  2226. VerticalAlignment="Center"
  2227. FontSize="{DynamicResource Font.Size.Body3}"
  2228. HorizontalAlignment="Right" />
  2229. <TextBox Grid.Row="0"
  2230. Grid.Column="1"
  2231. Margin="10,4"
  2232. MinWidth="80"
  2233. FontSize="{DynamicResource Font.Size.Body3}"
  2234. TextAlignment="Center"
  2235. HorizontalAlignment="Left"
  2236. VerticalAlignment="Center">
  2237. <TextBox.Text>
  2238. <Binding Path="BgTcp.Port"
  2239. Mode="TwoWay">
  2240. <Binding.ValidationRules>
  2241. <valRules:PortValidationRule />
  2242. </Binding.ValidationRules>
  2243. </Binding>
  2244. </TextBox.Text>
  2245. </TextBox>
  2246. <!--结束符-->
  2247. <TextBlock Margin="0,0,0,8"
  2248. Grid.Row="1"
  2249. VerticalAlignment="Center"
  2250. Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  2251. FontSize="{DynamicResource Font.Size.Body3}"
  2252. HorizontalAlignment="Right" />
  2253. <ComboBox SelectedItem="{Binding BgTcp.Terminator,Mode=TwoWay}"
  2254. Grid.Row="1"
  2255. Grid.Column="1"
  2256. Margin="10,4"
  2257. MinWidth="80"
  2258. HorizontalContentAlignment="Center"
  2259. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  2260. FontSize="{DynamicResource Font.Size.Body3}"
  2261. HorizontalAlignment="Left"
  2262. VerticalAlignment="Center" />
  2263. <!--编码格式-->
  2264. <TextBlock Text="{lex:Loc 编码解码, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  2265. Grid.Row="2"
  2266. VerticalAlignment="Center"
  2267. Grid.Column="0"
  2268. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2269. FontSize="{DynamicResource Font.Size.Body3}"
  2270. HorizontalAlignment="Right" />
  2271. <ComboBox SelectedItem="{Binding BgTcp.DataEncoding,Mode=TwoWay}"
  2272. Grid.Row="2"
  2273. Grid.Column="1"
  2274. Margin="10,4"
  2275. MinWidth="80"
  2276. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  2277. FontSize="{DynamicResource Font.Size.Body3}"
  2278. HorizontalContentAlignment="Center"
  2279. HorizontalAlignment="Left"
  2280. VerticalAlignment="Center" />
  2281. </Grid>
  2282. </GroupBox>
  2283. <Button Grid.Column="1"
  2284. Style="{StaticResource MaterialDesignRaisedButton}"
  2285. materialDesign:ButtonAssist.CornerRadius="10"
  2286. Width="60"
  2287. ToolTip="{lex:Loc 保存}"
  2288. HorizontalAlignment="Left"
  2289. Command="{Binding SaveCommunicateCommand}"
  2290. CommandParameter="ModbusTCP">
  2291. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  2292. </Button>
  2293. <materialDesign:PopupBox Grid.Column="1"
  2294. HorizontalAlignment="Right"
  2295. VerticalAlignment="Center">
  2296. <StackPanel Orientation="Vertical"
  2297. Margin="10">
  2298. <TextBlock TextWrapping="Wrap"
  2299. TextAlignment="Left"
  2300. Text="功能码 1 ReadCoils 读取DO的状态" />
  2301. <TextBlock TextWrapping="Wrap"
  2302. TextAlignment="Left"
  2303. Text="功能码 2 ReadInputs 读取DI的状态" />
  2304. <TextBlock TextWrapping="Wrap"
  2305. TextAlignment="Left"
  2306. Text="功能码 3 ReadHoldingRegisters 读取AO的值" />
  2307. <TextBlock TextWrapping="Wrap"
  2308. TextAlignment="Left"
  2309. Text="功能码 4 ReadInputRegisters 读取AI的值" />
  2310. <TextBlock TextWrapping="Wrap"
  2311. TextAlignment="Left"
  2312. Text="功能码 5 WriteSingleCoil 写入值到DO" />
  2313. <TextBlock TextWrapping="Wrap"
  2314. TextAlignment="Left"
  2315. Text="功能码 6 WriteSingleRegister 写入值到AO" />
  2316. <TextBlock TextWrapping="Wrap"
  2317. TextAlignment="Left"
  2318. Text="功能码 15 WriteMultipleCoils 写多线圈寄存器" />
  2319. <TextBlock TextWrapping="Wrap"
  2320. TextAlignment="Left"
  2321. Text="功能码 16 WriteMultipleRegisters 写多个保持寄存器" />
  2322. <TextBlock TextWrapping="Wrap"
  2323. TextAlignment="Left"
  2324. Text="功能码 23 ReadWriteMultipleRegisters 读写多个保持寄存器" />
  2325. </StackPanel>
  2326. </materialDesign:PopupBox>
  2327. <GroupBox Grid.Row="1"
  2328. Margin=" 5,5"
  2329. Grid.Column="1"
  2330. Header="{lex:Loc 后台ModbusTCPSlave}"
  2331. FontSize="{DynamicResource Font.Size.Title4}">
  2332. <Grid Margin="20">
  2333. <Grid.ColumnDefinitions>
  2334. <ColumnDefinition Width="auto" />
  2335. <ColumnDefinition Width="auto" />
  2336. </Grid.ColumnDefinitions>
  2337. <Grid.RowDefinitions>
  2338. <RowDefinition Height="auto" />
  2339. <RowDefinition Height=" auto" />
  2340. <RowDefinition Height=" auto" />
  2341. <RowDefinition Height=" auto" />
  2342. </Grid.RowDefinitions>
  2343. <!--IP-->
  2344. <TextBlock Margin="0,0,0,8"
  2345. Text="IP: "
  2346. FontSize="{DynamicResource Font.Size.Body3}"
  2347. VerticalAlignment="Center"
  2348. HorizontalAlignment="Right" />
  2349. <TextBox Grid.Row="0"
  2350. Grid.Column="1"
  2351. Margin="10,4"
  2352. MinWidth="80"
  2353. TextAlignment="Center"
  2354. HorizontalAlignment="Left"
  2355. VerticalAlignment="Center"
  2356. FontSize="{DynamicResource Font.Size.Body3}"
  2357. Text="{Binding BgModbus.IP,Mode=TwoWay}" />
  2358. <!--port-->
  2359. <TextBlock Grid.Row="1"
  2360. Margin="0,0,0,8"
  2361. Text="Port: "
  2362. FontSize="{DynamicResource Font.Size.Body3}"
  2363. VerticalAlignment="Center"
  2364. HorizontalAlignment="Right" />
  2365. <TextBox Grid.Row="1"
  2366. Grid.Column="1"
  2367. Margin="10,4"
  2368. MinWidth="80"
  2369. TextAlignment="Center"
  2370. HorizontalAlignment="Left"
  2371. VerticalAlignment="Center"
  2372. FontSize="{DynamicResource Font.Size.Body3}"
  2373. Text="{Binding BgModbus.Port,Mode=TwoWay}" />
  2374. <!--SlaveID-->
  2375. <TextBlock Grid.Row="2"
  2376. Margin="0,0,0,8"
  2377. VerticalAlignment="Center"
  2378. Text="SlaveID: "
  2379. FontSize="{DynamicResource Font.Size.Body3}"
  2380. HorizontalAlignment="Right" />
  2381. <TextBox Grid.Row="2"
  2382. Grid.Column="1"
  2383. Margin="10,4"
  2384. MinWidth="80"
  2385. TextAlignment="Center"
  2386. HorizontalAlignment="Left"
  2387. VerticalAlignment="Center"
  2388. FontSize="{DynamicResource Font.Size.Body3}"
  2389. Text="{Binding BgModbus.SlaveID,Mode=TwoWay}" />
  2390. <!--是否启用-->
  2391. <TextBlock Margin="0,0,0,8"
  2392. Grid.Row="3"
  2393. Text="{lex:Loc 是否启用, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  2394. FontSize="{DynamicResource Font.Size.Body3}"
  2395. VerticalAlignment="Center"
  2396. HorizontalAlignment="Right" />
  2397. <ToggleButton Grid.Row="3"
  2398. Grid.Column="1"
  2399. Margin="10,4"
  2400. MinWidth="80"
  2401. IsChecked="{Binding BgModbus.IsEnabled,Mode=TwoWay}"
  2402. HorizontalContentAlignment="Center"
  2403. HorizontalAlignment="Left"
  2404. VerticalAlignment="Center" />
  2405. </Grid>
  2406. </GroupBox>
  2407. </Grid>
  2408. </TabItem>
  2409. <!--系统参数-->
  2410. <TabItem>
  2411. <TabItem.Header>
  2412. <StackPanel HorizontalAlignment="Stretch">
  2413. <materialDesign:PackIcon Width="24"
  2414. Height="24"
  2415. HorizontalAlignment="Center"
  2416. Kind="CellphoneSystemUpdate" />
  2417. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2418. FontSize="{DynamicResource Font.Size.Body2}"
  2419. Text="{lex:Loc 系统参数}"
  2420. HorizontalAlignment="Stretch" />
  2421. </StackPanel>
  2422. </TabItem.Header>
  2423. <StackPanel Orientation="Vertical"
  2424. Margin="20">
  2425. <Grid>
  2426. <Grid.ColumnDefinitions>
  2427. <ColumnDefinition Width="auto" />
  2428. <ColumnDefinition Width="200" />
  2429. <ColumnDefinition Width="*" />
  2430. </Grid.ColumnDefinitions>
  2431. <Grid.RowDefinitions>
  2432. <RowDefinition Height="Auto" />
  2433. <RowDefinition Height="Auto" />
  2434. <RowDefinition Height="Auto" />
  2435. <RowDefinition Height="Auto" />
  2436. <RowDefinition Height="Auto" />
  2437. <RowDefinition Height="Auto" />
  2438. <RowDefinition Height="Auto" />
  2439. <RowDefinition Height="Auto" />
  2440. <RowDefinition Height="Auto" />
  2441. <RowDefinition Height="Auto" />
  2442. <RowDefinition Height="40" />
  2443. </Grid.RowDefinitions>
  2444. <!-- 相机拍照次数 -->
  2445. <TextBlock Grid.Row="0"
  2446. Grid.Column="0"
  2447. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2448. VerticalAlignment="Center"
  2449. HorizontalAlignment="Right"
  2450. Margin="0,6,10,6"
  2451. Text="下相机拍照次数:" />
  2452. <mah:NumericUpDown Grid.Row="0"
  2453. Grid.Column="1"
  2454. Margin="0,6"
  2455. Value="{Binding DowmCameraNum,Mode=TwoWay}"
  2456. Minimum="0"
  2457. Maximum="100"
  2458. FontSize="{DynamicResource Font.Size.Body3}" />
  2459. <!-- 上相机取料拍照次数 -->
  2460. <TextBlock Grid.Row="1"
  2461. Grid.Column="0"
  2462. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2463. VerticalAlignment="Center"
  2464. HorizontalAlignment="Right"
  2465. Margin="0,6,10,6"
  2466. Text="上相机取料拍照次数:" />
  2467. <mah:NumericUpDown Grid.Row="1"
  2468. Grid.Column="1"
  2469. Margin="0,6"
  2470. Value="{Binding UpCameraPickNum,Mode=TwoWay}"
  2471. Minimum="0"
  2472. Maximum="100"
  2473. FontSize="{DynamicResource Font.Size.Body3}" />
  2474. <!-- 上相机放料拍照次数 -->
  2475. <TextBlock Grid.Row="2"
  2476. Grid.Column="0"
  2477. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2478. VerticalAlignment="Center"
  2479. HorizontalAlignment="Right"
  2480. Margin="0,6,10,6"
  2481. Text="上相机放料拍照次数:" />
  2482. <mah:NumericUpDown Grid.Row="2"
  2483. Grid.Column="1"
  2484. Margin="0,6"
  2485. Value="{Binding UpCameraPutNum,Mode=TwoWay}"
  2486. Minimum="0"
  2487. Maximum="100"
  2488. FontSize="{DynamicResource Font.Size.Body3}" />
  2489. <!-- 上相机锁附/组装次数 -->
  2490. <TextBlock Grid.Row="3"
  2491. Grid.Column="0"
  2492. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2493. VerticalAlignment="Center"
  2494. HorizontalAlignment="Right"
  2495. Margin="0,6,10,6"
  2496. Text="上相机锁附/组装次数:" />
  2497. <mah:NumericUpDown Grid.Row="3"
  2498. Grid.Column="1"
  2499. Margin="0,6"
  2500. Value="{Binding UPCameracheckNum,Mode=TwoWay}"
  2501. Minimum="0"
  2502. Maximum="100"
  2503. FontSize="{DynamicResource Font.Size.Body3}" />
  2504. <!-- 取料固定位置拍产品相机数量 -->
  2505. <TextBlock Grid.Row="4"
  2506. Grid.Column="0"
  2507. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2508. VerticalAlignment="Center"
  2509. HorizontalAlignment="Right"
  2510. Margin="0,6,10,6"
  2511. Text="取料固定位置拍产品相机数量:" />
  2512. <mah:NumericUpDown Grid.Row="4"
  2513. Grid.Column="1"
  2514. Margin="0,6"
  2515. Value="{Binding FixedCameraPickNum,Mode=TwoWay}"
  2516. Minimum="0"
  2517. Maximum="10"
  2518. FontSize="{DynamicResource Font.Size.Body3}" />
  2519. <!-- 锁附/组装固定位置拍产品相机数量 -->
  2520. <TextBlock Grid.Row="5"
  2521. Grid.Column="0"
  2522. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2523. VerticalAlignment="Center"
  2524. HorizontalAlignment="Right"
  2525. Margin="0,6,10,6"
  2526. Text="锁附/组装固定位置拍产品相机数量:" />
  2527. <mah:NumericUpDown Grid.Row="5"
  2528. Grid.Column="1"
  2529. Margin="0,6"
  2530. Value="{Binding FixedCameraPutNum,Mode=TwoWay}"
  2531. Minimum="0"
  2532. Maximum="10"
  2533. FontSize="{DynamicResource Font.Size.Body3}" />
  2534. <!-- 固定相机检测锁附/组装次数 -->
  2535. <TextBlock Grid.Row="6"
  2536. Grid.Column="0"
  2537. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2538. VerticalAlignment="Center"
  2539. HorizontalAlignment="Right"
  2540. Margin="0,6,10,6"
  2541. Text="固定相机检测锁附/组装次数:" />
  2542. <mah:NumericUpDown Grid.Row="6"
  2543. Grid.Column="1"
  2544. Margin="0,6"
  2545. Value="{Binding FixedCameracheckNum,Mode=TwoWay}"
  2546. Minimum="0"
  2547. Maximum="100"
  2548. FontSize="{DynamicResource Font.Size.Body3}" />
  2549. <!-- 工作模式 -->
  2550. <TextBlock Grid.Row="7"
  2551. Grid.Column="0"
  2552. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2553. VerticalAlignment="Center"
  2554. HorizontalAlignment="Right"
  2555. Margin="0,6,10,6"
  2556. Text="工作模式 :" />
  2557. <mah:NumericUpDown Grid.Row="7"
  2558. Grid.Column="1"
  2559. Margin="0,6"
  2560. Value="{Binding WorkMode,Mode=TwoWay}"
  2561. Minimum="0"
  2562. Maximum="100"
  2563. FontSize="{DynamicResource Font.Size.Body3}" />
  2564. <!-- 取料位置 -->
  2565. <TextBlock Grid.Row="8"
  2566. Grid.Column="0"
  2567. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2568. VerticalAlignment="Center"
  2569. HorizontalAlignment="Right"
  2570. Margin="0,6,10,6"
  2571. Text="显示3D界面:" />
  2572. <mah:NumericUpDown Grid.Row="8"
  2573. Grid.Column="1"
  2574. Margin="0,6"
  2575. Value="{Binding PickPointNum,Mode=TwoWay}"
  2576. Minimum="0"
  2577. Maximum="100"
  2578. FontSize="{DynamicResource Font.Size.Body3}" />
  2579. <CheckBox Grid.Row="9"
  2580. Grid.Column="0"
  2581. IsChecked="{Binding IsSaveScrewCurve,Mode=TwoWay}"
  2582. VerticalAlignment="Center"
  2583. HorizontalAlignment="Right"
  2584. FontSize="{DynamicResource Font.Size.Body3}"
  2585. Margin="0,0,6,0">保存拍照數據CSV</CheckBox>
  2586. <!-- 保存拍照數據CSV -->
  2587. <StackPanel Grid.Row="9"
  2588. Grid.Column="1"
  2589. Grid.ColumnSpan="2"
  2590. Orientation="Horizontal"
  2591. VerticalAlignment="Center"
  2592. IsEnabled="{Binding IsSaveScrewCurve}">
  2593. <TextBox MinWidth="200"
  2594. Text="{Binding ScrewCurvePath,Mode=TwoWay}" />
  2595. <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  2596. Command="{Binding BrowseScrewCurvePathCommand}"
  2597. Margin="6,0">
  2598. <materialDesign:PackIcon Kind="FolderOpen" />
  2599. </Button>
  2600. </StackPanel>
  2601. <!-- 保存按钮 -->
  2602. <StackPanel Grid.Row="10"
  2603. Grid.ColumnSpan="3"
  2604. Orientation="Horizontal"
  2605. HorizontalAlignment="Right"
  2606. VerticalAlignment="Center"
  2607. Margin="0,10,0,0">
  2608. <Button Style="{StaticResource MaterialDesignRaisedButton}"
  2609. materialDesign:ButtonAssist.CornerRadius="10"
  2610. MinWidth="120"
  2611. Command="{Binding SaveSystemParametersCommand}"
  2612. IsEnabled="{Binding IsAllowEdit}">
  2613. <StackPanel Orientation="Horizontal"
  2614. HorizontalAlignment="Center">
  2615. <materialDesign:PackIcon Kind="ContentSaveCheck"
  2616. Margin="0,0,6,0" />
  2617. <TextBlock VerticalAlignment="Center"
  2618. Text="保存系统参数" />
  2619. </StackPanel>
  2620. </Button>
  2621. </StackPanel>
  2622. </Grid>
  2623. <StackPanel Grid.Row="5"
  2624. Margin="0,12,0,0"
  2625. Orientation="Horizontal">
  2626. <!--刷卡参数配置-->
  2627. <GroupBox Header="刷卡器配置"
  2628. Width="300"
  2629. Margin="0,0,50,0"
  2630. HorizontalAlignment="Left">
  2631. <Grid Margin="10">
  2632. <Grid.ColumnDefinitions>
  2633. <ColumnDefinition Width="auto" />
  2634. <ColumnDefinition Width="*" />
  2635. </Grid.ColumnDefinitions>
  2636. <Grid.RowDefinitions>
  2637. <RowDefinition Height="Auto" />
  2638. <RowDefinition Height="Auto" />
  2639. <RowDefinition Height="Auto" />
  2640. <RowDefinition Height="Auto" />
  2641. <RowDefinition Height="Auto" />
  2642. <RowDefinition Height="Auto" />
  2643. </Grid.RowDefinitions>
  2644. <TextBlock Text="PortName:"
  2645. Grid.Row="0"
  2646. Grid.Column="0"
  2647. HorizontalAlignment="Right" />
  2648. <TextBox Text="{Binding CardReaderConfig.PortName,Mode=TwoWay}"
  2649. Grid.Row="0"
  2650. Grid.Column="1"
  2651. Margin="6,0" />
  2652. <TextBlock Text="BaudRate:"
  2653. Grid.Row="1"
  2654. Grid.Column="0"
  2655. HorizontalAlignment="Right" />
  2656. <TextBox Text="{Binding CardReaderConfig.BaudRate,Mode=TwoWay}"
  2657. Grid.Row="1"
  2658. Grid.Column="1"
  2659. Margin="6,0" />
  2660. <TextBlock Text="Parity:"
  2661. Grid.Row="2"
  2662. Grid.Column="0"
  2663. HorizontalAlignment="Right" />
  2664. <ComboBox Grid.Row="2"
  2665. Grid.Column="1"
  2666. SelectedItem="{Binding CardReaderConfig.Parity,Mode=TwoWay}"
  2667. ItemsSource="{Binding Source={StaticResource Parity}}" />
  2668. <TextBlock Text="StopBits:"
  2669. Grid.Row="3"
  2670. Grid.Column="0"
  2671. HorizontalAlignment="Right" />
  2672. <ComboBox Grid.Row="3"
  2673. Grid.Column="1"
  2674. SelectedItem="{Binding CardReaderConfig.StopBits,Mode=TwoWay}"
  2675. ItemsSource="{Binding Source={StaticResource StopBits}}" />
  2676. <TextBlock Text="DataBits:"
  2677. Grid.Row="4"
  2678. Grid.Column="0"
  2679. HorizontalAlignment="Right" />
  2680. <TextBox Text="{Binding CardReaderConfig.DataBits,Mode=TwoWay}"
  2681. Grid.Row="4"
  2682. Grid.Column="1"
  2683. Margin="6,0" />
  2684. <Button Grid.Row="5"
  2685. Grid.Column="1"
  2686. Margin="0,6"
  2687. Style="{StaticResource MaterialDesignRaisedButton}"
  2688. materialDesign:ButtonAssist.CornerRadius="10"
  2689. MinWidth="120"
  2690. Command="{Binding SaveCardReaderConfigCommand}">
  2691. <StackPanel Orientation="Horizontal"
  2692. HorizontalAlignment="Center">
  2693. <materialDesign:PackIcon Kind="ContentSaveCheck"
  2694. Margin="0,0,6,0" />
  2695. <TextBlock VerticalAlignment="Center"
  2696. Text="保存刷卡器配置" />
  2697. </StackPanel>
  2698. </Button>
  2699. </Grid>
  2700. </GroupBox>
  2701. <GroupBox Grid.Row="5"
  2702. Header="{lex:Loc 扫码机配置}"
  2703. HorizontalAlignment="Left"
  2704. MinWidth="200"
  2705. Margin="0,0,20,0">
  2706. <Grid Margin="10">
  2707. <Grid.ColumnDefinitions>
  2708. <ColumnDefinition Width="auto" />
  2709. <ColumnDefinition Width="*" />
  2710. </Grid.ColumnDefinitions>
  2711. <Grid.RowDefinitions>
  2712. <RowDefinition Height="Auto" />
  2713. <RowDefinition Height="Auto" />
  2714. <RowDefinition Height="Auto" />
  2715. <RowDefinition Height="Auto" />
  2716. <RowDefinition Height="Auto" />
  2717. <RowDefinition Height="Auto" />
  2718. </Grid.RowDefinitions>
  2719. <TextBlock Text="PortName:"
  2720. Grid.Row="0"
  2721. Grid.Column="0"
  2722. HorizontalAlignment="Right" />
  2723. <TextBox Text="{Binding ScanConfig.PortName,Mode=TwoWay}"
  2724. Grid.Row="0"
  2725. Grid.Column="1"
  2726. Margin="6,0" />
  2727. <TextBlock Text="BaudRate:"
  2728. Grid.Row="1"
  2729. Grid.Column="0"
  2730. HorizontalAlignment="Right" />
  2731. <TextBox Text="{Binding ScanConfig.BaudRate,Mode=TwoWay}"
  2732. Grid.Row="1"
  2733. Grid.Column="1"
  2734. Margin="6,0" />
  2735. <TextBlock Text="Parity:"
  2736. Grid.Row="2"
  2737. Grid.Column="0"
  2738. HorizontalAlignment="Right" />
  2739. <ComboBox Grid.Row="2"
  2740. Grid.Column="1"
  2741. SelectedItem="{Binding ScanConfig.Parity,Mode=TwoWay}"
  2742. ItemsSource="{Binding Source={StaticResource Parity}}" />
  2743. <TextBlock Text="StopBits:"
  2744. Grid.Row="3"
  2745. Grid.Column="0"
  2746. HorizontalAlignment="Right" />
  2747. <ComboBox Grid.Row="3"
  2748. Grid.Column="1"
  2749. SelectedItem="{Binding ScanConfig.StopBits,Mode=TwoWay}"
  2750. ItemsSource="{Binding Source={StaticResource StopBits}}" />
  2751. <TextBlock Text="DataBits:"
  2752. Grid.Row="4"
  2753. Grid.Column="0"
  2754. HorizontalAlignment="Right" />
  2755. <TextBox Text="{Binding ScanConfig.DataBits,Mode=TwoWay}"
  2756. Grid.Row="4"
  2757. Grid.Column="1"
  2758. Margin="6,0" />
  2759. <!--<Button Grid.Row="5"
  2760. Grid.Column="0"
  2761. Grid.ColumnSpan="2"
  2762. Margin="0,10,0,0"
  2763. Style="{StaticResource MaterialDesignRaisedButton}"
  2764. materialDesign:ButtonAssist.CornerRadius="10"
  2765. MinWidth="120"
  2766. Command="{Binding SaveScanConfigConfigCommand}">
  2767. <StackPanel Orientation="Horizontal"
  2768. HorizontalAlignment="Center">
  2769. <materialDesign:PackIcon Kind="ContentSaveCheck"
  2770. Margin="0,0,6,0" />
  2771. <TextBlock VerticalAlignment="Center"
  2772. Text="保存扫码机配置" />
  2773. </StackPanel>
  2774. </Button>-->
  2775. </Grid>
  2776. </GroupBox>
  2777. </StackPanel>
  2778. </StackPanel>
  2779. </TabItem>
  2780. <!--产品信息-->
  2781. <TabItem>
  2782. <TabItem.Header>
  2783. <StackPanel HorizontalAlignment="Stretch">
  2784. <materialDesign:PackIcon Width="24"
  2785. Height="24"
  2786. HorizontalAlignment="Center"
  2787. Kind="BallotOutline" />
  2788. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2789. FontSize="{DynamicResource Font.Size.Body2}"
  2790. Text="产品信息"
  2791. HorizontalAlignment="Stretch" />
  2792. </StackPanel>
  2793. </TabItem.Header>
  2794. <StackPanel Margin="16">
  2795. <GroupBox HorizontalAlignment="Left"
  2796. Margin="10,5"
  2797. Header="产品与mes参数绑定设置"
  2798. Width="400"
  2799. FontSize="{DynamicResource Font.Size.Title4}">
  2800. <Grid Margin="20">
  2801. <Grid.ColumnDefinitions>
  2802. <ColumnDefinition Width="auto" />
  2803. <ColumnDefinition Width="auto" />
  2804. </Grid.ColumnDefinitions>
  2805. <Grid.RowDefinitions>
  2806. <RowDefinition Height=" auto" />
  2807. <RowDefinition Height=" auto" />
  2808. <RowDefinition Height=" auto" />
  2809. <RowDefinition Height=" auto" />
  2810. <RowDefinition Height=" auto" />
  2811. </Grid.RowDefinitions>
  2812. <TextBlock Margin="0,0,0,8"
  2813. Text="产品名称:"
  2814. VerticalAlignment="Center"
  2815. FontSize="{DynamicResource Font.Size.Body3}"
  2816. HorizontalAlignment="Right" />
  2817. <ComboBox x:Name="selectProduct"
  2818. Grid.Column="1"
  2819. Width="100"
  2820. Margin="10,4"
  2821. FontSize="14"
  2822. materialDesign:HintAssist.Hint="{lex:Loc 选择产品}"
  2823. SelectedItem="{Binding SelectProduct,Mode=TwoWay}"
  2824. ItemsSource="{Binding ProductList,Mode=TwoWay}"
  2825. HorizontalAlignment="Left">
  2826. <ComboBox.ItemTemplate>
  2827. <DataTemplate>
  2828. <StackPanel Orientation="Vertical">
  2829. <StackPanel Orientation="Horizontal">
  2830. <materialDesign:PackIcon Kind="CubeOutline" />
  2831. <TextBlock Text="{Binding Name}" />
  2832. </StackPanel>
  2833. <TextBlock Text="{Binding Description}"
  2834. MinHeight="0"
  2835. MaxWidth="300"
  2836. Foreground="Gray"
  2837. TextTrimming="CharacterEllipsis"
  2838. FontSize="{DynamicResource Font.Size.Captions4}"
  2839. TextWrapping="Wrap" />
  2840. </StackPanel>
  2841. </DataTemplate>
  2842. </ComboBox.ItemTemplate>
  2843. </ComboBox>
  2844. <TextBlock Margin="0,0,0,8"
  2845. Grid.Row="1"
  2846. Text="产品编码(model):"
  2847. VerticalAlignment="Center"
  2848. FontSize="{DynamicResource Font.Size.Body3}"
  2849. HorizontalAlignment="Right" />
  2850. <TextBox Grid.Row="1"
  2851. Grid.Column="1"
  2852. Margin="10,4"
  2853. MinWidth="100"
  2854. FontSize="{DynamicResource Font.Size.Body3}"
  2855. TextAlignment="Center"
  2856. HorizontalAlignment="Left"
  2857. VerticalAlignment="Center">
  2858. <TextBox.Text>
  2859. <Binding Path="ProMesInfo.ProductCode"
  2860. Mode="TwoWay">
  2861. </Binding>
  2862. </TextBox.Text>
  2863. </TextBox>
  2864. <TextBlock Margin="0,0,0,8"
  2865. Grid.Row="2"
  2866. VerticalAlignment="Center"
  2867. Text="产品颜色:"
  2868. FontSize="{DynamicResource Font.Size.Body3}"
  2869. HorizontalAlignment="Right" />
  2870. <TextBox Grid.Row="2"
  2871. Grid.Column="1"
  2872. Margin="10,4"
  2873. MinWidth="100"
  2874. FontSize="{DynamicResource Font.Size.Body3}"
  2875. TextAlignment="Center"
  2876. HorizontalAlignment="Left"
  2877. VerticalAlignment="Center">
  2878. <TextBox.Text>
  2879. <Binding Path="ProMesInfo.ProductColor"
  2880. Mode="TwoWay">
  2881. </Binding>
  2882. </TextBox.Text>
  2883. </TextBox>
  2884. <TextBlock Margin="0,0,0,8"
  2885. Grid.Row="3"
  2886. VerticalAlignment="Center"
  2887. Text="产品类型:"
  2888. FontSize="{DynamicResource Font.Size.Body3}"
  2889. HorizontalAlignment="Right" />
  2890. <TextBox Grid.Row="3"
  2891. Grid.Column="1"
  2892. Margin="10,4"
  2893. MinWidth="100"
  2894. FontSize="{DynamicResource Font.Size.Body3}"
  2895. TextAlignment="Center"
  2896. HorizontalAlignment="Left"
  2897. VerticalAlignment="Center">
  2898. <TextBox.Text>
  2899. <Binding Path="ProMesInfo.ProductLoadMode"
  2900. Mode="TwoWay">
  2901. </Binding>
  2902. </TextBox.Text>
  2903. </TextBox>
  2904. <StackPanel Grid.Row="6"
  2905. Grid.ColumnSpan="2"
  2906. Margin="0,6"
  2907. Orientation="Horizontal"
  2908. HorizontalAlignment="Center">
  2909. <Button Margin="5"
  2910. Style="{StaticResource MaterialDesignRaisedButton}"
  2911. materialDesign:ButtonAssist.CornerRadius="10"
  2912. MinWidth="100"
  2913. Command="{Binding GetProWithMesCommand}">
  2914. <StackPanel Orientation="Horizontal"
  2915. HorizontalAlignment="Center">
  2916. <materialDesign:PackIcon Kind="PuzzleEditOutline"
  2917. Margin="0,0,6,0" />
  2918. <TextBlock VerticalAlignment="Center"
  2919. Text="获取" />
  2920. </StackPanel>
  2921. </Button>
  2922. <Button Margin="5"
  2923. Style="{StaticResource MaterialDesignRaisedButton}"
  2924. materialDesign:ButtonAssist.CornerRadius="10"
  2925. MinWidth="100"
  2926. Command="{Binding DeleteProWithMesCommand}">
  2927. <StackPanel Orientation="Horizontal"
  2928. HorizontalAlignment="Center">
  2929. <materialDesign:PackIcon Kind="DeleteForeverOutline"
  2930. Margin="0,0,6,0" />
  2931. <TextBlock VerticalAlignment="Center"
  2932. Text="删除" />
  2933. </StackPanel>
  2934. </Button>
  2935. <Button Margin="5"
  2936. Style="{StaticResource MaterialDesignRaisedButton}"
  2937. materialDesign:ButtonAssist.CornerRadius="10"
  2938. MinWidth="100"
  2939. Command="{Binding SaveProWithMesCommand}">
  2940. <StackPanel Orientation="Horizontal"
  2941. HorizontalAlignment="Center">
  2942. <materialDesign:PackIcon Kind="ContentSaveCheck"
  2943. Margin="0,0,6,0" />
  2944. <TextBlock VerticalAlignment="Center"
  2945. Text="保存" />
  2946. </StackPanel>
  2947. </Button>
  2948. </StackPanel>
  2949. </Grid>
  2950. </GroupBox>
  2951. </StackPanel>
  2952. </TabItem>
  2953. <!--生产排班-->
  2954. <TabItem>
  2955. <TabItem.Header>
  2956. <StackPanel HorizontalAlignment="Stretch">
  2957. <materialDesign:PackIcon Width="24"
  2958. Height="24"
  2959. HorizontalAlignment="Center"
  2960. Kind="LanConnect" />
  2961. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2962. FontSize="{DynamicResource Font.Size.Body2}"
  2963. Text="{lex:Loc 生产排班}"
  2964. HorizontalAlignment="Stretch" />
  2965. </StackPanel>
  2966. </TabItem.Header>
  2967. <StackPanel Margin="16">
  2968. <TextBlock Margin="0,0,0,8"
  2969. Style="{StaticResource MaterialDesignHeadline5TextBlock}"
  2970. FontSize="{DynamicResource Font.Size.Body3}"
  2971. Text="{lex:Loc 白夜班}" />
  2972. </StackPanel>
  2973. </TabItem>
  2974. <!--字体-->
  2975. <TabItem>
  2976. <TabItem.Header>
  2977. <StackPanel HorizontalAlignment="Stretch">
  2978. <materialDesign:PackIcon Width="24"
  2979. Height="24"
  2980. HorizontalAlignment="Center"
  2981. Kind="FontSize" />
  2982. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  2983. FontSize="{DynamicResource Font.Size.Body2}"
  2984. Text="{lex:Loc 字体}"
  2985. HorizontalAlignment="Stretch" />
  2986. </StackPanel>
  2987. </TabItem.Header>
  2988. <ScrollViewer>
  2989. <Grid Margin="20">
  2990. <Grid.RowDefinitions>
  2991. <RowDefinition Height="auto" />
  2992. <RowDefinition Height="auto" />
  2993. <RowDefinition Height="auto" />
  2994. <RowDefinition Height="auto" />
  2995. <RowDefinition Height="auto" />
  2996. <RowDefinition Height="auto" />
  2997. <RowDefinition Height="auto" />
  2998. <RowDefinition Height="auto" />
  2999. <RowDefinition Height="auto" />
  3000. <RowDefinition Height="auto" />
  3001. <RowDefinition Height="auto" />
  3002. <RowDefinition Height="auto" />
  3003. </Grid.RowDefinitions>
  3004. <Grid.ColumnDefinitions>
  3005. <ColumnDefinition Width="auto" />
  3006. <ColumnDefinition Width="auto" />
  3007. </Grid.ColumnDefinitions>
  3008. <Grid.Resources>
  3009. <Style TargetType="TextBlock">
  3010. <Setter Property="FontSize"
  3011. Value="{DynamicResource Font.Size.Body2}" />
  3012. <Setter Property="VerticalAlignment"
  3013. Value="Center" />
  3014. <Setter Property="HorizontalAlignment"
  3015. Value="Right" />
  3016. </Style>
  3017. <Style TargetType="mah:NumericUpDown">
  3018. <Setter Property="FontSize"
  3019. Value="{DynamicResource Font.Size.Body2}" />
  3020. <Setter Property="Margin"
  3021. Value="5,2" />
  3022. <Setter Property="MinWidth"
  3023. Value="100" />
  3024. <Setter Property="HorizontalContentAlignment"
  3025. Value="Center" />
  3026. <Setter Property="VerticalContentAlignment"
  3027. Value="Center" />
  3028. <Setter Property="Minimum"
  3029. Value="6" />
  3030. <Setter Property="Interval"
  3031. Value="2" />
  3032. <Setter Property="Maximum"
  3033. Value="62" />
  3034. <Setter Property="StringFormat"
  3035. Value="{}{0:N0}" />
  3036. </Style>
  3037. </Grid.Resources>
  3038. <!--1-->
  3039. <TextBlock Grid.Row="0"
  3040. Grid.Column="0"
  3041. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  3042. <mah:NumericUpDown Grid.Row="0"
  3043. Grid.Column="1"
  3044. materialDesign:HintAssist.Hint="Font Size"
  3045. Value="{Binding Title1,Mode=TwoWay}" />
  3046. <!--2-->
  3047. <TextBlock Grid.Row="1"
  3048. Grid.Column="0"
  3049. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  3050. <mah:NumericUpDown Grid.Row="1"
  3051. Grid.Column="1"
  3052. materialDesign:HintAssist.Hint="Font Size"
  3053. Value="{Binding Title2,Mode=TwoWay}" />
  3054. <!--3-->
  3055. <TextBlock Grid.Row="2"
  3056. Grid.Column="0"
  3057. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  3058. <mah:NumericUpDown Grid.Row="2"
  3059. Grid.Column="1"
  3060. materialDesign:HintAssist.Hint="Font Size"
  3061. Value="{Binding Title3,Mode=TwoWay}" />
  3062. <!--4-->
  3063. <TextBlock Grid.Row="3"
  3064. Grid.Column="0"
  3065. Text="{lex:Loc 标题, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  3066. <mah:NumericUpDown Grid.Row="3"
  3067. Grid.Column="1"
  3068. materialDesign:HintAssist.Hint="Font Size"
  3069. Value="{Binding Title4,Mode=TwoWay}" />
  3070. <!--5-->
  3071. <TextBlock Grid.Row="4"
  3072. Grid.Column="0"
  3073. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  3074. <mah:NumericUpDown Grid.Row="4"
  3075. Grid.Column="1"
  3076. materialDesign:HintAssist.Hint="Font Size"
  3077. Value="{Binding Body1,Mode=TwoWay}" />
  3078. <!--6-->
  3079. <TextBlock Grid.Row="5"
  3080. Grid.Column="0"
  3081. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  3082. <mah:NumericUpDown Grid.Row="5"
  3083. Grid.Column="1"
  3084. materialDesign:HintAssist.Hint="Font Size"
  3085. Value="{Binding Body2,Mode=TwoWay}" />
  3086. <!--7-->
  3087. <TextBlock Grid.Row="6"
  3088. Grid.Column="0"
  3089. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  3090. <mah:NumericUpDown Grid.Row="6"
  3091. Grid.Column="1"
  3092. materialDesign:HintAssist.Hint="Font Size"
  3093. Value="{Binding Body3,Mode=TwoWay}" />
  3094. <!--8-->
  3095. <TextBlock Grid.Row="7"
  3096. Grid.Column="0"
  3097. Text="{lex:Loc 正文, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  3098. <mah:NumericUpDown Grid.Row="7"
  3099. Grid.Column="1"
  3100. materialDesign:HintAssist.Hint="Font Size"
  3101. Value="{Binding Body4,Mode=TwoWay}" />
  3102. <!--9-->
  3103. <TextBlock Grid.Row="8"
  3104. Grid.Column="0"
  3105. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}1: '}" />
  3106. <mah:NumericUpDown Grid.Row="8"
  3107. Grid.Column="1"
  3108. materialDesign:HintAssist.Hint="Font Size"
  3109. Value="{Binding Captions1,Mode=TwoWay}" />
  3110. <!--10-->
  3111. <TextBlock Grid.Row="9"
  3112. Grid.Column="0"
  3113. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}2: '}" />
  3114. <mah:NumericUpDown Grid.Row="9"
  3115. Grid.Column="1"
  3116. materialDesign:HintAssist.Hint="Font Size"
  3117. Value="{Binding Captions2,Mode=TwoWay}" />
  3118. <!--11-->
  3119. <TextBlock Grid.Row="10"
  3120. Grid.Column="0"
  3121. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}3: '}" />
  3122. <mah:NumericUpDown Grid.Row="10"
  3123. Grid.Column="1"
  3124. materialDesign:HintAssist.Hint="Font Size"
  3125. Value="{Binding Captions3,Mode=TwoWay}" />
  3126. <!--12-->
  3127. <TextBlock Grid.Row="11"
  3128. Grid.Column="0"
  3129. Text="{lex:Loc 标注, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}4: '}" />
  3130. <mah:NumericUpDown Grid.Row="11"
  3131. Grid.Column="1"
  3132. materialDesign:HintAssist.Hint="Font Size"
  3133. Value="{Binding Captions4,Mode=TwoWay}" />
  3134. </Grid>
  3135. </ScrollViewer>
  3136. </TabItem>
  3137. <!--语言-->
  3138. <TabItem>
  3139. <TabItem.Header>
  3140. <StackPanel HorizontalAlignment="Stretch">
  3141. <materialDesign:PackIcon Width="24"
  3142. Height="24"
  3143. HorizontalAlignment="Center"
  3144. Kind="TranslateVariant" />
  3145. <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
  3146. FontSize="{DynamicResource Font.Size.Body2}"
  3147. Text="{lex:Loc SettingView_Language_Text}"
  3148. HorizontalAlignment="Stretch" />
  3149. </StackPanel>
  3150. </TabItem.Header>
  3151. <StackPanel Margin="20"
  3152. Orientation="Horizontal"
  3153. VerticalAlignment="Top">
  3154. <!--中文简体-->
  3155. <Button MinWidth="100"
  3156. materialDesign:ButtonAssist.CornerRadius="10"
  3157. ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}"
  3158. FontSize="{DynamicResource Font.Size.Body1}"
  3159. Command="{Binding SelectLanguageCommand}"
  3160. CommandParameter="ChineseSimplified">
  3161. <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
  3162. <Button.Style>
  3163. <Style TargetType="Button"
  3164. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  3165. <Setter Property="Foreground"
  3166. Value="#000000" />
  3167. <Style.Triggers>
  3168. <DataTrigger Binding="{Binding CurrentLanguage}"
  3169. Value="{x:Static enums:Language.ChineseSimplified}">
  3170. <Setter Property="Background"
  3171. Value="Green" />
  3172. <Setter Property="BorderBrush"
  3173. Value="Green" />
  3174. </DataTrigger>
  3175. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  3176. Value="{x:Static enums:Language.English}">
  3177. <Setter Property="Background"
  3178. Value="#e4ff54" />
  3179. <Setter Property="BorderBrush"
  3180. Value="#e4ff54" />
  3181. </DataTrigger>-->
  3182. </Style.Triggers>
  3183. </Style>
  3184. </Button.Style>
  3185. </Button>
  3186. <!--中文繁体-->
  3187. <Button MinWidth="100"
  3188. Margin="20.0"
  3189. materialDesign:ButtonAssist.CornerRadius="10"
  3190. ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}"
  3191. FontSize="{DynamicResource Font.Size.Body1}"
  3192. Command="{Binding SelectLanguageCommand}"
  3193. CommandParameter="ChineseTraditional">
  3194. <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
  3195. <Button.Style>
  3196. <Style TargetType="Button"
  3197. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  3198. <Setter Property="Foreground"
  3199. Value="#000000" />
  3200. <Style.Triggers>
  3201. <DataTrigger Binding="{Binding CurrentLanguage}"
  3202. Value="{x:Static enums:Language.ChineseTraditional}">
  3203. <Setter Property="Background"
  3204. Value="Green" />
  3205. <Setter Property="BorderBrush"
  3206. Value="Green" />
  3207. </DataTrigger>
  3208. </Style.Triggers>
  3209. </Style>
  3210. </Button.Style>
  3211. </Button>
  3212. <!--英语-->
  3213. <Button MinWidth="100"
  3214. Margin="20.0"
  3215. materialDesign:ButtonAssist.CornerRadius="10"
  3216. ToolTip="{lex:Loc SettingView_Language_English}"
  3217. FontSize="{DynamicResource Font.Size.Body1}"
  3218. Command="{Binding SelectLanguageCommand}"
  3219. CommandParameter="English">
  3220. <TextBlock Text="{lex:Loc SettingView_Language_English}" />
  3221. <Button.Style>
  3222. <Style TargetType="Button"
  3223. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  3224. <Setter Property="Foreground"
  3225. Value="#000000" />
  3226. <Style.Triggers>
  3227. <DataTrigger Binding="{Binding CurrentLanguage}"
  3228. Value="{x:Static enums:Language.English}">
  3229. <Setter Property="Background"
  3230. Value="Green" />
  3231. <Setter Property="BorderBrush"
  3232. Value="Green" />
  3233. </DataTrigger>
  3234. </Style.Triggers>
  3235. </Style>
  3236. </Button.Style>
  3237. </Button>
  3238. <!--日语-->
  3239. <Button MinWidth="100"
  3240. Margin="20.0"
  3241. materialDesign:ButtonAssist.CornerRadius="10"
  3242. ToolTip="{lex:Loc SettingView_Language_Japanese}"
  3243. FontSize="{DynamicResource Font.Size.Body1}"
  3244. Command="{Binding SelectLanguageCommand}"
  3245. CommandParameter="Japanese">
  3246. <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
  3247. <Button.Style>
  3248. <Style TargetType="Button"
  3249. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  3250. <Setter Property="Foreground"
  3251. Value="#000000" />
  3252. <Style.Triggers>
  3253. <DataTrigger Binding="{Binding CurrentLanguage}"
  3254. Value="{x:Static enums:Language.Japanese}">
  3255. <Setter Property="Background"
  3256. Value="Green" />
  3257. <Setter Property="BorderBrush"
  3258. Value="Green" />
  3259. </DataTrigger>
  3260. </Style.Triggers>
  3261. </Style>
  3262. </Button.Style>
  3263. </Button>
  3264. </StackPanel>
  3265. </TabItem>
  3266. </TabControl>
  3267. </Grid>
  3268. </UserControl>