Commit b05d8a70 authored by 潘栩锋's avatar 潘栩锋 🚴

修复 解决没有向称重单组分发送线速度

修复 IBC 自动状态写反了
修复 称重单组分 参数页面没更新
parent 0073273f
...@@ -71,6 +71,10 @@ ...@@ -71,6 +71,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="UiModule\MainPanel2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\MenuSetting.xaml"> <Page Include="UiModule\MenuSetting.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -112,6 +116,9 @@ ...@@ -112,6 +116,9 @@
<Compile Include="UiModule\IbcCtrlGraph.xaml.cs"> <Compile Include="UiModule\IbcCtrlGraph.xaml.cs">
<DependentUpon>IbcCtrlGraph.xaml</DependentUpon> <DependentUpon>IbcCtrlGraph.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UiModule\MainPanel2.xaml.cs">
<DependentUpon>MainPanel2.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\MenuSetting.xaml.cs"> <Compile Include="UiModule\MenuSetting.xaml.cs">
<DependentUpon>MenuSetting.xaml</DependentUpon> <DependentUpon>MenuSetting.xaml</DependentUpon>
</Compile> </Compile>
......
<UserControl x:Class="FLY.IBC.UI.Client.UiModule.MainPanel2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.IBC.UI.Client.UiModule"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:flyctrl="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.IBC.UI.Client;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.IBC.UI.Client;component/UnitTests/UnitTests_ibc.xaml"/>
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="Color_theme_minus" Color="#FFEE5610"/>
<SolidColorBrush x:Key="Color_theme_plus" Color="#FF008BE5"/>
<SolidColorBrush x:Key="Color_button1_b" Color="#FF008BE5"/>
<SolidColorBrush x:Key="Color_button2_b" Color="#FF919191"/>
<SolidColorBrush x:Key="Color_button_f" Color="#FFf1f1f1"/>
<sys:Double x:Key="FontSize_title">15</sys:Double>
<sys:Double x:Key="FontSize_unit">12</sys:Double>
<Style TargetType="{x:Type ToggleButton}" x:Key="ToggleButtonStyle02" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Canvas x:Name="canvas" Height="45" Width="106" Background="{StaticResource Color_button1_b}">
<Rectangle x:Name="Path_block" Height="36" Width="24" Margin="5" Fill="{StaticResource Color_button_f}" Canvas.Right="0" />
<StackPanel x:Name="SP_Text" Orientation="Horizontal" Margin="5,5">
<Grid VerticalAlignment="Bottom" Margin="5">
<TextBlock x:Name="TB_On" Text="{Binding Tag.IsCheckText,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ToggleButton}}}" Foreground="{StaticResource Color_button_f}" FontSize="24" FontFamily="YouYuan"/>
<TextBlock x:Name="TB_Off" Text="{Binding Tag.NoCheckText,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ToggleButton}}}" Visibility="Hidden" Foreground="{StaticResource Color_button_f}" FontSize="24" FontFamily="YouYuan"/>
</Grid>
</StackPanel>
</Canvas>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="False">
<Setter TargetName="TB_On" Property="Visibility" Value="Hidden"/>
<Setter TargetName="TB_Off" Property="Visibility" Value="Visible"/>
<Setter TargetName="Path_block" Property="Canvas.Left" Value="0"/>
<Setter TargetName="SP_Text" Property="Canvas.Right" Value="0"/>
<Setter TargetName="canvas" Property="Background" Value="{StaticResource Color_button2_b}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<local:ToggleButtonText x:Key="tbt_inletAir" IsCheckText="运行" NoCheckText="停止"/>
<local:ToggleButtonText x:Key="tbt_outletAir" IsCheckText="运行" NoCheckText="停止"/>
<local:ToggleButtonText x:Key="tbt_IBC" IsCheckText="自动" NoCheckText="手动"/>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid x:Name="grid_ibc" d:DataContext="{StaticResource unitests_ibc}"/>
<local:IbcCtrlGraph x:Name="ibcCtrlGraph" Grid.Row="1" MinHeight="400"/>
<Border Margin="5" CornerRadius="5" Background="{StaticResource Color_theme_background}" DataContext="{Binding DataContext,ElementName=grid_ibc}">
<Viewbox MaxHeight="300" HorizontalAlignment="Left" VerticalAlignment="Top">
<StackPanel Orientation="Horizontal">
<Grid Margin="30,10">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.ColumnSpan="2" Orientation="Vertical">
<TextBlock Grid.Row="0" Grid.Column="0" Text="显示" FontSize="{StaticResource FontSize_title}" Margin="3,0" Foreground="{StaticResource Color_theme_static}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding InletAirFreq,StringFormat={}{0:F1}}" Style="{StaticResource TextBlockStyle_FieldContent}" FontSize="26" />
<TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}" FontSize="{StaticResource FontSize_unit}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="2" Background="#FF636363">
<StackPanel Orientation="Horizontal" Margin="7,3">
<TextBlock Text="进风" FontSize="35" Foreground="White"/>
<TextBlock Text="风机" FontSize="15" Foreground="White"/>
</StackPanel>
</StackPanel>
<Grid Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding InletAirFreqSet,StringFormat={}{0:F1}}" Style="{StaticResource TextBoxStyle_FieldContent}" Foreground="{StaticResource Color_theme_text_activity}" VerticalAlignment="Bottom" FontSize="48"/>
<TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}"/>
</StackPanel>
<Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource Color_theme_minus}"
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-30,-30,0" Click="button_inletAir_minus_Click" >
<Grid>
<Ellipse Fill="White" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="MinusCircle" />
</Grid>
</Button>
</Grid>
<Button Style="{StaticResource ButtonStyle_largeIcon}" Click="button_inletAir_plus_Click" Margin="-10,0,0,-80" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top" Height="50" Width="50">
<Grid>
<Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="PlusCircle"/>
</Grid>
</Button>
<flyctrl:ToggleButtonOnOff OnLabel="运行" OffLabel="停止"
Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Right" Margin="{StaticResource ControlMargin}"
IsChecked="{Binding IsInletAirOn}"/>
</Grid>
<Grid Margin="30,10">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.ColumnSpan="2" Orientation="Vertical">
<TextBlock Grid.Row="0" Grid.Column="0" Text="显示" FontSize="{StaticResource FontSize_title}" Margin="3,0" Foreground="{StaticResource Color_theme_static}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding OutletAirFreq,StringFormat={}{0:F1}}" Style="{StaticResource TextBlockStyle_FieldContent}" FontSize="26" />
<TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}" FontSize="{StaticResource FontSize_unit}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="2" Background="#FF636363">
<StackPanel Orientation="Horizontal" Margin="7,3">
<TextBlock Text="出风" FontSize="35" Foreground="White"/>
<TextBlock Text="风机" FontSize="15" Foreground="White"/>
</StackPanel>
</StackPanel>
<Grid Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding OutletAirFreqSet,StringFormat={}{0:F1}}" Style="{StaticResource TextBoxStyle_FieldContent}" Foreground="{StaticResource Color_theme_text_activity}" VerticalAlignment="Bottom" FontSize="48"/>
<TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}" />
</StackPanel>
<Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource Color_theme_minus}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-30,-30,0" Click="button_outletAir_minus_Click" >
<Grid>
<Ellipse Fill="White" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="MinusCircle" />
</Grid>
</Button>
</Grid>
<Button Style="{StaticResource ButtonStyle_largeIcon}" Click="button_outletAir_plus_Click" Margin="-10,0,0,-80" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top">
<Grid>
<Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="PlusCircle"/>
</Grid>
</Button>
<flyctrl:ToggleButtonOnOff OnLabel="运行" OffLabel="停止"
Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Right" Margin="{StaticResource ControlMargin}"
IsChecked="{Binding IsOutletAirOn}"/>
</Grid>
<Grid Margin="30,10">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.ColumnSpan="2" Orientation="Vertical">
<TextBlock Grid.Row="0" Grid.Column="0" Text="显示" FontSize="{StaticResource FontSize_title}" Margin="3,0" Foreground="{StaticResource Color_theme_static}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding DownOutletAirFreq,StringFormat={}{0:F1}}" Style="{StaticResource TextBlockStyle_FieldContent}" FontSize="26" />
<TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}" FontSize="{StaticResource FontSize_unit}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="2" Background="#FF636363">
<StackPanel Orientation="Horizontal" Margin="7,3">
<TextBlock Text="外风" FontSize="35" Foreground="White"/>
<TextBlock Text="风机" FontSize="15" Foreground="White"/>
</StackPanel>
</StackPanel>
<Grid Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding DownOutletAirFreqSet,StringFormat={}{0:F1}}" Style="{StaticResource TextBoxStyle_FieldContent}" Foreground="{StaticResource Color_theme_text_activity}" VerticalAlignment="Bottom" FontSize="48"/>
<TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}" />
</StackPanel>
<Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource Color_theme_minus}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-30,-30,0" Click="button_downOutletAir_minus_Click" >
<Grid>
<Ellipse Fill="White" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="MinusCircle" />
</Grid>
</Button>
</Grid>
<Button Style="{StaticResource ButtonStyle_largeIcon}" Click="button_downOutletAir_plus_Click" Margin="-10,0,0,-80" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top">
<Grid>
<Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="PlusCircle"/>
</Grid>
</Button>
<flyctrl:ToggleButtonOnOff OnLabel="运行" OffLabel="停止"
Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Right" Margin="{StaticResource ControlMargin}"
IsChecked="{Binding IsDownOutletAirOn}"/>
</Grid>
<Grid Margin="30,10">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<TextBlock Text="折径显示" FontSize="{StaticResource FontSize_title}" Margin="3,0" Foreground="{StaticResource Color_theme_static}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding FilmWidth,StringFormat={}{0:F0}}" Style="{StaticResource TextBlockStyle_FieldContent}" FontSize="26" />
<TextBlock Text="mm" Style="{StaticResource TextBlockStyle_FieldContent_mm}" FontSize="{StaticResource FontSize_unit}" />
</StackPanel>
</StackPanel>
<TextBlock Text="IBC" Grid.Column="1" FontSize="35" Margin="3" Padding="20,0" Background="#FF636363" Foreground="White"/>
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.ColumnSpan="2">
<StackPanel Orientation="Vertical">
<TextBlock Grid.Row="0" Grid.Column="0" Text="折径设置" FontSize="{StaticResource FontSize_title}" Margin="3,0" Foreground="{StaticResource Color_theme_activity}"/>
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding FilmWidthSet,StringFormat={}{0:F0}}" Style="{StaticResource TextBoxStyle_FieldContent}" Foreground="{StaticResource Color_theme_text_activity}" VerticalAlignment="Bottom"/>
<TextBlock Text="mm" Style="{StaticResource TextBlockStyle_FieldContent_mm}" FontSize="{StaticResource FontSize_unit}"/>
</StackPanel>
</StackPanel>
<TextBlock Text="|" Style="{StaticResource TextBlockStyle_FieldContent_mm_interval}" Foreground="{StaticResource Color_theme_minus}"/>
<StackPanel Orientation="Vertical">
<TextBlock Grid.Row="0" Grid.Column="0" Text="误差校正" FontSize="{StaticResource FontSize_title}" Margin="3,0" Foreground="{StaticResource Color_theme_minus}"/>
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding ErrorCorrection,StringFormat={}{0:F0}}" Style="{StaticResource TextBoxStyle_FieldContent}" Foreground="DarkRed" VerticalAlignment="Bottom" FontSize="26"/>
<TextBlock Text="mm" Style="{StaticResource TextBlockStyle_FieldContent_mm}" FontSize="{StaticResource FontSize_unit}" />
</StackPanel>
</StackPanel>
</StackPanel>
<Grid Grid.Row="2" Grid.ColumnSpan="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Button Style="{StaticResource ButtonStyle_empty}" Background="Transparent" Click="button_k123_Click" Margin="-20,5,20,5" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid Style="{StaticResource GridStyle_ButtonShadow}">
<Border CornerRadius="5" Background="{StaticResource Color_theme_plus}">
<Path Margin="10" Width="60" Height="50" Stretch="Fill" Stroke="White" StrokeThickness="3" Data="M150,200 L0,300 M150,200 L300,300 M150,200 L150,0 M150,0 0,300 300,300 Z" />
</Border>
<TextBlock Text="膜泡校正" Foreground="White" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Center" Background="{StaticResource Color_theme_activity}" Margin="0,0,0,-10" FontSize="{StaticResource FontSize_title}"/>
</Grid>
</Button>
<flyctrl:ToggleButtonOnOff OnLabel="自动" OffLabel="手动"
Grid.Column="1" HorizontalAlignment="Right" Margin="{StaticResource ControlMargin}"
IsChecked="{Binding IsIBCAuto}"/>
</Grid>
</Grid>
</StackPanel>
</Viewbox>
</Border>
</Grid>
</UserControl>
using FLY.IBC.Client;
using FLY.IBC.IService;
using FObjBase;
using MultiLayout.UiModule;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using Unity;
namespace FLY.IBC.UI.Client.UiModule
{
/// <summary>
/// Page_Main.xaml 的交互逻辑
/// </summary>
public partial class MainPanel2 : UserControl
{
IUnityContainer container;
IIbcSystemService ibcSystemService;
FLY.OBJComponents.Client.SetPLCUpdatePlan setPlan;
public MainPanel2()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(
IUnityContainer container,
IIbcSystemService ibcSystemService)
{
this.container = container;
this.ibcSystemService = ibcSystemService;
grid_ibc.DataContext = ibcSystemService.Item;
setPlan = new FLY.OBJComponents.Client.SetPLCUpdatePlan(
ibcSystemService.PLCos,
ibcSystemService.Item,
new string[] {
"IsIBCAuto",
"FilmWidth",
"FilmWidthSet",
"IsFilmWidthChanged",
"ErrorCorrection",
"IsInletAirOn",
"InletAirFreq",
"InletAirFreqSet",
"IsOutletAirOn",
"OutletAirFreq",
"OutletAirFreqSet",
"IsOutletAirFreqChanged",
"IsDownOutletAirOn",
"DownOutletAirFreq",
"DownOutletAirFreqSet",
});
container.BuildUp(ibcCtrlGraph);
ibcSystemService.Item.PropertyChanged += Item_PropertyChanged;
}
private async void Item_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if((ibcSystemService is IbcSystemServiceClient) && ((ibcSystemService as IbcSystemServiceClient).IsInPushValue))
return;
if (e.PropertyName == "FilmWidthSet")
{
await Task.Delay(1000);//1s后触发通知
ibcSystemService.Item.IsFilmWidthChanged = true;
}
else if (e.PropertyName == "OutletAirFreqSet")
{
await Task.Delay(1000);//1s后触发通知
ibcSystemService.Item.IsOutletAirFreqChanged = true;
}
}
private void button_inletAir_plus_Click(object sender, RoutedEventArgs e)
{
if (ibcSystemService.Item.InletAirFreqSet < 49.9)
ibcSystemService.Item.InletAirFreqSet += 0.1f;
}
private void button_inletAir_minus_Click(object sender, RoutedEventArgs e)
{
if(ibcSystemService.Item.InletAirFreqSet>0.1)
ibcSystemService.Item.InletAirFreqSet -= 0.1f;
}
private void button_outletAir_plus_Click(object sender, RoutedEventArgs e)
{
if (ibcSystemService.Item.OutletAirFreqSet < 49.9)
ibcSystemService.Item.OutletAirFreqSet += 0.1f;
}
private void button_outletAir_minus_Click(object sender, RoutedEventArgs e)
{
if(ibcSystemService.Item.OutletAirFreqSet>0.1)
ibcSystemService.Item.OutletAirFreqSet -= 0.1f;
}
private void button_k123_Click(object sender, RoutedEventArgs e)
{
WdK123 w = new WdK123();
container.BuildUp(w);
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
}
private void button_downOutletAir_plus_Click(object sender, RoutedEventArgs e)
{
if (ibcSystemService.Item.DownOutletAirFreqSet < 49.9)
ibcSystemService.Item.DownOutletAirFreqSet += 0.1f;
}
private void button_downOutletAir_minus_Click(object sender, RoutedEventArgs e)
{
if (ibcSystemService.Item.DownOutletAirFreqSet > 0.1)
ibcSystemService.Item.DownOutletAirFreqSet -= 0.1f;
}
}
public class UiModule2_MainPanel2 : IUiModule2
{
/// <summary>
/// 控件标题
/// 它的值取决于culture
/// </summary>
public string Title=>"IBC主界面(下吹)";
public ComponentType Type => ComponentType.Graph;
public bool IsUnique => true;
/// <summary>
/// 控件
/// 创建时,需要给它唯一ID,让加载自己的数据
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public FrameworkElement GetComponent(int id, IUnityContainer container)
{
MainPanel2 graph = new MainPanel2();
container.BuildUp(graph);
return graph;
}
/// <summary>
/// 控件缩略图,用于编辑界面时,大致看看
/// 创建时,需要给它唯一ID,让加载自己的数据
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public FrameworkElement GetThumbnail()
{
return new System.Windows.Controls.Grid();
}
/// <summary>
/// 给出全部控件ID, 控件自行删除没有的参数
/// </summary>
/// <param name="IDs"></param>
public void MatchParam(int[] IDs)
{
}
}
}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.IBC.UI.Client.UiModule" xmlns:local="clr-namespace:FLY.IBC.UI.Client.UiModule"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:flyctrl="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
...@@ -105,21 +105,23 @@ ...@@ -105,21 +105,23 @@
<TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}"/> <TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}"/>
</StackPanel> </StackPanel>
<Button HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-30,-30,0" Style="{StaticResource ButtonStyle_empty}" Background="Transparent" Click="button_inletAir_minus_Click" > <Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource Color_theme_minus}"
<Grid Style="{StaticResource GridStyle_ButtonShadow}"> HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-30,-30,0" Click="button_inletAir_minus_Click" >
<Grid>
<Ellipse Fill="White" Stretch="Fill"/> <Ellipse Fill="White" Stretch="Fill" Margin="1"/>
<Path Data="{StaticResource Geometry_minus-circle}" Fill="{StaticResource Color_theme_minus}" Stretch="Fill" Height="50" Width="50" /> <iconPacks:PackIconMaterial Kind="MinusCircle" />
</Grid> </Grid>
</Button> </Button>
</Grid> </Grid>
<Button Style="{StaticResource ButtonStyle_empty}" Click="button_inletAir_plus_Click" Margin="-10,0,0,-80" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top"> <Button Style="{StaticResource ButtonStyle_largeIcon}" Click="button_inletAir_plus_Click" Margin="-10,0,0,-80" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top" Height="50" Width="50">
<Grid Style="{StaticResource GridStyle_ButtonShadow}"> <Grid>
<Ellipse Fill="White" Stretch="Fill"/> <Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<Path Data="{StaticResource Geometry_plus-circle}" Fill="{StaticResource Color_theme_plus}" Stretch="Fill" Height="50" Width="50" /> <iconPacks:PackIconMaterial Kind="PlusCircle"/>
</Grid> </Grid>
</Button> </Button>
<ToggleButton Style="{StaticResource ToggleButtonStyle02}" Tag="{StaticResource tbt_inletAir}" Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Right" Margin="5" IsChecked="{Binding IsInletAirOn}"/> <flyctrl:ToggleButtonOnOff OnLabel="运行" OffLabel="停止"
Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Right" Margin="{StaticResource ControlMargin}"
IsChecked="{Binding IsInletAirOn}"/>
</Grid> </Grid>
<Grid Margin="30,10"> <Grid Margin="30,10">
<Grid.RowDefinitions> <Grid.RowDefinitions>
...@@ -161,20 +163,22 @@ ...@@ -161,20 +163,22 @@
<TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}" /> <TextBlock Text="Hz" Style="{StaticResource TextBlockStyle_FieldContent_mm}" />
</StackPanel> </StackPanel>
<Button HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-30,-30,0" Style="{StaticResource ButtonStyle_empty}" Background="Transparent" Click="button_outletAir_minus_Click" > <Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource Color_theme_minus}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-30,-30,0" Click="button_outletAir_minus_Click" >
<Grid Style="{StaticResource GridStyle_ButtonShadow}"> <Grid>
<Ellipse Fill="White" Stretch="Fill"/> <Ellipse Fill="White" Stretch="Fill" Margin="1"/>
<Path Data="{StaticResource Geometry_minus-circle}" Fill="{StaticResource Color_theme_minus}" Stretch="Fill" Height="50" Width="50" /> <iconPacks:PackIconMaterial Kind="MinusCircle" />
</Grid> </Grid>
</Button> </Button>
</Grid> </Grid>
<Button Style="{StaticResource ButtonStyle_empty}" Background="Transparent" Click="button_outletAir_plus_Click" Margin="-10,0,0,-80" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top"> <Button Style="{StaticResource ButtonStyle_largeIcon}" Click="button_outletAir_plus_Click" Margin="-10,0,0,-80" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top">
<Grid Style="{StaticResource GridStyle_ButtonShadow}"> <Grid>
<Ellipse Fill="White" Stretch="Fill"/> <Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<Path Data="{StaticResource Geometry_plus-circle}" Fill="{StaticResource Color_theme_plus}" Stretch="Fill" Height="50" Width="50" /> <iconPacks:PackIconMaterial Kind="PlusCircle"/>
</Grid> </Grid>
</Button> </Button>
<ToggleButton Style="{StaticResource ToggleButtonStyle02}" Tag="{StaticResource tbt_outletAir}" Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Right" Margin="5" IsChecked="{Binding IsOutletAirOn}"/> <flyctrl:ToggleButtonOnOff OnLabel="运行" OffLabel="停止"
Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Right" Margin="{StaticResource ControlMargin}"
IsChecked="{Binding IsOutletAirOn}"/>
</Grid> </Grid>
<Grid Margin="30,10"> <Grid Margin="30,10">
<Grid.RowDefinitions> <Grid.RowDefinitions>
...@@ -229,7 +233,9 @@ ...@@ -229,7 +233,9 @@
<TextBlock Text="膜泡校正" Foreground="White" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Center" Background="{StaticResource Color_theme_activity}" Margin="0,0,0,-10" FontSize="{StaticResource FontSize_title}"/> <TextBlock Text="膜泡校正" Foreground="White" FontWeight="Bold" VerticalAlignment="Bottom" HorizontalAlignment="Center" Background="{StaticResource Color_theme_activity}" Margin="0,0,0,-10" FontSize="{StaticResource FontSize_title}"/>
</Grid> </Grid>
</Button> </Button>
<ToggleButton Grid.Column="1" Style="{StaticResource ToggleButtonStyle02}" Tag="{StaticResource tbt_IBC}" Margin="5" IsChecked="{Binding IsIBCAuto}"/> <flyctrl:ToggleButtonOnOff OnLabel="自动" OffLabel="手动"
Grid.Column="1" HorizontalAlignment="Right" Margin="{StaticResource ControlMargin}"
IsChecked="{Binding IsIBCAuto}"/>
</Grid> </Grid>
</Grid> </Grid>
......
...@@ -60,7 +60,11 @@ namespace FLY.IBC.UI.Client.UiModule ...@@ -60,7 +60,11 @@ namespace FLY.IBC.UI.Client.UiModule
"IsOutletAirOn", "IsOutletAirOn",
"OutletAirFreq", "OutletAirFreq",
"OutletAirFreqSet", "OutletAirFreqSet",
"IsOutletAirFreqChanged" "IsOutletAirFreqChanged",
"IsDownOutletAirOn",
"DownOutletAirFreq",
"DownOutletAirFreqSet",
}); });
container.BuildUp(ibcCtrlGraph); container.BuildUp(ibcCtrlGraph);
......
...@@ -92,6 +92,24 @@ namespace FLY.IBC.Common ...@@ -92,6 +92,24 @@ namespace FLY.IBC.Common
[Description("IBC自动")] [Description("IBC自动")]
public bool IsIBCAuto{ get; set; } public bool IsIBCAuto{ get; set; }
/// <summary>
/// 下吹出风指示
/// </summary>
[Description("下吹出风指示")]
public bool IsDownOutletAirOn{ get; set; }
/// <summary>
/// 下吹出风运行频率(Hz)
/// </summary>
[Description("下吹出风运行频率(Hz)")]
public float DownOutletAirFreq{ get; set; }
/// <summary>
/// 下吹出风设定频率(Hz)
/// </summary>
[Description("下吹出风设定频率(Hz)")]
public float DownOutletAirFreqSet{ get; set; }
/// <summary> /// <summary>
/// K1 /// K1
/// </summary> /// </summary>
......
...@@ -70,24 +70,33 @@ namespace FLY.Weight2.UI.Client ...@@ -70,24 +70,33 @@ namespace FLY.Weight2.UI.Client
weightSystemService.PLCos, weightSystemService.PLCos,
weightSystemService.Items[i], weightSystemService.Items[i],
new string[] { new string[] {
"FlowDisp",
"FlowSetting", "MaxFreq",
"FilterParam", "StableTime",
"SwitchLv",
"UpDownGain",
"PGain",
"ITime",
"AdjustFactor",
"AdjustUpper",
"AdjustLower",
"StableLvSwitch",
"PIDLimit",
"SampleTime", "SampleTime",
"ChargeTime",
"FastStandard",
"BinUpperLimit",
"BinLowerLimit",
"ScrewLowerLimit",
"StableLv",
"AdjustLv",
"HighFactor",
"LowFactor",
"AdjustLimit",
"Pc",
"It",
"Dg",
"Dt",
"Filter",
"FastFreq",
"FastTime",
"Cal",
"Tolerance",
"PIDResult", "PIDResult",
"PIDAdjust", "PIDAdjust"
"ScrewCurrentSpeed",
"ScrewMotorFreq",
"PGainDisp"
})); }));
} }
} }
......
...@@ -105,6 +105,12 @@ namespace FLY.Weight2.Common ...@@ -105,6 +105,12 @@ namespace FLY.Weight2.Common
[Description("当前线速度m/min")] [Description("当前线速度m/min")]
public float CurrentVelocity{ get; set; } public float CurrentVelocity{ get; set; }
/// <summary>
/// 当前线速度设置m/min
/// </summary>
[Description("当前线速度设置m/min")]
public float CurrentVelocitySet { get; set; }
/// <summary> /// <summary>
/// 产品宽度(mm) xxx /// 产品宽度(mm) xxx
/// </summary> /// </summary>
......
...@@ -61,6 +61,10 @@ ...@@ -61,6 +61,10 @@
<Compile Include="Server\WeightSystem.cs" /> <Compile Include="Server\WeightSystem.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Project.FLY.Thick.Blowing\FLY.Thick.Blowing\FLY.Thick.Blowing.csproj">
<Project>{cc20abeb-59f6-492b-a963-51121eb5ae66}</Project>
<Name>FLY.Thick.Blowing</Name>
</ProjectReference>
<ProjectReference Include="..\..\thick_public\Project.FLY.FObjSys\FObjSys\FObjBase.csproj"> <ProjectReference Include="..\..\thick_public\Project.FLY.FObjSys\FObjSys\FObjBase.csproj">
<Project>{abfe87d4-b692-4ae9-a8c0-1f470b8acbb8}</Project> <Project>{abfe87d4-b692-4ae9-a8c0-1f470b8acbb8}</Project>
<Name>FObjBase</Name> <Name>FObjBase</Name>
......
...@@ -14,6 +14,12 @@ namespace FLY.Weight2.Server ...@@ -14,6 +14,12 @@ namespace FLY.Weight2.Server
/// </summary> /// </summary>
public int OBJ_Port { get; set; } = 20005; public int OBJ_Port { get; set; } = 20005;
/// <summary>
/// 远程服务器
/// </summary>
public string BlowingAddr { get; set; } = "127.0.0.1:20006";
/// <summary> /// <summary>
/// 数据库保持时间 默认6个月 /// 数据库保持时间 默认6个月
/// </summary> /// </summary>
......
...@@ -30,6 +30,13 @@ namespace FLY.Weight2.Server ...@@ -30,6 +30,13 @@ namespace FLY.Weight2.Server
DbModel mDbModel; DbModel mDbModel;
#endregion #endregion
#region 服务器数据--------------------------------------------------------------
/// <summary>
/// 吹膜测厚仪, 旋转架模型
/// </summary>
FLY.Thick.Blowing.Client.BlowingDetectServiceClient mBDetect;
#endregion
public TDGage(string nam) public TDGage(string nam)
{ {
...@@ -68,6 +75,39 @@ namespace FLY.Weight2.Server ...@@ -68,6 +75,39 @@ namespace FLY.Weight2.Server
mData.Init(mHistoryDb, mWarning); mData.Init(mHistoryDb, mWarning);
#region 与服务器同步的数据
mBDetect = new Thick.Blowing.Client.BlowingDetectServiceClient(FLY.Thick.Blowing.OBJ_INTERFACE.OBJ_INTERFACE_ID.BDETECT_ID);
#endregion
Init2();
mBDetect.PropertyChanged += MBDetect_PropertyChanged;
}
private void MBDetect_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "FilmVelocity")
{
mData.Accessory.CurrentVelocitySet = (((int)(mBDetect.FilmVelocity * 10)) / 10.0f);
}
}
/// <summary>
/// 第2步, 连接到服务器,初始化参数 。由界面的 【登陆】 按钮触发
/// </summary>
private void Init2()
{
#region 网络初始化
//FObjSys.Current.Start_Conn_Server(new IPEndPoint(IPAddress.Any, mSysParam.OBJ_Port), mServerOBJProxy.ID);
var addr = Misc.StringConverter.ToIPEndPoint(mSysParam.BlowingAddr);
FObjSys.Current.Connect_to_Another_OBJSys(
addr,
mBDetect.ID
);
#endregion
} }
} }
......
...@@ -1202,6 +1202,15 @@ ...@@ -1202,6 +1202,15 @@
"OwnerName": "Accessory", "OwnerName": "Accessory",
"PropertyName": "CurrentVelocity" "PropertyName": "CurrentVelocity"
}, },
{
"DeviceIndex": 0,
"Mode": "4",
"Addr": 13988,
"Type": "UInt16",
"Scale": 0.1,
"OwnerName": "Accessory",
"PropertyName": "CurrentVelocitySet"
},
{ {
"DeviceIndex": 0, "DeviceIndex": 0,
"Mode": "4", "Mode": "4",
......
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