SettingView.xaml 230 KB

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