SettingView.xaml 229 KB

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