SettingView.xaml 230 KB

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