SettingView.xaml 227 KB

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