| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123 |
- <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:sys="clr-namespace:System;assembly=mscorlib"
- xmlns:sysio="clr-namespace:System.IO.Ports;assembly=System"
- xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels"
- xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
- xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
- xmlns:enums1="clr-namespace:Team.FFFeederService;assembly=Team.FFFeederService"
- xmlns:valRules="clr-namespace:TeamAAS_VP.Identity"
- xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
- xmlns:c="clr-namespace:TeamAAS_VP.ValueConverter"
- xmlns:lex="http://wpflocalizeextension.codeplex.com"
- xmlns:coreLights="clr-namespace:TeamAAS_VP.Core.Lights"
- xmlns:io="clr-namespace:System.IO.Ports;assembly=System"
- lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
- lex:ResxLocalizationProvider.DefaultDictionary="Lang"
- lex:LocalizeDictionary.DesignCulture="zh-CN"
- mc:Ignorable="d"
- d:DataContext="{d:DesignInstance Type=vm:SettingViewModel}"
- d:Height="600"
- d:Width="1024"
- d:Background="White"
- x:Class="TeamAAS_VP.Views.SettingView"
- prism:ViewModelLocator.AutoWireViewModel="True"
- FontFamily="{DynamicResource DefaultFont}">
- <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 Style="{StaticResource TabHeaderTextBlockStyle}"
- FontSize="{DynamicResource Font.Size.Body2}"
- Text="{lex:Loc SettingView_Camera_Text}"
- HorizontalAlignment="Stretch" />
- </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 Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc SettingView_Camera_btnAddCamera}"
- Command="{Binding AddCameraCommand}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc SettingView_Camera_btnEditCamera}"
- Margin="20,0"
- Command="{Binding EditCameraCommand}">
- <materialDesign:PackIcon Kind="PuzzleEditOutline" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc SettingView_Camera_btnRemoveCamera}"
- Command="{Binding RemoveCameraCommand}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- Margin="20,0"
- ToolTip="{lex:Loc 保存}"
- Command="{Binding SaveCamerasCommand}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!--相机列表-->
- <TreeView Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem Header="{lex:Loc SettingView_Camera_CameraList}"
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- 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 Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <TextBlock Text="{Binding CameraBrand}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <TextBlock Text="-"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <TextBlock Text="{Binding ManufacturerName}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{lex:Loc 型号, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <TextBlock Text="{Binding Model,Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <TextBlock Text="{lex:Loc 序列号,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- Margin="10,0,0,0" />
- <TextBlock Text="{Binding SerialNumber,Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{lex:Loc 类型, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <TextBlock Text="{Binding CameraType}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <TextBlock Text="IP: "
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- Margin="10,0,0,0" />
- <TextBlock Text="{Binding CameraIp}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}" />
- </StackPanel>
- <Border Height="2"
- Margin="0"
- BorderThickness="2"
- BorderBrush="Green" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- </Grid>
- </TabItem>
- <!--机器人-->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="RobotIndustrialOutline" />
- <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
- FontSize="{DynamicResource Font.Size.Body2}"
- Text="{lex:Loc 机器人}"
- HorizontalAlignment="Stretch" />
- </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 Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc 增加机器人}"
- Command="{Binding AddRobotCommand}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc 移除机器人}"
- Margin="20,0"
- Command="{Binding RemoveCommand}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}"
- Command="{Binding SaveRobotsCommand}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!--机器人列表-->
- <TreeView Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem Header="{lex:Loc 机器人列表}"
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- 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 Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- <TextBlock Text="{Binding RobotBrand,Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Margin="10,0,0,0"
- Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <TextBlock Text="{Binding ConnectType,Mode=TwoWay}"
- VerticalAlignment="Center"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <!--PLC-->
- <TextBlock Text="PLC: "
- Margin="10,0,0,0"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- d:Visibility="Collapsed"
- Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
- <TextBlock Text="{Binding PLC,Converter={StaticResource PlcIdToNameConverter}}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- d:Visibility="Collapsed"
- Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal"
- Visibility="{Binding RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
- <TextBlock Text="{Binding IP,StringFormat=IP:{0},Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- <TextBlock Text="{Binding Port,StringFormat=Port:{0},Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Margin="10,0" />
- <TextBlock Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- <TextBlock Text="{Binding Terminator,Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- </StackPanel>
- <Border Height="2"
- Margin="0"
- BorderThickness="2"
- BorderBrush="Green" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!--参数详情-->
- <ScrollViewer Grid.Row="1"
- Grid.Column="1"
- IsEnabled="{Binding IsAllowEdit}"
- Margin="20"
- Visibility="{Binding SelectRobot,Converter={StaticResource ObjectToVisibilityConverter}}">
- <Grid HorizontalAlignment="Stretch"
- VerticalAlignment="Top">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <!--id-->
- <TextBlock Text="Id: "
- Grid.Row="0"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <TextBlock x:Name="txt_Id"
- Text="{Binding SelectRobot.Id,Mode=TwoWay}"
- Grid.Row="0"
- Grid.Column="1"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <!--名称-->
- <TextBlock Text="{lex:Loc 名称,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="1"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}" />
- <TextBox Grid.Row="1"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
- FontSize="{DynamicResource Font.Size.Body3}"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center">
- <TextBox.Text>
- <Binding Path="SelectRobot.RobotName"
- Mode="TwoWay">
- <Binding.ValidationRules>
- <valRules:NameValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!--机器人品牌-->
- <TextBlock Text="{lex:Loc 品牌,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="2"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <ComboBox Grid.Row="2"
- Grid.Column="1"
- Margin="10,0"
- FontSize="{DynamicResource Font.Size.Body3}"
- Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
- MinWidth="80"
- SelectedItem="{Binding SelectRobot.RobotBrand,Mode=TwoWay}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:RobotBrand}"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center" />
- <!--通讯方式-->
- <TextBlock Text="{lex:Loc 通讯方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="3"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <ComboBox Grid.Row="3"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
- MinWidth="80"
- SelectedItem="{Binding SelectRobot.ConnectType,Mode=TwoWay}"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <!--IP地址-->
- <TextBlock Text="IP: "
- Grid.Row="4"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <TextBox Grid.Row="4"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
- FontSize="{DynamicResource Font.Size.Body3}"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
- <TextBox.Text>
- <Binding Path="SelectRobot.IP"
- Mode="TwoWay">
- <Binding.ValidationRules>
- <valRules:IPValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!--端口号-->
- <TextBlock Text="Port: "
- Grid.Row="5"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <TextBox Grid.Row="5"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
- FontSize="{DynamicResource Font.Size.Body3}"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}">
- <TextBox.Text>
- <Binding Path="SelectRobot.Port"
- Mode="TwoWay">
- <Binding.ValidationRules>
- <valRules:PortValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!--结束符-->
- <TextBlock Text="{lex:Loc 结束符,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="6"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <ComboBox SelectedItem="{Binding SelectRobot.Terminator,Mode=TwoWay}"
- Grid.Row="6"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
- MinWidth="80"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <!--编码格式-->
- <TextBlock Grid.Row="7"
- Grid.Column="0"
- Text="{lex:Loc 编码解码,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <ComboBox SelectedItem="{Binding SelectRobot.DataEncoding,Mode=TwoWay}"
- Grid.Row="7"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
- MinWidth="80"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverter}}" />
- <!--PLC-->
- <TextBlock Grid.Row="3"
- Grid.Column="0"
- Text="PLC: "
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- d:Visibility="Collapsed"
- Visibility="{Binding SelectRobot.RobotBrand,Converter={StaticResource RobotBrandToVisibiltyConverterInverse}}" />
- <ComboBox SelectedItem="{Binding RobotSelectedPlc}"
- Grid.Row="3"
- Grid.Column="1"
- Margin="10,5"
- ItemsSource="{Binding PlcList}"
- Width="{Binding ElementName=txt_Id,Path=ActualWidth}"
- MinWidth="80"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- d:Visibility="Collapsed"
- 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 Style="{StaticResource TabHeaderTextBlockStyle}"
- FontSize="{DynamicResource Font.Size.Body2}"
- Text="Feeder"
- HorizontalAlignment="Stretch" />
- </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 Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc 增加Feeder}"
- Command="{Binding AddFeederCommand}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc 移除Feeder}"
- Margin="20,0"
- Command="{Binding RemoveFeederCommand}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}"
- Command="{Binding SaveFeedersCommand}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!--Feeder列表-->
- <TreeView Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem Header="{lex:Loc Feeder列表}"
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- 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 Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}" />
- <TextBlock Text="{Binding FeederBrand,Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Margin="10,0,0,0" />
- <TextBlock Text="{Binding ConnectType,Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{Binding IP,StringFormat=IP:{0},Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- <TextBlock Text="{Binding Port,StringFormat=Port:{0},Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Margin="10,0" />
- </StackPanel>
- <Border Height="2"
- Margin="0"
- BorderThickness="2"
- BorderBrush="Green" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!--参数详情-->
- <ScrollViewer Grid.Row="1"
- IsEnabled="{Binding IsAllowEdit}"
- Grid.Column="1"
- Margin="20"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- 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 Text="Id: "
- Grid.Row="0"
- Grid.Column="0"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBlock x:Name="txt_Feeder_Id"
- Text="{Binding SelectFeeder.Id,Mode=TwoWay}"
- Grid.Row="0"
- Grid.Column="1"
- FontSize="{DynamicResource Font.Size.Body3}"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center" />
- <!--名称-->
- <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="1"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBox Grid.Row="1"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
- FontSize="{DynamicResource Font.Size.Body3}"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center">
- <TextBox.Text>
- <Binding Path="SelectFeeder.FeederName"
- Mode="TwoWay">
- <Binding.ValidationRules>
- <valRules:NameValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!--Feeder品牌-->
- <TextBlock Text="{lex:Loc 品牌, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="2"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <ComboBox SelectedItem="{Binding SelectFeeder.FeederBrand,Mode=TwoWay}"
- Grid.Row="2"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
- FontSize="{DynamicResource Font.Size.Body3}"
- MinWidth="80"
- ItemsSource="{ext:EnumBindingSource EnumType=enums1:FeederBrand}"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center" />
- <!--通讯方式-->
- <TextBlock Text="{lex:Loc 通讯方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="3"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <ComboBox SelectedItem="{Binding SelectFeeder.ConnectType,Mode=TwoWay}"
- Grid.Row="3"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
- MinWidth="80"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:TCPConnectType}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center" />
- <!--IP地址-->
- <TextBlock Text="IP: "
- Grid.Row="4"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBox Grid.Row="4"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
- FontSize="{DynamicResource Font.Size.Body3}"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center">
- <TextBox.Text>
- <Binding Path="SelectFeeder.IP"
- Mode="TwoWay">
- <Binding.ValidationRules>
- <valRules:IPValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!--端口号-->
- <TextBlock Text="Port: "
- Grid.Row="5"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBox Grid.Row="5"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_Feeder_Id,Path=ActualWidth}"
- FontSize="{DynamicResource Font.Size.Body3}"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center">
- <TextBox.Text>
- <Binding Path="SelectFeeder.Port"
- Mode="TwoWay">
- <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 Style="{StaticResource TabHeaderTextBlockStyle}"
- FontSize="{DynamicResource Font.Size.Body2}"
- Text="PLC"
- HorizontalAlignment="Stretch" />
- </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 Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc 增加PLC}"
- Command="{Binding AddPlcCommand}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc 移除PLC}"
- Margin="20,0"
- Command="{Binding RemovePlcCommand}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}"
- Command="{Binding SavePlcsCommand}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!--PLC列表-->
- <TreeView Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem Header="{lex:Loc PLC列表}"
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- IsExpanded="True"
- ItemsSource="{Binding PlcList}">
- <TreeViewItem.ItemTemplate>
- <HierarchicalDataTemplate>
- <StackPanel Orientation="Vertical">
- <TextBlock Text="{Binding Name,Mode=TwoWay}"
- FontSize="{DynamicResource Font.Size.Title4}" />
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{lex:Loc 连接方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Margin="10,0,0,0" />
- <TextBlock Text="{Binding CommunicationType,Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{Binding EndpointUrl,StringFormat=Endpoint Url:{0},Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- </StackPanel>
- <Border Height="2"
- Margin="0"
- BorderThickness="2"
- BorderBrush="Green" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!--参数详情-->
- <ScrollViewer Grid.Row="1"
- IsEnabled="{Binding IsAllowEdit}"
- Grid.Column="1"
- Margin="20"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- 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 Text="Id: "
- Grid.Row="0"
- Grid.Column="0"
- FontSize="{DynamicResource Font.Size.Body3}"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBlock x:Name="txt_plc_Id"
- Text="{Binding SelectPlc.Id,Mode=TwoWay}"
- Grid.Row="0"
- Grid.Column="1"
- FontSize="{DynamicResource Font.Size.Body3}"
- Margin="10,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center" />
- <!--名称-->
- <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="1"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBox Grid.Row="1"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
- FontSize="{DynamicResource Font.Size.Body3}"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center">
- <TextBox.Text>
- <Binding Path="SelectPlc.Name"
- Mode="TwoWay">
- <Binding.ValidationRules>
- <valRules:NameValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!--通讯方式-->
- <TextBlock Text="{lex:Loc 通讯方式, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="2"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <ComboBox SelectedItem="{Binding SelectPlc.CommunicationType,Mode=TwoWay}"
- Grid.Row="2"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
- MinWidth="80"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:CommunicationType}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center" />
- <!--Endpoint Url地址-->
- <TextBlock Text="Endpoints Url: "
- Grid.Row="3"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBox Grid.Row="3"
- Grid.Column="1"
- Margin="10,0"
- Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
- FontSize="{DynamicResource Font.Size.Body3}"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Text="{Binding SelectPlc.EndpointUrl}" />
- <!--节点头-->
- <TextBlock Text="{lex:Loc 节点头, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="4"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBox Grid.Row="4"
- Grid.Column="1"
- FontSize="{DynamicResource Font.Size.Body3}"
- Margin="10,0"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Width="{Binding ElementName=txt_plc_Id,Path=ActualWidth}"
- Text="{Binding SelectPlc.NodeHeader,Mode=TwoWay}" />
- </Grid>
- </ScrollViewer>
- </Grid>
- </TabItem>
- <!--光源控制器-->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="TelevisionAmbientLight" />
- <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
- FontSize="{DynamicResource Font.Size.Body2}"
- Text="{lex:Loc 光源控制器}"
- HorizontalAlignment="Stretch" />
- </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 Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- ToolTip="{lex:Loc 增加光源控制器}"
- Command="{Binding AddLightControllerCommand}">
- <materialDesign:PackIcon Kind="Plus" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniDarkButton}"
- ToolTip="{lex:Loc 移除光源控制器}"
- Margin="20,0"
- Command="{Binding RemoveLightControllerCommand}">
- <materialDesign:PackIcon Kind="DeleteForeverOutline" />
- </Button>
- <Button Style="{StaticResource MaterialDesignFloatingActionMiniSecondaryDarkButton}"
- ToolTip="{lex:Loc 保存}"
- Command="{Binding SaveLightControllersCommand}">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- </StackPanel>
- <!--控制器列表-->
- <TreeView Grid.Row="1"
- Grid.Column="0"
- SelectedItemChanged="TreeView_SelectedItemChanged">
- <TreeViewItem Header="{lex:Loc 光源控制器列表}"
- FontSize="{DynamicResource Font.Size.Title4}"
- FontWeight="Bold"
- 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 Text="{lex:Loc 型号, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Margin="10,0,0,0" />
- <TextBlock Text="{Binding LightModel,Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{lex:Loc 通道数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}"
- Margin="10,0,0,0" />
- <TextBlock Text="{Binding ChannelCount,Mode=TwoWay}"
- Style="{StaticResource MaterialDesignCaptionTextBlock}"
- FontSize="{DynamicResource Font.Size.Captions3}" />
- </StackPanel>
- <Border Height="2"
- Margin="0"
- BorderThickness="2"
- BorderBrush="Green" />
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeViewItem.ItemTemplate>
- </TreeViewItem>
- </TreeView>
- <!--参数详情-->
- <ScrollViewer Grid.Row="1"
- IsEnabled="{Binding IsAllowEdit}"
- Grid.Column="1"
- Margin="20"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- 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 Text="Id: "
- Grid.Row="0"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBlock Text="{Binding SelectLightController.Id}"
- Grid.Row="0"
- Grid.Column="1"
- Margin="10,0"
- VerticalAlignment="Center" />
- <!-- Name -->
- <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="1"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBox Grid.Row="1"
- Grid.Column="1"
- Margin="10,0"
- Text="{Binding SelectLightController.Name,Mode=TwoWay}" />
- <!-- Model -->
- <TextBlock Text="{lex:Loc 型号, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="2"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <ComboBox Grid.Row="2"
- Grid.Column="1"
- Margin="10,0"
- SelectedItem="{Binding SelectLightController.LightModel,Mode=TwoWay}"
- ItemsSource="{ext:EnumBindingSource EnumType=coreLights:LightModel}" />
- <!-- Channel count -->
- <TextBlock Text="{lex:Loc 通道数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="3"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center" />
- <TextBox Grid.Row="3"
- Grid.Column="1"
- Margin="10,0"
- Text="{Binding SelectLightController.ChannelCount,Mode=TwoWay}"
- IsReadOnly="True" />
- <!-- Channel configs list -->
- <TextBlock Text="{lex:Loc 通道配置}"
- Grid.Row="4"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- HorizontalAlignment="Right"
- VerticalAlignment="Top" />
- <ItemsControl Grid.Row="4"
- Grid.Column="1"
- Margin="10,0"
- ItemsSource="{Binding SelectLightController.ChannelConfigs}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal"
- Margin="0,4">
- <TextBlock Text="{Binding LocalIndex}"
- Width="30"
- VerticalAlignment="Center" />
- <TextBox Text="{Binding Name,Mode=TwoWay}"
- Width="180"
- Margin="6,0" />
- <TextBlock Text="亮度:"
- VerticalAlignment="Center"
- Margin="6,0" />
- <TextBox Text="{Binding DefaultBrightness,Mode=TwoWay}"
- Width="80" />
- </StackPanel>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- <!-- Serial port config (visible for serial model) -->
- <GroupBox Grid.Row="5"
- Grid.ColumnSpan="2"
- Header="{lex:Loc 串口配置}"
- Margin="0,12,0,0">
- <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>
- </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 Text="PortName:"
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right" />
- <TextBox Text="{Binding SelectLightController.SerialPortConfig.PortName,Mode=TwoWay}"
- Grid.Row="0"
- Grid.Column="1"
- Margin="6,0" />
- <TextBlock Text="BaudRate:"
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right" />
- <TextBox Text="{Binding SelectLightController.SerialPortConfig.BaudRate,Mode=TwoWay}"
- Grid.Row="1"
- Grid.Column="1"
- Margin="6,0" />
- <TextBlock Text="Parity:"
- Grid.Row="2"
- Grid.Column="0"
- HorizontalAlignment="Right" />
- <ComboBox Grid.Row="2"
- Grid.Column="1"
- SelectedItem="{Binding SelectLightController.SerialPortConfig.Parity,Mode=TwoWay}"
- ItemsSource="{Binding Source={StaticResource Parity}}"/>
- <TextBlock Text="StopBits:"
- Grid.Row="3"
- Grid.Column="0"
- HorizontalAlignment="Right" />
- <ComboBox Grid.Row="3"
- Grid.Column="1"
- SelectedItem="{Binding SelectLightController.SerialPortConfig.StopBits,Mode=TwoWay}"
- ItemsSource="{Binding Source={StaticResource StopBits}}" />
- <TextBlock Text="DataBits:"
- Grid.Row="4"
- Grid.Column="0"
- HorizontalAlignment="Right" />
- <TextBox Text="{Binding SelectLightController.SerialPortConfig.DataBits,Mode=TwoWay}"
- Grid.Row="4"
- Grid.Column="1"
- Margin="6,0" />
- </Grid>
- </GroupBox>
- <!-- TCP config (visible for non-serial models) -->
- <GroupBox Grid.Row="5"
- Grid.ColumnSpan="2"
- Header="{lex:Loc TCP配置}"
- Margin="0,12,0,0">
- <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>
- </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 Text="IP:"
- Grid.Row="0"
- Grid.Column="0"
- HorizontalAlignment="Right" />
- <TextBox Text="{Binding SelectLightController.TcpConfig.IP,Mode=TwoWay}"
- Grid.Row="0"
- Grid.Column="1"
- Margin="6,0" />
- <TextBlock Text="Port:"
- Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Right" />
- <TextBox Text="{Binding SelectLightController.TcpConfig.Port,Mode=TwoWay}"
- Grid.Row="1"
- Grid.Column="1"
- Margin="6,0" />
- </Grid>
- </GroupBox>
- </Grid>
- </ScrollViewer>
- </Grid>
- </TabItem>
- <!--通讯-->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="Lan" />
- <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
- FontSize="{DynamicResource Font.Size.Body2}"
- Text="{lex:Loc 通讯}"
- HorizontalAlignment="Stretch" />
- </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 Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- Width="60"
- ToolTip="{lex:Loc 保存}"
- HorizontalAlignment="Left"
- Command="{Binding SaveCommunicateCommand}"
- CommandParameter="TCPIP">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- <GroupBox Grid.Row="1"
- Header="{lex:Loc 后台TCPIP服务器}"
- FontSize="{DynamicResource Font.Size.Title4}"
- Margin="5,5">
- <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"
- Text="Port: "
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right" />
- <TextBox Grid.Row="0"
- Grid.Column="1"
- Margin="10,4"
- MinWidth="80"
- FontSize="{DynamicResource Font.Size.Body3}"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center">
- <TextBox.Text>
- <Binding Path="BgTcp.Port"
- Mode="TwoWay">
- <Binding.ValidationRules>
- <valRules:PortValidationRule />
- </Binding.ValidationRules>
- </Binding>
- </TextBox.Text>
- </TextBox>
- <!--结束符-->
- <TextBlock Margin="0,0,0,8"
- Grid.Row="1"
- VerticalAlignment="Center"
- Text="{lex:Loc 结束符, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right" />
- <ComboBox SelectedItem="{Binding BgTcp.Terminator,Mode=TwoWay}"
- Grid.Row="1"
- Grid.Column="1"
- Margin="10,4"
- MinWidth="80"
- HorizontalContentAlignment="Center"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:Terminator}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Left"
- VerticalAlignment="Center" />
- <!--编码格式-->
- <TextBlock Text="{lex:Loc 编码解码, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Grid.Row="2"
- VerticalAlignment="Center"
- Grid.Column="0"
- Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right" />
- <ComboBox SelectedItem="{Binding BgTcp.DataEncoding,Mode=TwoWay}"
- Grid.Row="2"
- Grid.Column="1"
- Margin="10,4"
- MinWidth="80"
- ItemsSource="{ext:EnumBindingSource EnumType=enums:DataEncoding}"
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center" />
- </Grid>
- </GroupBox>
- <Button Grid.Column="1"
- Style="{StaticResource MaterialDesignRaisedButton}"
- materialDesign:ButtonAssist.CornerRadius="10"
- Width="60"
- ToolTip="{lex:Loc 保存}"
- HorizontalAlignment="Left"
- Command="{Binding SaveCommunicateCommand}"
- CommandParameter="ModbusTCP">
- <materialDesign:PackIcon Kind="ContentSaveCheck" />
- </Button>
- <materialDesign:PopupBox Grid.Column="1"
- HorizontalAlignment="Right"
- VerticalAlignment="Center">
- <StackPanel Orientation="Vertical"
- Margin="10">
- <TextBlock TextWrapping="Wrap"
- TextAlignment="Left"
- Text="功能码 1 ReadCoils 读取DO的状态" />
- <TextBlock TextWrapping="Wrap"
- TextAlignment="Left"
- Text="功能码 2 ReadInputs 读取DI的状态" />
- <TextBlock TextWrapping="Wrap"
- TextAlignment="Left"
- Text="功能码 3 ReadHoldingRegisters 读取AO的值" />
- <TextBlock TextWrapping="Wrap"
- TextAlignment="Left"
- Text="功能码 4 ReadInputRegisters 读取AI的值" />
- <TextBlock TextWrapping="Wrap"
- TextAlignment="Left"
- Text="功能码 5 WriteSingleCoil 写入值到DO" />
- <TextBlock TextWrapping="Wrap"
- TextAlignment="Left"
- Text="功能码 6 WriteSingleRegister 写入值到AO" />
- <TextBlock TextWrapping="Wrap"
- TextAlignment="Left"
- Text="功能码 15 WriteMultipleCoils 写多线圈寄存器" />
- <TextBlock TextWrapping="Wrap"
- TextAlignment="Left"
- Text="功能码 16 WriteMultipleRegisters 写多个保持寄存器" />
- <TextBlock TextWrapping="Wrap"
- TextAlignment="Left"
- Text="功能码 23 ReadWriteMultipleRegisters 读写多个保持寄存器" />
- </StackPanel>
- </materialDesign:PopupBox>
- <GroupBox Grid.Row="1"
- Margin=" 5,5"
- Grid.Column="1"
- Header="{lex:Loc 后台ModbusTCPSlave}"
- FontSize="{DynamicResource Font.Size.Title4}">
- <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"
- Text="IP: "
- FontSize="{DynamicResource Font.Size.Body3}"
- VerticalAlignment="Center"
- HorizontalAlignment="Right" />
- <TextBox Grid.Row="0"
- Grid.Column="1"
- Margin="10,4"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding BgModbus.IP,Mode=TwoWay}" />
- <!--port-->
- <TextBlock Grid.Row="1"
- Margin="0,0,0,8"
- Text="Port: "
- FontSize="{DynamicResource Font.Size.Body3}"
- VerticalAlignment="Center"
- HorizontalAlignment="Right" />
- <TextBox Grid.Row="1"
- Grid.Column="1"
- Margin="10,4"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding BgModbus.Port,Mode=TwoWay}" />
- <!--SlaveID-->
- <TextBlock Grid.Row="2"
- Margin="0,0,0,8"
- VerticalAlignment="Center"
- Text="SlaveID: "
- FontSize="{DynamicResource Font.Size.Body3}"
- HorizontalAlignment="Right" />
- <TextBox Grid.Row="2"
- Grid.Column="1"
- Margin="10,4"
- MinWidth="80"
- TextAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{Binding BgModbus.SlaveID,Mode=TwoWay}" />
- <!--是否启用-->
- <TextBlock Margin="0,0,0,8"
- Grid.Row="3"
- Text="{lex:Loc 是否启用, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- FontSize="{DynamicResource Font.Size.Body3}"
- VerticalAlignment="Center"
- HorizontalAlignment="Right" />
- <ToggleButton Grid.Row="3"
- Grid.Column="1"
- Margin="10,4"
- MinWidth="80"
- IsChecked="{Binding BgModbus.IsEnabled,Mode=TwoWay}"
- HorizontalContentAlignment="Center"
- HorizontalAlignment="Left"
- VerticalAlignment="Center" />
- </Grid>
- </GroupBox>
- </Grid>
- </TabItem>
- <!--生产排班-->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="LanConnect" />
- <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
- FontSize="{DynamicResource Font.Size.Body2}"
- Text="{lex:Loc 生产排班}"
- HorizontalAlignment="Stretch" />
- </StackPanel>
- </TabItem.Header>
- <StackPanel Margin="16">
- <TextBlock Margin="0,0,0,8"
- Style="{StaticResource MaterialDesignHeadline5TextBlock}"
- FontSize="{DynamicResource Font.Size.Body3}"
- Text="{lex:Loc 白夜班}" />
- </StackPanel>
- </TabItem>
- <!--字体-->
- <TabItem>
- <TabItem.Header>
- <StackPanel HorizontalAlignment="Stretch">
- <materialDesign:PackIcon Width="24"
- Height="24"
- HorizontalAlignment="Center"
- Kind="FontSize" />
- <TextBlock Style="{StaticResource TabHeaderTextBlockStyle}"
- FontSize="{DynamicResource Font.Size.Body2}"
- Text="{lex:Loc 字体}"
- HorizontalAlignment="Stretch" />
- </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 Style="{StaticResource TabHeaderTextBlockStyle}"
- FontSize="{DynamicResource Font.Size.Body2}"
- Text="{lex:Loc SettingView_Language_Text}"
- HorizontalAlignment="Stretch" />
- </StackPanel>
- </TabItem.Header>
- <StackPanel Margin="20"
- Orientation="Horizontal"
- VerticalAlignment="Top">
- <!--中文简体-->
- <Button MinWidth="100"
- materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="{lex:Loc SettingView_Language_ChineseSimplified}"
- FontSize="{DynamicResource Font.Size.Body1}"
- Command="{Binding SelectLanguageCommand}"
- CommandParameter="ChineseSimplified">
- <TextBlock Text="{lex:Loc SettingView_Language_ChineseSimplified}" />
- <Button.Style>
- <Style TargetType="Button"
- BasedOn="{StaticResource MaterialDesignRaisedButton}">
- <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"
- ToolTip="{lex:Loc SettingView_Language_ChineseTraditional}"
- FontSize="{DynamicResource Font.Size.Body1}"
- Command="{Binding SelectLanguageCommand}"
- CommandParameter="ChineseTraditional">
- <TextBlock Text="{lex:Loc SettingView_Language_ChineseTraditional}" />
- <Button.Style>
- <Style TargetType="Button"
- BasedOn="{StaticResource MaterialDesignRaisedButton}">
- <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"
- ToolTip="{lex:Loc SettingView_Language_English}"
- FontSize="{DynamicResource Font.Size.Body1}"
- Command="{Binding SelectLanguageCommand}"
- CommandParameter="English">
- <TextBlock Text="{lex:Loc SettingView_Language_English}" />
- <Button.Style>
- <Style TargetType="Button"
- BasedOn="{StaticResource MaterialDesignRaisedButton}">
- <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"
- ToolTip="{lex:Loc SettingView_Language_Japanese}"
- FontSize="{DynamicResource Font.Size.Body1}"
- Command="{Binding SelectLanguageCommand}"
- CommandParameter="Japanese">
- <TextBlock Text="{lex:Loc SettingView_Language_Japanese}" />
- <Button.Style>
- <Style TargetType="Button"
- BasedOn="{StaticResource MaterialDesignRaisedButton}">
- <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>
- </StackPanel>
- </TabItem>
-
- </TabControl>
- </Grid>
- </UserControl>
|