Commit 51dc32ec authored by 潘栩锋's avatar 潘栩锋 🚴

1.添加 吸料的寄存器地址表

2.修改 称重服务器画面
parent 05ac8097
<NavigationWindow x:Class="FLY.Weight.UI.Server.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" ResizeMode="NoResize" SizeToContent="WidthAndHeight" MinWidth="400" MinHeight="200"
Title="MainWindow" SizeToContent="WidthAndHeight" MinWidth="400" MinHeight="200"
ShowsNavigationUI="False"
Loaded="NavigationWindow_Loaded">
</NavigationWindow>
......@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.Weight.UI.Server"
mc:Ignorable="d"
Title="PgMain" Height="270" Width="765">
Title="PgMain" MinHeight="270" Width="765">
<Page.Resources>
<local:PgMainVmUt x:Key="viewModel"/>
</Page.Resources>
......@@ -15,8 +15,6 @@
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid x:Name="grid_plc"/>
<Grid x:Name="grid_plcos"/>
<Grid x:Name="grid_WeightSystem"/>
<Grid Margin="5">
<Grid.ColumnDefinitions>
......@@ -36,8 +34,8 @@
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition />
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<GroupBox Header="称重">
<Grid>
......@@ -45,54 +43,57 @@
<RowDefinition/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<ItemsControl x:Name="itemcontrol" ItemsSource="{Binding PLCs}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel Orientation="Horizontal" >
<StackPanel Margin="4" >
<TextBlock Text="更新速度" />
<TextBlock FontSize="20">
<ScrollViewer>
<ItemsControl x:Name="itemcontrol_weighter" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel Orientation="Horizontal" >
<StackPanel Margin="4" >
<TextBlock Text="更新速度" />
<TextBlock FontSize="20">
<Run Text="{Binding ActUpdateInterval,StringFormat=\{0:sfff\}, Mode=OneWay}" />
<Run Text="ms" FontSize="15"/>
</TextBlock>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="{Binding Client.RemoteAddr,Mode=OneWay}" />
<TextBlock >
</TextBlock>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="{Binding Client.RemoteAddr,Mode=OneWay}" />
<TextBlock >
连接状态[<Run Text="{Binding Client.IsConnected,Mode=OneWay}" FontSize="20"/>]
</TextBlock>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="异常次数" />
<TextBlock Text="{Binding ErrorCnt}" FontSize="20"/>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="寄存器更新数" />
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="20">
<Run Text="{Binding DRNeedUpdateCnt,Mode=OneWay}"/>/<Run Text="{Binding DRCnt,Mode=OneWay}"/>
</TextBlock>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="异常次数" />
<TextBlock Text="{Binding ErrorCnt}" FontSize="20"/>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="寄存器更新数" />
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="20">
<Run Text="{Binding DRNeedUpdateCnt,Mode=OneWay}"/>/<Run Text="{Binding DRCnt,Mode=OneWay}"/>
</TextBlock>
</StackPanel>
</StackPanel>
<Button Margin="4" Padding="5,2" Content="..." Tag="{Binding .}" Click="btnMoreClick"/>
</StackPanel>
<Button Margin="4" Padding="5,2" Content="..." Tag="{Binding .}" Click="btnMoreClick"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<Button Content="配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnSetupClick"></Button>
<Button Content="称重配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnSetupClick"></Button>
<Button x:Name="btnFeederSetup" Content="吸料配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnFeederSetupClick"></Button>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Header="吸料" Grid.Column="1">
<GroupBox x:Name="grpFeeder" Header="吸料" Grid.Column="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<ItemsControl x:Name="itemcontrol_feeder" ItemsSource="{Binding PLCs}">
<ItemsControl x:Name="itemcontrol_feeder" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
......@@ -128,9 +129,10 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Button Grid.Row="1" Content="配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnFeederSetupClick"></Button>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<Button Grid.Row="1" Content="吸料配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnFeederSetupClick"></Button>
</StackPanel>
</Grid>
</GroupBox>
</Grid>
......
......@@ -30,16 +30,19 @@ namespace FLY.Weight.UI.Server
public void Init(TDGage gage)
{
this.gage = gage;
var plsos = gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem;
//grid_plcos.DataContext = plsos;
//grid_plc.DataContext = plsos.PLCs[0];
grid_WeightSystem.DataContext = gage.mData;
this.itemcontrol.ItemsSource = plsos.PLCs;
sp_sysParam.DataContext = gage.mSysParam;
itemcontrol_weighter.ItemsSource = gage.mData.plcos.PLCs;
if (gage.mFeederSystem != null) {
if (gage.mFeederSystem != null)
{
btnFeederSetup.Visibility = Visibility.Collapsed;
this.itemcontrol_feeder.ItemsSource = gage.mFeederSystem.plcos.PLCs;
}
else {
grpFeeder.Visibility = Visibility.Collapsed;
}
}
private void btnSetupClick(object sender, RoutedEventArgs e)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment