123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <UserControl
- x:Class="ShakerManger.View.ShakerPageView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:hc="https://handyorg.github.io/handycontrol"
- xmlns:local="clr-namespace:ShakerManger.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:model="clr-namespace:Shaker.Model;assembly=Shaker"
- xmlns:vm="clr-namespace:ShakerManger.ViewModel"
- d:DataContext="{d:DesignInstance {x:Type vm:MainWindowViewModel}}"
- d:DesignHeight="450"
- d:DesignWidth="800"
- DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data}"
- mc:Ignorable="d">
- <UserControl.Style>
- <Style TargetType="UserControl">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Source={StaticResource Login}, Path=Data.UserType}" Value="{x:Static model:UserType.SystemAdministrator}">
- <Setter Property="IsEnabled" Value="True" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Source={StaticResource Login}, Path=Data.UserType}" Value="{x:Static model:UserType.ClientUser}">
- <Setter Property="IsEnabled" Value="False" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Source={StaticResource Login}, Path=Data.UserType}" Value="{x:Static model:UserType.SystemUser}">
- <Setter Property="IsEnabled" Value="False" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </UserControl.Style>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="80" />
- <RowDefinition Height="auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Border Background="{StaticResource SystemItemsSelectBackColor}">
- <TextBlock Grid.Row="0" Margin="10">
- <Run
- FontFamily="Arial Black"
- FontSize="22"
- Foreground="{StaticResource MainBrush}"
- Text="振动台配置说明" />
- <LineBreak />
- <LineBreak />
- <Run
- FontSize="16"
- Foreground="{StaticResource MainBrush}"
- Text="当前振动台配置参数设置成功后需要重启下位机软件方可生效" />
- </TextBlock>
- </Border>
- <StackPanel
- x:Name="first"
- Grid.Row="1"
- Height="66"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16"
- Text="振动台:" />
- <ComboBox
- Width="720"
- Height="34"
- Margin="10,0,0,0"
- Background="Transparent"
- DisplayMemberPath="Description"
- FontSize="16"
- ItemsSource="{Binding Shakers.Shakers}"
- SelectedValue="{Binding SystemConfig.ShakerPage.CurrentShaker}"
- Style="{StaticResource ComboBoxStyle1}"
- TabIndex="0" />
- </StackPanel>
- <UniformGrid
- Grid.Row="2"
- Margin="0,20,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- d:DataContext="{d:DesignInstance {x:Type vm:ShakerControlViewModel}}"
- Columns="1">
- <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16">
- <Run Foreground="Red" Text="*" />
- <Run Text="振动台别名:" />
- </TextBlock>
- <TextBox
- Width="720"
- Height="34"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- TabIndex="1"
- Text="{Binding SystemConfig.ShakerPage.CurrentShaker.Description}" />
- </StackPanel>
- <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16">
- <Run Foreground="Red" Text="*" />
- <Run Text="功放IP地址:" />
- </TextBlock>
- <TextBox
- Width="720"
- Height="34"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- InputScope="Digits"
- TabIndex="1"
- Text="{Binding SystemConfig.ShakerPage.CurrentShaker.IPAddress}" />
- </StackPanel>
- <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16">
- <Run Foreground="Red" Text="*" />
- <Run Text="功放端口:" />
- </TextBlock>
- <hc:NumericUpDown
- Width="120"
- Height="34"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- Maximum="65535"
- Minimum="1"
- TabIndex="2"
- Value="{Binding SystemConfig.ShakerPage.CurrentShaker.Port, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- </StackPanel>
- <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16">
- <Run Foreground="Red" Text="*" />
- <Run Text="客户端ID:" />
- </TextBlock>
- <TextBox
- Width="720"
- Height="34"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- TabIndex="1"
- Text="{Binding SystemConfig.ShakerPage.CurrentShaker.ClientID}" />
- </StackPanel>
- <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16">
- <Run Foreground="Red" Text="*" />
- <Run Text="SlaveID:" />
- </TextBlock>
- <hc:NumericUpDown
- Width="120"
- Height="34"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- Maximum="254"
- Minimum="1"
- TabIndex="3"
- Value="{Binding SystemConfig.ShakerPage.CurrentShaker.SlaveID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- </StackPanel>
- <UniformGrid Rows="1">
- <Button
- Width="144"
- Height="34"
- hc:IconElement.Geometry="{StaticResource SaveGeometry}"
- hc:IconElement.Height="20"
- hc:IconElement.Width="20"
- Command="{Binding SystemConfig.ShakerPage.SaveCommand}"
- Content="保存配置"
- FontSize="16"
- Style="{StaticResource HasIconButton}"
- TabIndex="4" />
- </UniformGrid>
- </UniformGrid>
- </Grid>
- </UserControl>
|