SettingView.xaml 227 KB

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