SettingView.xaml 231 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018
  1. <UserControl
  2. x:Class="TeamAAS_VP.Views.SettingView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  6. xmlns:c="clr-namespace:TeamAAS_VP.ValueConverter"
  7. xmlns:coreLights="clr-namespace:TeamAAS_VP.Core.Lights"
  8. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  9. xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
  10. xmlns:enums1="clr-namespace:Team.FFFeederService;assembly=Team.FFFeederService"
  11. xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
  12. xmlns:io="clr-namespace:System.IO.Ports;assembly=System"
  13. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  14. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  15. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  16. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  17. xmlns:prism="http://prismlibrary.com/"
  18. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  19. xmlns:sysio="clr-namespace:System.IO.Ports;assembly=System"
  20. xmlns:valRules="clr-namespace:TeamAAS_VP.Identity"
  21. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels"
  22. d:Background="White"
  23. d:DataContext="{d:DesignInstance Type=vm:SettingViewModel}"
  24. d:Height="1080"
  25. d:Width="1024"
  26. lex:LocalizeDictionary.DesignCulture="zh-CN"
  27. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  28. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  29. prism:ViewModelLocator.AutoWireViewModel="True"
  30. FontFamily="{DynamicResource DefaultFont}"
  31. mc:Ignorable="d">
  32. <b:Interaction.Triggers>
  33. <b:EventTrigger EventName="Loaded">
  34. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  35. </b:EventTrigger>
  36. </b:Interaction.Triggers>
  37. <UserControl.Resources>
  38. <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverter" />
  39. <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverterInverse" 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" TargetType="TextBlock">
  43. <Setter Property="TextWrapping" Value="NoWrap" />
  44. <Setter Property="TextTrimming" Value="CharacterEllipsis" />
  45. <Setter Property="HorizontalAlignment" Value="Center" />
  46. <Setter Property="VerticalAlignment" Value="Center" />
  47. </Style>
  48. <ObjectDataProvider
  49. x:Key="Parity"
  50. MethodName="GetValues"
  51. ObjectType="{x:Type sys:Enum}">
  52. <ObjectDataProvider.MethodParameters>
  53. <x:Type TypeName="sysio:Parity" />
  54. </ObjectDataProvider.MethodParameters>
  55. </ObjectDataProvider>
  56. <ObjectDataProvider
  57. x:Key="StopBits"
  58. MethodName="GetValues"
  59. ObjectType="{x:Type sys:Enum}">
  60. <ObjectDataProvider.MethodParameters>
  61. <x:Type TypeName="sysio:StopBits" />
  62. </ObjectDataProvider.MethodParameters>
  63. </ObjectDataProvider>
  64. </UserControl.Resources>
  65. <Grid>
  66. <TabControl
  67. materialDesign:NavigationRailAssist.ShowSelectionBackground="True"
  68. SnapsToDevicePixels="True"
  69. Style="{StaticResource MaterialDesignNavigationRailTabControl}"
  70. TabStripPlacement="Left">
  71. <materialDesign:NavigationRailAssist.FloatingContent>
  72. <Button
  73. Margin="8"
  74. Content="{materialDesign:PackIcon Kind=OfficeBuildingCogOutline}"
  75. Style="{StaticResource MaterialDesignFloatingActionSecondaryButton}" />
  76. </materialDesign:NavigationRailAssist.FloatingContent>
  77. <!-- 相机配置 -->
  78. <TabItem Margin="5,0">
  79. <TabItem.Header>
  80. <StackPanel HorizontalAlignment="Stretch">
  81. <materialDesign:PackIcon
  82. Width="24"
  83. Height="24"
  84. HorizontalAlignment="Center"
  85. Kind="CameraPlusOutline" />
  86. <TextBlock
  87. HorizontalAlignment="Stretch"
  88. FontSize="{DynamicResource Font.Size.Body2}"
  89. Style="{StaticResource TabHeaderTextBlockStyle}"
  90. Text="{lex:Loc SettingView_Camera_Text}" />
  91. </StackPanel>
  92. </TabItem.Header>
  93. <Grid Margin="16">
  94. <Grid.RowDefinitions>
  95. <RowDefinition Height="50" />
  96. <RowDefinition Height="*" />
  97. </Grid.RowDefinitions>
  98. <Grid.ColumnDefinitions>
  99. <ColumnDefinition Width="auto" />
  100. <ColumnDefinition Width="*" />
  101. </Grid.ColumnDefinitions>
  102. <!-- 增删改查 -->
  103. <StackPanel
  104. Grid.ColumnSpan="2"
  105. IsEnabled="{Binding IsAllowEdit}"
  106. Orientation="Horizontal">
  107. <Button
  108. Command="{Binding AddCameraCommand}"
  109. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  110. ToolTip="{lex:Loc SettingView_Camera_btnAddCamera}">
  111. <materialDesign:PackIcon Kind="Plus" />
  112. </Button>
  113. <Button
  114. Margin="20,0"
  115. Command="{Binding EditCameraCommand}"
  116. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  117. ToolTip="{lex:Loc SettingView_Camera_btnEditCamera}">
  118. <materialDesign:PackIcon Kind="PuzzleEditOutline" />
  119. </Button>
  120. <Button
  121. Command="{Binding RemoveCameraCommand}"
  122. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  123. ToolTip="{lex:Loc SettingView_Camera_btnRemoveCamera}">
  124. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  125. </Button>
  126. <Button
  127. Margin="20,0"
  128. Command="{Binding SaveCamerasCommand}"
  129. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  130. ToolTip="{lex:Loc 保存}">
  131. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  132. </Button>
  133. </StackPanel>
  134. <!-- 相机列表 -->
  135. <TreeView
  136. Grid.Row="1"
  137. Grid.Column="0"
  138. SelectedItemChanged="TreeView_SelectedItemChanged">
  139. <TreeViewItem
  140. FontSize="{DynamicResource Font.Size.Title4}"
  141. FontWeight="Bold"
  142. Header="{lex:Loc SettingView_Camera_CameraList}"
  143. IsExpanded="True"
  144. ItemsSource="{Binding CameraList}">
  145. <TreeViewItem.ItemTemplate>
  146. <HierarchicalDataTemplate>
  147. <StackPanel Orientation="Vertical">
  148. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  149. <TextBlock.Text>
  150. <MultiBinding StringFormat="{}{0}. {1}">
  151. <Binding Path="CameraNo" />
  152. <Binding Path="CameraName" />
  153. </MultiBinding>
  154. </TextBlock.Text>
  155. </TextBlock>
  156. <StackPanel Orientation="Horizontal">
  157. <TextBlock
  158. FontSize="{DynamicResource Font.Size.Body3}"
  159. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  160. Text="{lex:Loc 品牌,
  161. Converter={StaticResource StringFormatConverter},
  162. ConverterParameter='{}{0}: '}" />
  163. <TextBlock
  164. FontSize="{DynamicResource Font.Size.Body3}"
  165. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  166. Text="{Binding CameraBrand}" />
  167. <TextBlock
  168. FontSize="{DynamicResource Font.Size.Body3}"
  169. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  170. Text="-" />
  171. <TextBlock
  172. FontSize="{DynamicResource Font.Size.Body3}"
  173. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  174. Text="{Binding ManufacturerName}" />
  175. </StackPanel>
  176. <StackPanel Orientation="Horizontal">
  177. <TextBlock
  178. FontSize="{DynamicResource Font.Size.Body3}"
  179. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  180. Text="{lex:Loc 型号,
  181. Converter={StaticResource StringFormatConverter},
  182. ConverterParameter='{}{0}: '}" />
  183. <TextBlock
  184. FontSize="{DynamicResource Font.Size.Body3}"
  185. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  186. Text="{Binding Model, Mode=TwoWay}" />
  187. <TextBlock
  188. Margin="10,0,0,0"
  189. FontSize="{DynamicResource Font.Size.Body3}"
  190. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  191. Text="{lex:Loc 序列号,
  192. Converter={StaticResource StringFormatConverter},
  193. ConverterParameter='{}{0}: '}" />
  194. <TextBlock
  195. FontSize="{DynamicResource Font.Size.Body3}"
  196. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  197. Text="{Binding SerialNumber, Mode=TwoWay}" />
  198. </StackPanel>
  199. <StackPanel Orientation="Horizontal">
  200. <TextBlock
  201. FontSize="{DynamicResource Font.Size.Body3}"
  202. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  203. Text="{lex:Loc 类型,
  204. Converter={StaticResource StringFormatConverter},
  205. ConverterParameter='{}{0}: '}" />
  206. <TextBlock
  207. FontSize="{DynamicResource Font.Size.Body3}"
  208. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  209. Text="{Binding CameraType}" />
  210. <TextBlock
  211. Margin="10,0,0,0"
  212. FontSize="{DynamicResource Font.Size.Body3}"
  213. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  214. Text="IP: " />
  215. <TextBlock
  216. FontSize="{DynamicResource Font.Size.Body3}"
  217. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  218. Text="{Binding CameraIp}" />
  219. </StackPanel>
  220. <Border
  221. Height="2"
  222. Margin="0"
  223. BorderBrush="Green"
  224. BorderThickness="2" />
  225. </StackPanel>
  226. </HierarchicalDataTemplate>
  227. </TreeViewItem.ItemTemplate>
  228. </TreeViewItem>
  229. </TreeView>
  230. </Grid>
  231. </TabItem>
  232. <!-- 设备信息 -->
  233. <TabItem>
  234. <TabItem.Header>
  235. <StackPanel HorizontalAlignment="Stretch">
  236. <materialDesign:PackIcon
  237. Width="24"
  238. Height="24"
  239. HorizontalAlignment="Center"
  240. Kind="RouterNetwork" />
  241. <TextBlock
  242. HorizontalAlignment="Stretch"
  243. FontSize="{DynamicResource Font.Size.Body2}"
  244. Style="{StaticResource TabHeaderTextBlockStyle}"
  245. Text="设备信息" />
  246. </StackPanel>
  247. </TabItem.Header>
  248. <Grid Margin="16">
  249. <Grid.RowDefinitions>
  250. <RowDefinition Height="50" />
  251. <RowDefinition Height="*" />
  252. </Grid.RowDefinitions>
  253. <Grid.ColumnDefinitions>
  254. <ColumnDefinition Width="auto" />
  255. <ColumnDefinition Width="*" />
  256. </Grid.ColumnDefinitions>
  257. <!-- 增删改查按钮 -->
  258. <StackPanel
  259. Grid.ColumnSpan="2"
  260. IsEnabled="{Binding IsAllowEdit}"
  261. Orientation="Horizontal">
  262. <Button
  263. Command="{Binding AddDeviceInfoCommand}"
  264. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  265. ToolTip="添加设备">
  266. <materialDesign:PackIcon Kind="Plus" />
  267. </Button>
  268. <Button
  269. Margin="20,0"
  270. Command="{Binding RemoveDeviceInfoCommand}"
  271. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  272. ToolTip="删除设备">
  273. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  274. </Button>
  275. <Button
  276. Command="{Binding SaveDeviceInfoCommand}"
  277. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  278. ToolTip="{lex:Loc 保存}">
  279. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  280. </Button>
  281. </StackPanel>
  282. <!-- 设备列表 -->
  283. <TreeView
  284. Grid.Row="1"
  285. Grid.Column="0"
  286. SelectedItemChanged="TreeView_SelectedItemChanged">
  287. <TreeViewItem
  288. FontSize="{DynamicResource Font.Size.Title4}"
  289. FontWeight="Bold"
  290. Header="设备列表"
  291. IsExpanded="True"
  292. ItemsSource="{Binding DeviceInfoList}">
  293. <TreeViewItem.ItemTemplate>
  294. <HierarchicalDataTemplate>
  295. <StackPanel Orientation="Vertical">
  296. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  297. <TextBlock.Text>
  298. <MultiBinding StringFormat="设备 {0}">
  299. <Binding Path="DeviceNo" />
  300. </MultiBinding>
  301. </TextBlock.Text>
  302. </TextBlock>
  303. <StackPanel Orientation="Horizontal">
  304. <TextBlock
  305. FontSize="{DynamicResource Font.Size.Body3}"
  306. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  307. Text="DeviceName: " />
  308. <TextBlock
  309. FontSize="{DynamicResource Font.Size.Body3}"
  310. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  311. Text="{Binding DeviceName}" />
  312. </StackPanel>
  313. <StackPanel Orientation="Horizontal">
  314. <TextBlock
  315. FontSize="{DynamicResource Font.Size.Body3}"
  316. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  317. Text="Line: " />
  318. <TextBlock
  319. FontSize="{DynamicResource Font.Size.Body3}"
  320. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  321. Text="{Binding Line}" />
  322. </StackPanel>
  323. <StackPanel Orientation="Horizontal">
  324. <TextBlock
  325. FontSize="{DynamicResource Font.Size.Body3}"
  326. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  327. Text="Station: " />
  328. <TextBlock
  329. FontSize="{DynamicResource Font.Size.Body3}"
  330. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  331. Text="{Binding Station}" />
  332. </StackPanel>
  333. <Border
  334. Height="2"
  335. Margin="0"
  336. BorderBrush="Green"
  337. BorderThickness="2" />
  338. </StackPanel>
  339. </HierarchicalDataTemplate>
  340. </TreeViewItem.ItemTemplate>
  341. </TreeViewItem>
  342. </TreeView>
  343. <!-- 参数详情 -->
  344. <ScrollViewer
  345. Grid.Row="1"
  346. Grid.Column="1"
  347. Margin="20"
  348. IsEnabled="{Binding IsAllowEdit}"
  349. Visibility="{Binding SelectDeviceInfo, Converter={StaticResource ObjectToVisibilityConverter}}">
  350. <Grid>
  351. <Grid.RowDefinitions>
  352. <RowDefinition Height="auto" />
  353. <RowDefinition Height="auto" />
  354. </Grid.RowDefinitions>
  355. <!-- 设备信息表单 -->
  356. <Grid>
  357. <Grid.RowDefinitions>
  358. <RowDefinition Height="Auto" />
  359. <RowDefinition Height="Auto" />
  360. <RowDefinition Height="Auto" />
  361. <RowDefinition Height="Auto" />
  362. <RowDefinition Height="Auto" />
  363. <RowDefinition Height="Auto" />
  364. <RowDefinition Height="Auto" />
  365. <RowDefinition Height="Auto" />
  366. <RowDefinition Height="Auto" />
  367. <RowDefinition Height="Auto" />
  368. <RowDefinition Height="Auto" />
  369. <RowDefinition Height="Auto" />
  370. <RowDefinition Height="Auto" />
  371. <RowDefinition Height="Auto" />
  372. <RowDefinition Height="Auto" />
  373. <RowDefinition Height="Auto" />
  374. <RowDefinition Height="Auto" />
  375. <RowDefinition Height="Auto" />
  376. <RowDefinition Height="Auto" />
  377. <RowDefinition Height="Auto" />
  378. <RowDefinition Height="Auto" />
  379. <RowDefinition Height="Auto" />
  380. <RowDefinition Height="Auto" />
  381. <RowDefinition Height="Auto" />
  382. <RowDefinition Height="Auto" />
  383. <RowDefinition Height="Auto" />
  384. <RowDefinition Height="Auto" />
  385. <RowDefinition Height="Auto" />
  386. <RowDefinition Height="Auto" />
  387. <RowDefinition Height="Auto" />
  388. </Grid.RowDefinitions>
  389. <Grid.ColumnDefinitions>
  390. <ColumnDefinition Width="auto" />
  391. <ColumnDefinition Width="*" />
  392. </Grid.ColumnDefinitions>
  393. <TextBlock
  394. Grid.Row="0"
  395. Grid.Column="0"
  396. HorizontalAlignment="Right"
  397. VerticalAlignment="Center"
  398. Text="设备编号:" />
  399. <TextBlock
  400. Grid.Row="0"
  401. Grid.Column="1"
  402. Margin="6,2"
  403. VerticalAlignment="Center"
  404. Text="{Binding SelectDeviceInfo.DeviceNo}" />
  405. <TextBlock
  406. Grid.Row="1"
  407. Grid.Column="0"
  408. HorizontalAlignment="Right"
  409. VerticalAlignment="Center"
  410. Text="设备名称:" />
  411. <TextBox
  412. Grid.Row="1"
  413. Grid.Column="1"
  414. Margin="6,2"
  415. Text="{Binding SelectDeviceInfo.DeviceName, Mode=TwoWay}" />
  416. <TextBlock
  417. Grid.Row="2"
  418. Grid.Column="0"
  419. HorizontalAlignment="Right"
  420. VerticalAlignment="Center"
  421. Text="设备描述:" />
  422. <TextBox
  423. Grid.Row="2"
  424. Grid.Column="1"
  425. Margin="6,2"
  426. Text="{Binding SelectDeviceInfo.DeviceDesc, Mode=TwoWay}" />
  427. <TextBlock
  428. Grid.Row="3"
  429. Grid.Column="0"
  430. HorizontalAlignment="Right"
  431. VerticalAlignment="Center"
  432. Text="Url:" />
  433. <TextBox
  434. Grid.Row="3"
  435. Grid.Column="1"
  436. Margin="6,2"
  437. Text="{Binding SelectDeviceInfo.MesUrl, Mode=TwoWay}" />
  438. <TextBlock
  439. Grid.Row="4"
  440. Grid.Column="0"
  441. HorizontalAlignment="Right"
  442. VerticalAlignment="Center"
  443. Text="Line:" />
  444. <TextBox
  445. Grid.Row="4"
  446. Grid.Column="1"
  447. Margin="6,2"
  448. Text="{Binding SelectDeviceInfo.Line, Mode=TwoWay}" />
  449. <TextBlock
  450. Grid.Row="5"
  451. Grid.Column="0"
  452. HorizontalAlignment="Right"
  453. VerticalAlignment="Center"
  454. Text="Station:" />
  455. <TextBox
  456. Grid.Row="5"
  457. Grid.Column="1"
  458. Margin="6,2"
  459. Text="{Binding SelectDeviceInfo.Station, Mode=TwoWay}" />
  460. <TextBlock
  461. Grid.Row="6"
  462. Grid.Column="0"
  463. HorizontalAlignment="Right"
  464. VerticalAlignment="Center"
  465. Text="FixtureId:" />
  466. <TextBox
  467. Grid.Row="6"
  468. Grid.Column="1"
  469. Margin="6,2"
  470. Text="{Binding SelectDeviceInfo.FixtureId, Mode=TwoWay}" />
  471. <TextBlock
  472. Grid.Row="7"
  473. Grid.Column="0"
  474. HorizontalAlignment="Right"
  475. VerticalAlignment="Center"
  476. Text="f:" />
  477. <TextBox
  478. Grid.Row="7"
  479. Grid.Column="1"
  480. Margin="6,2"
  481. Text="{Binding SelectDeviceInfo.F, Mode=TwoWay}" />
  482. <TextBlock
  483. Grid.Row="8"
  484. Grid.Column="0"
  485. HorizontalAlignment="Right"
  486. VerticalAlignment="Center"
  487. Text="comp:" />
  488. <TextBox
  489. Grid.Row="8"
  490. Grid.Column="1"
  491. Margin="6,2"
  492. Text="{Binding SelectDeviceInfo.comp, Mode=TwoWay}" />
  493. <TextBlock
  494. Grid.Row="9"
  495. Grid.Column="0"
  496. HorizontalAlignment="Right"
  497. VerticalAlignment="Center"
  498. Text="LogUrl:" />
  499. <TextBox
  500. Grid.Row="9"
  501. Grid.Column="1"
  502. Margin="6,2"
  503. Text="{Binding SelectDeviceInfo.LogUrl, Mode=TwoWay}" />
  504. <TextBlock
  505. Grid.Row="10"
  506. Grid.Column="0"
  507. HorizontalAlignment="Right"
  508. VerticalAlignment="Center"
  509. Text="apikey:" />
  510. <TextBox
  511. Grid.Row="10"
  512. Grid.Column="1"
  513. Margin="6,2"
  514. Text="{Binding SelectDeviceInfo.ApiKey, Mode=TwoWay}" />
  515. <StackPanel
  516. Grid.Row="11"
  517. Grid.Column="1"
  518. Orientation="Horizontal">
  519. <CheckBox
  520. Grid.Row="11"
  521. Grid.Column="1"
  522. Margin="6,2"
  523. Command="{Binding CheckStatusCommand}"
  524. Content="启用 MES"
  525. IsChecked="{Binding SelectDeviceInfo.EnableMES, Mode=TwoWay}" />
  526. <!--<CheckBox Grid.Row="10"
  527. Grid.Column="1"
  528. Content="是否启用两次产品编号"
  529. IsChecked="{Binding SelectDeviceInfo.EnableDoubleMes, Mode=TwoWay}"
  530. Margin="6,2" />-->
  531. <CheckBox
  532. Grid.Row="11"
  533. Grid.Column="1"
  534. Margin="6,2"
  535. Command="{Binding CheckStatusCommand}"
  536. Content="是否启用锁螺丝XY超限"
  537. IsChecked="{Binding SelectDeviceInfo.EnableXY, Mode=TwoWay}" />
  538. </StackPanel>
  539. <StackPanel
  540. Grid.Row="13"
  541. Grid.Column="1"
  542. Orientation="Horizontal">
  543. <CheckBox
  544. Margin="6,2"
  545. Command="{Binding CheckStatusCommand}"
  546. Content="是否保存CSV文件"
  547. IsChecked="{Binding SelectDeviceInfo.SaveCsv, Mode=TwoWay}" />
  548. <CheckBox
  549. Margin="6,2"
  550. Content="是否保存ppid"
  551. IsChecked="{Binding SelectDeviceInfo.SaveCsvPPID, Mode=TwoWay}" />
  552. </StackPanel>
  553. <TextBlock
  554. Grid.Row="14"
  555. Grid.Column="0"
  556. HorizontalAlignment="Right"
  557. VerticalAlignment="Center"
  558. Text="保存的CSV文件路径:" />
  559. <DockPanel
  560. Grid.Row="14"
  561. Grid.Column="1"
  562. Margin="6,2"
  563. HorizontalAlignment="Stretch">
  564. <Button
  565. HorizontalAlignment="Right"
  566. Command="{Binding SelectSaveImagePathCommand}"
  567. DockPanel.Dock="Right"
  568. ToolTip="{lex:Loc 选择路径}">
  569. <Button.Content>
  570. <materialDesign:PackIcon Kind="FolderOpenOutline" />
  571. </Button.Content>
  572. </Button>
  573. <TextBox Text="{Binding SelectDeviceInfo.SaveCsvPath, Mode=TwoWay}" />
  574. </DockPanel>
  575. <!-- CTQ 数据信息 -->
  576. <TextBlock
  577. Grid.Row="15"
  578. Grid.Column="0"
  579. HorizontalAlignment="Right"
  580. VerticalAlignment="Center"
  581. Text="PROCESS_NAME:" />
  582. <TextBox
  583. Grid.Row="15"
  584. Grid.Column="1"
  585. Margin="6,2"
  586. Text="{Binding SelectDeviceInfo.DataInfo.PROCESS_NAME, Mode=TwoWay}" />
  587. <TextBlock
  588. Grid.Row="16"
  589. Grid.Column="0"
  590. HorizontalAlignment="Right"
  591. VerticalAlignment="Center"
  592. Text="CTQ_LSL(压力下限):" />
  593. <TextBox
  594. Grid.Row="16"
  595. Grid.Column="1"
  596. Margin="6,2"
  597. Text="{Binding SelectDeviceInfo.DataInfo.CTQ_LSL_Pressure, Mode=TwoWay}" />
  598. <TextBlock
  599. Grid.Row="17"
  600. Grid.Column="0"
  601. HorizontalAlignment="Right"
  602. VerticalAlignment="Center"
  603. Text="CTQ_USL(压力上限):" />
  604. <TextBox
  605. Grid.Row="17"
  606. Grid.Column="1"
  607. Margin="6,2"
  608. Text="{Binding SelectDeviceInfo.DataInfo.CTQ_USL_Pressure, Mode=TwoWay}" />
  609. <TextBlock
  610. Grid.Row="18"
  611. Grid.Column="0"
  612. HorizontalAlignment="Right"
  613. VerticalAlignment="Center"
  614. Text="SUPPLIER_NAME:" />
  615. <TextBox
  616. Grid.Row="18"
  617. Grid.Column="1"
  618. Margin="6,2"
  619. Text="{Binding SelectDeviceInfo.DataInfo.SUPPLIER_NAME, Mode=TwoWay}" />
  620. <TextBlock
  621. Grid.Row="19"
  622. Grid.Column="0"
  623. HorizontalAlignment="Right"
  624. VerticalAlignment="Center"
  625. Text="COMMODITY_TYPE:" />
  626. <TextBox
  627. Grid.Row="19"
  628. Grid.Column="1"
  629. Margin="6,2"
  630. Text="{Binding SelectDeviceInfo.DataInfo.COMMODITY_TYPE, Mode=TwoWay}" />
  631. <TextBlock
  632. Grid.Row="20"
  633. Grid.Column="0"
  634. HorizontalAlignment="Right"
  635. VerticalAlignment="Center"
  636. Text="REVISION:" />
  637. <TextBox
  638. Grid.Row="20"
  639. Grid.Column="1"
  640. Margin="6,2"
  641. Text="{Binding SelectDeviceInfo.DataInfo.REVISION, Mode=TwoWay}" />
  642. <TextBlock
  643. Grid.Row="21"
  644. Grid.Column="0"
  645. HorizontalAlignment="Right"
  646. VerticalAlignment="Center"
  647. Text="MFG_LOT#:" />
  648. <TextBox
  649. Grid.Row="21"
  650. Grid.Column="1"
  651. Margin="6,2"
  652. Text="{Binding SelectDeviceInfo.DataInfo.MFG_LOT, Mode=TwoWay}" />
  653. <TextBlock
  654. Grid.Row="22"
  655. Grid.Column="0"
  656. HorizontalAlignment="Right"
  657. VerticalAlignment="Center"
  658. Text="MFG_ASSY_LINE:" />
  659. <TextBox
  660. Grid.Row="22"
  661. Grid.Column="1"
  662. Margin="6,2"
  663. Text="{Binding SelectDeviceInfo.DataInfo.MFG_ASSY_LINE, Mode=TwoWay}" />
  664. <TextBlock
  665. Grid.Row="23"
  666. Grid.Column="0"
  667. HorizontalAlignment="Right"
  668. VerticalAlignment="Center"
  669. Text="PROCESS_MACHINE_ID:" />
  670. <TextBox
  671. Grid.Row="23"
  672. Grid.Column="1"
  673. Margin="6,2"
  674. Text="{Binding SelectDeviceInfo.DataInfo.PROCESS_MACHINE_ID, Mode=TwoWay}" />
  675. <TextBlock
  676. Grid.Row="24"
  677. Grid.Column="0"
  678. HorizontalAlignment="Right"
  679. VerticalAlignment="Center"
  680. Text="螺丝型号1:" />
  681. <TextBox
  682. Grid.Row="24"
  683. Grid.Column="1"
  684. Margin="6,2"
  685. Text="{Binding SelectDeviceInfo.DataInfo.Screwsize1, Mode=TwoWay}" />
  686. <TextBlock
  687. Grid.Row="25"
  688. Grid.Column="0"
  689. HorizontalAlignment="Right"
  690. VerticalAlignment="Center"
  691. Text="螺丝型号2:" />
  692. <TextBox
  693. Grid.Row="25"
  694. Grid.Column="1"
  695. Margin="6,2"
  696. Text="{Binding SelectDeviceInfo.DataInfo.Screwsize2, Mode=TwoWay}" />
  697. <TextBlock
  698. Grid.Row="26"
  699. Grid.Column="0"
  700. HorizontalAlignment="Right"
  701. VerticalAlignment="Center"
  702. Text="螺丝型号3:" />
  703. <TextBox
  704. Grid.Row="26"
  705. Grid.Column="1"
  706. Margin="6,2"
  707. Text="{Binding SelectDeviceInfo.DataInfo.Screwsize3, Mode=TwoWay}" />
  708. </Grid>
  709. </Grid>
  710. </ScrollViewer>
  711. </Grid>
  712. </TabItem>
  713. <!-- 机器人 -->
  714. <TabItem>
  715. <TabItem.Header>
  716. <StackPanel HorizontalAlignment="Stretch">
  717. <materialDesign:PackIcon
  718. Width="24"
  719. Height="24"
  720. HorizontalAlignment="Center"
  721. Kind="RobotIndustrialOutline" />
  722. <TextBlock
  723. HorizontalAlignment="Stretch"
  724. FontSize="{DynamicResource Font.Size.Body2}"
  725. Style="{StaticResource TabHeaderTextBlockStyle}"
  726. Text="{lex:Loc 机器人}" />
  727. </StackPanel>
  728. </TabItem.Header>
  729. <Grid Margin="16">
  730. <Grid.RowDefinitions>
  731. <RowDefinition Height="50" />
  732. <RowDefinition Height="*" />
  733. </Grid.RowDefinitions>
  734. <Grid.ColumnDefinitions>
  735. <ColumnDefinition Width="auto" />
  736. <ColumnDefinition Width="*" />
  737. </Grid.ColumnDefinitions>
  738. <!-- 增删改查 -->
  739. <StackPanel
  740. Grid.ColumnSpan="2"
  741. IsEnabled="{Binding IsAllowEdit}"
  742. Orientation="Horizontal">
  743. <Button
  744. Command="{Binding AddRobotCommand}"
  745. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  746. ToolTip="{lex:Loc 增加机器人}">
  747. <materialDesign:PackIcon Kind="Plus" />
  748. </Button>
  749. <Button
  750. Margin="20,0"
  751. Command="{Binding RemoveCommand}"
  752. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  753. ToolTip="{lex:Loc 移除机器人}">
  754. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  755. </Button>
  756. <Button
  757. Command="{Binding SaveRobotsCommand}"
  758. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  759. ToolTip="{lex:Loc 保存}">
  760. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  761. </Button>
  762. </StackPanel>
  763. <!-- 机器人列表 -->
  764. <TreeView
  765. Grid.Row="1"
  766. Grid.Column="0"
  767. SelectedItemChanged="TreeView_SelectedItemChanged">
  768. <TreeViewItem
  769. FontSize="{DynamicResource Font.Size.Title4}"
  770. FontWeight="Bold"
  771. Header="{lex:Loc 机器人列表}"
  772. IsExpanded="True"
  773. ItemsSource="{Binding RobotList}">
  774. <TreeViewItem.ItemTemplate>
  775. <HierarchicalDataTemplate>
  776. <StackPanel Orientation="Vertical">
  777. <StackPanel Orientation="Horizontal">
  778. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  779. <TextBlock.Text>
  780. <MultiBinding StringFormat="{}{0}. {1}">
  781. <Binding Path="RobotNo" />
  782. <Binding Path="RobotName" />
  783. </MultiBinding>
  784. </TextBlock.Text>
  785. </TextBlock>
  786. </StackPanel>
  787. <StackPanel Orientation="Horizontal">
  788. <TextBlock
  789. FontSize="{DynamicResource Font.Size.Captions3}"
  790. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  791. Text="{lex:Loc 品牌,
  792. Converter={StaticResource StringFormatConverter},
  793. ConverterParameter='{}{0}: '}" />
  794. <TextBlock
  795. FontSize="{DynamicResource Font.Size.Captions3}"
  796. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  797. Text="{Binding RobotBrand, Mode=TwoWay}" />
  798. <TextBlock
  799. Margin="10,0,0,0"
  800. FontSize="{DynamicResource Font.Size.Captions3}"
  801. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  802. Text="{lex:Loc 连接方式,
  803. Converter={StaticResource StringFormatConverter},
  804. ConverterParameter='{}{0}: '}"
  805. Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  806. <TextBlock
  807. VerticalAlignment="Center"
  808. FontSize="{DynamicResource Font.Size.Captions3}"
  809. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  810. Text="{Binding ConnectType, Mode=TwoWay}"
  811. Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  812. <!-- PLC -->
  813. <TextBlock
  814. Margin="10,0,0,0"
  815. d:Visibility="Collapsed"
  816. FontSize="{DynamicResource Font.Size.Captions3}"
  817. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  818. Text="PLC: "
  819. Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  820. <TextBlock
  821. d:Visibility="Collapsed"
  822. FontSize="{DynamicResource Font.Size.Captions3}"
  823. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  824. Text="{Binding PLC, Converter={StaticResource PlcIdToNameConverter}}"
  825. Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  826. </StackPanel>
  827. <StackPanel Orientation="Horizontal" Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  828. <TextBlock
  829. FontSize="{DynamicResource Font.Size.Captions3}"
  830. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  831. Text="{Binding IP, StringFormat=IP:{0}, Mode=TwoWay}" />
  832. <TextBlock
  833. Margin="10,0"
  834. FontSize="{DynamicResource Font.Size.Captions3}"
  835. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  836. Text="{Binding Port, StringFormat=Port:{0}, Mode=TwoWay}" />
  837. <TextBlock
  838. FontSize="{DynamicResource Font.Size.Captions3}"
  839. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  840. Text="{lex:Loc 结束符,
  841. Converter={StaticResource StringFormatConverter},
  842. ConverterParameter='{}{0}: '}" />
  843. <TextBlock
  844. FontSize="{DynamicResource Font.Size.Captions3}"
  845. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  846. Text="{Binding Terminator, Mode=TwoWay}" />
  847. </StackPanel>
  848. <Border
  849. Height="2"
  850. Margin="0"
  851. BorderBrush="Green"
  852. BorderThickness="2" />
  853. </StackPanel>
  854. </HierarchicalDataTemplate>
  855. </TreeViewItem.ItemTemplate>
  856. </TreeViewItem>
  857. </TreeView>
  858. <!-- 参数详情 -->
  859. <ScrollViewer
  860. Grid.Row="1"
  861. Grid.Column="1"
  862. Margin="20"
  863. IsEnabled="{Binding IsAllowEdit}"
  864. Visibility="{Binding SelectRobot, Converter={StaticResource ObjectToVisibilityConverter}}">
  865. <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
  866. <Grid.RowDefinitions>
  867. <RowDefinition />
  868. <RowDefinition />
  869. <RowDefinition />
  870. <RowDefinition />
  871. <RowDefinition />
  872. <RowDefinition />
  873. <RowDefinition />
  874. <RowDefinition />
  875. <RowDefinition />
  876. </Grid.RowDefinitions>
  877. <Grid.ColumnDefinitions>
  878. <ColumnDefinition Width="auto" />
  879. <ColumnDefinition Width="auto" />
  880. <ColumnDefinition Width="*" />
  881. </Grid.ColumnDefinitions>
  882. <!-- id -->
  883. <TextBlock
  884. Grid.Row="0"
  885. Grid.Column="0"
  886. HorizontalAlignment="Right"
  887. VerticalAlignment="Center"
  888. FontSize="{DynamicResource Font.Size.Body3}"
  889. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  890. Text="Id: " />
  891. <TextBlock
  892. x:Name="txt_Id"
  893. Grid.Row="0"
  894. Grid.Column="1"
  895. Margin="10,0"
  896. HorizontalAlignment="Left"
  897. VerticalAlignment="Center"
  898. FontSize="{DynamicResource Font.Size.Body3}"
  899. Text="{Binding SelectRobot.Id, Mode=TwoWay}" />
  900. <!-- 名称 -->
  901. <TextBlock
  902. Grid.Row="1"
  903. Grid.Column="0"
  904. HorizontalAlignment="Right"
  905. VerticalAlignment="Center"
  906. FontSize="{DynamicResource Font.Size.Body3}"
  907. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  908. Text="{lex:Loc 名称,
  909. Converter={StaticResource StringFormatConverter},
  910. ConverterParameter='{}{0}: '}" />
  911. <TextBox
  912. Grid.Row="1"
  913. Grid.Column="1"
  914. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  915. MinWidth="80"
  916. Margin="10,0"
  917. HorizontalAlignment="Left"
  918. VerticalAlignment="Center"
  919. FontSize="{DynamicResource Font.Size.Body3}"
  920. TextAlignment="Center">
  921. <TextBox.Text>
  922. <Binding Mode="TwoWay" Path="SelectRobot.RobotName">
  923. <Binding.ValidationRules>
  924. <valRules:NameValidationRule />
  925. </Binding.ValidationRules>
  926. </Binding>
  927. </TextBox.Text>
  928. </TextBox>
  929. <!-- 机器人品牌 -->
  930. <TextBlock
  931. Grid.Row="2"
  932. Grid.Column="0"
  933. HorizontalAlignment="Right"
  934. VerticalAlignment="Center"
  935. FontSize="{DynamicResource Font.Size.Body3}"
  936. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  937. Text="{lex:Loc 品牌,
  938. Converter={StaticResource StringFormatConverter},
  939. ConverterParameter='{}{0}: '}" />
  940. <ComboBox
  941. Grid.Row="2"
  942. Grid.Column="1"
  943. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  944. MinWidth="80"
  945. Margin="10,0"
  946. HorizontalAlignment="Left"
  947. VerticalAlignment="Center"
  948. HorizontalContentAlignment="Center"
  949. FontSize="{DynamicResource Font.Size.Body3}"
  950. ItemsSource="{ext:EnumBindingSource EnumType=enums:RobotBrand}"
  951. SelectedItem="{Binding SelectRobot.RobotBrand, Mode=TwoWay}" />
  952. <!-- 通讯方式 -->
  953. <TextBlock
  954. Grid.Row="3"
  955. Grid.Column="0"
  956. HorizontalAlignment="Right"
  957. VerticalAlignment="Center"
  958. FontSize="{DynamicResource Font.Size.Body3}"
  959. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  960. Text="{lex:Loc 通讯方式,
  961. Converter={StaticResource StringFormatConverter},
  962. ConverterParameter='{}{0}: '}"
  963. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  964. <ComboBox
  965. Grid.Row="3"
  966. Grid.Column="1"
  967. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  968. MinWidth="80"
  969. Margin="10,0"
  970. HorizontalAlignment="Left"
  971. VerticalAlignment="Center"
  972. HorizontalContentAlignment="Center"
  973. FontSize="{DynamicResource Font.Size.Body3}"
  974. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  975. SelectedItem="{Binding SelectRobot.ConnectType, Mode=TwoWay}"
  976. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  977. <!-- IP地址 -->
  978. <TextBlock
  979. Grid.Row="4"
  980. Grid.Column="0"
  981. HorizontalAlignment="Right"
  982. VerticalAlignment="Center"
  983. FontSize="{DynamicResource Font.Size.Body3}"
  984. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  985. Text="IP: "
  986. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  987. <TextBox
  988. Grid.Row="4"
  989. Grid.Column="1"
  990. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  991. MinWidth="80"
  992. Margin="10,0"
  993. HorizontalAlignment="Left"
  994. VerticalAlignment="Center"
  995. FontSize="{DynamicResource Font.Size.Body3}"
  996. TextAlignment="Center"
  997. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  998. <TextBox.Text>
  999. <Binding Mode="TwoWay" Path="SelectRobot.IP">
  1000. <Binding.ValidationRules>
  1001. <valRules:IPValidationRule />
  1002. </Binding.ValidationRules>
  1003. </Binding>
  1004. </TextBox.Text>
  1005. </TextBox>
  1006. <!-- 端口号 -->
  1007. <TextBlock
  1008. Grid.Row="5"
  1009. Grid.Column="0"
  1010. HorizontalAlignment="Right"
  1011. VerticalAlignment="Center"
  1012. FontSize="{DynamicResource Font.Size.Body3}"
  1013. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1014. Text="Port: "
  1015. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1016. <TextBox
  1017. Grid.Row="5"
  1018. Grid.Column="1"
  1019. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  1020. MinWidth="80"
  1021. Margin="10,0"
  1022. HorizontalAlignment="Left"
  1023. VerticalAlignment="Center"
  1024. FontSize="{DynamicResource Font.Size.Body3}"
  1025. TextAlignment="Center"
  1026. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}">
  1027. <TextBox.Text>
  1028. <Binding Mode="TwoWay" Path="SelectRobot.Port">
  1029. <Binding.ValidationRules>
  1030. <valRules:PortValidationRule />
  1031. </Binding.ValidationRules>
  1032. </Binding>
  1033. </TextBox.Text>
  1034. </TextBox>
  1035. <!-- 结束符 -->
  1036. <TextBlock
  1037. Grid.Row="6"
  1038. Grid.Column="0"
  1039. HorizontalAlignment="Right"
  1040. VerticalAlignment="Center"
  1041. FontSize="{DynamicResource Font.Size.Body3}"
  1042. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1043. Text="{lex:Loc 结束符,
  1044. Converter={StaticResource StringFormatConverter},
  1045. ConverterParameter='{}{0}: '}"
  1046. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1047. <ComboBox
  1048. Grid.Row="6"
  1049. Grid.Column="1"
  1050. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  1051. MinWidth="80"
  1052. Margin="10,0"
  1053. HorizontalAlignment="Left"
  1054. VerticalAlignment="Center"
  1055. HorizontalContentAlignment="Center"
  1056. FontSize="{DynamicResource Font.Size.Body3}"
  1057. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  1058. SelectedItem="{Binding SelectRobot.Terminator, Mode=TwoWay}"
  1059. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1060. <!-- 编码格式 -->
  1061. <TextBlock
  1062. Grid.Row="7"
  1063. Grid.Column="0"
  1064. HorizontalAlignment="Right"
  1065. VerticalAlignment="Center"
  1066. FontSize="{DynamicResource Font.Size.Body3}"
  1067. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1068. Text="{lex:Loc 编码解码,
  1069. Converter={StaticResource StringFormatConverter},
  1070. ConverterParameter='{}{0}: '}"
  1071. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1072. <ComboBox
  1073. Grid.Row="7"
  1074. Grid.Column="1"
  1075. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  1076. MinWidth="80"
  1077. Margin="10,0"
  1078. HorizontalAlignment="Left"
  1079. VerticalAlignment="Center"
  1080. HorizontalContentAlignment="Center"
  1081. FontSize="{DynamicResource Font.Size.Body3}"
  1082. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  1083. SelectedItem="{Binding SelectRobot.DataEncoding, Mode=TwoWay}"
  1084. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
  1085. <!-- Z轴的安全高度 -->
  1086. <TextBlock
  1087. Grid.Row="8"
  1088. Grid.Column="0"
  1089. HorizontalAlignment="Right"
  1090. VerticalAlignment="Center"
  1091. FontSize="{DynamicResource Font.Size.Body3}"
  1092. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1093. Text="Z轴的安全高度: " />
  1094. <TextBox
  1095. Grid.Row="8"
  1096. Grid.Column="1"
  1097. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  1098. MinWidth="80"
  1099. Margin="10,0"
  1100. HorizontalAlignment="Left"
  1101. VerticalAlignment="Center"
  1102. HorizontalContentAlignment="Center"
  1103. FontSize="{DynamicResource Font.Size.Body3}"
  1104. Text="{Binding SelectRobot.SafeZ, Mode=TwoWay}" />
  1105. <TextBlock
  1106. Grid.Row="8"
  1107. Grid.Column="1"
  1108. Margin="0,0,-20,0"
  1109. HorizontalAlignment="Right"
  1110. VerticalAlignment="Center"
  1111. FontSize="{DynamicResource Font.Size.Body3}"
  1112. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1113. Text="mm" />
  1114. <!-- PLC -->
  1115. <TextBlock
  1116. Grid.Row="3"
  1117. Grid.Column="0"
  1118. HorizontalAlignment="Right"
  1119. VerticalAlignment="Center"
  1120. d:Visibility="Collapsed"
  1121. Text="PLC: "
  1122. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
  1123. <ComboBox
  1124. Grid.Row="3"
  1125. Grid.Column="1"
  1126. Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
  1127. MinWidth="80"
  1128. Margin="10,5"
  1129. HorizontalAlignment="Left"
  1130. VerticalAlignment="Center"
  1131. HorizontalContentAlignment="Center"
  1132. d:Visibility="Collapsed"
  1133. ItemsSource="{Binding PlcList}"
  1134. SelectedItem="{Binding RobotSelectedPlc}"
  1135. Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  1136. <ComboBox.ItemTemplate>
  1137. <DataTemplate>
  1138. <TextBlock Text="{Binding Name}" />
  1139. </DataTemplate>
  1140. </ComboBox.ItemTemplate>
  1141. </ComboBox>
  1142. <!--<ScrollViewer Grid.RowSpan="8"
  1143. Grid.Column="2"
  1144. HorizontalScrollBarVisibility="Auto"
  1145. VerticalScrollBarVisibility="Auto"
  1146. d:Visibility="Collapsed"
  1147. Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
  1148. <Grid Margin="5">
  1149. <Grid.RowDefinitions>
  1150. <RowDefinition Height="Auto" />
  1151. <RowDefinition Height="Auto" />
  1152. <RowDefinition Height="Auto" />
  1153. <RowDefinition Height="Auto" />
  1154. <RowDefinition Height="Auto" />
  1155. <RowDefinition Height="Auto" />
  1156. <RowDefinition Height="Auto" />
  1157. <RowDefinition Height="Auto" />
  1158. <RowDefinition Height="Auto" />
  1159. <RowDefinition Height="Auto" />
  1160. <RowDefinition Height="Auto" />
  1161. <RowDefinition Height="Auto" />
  1162. <RowDefinition Height="Auto" />
  1163. <RowDefinition Height="Auto" />
  1164. <RowDefinition Height="Auto" />
  1165. <RowDefinition Height="Auto" />
  1166. <RowDefinition Height="Auto" />
  1167. <RowDefinition Height="Auto" />
  1168. <RowDefinition Height="Auto" />
  1169. <RowDefinition Height="Auto" />
  1170. <RowDefinition Height="Auto" />
  1171. <RowDefinition Height="Auto" />
  1172. <RowDefinition Height="Auto" />
  1173. <RowDefinition Height="Auto" />
  1174. </Grid.RowDefinitions>
  1175. <Grid.ColumnDefinitions>
  1176. <ColumnDefinition Width="auto" />
  1177. <ColumnDefinition Width="*" />
  1178. </Grid.ColumnDefinitions>
  1179. <Grid.Resources>
  1180. <Style TargetType="TextBlock">
  1181. <Setter Property="FontSize"
  1182. Value="{DynamicResource Font.Size.Body3}" />
  1183. <Setter Property="Margin"
  1184. Value="5" />
  1185. <Setter Property="VerticalAlignment"
  1186. Value="Center" />
  1187. </Style>
  1188. <Style TargetType="TextBox">
  1189. <Setter Property="FontSize"
  1190. Value="{DynamicResource Font.Size.Body3}" />
  1191. <Setter Property="Margin"
  1192. Value="5" />
  1193. <Setter Property="HorizontalAlignment"
  1194. Value="Stretch" />
  1195. <Setter Property="VerticalAlignment"
  1196. Value="Center" />
  1197. </Style>
  1198. </Grid.Resources>
  1199. <TextBlock Grid.Row="0"
  1200. FontWeight="Bold"
  1201. Text="{lex:Loc 状态参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  1202. <TextBlock Grid.Row="1"
  1203. Text="{lex:Loc X坐标}" />
  1204. <DockPanel Grid.Row="1"
  1205. Grid.Column="1"
  1206. LastChildFill="True">
  1207. <TextBlock Text="{Binding ResultsValues[0]}"
  1208. MinWidth="50" />
  1209. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.X}" />
  1210. </DockPanel>
  1211. <TextBlock Grid.Row="2"
  1212. Text="{lex:Loc Y坐标}" />
  1213. <DockPanel Grid.Row="2"
  1214. Grid.Column="1"
  1215. LastChildFill="True">
  1216. <TextBlock Text="{Binding ResultsValues[1]}"
  1217. MinWidth="50" />
  1218. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Y}" />
  1219. </DockPanel>
  1220. <TextBlock Grid.Row="3"
  1221. Text="{lex:Loc Z坐标}" />
  1222. <DockPanel Grid.Row="3"
  1223. Grid.Column="1"
  1224. LastChildFill="True">
  1225. <TextBlock Text="{Binding ResultsValues[2]}"
  1226. MinWidth="50" />
  1227. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Z}" />
  1228. </DockPanel>
  1229. <TextBlock Grid.Row="4"
  1230. Text="{lex:Loc U坐标}" />
  1231. <DockPanel Grid.Row="4"
  1232. Grid.Column="1"
  1233. LastChildFill="True">
  1234. <TextBlock Text="{Binding ResultsValues[3]}"
  1235. MinWidth="50" />
  1236. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.U}" />
  1237. </DockPanel>
  1238. <TextBlock Grid.Row="5"
  1239. Text="{lex:Loc 运动结束}" />
  1240. <DockPanel Grid.Row="5"
  1241. Grid.Column="1"
  1242. LastChildFill="True">
  1243. <TextBlock Text="{Binding ResultsValues[4]}"
  1244. MinWidth="50" />
  1245. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.MoveFinish}" />
  1246. </DockPanel>
  1247. <TextBlock Grid.Row="6"
  1248. Text="{lex:Loc 错误}" />
  1249. <DockPanel Grid.Row="6"
  1250. Grid.Column="1"
  1251. LastChildFill="True">
  1252. <TextBlock Text="{Binding ResultsValues[5]}"
  1253. MinWidth="50" />
  1254. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Error}" />
  1255. </DockPanel>
  1256. <TextBlock Grid.Row="7"
  1257. Text="{lex:Loc 吸真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1258. <DockPanel Grid.Row="7"
  1259. Grid.Column="1"
  1260. LastChildFill="True">
  1261. <TextBlock Text="{Binding ResultsValues[6]}"
  1262. MinWidth="50" />
  1263. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOn}" />
  1264. </DockPanel>
  1265. <TextBlock Grid.Row="8"
  1266. Text="{lex:Loc 破真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1267. <DockPanel Grid.Row="8"
  1268. Grid.Column="1"
  1269. LastChildFill="True">
  1270. <TextBlock Text="{Binding ResultsValues[7]}"
  1271. MinWidth="50" />
  1272. <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOff}" />
  1273. </DockPanel>
  1274. <TextBlock Grid.Row="9"
  1275. FontWeight="Bold"
  1276. Text="{lex:Loc 命令参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  1277. <TextBlock Grid.Row="10"
  1278. Text="{lex:Loc X坐标}" />
  1279. <TextBox Grid.Row="10"
  1280. Grid.Column="1"
  1281. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.X}" />
  1282. <TextBlock Grid.Row="11"
  1283. Text="{lex:Loc Y坐标}" />
  1284. <TextBox Grid.Row="11"
  1285. Grid.Column="1"
  1286. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Y}" />
  1287. <TextBlock Grid.Row="12"
  1288. Text="{lex:Loc Z坐标}" />
  1289. <TextBox Grid.Row="12"
  1290. Grid.Column="1"
  1291. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Z}" />
  1292. <TextBlock Grid.Row="13"
  1293. Text="{lex:Loc U坐标}" />
  1294. <TextBox Grid.Row="13"
  1295. Grid.Column="1"
  1296. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.U}" />
  1297. <TextBlock Grid.Row="14"
  1298. Text="{lex:Loc 吸真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1299. <TextBox Grid.Row="14"
  1300. Grid.Column="1"
  1301. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOn}" />
  1302. <TextBlock Grid.Row="15"
  1303. Text="{lex:Loc 破真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1304. <TextBox Grid.Row="15"
  1305. Grid.Column="1"
  1306. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOff}" />
  1307. <TextBlock Grid.Row="16"
  1308. Text="{lex:Loc Z轴限高}" />
  1309. <TextBox Grid.Row="16"
  1310. Grid.Column="1"
  1311. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Limz}" />
  1312. <TextBlock Grid.Row="17"
  1313. Text="{lex:Loc 执行运动}" />
  1314. <TextBox Grid.Row="17"
  1315. Grid.Column="1"
  1316. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.ExecuteMove}" />
  1317. <TextBlock Grid.Row="18"
  1318. Text="{lex:Loc 吸真空}" />
  1319. <TextBox Grid.Row="18"
  1320. Grid.Column="1"
  1321. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOn}" />
  1322. <TextBlock Grid.Row="19"
  1323. Text="{lex:Loc 破真空}" />
  1324. <TextBox Grid.Row="19"
  1325. Grid.Column="1"
  1326. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOff}" />
  1327. <TextBlock Grid.Row="20"
  1328. Text="{lex:Loc 步进距离,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1329. <TextBox Grid.Row="20"
  1330. Grid.Column="1"
  1331. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Distance}" />
  1332. <TextBlock Grid.Row="21"
  1333. Text="{lex:Loc 点动命令,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
  1334. <TextBox Grid.Row="21"
  1335. Grid.Column="1"
  1336. Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.JogCmd}" />
  1337. </Grid>
  1338. </ScrollViewer>-->
  1339. </Grid>
  1340. </ScrollViewer>
  1341. </Grid>
  1342. </TabItem>
  1343. <!-- Feeder -->
  1344. <TabItem>
  1345. <TabItem.Header>
  1346. <StackPanel HorizontalAlignment="Stretch">
  1347. <materialDesign:PackIcon
  1348. Width="24"
  1349. Height="24"
  1350. HorizontalAlignment="Center"
  1351. Kind="Vibrate" />
  1352. <TextBlock
  1353. HorizontalAlignment="Stretch"
  1354. FontSize="{DynamicResource Font.Size.Body2}"
  1355. Style="{StaticResource TabHeaderTextBlockStyle}"
  1356. Text="Feeder" />
  1357. </StackPanel>
  1358. </TabItem.Header>
  1359. <Grid Margin="16">
  1360. <Grid.RowDefinitions>
  1361. <RowDefinition Height="50" />
  1362. <RowDefinition Height="*" />
  1363. </Grid.RowDefinitions>
  1364. <Grid.ColumnDefinitions>
  1365. <ColumnDefinition Width="auto" />
  1366. <ColumnDefinition Width="*" />
  1367. </Grid.ColumnDefinitions>
  1368. <!-- 增删改查 -->
  1369. <StackPanel
  1370. Grid.ColumnSpan="2"
  1371. IsEnabled="{Binding IsAllowEdit}"
  1372. Orientation="Horizontal">
  1373. <Button
  1374. Command="{Binding AddFeederCommand}"
  1375. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1376. ToolTip="{lex:Loc 增加Feeder}">
  1377. <materialDesign:PackIcon Kind="Plus" />
  1378. </Button>
  1379. <Button
  1380. Margin="20,0"
  1381. Command="{Binding RemoveFeederCommand}"
  1382. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1383. ToolTip="{lex:Loc 移除Feeder}">
  1384. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1385. </Button>
  1386. <Button
  1387. Command="{Binding SaveFeedersCommand}"
  1388. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1389. ToolTip="{lex:Loc 保存}">
  1390. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1391. </Button>
  1392. </StackPanel>
  1393. <!-- Feeder列表 -->
  1394. <TreeView
  1395. Grid.Row="1"
  1396. Grid.Column="0"
  1397. SelectedItemChanged="TreeView_SelectedItemChanged">
  1398. <TreeViewItem
  1399. FontSize="{DynamicResource Font.Size.Title4}"
  1400. FontWeight="Bold"
  1401. Header="{lex:Loc Feeder列表}"
  1402. IsExpanded="True"
  1403. ItemsSource="{Binding FeederList}">
  1404. <TreeViewItem.ItemTemplate>
  1405. <HierarchicalDataTemplate>
  1406. <StackPanel Orientation="Vertical">
  1407. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  1408. <TextBlock.Text>
  1409. <MultiBinding StringFormat="{}{0}. {1}">
  1410. <Binding Path="FeederNo" />
  1411. <Binding Path="FeederName" />
  1412. </MultiBinding>
  1413. </TextBlock.Text>
  1414. </TextBlock>
  1415. <StackPanel Orientation="Horizontal">
  1416. <TextBlock
  1417. FontSize="{DynamicResource Font.Size.Captions3}"
  1418. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1419. Text="{lex:Loc 品牌,
  1420. Converter={StaticResource StringFormatConverter},
  1421. ConverterParameter='{}{0}: '}" />
  1422. <TextBlock
  1423. FontSize="{DynamicResource Font.Size.Captions3}"
  1424. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1425. Text="{Binding FeederBrand, Mode=TwoWay}" />
  1426. <TextBlock
  1427. Margin="10,0,0,0"
  1428. FontSize="{DynamicResource Font.Size.Captions3}"
  1429. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1430. Text="{lex:Loc 连接方式,
  1431. Converter={StaticResource StringFormatConverter},
  1432. ConverterParameter='{}{0}: '}" />
  1433. <TextBlock
  1434. FontSize="{DynamicResource Font.Size.Captions3}"
  1435. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1436. Text="{Binding ConnectType, Mode=TwoWay}" />
  1437. </StackPanel>
  1438. <StackPanel Orientation="Horizontal">
  1439. <TextBlock
  1440. FontSize="{DynamicResource Font.Size.Captions3}"
  1441. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1442. Text="{Binding IP, StringFormat=IP:{0}, Mode=TwoWay}" />
  1443. <TextBlock
  1444. Margin="10,0"
  1445. FontSize="{DynamicResource Font.Size.Captions3}"
  1446. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1447. Text="{Binding Port, StringFormat=Port:{0}, Mode=TwoWay}" />
  1448. </StackPanel>
  1449. <Border
  1450. Height="2"
  1451. Margin="0"
  1452. BorderBrush="Green"
  1453. BorderThickness="2" />
  1454. </StackPanel>
  1455. </HierarchicalDataTemplate>
  1456. </TreeViewItem.ItemTemplate>
  1457. </TreeViewItem>
  1458. </TreeView>
  1459. <!-- 参数详情 -->
  1460. <ScrollViewer
  1461. Grid.Row="1"
  1462. Grid.Column="1"
  1463. Margin="20"
  1464. HorizontalAlignment="Left"
  1465. VerticalAlignment="Top"
  1466. IsEnabled="{Binding IsAllowEdit}"
  1467. Visibility="{Binding SelectFeeder, Converter={StaticResource ObjectToVisibilityConverter}}">
  1468. <Grid Height="300">
  1469. <Grid.RowDefinitions>
  1470. <RowDefinition />
  1471. <RowDefinition />
  1472. <RowDefinition />
  1473. <RowDefinition />
  1474. <RowDefinition />
  1475. <RowDefinition />
  1476. <RowDefinition />
  1477. </Grid.RowDefinitions>
  1478. <Grid.ColumnDefinitions>
  1479. <ColumnDefinition Width="auto" />
  1480. <ColumnDefinition Width="*" />
  1481. </Grid.ColumnDefinitions>
  1482. <!-- id -->
  1483. <TextBlock
  1484. Grid.Row="0"
  1485. Grid.Column="0"
  1486. HorizontalAlignment="Right"
  1487. VerticalAlignment="Center"
  1488. FontSize="{DynamicResource Font.Size.Body3}"
  1489. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1490. Text="Id: " />
  1491. <TextBlock
  1492. x:Name="txt_Feeder_Id"
  1493. Grid.Row="0"
  1494. Grid.Column="1"
  1495. Margin="10,0"
  1496. HorizontalAlignment="Left"
  1497. VerticalAlignment="Center"
  1498. FontSize="{DynamicResource Font.Size.Body3}"
  1499. Text="{Binding SelectFeeder.Id, Mode=TwoWay}" />
  1500. <!-- 名称 -->
  1501. <TextBlock
  1502. Grid.Row="1"
  1503. Grid.Column="0"
  1504. HorizontalAlignment="Right"
  1505. VerticalAlignment="Center"
  1506. FontSize="{DynamicResource Font.Size.Body3}"
  1507. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1508. Text="{lex:Loc 名称,
  1509. Converter={StaticResource StringFormatConverter},
  1510. ConverterParameter='{}{0}: '}" />
  1511. <TextBox
  1512. Grid.Row="1"
  1513. Grid.Column="1"
  1514. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1515. MinWidth="80"
  1516. Margin="10,0"
  1517. HorizontalAlignment="Left"
  1518. VerticalAlignment="Center"
  1519. FontSize="{DynamicResource Font.Size.Body3}"
  1520. TextAlignment="Center">
  1521. <TextBox.Text>
  1522. <Binding Mode="TwoWay" Path="SelectFeeder.FeederName">
  1523. <Binding.ValidationRules>
  1524. <valRules:NameValidationRule />
  1525. </Binding.ValidationRules>
  1526. </Binding>
  1527. </TextBox.Text>
  1528. </TextBox>
  1529. <!-- Feeder品牌 -->
  1530. <TextBlock
  1531. Grid.Row="2"
  1532. Grid.Column="0"
  1533. HorizontalAlignment="Right"
  1534. VerticalAlignment="Center"
  1535. FontSize="{DynamicResource Font.Size.Body3}"
  1536. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1537. Text="{lex:Loc 品牌,
  1538. Converter={StaticResource StringFormatConverter},
  1539. ConverterParameter='{}{0}: '}" />
  1540. <ComboBox
  1541. Grid.Row="2"
  1542. Grid.Column="1"
  1543. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1544. MinWidth="80"
  1545. Margin="10,0"
  1546. HorizontalAlignment="Left"
  1547. VerticalAlignment="Center"
  1548. HorizontalContentAlignment="Center"
  1549. FontSize="{DynamicResource Font.Size.Body3}"
  1550. ItemsSource="{ext:EnumBindingSource EnumType=enums1:FeederBrand}"
  1551. SelectedItem="{Binding SelectFeeder.FeederBrand, Mode=TwoWay}" />
  1552. <!-- 通讯方式 -->
  1553. <TextBlock
  1554. Grid.Row="3"
  1555. Grid.Column="0"
  1556. HorizontalAlignment="Right"
  1557. VerticalAlignment="Center"
  1558. FontSize="{DynamicResource Font.Size.Body3}"
  1559. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1560. Text="{lex:Loc 通讯方式,
  1561. Converter={StaticResource StringFormatConverter},
  1562. ConverterParameter='{}{0}: '}" />
  1563. <ComboBox
  1564. Grid.Row="3"
  1565. Grid.Column="1"
  1566. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1567. MinWidth="80"
  1568. Margin="10,0"
  1569. HorizontalAlignment="Left"
  1570. VerticalAlignment="Center"
  1571. HorizontalContentAlignment="Center"
  1572. FontSize="{DynamicResource Font.Size.Body3}"
  1573. ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
  1574. SelectedItem="{Binding SelectFeeder.ConnectType, Mode=TwoWay}" />
  1575. <!-- IP地址 -->
  1576. <TextBlock
  1577. Grid.Row="4"
  1578. Grid.Column="0"
  1579. HorizontalAlignment="Right"
  1580. VerticalAlignment="Center"
  1581. FontSize="{DynamicResource Font.Size.Body3}"
  1582. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1583. Text="IP: " />
  1584. <TextBox
  1585. Grid.Row="4"
  1586. Grid.Column="1"
  1587. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1588. MinWidth="80"
  1589. Margin="10,0"
  1590. HorizontalAlignment="Left"
  1591. VerticalAlignment="Center"
  1592. FontSize="{DynamicResource Font.Size.Body3}"
  1593. TextAlignment="Center">
  1594. <TextBox.Text>
  1595. <Binding Mode="TwoWay" Path="SelectFeeder.IP">
  1596. <Binding.ValidationRules>
  1597. <valRules:IPValidationRule />
  1598. </Binding.ValidationRules>
  1599. </Binding>
  1600. </TextBox.Text>
  1601. </TextBox>
  1602. <!-- 端口号 -->
  1603. <TextBlock
  1604. Grid.Row="5"
  1605. Grid.Column="0"
  1606. HorizontalAlignment="Right"
  1607. VerticalAlignment="Center"
  1608. FontSize="{DynamicResource Font.Size.Body3}"
  1609. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1610. Text="Port: " />
  1611. <TextBox
  1612. Grid.Row="5"
  1613. Grid.Column="1"
  1614. Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
  1615. MinWidth="80"
  1616. Margin="10,0"
  1617. HorizontalAlignment="Left"
  1618. VerticalAlignment="Center"
  1619. FontSize="{DynamicResource Font.Size.Body3}"
  1620. TextAlignment="Center">
  1621. <TextBox.Text>
  1622. <Binding Mode="TwoWay" Path="SelectFeeder.Port">
  1623. <Binding.ValidationRules>
  1624. <valRules:PortValidationRule />
  1625. </Binding.ValidationRules>
  1626. </Binding>
  1627. </TextBox.Text>
  1628. </TextBox>
  1629. </Grid>
  1630. </ScrollViewer>
  1631. </Grid>
  1632. </TabItem>
  1633. <!-- PLC -->
  1634. <TabItem>
  1635. <TabItem.Header>
  1636. <StackPanel HorizontalAlignment="Stretch">
  1637. <materialDesign:PackIcon
  1638. Width="24"
  1639. Height="24"
  1640. HorizontalAlignment="Center"
  1641. Kind="CellphoneLink" />
  1642. <TextBlock
  1643. HorizontalAlignment="Stretch"
  1644. FontSize="{DynamicResource Font.Size.Body2}"
  1645. Style="{StaticResource TabHeaderTextBlockStyle}"
  1646. Text="PLC" />
  1647. </StackPanel>
  1648. </TabItem.Header>
  1649. <Grid Margin="16">
  1650. <Grid.RowDefinitions>
  1651. <RowDefinition Height="50" />
  1652. <RowDefinition Height="*" />
  1653. </Grid.RowDefinitions>
  1654. <Grid.ColumnDefinitions>
  1655. <ColumnDefinition Width="auto" />
  1656. <ColumnDefinition Width="*" />
  1657. </Grid.ColumnDefinitions>
  1658. <!-- 增删改查 -->
  1659. <StackPanel
  1660. Grid.ColumnSpan="2"
  1661. IsEnabled="{Binding IsAllowEdit}"
  1662. Orientation="Horizontal">
  1663. <Button
  1664. Command="{Binding AddPlcCommand}"
  1665. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1666. ToolTip="{lex:Loc 增加PLC}">
  1667. <materialDesign:PackIcon Kind="Plus" />
  1668. </Button>
  1669. <Button
  1670. Margin="20,0"
  1671. Command="{Binding RemovePlcCommand}"
  1672. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1673. ToolTip="{lex:Loc 移除PLC}">
  1674. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1675. </Button>
  1676. <Button
  1677. Command="{Binding SavePlcsCommand}"
  1678. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1679. ToolTip="{lex:Loc 保存}">
  1680. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1681. </Button>
  1682. </StackPanel>
  1683. <!-- PLC列表 -->
  1684. <TreeView
  1685. Grid.Row="1"
  1686. Grid.Column="0"
  1687. SelectedItemChanged="TreeView_SelectedItemChanged">
  1688. <TreeViewItem
  1689. FontSize="{DynamicResource Font.Size.Title4}"
  1690. FontWeight="Bold"
  1691. Header="{lex:Loc PLC列表}"
  1692. IsExpanded="True"
  1693. ItemsSource="{Binding PlcList}">
  1694. <TreeViewItem.ItemTemplate>
  1695. <HierarchicalDataTemplate>
  1696. <StackPanel Orientation="Vertical">
  1697. <TextBlock FontSize="{DynamicResource Font.Size.Title4}" Text="{Binding Name, Mode=TwoWay}" />
  1698. <StackPanel Orientation="Horizontal">
  1699. <TextBlock
  1700. Margin="10,0,0,0"
  1701. FontSize="{DynamicResource Font.Size.Captions3}"
  1702. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1703. Text="{lex:Loc 连接方式,
  1704. Converter={StaticResource StringFormatConverter},
  1705. ConverterParameter='{}{0}: '}" />
  1706. <TextBlock
  1707. FontSize="{DynamicResource Font.Size.Captions3}"
  1708. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1709. Text="{Binding CommunicationType, Mode=TwoWay}" />
  1710. </StackPanel>
  1711. <StackPanel Orientation="Horizontal">
  1712. <TextBlock
  1713. FontSize="{DynamicResource Font.Size.Captions3}"
  1714. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1715. Text="{Binding EndpointUrl, StringFormat=Endpoint Url:{0}, Mode=TwoWay}" />
  1716. </StackPanel>
  1717. <Border
  1718. Height="2"
  1719. Margin="0"
  1720. BorderBrush="Green"
  1721. BorderThickness="2" />
  1722. </StackPanel>
  1723. </HierarchicalDataTemplate>
  1724. </TreeViewItem.ItemTemplate>
  1725. </TreeViewItem>
  1726. </TreeView>
  1727. <!-- 参数详情 -->
  1728. <ScrollViewer
  1729. Grid.Row="1"
  1730. Grid.Column="1"
  1731. Margin="20"
  1732. HorizontalAlignment="Left"
  1733. VerticalAlignment="Top"
  1734. IsEnabled="{Binding IsAllowEdit}"
  1735. Visibility="{Binding SelectPlc, Converter={StaticResource ObjectToVisibilityConverter}}">
  1736. <Grid Height="200">
  1737. <Grid.RowDefinitions>
  1738. <RowDefinition />
  1739. <RowDefinition />
  1740. <RowDefinition />
  1741. <RowDefinition />
  1742. <RowDefinition />
  1743. </Grid.RowDefinitions>
  1744. <Grid.ColumnDefinitions>
  1745. <ColumnDefinition Width="auto" />
  1746. <ColumnDefinition Width="*" />
  1747. </Grid.ColumnDefinitions>
  1748. <!-- id -->
  1749. <TextBlock
  1750. Grid.Row="0"
  1751. Grid.Column="0"
  1752. HorizontalAlignment="Right"
  1753. VerticalAlignment="Center"
  1754. FontSize="{DynamicResource Font.Size.Body3}"
  1755. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1756. Text="Id: " />
  1757. <TextBlock
  1758. x:Name="txt_plc_Id"
  1759. Grid.Row="0"
  1760. Grid.Column="1"
  1761. Margin="10,0"
  1762. HorizontalAlignment="Left"
  1763. VerticalAlignment="Center"
  1764. FontSize="{DynamicResource Font.Size.Body3}"
  1765. Text="{Binding SelectPlc.Id, Mode=TwoWay}" />
  1766. <!-- 名称 -->
  1767. <TextBlock
  1768. Grid.Row="1"
  1769. Grid.Column="0"
  1770. HorizontalAlignment="Right"
  1771. VerticalAlignment="Center"
  1772. FontSize="{DynamicResource Font.Size.Body3}"
  1773. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1774. Text="{lex:Loc 名称,
  1775. Converter={StaticResource StringFormatConverter},
  1776. ConverterParameter='{}{0}: '}" />
  1777. <TextBox
  1778. Grid.Row="1"
  1779. Grid.Column="1"
  1780. Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
  1781. MinWidth="80"
  1782. Margin="10,0"
  1783. HorizontalAlignment="Left"
  1784. VerticalAlignment="Center"
  1785. FontSize="{DynamicResource Font.Size.Body3}"
  1786. TextAlignment="Center">
  1787. <TextBox.Text>
  1788. <Binding Mode="TwoWay" Path="SelectPlc.Name">
  1789. <Binding.ValidationRules>
  1790. <valRules:NameValidationRule />
  1791. </Binding.ValidationRules>
  1792. </Binding>
  1793. </TextBox.Text>
  1794. </TextBox>
  1795. <!-- 通讯方式 -->
  1796. <TextBlock
  1797. Grid.Row="2"
  1798. Grid.Column="0"
  1799. HorizontalAlignment="Right"
  1800. VerticalAlignment="Center"
  1801. FontSize="{DynamicResource Font.Size.Body3}"
  1802. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1803. Text="{lex:Loc 通讯方式,
  1804. Converter={StaticResource StringFormatConverter},
  1805. ConverterParameter='{}{0}: '}" />
  1806. <ComboBox
  1807. Grid.Row="2"
  1808. Grid.Column="1"
  1809. Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
  1810. MinWidth="80"
  1811. Margin="10,0"
  1812. HorizontalAlignment="Left"
  1813. VerticalAlignment="Center"
  1814. HorizontalContentAlignment="Center"
  1815. FontSize="{DynamicResource Font.Size.Body3}"
  1816. ItemsSource="{ext:EnumBindingSource EnumType=enums:CommunicationType}"
  1817. SelectedItem="{Binding SelectPlc.CommunicationType, Mode=TwoWay}" />
  1818. <!-- Endpoint Url地址 -->
  1819. <TextBlock
  1820. Grid.Row="3"
  1821. Grid.Column="0"
  1822. HorizontalAlignment="Right"
  1823. VerticalAlignment="Center"
  1824. FontSize="{DynamicResource Font.Size.Body3}"
  1825. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1826. Text="Endpoints Url: " />
  1827. <TextBox
  1828. Grid.Row="3"
  1829. Grid.Column="1"
  1830. Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
  1831. MinWidth="80"
  1832. Margin="10,0"
  1833. HorizontalAlignment="Left"
  1834. VerticalAlignment="Center"
  1835. FontSize="{DynamicResource Font.Size.Body3}"
  1836. Text="{Binding SelectPlc.EndpointUrl}"
  1837. TextAlignment="Center" />
  1838. <!-- 节点头 -->
  1839. <TextBlock
  1840. Grid.Row="4"
  1841. Grid.Column="0"
  1842. HorizontalAlignment="Right"
  1843. VerticalAlignment="Center"
  1844. FontSize="{DynamicResource Font.Size.Body3}"
  1845. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  1846. Text="{lex:Loc 节点头,
  1847. Converter={StaticResource StringFormatConverter},
  1848. ConverterParameter='{}{0}: '}" />
  1849. <TextBox
  1850. Grid.Row="4"
  1851. Grid.Column="1"
  1852. Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
  1853. MinWidth="80"
  1854. Margin="10,0"
  1855. HorizontalAlignment="Left"
  1856. VerticalAlignment="Center"
  1857. FontSize="{DynamicResource Font.Size.Body3}"
  1858. Text="{Binding SelectPlc.NodeHeader, Mode=TwoWay}"
  1859. TextAlignment="Center" />
  1860. </Grid>
  1861. </ScrollViewer>
  1862. </Grid>
  1863. </TabItem>
  1864. <!-- 光源控制器 -->
  1865. <TabItem>
  1866. <TabItem.Header>
  1867. <StackPanel HorizontalAlignment="Stretch">
  1868. <materialDesign:PackIcon
  1869. Width="24"
  1870. Height="24"
  1871. HorizontalAlignment="Center"
  1872. Kind="TelevisionAmbientLight" />
  1873. <TextBlock
  1874. HorizontalAlignment="Stretch"
  1875. FontSize="{DynamicResource Font.Size.Body2}"
  1876. Style="{StaticResource TabHeaderTextBlockStyle}"
  1877. Text="{lex:Loc 光源控制器}" />
  1878. </StackPanel>
  1879. </TabItem.Header>
  1880. <Grid Margin="16">
  1881. <Grid.RowDefinitions>
  1882. <RowDefinition Height="50" />
  1883. <RowDefinition Height="*" />
  1884. </Grid.RowDefinitions>
  1885. <Grid.ColumnDefinitions>
  1886. <ColumnDefinition Width="auto" />
  1887. <ColumnDefinition Width="*" />
  1888. </Grid.ColumnDefinitions>
  1889. <!-- 增删改查 -->
  1890. <StackPanel
  1891. Grid.ColumnSpan="2"
  1892. IsEnabled="{Binding IsAllowEdit}"
  1893. Orientation="Horizontal">
  1894. <Button
  1895. Command="{Binding AddLightControllerCommand}"
  1896. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  1897. ToolTip="{lex:Loc 增加光源控制器}">
  1898. <materialDesign:PackIcon Kind="Plus" />
  1899. </Button>
  1900. <Button
  1901. Margin="20,0"
  1902. Command="{Binding RemoveLightControllerCommand}"
  1903. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  1904. ToolTip="{lex:Loc 移除光源控制器}">
  1905. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  1906. </Button>
  1907. <Button
  1908. Command="{Binding SaveLightControllersCommand}"
  1909. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  1910. ToolTip="{lex:Loc 保存}">
  1911. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  1912. </Button>
  1913. </StackPanel>
  1914. <!-- 控制器列表 -->
  1915. <TreeView
  1916. Grid.Row="1"
  1917. Grid.Column="0"
  1918. SelectedItemChanged="TreeView_SelectedItemChanged">
  1919. <TreeViewItem
  1920. FontSize="{DynamicResource Font.Size.Title4}"
  1921. FontWeight="Bold"
  1922. Header="{lex:Loc 光源控制器列表}"
  1923. IsExpanded="True"
  1924. ItemsSource="{Binding LightControllerList}">
  1925. <TreeViewItem.ItemTemplate>
  1926. <HierarchicalDataTemplate>
  1927. <StackPanel Orientation="Vertical">
  1928. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  1929. <TextBlock.Text>
  1930. <MultiBinding StringFormat="{}{0}. {1}">
  1931. <Binding Path="Id" />
  1932. <Binding Path="Name" />
  1933. </MultiBinding>
  1934. </TextBlock.Text>
  1935. </TextBlock>
  1936. <StackPanel Orientation="Horizontal">
  1937. <TextBlock
  1938. Margin="10,0,0,0"
  1939. FontSize="{DynamicResource Font.Size.Captions3}"
  1940. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1941. Text="{lex:Loc 型号,
  1942. Converter={StaticResource StringFormatConverter},
  1943. ConverterParameter='{}{0}: '}" />
  1944. <TextBlock
  1945. FontSize="{DynamicResource Font.Size.Captions3}"
  1946. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1947. Text="{Binding LightModel, Mode=TwoWay}" />
  1948. </StackPanel>
  1949. <StackPanel Orientation="Horizontal">
  1950. <TextBlock
  1951. Margin="10,0,0,0"
  1952. FontSize="{DynamicResource Font.Size.Captions3}"
  1953. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1954. Text="{lex:Loc 通道数,
  1955. Converter={StaticResource StringFormatConverter},
  1956. ConverterParameter='{}{0}: '}" />
  1957. <TextBlock
  1958. FontSize="{DynamicResource Font.Size.Captions3}"
  1959. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  1960. Text="{Binding ChannelCount, Mode=TwoWay}" />
  1961. </StackPanel>
  1962. <Border
  1963. Height="2"
  1964. Margin="0"
  1965. BorderBrush="Green"
  1966. BorderThickness="2" />
  1967. </StackPanel>
  1968. </HierarchicalDataTemplate>
  1969. </TreeViewItem.ItemTemplate>
  1970. </TreeViewItem>
  1971. </TreeView>
  1972. <!-- 参数详情 -->
  1973. <ScrollViewer
  1974. Grid.Row="1"
  1975. Grid.Column="1"
  1976. Margin="20"
  1977. HorizontalAlignment="Left"
  1978. VerticalAlignment="Top"
  1979. IsEnabled="{Binding IsAllowEdit}"
  1980. Visibility="{Binding SelectLightController, Converter={StaticResource ObjectToVisibilityConverter}}">
  1981. <Grid>
  1982. <Grid.RowDefinitions>
  1983. <RowDefinition Height="Auto" />
  1984. <RowDefinition Height="Auto" />
  1985. <RowDefinition Height="Auto" />
  1986. <RowDefinition Height="Auto" />
  1987. <RowDefinition Height="Auto" />
  1988. <RowDefinition Height="*" />
  1989. </Grid.RowDefinitions>
  1990. <Grid.ColumnDefinitions>
  1991. <ColumnDefinition Width="auto" />
  1992. <ColumnDefinition Width="*" MinWidth="200" />
  1993. </Grid.ColumnDefinitions>
  1994. <!-- Id -->
  1995. <TextBlock
  1996. Grid.Row="0"
  1997. Grid.Column="0"
  1998. HorizontalAlignment="Right"
  1999. VerticalAlignment="Center"
  2000. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2001. Text="Id: " />
  2002. <TextBlock
  2003. Grid.Row="0"
  2004. Grid.Column="1"
  2005. Margin="10,0"
  2006. VerticalAlignment="Center"
  2007. Text="{Binding SelectLightController.Id}" />
  2008. <!-- Name -->
  2009. <TextBlock
  2010. Grid.Row="1"
  2011. Grid.Column="0"
  2012. HorizontalAlignment="Right"
  2013. VerticalAlignment="Center"
  2014. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2015. Text="{lex:Loc 名称,
  2016. Converter={StaticResource StringFormatConverter},
  2017. ConverterParameter='{}{0}: '}" />
  2018. <TextBox
  2019. Grid.Row="1"
  2020. Grid.Column="1"
  2021. Margin="10,0"
  2022. Text="{Binding SelectLightController.Name, Mode=TwoWay}" />
  2023. <!-- Model -->
  2024. <TextBlock
  2025. Grid.Row="2"
  2026. Grid.Column="0"
  2027. HorizontalAlignment="Right"
  2028. VerticalAlignment="Center"
  2029. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2030. Text="{lex:Loc 型号,
  2031. Converter={StaticResource StringFormatConverter},
  2032. ConverterParameter='{}{0}: '}" />
  2033. <ComboBox
  2034. Grid.Row="2"
  2035. Grid.Column="1"
  2036. Margin="10,0"
  2037. ItemsSource="{ext:EnumBindingSource EnumType=coreLights:LightModel}"
  2038. SelectedItem="{Binding SelectLightController.LightModel, Mode=TwoWay}">
  2039. <b:Interaction.Triggers>
  2040. <b:EventTrigger EventName="SelectionChanged">
  2041. <b:InvokeCommandAction Command="{Binding LightModelChangedCommand}" CommandParameter="{Binding SelectLightController}" />
  2042. </b:EventTrigger>
  2043. </b:Interaction.Triggers>
  2044. </ComboBox>
  2045. <!-- Channel count -->
  2046. <TextBlock
  2047. Grid.Row="3"
  2048. Grid.Column="0"
  2049. HorizontalAlignment="Right"
  2050. VerticalAlignment="Center"
  2051. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2052. Text="{lex:Loc 通道数,
  2053. Converter={StaticResource StringFormatConverter},
  2054. ConverterParameter='{}{0}: '}" />
  2055. <TextBox
  2056. Grid.Row="3"
  2057. Grid.Column="1"
  2058. Margin="10,0"
  2059. IsReadOnly="True"
  2060. Text="{Binding SelectLightController.ChannelCount, Mode=TwoWay}" />
  2061. <!-- Channel configs list -->
  2062. <TextBlock
  2063. Grid.Row="4"
  2064. Grid.Column="0"
  2065. HorizontalAlignment="Right"
  2066. VerticalAlignment="Top"
  2067. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2068. Text="{lex:Loc 通道配置}" />
  2069. <ItemsControl
  2070. Grid.Row="4"
  2071. Grid.Column="1"
  2072. Margin="10,0"
  2073. ItemsSource="{Binding SelectLightController.ChannelConfigs}">
  2074. <ItemsControl.ItemTemplate>
  2075. <DataTemplate>
  2076. <StackPanel Margin="0,4" Orientation="Horizontal">
  2077. <TextBlock
  2078. Width="30"
  2079. VerticalAlignment="Center"
  2080. Text="{Binding LocalIndex}" />
  2081. <TextBox
  2082. Width="180"
  2083. Margin="6,0"
  2084. Text="{Binding Name, Mode=TwoWay}" />
  2085. <TextBlock
  2086. Margin="6,0"
  2087. VerticalAlignment="Center"
  2088. Text="{lex:Loc 亮度}" />
  2089. <TextBox Width="80" Text="{Binding DefaultBrightness, Mode=TwoWay}" />
  2090. </StackPanel>
  2091. </DataTemplate>
  2092. </ItemsControl.ItemTemplate>
  2093. </ItemsControl>
  2094. <!-- Serial port config (visible for serial model) -->
  2095. <GroupBox
  2096. Grid.Row="5"
  2097. Grid.ColumnSpan="2"
  2098. Margin="0,12,0,0"
  2099. Header="{lex:Loc 串口配置}">
  2100. <GroupBox.Style>
  2101. <Style TargetType="GroupBox">
  2102. <Setter Property="Visibility" Value="Collapsed" />
  2103. <Style.Triggers>
  2104. <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
  2105. <Setter Property="Visibility" Value="Visible" />
  2106. </DataTrigger>
  2107. <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC3_24V300W_8T}">
  2108. <Setter Property="Visibility" Value="Visible" />
  2109. </DataTrigger>
  2110. </Style.Triggers>
  2111. </Style>
  2112. </GroupBox.Style>
  2113. <Grid Margin="10">
  2114. <Grid.ColumnDefinitions>
  2115. <ColumnDefinition Width="auto" />
  2116. <ColumnDefinition Width="*" />
  2117. </Grid.ColumnDefinitions>
  2118. <Grid.RowDefinitions>
  2119. <RowDefinition Height="Auto" />
  2120. <RowDefinition Height="Auto" />
  2121. <RowDefinition Height="Auto" />
  2122. <RowDefinition Height="Auto" />
  2123. <RowDefinition Height="Auto" />
  2124. </Grid.RowDefinitions>
  2125. <TextBlock
  2126. Grid.Row="0"
  2127. Grid.Column="0"
  2128. HorizontalAlignment="Right"
  2129. Text="PortName:" />
  2130. <TextBox
  2131. Grid.Row="0"
  2132. Grid.Column="1"
  2133. Margin="6,0"
  2134. Text="{Binding SelectLightController.SerialPortConfig.PortName, Mode=TwoWay}" />
  2135. <TextBlock
  2136. Grid.Row="1"
  2137. Grid.Column="0"
  2138. HorizontalAlignment="Right"
  2139. Text="BaudRate:" />
  2140. <TextBox
  2141. Grid.Row="1"
  2142. Grid.Column="1"
  2143. Margin="6,0"
  2144. Text="{Binding SelectLightController.SerialPortConfig.BaudRate, Mode=TwoWay}" />
  2145. <TextBlock
  2146. Grid.Row="2"
  2147. Grid.Column="0"
  2148. HorizontalAlignment="Right"
  2149. Text="Parity:" />
  2150. <ComboBox
  2151. Grid.Row="2"
  2152. Grid.Column="1"
  2153. ItemsSource="{Binding Source={StaticResource Parity}}"
  2154. SelectedItem="{Binding SelectLightController.SerialPortConfig.Parity, Mode=TwoWay}" />
  2155. <TextBlock
  2156. Grid.Row="3"
  2157. Grid.Column="0"
  2158. HorizontalAlignment="Right"
  2159. Text="StopBits:" />
  2160. <ComboBox
  2161. Grid.Row="3"
  2162. Grid.Column="1"
  2163. ItemsSource="{Binding Source={StaticResource StopBits}}"
  2164. SelectedItem="{Binding SelectLightController.SerialPortConfig.StopBits, Mode=TwoWay}" />
  2165. <TextBlock
  2166. Grid.Row="4"
  2167. Grid.Column="0"
  2168. HorizontalAlignment="Right"
  2169. Text="DataBits:" />
  2170. <TextBox
  2171. Grid.Row="4"
  2172. Grid.Column="1"
  2173. Margin="6,0"
  2174. Text="{Binding SelectLightController.SerialPortConfig.DataBits, Mode=TwoWay}" />
  2175. </Grid>
  2176. </GroupBox>
  2177. <!-- TCP config (visible for non-serial models) -->
  2178. <GroupBox
  2179. Grid.Row="5"
  2180. Grid.ColumnSpan="2"
  2181. Margin="0,12,0,0"
  2182. Header="{lex:Loc TCP配置}">
  2183. <GroupBox.Style>
  2184. <Style TargetType="GroupBox">
  2185. <Setter Property="Visibility" Value="Visible" />
  2186. <Style.Triggers>
  2187. <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
  2188. <Setter Property="Visibility" Value="Collapsed" />
  2189. </DataTrigger>
  2190. <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC3_24V300W_8T}">
  2191. <Setter Property="Visibility" Value="Collapsed" />
  2192. </DataTrigger>
  2193. </Style.Triggers>
  2194. </Style>
  2195. </GroupBox.Style>
  2196. <Grid Margin="10">
  2197. <Grid.ColumnDefinitions>
  2198. <ColumnDefinition Width="auto" />
  2199. <ColumnDefinition Width="*" />
  2200. </Grid.ColumnDefinitions>
  2201. <Grid.RowDefinitions>
  2202. <RowDefinition Height="Auto" />
  2203. <RowDefinition Height="Auto" />
  2204. </Grid.RowDefinitions>
  2205. <TextBlock
  2206. Grid.Row="0"
  2207. Grid.Column="0"
  2208. HorizontalAlignment="Right"
  2209. Text="IP:" />
  2210. <TextBox
  2211. Grid.Row="0"
  2212. Grid.Column="1"
  2213. Margin="6,0"
  2214. Text="{Binding SelectLightController.TcpConfig.IP, Mode=TwoWay}" />
  2215. <TextBlock
  2216. Grid.Row="1"
  2217. Grid.Column="0"
  2218. HorizontalAlignment="Right"
  2219. Text="Port:" />
  2220. <TextBox
  2221. Grid.Row="1"
  2222. Grid.Column="1"
  2223. Margin="6,0"
  2224. Text="{Binding SelectLightController.TcpConfig.Port, Mode=TwoWay}" />
  2225. </Grid>
  2226. </GroupBox>
  2227. </Grid>
  2228. </ScrollViewer>
  2229. </Grid>
  2230. </TabItem>
  2231. <!-- 螺丝供料器 -->
  2232. <TabItem>
  2233. <TabItem.Header>
  2234. <StackPanel HorizontalAlignment="Stretch">
  2235. <materialDesign:PackIcon
  2236. Width="24"
  2237. Height="24"
  2238. HorizontalAlignment="Center"
  2239. Kind="Screwdriver" />
  2240. <TextBlock
  2241. HorizontalAlignment="Stretch"
  2242. FontSize="{DynamicResource Font.Size.Body2}"
  2243. Style="{StaticResource TabHeaderTextBlockStyle}"
  2244. Text="{lex:Loc 螺丝供料器}" />
  2245. </StackPanel>
  2246. </TabItem.Header>
  2247. <Grid Margin="16">
  2248. <Grid.RowDefinitions>
  2249. <RowDefinition Height="50" />
  2250. <RowDefinition Height="*" />
  2251. </Grid.RowDefinitions>
  2252. <Grid.ColumnDefinitions>
  2253. <ColumnDefinition Width="auto" />
  2254. <ColumnDefinition Width="*" />
  2255. </Grid.ColumnDefinitions>
  2256. <!-- 增删改查 -->
  2257. <StackPanel
  2258. Grid.ColumnSpan="2"
  2259. IsEnabled="{Binding IsAllowEdit}"
  2260. Orientation="Horizontal">
  2261. <Button
  2262. Command="{Binding AddScrewFeederCommand}"
  2263. Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
  2264. ToolTip="{lex:Loc 增加螺丝供料器}">
  2265. <materialDesign:PackIcon Kind="Plus" />
  2266. </Button>
  2267. <Button
  2268. Margin="20,0"
  2269. Command="{Binding RemoveScrewFeederCommand}"
  2270. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
  2271. ToolTip="{lex:Loc 移除螺丝供料器}">
  2272. <materialDesign:PackIcon Kind="DeleteForeverOutline" />
  2273. </Button>
  2274. <Button
  2275. Command="{Binding SaveScrewFeedersCommand}"
  2276. Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
  2277. ToolTip="{lex:Loc 保存}">
  2278. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  2279. </Button>
  2280. </StackPanel>
  2281. <!-- 螺丝供料器列表 -->
  2282. <TreeView
  2283. Grid.Row="1"
  2284. Grid.Column="0"
  2285. SelectedItemChanged="TreeView_SelectedItemChanged">
  2286. <TreeViewItem
  2287. FontSize="{DynamicResource Font.Size.Title4}"
  2288. FontWeight="Bold"
  2289. Header="{lex:Loc 螺丝供料器列表}"
  2290. IsExpanded="True"
  2291. ItemsSource="{Binding ScrewFeederList}">
  2292. <TreeViewItem.ItemTemplate>
  2293. <HierarchicalDataTemplate>
  2294. <StackPanel Orientation="Vertical">
  2295. <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
  2296. <TextBlock.Text>
  2297. <MultiBinding StringFormat="{}{0} . {1}">
  2298. <Binding Path="FeederNumber" />
  2299. <Binding Path="Name" />
  2300. </MultiBinding>
  2301. </TextBlock.Text>
  2302. </TextBlock>
  2303. <StackPanel Orientation="Horizontal">
  2304. <TextBlock
  2305. Margin="10,0,0,0"
  2306. FontSize="{DynamicResource Font.Size.Captions3}"
  2307. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2308. Text="{lex:Loc 每包螺丝的数量}" />
  2309. <TextBlock
  2310. FontSize="{DynamicResource Font.Size.Captions3}"
  2311. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2312. Text="{Binding PackSize, Mode=TwoWay}" />
  2313. </StackPanel>
  2314. <StackPanel Orientation="Horizontal">
  2315. <TextBlock
  2316. Margin="10,0,0,0"
  2317. FontSize="{DynamicResource Font.Size.Captions3}"
  2318. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2319. Text="{lex:Loc 低量报警阈值}" />
  2320. <TextBlock
  2321. FontSize="{DynamicResource Font.Size.Captions3}"
  2322. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2323. Text="{Binding LowLevelThreshold, Mode=TwoWay}" />
  2324. </StackPanel>
  2325. <StackPanel Orientation="Horizontal">
  2326. <TextBlock
  2327. Margin="10,0,0,0"
  2328. FontSize="{DynamicResource Font.Size.Captions3}"
  2329. Style="{StaticResource MaterialDesignCaptionTextBlock}"
  2330. Text="{lex:Loc 是否启用低量报警}" />
  2331. <CheckBox
  2332. FontSize="{DynamicResource Font.Size.Captions3}"
  2333. IsChecked="{Binding LowLevelAlarmEnabled, Mode=TwoWay}"
  2334. IsEnabled="False" />
  2335. </StackPanel>
  2336. <Border
  2337. Height="2"
  2338. Margin="0"
  2339. BorderBrush="Green"
  2340. BorderThickness="2" />
  2341. </StackPanel>
  2342. </HierarchicalDataTemplate>
  2343. </TreeViewItem.ItemTemplate>
  2344. </TreeViewItem>
  2345. </TreeView>
  2346. <!-- 参数详情 -->
  2347. <ScrollViewer
  2348. Grid.Row="1"
  2349. Grid.Column="1"
  2350. Margin="20"
  2351. HorizontalAlignment="Left"
  2352. VerticalAlignment="Top"
  2353. IsEnabled="{Binding IsAllowEdit}"
  2354. Visibility="{Binding SelectScrewFeeder, Converter={StaticResource ObjectToVisibilityConverter}}">
  2355. <Grid>
  2356. <Grid.RowDefinitions>
  2357. <RowDefinition Height="Auto" />
  2358. <RowDefinition Height="Auto" />
  2359. <RowDefinition Height="Auto" />
  2360. <RowDefinition Height="Auto" />
  2361. <RowDefinition Height="Auto" />
  2362. <RowDefinition Height="Auto" />
  2363. <RowDefinition Height="Auto" />
  2364. <RowDefinition Height="40" />
  2365. </Grid.RowDefinitions>
  2366. <Grid.ColumnDefinitions>
  2367. <ColumnDefinition Width="auto" />
  2368. <ColumnDefinition MinWidth="200" />
  2369. <ColumnDefinition Width="*" />
  2370. </Grid.ColumnDefinitions>
  2371. <!-- Id -->
  2372. <TextBlock
  2373. Grid.Row="0"
  2374. Grid.Column="0"
  2375. HorizontalAlignment="Right"
  2376. VerticalAlignment="Center"
  2377. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2378. Text="Id: " />
  2379. <TextBlock
  2380. Grid.Row="0"
  2381. Grid.Column="1"
  2382. Margin="10,0"
  2383. VerticalAlignment="Center"
  2384. Text="{Binding SelectScrewFeeder.Id}" />
  2385. <!-- Name -->
  2386. <TextBlock
  2387. Grid.Row="1"
  2388. Grid.Column="0"
  2389. HorizontalAlignment="Right"
  2390. VerticalAlignment="Center"
  2391. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2392. Text="{lex:Loc 名称,
  2393. Converter={StaticResource StringFormatConverter},
  2394. ConverterParameter='{}{0}: '}" />
  2395. <TextBox
  2396. Grid.Row="1"
  2397. Grid.Column="1"
  2398. Margin="10,0"
  2399. Text="{Binding SelectScrewFeeder.Name, Mode=TwoWay}" />
  2400. <!-- 供料器编号 -->
  2401. <!--<TextBlock Text="供料器编号:"
  2402. Grid.Row="2"
  2403. Grid.Column="0"
  2404. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2405. HorizontalAlignment="Right"
  2406. VerticalAlignment="Center" />
  2407. <TextBox Text="{Binding SelectScrewFeeder.FeederNumber,Mode=TwoWay}"
  2408. Grid.Row="2"
  2409. Grid.Column="1"
  2410. Margin="10,0"
  2411. Width="200"
  2412. TextAlignment="Center" />-->
  2413. <!-- 每包螺丝数量 -->
  2414. <TextBlock
  2415. Grid.Row="3"
  2416. Grid.Column="0"
  2417. HorizontalAlignment="Right"
  2418. VerticalAlignment="Center"
  2419. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2420. Text="{lex:Loc 每包螺丝数量}" />
  2421. <mah:NumericUpDown
  2422. Grid.Row="3"
  2423. Grid.Column="1"
  2424. MinWidth="200"
  2425. Margin="10,5"
  2426. FontSize="{DynamicResource Font.Size.Body3}"
  2427. Maximum="10000"
  2428. Minimum="0"
  2429. Value="{Binding SelectScrewFeeder.PackSize, Mode=TwoWay}" />
  2430. <!-- 低量报警阈值 -->
  2431. <TextBlock
  2432. Grid.Row="4"
  2433. Grid.Column="0"
  2434. HorizontalAlignment="Right"
  2435. VerticalAlignment="Center"
  2436. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2437. Text="{lex:Loc 低量报警阈值}" />
  2438. <mah:NumericUpDown
  2439. Grid.Row="4"
  2440. Grid.Column="1"
  2441. MinWidth="200"
  2442. Margin="10,0"
  2443. FontSize="{DynamicResource Font.Size.Body3}"
  2444. Maximum="10000"
  2445. Minimum="0"
  2446. Value="{Binding SelectScrewFeeder.LowLevelThreshold, Mode=TwoWay}" />
  2447. <!-- 是否启用低量报警 -->
  2448. <TextBlock
  2449. Grid.Row="5"
  2450. Grid.Column="0"
  2451. HorizontalAlignment="Right"
  2452. VerticalAlignment="Center"
  2453. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2454. Text="是否启用低量报警:" />
  2455. <CheckBox
  2456. Grid.Row="5"
  2457. Grid.Column="1"
  2458. Margin="10,5"
  2459. VerticalAlignment="Center"
  2460. IsChecked="{Binding SelectScrewFeeder.LowLevelAlarmEnabled, Mode=TwoWay}" />
  2461. </Grid>
  2462. </ScrollViewer>
  2463. </Grid>
  2464. </TabItem>
  2465. <!-- 通讯 -->
  2466. <TabItem>
  2467. <TabItem.Header>
  2468. <StackPanel HorizontalAlignment="Stretch">
  2469. <materialDesign:PackIcon
  2470. Width="24"
  2471. Height="24"
  2472. HorizontalAlignment="Center"
  2473. Kind="Lan" />
  2474. <TextBlock
  2475. HorizontalAlignment="Stretch"
  2476. FontSize="{DynamicResource Font.Size.Body2}"
  2477. Style="{StaticResource TabHeaderTextBlockStyle}"
  2478. Text="{lex:Loc 通讯}" />
  2479. </StackPanel>
  2480. </TabItem.Header>
  2481. <Grid Margin="20" IsEnabled="{Binding IsAllowEdit}">
  2482. <Grid.ColumnDefinitions>
  2483. <ColumnDefinition Width="auto" />
  2484. <ColumnDefinition Width="auto" />
  2485. </Grid.ColumnDefinitions>
  2486. <Grid.RowDefinitions>
  2487. <RowDefinition Height="auto" />
  2488. <RowDefinition Height=" auto" />
  2489. </Grid.RowDefinitions>
  2490. <Button
  2491. Width="60"
  2492. HorizontalAlignment="Left"
  2493. materialDesign:ButtonAssist.CornerRadius="10"
  2494. Command="{Binding SaveCommunicateCommand}"
  2495. CommandParameter="TCPIP"
  2496. Style="{StaticResource MaterialDesignRaisedButton}"
  2497. ToolTip="{lex:Loc 保存}">
  2498. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  2499. </Button>
  2500. <GroupBox
  2501. Grid.Row="1"
  2502. Margin="5,5"
  2503. FontSize="{DynamicResource Font.Size.Title4}"
  2504. Header="{lex:Loc 后台TCPIP服务器}">
  2505. <Grid Margin="20">
  2506. <Grid.ColumnDefinitions>
  2507. <ColumnDefinition Width="auto" />
  2508. <ColumnDefinition Width="auto" />
  2509. </Grid.ColumnDefinitions>
  2510. <Grid.RowDefinitions>
  2511. <RowDefinition Height="auto" />
  2512. <RowDefinition Height=" auto" />
  2513. <RowDefinition Height=" auto" />
  2514. </Grid.RowDefinitions>
  2515. <!-- port -->
  2516. <TextBlock
  2517. Margin="0,0,0,8"
  2518. HorizontalAlignment="Right"
  2519. VerticalAlignment="Center"
  2520. FontSize="{DynamicResource Font.Size.Body3}"
  2521. Text="Port: " />
  2522. <TextBox
  2523. Grid.Row="0"
  2524. Grid.Column="1"
  2525. MinWidth="80"
  2526. Margin="10,4"
  2527. HorizontalAlignment="Left"
  2528. VerticalAlignment="Center"
  2529. FontSize="{DynamicResource Font.Size.Body3}"
  2530. TextAlignment="Center">
  2531. <TextBox.Text>
  2532. <Binding Mode="TwoWay" Path="BgTcp.Port">
  2533. <Binding.ValidationRules>
  2534. <valRules:PortValidationRule />
  2535. </Binding.ValidationRules>
  2536. </Binding>
  2537. </TextBox.Text>
  2538. </TextBox>
  2539. <!-- 结束符 -->
  2540. <TextBlock
  2541. Grid.Row="1"
  2542. Margin="0,0,0,8"
  2543. HorizontalAlignment="Right"
  2544. VerticalAlignment="Center"
  2545. FontSize="{DynamicResource Font.Size.Body3}"
  2546. Text="{lex:Loc 结束符,
  2547. Converter={StaticResource StringFormatConverter},
  2548. ConverterParameter='{}{0}: '}" />
  2549. <ComboBox
  2550. Grid.Row="1"
  2551. Grid.Column="1"
  2552. MinWidth="80"
  2553. Margin="10,4"
  2554. HorizontalAlignment="Left"
  2555. VerticalAlignment="Center"
  2556. HorizontalContentAlignment="Center"
  2557. FontSize="{DynamicResource Font.Size.Body3}"
  2558. ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
  2559. SelectedItem="{Binding BgTcp.Terminator, Mode=TwoWay}" />
  2560. <!-- 编码格式 -->
  2561. <TextBlock
  2562. Grid.Row="2"
  2563. Grid.Column="0"
  2564. HorizontalAlignment="Right"
  2565. VerticalAlignment="Center"
  2566. FontSize="{DynamicResource Font.Size.Body3}"
  2567. Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
  2568. Text="{lex:Loc 编码解码,
  2569. Converter={StaticResource StringFormatConverter},
  2570. ConverterParameter='{}{0}: '}" />
  2571. <ComboBox
  2572. Grid.Row="2"
  2573. Grid.Column="1"
  2574. MinWidth="80"
  2575. Margin="10,4"
  2576. HorizontalAlignment="Left"
  2577. VerticalAlignment="Center"
  2578. HorizontalContentAlignment="Center"
  2579. FontSize="{DynamicResource Font.Size.Body3}"
  2580. ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
  2581. SelectedItem="{Binding BgTcp.DataEncoding, Mode=TwoWay}" />
  2582. </Grid>
  2583. </GroupBox>
  2584. <Button
  2585. Grid.Column="1"
  2586. Width="60"
  2587. HorizontalAlignment="Left"
  2588. materialDesign:ButtonAssist.CornerRadius="10"
  2589. Command="{Binding SaveCommunicateCommand}"
  2590. CommandParameter="ModbusTCP"
  2591. Style="{StaticResource MaterialDesignRaisedButton}"
  2592. ToolTip="{lex:Loc 保存}">
  2593. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  2594. </Button>
  2595. <materialDesign:PopupBox
  2596. Grid.Column="1"
  2597. HorizontalAlignment="Right"
  2598. VerticalAlignment="Center">
  2599. <StackPanel Margin="10" Orientation="Vertical">
  2600. <TextBlock
  2601. Text="功能码 1 ReadCoils 读取DO的状态"
  2602. TextAlignment="Left"
  2603. TextWrapping="Wrap" />
  2604. <TextBlock
  2605. Text="功能码 2 ReadInputs 读取DI的状态"
  2606. TextAlignment="Left"
  2607. TextWrapping="Wrap" />
  2608. <TextBlock
  2609. Text="功能码 3 ReadHoldingRegisters 读取AO的值"
  2610. TextAlignment="Left"
  2611. TextWrapping="Wrap" />
  2612. <TextBlock
  2613. Text="功能码 4 ReadInputRegisters 读取AI的值"
  2614. TextAlignment="Left"
  2615. TextWrapping="Wrap" />
  2616. <TextBlock
  2617. Text="功能码 5 WriteSingleCoil 写入值到DO"
  2618. TextAlignment="Left"
  2619. TextWrapping="Wrap" />
  2620. <TextBlock
  2621. Text="功能码 6 WriteSingleRegister 写入值到AO"
  2622. TextAlignment="Left"
  2623. TextWrapping="Wrap" />
  2624. <TextBlock
  2625. Text="功能码 15 WriteMultipleCoils 写多线圈寄存器"
  2626. TextAlignment="Left"
  2627. TextWrapping="Wrap" />
  2628. <TextBlock
  2629. Text="功能码 16 WriteMultipleRegisters 写多个保持寄存器"
  2630. TextAlignment="Left"
  2631. TextWrapping="Wrap" />
  2632. <TextBlock
  2633. Text="功能码 23 ReadWriteMultipleRegisters 读写多个保持寄存器"
  2634. TextAlignment="Left"
  2635. TextWrapping="Wrap" />
  2636. </StackPanel>
  2637. </materialDesign:PopupBox>
  2638. <GroupBox
  2639. Grid.Row="1"
  2640. Grid.Column="1"
  2641. Margin="5,5"
  2642. FontSize="{DynamicResource Font.Size.Title4}"
  2643. Header="{lex:Loc 后台ModbusTCPSlave}">
  2644. <Grid Margin="20">
  2645. <Grid.ColumnDefinitions>
  2646. <ColumnDefinition Width="auto" />
  2647. <ColumnDefinition Width="auto" />
  2648. </Grid.ColumnDefinitions>
  2649. <Grid.RowDefinitions>
  2650. <RowDefinition Height="auto" />
  2651. <RowDefinition Height=" auto" />
  2652. <RowDefinition Height=" auto" />
  2653. <RowDefinition Height=" auto" />
  2654. </Grid.RowDefinitions>
  2655. <!-- IP -->
  2656. <TextBlock
  2657. Margin="0,0,0,8"
  2658. HorizontalAlignment="Right"
  2659. VerticalAlignment="Center"
  2660. FontSize="{DynamicResource Font.Size.Body3}"
  2661. Text="IP: " />
  2662. <TextBox
  2663. Grid.Row="0"
  2664. Grid.Column="1"
  2665. MinWidth="80"
  2666. Margin="10,4"
  2667. HorizontalAlignment="Left"
  2668. VerticalAlignment="Center"
  2669. FontSize="{DynamicResource Font.Size.Body3}"
  2670. Text="{Binding BgModbus.IP, Mode=TwoWay}"
  2671. TextAlignment="Center" />
  2672. <!-- port -->
  2673. <TextBlock
  2674. Grid.Row="1"
  2675. Margin="0,0,0,8"
  2676. HorizontalAlignment="Right"
  2677. VerticalAlignment="Center"
  2678. FontSize="{DynamicResource Font.Size.Body3}"
  2679. Text="Port: " />
  2680. <TextBox
  2681. Grid.Row="1"
  2682. Grid.Column="1"
  2683. MinWidth="80"
  2684. Margin="10,4"
  2685. HorizontalAlignment="Left"
  2686. VerticalAlignment="Center"
  2687. FontSize="{DynamicResource Font.Size.Body3}"
  2688. Text="{Binding BgModbus.Port, Mode=TwoWay}"
  2689. TextAlignment="Center" />
  2690. <!-- SlaveID -->
  2691. <TextBlock
  2692. Grid.Row="2"
  2693. Margin="0,0,0,8"
  2694. HorizontalAlignment="Right"
  2695. VerticalAlignment="Center"
  2696. FontSize="{DynamicResource Font.Size.Body3}"
  2697. Text="SlaveID: " />
  2698. <TextBox
  2699. Grid.Row="2"
  2700. Grid.Column="1"
  2701. MinWidth="80"
  2702. Margin="10,4"
  2703. HorizontalAlignment="Left"
  2704. VerticalAlignment="Center"
  2705. FontSize="{DynamicResource Font.Size.Body3}"
  2706. Text="{Binding BgModbus.SlaveID, Mode=TwoWay}"
  2707. TextAlignment="Center" />
  2708. <!-- 是否启用 -->
  2709. <TextBlock
  2710. Grid.Row="3"
  2711. Margin="0,0,0,8"
  2712. HorizontalAlignment="Right"
  2713. VerticalAlignment="Center"
  2714. FontSize="{DynamicResource Font.Size.Body3}"
  2715. Text="{lex:Loc 是否启用,
  2716. Converter={StaticResource StringFormatConverter},
  2717. ConverterParameter='{}{0}: '}" />
  2718. <ToggleButton
  2719. Grid.Row="3"
  2720. Grid.Column="1"
  2721. MinWidth="80"
  2722. Margin="10,4"
  2723. HorizontalAlignment="Left"
  2724. VerticalAlignment="Center"
  2725. HorizontalContentAlignment="Center"
  2726. IsChecked="{Binding BgModbus.IsEnabled, Mode=TwoWay}" />
  2727. </Grid>
  2728. </GroupBox>
  2729. </Grid>
  2730. </TabItem>
  2731. <!-- 系统参数 -->
  2732. <TabItem>
  2733. <TabItem.Header>
  2734. <StackPanel HorizontalAlignment="Stretch">
  2735. <materialDesign:PackIcon
  2736. Width="24"
  2737. Height="24"
  2738. HorizontalAlignment="Center"
  2739. Kind="CellphoneSystemUpdate" />
  2740. <TextBlock
  2741. HorizontalAlignment="Stretch"
  2742. FontSize="{DynamicResource Font.Size.Body2}"
  2743. Style="{StaticResource TabHeaderTextBlockStyle}"
  2744. Text="{lex:Loc 系统参数}" />
  2745. </StackPanel>
  2746. </TabItem.Header>
  2747. <Grid Margin="20">
  2748. <ScrollViewer
  2749. HorizontalScrollBarVisibility="Auto"
  2750. VerticalScrollBarVisibility="Auto">
  2751. <Grid IsEnabled="{Binding IsAllowEdit}">
  2752. <Grid.RowDefinitions>
  2753. <RowDefinition Height="Auto" />
  2754. <RowDefinition Height="16" />
  2755. <RowDefinition Height="Auto" />
  2756. <RowDefinition Height="20" />
  2757. <RowDefinition Height="Auto" />
  2758. </Grid.RowDefinitions>
  2759. <Grid Margin="16">
  2760. <Grid.ColumnDefinitions>
  2761. <ColumnDefinition Width="220" />
  2762. <ColumnDefinition Width="260" />
  2763. <ColumnDefinition Width="*" />
  2764. </Grid.ColumnDefinitions>
  2765. <Grid.RowDefinitions>
  2766. <RowDefinition Height="Auto" />
  2767. <RowDefinition Height="Auto" />
  2768. <RowDefinition Height="Auto" />
  2769. <RowDefinition Height="Auto" />
  2770. <RowDefinition Height="Auto" />
  2771. <RowDefinition Height="Auto" />
  2772. <RowDefinition Height="Auto" />
  2773. <RowDefinition Height="Auto" />
  2774. <RowDefinition Height="Auto" />
  2775. <RowDefinition Height="Auto" />
  2776. <RowDefinition Height="Auto" />
  2777. <RowDefinition Height="Auto" />
  2778. </Grid.RowDefinitions>
  2779. <!-- 下相机拍照次数 -->
  2780. <TextBlock
  2781. Grid.Row="0"
  2782. Grid.Column="0"
  2783. Margin="0,8,12,8"
  2784. VerticalAlignment="Center"
  2785. Text="{lex:Loc 下相机拍照次数}" />
  2786. <mah:NumericUpDown
  2787. Grid.Row="0"
  2788. Grid.Column="1"
  2789. Margin="0,6"
  2790. FontSize="{DynamicResource Font.Size.Body3}"
  2791. Maximum="100"
  2792. Minimum="0"
  2793. Value="{Binding DowmCameraNum, Mode=TwoWay}" />
  2794. <!-- 上相机取料拍照次数 -->
  2795. <TextBlock
  2796. Grid.Row="1"
  2797. Grid.Column="0"
  2798. Margin="0,8,12,8"
  2799. VerticalAlignment="Center"
  2800. Text="{lex:Loc 上相机取料拍照次数}" />
  2801. <mah:NumericUpDown
  2802. Grid.Row="1"
  2803. Grid.Column="1"
  2804. Margin="0,6"
  2805. FontSize="{DynamicResource Font.Size.Body3}"
  2806. Maximum="100"
  2807. Minimum="0"
  2808. Value="{Binding UpCameraPickNum, Mode=TwoWay}" />
  2809. <!-- 上相机放料拍照次数 -->
  2810. <TextBlock
  2811. Grid.Row="2"
  2812. Grid.Column="0"
  2813. Margin="0,8,12,8"
  2814. VerticalAlignment="Center"
  2815. Text="{lex:Loc 上相机放料拍照次数}" />
  2816. <mah:NumericUpDown
  2817. Grid.Row="2"
  2818. Grid.Column="1"
  2819. Margin="0,6"
  2820. FontSize="{DynamicResource Font.Size.Body3}"
  2821. Maximum="100"
  2822. Minimum="0"
  2823. Value="{Binding UpCameraPutNum, Mode=TwoWay}" />
  2824. <!-- 上相机锁附/组装次数(复检) -->
  2825. <TextBlock
  2826. Grid.Row="3"
  2827. Grid.Column="0"
  2828. Margin="0,8,12,8"
  2829. VerticalAlignment="Center"
  2830. Text="上相机锁附/组装次数(复检)" />
  2831. <mah:NumericUpDown
  2832. Grid.Row="3"
  2833. Grid.Column="1"
  2834. Margin="0,6"
  2835. FontSize="{DynamicResource Font.Size.Body3}"
  2836. Maximum="100"
  2837. Minimum="0"
  2838. Value="{Binding UPCameracheckNum, Mode=TwoWay}" />
  2839. <!-- 取料固定位置拍产品相机数量 -->
  2840. <TextBlock
  2841. Grid.Row="4"
  2842. Grid.Column="0"
  2843. Margin="0,8,12,8"
  2844. VerticalAlignment="Center"
  2845. Text="{lex:Loc 取料固定位置拍产品相机数量}" />
  2846. <mah:NumericUpDown
  2847. Grid.Row="4"
  2848. Grid.Column="1"
  2849. Margin="0,6"
  2850. FontSize="{DynamicResource Font.Size.Body3}"
  2851. Maximum="10"
  2852. Minimum="0"
  2853. Value="{Binding FixedCameraPickNum, Mode=TwoWay}" />
  2854. <!-- 锁附/组装固定位置拍产品相机数量 -->
  2855. <TextBlock
  2856. Grid.Row="5"
  2857. Grid.Column="0"
  2858. Margin="0,8,12,8"
  2859. VerticalAlignment="Center"
  2860. Text="{lex:Loc 锁附组装固定位置拍产品相机数量}" />
  2861. <mah:NumericUpDown
  2862. Grid.Row="5"
  2863. Grid.Column="1"
  2864. Margin="0,6"
  2865. FontSize="{DynamicResource Font.Size.Body3}"
  2866. Maximum="10"
  2867. Minimum="0"
  2868. Value="{Binding FixedCameraPutNum, Mode=TwoWay}" />
  2869. <!-- 固定相机检测锁附/组装次数 -->
  2870. <TextBlock
  2871. Grid.Row="6"
  2872. Grid.Column="0"
  2873. Margin="0,8,12,8"
  2874. VerticalAlignment="Center"
  2875. Text="{lex:Loc 固定相机检测锁附组装次数}" />
  2876. <mah:NumericUpDown
  2877. Grid.Row="6"
  2878. Grid.Column="1"
  2879. Margin="0,6"
  2880. FontSize="{DynamicResource Font.Size.Body3}"
  2881. Maximum="100"
  2882. Minimum="0"
  2883. Value="{Binding FixedCameracheckNum, Mode=TwoWay}" />
  2884. <!-- 工作模式 -->
  2885. <TextBlock
  2886. Grid.Row="7"
  2887. Grid.Column="0"
  2888. Margin="0,8,12,8"
  2889. VerticalAlignment="Center"
  2890. Text="{lex:Loc 工作模式}" />
  2891. <mah:NumericUpDown
  2892. Grid.Row="7"
  2893. Grid.Column="1"
  2894. Margin="0,6"
  2895. materialDesign:HintAssist.HelperText="1:拍1打1 - 2:拍2打所有 - 3:先拍1打1打3颗再拍2打所有"
  2896. materialDesign:HintAssist.HelperTextFontSize="10"
  2897. FontSize="{DynamicResource Font.Size.Body3}"
  2898. Maximum="100"
  2899. Minimum="0"
  2900. Value="{Binding WorkMode, Mode=TwoWay}" />
  2901. <!-- 取料位置 -->
  2902. <TextBlock
  2903. Grid.Row="8"
  2904. Grid.Column="0"
  2905. Margin="0,8,12,8"
  2906. VerticalAlignment="Center"
  2907. Text="{lex:Loc 取料位置}" />
  2908. <mah:NumericUpDown
  2909. Grid.Row="8"
  2910. Grid.Column="1"
  2911. Margin="0,6"
  2912. materialDesign:HintAssist.HelperText="0:不需要取料 1:需要取料"
  2913. materialDesign:HintAssist.HelperTextFontSize="10"
  2914. FontSize="{DynamicResource Font.Size.Body3}"
  2915. Maximum="100"
  2916. Minimum="0"
  2917. Value="{Binding PickPointNum, Mode=TwoWay}" />
  2918. <!-- 批头矫正模式 -->
  2919. <TextBlock
  2920. Grid.Row="9"
  2921. Grid.Column="0"
  2922. Margin="0,8,12,8"
  2923. VerticalAlignment="Center"
  2924. Text="批头矫正模式" />
  2925. <mah:NumericUpDown
  2926. Grid.Row="9"
  2927. Grid.Column="1"
  2928. Margin="0,6"
  2929. materialDesign:HintAssist.HelperText="1:初始化时矫正 2:每个产品矫正一次 3:每颗螺丝矫正一次"
  2930. materialDesign:HintAssist.HelperTextFontSize="10"
  2931. FontSize="{DynamicResource Font.Size.Body3}"
  2932. Maximum="100"
  2933. Minimum="0"
  2934. ToolTip="1:初始化时矫正,2:每个产品矫正一次,3:每颗螺丝矫正一次"
  2935. Value="{Binding ScrewTeachNum, Mode=TwoWay}" />
  2936. <!-- 保存锁付曲线 -->
  2937. <TextBlock
  2938. Grid.Row="10"
  2939. Grid.Column="0"
  2940. Margin="0,8,12,8"
  2941. VerticalAlignment="Center"
  2942. Text="锁付曲线图保存" />
  2943. <Grid
  2944. Grid.Row="10"
  2945. Grid.Column="1"
  2946. Grid.ColumnSpan="2"
  2947. Margin="0,6,0,6">
  2948. <Grid.ColumnDefinitions>
  2949. <ColumnDefinition Width="Auto" />
  2950. <ColumnDefinition Width="12" />
  2951. <ColumnDefinition Width="*" />
  2952. <ColumnDefinition Width="Auto" />
  2953. </Grid.ColumnDefinitions>
  2954. <CheckBox
  2955. Grid.Column="0"
  2956. VerticalAlignment="Center"
  2957. Content="启用保存锁付曲线图"
  2958. FontSize="{DynamicResource Font.Size.Body3}"
  2959. IsChecked="{Binding IsSaveScrewCurve, Mode=TwoWay}" />
  2960. <TextBox
  2961. Grid.Column="2"
  2962. MinWidth="260"
  2963. VerticalAlignment="Center"
  2964. IsEnabled="{Binding IsSaveScrewCurve}"
  2965. Text="{Binding ScrewCurvePath, Mode=TwoWay}" />
  2966. <Button
  2967. Grid.Column="3"
  2968. Margin="8,0,0,0"
  2969. VerticalAlignment="Center"
  2970. Command="{Binding BrowseScrewCurvePathCommand}"
  2971. IsEnabled="{Binding IsSaveScrewCurve}"
  2972. Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}">
  2973. <materialDesign:PackIcon Kind="FolderOpen" />
  2974. </Button>
  2975. </Grid>
  2976. <!-- 扫码流程设置 -->
  2977. <TextBlock
  2978. Grid.Row="11"
  2979. Grid.Column="0"
  2980. Margin="0,8,12,8"
  2981. VerticalAlignment="Top"
  2982. Text="扫码流程设置" />
  2983. <StackPanel
  2984. Grid.Row="11"
  2985. Grid.Column="1"
  2986. Grid.ColumnSpan="2"
  2987. Margin="0,6,0,0"
  2988. Orientation="Vertical">
  2989. <WrapPanel Margin="0,0,0,8">
  2990. <CheckBox
  2991. Margin="0,0,20,8"
  2992. Content="是否启用最后一次拍照关闭光源"
  2993. FontSize="{DynamicResource Font.Size.Body3}"
  2994. IsChecked="{Binding IsBasePartOpenLight, Mode=TwoWay}" />
  2995. <CheckBox
  2996. Margin="0,0,20,8"
  2997. Content="是否启用KB复检"
  2998. FontSize="{DynamicResource Font.Size.Body3}"
  2999. IsChecked="{Binding IsBasePartOpenLightKB, Mode=TwoWay}" />
  3000. <CheckBox
  3001. Margin="0,0,20,8"
  3002. Content="是否MES结果为1"
  3003. FontSize="{DynamicResource Font.Size.Body3}"
  3004. IsChecked="{Binding IsMesResult, Mode=TwoWay}" />
  3005. </WrapPanel>
  3006. <WrapPanel Margin="0,0,0,8">
  3007. <CheckBox
  3008. Margin="0,0,20,8"
  3009. Content="是否基于零件码获取流程码"
  3010. FontSize="{DynamicResource Font.Size.Body3}"
  3011. IsChecked="{Binding IsBasePartCodeGetSN, Mode=TwoWay}" />
  3012. <CheckBox
  3013. Margin="0,0,20,8"
  3014. Content="是否通过零件码判断螺丝型号"
  3015. FontSize="{DynamicResource Font.Size.Body3}"
  3016. IsChecked="{Binding IsBasePartCodeChooseScrew, Mode=TwoWay}" />
  3017. </WrapPanel>
  3018. <TextBox
  3019. Width="320"
  3020. HorizontalAlignment="Left"
  3021. materialDesign:HintAssist.Hint="螺丝型号匹配规则"
  3022. BorderThickness="1"
  3023. Text="{Binding ChooseScrewModel, Mode=TwoWay}"
  3024. ToolTip="螺丝型号判断,如******123**,*为忽略字符" />
  3025. </StackPanel>
  3026. </Grid>
  3027. <!-- 保存系统参数 -->
  3028. <DockPanel Grid.Row="2" LastChildFill="False">
  3029. <Button
  3030. Height="40"
  3031. MinWidth="150"
  3032. HorizontalAlignment="Right"
  3033. materialDesign:ButtonAssist.CornerRadius="10"
  3034. Command="{Binding SaveSystemParametersCommand}"
  3035. DockPanel.Dock="Right"
  3036. IsEnabled="{Binding IsAllowEdit}"
  3037. Style="{StaticResource MaterialDesignRaisedButton}">
  3038. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3039. <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
  3040. <TextBlock VerticalAlignment="Center" Text="{lex:Loc 保存系统参数}" />
  3041. </StackPanel>
  3042. </Button>
  3043. </DockPanel>
  3044. <StackPanel
  3045. Grid.Row="4"
  3046. Margin="0,12,0,0"
  3047. Orientation="Horizontal">
  3048. <!-- 刷卡参数配置 -->
  3049. <GroupBox
  3050. Width="280"
  3051. Margin="0,0,50,0"
  3052. HorizontalAlignment="Left"
  3053. Header="刷卡器配置">
  3054. <Grid Margin="10">
  3055. <Grid.ColumnDefinitions>
  3056. <ColumnDefinition Width="auto" />
  3057. <ColumnDefinition Width="*" />
  3058. </Grid.ColumnDefinitions>
  3059. <Grid.RowDefinitions>
  3060. <RowDefinition Height="Auto" />
  3061. <RowDefinition Height="Auto" />
  3062. <RowDefinition Height="Auto" />
  3063. <RowDefinition Height="Auto" />
  3064. <RowDefinition Height="Auto" />
  3065. <RowDefinition Height="Auto" />
  3066. </Grid.RowDefinitions>
  3067. <TextBlock
  3068. Grid.Row="0"
  3069. Grid.Column="0"
  3070. HorizontalAlignment="Right"
  3071. Text="PortName:" />
  3072. <TextBox
  3073. Grid.Row="0"
  3074. Grid.Column="1"
  3075. Margin="6,0"
  3076. Text="{Binding CardReaderConfig.PortName, Mode=TwoWay}" />
  3077. <TextBlock
  3078. Grid.Row="1"
  3079. Grid.Column="0"
  3080. HorizontalAlignment="Right"
  3081. Text="BaudRate:" />
  3082. <TextBox
  3083. Grid.Row="1"
  3084. Grid.Column="1"
  3085. Margin="6,0"
  3086. Text="{Binding CardReaderConfig.BaudRate, Mode=TwoWay}" />
  3087. <TextBlock
  3088. Grid.Row="2"
  3089. Grid.Column="0"
  3090. HorizontalAlignment="Right"
  3091. Text="Parity:" />
  3092. <ComboBox
  3093. Grid.Row="2"
  3094. Grid.Column="1"
  3095. ItemsSource="{Binding Source={StaticResource Parity}}"
  3096. SelectedItem="{Binding CardReaderConfig.Parity, Mode=TwoWay}" />
  3097. <TextBlock
  3098. Grid.Row="3"
  3099. Grid.Column="0"
  3100. HorizontalAlignment="Right"
  3101. Text="StopBits:" />
  3102. <ComboBox
  3103. Grid.Row="3"
  3104. Grid.Column="1"
  3105. ItemsSource="{Binding Source={StaticResource StopBits}}"
  3106. SelectedItem="{Binding CardReaderConfig.StopBits, Mode=TwoWay}" />
  3107. <TextBlock
  3108. Grid.Row="4"
  3109. Grid.Column="0"
  3110. HorizontalAlignment="Right"
  3111. Text="DataBits:" />
  3112. <TextBox
  3113. Grid.Row="4"
  3114. Grid.Column="1"
  3115. Margin="6,0"
  3116. Text="{Binding CardReaderConfig.DataBits, Mode=TwoWay}" />
  3117. <Button
  3118. Grid.Row="5"
  3119. Grid.Column="1"
  3120. MinWidth="120"
  3121. Margin="0,6"
  3122. materialDesign:ButtonAssist.CornerRadius="10"
  3123. Command="{Binding SaveCardReaderConfigCommand}"
  3124. Style="{StaticResource MaterialDesignRaisedButton}">
  3125. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3126. <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
  3127. <TextBlock VerticalAlignment="Center" Text="保存刷卡器配置" />
  3128. </StackPanel>
  3129. </Button>
  3130. </Grid>
  3131. </GroupBox>
  3132. <GroupBox Width="280" Header="扭力测量仪配置">
  3133. <Grid Margin="10">
  3134. <Grid.ColumnDefinitions>
  3135. <ColumnDefinition Width="auto" />
  3136. <ColumnDefinition Width="*" />
  3137. </Grid.ColumnDefinitions>
  3138. <Grid.RowDefinitions>
  3139. <RowDefinition Height="Auto" />
  3140. <RowDefinition Height="Auto" />
  3141. <RowDefinition Height="Auto" />
  3142. <RowDefinition Height="Auto" />
  3143. <RowDefinition Height="Auto" />
  3144. <RowDefinition Height="Auto" />
  3145. </Grid.RowDefinitions>
  3146. <TextBlock
  3147. Grid.Row="0"
  3148. Grid.Column="0"
  3149. HorizontalAlignment="Right"
  3150. Text="PortName:" />
  3151. <TextBox
  3152. Grid.Row="0"
  3153. Grid.Column="1"
  3154. Margin="6,0"
  3155. Text="{Binding TorqueReadConfig.PortName, Mode=TwoWay}" />
  3156. <TextBlock
  3157. Grid.Row="1"
  3158. Grid.Column="0"
  3159. HorizontalAlignment="Right"
  3160. Text="BaudRate:" />
  3161. <TextBox
  3162. Grid.Row="1"
  3163. Grid.Column="1"
  3164. Margin="6,0"
  3165. Text="{Binding TorqueReadConfig.BaudRate, Mode=TwoWay}" />
  3166. <TextBlock
  3167. Grid.Row="2"
  3168. Grid.Column="0"
  3169. HorizontalAlignment="Right"
  3170. Text="Parity:" />
  3171. <ComboBox
  3172. Grid.Row="2"
  3173. Grid.Column="1"
  3174. ItemsSource="{Binding Source={StaticResource Parity}}"
  3175. SelectedItem="{Binding TorqueReadConfig.Parity, Mode=TwoWay}" />
  3176. <TextBlock
  3177. Grid.Row="3"
  3178. Grid.Column="0"
  3179. HorizontalAlignment="Right"
  3180. Text="StopBits:" />
  3181. <ComboBox
  3182. Grid.Row="3"
  3183. Grid.Column="1"
  3184. ItemsSource="{Binding Source={StaticResource StopBits}}"
  3185. SelectedItem="{Binding TorqueReadConfig.StopBits, Mode=TwoWay}" />
  3186. <TextBlock
  3187. Grid.Row="4"
  3188. Grid.Column="0"
  3189. HorizontalAlignment="Right"
  3190. Text="DataBits:" />
  3191. <TextBox
  3192. Grid.Row="4"
  3193. Grid.Column="1"
  3194. Margin="6,0"
  3195. Text="{Binding TorqueReadConfig.DataBits, Mode=TwoWay}" />
  3196. <Button
  3197. Grid.Row="5"
  3198. Grid.Column="1"
  3199. MinWidth="120"
  3200. Margin="0,6"
  3201. materialDesign:ButtonAssist.CornerRadius="10"
  3202. Command="{Binding SaveTorqueReaderConfigCommand}"
  3203. Style="{StaticResource MaterialDesignRaisedButton}">
  3204. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3205. <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
  3206. <TextBlock VerticalAlignment="Center" Text="保存扭力测量仪配置" />
  3207. </StackPanel>
  3208. </Button>
  3209. </Grid>
  3210. </GroupBox>
  3211. </StackPanel>
  3212. </Grid>
  3213. </ScrollViewer>
  3214. </Grid>
  3215. </TabItem>
  3216. <!-- 产品信息 -->
  3217. <TabItem>
  3218. <TabItem.Header>
  3219. <StackPanel HorizontalAlignment="Stretch">
  3220. <materialDesign:PackIcon
  3221. Width="24"
  3222. Height="24"
  3223. HorizontalAlignment="Center"
  3224. Kind="BallotOutline" />
  3225. <TextBlock
  3226. HorizontalAlignment="Stretch"
  3227. FontSize="{DynamicResource Font.Size.Body2}"
  3228. Style="{StaticResource TabHeaderTextBlockStyle}"
  3229. Text="产品信息" />
  3230. </StackPanel>
  3231. </TabItem.Header>
  3232. <StackPanel Margin="16">
  3233. <GroupBox
  3234. Width="400"
  3235. Margin="10,5"
  3236. HorizontalAlignment="Left"
  3237. FontSize="{DynamicResource Font.Size.Title4}"
  3238. Header="产品与mes参数绑定设置">
  3239. <Grid Margin="20">
  3240. <Grid.ColumnDefinitions>
  3241. <ColumnDefinition Width="auto" />
  3242. <ColumnDefinition Width="auto" />
  3243. </Grid.ColumnDefinitions>
  3244. <Grid.RowDefinitions>
  3245. <RowDefinition Height=" auto" />
  3246. <RowDefinition Height=" auto" />
  3247. <RowDefinition Height=" auto" />
  3248. <RowDefinition Height=" auto" />
  3249. <RowDefinition Height=" auto" />
  3250. </Grid.RowDefinitions>
  3251. <TextBlock
  3252. Margin="0,0,0,8"
  3253. HorizontalAlignment="Right"
  3254. VerticalAlignment="Center"
  3255. FontSize="{DynamicResource Font.Size.Body3}"
  3256. Text="产品名称:" />
  3257. <ComboBox
  3258. x:Name="selectProduct"
  3259. Grid.Column="1"
  3260. Width="100"
  3261. Margin="10,4"
  3262. HorizontalAlignment="Left"
  3263. materialDesign:HintAssist.Hint="{lex:Loc 选择产品}"
  3264. FontSize="14"
  3265. ItemsSource="{Binding ProductList, Mode=TwoWay}"
  3266. SelectedItem="{Binding SelectProduct, Mode=TwoWay}">
  3267. <ComboBox.ItemTemplate>
  3268. <DataTemplate>
  3269. <StackPanel Orientation="Vertical">
  3270. <StackPanel Orientation="Horizontal">
  3271. <materialDesign:PackIcon Kind="CubeOutline" />
  3272. <TextBlock Text="{Binding Name}" />
  3273. </StackPanel>
  3274. <TextBlock
  3275. MinHeight="0"
  3276. MaxWidth="300"
  3277. FontSize="{DynamicResource Font.Size.Captions4}"
  3278. Foreground="Gray"
  3279. Text="{Binding Description}"
  3280. TextTrimming="CharacterEllipsis"
  3281. TextWrapping="Wrap" />
  3282. </StackPanel>
  3283. </DataTemplate>
  3284. </ComboBox.ItemTemplate>
  3285. </ComboBox>
  3286. <TextBlock
  3287. Grid.Row="1"
  3288. Margin="0,0,0,8"
  3289. HorizontalAlignment="Right"
  3290. VerticalAlignment="Center"
  3291. FontSize="{DynamicResource Font.Size.Body3}"
  3292. Text="产品编码(model):" />
  3293. <TextBox
  3294. Grid.Row="1"
  3295. Grid.Column="1"
  3296. MinWidth="100"
  3297. Margin="10,4"
  3298. HorizontalAlignment="Left"
  3299. VerticalAlignment="Center"
  3300. FontSize="{DynamicResource Font.Size.Body3}"
  3301. TextAlignment="Center">
  3302. <TextBox.Text>
  3303. <Binding Mode="TwoWay" Path="ProMesInfo.ProductCode" />
  3304. </TextBox.Text>
  3305. </TextBox>
  3306. <TextBlock
  3307. Grid.Row="2"
  3308. Margin="0,0,0,8"
  3309. HorizontalAlignment="Right"
  3310. VerticalAlignment="Center"
  3311. FontSize="{DynamicResource Font.Size.Body3}"
  3312. Text="产品颜色:" />
  3313. <TextBox
  3314. Grid.Row="2"
  3315. Grid.Column="1"
  3316. MinWidth="100"
  3317. Margin="10,4"
  3318. HorizontalAlignment="Left"
  3319. VerticalAlignment="Center"
  3320. FontSize="{DynamicResource Font.Size.Body3}"
  3321. TextAlignment="Center">
  3322. <TextBox.Text>
  3323. <Binding Mode="TwoWay" Path="ProMesInfo.ProductColor" />
  3324. </TextBox.Text>
  3325. </TextBox>
  3326. <TextBlock
  3327. Grid.Row="3"
  3328. Margin="0,0,0,8"
  3329. HorizontalAlignment="Right"
  3330. VerticalAlignment="Center"
  3331. FontSize="{DynamicResource Font.Size.Body3}"
  3332. Text="产品类型:" />
  3333. <TextBox
  3334. Grid.Row="3"
  3335. Grid.Column="1"
  3336. MinWidth="100"
  3337. Margin="10,4"
  3338. HorizontalAlignment="Left"
  3339. VerticalAlignment="Center"
  3340. FontSize="{DynamicResource Font.Size.Body3}"
  3341. TextAlignment="Center">
  3342. <TextBox.Text>
  3343. <Binding Mode="TwoWay" Path="ProMesInfo.ProductLoadMode" />
  3344. </TextBox.Text>
  3345. </TextBox>
  3346. <StackPanel
  3347. Grid.Row="6"
  3348. Grid.ColumnSpan="2"
  3349. Margin="0,6"
  3350. HorizontalAlignment="Center"
  3351. Orientation="Horizontal">
  3352. <Button
  3353. MinWidth="100"
  3354. Margin="5"
  3355. materialDesign:ButtonAssist.CornerRadius="10"
  3356. Command="{Binding GetProWithMesCommand}"
  3357. Style="{StaticResource MaterialDesignRaisedButton}">
  3358. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3359. <materialDesign:PackIcon Margin="0,0,6,0" Kind="PuzzleEditOutline" />
  3360. <TextBlock VerticalAlignment="Center" Text="获取" />
  3361. </StackPanel>
  3362. </Button>
  3363. <Button
  3364. MinWidth="100"
  3365. Margin="5"
  3366. materialDesign:ButtonAssist.CornerRadius="10"
  3367. Command="{Binding DeleteProWithMesCommand}"
  3368. Style="{StaticResource MaterialDesignRaisedButton}">
  3369. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3370. <materialDesign:PackIcon Margin="0,0,6,0" Kind="DeleteForeverOutline" />
  3371. <TextBlock VerticalAlignment="Center" Text="删除" />
  3372. </StackPanel>
  3373. </Button>
  3374. <Button
  3375. MinWidth="100"
  3376. Margin="5"
  3377. materialDesign:ButtonAssist.CornerRadius="10"
  3378. Command="{Binding SaveProWithMesCommand}"
  3379. Style="{StaticResource MaterialDesignRaisedButton}">
  3380. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  3381. <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
  3382. <TextBlock VerticalAlignment="Center" Text="保存" />
  3383. </StackPanel>
  3384. </Button>
  3385. </StackPanel>
  3386. </Grid>
  3387. </GroupBox>
  3388. </StackPanel>
  3389. </TabItem>
  3390. <!-- 生产排班 -->
  3391. <TabItem>
  3392. <TabItem.Header>
  3393. <StackPanel HorizontalAlignment="Stretch">
  3394. <materialDesign:PackIcon
  3395. Width="24"
  3396. Height="24"
  3397. HorizontalAlignment="Center"
  3398. Kind="LanConnect" />
  3399. <TextBlock
  3400. HorizontalAlignment="Stretch"
  3401. FontSize="{DynamicResource Font.Size.Body2}"
  3402. Style="{StaticResource TabHeaderTextBlockStyle}"
  3403. Text="{lex:Loc 生产排班}" />
  3404. </StackPanel>
  3405. </TabItem.Header>
  3406. <StackPanel Margin="16">
  3407. <Button
  3408. Width="60"
  3409. Margin="10"
  3410. HorizontalAlignment="Left"
  3411. materialDesign:ButtonAssist.CornerRadius="10"
  3412. Command="{Binding SaveWorkShiftCommand}"
  3413. CommandParameter="WorkShift"
  3414. Style="{StaticResource MaterialDesignRaisedButton}"
  3415. ToolTip="{lex:Loc 保存}">
  3416. <materialDesign:PackIcon Kind="ContentSaveCheck" />
  3417. </Button>
  3418. <GroupBox
  3419. Width="320"
  3420. Margin="10,5"
  3421. HorizontalAlignment="Left"
  3422. FontSize="{DynamicResource Font.Size.Title4}"
  3423. Header="白夜班时间设置">
  3424. <Grid Margin="20">
  3425. <Grid.ColumnDefinitions>
  3426. <ColumnDefinition Width="auto" />
  3427. <ColumnDefinition Width="auto" />
  3428. <ColumnDefinition Width="auto" />
  3429. </Grid.ColumnDefinitions>
  3430. <Grid.RowDefinitions>
  3431. <RowDefinition Height="auto" />
  3432. <RowDefinition Height=" auto" />
  3433. <RowDefinition Height=" auto" />
  3434. <RowDefinition Height=" auto" />
  3435. </Grid.RowDefinitions>
  3436. <TextBlock
  3437. Margin="0,0,0,8"
  3438. HorizontalAlignment="Right"
  3439. VerticalAlignment="Center"
  3440. FontSize="{DynamicResource Font.Size.Body3}"
  3441. Text="白班开始时间:" />
  3442. <TextBox
  3443. Grid.Row="0"
  3444. Grid.Column="1"
  3445. MinWidth="80"
  3446. Margin="10,4"
  3447. HorizontalAlignment="Left"
  3448. VerticalAlignment="Center"
  3449. FontSize="{DynamicResource Font.Size.Body3}"
  3450. TextAlignment="Center">
  3451. <TextBox.Text>
  3452. <Binding Mode="TwoWay" Path="WorkShifts.DayShift" />
  3453. </TextBox.Text>
  3454. </TextBox>
  3455. <TextBlock
  3456. Grid.Row="1"
  3457. Margin="0,0,0,8"
  3458. HorizontalAlignment="Right"
  3459. VerticalAlignment="Center"
  3460. FontSize="{DynamicResource Font.Size.Body3}"
  3461. Text="白班结束时间:" />
  3462. <TextBox
  3463. Grid.Row="1"
  3464. Grid.Column="1"
  3465. MinWidth="80"
  3466. Margin="10,4"
  3467. HorizontalAlignment="Left"
  3468. VerticalAlignment="Center"
  3469. FontSize="{DynamicResource Font.Size.Body3}"
  3470. TextAlignment="Center">
  3471. <TextBox.Text>
  3472. <Binding Mode="TwoWay" Path="WorkShifts.DayShift" />
  3473. </TextBox.Text>
  3474. </TextBox>
  3475. <StackPanel
  3476. Grid.RowSpan="2"
  3477. Grid.Column="2"
  3478. Margin="10,5"
  3479. HorizontalAlignment="Center">
  3480. <ToggleButton
  3481. Width="60"
  3482. Height="40"
  3483. Margin="0,10" />
  3484. </StackPanel>
  3485. <!-- 结束符 -->
  3486. <TextBlock
  3487. Grid.Row="2"
  3488. Margin="0,0,0,8"
  3489. HorizontalAlignment="Right"
  3490. VerticalAlignment="Center"
  3491. FontSize="{DynamicResource Font.Size.Body3}"
  3492. Text="夜班开始时间:" />
  3493. <TextBox
  3494. Grid.Row="2"
  3495. Grid.Column="1"
  3496. MinWidth="80"
  3497. Margin="10,4"
  3498. HorizontalAlignment="Left"
  3499. VerticalAlignment="Center"
  3500. FontSize="{DynamicResource Font.Size.Body3}"
  3501. TextAlignment="Center">
  3502. <TextBox.Text>
  3503. <Binding Mode="TwoWay" Path="WorkShifts.NightShift" />
  3504. </TextBox.Text>
  3505. </TextBox>
  3506. <TextBlock
  3507. Grid.Row="3"
  3508. Margin="0,0,0,8"
  3509. HorizontalAlignment="Right"
  3510. VerticalAlignment="Center"
  3511. FontSize="{DynamicResource Font.Size.Body3}"
  3512. Text="夜班结束时间:" />
  3513. <TextBox
  3514. Grid.Row="3"
  3515. Grid.Column="1"
  3516. MinWidth="80"
  3517. Margin="10,4"
  3518. HorizontalAlignment="Left"
  3519. VerticalAlignment="Center"
  3520. FontSize="{DynamicResource Font.Size.Body3}"
  3521. TextAlignment="Center">
  3522. <TextBox.Text>
  3523. <Binding Mode="TwoWay" Path="WorkShifts.NightShift" />
  3524. </TextBox.Text>
  3525. </TextBox>
  3526. <ToggleButton
  3527. Grid.Row="2"
  3528. Grid.RowSpan="2"
  3529. Grid.Column="2"
  3530. Width="60"
  3531. Height="40"
  3532. Margin="10,5"
  3533. HorizontalAlignment="Center" />
  3534. </Grid>
  3535. </GroupBox>
  3536. <!--<Button Style="{StaticResource MaterialDesignRaisedButton}"
  3537. materialDesign:ButtonAssist.CornerRadius="10"
  3538. Width="60"
  3539. Margin="10"
  3540. Content="test"
  3541. HorizontalAlignment="Left"
  3542. Command="{Binding testCommand}">
  3543. </Button>-->
  3544. </StackPanel>
  3545. </TabItem>
  3546. <!-- 字体 -->
  3547. <TabItem>
  3548. <TabItem.Header>
  3549. <StackPanel HorizontalAlignment="Stretch">
  3550. <materialDesign:PackIcon
  3551. Width="24"
  3552. Height="24"
  3553. HorizontalAlignment="Center"
  3554. Kind="FontSize" />
  3555. <TextBlock
  3556. HorizontalAlignment="Stretch"
  3557. FontSize="{DynamicResource Font.Size.Body2}"
  3558. Style="{StaticResource TabHeaderTextBlockStyle}"
  3559. Text="{lex:Loc 字体}" />
  3560. </StackPanel>
  3561. </TabItem.Header>
  3562. <ScrollViewer>
  3563. <Grid Margin="20">
  3564. <Grid.RowDefinitions>
  3565. <RowDefinition Height="auto" />
  3566. <RowDefinition Height="auto" />
  3567. <RowDefinition Height="auto" />
  3568. <RowDefinition Height="auto" />
  3569. <RowDefinition Height="auto" />
  3570. <RowDefinition Height="auto" />
  3571. <RowDefinition Height="auto" />
  3572. <RowDefinition Height="auto" />
  3573. <RowDefinition Height="auto" />
  3574. <RowDefinition Height="auto" />
  3575. <RowDefinition Height="auto" />
  3576. <RowDefinition Height="auto" />
  3577. </Grid.RowDefinitions>
  3578. <Grid.ColumnDefinitions>
  3579. <ColumnDefinition Width="auto" />
  3580. <ColumnDefinition Width="auto" />
  3581. </Grid.ColumnDefinitions>
  3582. <Grid.Resources>
  3583. <Style TargetType="TextBlock">
  3584. <Setter Property="FontSize" Value="{DynamicResource Font.Size.Body2}" />
  3585. <Setter Property="VerticalAlignment" Value="Center" />
  3586. <Setter Property="HorizontalAlignment" Value="Right" />
  3587. </Style>
  3588. <Style TargetType="mah:NumericUpDown">
  3589. <Setter Property="FontSize" Value="{DynamicResource Font.Size.Body2}" />
  3590. <Setter Property="Margin" Value="5,2" />
  3591. <Setter Property="MinWidth" Value="100" />
  3592. <Setter Property="HorizontalContentAlignment" Value="Center" />
  3593. <Setter Property="VerticalContentAlignment" Value="Center" />
  3594. <Setter Property="Minimum" Value="6" />
  3595. <Setter Property="Interval" Value="2" />
  3596. <Setter Property="Maximum" Value="62" />
  3597. <Setter Property="StringFormat" Value="{}{0:N0}" />
  3598. </Style>
  3599. </Grid.Resources>
  3600. <!-- 1 -->
  3601. <TextBlock
  3602. Grid.Row="0"
  3603. Grid.Column="0"
  3604. Text="{lex:Loc 标题,
  3605. Converter={StaticResource StringFormatConverter},
  3606. ConverterParameter='{}{0}1: '}" />
  3607. <mah:NumericUpDown
  3608. Grid.Row="0"
  3609. Grid.Column="1"
  3610. materialDesign:HintAssist.Hint="Font Size"
  3611. Value="{Binding Title1, Mode=TwoWay}" />
  3612. <!-- 2 -->
  3613. <TextBlock
  3614. Grid.Row="1"
  3615. Grid.Column="0"
  3616. Text="{lex:Loc 标题,
  3617. Converter={StaticResource StringFormatConverter},
  3618. ConverterParameter='{}{0}2: '}" />
  3619. <mah:NumericUpDown
  3620. Grid.Row="1"
  3621. Grid.Column="1"
  3622. materialDesign:HintAssist.Hint="Font Size"
  3623. Value="{Binding Title2, Mode=TwoWay}" />
  3624. <!-- 3 -->
  3625. <TextBlock
  3626. Grid.Row="2"
  3627. Grid.Column="0"
  3628. Text="{lex:Loc 标题,
  3629. Converter={StaticResource StringFormatConverter},
  3630. ConverterParameter='{}{0}3: '}" />
  3631. <mah:NumericUpDown
  3632. Grid.Row="2"
  3633. Grid.Column="1"
  3634. materialDesign:HintAssist.Hint="Font Size"
  3635. Value="{Binding Title3, Mode=TwoWay}" />
  3636. <!-- 4 -->
  3637. <TextBlock
  3638. Grid.Row="3"
  3639. Grid.Column="0"
  3640. Text="{lex:Loc 标题,
  3641. Converter={StaticResource StringFormatConverter},
  3642. ConverterParameter='{}{0}4: '}" />
  3643. <mah:NumericUpDown
  3644. Grid.Row="3"
  3645. Grid.Column="1"
  3646. materialDesign:HintAssist.Hint="Font Size"
  3647. Value="{Binding Title4, Mode=TwoWay}" />
  3648. <!-- 5 -->
  3649. <TextBlock
  3650. Grid.Row="4"
  3651. Grid.Column="0"
  3652. Text="{lex:Loc 正文,
  3653. Converter={StaticResource StringFormatConverter},
  3654. ConverterParameter='{}{0}1: '}" />
  3655. <mah:NumericUpDown
  3656. Grid.Row="4"
  3657. Grid.Column="1"
  3658. materialDesign:HintAssist.Hint="Font Size"
  3659. Value="{Binding Body1, Mode=TwoWay}" />
  3660. <!-- 6 -->
  3661. <TextBlock
  3662. Grid.Row="5"
  3663. Grid.Column="0"
  3664. Text="{lex:Loc 正文,
  3665. Converter={StaticResource StringFormatConverter},
  3666. ConverterParameter='{}{0}2: '}" />
  3667. <mah:NumericUpDown
  3668. Grid.Row="5"
  3669. Grid.Column="1"
  3670. materialDesign:HintAssist.Hint="Font Size"
  3671. Value="{Binding Body2, Mode=TwoWay}" />
  3672. <!-- 7 -->
  3673. <TextBlock
  3674. Grid.Row="6"
  3675. Grid.Column="0"
  3676. Text="{lex:Loc 正文,
  3677. Converter={StaticResource StringFormatConverter},
  3678. ConverterParameter='{}{0}3: '}" />
  3679. <mah:NumericUpDown
  3680. Grid.Row="6"
  3681. Grid.Column="1"
  3682. materialDesign:HintAssist.Hint="Font Size"
  3683. Value="{Binding Body3, Mode=TwoWay}" />
  3684. <!-- 8 -->
  3685. <TextBlock
  3686. Grid.Row="7"
  3687. Grid.Column="0"
  3688. Text="{lex:Loc 正文,
  3689. Converter={StaticResource StringFormatConverter},
  3690. ConverterParameter='{}{0}4: '}" />
  3691. <mah:NumericUpDown
  3692. Grid.Row="7"
  3693. Grid.Column="1"
  3694. materialDesign:HintAssist.Hint="Font Size"
  3695. Value="{Binding Body4, Mode=TwoWay}" />
  3696. <!-- 9 -->
  3697. <TextBlock
  3698. Grid.Row="8"
  3699. Grid.Column="0"
  3700. Text="{lex:Loc 标注,
  3701. Converter={StaticResource StringFormatConverter},
  3702. ConverterParameter='{}{0}1: '}" />
  3703. <mah:NumericUpDown
  3704. Grid.Row="8"
  3705. Grid.Column="1"
  3706. materialDesign:HintAssist.Hint="Font Size"
  3707. Value="{Binding Captions1, Mode=TwoWay}" />
  3708. <!-- 10 -->
  3709. <TextBlock
  3710. Grid.Row="9"
  3711. Grid.Column="0"
  3712. Text="{lex:Loc 标注,
  3713. Converter={StaticResource StringFormatConverter},
  3714. ConverterParameter='{}{0}2: '}" />
  3715. <mah:NumericUpDown
  3716. Grid.Row="9"
  3717. Grid.Column="1"
  3718. materialDesign:HintAssist.Hint="Font Size"
  3719. Value="{Binding Captions2, Mode=TwoWay}" />
  3720. <!-- 11 -->
  3721. <TextBlock
  3722. Grid.Row="10"
  3723. Grid.Column="0"
  3724. Text="{lex:Loc 标注,
  3725. Converter={StaticResource StringFormatConverter},
  3726. ConverterParameter='{}{0}3: '}" />
  3727. <mah:NumericUpDown
  3728. Grid.Row="10"
  3729. Grid.Column="1"
  3730. materialDesign:HintAssist.Hint="Font Size"
  3731. Value="{Binding Captions3, Mode=TwoWay}" />
  3732. <!-- 12 -->
  3733. <TextBlock
  3734. Grid.Row="11"
  3735. Grid.Column="0"
  3736. Text="{lex:Loc 标注,
  3737. Converter={StaticResource StringFormatConverter},
  3738. ConverterParameter='{}{0}4: '}" />
  3739. <mah:NumericUpDown
  3740. Grid.Row="11"
  3741. Grid.Column="1"
  3742. materialDesign:HintAssist.Hint="Font Size"
  3743. Value="{Binding Captions4, Mode=TwoWay}" />
  3744. </Grid>
  3745. </ScrollViewer>
  3746. </TabItem>
  3747. <!-- 语言 -->
  3748. <TabItem>
  3749. <TabItem.Header>
  3750. <StackPanel HorizontalAlignment="Stretch">
  3751. <materialDesign:PackIcon
  3752. Width="24"
  3753. Height="24"
  3754. HorizontalAlignment="Center"
  3755. Kind="TranslateVariant" />
  3756. <TextBlock
  3757. HorizontalAlignment="Stretch"
  3758. FontSize="{DynamicResource Font.Size.Body2}"
  3759. Style="{StaticResource TabHeaderTextBlockStyle}"
  3760. Text="{lex:Loc SettingView_Language_Text}" />
  3761. </StackPanel>
  3762. </TabItem.Header>
  3763. <StackPanel
  3764. Margin="20"
  3765. VerticalAlignment="Top"
  3766. Orientation="Horizontal">
  3767. <!-- 中文简体 -->
  3768. <Button
  3769. MinWidth="100"
  3770. materialDesign:ButtonAssist.CornerRadius="10"
  3771. Command="{Binding SelectLanguageCommand}"
  3772. CommandParameter="ChineseSimplified"
  3773. FontSize="{DynamicResource Font.Size.Body1}"
  3774. ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}">
  3775. <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
  3776. <Button.Style>
  3777. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3778. <Setter Property="Foreground" Value="#000000" />
  3779. <Style.Triggers>
  3780. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.ChineseSimplified}">
  3781. <Setter Property="Background" Value="Green" />
  3782. <Setter Property="BorderBrush" Value="Green" />
  3783. </DataTrigger>
  3784. <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
  3785. Value="{x:Static enums:Language.English}">
  3786. <Setter Property="Background"
  3787. Value="#e4ff54" />
  3788. <Setter Property="BorderBrush"
  3789. Value="#e4ff54" />
  3790. </DataTrigger>-->
  3791. </Style.Triggers>
  3792. </Style>
  3793. </Button.Style>
  3794. </Button>
  3795. <!-- 中文繁体 -->
  3796. <Button
  3797. MinWidth="100"
  3798. Margin="20.0"
  3799. materialDesign:ButtonAssist.CornerRadius="10"
  3800. Command="{Binding SelectLanguageCommand}"
  3801. CommandParameter="ChineseTraditional"
  3802. FontSize="{DynamicResource Font.Size.Body1}"
  3803. ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}">
  3804. <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
  3805. <Button.Style>
  3806. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3807. <Setter Property="Foreground" Value="#000000" />
  3808. <Style.Triggers>
  3809. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.ChineseTraditional}">
  3810. <Setter Property="Background" Value="Green" />
  3811. <Setter Property="BorderBrush" Value="Green" />
  3812. </DataTrigger>
  3813. </Style.Triggers>
  3814. </Style>
  3815. </Button.Style>
  3816. </Button>
  3817. <!-- 英语 -->
  3818. <Button
  3819. MinWidth="100"
  3820. Margin="20.0"
  3821. materialDesign:ButtonAssist.CornerRadius="10"
  3822. Command="{Binding SelectLanguageCommand}"
  3823. CommandParameter="English"
  3824. FontSize="{DynamicResource Font.Size.Body1}"
  3825. ToolTip="{lex:Loc SettingView_Language_English}">
  3826. <TextBlock Text="{lex:Loc SettingView_Language_English}" />
  3827. <Button.Style>
  3828. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3829. <Setter Property="Foreground" Value="#000000" />
  3830. <Style.Triggers>
  3831. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.English}">
  3832. <Setter Property="Background" Value="Green" />
  3833. <Setter Property="BorderBrush" Value="Green" />
  3834. </DataTrigger>
  3835. </Style.Triggers>
  3836. </Style>
  3837. </Button.Style>
  3838. </Button>
  3839. <!-- 日语 -->
  3840. <Button
  3841. MinWidth="100"
  3842. Margin="20.0"
  3843. materialDesign:ButtonAssist.CornerRadius="10"
  3844. Command="{Binding SelectLanguageCommand}"
  3845. CommandParameter="Japanese"
  3846. FontSize="{DynamicResource Font.Size.Body1}"
  3847. ToolTip="{lex:Loc SettingView_Language_Japanese}">
  3848. <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
  3849. <Button.Style>
  3850. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3851. <Setter Property="Foreground" Value="#000000" />
  3852. <Style.Triggers>
  3853. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.Japanese}">
  3854. <Setter Property="Background" Value="Green" />
  3855. <Setter Property="BorderBrush" Value="Green" />
  3856. </DataTrigger>
  3857. </Style.Triggers>
  3858. </Style>
  3859. </Button.Style>
  3860. </Button>
  3861. <!-- 越南语 -->
  3862. <Button
  3863. MinWidth="100"
  3864. Margin="20.0"
  3865. materialDesign:ButtonAssist.CornerRadius="10"
  3866. Command="{Binding SelectLanguageCommand}"
  3867. CommandParameter="Vietnamese"
  3868. FontSize="{DynamicResource Font.Size.Body1}"
  3869. ToolTip="{lex:Loc SettingView_Language_Vietnamese}">
  3870. <TextBlock Text="{lex:Loc SettingView_Language_Vietnamese}" />
  3871. <Button.Style>
  3872. <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
  3873. <Setter Property="Foreground" Value="#000000" />
  3874. <Style.Triggers>
  3875. <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.Vietnamese}">
  3876. <Setter Property="Background" Value="Green" />
  3877. <Setter Property="BorderBrush" Value="Green" />
  3878. </DataTrigger>
  3879. </Style.Triggers>
  3880. </Style>
  3881. </Button.Style>
  3882. </Button>
  3883. </StackPanel>
  3884. </TabItem>
  3885. </TabControl>
  3886. </Grid>
  3887. </UserControl>