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>
......
This diff is collapsed.
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