| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029 |
- <UserControl
- x:Class="TeamAAS_VP.Views.SettingView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:c="clr-namespace:TeamAAS_VP.ValueConverter"
- xmlns:coreLights="clr-namespace:TeamAAS_VP.Core.Lights"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
- xmlns:enums1="clr-namespace:Team.FFFeederService;assembly=Team.FFFeederService"
- xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
- xmlns:io="clr-namespace:System.IO.Ports;assembly=System"
- xmlns:lex="http://wpflocalizeextension.codeplex.com"
- xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:sys="clr-namespace:System;assembly=mscorlib"
- xmlns:sysio="clr-namespace:System.IO.Ports;assembly=System"
- xmlns:valRules="clr-namespace:TeamAAS_VP.Identity"
- xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels"
- d:Background="White"
- d:DataContext="{d:DesignInstance Type=vm:SettingViewModel}"
- d:Height="1080"
- d:Width="1024"
- lex:LocalizeDictionary.DesignCulture="zh-CN"
- lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
- lex:ResxLocalizationProvider.DefaultDictionary="Lang"
- prism:ViewModelLocator.AutoWireViewModel="True"
- FontFamily="{DynamicResource DefaultFont}"
- mc:Ignorable="d">
- <b:Interaction.Triggers>
- <b:EventTrigger EventName="Loaded">
- <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
- </b:EventTrigger>
- </b:Interaction.Triggers>
- <UserControl.Resources>
- <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverter" />
- <c:RobotBrandToVisibiltyConverter x:Key="RobotBrandToVisibiltyConverterInverse" Inverse="True" />
- <c:PlcIdToNameConverter x:Key="PlcIdToNameConverter" />
- <!-- Header text style: no wrap and trim with ellipsis, allows header to size to content -->
- <Style x:Key="TabHeaderTextBlockStyle" TargetType="TextBlock">
- <Setter Property="TextWrapping" Value="NoWrap" />
- <Setter Property="TextTrimming" Value="CharacterEllipsis" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
- <ObjectDataProvider
- x:Key="Parity"
- MethodName="GetValues"
- ObjectType="{x:Type sys:Enum}">
- <ObjectDataProvider.MethodParameters>
- <x:Type TypeName="sysio:Parity" />
- </ObjectDataProvider.MethodParameters>
- </ObjectDataProvider>
- <ObjectDataProvider
- x:Key="StopBits"
- MethodName="GetValues"
- ObjectType="{x:Type sys:Enum}">
- <ObjectDataProvider.MethodParameters>
- <x:Type TypeName="sysio:StopBits" />
- </ObjectDataProvider.MethodParameters>
- </ObjectDataProvider>
- </UserControl.Resources>
- <Grid>
- <TabControl
- materialDesign:NavigationRailAssist.ShowSelectionBackground="True"
- SnapsToDevicePixels="True"
- Style="{StaticResource MaterialDesignNavigationRailTabControl}"
- TabStripPlacement="Left">
- <materialDesign:NavigationRailAssist.FloatingContent>
- <Button
- Margin="8"
- Content="{materialDesign:PackIcon Kind=OfficeBuildingCogOutline}"
- Style="{StaticResource MaterialDesignFloatingActionSecondaryButton}" />
- </materialDesign:NavigationRailAssist.FloatingContent>
- <!-- 相机配置 -->
- <TabItem Margin="5,0">
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="CameraPlusOutline" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="{lex:Loc SettingView_Camera_Text}" />
- </StackPanel>
- </TabItem.Header>
- <Grid Margin="16">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- 增删改查 -->
- <StackPanel
- Grid.ColumnSpan="2"
- IsEnabled="{Binding IsAllowEdit}"
- Orientation="Horizontal">
- <Button
- Command="{Binding AddCameraCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc SettingView_Camera_btnAddCamera}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button
- Margin="20,0"
- Command="{Binding EditCameraCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc SettingView_Camera_btnEditCamera}">
- <materialDesign:PackIcon Kind="PuzzleEditOutline" />
- </Button>
- <Button
- Command="{Binding RemoveCameraCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc SettingView_Camera_btnRemoveCamera}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button
- Margin="20,0"
- Command="{Binding SaveCamerasCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!-- 相机列表 -->
- <TreeView
- Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- Header="{lex:Loc SettingView_Camera_CameraList}"
- IsExpanded="True"
- ItemsSource="{Binding CameraList}">
- <TreeViewItem.ItemTemplate>
- <HierarchicalDataTemplate>
- <StackPanel Orientation="Vertical">
- <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
- <TextBlock.Text>
- <MultiBinding StringFormat="{}{0}. {1}">
- <Binding Path="CameraNo" />
- <Binding Path="CameraName" />
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 品牌,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding CameraBrand}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="-" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding ManufacturerName}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 型号,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding Model, Mode=TwoWay}" />
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 序列号,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding SerialNumber, Mode=TwoWay}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 类型,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding CameraType}" />
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="IP: " />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding CameraIp}" />
- </StackPanel>
- <Border
- Height="2"
- Margin="0"
- BorderBrush="Green"
- BorderThickness="2" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- </Grid>
- </TabItem>
- <!-- 设备信息 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="RouterNetwork" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="设备信息" />
- </StackPanel>
- </TabItem.Header>
- <Grid Margin="16">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- 增删改查按钮 -->
- <StackPanel
- Grid.ColumnSpan="2"
- IsEnabled="{Binding IsAllowEdit}"
- Orientation="Horizontal">
- <Button
- Command="{Binding AddDeviceInfoCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="添加设备">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button
- Margin="20,0"
- Command="{Binding RemoveDeviceInfoCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="删除设备">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button
- Command="{Binding SaveDeviceInfoCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!-- 设备列表 -->
- <TreeView
- Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- Header="设备列表"
- IsExpanded="True"
- ItemsSource="{Binding DeviceInfoList}">
- <TreeViewItem.ItemTemplate>
- <HierarchicalDataTemplate>
- <StackPanel Orientation="Vertical">
- <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
- <TextBlock.Text>
- <MultiBinding StringFormat="设备 {0}">
- <Binding Path="DeviceNo" />
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="DeviceName: " />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding DeviceName}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="Line: " />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding Line}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="Station: " />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding Station}" />
- </StackPanel>
- <Border
- Height="2"
- Margin="0"
- BorderBrush="Green"
- BorderThickness="2" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!-- 参数详情 -->
- <ScrollViewer
- Grid.Row="1"
- Grid.Column="1"
- Margin="20"
- IsEnabled="{Binding IsAllowEdit}"
- Visibility="{Binding SelectDeviceInfo, Converter={StaticResource ObjectToVisibilityConverter}}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <!-- 设备信息表单 -->
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="设备编号:" />
- <TextBlock
- Grid.Row="0"
- Grid.Column="1"
- Margin="6,2"
- VerticalAlignment="Center"
- Text="{Binding SelectDeviceInfo.DeviceNo}" />
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="设备名称:" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DeviceName, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="设备描述:" />
- <TextBox
- Grid.Row="2"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DeviceDesc, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="Url:" />
- <TextBox
- Grid.Row="3"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.MesUrl, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="Line:" />
- <TextBox
- Grid.Row="4"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.Line, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="5"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="Station:" />
- <TextBox
- Grid.Row="5"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.Station, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="6"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="FixtureId:" />
- <TextBox
- Grid.Row="6"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.FixtureId, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="7"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="f:" />
- <TextBox
- Grid.Row="7"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.F, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="8"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="comp:" />
- <TextBox
- Grid.Row="8"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.comp, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="9"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="LogUrl:" />
- <TextBox
- Grid.Row="9"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.LogUrl, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="10"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="apikey:" />
- <TextBox
- Grid.Row="10"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.ApiKey, Mode=TwoWay}" />
- <StackPanel
- Grid.Row="11"
- Grid.Column="1"
- Orientation="Horizontal">
- <CheckBox
- Grid.Row="11"
- Grid.Column="1"
- Margin="6,2"
- Command="{Binding CheckStatusCommand}"
- Content="启用 MES"
- IsChecked="{Binding SelectDeviceInfo.EnableMES, Mode=TwoWay}" />
- <!--<CheckBox Grid.Row="10"
- Grid.Column="1"
- Content="是否启用两次产品编号"
- IsChecked="{Binding SelectDeviceInfo.EnableDoubleMes, Mode=TwoWay}"
- Margin="6,2" />-->
- <CheckBox
- Grid.Row="11"
- Grid.Column="1"
- Margin="6,2"
- Command="{Binding CheckStatusCommand}"
- Content="是否启用锁螺丝XY超限"
- IsChecked="{Binding SelectDeviceInfo.EnableXY, Mode=TwoWay}" />
- </StackPanel>
- <StackPanel
- Grid.Row="13"
- Grid.Column="1"
- Orientation="Horizontal">
- <CheckBox
- Margin="6,2"
- Command="{Binding CheckStatusCommand}"
- Content="是否保存CSV文件"
- IsChecked="{Binding SelectDeviceInfo.SaveCsv, Mode=TwoWay}" />
- <CheckBox
- Margin="6,2"
- Content="是否保存ppid"
- IsChecked="{Binding SelectDeviceInfo.SaveCsvPPID, Mode=TwoWay}" />
- </StackPanel>
- <TextBlock
- Grid.Row="14"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="保存的CSV文件路径:" />
- <DockPanel
- Grid.Row="14"
- Grid.Column="1"
- Margin="6,2"
- HorizontalAlignment="Stretch">
- <Button
- HorizontalAlignment="Right"
- Command="{Binding SelectSaveImagePathCommand}"
- DockPanel.Dock="Right"
- ToolTip="{lex:Loc 选择路径}">
- <Button.Content>
- <materialDesign:PackIcon Kind="FolderOpenOutline" />
- </Button.Content>
- </Button>
- <TextBox Text="{Binding SelectDeviceInfo.SaveCsvPath, Mode=TwoWay}" />
- </DockPanel>
- <!-- CTQ 数据信息 -->
- <TextBlock
- Grid.Row="15"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="PROCESS_NAME:" />
- <TextBox
- Grid.Row="15"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.PROCESS_NAME, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="16"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="CTQ_LSL(压力下限):" />
- <TextBox
- Grid.Row="16"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.CTQ_LSL_Pressure, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="17"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="CTQ_USL(压力上限):" />
- <TextBox
- Grid.Row="17"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.CTQ_USL_Pressure, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="18"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="SUPPLIER_NAME:" />
- <TextBox
- Grid.Row="18"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.SUPPLIER_NAME, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="19"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="COMMODITY_TYPE:" />
- <TextBox
- Grid.Row="19"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.COMMODITY_TYPE, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="20"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="REVISION:" />
- <TextBox
- Grid.Row="20"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.REVISION, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="21"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="MFG_LOT#:" />
- <TextBox
- Grid.Row="21"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.MFG_LOT, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="22"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="MFG_ASSY_LINE:" />
- <TextBox
- Grid.Row="22"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.MFG_ASSY_LINE, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="23"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="PROCESS_MACHINE_ID:" />
- <TextBox
- Grid.Row="23"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.PROCESS_MACHINE_ID, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="24"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="供料器1螺丝SN:" />
- <TextBox
- Grid.Row="24"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.Feeder1ScrewSN, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="25"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="供料器2螺丝SN:" />
- <TextBox
- Grid.Row="25"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.Feeder2ScrewSN, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="26"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="供料器1螺丝颜色:" />
- <TextBox
- Grid.Row="26"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.Feeder1ScrewColor, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="27"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Text="供料器2螺丝颜色:" />
- <TextBox
- Grid.Row="27"
- Grid.Column="1"
- Margin="6,2"
- Text="{Binding SelectDeviceInfo.DataInfo.Feeder2ScrewColor, Mode=TwoWay}" />
- </Grid>
- </Grid>
- </ScrollViewer>
- </Grid>
- </TabItem>
- <!-- 机器人 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="RobotIndustrialOutline" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="{lex:Loc 机器人}" />
- </StackPanel>
- </TabItem.Header>
- <Grid Margin="16">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- 增删改查 -->
- <StackPanel
- Grid.ColumnSpan="2"
- IsEnabled="{Binding IsAllowEdit}"
- Orientation="Horizontal">
- <Button
- Command="{Binding AddRobotCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc 增加机器人}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button
- Margin="20,0"
- Command="{Binding RemoveCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc 移除机器人}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button
- Command="{Binding SaveRobotsCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!-- 机器人列表 -->
- <TreeView
- Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- Header="{lex:Loc 机器人列表}"
- IsExpanded="True"
- ItemsSource="{Binding RobotList}">
- <TreeViewItem.ItemTemplate>
- <HierarchicalDataTemplate>
- <StackPanel Orientation="Vertical">
- <StackPanel Orientation="Horizontal">
- <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
- <TextBlock.Text>
- <MultiBinding StringFormat="{}{0}. {1}">
- <Binding Path="RobotNo" />
- <Binding Path="RobotName" />
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 品牌,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding RobotBrand, Mode=TwoWay}" />
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 连接方式,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}"
- Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <TextBlock
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding ConnectType, Mode=TwoWay}"
- Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <!-- PLC -->
- <TextBlock
- Margin="10,0,0,0"
- d:Visibility="Collapsed"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="PLC: "
- Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
- <TextBlock
- d:Visibility="Collapsed"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding PLC, Converter={StaticResource PlcIdToNameConverter}}"
- Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal" Visibility="{Binding RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding IP, StringFormat=IP:{0}, Mode=TwoWay}" />
- <TextBlock
- Margin="10,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding Port, StringFormat=Port:{0}, Mode=TwoWay}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 结束符,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding Terminator, Mode=TwoWay}" />
- </StackPanel>
- <Border
- Height="2"
- Margin="0"
- BorderBrush="Green"
- BorderThickness="2" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!-- 参数详情 -->
- <ScrollViewer
- Grid.Row="1"
- Grid.Column="1"
- Margin="20"
- IsEnabled="{Binding IsAllowEdit}"
- Visibility="{Binding SelectRobot, Converter={StaticResource ObjectToVisibilityConverter}}">
- <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- id -->
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="Id: " />
- <TextBlock
- x:Name="txt_Id"
- Grid.Row="0"
- Grid.Column="1"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding SelectRobot.Id, Mode=TwoWay}" />
- <!-- 名称 -->
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 名称,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="SelectRobot.RobotName">
- <Binding.ValidationRules>
- <valRules:NameValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!-- 机器人品牌 -->
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 品牌,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <ComboBox
- Grid.Row="2"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:RobotBrand}"
- SelectedItem="{Binding SelectRobot.RobotBrand, Mode=TwoWay}" />
- <!-- 通讯方式 -->
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 通讯方式,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}"
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <ComboBox
- Grid.Row="3"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
- SelectedItem="{Binding SelectRobot.ConnectType, Mode=TwoWay}"
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <!-- IP地址 -->
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="IP: "
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <TextBox
- Grid.Row="4"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="SelectRobot.IP">
- <Binding.ValidationRules>
- <valRules:IPValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!-- 端口号 -->
- <TextBlock
- Grid.Row="5"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="Port: "
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <TextBox
- Grid.Row="5"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="SelectRobot.Port">
- <Binding.ValidationRules>
- <valRules:PortValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!-- 结束符 -->
- <TextBlock
- Grid.Row="6"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 结束符,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}"
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <ComboBox
- Grid.Row="6"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
- SelectedItem="{Binding SelectRobot.Terminator, Mode=TwoWay}"
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <!-- 编码格式 -->
- <TextBlock
- Grid.Row="7"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 编码解码,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}"
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <ComboBox
- Grid.Row="7"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
- SelectedItem="{Binding SelectRobot.DataEncoding, Mode=TwoWay}"
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <!-- Z轴的安全高度 -->
- <TextBlock
- Grid.Row="8"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="Z轴的安全高度: " />
- <TextBox
- Grid.Row="8"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding SelectRobot.SafeZ, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="8"
- Grid.Column="1"
- Margin="0,0,-20,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="mm" />
- <!-- PLC -->
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- d:Visibility="Collapsed"
- Text="PLC: "
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
- <ComboBox
- Grid.Row="3"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,5"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- d:Visibility="Collapsed"
- ItemsSource="{Binding PlcList}"
- SelectedItem="{Binding RobotSelectedPlc}"
- Visibility="{Binding SelectRobot.RobotBrand, Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Name}" />
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <!--<ScrollViewer Grid.RowSpan="8"
- Grid.Column="2"
- HorizontalScrollBarVisibility="Auto"
- VerticalScrollBarVisibility="Auto"
- d:Visibility="Collapsed"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}">
- <Grid Margin="5">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.Resources>
- <Style TargetType="TextBlock">
- <Setter Property="FontSize"
- Value="{DynamicResource Font.Size.Body3}" />
- <Setter Property="Margin"
- Value="5" />
- <Setter Property="VerticalAlignment"
- Value="Center" />
- </Style>
- <Style TargetType="TextBox">
- <Setter Property="FontSize"
- Value="{DynamicResource Font.Size.Body3}" />
- <Setter Property="Margin"
- Value="5" />
- <Setter Property="HorizontalAlignment"
- Value="Stretch" />
- <Setter Property="VerticalAlignment"
- Value="Center" />
- </Style>
- </Grid.Resources>
- <TextBlock Grid.Row="0"
- FontWeight="Bold"
- Text="{lex:Loc 状态参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
- <TextBlock Grid.Row="1"
- Text="{lex:Loc X坐标}" />
- <DockPanel Grid.Row="1"
- Grid.Column="1"
- LastChildFill="True">
- <TextBlock Text="{Binding ResultsValues[0]}"
- MinWidth="50" />
- <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.X}" />
- </DockPanel>
- <TextBlock Grid.Row="2"
- Text="{lex:Loc Y坐标}" />
- <DockPanel Grid.Row="2"
- Grid.Column="1"
- LastChildFill="True">
- <TextBlock Text="{Binding ResultsValues[1]}"
- MinWidth="50" />
- <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Y}" />
- </DockPanel>
- <TextBlock Grid.Row="3"
- Text="{lex:Loc Z坐标}" />
- <DockPanel Grid.Row="3"
- Grid.Column="1"
- LastChildFill="True">
- <TextBlock Text="{Binding ResultsValues[2]}"
- MinWidth="50" />
- <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Z}" />
- </DockPanel>
- <TextBlock Grid.Row="4"
- Text="{lex:Loc U坐标}" />
- <DockPanel Grid.Row="4"
- Grid.Column="1"
- LastChildFill="True">
- <TextBlock Text="{Binding ResultsValues[3]}"
- MinWidth="50" />
- <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.U}" />
- </DockPanel>
- <TextBlock Grid.Row="5"
- Text="{lex:Loc 运动结束}" />
- <DockPanel Grid.Row="5"
- Grid.Column="1"
- LastChildFill="True">
- <TextBlock Text="{Binding ResultsValues[4]}"
- MinWidth="50" />
- <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.MoveFinish}" />
- </DockPanel>
- <TextBlock Grid.Row="6"
- Text="{lex:Loc 错误}" />
- <DockPanel Grid.Row="6"
- Grid.Column="1"
- LastChildFill="True">
- <TextBlock Text="{Binding ResultsValues[5]}"
- MinWidth="50" />
- <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.Error}" />
- </DockPanel>
- <TextBlock Grid.Row="7"
- Text="{lex:Loc 吸真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
- <DockPanel Grid.Row="7"
- Grid.Column="1"
- LastChildFill="True">
- <TextBlock Text="{Binding ResultsValues[6]}"
- MinWidth="50" />
- <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOn}" />
- </DockPanel>
- <TextBlock Grid.Row="8"
- Text="{lex:Loc 破真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
- <DockPanel Grid.Row="8"
- Grid.Column="1"
- LastChildFill="True">
- <TextBlock Text="{Binding ResultsValues[7]}"
- MinWidth="50" />
- <TextBox Text="{Binding SelectRobot.PlcRobotParameter.StateParameter.VacuumOff}" />
- </DockPanel>
- <TextBlock Grid.Row="9"
- FontWeight="Bold"
- Text="{lex:Loc 命令参数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
- <TextBlock Grid.Row="10"
- Text="{lex:Loc X坐标}" />
- <TextBox Grid.Row="10"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.X}" />
- <TextBlock Grid.Row="11"
- Text="{lex:Loc Y坐标}" />
- <TextBox Grid.Row="11"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Y}" />
- <TextBlock Grid.Row="12"
- Text="{lex:Loc Z坐标}" />
- <TextBox Grid.Row="12"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Z}" />
- <TextBlock Grid.Row="13"
- Text="{lex:Loc U坐标}" />
- <TextBox Grid.Row="13"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.U}" />
- <TextBlock Grid.Row="14"
- Text="{lex:Loc 吸真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
- <TextBox Grid.Row="14"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOn}" />
- <TextBlock Grid.Row="15"
- Text="{lex:Loc 破真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
- <TextBox Grid.Row="15"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.WaitVacuumOff}" />
- <TextBlock Grid.Row="16"
- Text="{lex:Loc Z轴限高}" />
- <TextBox Grid.Row="16"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Limz}" />
- <TextBlock Grid.Row="17"
- Text="{lex:Loc 执行运动}" />
- <TextBox Grid.Row="17"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.ExecuteMove}" />
- <TextBlock Grid.Row="18"
- Text="{lex:Loc 吸真空}" />
- <TextBox Grid.Row="18"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOn}" />
- <TextBlock Grid.Row="19"
- Text="{lex:Loc 破真空}" />
- <TextBox Grid.Row="19"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.VacuumOff}" />
- <TextBlock Grid.Row="20"
- Text="{lex:Loc 步进距离,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
- <TextBox Grid.Row="20"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.Distance}" />
- <TextBlock Grid.Row="21"
- Text="{lex:Loc 点动命令,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}:'}" />
- <TextBox Grid.Row="21"
- Grid.Column="1"
- Text="{Binding SelectRobot.PlcRobotParameter.CommandParameter.JogCmd}" />
- </Grid>
- </ScrollViewer>-->
- </Grid>
- </ScrollViewer>
- </Grid>
- </TabItem>
- <!-- Feeder -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="Vibrate" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="Feeder" />
- </StackPanel>
- </TabItem.Header>
- <Grid Margin="16">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- 增删改查 -->
- <StackPanel
- Grid.ColumnSpan="2"
- IsEnabled="{Binding IsAllowEdit}"
- Orientation="Horizontal">
- <Button
- Command="{Binding AddFeederCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc 增加Feeder}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button
- Margin="20,0"
- Command="{Binding RemoveFeederCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc 移除Feeder}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button
- Command="{Binding SaveFeedersCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!-- Feeder列表 -->
- <TreeView
- Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- Header="{lex:Loc Feeder列表}"
- IsExpanded="True"
- ItemsSource="{Binding FeederList}">
- <TreeViewItem.ItemTemplate>
- <HierarchicalDataTemplate>
- <StackPanel Orientation="Vertical">
- <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
- <TextBlock.Text>
- <MultiBinding StringFormat="{}{0}. {1}">
- <Binding Path="FeederNo" />
- <Binding Path="FeederName" />
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 品牌,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding FeederBrand, Mode=TwoWay}" />
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 连接方式,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding ConnectType, Mode=TwoWay}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding IP, StringFormat=IP:{0}, Mode=TwoWay}" />
- <TextBlock
- Margin="10,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding Port, StringFormat=Port:{0}, Mode=TwoWay}" />
- </StackPanel>
- <Border
- Height="2"
- Margin="0"
- BorderBrush="Green"
- BorderThickness="2" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!-- 参数详情 -->
- <ScrollViewer
- Grid.Row="1"
- Grid.Column="1"
- Margin="20"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- IsEnabled="{Binding IsAllowEdit}"
- Visibility="{Binding SelectFeeder, Converter={StaticResource ObjectToVisibilityConverter}}">
- <Grid Height="300">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- id -->
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="Id: " />
- <TextBlock
- x:Name="txt_Feeder_Id"
- Grid.Row="0"
- Grid.Column="1"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding SelectFeeder.Id, Mode=TwoWay}" />
- <!-- 名称 -->
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 名称,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="SelectFeeder.FeederName">
- <Binding.ValidationRules>
- <valRules:NameValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!-- Feeder品牌 -->
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 品牌,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <ComboBox
- Grid.Row="2"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums1:FeederBrand}"
- SelectedItem="{Binding SelectFeeder.FeederBrand, Mode=TwoWay}" />
- <!-- 通讯方式 -->
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 通讯方式,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <ComboBox
- Grid.Row="3"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
- SelectedItem="{Binding SelectFeeder.ConnectType, Mode=TwoWay}" />
- <!-- IP地址 -->
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="IP: " />
- <TextBox
- Grid.Row="4"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="SelectFeeder.IP">
- <Binding.ValidationRules>
- <valRules:IPValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!-- 端口号 -->
- <TextBlock
- Grid.Row="5"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="Port: " />
- <TextBox
- Grid.Row="5"
- Grid.Column="1"
- Width="{Binding ElementName=txt_Feeder_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="SelectFeeder.Port">
- <Binding.ValidationRules>
- <valRules:PortValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- </Grid>
- </ScrollViewer>
- </Grid>
- </TabItem>
- <!-- PLC -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="CellphoneLink" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="PLC" />
- </StackPanel>
- </TabItem.Header>
- <Grid Margin="16">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- 增删改查 -->
- <StackPanel
- Grid.ColumnSpan="2"
- IsEnabled="{Binding IsAllowEdit}"
- Orientation="Horizontal">
- <Button
- Command="{Binding AddPlcCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc 增加PLC}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button
- Margin="20,0"
- Command="{Binding RemovePlcCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc 移除PLC}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button
- Command="{Binding SavePlcsCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!-- PLC列表 -->
- <TreeView
- Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- Header="{lex:Loc PLC列表}"
- IsExpanded="True"
- ItemsSource="{Binding PlcList}">
- <TreeViewItem.ItemTemplate>
- <HierarchicalDataTemplate>
- <StackPanel Orientation="Vertical">
- <TextBlock FontSize="{DynamicResource Font.Size.Title4}" Text="{Binding Name, Mode=TwoWay}" />
- <StackPanel Orientation="Horizontal">
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 连接方式,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding CommunicationType, Mode=TwoWay}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding EndpointUrl, StringFormat=Endpoint Url:{0}, Mode=TwoWay}" />
- </StackPanel>
- <Border
- Height="2"
- Margin="0"
- BorderBrush="Green"
- BorderThickness="2" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!-- 参数详情 -->
- <ScrollViewer
- Grid.Row="1"
- Grid.Column="1"
- Margin="20"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- IsEnabled="{Binding IsAllowEdit}"
- Visibility="{Binding SelectPlc, Converter={StaticResource ObjectToVisibilityConverter}}">
- <Grid Height="200">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- id -->
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="Id: " />
- <TextBlock
- x:Name="txt_plc_Id"
- Grid.Row="0"
- Grid.Column="1"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding SelectPlc.Id, Mode=TwoWay}" />
- <!-- 名称 -->
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 名称,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="SelectPlc.Name">
- <Binding.ValidationRules>
- <valRules:NameValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!-- 通讯方式 -->
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 通讯方式,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <ComboBox
- Grid.Row="2"
- Grid.Column="1"
- Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:CommunicationType}"
- SelectedItem="{Binding SelectPlc.CommunicationType, Mode=TwoWay}" />
- <!-- Endpoint Url地址 -->
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="Endpoints Url: " />
- <TextBox
- Grid.Row="3"
- Grid.Column="1"
- Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding SelectPlc.EndpointUrl}"
- TextAlignment="Center" />
- <!-- 节点头 -->
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 节点头,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBox
- Grid.Row="4"
- Grid.Column="1"
- Width="{Binding ElementName=txt_plc_Id, Path=ActualWidth}"
- MinWidth="80"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding SelectPlc.NodeHeader, Mode=TwoWay}"
- TextAlignment="Center" />
- </Grid>
- </ScrollViewer>
- </Grid>
- </TabItem>
- <!-- 光源控制器 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="TelevisionAmbientLight" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="{lex:Loc 光源控制器}" />
- </StackPanel>
- </TabItem.Header>
- <Grid Margin="16">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- 增删改查 -->
- <StackPanel
- Grid.ColumnSpan="2"
- IsEnabled="{Binding IsAllowEdit}"
- Orientation="Horizontal">
- <Button
- Command="{Binding AddLightControllerCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc 增加光源控制器}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button
- Margin="20,0"
- Command="{Binding RemoveLightControllerCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc 移除光源控制器}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button
- Command="{Binding SaveLightControllersCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!-- 控制器列表 -->
- <TreeView
- Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- Header="{lex:Loc 光源控制器列表}"
- IsExpanded="True"
- ItemsSource="{Binding LightControllerList}">
- <TreeViewItem.ItemTemplate>
- <HierarchicalDataTemplate>
- <StackPanel Orientation="Vertical">
- <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
- <TextBlock.Text>
- <MultiBinding StringFormat="{}{0}. {1}">
- <Binding Path="Id" />
- <Binding Path="Name" />
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 型号,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding LightModel, Mode=TwoWay}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 通道数,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding ChannelCount, Mode=TwoWay}" />
- </StackPanel>
- <Border
- Height="2"
- Margin="0"
- BorderBrush="Green"
- BorderThickness="2" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!-- 参数详情 -->
- <ScrollViewer
- Grid.Row="1"
- Grid.Column="1"
- Margin="20"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- IsEnabled="{Binding IsAllowEdit}"
- Visibility="{Binding SelectLightController, Converter={StaticResource ObjectToVisibilityConverter}}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" MinWidth="200" />
- </Grid.ColumnDefinitions>
- <!-- Id -->
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="Id: " />
- <TextBlock
- Grid.Row="0"
- Grid.Column="1"
- Margin="10,0"
- VerticalAlignment="Center"
- Text="{Binding SelectLightController.Id}" />
- <!-- Name -->
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 名称,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Margin="10,0"
- Text="{Binding SelectLightController.Name, Mode=TwoWay}" />
- <!-- Model -->
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 型号,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <ComboBox
- Grid.Row="2"
- Grid.Column="1"
- Margin="10,0"
- ItemsSource="{ext:EnumBindingSource EnumType=coreLights:LightModel}"
- SelectedItem="{Binding SelectLightController.LightModel, Mode=TwoWay}">
- <b:Interaction.Triggers>
- <b:EventTrigger EventName="SelectionChanged">
- <b:InvokeCommandAction Command="{Binding LightModelChangedCommand}" CommandParameter="{Binding SelectLightController}" />
- </b:EventTrigger>
- </b:Interaction.Triggers>
- </ComboBox>
- <!-- Channel count -->
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 通道数,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBox
- Grid.Row="3"
- Grid.Column="1"
- Margin="10,0"
- IsReadOnly="True"
- Text="{Binding SelectLightController.ChannelCount, Mode=TwoWay}" />
- <!-- Channel configs list -->
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 通道配置}" />
- <ItemsControl
- Grid.Row="4"
- Grid.Column="1"
- Margin="10,0"
- ItemsSource="{Binding SelectLightController.ChannelConfigs}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <StackPanel Margin="0,4" Orientation="Horizontal">
- <TextBlock
- Width="30"
- VerticalAlignment="Center"
- Text="{Binding LocalIndex}" />
- <TextBox
- Width="180"
- Margin="6,0"
- Text="{Binding Name, Mode=TwoWay}" />
- <TextBlock
- Margin="6,0"
- VerticalAlignment="Center"
- Text="{lex:Loc 亮度}" />
- <TextBox Width="80" Text="{Binding DefaultBrightness, Mode=TwoWay}" />
- </StackPanel>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- <!-- Serial port config (visible for serial model) -->
- <GroupBox
- Grid.Row="5"
- Grid.ColumnSpan="2"
- Margin="0,12,0,0"
- Header="{lex:Loc 串口配置}">
- <GroupBox.Style>
- <Style TargetType="GroupBox">
- <Setter Property="Visibility" Value="Collapsed" />
- <Style.Triggers>
- <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
- <Setter Property="Visibility" Value="Visible" />
- </DataTrigger>
- <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC3_24V300W_8T}">
- <Setter Property="Visibility" Value="Visible" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </GroupBox.Style>
- <Grid Margin="10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="PortName:" />
- <TextBox
- Grid.Row="0"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding SelectLightController.SerialPortConfig.PortName, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="BaudRate:" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding SelectLightController.SerialPortConfig.BaudRate, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="Parity:" />
- <ComboBox
- Grid.Row="2"
- Grid.Column="1"
- ItemsSource="{Binding Source={StaticResource Parity}}"
- SelectedItem="{Binding SelectLightController.SerialPortConfig.Parity, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="StopBits:" />
- <ComboBox
- Grid.Row="3"
- Grid.Column="1"
- ItemsSource="{Binding Source={StaticResource StopBits}}"
- SelectedItem="{Binding SelectLightController.SerialPortConfig.StopBits, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="DataBits:" />
- <TextBox
- Grid.Row="4"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding SelectLightController.SerialPortConfig.DataBits, Mode=TwoWay}" />
- </Grid>
- </GroupBox>
- <!-- TCP config (visible for non-serial models) -->
- <GroupBox
- Grid.Row="5"
- Grid.ColumnSpan="2"
- Margin="0,12,0,0"
- Header="{lex:Loc TCP配置}">
- <GroupBox.Style>
- <Style TargetType="GroupBox">
- <Setter Property="Visibility" Value="Visible" />
- <Style.Triggers>
- <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC_12V60W_4T}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- <DataTrigger Binding="{Binding SelectLightController.LightModel}" Value="{x:Static coreLights:LightModel.KCS_KDC3_24V300W_8T}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </GroupBox.Style>
- <Grid Margin="10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="IP:" />
- <TextBox
- Grid.Row="0"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding SelectLightController.TcpConfig.IP, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="Port:" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding SelectLightController.TcpConfig.Port, Mode=TwoWay}" />
- </Grid>
- </GroupBox>
- </Grid>
- </ScrollViewer>
- </Grid>
- </TabItem>
- <!-- 螺丝供料器 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="Screwdriver" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="{lex:Loc 螺丝供料器}" />
- </StackPanel>
- </TabItem.Header>
- <Grid Margin="16">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- 增删改查 -->
- <StackPanel
- Grid.ColumnSpan="2"
- IsEnabled="{Binding IsAllowEdit}"
- Orientation="Horizontal">
- <Button
- Command="{Binding AddScrewFeederCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc 增加螺丝供料器}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button
- Margin="20,0"
- Command="{Binding RemoveScrewFeederCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc 移除螺丝供料器}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button
- Command="{Binding SaveScrewFeedersCommand}"
- Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!-- 螺丝供料器列表 -->
- <TreeView
- Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- Header="{lex:Loc 螺丝供料器列表}"
- IsExpanded="True"
- ItemsSource="{Binding ScrewFeederList}">
- <TreeViewItem.ItemTemplate>
- <HierarchicalDataTemplate>
- <StackPanel Orientation="Vertical">
- <TextBlock FontSize="{DynamicResource Font.Size.Title4}">
- <TextBlock.Text>
- <MultiBinding StringFormat="{}{0} . {1}">
- <Binding Path="FeederNumber" />
- <Binding Path="Name" />
- </MultiBinding>
- </TextBlock.Text>
- </TextBlock>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 每包螺丝的数量}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding PackSize, Mode=TwoWay}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 低量报警阈值}" />
- <TextBlock
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{Binding LowLevelThreshold, Mode=TwoWay}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- Text="{lex:Loc 是否启用低量报警}" />
- <CheckBox
- FontSize="{DynamicResource Font.Size.Captions3}"
- IsChecked="{Binding LowLevelAlarmEnabled, Mode=TwoWay}"
- IsEnabled="False" />
- </StackPanel>
- <Border
- Height="2"
- Margin="0"
- BorderBrush="Green"
- BorderThickness="2" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!-- 参数详情 -->
- <ScrollViewer
- Grid.Row="1"
- Grid.Column="1"
- Margin="20"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- IsEnabled="{Binding IsAllowEdit}"
- Visibility="{Binding SelectScrewFeeder, Converter={StaticResource ObjectToVisibilityConverter}}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="40" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition MinWidth="200" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!-- Id -->
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="Id: " />
- <TextBlock
- Grid.Row="0"
- Grid.Column="1"
- Margin="10,0"
- VerticalAlignment="Center"
- Text="{Binding SelectScrewFeeder.Id}" />
- <!-- Name -->
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 名称,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Margin="10,0"
- Text="{Binding SelectScrewFeeder.Name, Mode=TwoWay}" />
- <!-- 供料器编号 -->
- <!--<TextBlock Text="供料器编号:"
- Grid.Row="2"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBox Text="{Binding SelectScrewFeeder.FeederNumber,Mode=TwoWay}"
- Grid.Row="2"
- Grid.Column="1"
- Margin="10,0"
- Width="200"
- TextAlignment="Center" />-->
- <!-- 每包螺丝数量 -->
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 每包螺丝数量}" />
- <mah:NumericUpDown
- Grid.Row="3"
- Grid.Column="1"
- MinWidth="200"
- Margin="10,5"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="10000"
- Minimum="0"
- Value="{Binding SelectScrewFeeder.PackSize, Mode=TwoWay}" />
- <!-- 低量报警阈值 -->
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 低量报警阈值}" />
- <mah:NumericUpDown
- Grid.Row="4"
- Grid.Column="1"
- MinWidth="200"
- Margin="10,0"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="10000"
- Minimum="0"
- Value="{Binding SelectScrewFeeder.LowLevelThreshold, Mode=TwoWay}" />
- <!-- 是否启用低量报警 -->
- <TextBlock
- Grid.Row="5"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="是否启用低量报警:" />
- <CheckBox
- Grid.Row="5"
- Grid.Column="1"
- Margin="10,5"
- VerticalAlignment="Center"
- IsChecked="{Binding SelectScrewFeeder.LowLevelAlarmEnabled, Mode=TwoWay}" />
- </Grid>
- </ScrollViewer>
- </Grid>
- </TabItem>
- <!-- 通讯 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="Lan" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="{lex:Loc 通讯}" />
- </StackPanel>
- </TabItem.Header>
- <Grid Margin="20" IsEnabled="{Binding IsAllowEdit}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height=" auto" />
- </Grid.RowDefinitions>
- <Button
- Width="60"
- HorizontalAlignment="Left"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SaveCommunicateCommand}"
- CommandParameter="TCPIP"
- Style="{StaticResource MaterialDesignRaisedButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- <GroupBox
- Grid.Row="1"
- Margin="5,5"
- FontSize="{DynamicResource Font.Size.Title4}"
- Header="{lex:Loc 后台TCPIP服务器}">
- <Grid Margin="20">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height=" auto" />
- <RowDefinition Height=" auto" />
- </Grid.RowDefinitions>
- <!-- port -->
- <TextBlock
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="Port: " />
- <TextBox
- Grid.Row="0"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="BgTcp.Port">
- <Binding.ValidationRules>
- <valRules:PortValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!-- 结束符 -->
- <TextBlock
- Grid.Row="1"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{lex:Loc 结束符,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <ComboBox
- Grid.Row="1"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
- SelectedItem="{Binding BgTcp.Terminator, Mode=TwoWay}" />
- <!-- 编码格式 -->
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- Text="{lex:Loc 编码解码,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <ComboBox
- Grid.Row="2"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
- SelectedItem="{Binding BgTcp.DataEncoding, Mode=TwoWay}" />
- </Grid>
- </GroupBox>
- <Button
- Grid.Column="1"
- Width="60"
- HorizontalAlignment="Left"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SaveCommunicateCommand}"
- CommandParameter="ModbusTCP"
- Style="{StaticResource MaterialDesignRaisedButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- <materialDesign:PopupBox
- Grid.Column="1"
- HorizontalAlignment="Right"
- VerticalAlignment="Center">
- <StackPanel Margin="10" Orientation="Vertical">
- <TextBlock
- Text="功能码 1 ReadCoils 读取DO的状态"
- TextAlignment="Left"
- TextWrapping="Wrap" />
- <TextBlock
- Text="功能码 2 ReadInputs 读取DI的状态"
- TextAlignment="Left"
- TextWrapping="Wrap" />
- <TextBlock
- Text="功能码 3 ReadHoldingRegisters 读取AO的值"
- TextAlignment="Left"
- TextWrapping="Wrap" />
- <TextBlock
- Text="功能码 4 ReadInputRegisters 读取AI的值"
- TextAlignment="Left"
- TextWrapping="Wrap" />
- <TextBlock
- Text="功能码 5 WriteSingleCoil 写入值到DO"
- TextAlignment="Left"
- TextWrapping="Wrap" />
- <TextBlock
- Text="功能码 6 WriteSingleRegister 写入值到AO"
- TextAlignment="Left"
- TextWrapping="Wrap" />
- <TextBlock
- Text="功能码 15 WriteMultipleCoils 写多线圈寄存器"
- TextAlignment="Left"
- TextWrapping="Wrap" />
- <TextBlock
- Text="功能码 16 WriteMultipleRegisters 写多个保持寄存器"
- TextAlignment="Left"
- TextWrapping="Wrap" />
- <TextBlock
- Text="功能码 23 ReadWriteMultipleRegisters 读写多个保持寄存器"
- TextAlignment="Left"
- TextWrapping="Wrap" />
- </StackPanel>
- </materialDesign:PopupBox>
- <GroupBox
- Grid.Row="1"
- Grid.Column="1"
- Margin="5,5"
- FontSize="{DynamicResource Font.Size.Title4}"
- Header="{lex:Loc 后台ModbusTCPSlave}">
- <Grid Margin="20">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height=" auto" />
- <RowDefinition Height=" auto" />
- <RowDefinition Height=" auto" />
- </Grid.RowDefinitions>
- <!-- IP -->
- <TextBlock
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="IP: " />
- <TextBox
- Grid.Row="0"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding BgModbus.IP, Mode=TwoWay}"
- TextAlignment="Center" />
- <!-- port -->
- <TextBlock
- Grid.Row="1"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="Port: " />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding BgModbus.Port, Mode=TwoWay}"
- TextAlignment="Center" />
- <!-- SlaveID -->
- <TextBlock
- Grid.Row="2"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="SlaveID: " />
- <TextBox
- Grid.Row="2"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding BgModbus.SlaveID, Mode=TwoWay}"
- TextAlignment="Center" />
- <!-- 是否启用 -->
- <TextBlock
- Grid.Row="3"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{lex:Loc 是否启用,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}: '}" />
- <ToggleButton
- Grid.Row="3"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- IsChecked="{Binding BgModbus.IsEnabled, Mode=TwoWay}" />
- </Grid>
- </GroupBox>
- </Grid>
- </TabItem>
- <!-- 系统参数 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="CellphoneSystemUpdate" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="{lex:Loc 系统参数}" />
- </StackPanel>
- </TabItem.Header>
- <Grid Margin="20">
- <ScrollViewer
- HorizontalScrollBarVisibility="Auto"
- VerticalScrollBarVisibility="Auto">
- <Grid IsEnabled="{Binding IsAllowEdit}">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="16" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="20" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid Margin="16">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="220" />
- <ColumnDefinition Width="260" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <!-- 下相机拍照次数 -->
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="{lex:Loc 下相机拍照次数}" />
- <mah:NumericUpDown
- Grid.Row="0"
- Grid.Column="1"
- Margin="0,6"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="100"
- Minimum="0"
- Value="{Binding DowmCameraNum, Mode=TwoWay}" />
- <!-- 上相机取料拍照次数 -->
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="{lex:Loc 上相机取料拍照次数}" />
- <mah:NumericUpDown
- Grid.Row="1"
- Grid.Column="1"
- Margin="0,6"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="100"
- Minimum="0"
- Value="{Binding UpCameraPickNum, Mode=TwoWay}" />
- <!-- 上相机放料拍照次数 -->
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="{lex:Loc 上相机放料拍照次数}" />
- <mah:NumericUpDown
- Grid.Row="2"
- Grid.Column="1"
- Margin="0,6"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="100"
- Minimum="0"
- Value="{Binding UpCameraPutNum, Mode=TwoWay}" />
- <!-- 上相机锁附/组装次数(复检) -->
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="上相机锁附/组装次数(复检)" />
- <mah:NumericUpDown
- Grid.Row="3"
- Grid.Column="1"
- Margin="0,6"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="100"
- Minimum="0"
- Value="{Binding UPCameracheckNum, Mode=TwoWay}" />
- <!-- 取料固定位置拍产品相机数量 -->
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="{lex:Loc 取料固定位置拍产品相机数量}" />
- <mah:NumericUpDown
- Grid.Row="4"
- Grid.Column="1"
- Margin="0,6"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="10"
- Minimum="0"
- Value="{Binding FixedCameraPickNum, Mode=TwoWay}" />
- <!-- 锁附/组装固定位置拍产品相机数量 -->
- <TextBlock
- Grid.Row="5"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="{lex:Loc 锁附组装固定位置拍产品相机数量}" />
- <mah:NumericUpDown
- Grid.Row="5"
- Grid.Column="1"
- Margin="0,6"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="10"
- Minimum="0"
- Value="{Binding FixedCameraPutNum, Mode=TwoWay}" />
- <!-- 固定相机检测锁附/组装次数 -->
- <TextBlock
- Grid.Row="6"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="{lex:Loc 固定相机检测锁附组装次数}" />
- <mah:NumericUpDown
- Grid.Row="6"
- Grid.Column="1"
- Margin="0,6"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="100"
- Minimum="0"
- Value="{Binding FixedCameracheckNum, Mode=TwoWay}" />
- <!-- 工作模式 -->
- <TextBlock
- Grid.Row="7"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="{lex:Loc 工作模式}" />
- <mah:NumericUpDown
- Grid.Row="7"
- Grid.Column="1"
- Margin="0,6"
- materialDesign:HintAssist.HelperText="1:拍1打1 - 2:拍2打所有 - 3:先拍1打1打3颗再拍2打所有"
- materialDesign:HintAssist.HelperTextFontSize="10"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="100"
- Minimum="0"
- Value="{Binding WorkMode, Mode=TwoWay}" />
- <!-- 取料位置 -->
- <TextBlock
- Grid.Row="8"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="{lex:Loc 取料位置}" />
- <mah:NumericUpDown
- Grid.Row="8"
- Grid.Column="1"
- Margin="0,6"
- materialDesign:HintAssist.HelperText="0:不需要取料 1:需要取料"
- materialDesign:HintAssist.HelperTextFontSize="10"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="100"
- Minimum="0"
- Value="{Binding PickPointNum, Mode=TwoWay}" />
- <!-- 批头矫正模式 -->
- <TextBlock
- Grid.Row="9"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="批头矫正模式" />
- <mah:NumericUpDown
- Grid.Row="9"
- Grid.Column="1"
- Margin="0,6"
- materialDesign:HintAssist.HelperText="1:初始化时矫正 2:每个产品矫正一次 3:每颗螺丝矫正一次"
- materialDesign:HintAssist.HelperTextFontSize="10"
- FontSize="{DynamicResource Font.Size.Body3}"
- Maximum="100"
- Minimum="0"
- ToolTip="1:初始化时矫正,2:每个产品矫正一次,3:每颗螺丝矫正一次"
- Value="{Binding ScrewTeachNum, Mode=TwoWay}" />
- <!-- 保存锁付曲线 -->
- <TextBlock
- Grid.Row="10"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Center"
- Text="锁付曲线图保存" />
- <Grid
- Grid.Row="10"
- Grid.Column="1"
- Grid.ColumnSpan="2"
- Margin="0,6,0,6">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="12" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <CheckBox
- Grid.Column="0"
- VerticalAlignment="Center"
- Content="启用保存锁付曲线图"
- FontSize="{DynamicResource Font.Size.Body3}"
- IsChecked="{Binding IsSaveScrewCurve, Mode=TwoWay}" />
- <TextBox
- Grid.Column="2"
- MinWidth="260"
- VerticalAlignment="Center"
- IsEnabled="{Binding IsSaveScrewCurve}"
- Text="{Binding ScrewCurvePath, Mode=TwoWay}" />
- <Button
- Grid.Column="3"
- Margin="8,0,0,0"
- VerticalAlignment="Center"
- Command="{Binding BrowseScrewCurvePathCommand}"
- IsEnabled="{Binding IsSaveScrewCurve}"
- Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}">
- <materialDesign:PackIcon Kind="FolderOpen" />
- </Button>
- </Grid>
- <!-- 扫码流程设置 -->
- <TextBlock
- Grid.Row="11"
- Grid.Column="0"
- Margin="0,8,12,8"
- VerticalAlignment="Top"
- Text="扫码流程设置" />
- <StackPanel
- Grid.Row="11"
- Grid.Column="1"
- Grid.ColumnSpan="2"
- Margin="0,6,0,0"
- Orientation="Vertical">
- <WrapPanel Margin="0,0,0,8">
- <CheckBox
- Margin="0,0,20,8"
- Content="是否启用最后一次拍照关闭光源"
- FontSize="{DynamicResource Font.Size.Body3}"
- IsChecked="{Binding IsBasePartOpenLight, Mode=TwoWay}" />
- <CheckBox
- Margin="0,0,20,8"
- Content="是否启用KB复检"
- FontSize="{DynamicResource Font.Size.Body3}"
- IsChecked="{Binding IsBasePartOpenLightKB, Mode=TwoWay}" />
- <CheckBox
- Margin="0,0,20,8"
- Content="是否MES结果为1"
- FontSize="{DynamicResource Font.Size.Body3}"
- IsChecked="{Binding IsMesResult, Mode=TwoWay}" />
- </WrapPanel>
- <WrapPanel Margin="0,0,0,8">
- <CheckBox
- Margin="0,0,20,8"
- Content="是否基于零件码获取流程码"
- FontSize="{DynamicResource Font.Size.Body3}"
- IsChecked="{Binding IsBasePartCodeGetSN, Mode=TwoWay}" />
- <CheckBox
- Margin="0,0,20,8"
- Content="是否通过零件码判断螺丝型号"
- FontSize="{DynamicResource Font.Size.Body3}"
- IsChecked="{Binding IsBasePartCodeChooseScrew, Mode=TwoWay}" />
- </WrapPanel>
- <TextBox
- Width="320"
- HorizontalAlignment="Left"
- materialDesign:HintAssist.Hint="螺丝型号匹配规则"
- BorderThickness="1"
- Text="{Binding ChooseScrewModel, Mode=TwoWay}"
- ToolTip="螺丝型号判断,如******123**,*为忽略字符" />
- </StackPanel>
- </Grid>
- <!-- 保存系统参数 -->
- <DockPanel Grid.Row="2" LastChildFill="False">
- <Button
- Height="40"
- MinWidth="150"
- HorizontalAlignment="Right"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SaveSystemParametersCommand}"
- DockPanel.Dock="Right"
- IsEnabled="{Binding IsAllowEdit}"
- Style="{StaticResource MaterialDesignRaisedButton}">
- <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
- <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
- <TextBlock VerticalAlignment="Center" Text="{lex:Loc 保存系统参数}" />
- </StackPanel>
- </Button>
- </DockPanel>
- <StackPanel
- Grid.Row="4"
- Margin="0,12,0,0"
- Orientation="Horizontal">
- <!-- 刷卡参数配置 -->
- <GroupBox
- Width="280"
- Margin="0,0,50,0"
- HorizontalAlignment="Left"
- Header="刷卡器配置">
- <Grid Margin="10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="PortName:" />
- <TextBox
- Grid.Row="0"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding CardReaderConfig.PortName, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="BaudRate:" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding CardReaderConfig.BaudRate, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="Parity:" />
- <ComboBox
- Grid.Row="2"
- Grid.Column="1"
- ItemsSource="{Binding Source={StaticResource Parity}}"
- SelectedItem="{Binding CardReaderConfig.Parity, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="StopBits:" />
- <ComboBox
- Grid.Row="3"
- Grid.Column="1"
- ItemsSource="{Binding Source={StaticResource StopBits}}"
- SelectedItem="{Binding CardReaderConfig.StopBits, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="DataBits:" />
- <TextBox
- Grid.Row="4"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding CardReaderConfig.DataBits, Mode=TwoWay}" />
- <Button
- Grid.Row="5"
- Grid.Column="1"
- MinWidth="120"
- Margin="0,6"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SaveCardReaderConfigCommand}"
- Style="{StaticResource MaterialDesignRaisedButton}">
- <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
- <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
- <TextBlock VerticalAlignment="Center" Text="保存刷卡器配置" />
- </StackPanel>
- </Button>
- </Grid>
- </GroupBox>
- <GroupBox Width="280" Header="扭力测量仪配置">
- <Grid Margin="10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="PortName:" />
- <TextBox
- Grid.Row="0"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding TorqueReadConfig.PortName, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="BaudRate:" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding TorqueReadConfig.BaudRate, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="Parity:" />
- <ComboBox
- Grid.Row="2"
- Grid.Column="1"
- ItemsSource="{Binding Source={StaticResource Parity}}"
- SelectedItem="{Binding TorqueReadConfig.Parity, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="StopBits:" />
- <ComboBox
- Grid.Row="3"
- Grid.Column="1"
- ItemsSource="{Binding Source={StaticResource StopBits}}"
- SelectedItem="{Binding TorqueReadConfig.StopBits, Mode=TwoWay}" />
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right"
- Text="DataBits:" />
- <TextBox
- Grid.Row="4"
- Grid.Column="1"
- Margin="6,0"
- Text="{Binding TorqueReadConfig.DataBits, Mode=TwoWay}" />
- <Button
- Grid.Row="5"
- Grid.Column="1"
- MinWidth="120"
- Margin="0,6"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SaveTorqueReaderConfigCommand}"
- Style="{StaticResource MaterialDesignRaisedButton}">
- <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
- <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
- <TextBlock VerticalAlignment="Center" Text="保存扭力测量仪配置" />
- </StackPanel>
- </Button>
- </Grid>
- </GroupBox>
- </StackPanel>
- </Grid>
- </ScrollViewer>
- </Grid>
- </TabItem>
- <!-- 产品信息 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="BallotOutline" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="产品信息" />
- </StackPanel>
- </TabItem.Header>
- <StackPanel Margin="16">
- <GroupBox
- Width="400"
- Margin="10,5"
- HorizontalAlignment="Left"
- FontSize="{DynamicResource Font.Size.Title4}"
- Header="产品与mes参数绑定设置">
- <Grid Margin="20">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height=" auto" />
- <RowDefinition Height=" auto" />
- <RowDefinition Height=" auto" />
- <RowDefinition Height=" auto" />
- <RowDefinition Height=" auto" />
- </Grid.RowDefinitions>
- <TextBlock
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="产品名称:" />
- <ComboBox
- x:Name="selectProduct"
- Grid.Column="1"
- Width="100"
- Margin="10,4"
- HorizontalAlignment="Left"
- materialDesign:HintAssist.Hint="{lex:Loc 选择产品}"
- FontSize="14"
- ItemsSource="{Binding ProductList, Mode=TwoWay}"
- SelectedItem="{Binding SelectProduct, Mode=TwoWay}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Vertical">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="CubeOutline" />
- <TextBlock Text="{Binding Name}" />
- </StackPanel>
- <TextBlock
- MinHeight="0"
- MaxWidth="300"
- FontSize="{DynamicResource Font.Size.Captions4}"
- Foreground="Gray"
- Text="{Binding Description}"
- TextTrimming="CharacterEllipsis"
- TextWrapping="Wrap" />
- </StackPanel>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <TextBlock
- Grid.Row="1"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="产品编码(model):" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- MinWidth="100"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="ProMesInfo.ProductCode" />
- </TextBox.Text>
- </TextBox>
- <TextBlock
- Grid.Row="2"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="产品颜色:" />
- <TextBox
- Grid.Row="2"
- Grid.Column="1"
- MinWidth="100"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="ProMesInfo.ProductColor" />
- </TextBox.Text>
- </TextBox>
- <TextBlock
- Grid.Row="3"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="产品类型:" />
- <TextBox
- Grid.Row="3"
- Grid.Column="1"
- MinWidth="100"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="ProMesInfo.ProductLoadMode" />
- </TextBox.Text>
- </TextBox>
- <StackPanel
- Grid.Row="6"
- Grid.ColumnSpan="2"
- Margin="0,6"
- HorizontalAlignment="Center"
- Orientation="Horizontal">
- <Button
- MinWidth="100"
- Margin="5"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding GetProWithMesCommand}"
- Style="{StaticResource MaterialDesignRaisedButton}">
- <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
- <materialDesign:PackIcon Margin="0,0,6,0" Kind="PuzzleEditOutline" />
- <TextBlock VerticalAlignment="Center" Text="获取" />
- </StackPanel>
- </Button>
- <Button
- MinWidth="100"
- Margin="5"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding DeleteProWithMesCommand}"
- Style="{StaticResource MaterialDesignRaisedButton}">
- <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
- <materialDesign:PackIcon Margin="0,0,6,0" Kind="DeleteForeverOutline" />
- <TextBlock VerticalAlignment="Center" Text="删除" />
- </StackPanel>
- </Button>
- <Button
- MinWidth="100"
- Margin="5"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SaveProWithMesCommand}"
- Style="{StaticResource MaterialDesignRaisedButton}">
- <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
- <materialDesign:PackIcon Margin="0,0,6,0" Kind="ContentSaveCheck" />
- <TextBlock VerticalAlignment="Center" Text="保存" />
- </StackPanel>
- </Button>
- </StackPanel>
- </Grid>
- </GroupBox>
- </StackPanel>
- </TabItem>
- <!-- 生产排班 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="LanConnect" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="{lex:Loc 生产排班}" />
- </StackPanel>
- </TabItem.Header>
- <StackPanel Margin="16">
- <Button
- Width="60"
- Margin="10"
- HorizontalAlignment="Left"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SaveWorkShiftCommand}"
- CommandParameter="WorkShift"
- Style="{StaticResource MaterialDesignRaisedButton}"
- ToolTip="{lex:Loc 保存}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- <GroupBox
- Width="320"
- Margin="10,5"
- HorizontalAlignment="Left"
- FontSize="{DynamicResource Font.Size.Title4}"
- Header="白夜班时间设置">
- <Grid Margin="20">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height=" auto" />
- <RowDefinition Height=" auto" />
- <RowDefinition Height=" auto" />
- </Grid.RowDefinitions>
- <TextBlock
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="白班开始时间:" />
- <TextBox
- Grid.Row="0"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="WorkShifts.DayShift" />
- </TextBox.Text>
- </TextBox>
- <TextBlock
- Grid.Row="1"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="白班结束时间:" />
- <TextBox
- Grid.Row="1"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="WorkShifts.DayShift" />
- </TextBox.Text>
- </TextBox>
- <StackPanel
- Grid.RowSpan="2"
- Grid.Column="2"
- Margin="10,5"
- HorizontalAlignment="Center">
- <ToggleButton
- Width="60"
- Height="40"
- Margin="0,10" />
- </StackPanel>
- <!-- 结束符 -->
- <TextBlock
- Grid.Row="2"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="夜班开始时间:" />
- <TextBox
- Grid.Row="2"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="WorkShifts.NightShift" />
- </TextBox.Text>
- </TextBox>
- <TextBlock
- Grid.Row="3"
- Margin="0,0,0,8"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="夜班结束时间:" />
- <TextBox
- Grid.Row="3"
- Grid.Column="1"
- MinWidth="80"
- Margin="10,4"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center">
- <TextBox.Text>
- <Binding Mode="TwoWay" Path="WorkShifts.NightShift" />
- </TextBox.Text>
- </TextBox>
- <ToggleButton
- Grid.Row="2"
- Grid.RowSpan="2"
- Grid.Column="2"
- Width="60"
- Height="40"
- Margin="10,5"
- HorizontalAlignment="Center" />
- </Grid>
- </GroupBox>
- <!--<Button Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- Width="60"
- Margin="10"
- Content="test"
- HorizontalAlignment="Left"
- Command="{Binding testCommand}">
- </Button>-->
- </StackPanel>
- </TabItem>
- <!-- 字体 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="FontSize" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="{lex:Loc 字体}" />
- </StackPanel>
- </TabItem.Header>
- <ScrollViewer>
- <Grid Margin="20">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <Grid.Resources>
- <Style TargetType="TextBlock">
- <Setter Property="FontSize" Value="{DynamicResource Font.Size.Body2}" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="HorizontalAlignment" Value="Right" />
- </Style>
- <Style TargetType="mah:NumericUpDown">
- <Setter Property="FontSize" Value="{DynamicResource Font.Size.Body2}" />
- <Setter Property="Margin" Value="5,2" />
- <Setter Property="MinWidth" Value="100" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Minimum" Value="6" />
- <Setter Property="Interval" Value="2" />
- <Setter Property="Maximum" Value="62" />
- <Setter Property="StringFormat" Value="{}{0:N0}" />
- </Style>
- </Grid.Resources>
- <!-- 1 -->
- <TextBlock
- Grid.Row="0"
- Grid.Column="0"
- Text="{lex:Loc 标题,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}1: '}" />
- <mah:NumericUpDown
- Grid.Row="0"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Title1, Mode=TwoWay}" />
- <!-- 2 -->
- <TextBlock
- Grid.Row="1"
- Grid.Column="0"
- Text="{lex:Loc 标题,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}2: '}" />
- <mah:NumericUpDown
- Grid.Row="1"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Title2, Mode=TwoWay}" />
- <!-- 3 -->
- <TextBlock
- Grid.Row="2"
- Grid.Column="0"
- Text="{lex:Loc 标题,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}3: '}" />
- <mah:NumericUpDown
- Grid.Row="2"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Title3, Mode=TwoWay}" />
- <!-- 4 -->
- <TextBlock
- Grid.Row="3"
- Grid.Column="0"
- Text="{lex:Loc 标题,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}4: '}" />
- <mah:NumericUpDown
- Grid.Row="3"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Title4, Mode=TwoWay}" />
- <!-- 5 -->
- <TextBlock
- Grid.Row="4"
- Grid.Column="0"
- Text="{lex:Loc 正文,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}1: '}" />
- <mah:NumericUpDown
- Grid.Row="4"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Body1, Mode=TwoWay}" />
- <!-- 6 -->
- <TextBlock
- Grid.Row="5"
- Grid.Column="0"
- Text="{lex:Loc 正文,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}2: '}" />
- <mah:NumericUpDown
- Grid.Row="5"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Body2, Mode=TwoWay}" />
- <!-- 7 -->
- <TextBlock
- Grid.Row="6"
- Grid.Column="0"
- Text="{lex:Loc 正文,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}3: '}" />
- <mah:NumericUpDown
- Grid.Row="6"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Body3, Mode=TwoWay}" />
- <!-- 8 -->
- <TextBlock
- Grid.Row="7"
- Grid.Column="0"
- Text="{lex:Loc 正文,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}4: '}" />
- <mah:NumericUpDown
- Grid.Row="7"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Body4, Mode=TwoWay}" />
- <!-- 9 -->
- <TextBlock
- Grid.Row="8"
- Grid.Column="0"
- Text="{lex:Loc 标注,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}1: '}" />
- <mah:NumericUpDown
- Grid.Row="8"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Captions1, Mode=TwoWay}" />
- <!-- 10 -->
- <TextBlock
- Grid.Row="9"
- Grid.Column="0"
- Text="{lex:Loc 标注,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}2: '}" />
- <mah:NumericUpDown
- Grid.Row="9"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Captions2, Mode=TwoWay}" />
- <!-- 11 -->
- <TextBlock
- Grid.Row="10"
- Grid.Column="0"
- Text="{lex:Loc 标注,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}3: '}" />
- <mah:NumericUpDown
- Grid.Row="10"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Captions3, Mode=TwoWay}" />
- <!-- 12 -->
- <TextBlock
- Grid.Row="11"
- Grid.Column="0"
- Text="{lex:Loc 标注,
- Converter={StaticResource StringFormatConverter},
- ConverterParameter='{}{0}4: '}" />
- <mah:NumericUpDown
- Grid.Row="11"
- Grid.Column="1"
- materialDesign:HintAssist.Hint="Font Size"
- Value="{Binding Captions4, Mode=TwoWay}" />
- </Grid>
- </ScrollViewer>
- </TabItem>
- <!-- 语言 -->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon
- Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="TranslateVariant" />
- <TextBlock
- HorizontalAlignment="Stretch"
- FontSize="{DynamicResource Font.Size.Body2}"
- Style="{StaticResource TabHeaderTextBlockStyle}"
- Text="{lex:Loc SettingView_Language_Text}" />
- </StackPanel>
- </TabItem.Header>
- <StackPanel
- Margin="20"
- VerticalAlignment="Top"
- Orientation="Horizontal">
- <!-- 中文简体 -->
- <Button
- MinWidth="100"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SelectLanguageCommand}"
- CommandParameter="ChineseSimplified"
- FontSize="{DynamicResource Font.Size.Body1}"
- ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}">
- <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
- <Button.Style>
- <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
- <Setter Property="Foreground" Value="#000000" />
- <Style.Triggers>
- <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.ChineseSimplified}">
- <Setter Property="Background" Value="Green" />
- <Setter Property="BorderBrush" Value="Green" />
- </DataTrigger>
- <!--<DataTrigger Binding="{Binding management.CurrentLanguage}"
- Value="{x:Static enums:Language.English}">
- <Setter Property="Background"
- Value="#e4ff54" />
- <Setter Property="BorderBrush"
- Value="#e4ff54" />
- </DataTrigger>-->
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- <!-- 中文繁体 -->
- <Button
- MinWidth="100"
- Margin="20.0"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SelectLanguageCommand}"
- CommandParameter="ChineseTraditional"
- FontSize="{DynamicResource Font.Size.Body1}"
- ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}">
- <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
- <Button.Style>
- <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
- <Setter Property="Foreground" Value="#000000" />
- <Style.Triggers>
- <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.ChineseTraditional}">
- <Setter Property="Background" Value="Green" />
- <Setter Property="BorderBrush" Value="Green" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- <!-- 英语 -->
- <Button
- MinWidth="100"
- Margin="20.0"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SelectLanguageCommand}"
- CommandParameter="English"
- FontSize="{DynamicResource Font.Size.Body1}"
- ToolTip="{lex:Loc SettingView_Language_English}">
- <TextBlock Text="{lex:Loc SettingView_Language_English}" />
- <Button.Style>
- <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
- <Setter Property="Foreground" Value="#000000" />
- <Style.Triggers>
- <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.English}">
- <Setter Property="Background" Value="Green" />
- <Setter Property="BorderBrush" Value="Green" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- <!-- 日语 -->
- <Button
- MinWidth="100"
- Margin="20.0"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SelectLanguageCommand}"
- CommandParameter="Japanese"
- FontSize="{DynamicResource Font.Size.Body1}"
- ToolTip="{lex:Loc SettingView_Language_Japanese}">
- <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
- <Button.Style>
- <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
- <Setter Property="Foreground" Value="#000000" />
- <Style.Triggers>
- <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.Japanese}">
- <Setter Property="Background" Value="Green" />
- <Setter Property="BorderBrush" Value="Green" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- <!-- 越南语 -->
- <Button
- MinWidth="100"
- Margin="20.0"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding SelectLanguageCommand}"
- CommandParameter="Vietnamese"
- FontSize="{DynamicResource Font.Size.Body1}"
- ToolTip="{lex:Loc SettingView_Language_Vietnamese}">
- <TextBlock Text="{lex:Loc SettingView_Language_Vietnamese}" />
- <Button.Style>
- <Style BasedOn="{StaticResource MaterialDesignRaisedButton}" TargetType="Button">
- <Setter Property="Foreground" Value="#000000" />
- <Style.Triggers>
- <DataTrigger Binding="{Binding CurrentLanguage}" Value="{x:Static enums:Language.Vietnamese}">
- <Setter Property="Background" Value="Green" />
- <Setter Property="BorderBrush" Value="Green" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- </StackPanel>
- </TabItem>
- </TabControl>
- </Grid>
- </UserControl>
|