SettingView.xaml 229 KB

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