SettingView.xaml 203 KB

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