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

IBC, 称重 参数设置界面添加密码, 都添加 Desp 的 attribute, 用于 PLC写入记录

parent 9eecefea
......@@ -200,6 +200,10 @@
<Project>{a539505d-9ac0-426b-a9a0-197df50598b0}</Project>
<Name>OBJComponents</Name>
</ProjectReference>
<ProjectReference Include="..\..\thick_public\Project.FLY.Thick.Base\FLY.Thick.Base.UI\FLY.Thick.Base.UI.csproj">
<Project>{ec84265e-4196-4834-8ac0-81956777c5e9}</Project>
<Name>FLY.Thick.Base.UI</Name>
</ProjectReference>
<ProjectReference Include="..\..\thick_public\Project.FLY.UI.Module\FLY.UI.Module\FLY.UI.Module.csproj">
<Project>{4df79671-e814-49bd-864d-8257d6c6e072}</Project>
<Name>FLY.UI.Module</Name>
......
......@@ -32,8 +32,11 @@ namespace FLY.IBC.UI.Client
private void button_system_Click(object sender, RoutedEventArgs e)
{
Page_System p = new Page_System();
NavigationService.Navigate(p);
if (ThickTcpUiInWindow.Window_Password.Authorize(1))
{
Page_System p = new Page_System();
NavigationService.Navigate(p);
}
}
private void button_error_Click(object sender, RoutedEventArgs e)
......
......@@ -329,6 +329,10 @@
<Project>{a539505d-9ac0-426b-a9a0-197df50598b0}</Project>
<Name>OBJComponents</Name>
</ProjectReference>
<ProjectReference Include="..\..\thick_public\Project.FLY.Thick.Base\FLY.Thick.Base.UI\FLY.Thick.Base.UI.csproj">
<Project>{ec84265e-4196-4834-8ac0-81956777c5e9}</Project>
<Name>FLY.Thick.Base.UI</Name>
</ProjectReference>
<ProjectReference Include="..\..\thick_public\Project.FLY.Thick.Base\FLY.Thick.Base\FLY.Thick.Base.csproj">
<Project>{91a1aafe-a528-4c2e-a48a-9259e780255a}</Project>
<Name>FLY.Thick.Base</Name>
......
......@@ -35,22 +35,31 @@ namespace FLY.Weight.UI.Client
private void button_ingredient_Click(object sender, RoutedEventArgs e)
{
Page_Ingredient p = new Page_Ingredient();
if (ThickTcpUiInWindow.Window_Password.Authorize(1))
{
Page_Ingredient p = new Page_Ingredient();
NavigationService.Navigate(p);
NavigationService.Navigate(p);
}
}
private void button_screw_Click(object sender, RoutedEventArgs e)
{
Page_Screw p = new Page_Screw();
if (ThickTcpUiInWindow.Window_Password.Authorize(1))
{
Page_Screw p = new Page_Screw();
NavigationService.Navigate(p);
NavigationService.Navigate(p);
}
}
private void button_hopper_Click(object sender, RoutedEventArgs e)
{
Page_Hopper p = new Page_Hopper();
NavigationService.Navigate(p);
if (ThickTcpUiInWindow.Window_Password.Authorize(1))
{
Page_Hopper p = new Page_Hopper();
NavigationService.Navigate(p);
}
}
private void button_error_Click(object sender, RoutedEventArgs e)
......@@ -61,8 +70,11 @@ namespace FLY.Weight.UI.Client
private void button_thickness_Click(object sender, RoutedEventArgs e)
{
Page_Thickness p = new Page_Thickness();
NavigationService.Navigate(p);
if (ThickTcpUiInWindow.Window_Password.Authorize(1))
{
Page_Thickness p = new Page_Thickness();
NavigationService.Navigate(p);
}
}
private void button_rollmixtable_Click(object sender, RoutedEventArgs e)
......
......@@ -34,6 +34,9 @@
<target xsi:type="File" name="f_error" fileName="${basedir}/logs/error/${shortdate}.log"
layout="${longdate} ${logger} ${uppercase:${level}} ${message} ${onexception:inner=${newline} *****Error***** ${newline} ${exception:format=ToString}}"
archiveAboveSize="1048576" encoding="utf-8"/>
<target xsi:type="File" name="plcWrite" fileName="${basedir}/logs/plcWrite/${shortdate}.log"
layout="${longdate} ${message}"
archiveAboveSize="1048576" encoding="utf-8"/>
</targets>
<rules>
......@@ -45,6 +48,7 @@
-->
<!--<logger name="FObjSysOfClient" minlevel="Debug" writeTo="f_debug" />-->
<!--name 可以用匹配-->
<logger name="FLY.OBJComponents.Server.PLCProxySystem" minlevel="Info" writeTo="plcWrite" />
<logger name="*" minlevel="Error" writeTo="f_error" />
</rules>
</nlog>
......
......@@ -8,115 +8,20 @@ namespace FLY.Weight.Common
{
public static class ERRNOs
{
public static byte TYPE = 10;
static ERRNOs()
{
ERRNO_PLC_DISCONNECTED = new ERRNO() { Code = 255, Descrption = "称重 PLC连接断开" };
WEIGHT_ERRNO_LACK1 = new ERRNO() { Code = 0, Descrption = "No.1料仓缺料报警" };
WEIGHT_ERRNO_LACK2 = new ERRNO() { Code = 1, Descrption = "No.2料仓缺料报警" };
WEIGHT_ERRNO_LACK3 = new ERRNO() { Code = 2, Descrption = "No.3料仓缺料报警" };
WEIGHT_ERRNO_LACK4 = new ERRNO() { Code = 3, Descrption = "No.4料仓缺料报警" };
WEIGHT_ERRNO_LACK5 = new ERRNO() { Code = 4, Descrption = "No.5料仓缺料报警" };
WEIGHT_ERRNO_LACK6 = new ERRNO() { Code = 5, Descrption = "No.6料仓缺料报警" };
WEIGHT_ERRNO_ADD1 = new ERRNO() { Code = 10, Descrption = "No.1料斗加料异常" };
WEIGHT_ERRNO_ADD2 = new ERRNO() { Code = 11, Descrption = "No.2料斗加料异常" };
WEIGHT_ERRNO_ADD3 = new ERRNO() { Code = 12, Descrption = "No.3料斗加料异常" };
WEIGHT_ERRNO_ADD4 = new ERRNO() { Code = 13, Descrption = "No.4料斗加料异常" };
WEIGHT_ERRNO_ADD5 = new ERRNO() { Code = 14, Descrption = "No.5料斗加料异常" };
WEIGHT_ERRNO_ADD6 = new ERRNO() { Code = 15, Descrption = "No.6料斗加料异常" };
WEIGHT_ERRNO_SCREWLACK = new ERRNO() { Code = 20, Descrption = "螺杆缺料报警" };
WEIGHT_ERRNO_SCREWFLOW = new ERRNO() { Code = 21, Descrption = "螺杆流量超偏差报警" };
WEIGHT_ERRNO_BLENDER = new ERRNO() { Code = 22, Descrption = "搅拌电机故障" };
WEIGHT_ERRNO_SCRAM = new ERRNO() { Code = 23, Descrption = "急停开启" };
WEIGHT_ERRNO_BLENDER2 = new ERRNO() { Code = 24, Descrption = "搅拌电机急停开启" };
WEIGHT_ERRNO_BLENDER3 = new ERRNO() { Code = 25, Descrption = "搅拌电机未启动" };
ERRNO_PLC_REG = new ERRNO() { Code = 0, Descrption = "通过 PLC寄存器 触发的报警信息" };
}
/// <summary>
/// PLC连接断开
/// </summary>
public static ERRNO ERRNO_PLC_DISCONNECTED;
#region 单层报警类型
/// <summary>
/// No.1料仓缺料报警
/// </summary>
public static ERRNO WEIGHT_ERRNO_LACK1;
/// <summary>
/// No.2料仓缺料报警
/// </summary>
public static ERRNO WEIGHT_ERRNO_LACK2;
/// <summary>
/// No.3料仓缺料报警
/// </summary>
public static ERRNO WEIGHT_ERRNO_LACK3;
/// <summary>
/// No.4料仓缺料报警
/// </summary>
public static ERRNO WEIGHT_ERRNO_LACK4;
/// <summary>
/// No.5料仓缺料报警
/// </summary>
public static ERRNO WEIGHT_ERRNO_LACK5;
/// <summary>
/// No.6料仓缺料报警
/// </summary>
public static ERRNO WEIGHT_ERRNO_LACK6;
/// <summary>
/// No.1料斗加料异常
/// </summary>
public static ERRNO WEIGHT_ERRNO_ADD1;
/// <summary>
/// No.2料斗加料异常
/// </summary>
public static ERRNO WEIGHT_ERRNO_ADD2;
/// <summary>
/// No.3料斗加料异常
/// </summary>
public static ERRNO WEIGHT_ERRNO_ADD3;
/// <summary>
/// No.4料斗加料异常
/// 通过 PLC寄存器 触发的报警信息
/// </summary>
public static ERRNO WEIGHT_ERRNO_ADD4;
/// <summary>
/// No.5料斗加料异常
/// </summary>
public static ERRNO WEIGHT_ERRNO_ADD5;
/// <summary>
/// No.6料斗加料异常
/// </summary>
public static ERRNO WEIGHT_ERRNO_ADD6;
/// <summary>
/// 螺杆缺料报警
/// </summary>
public static ERRNO WEIGHT_ERRNO_SCREWLACK;
/// <summary>
/// 螺杆流量超偏差报警
/// </summary>
public static ERRNO WEIGHT_ERRNO_SCREWFLOW;
/// <summary>
/// 搅拌电机故障
/// </summary>
public static ERRNO WEIGHT_ERRNO_BLENDER;
/// <summary>
/// 急停开启
/// </summary>
public static ERRNO WEIGHT_ERRNO_SCRAM;
public static ERRNO ERRNO_PLC_REG;
/// <summary>
/// 搅拌电机急停开启
/// </summary>
public static ERRNO WEIGHT_ERRNO_BLENDER2;
/// <summary>
/// 搅拌电机未启动
/// </summary>
public static ERRNO WEIGHT_ERRNO_BLENDER3;
#endregion
}
}
......@@ -12,122 +12,146 @@ namespace FLY.Weight.Common
/// <summary>
/// 总流量设定
/// </summary>
public float TotalFlowSetting { get; set; }
[Description("总流量设定")]
public float TotalFlowSetting{ get; set; }
/// <summary>
/// 总流量显示
/// </summary>
public float TotalFlow { get; set; }
[Description("总流量显示")]
public float TotalFlow{ get; set; }
/// <summary>
/// 总产量
/// </summary>
public float TotalProduction { get; set; }
[Description("总产量")]
public float TotalProduction{ get; set; }
/// <summary>
/// 码轮周长mm
/// </summary>
public float WheelPerimeter { get; set; }
[Description("码轮周长mm")]
public float WheelPerimeter{ get; set; }
/// <summary>
/// 码轮脉冲
/// </summary>
public float WheelPulse { get; set; }
[Description("码轮脉冲")]
public float WheelPulse{ get; set; }
/// <summary>
/// 平均密度
/// </summary>
public float Density { get; set; }
[Description("平均密度")]
public float Density{ get; set; }
/// <summary>
/// 边料不回收
/// </summary>
public bool IsRimNoRecycle { get; set; }
[Description("边料不回收")]
public bool IsRimNoRecycle{ get; set; }
/// <summary>
/// 边料kg/h
/// </summary>
public float RimCharge { get; set; }
[Description("边料kg/h")]
public float RimCharge{ get; set; }
/// <summary>
/// 厚度um
/// </summary>
public float Thickness { get; set; }
[Description("厚度um")]
public float Thickness{ get; set; }
/// <summary>
/// 当前线速度m/min
/// </summary>
public float CurrentVelocity { get; set; }
[Description("当前线速度m/min")]
public float CurrentVelocity{ get; set; }
/// <summary>
/// 当前线速度设置m/min
/// </summary>
public float CurrentVelocitySet { get; set; }
[Description("当前线速度设置m/min")]
public float CurrentVelocitySet{ get; set; }
/// <summary>
/// 吹膜宽度mm
/// </summary>
public float TotalFilmWidth { get; set; }
[Description("吹膜宽度mm")]
public float TotalFilmWidth{ get; set; }
/// <summary>
/// 切边mm
/// </summary>
public float RimWidth { get; set; }
[Description("切边mm")]
public float RimWidth{ get; set; }
/// <summary>
/// 收卷宽度mm
/// </summary>
public float ActFilmWidth { get; set; }
[Description("收卷宽度mm")]
public float ActFilmWidth{ get; set; }
/// <summary>
/// 设定厚度um
/// </summary>
public float SetThickness { get; set; }
[Description("设定厚度um")]
public float SetThickness{ get; set; }
/// <summary>
/// 理论速度m/min
/// </summary>
public float TargetVelocity { get; set; }
[Description("理论速度m/min")]
public float TargetVelocity{ get; set; }
/// <summary>
/// 内收卷当前m
/// </summary>
public float ACurrentLen { get; set; }
[Description("内收卷当前m")]
public float ACurrentLen{ get; set; }
/// <summary>
/// 内收卷当前kg
/// </summary>
public float ACurrent { get; set; }
[Description("内收卷当前kg")]
public float ACurrent{ get; set; }
/// <summary>
/// 内收卷上卷kg
/// </summary>
public float ALast { get; set; }
[Description("内收卷上卷kg")]
public float ALast{ get; set; }
/// <summary>
/// 外收卷当前m
/// </summary>
public float BCurrentLen { get; set; }
[Description("外收卷当前m")]
public float BCurrentLen{ get; set; }
/// <summary>
/// 外收卷当前kg
/// </summary>
public float BCurrent { get; set; }
[Description("外收卷当前kg")]
public float BCurrent{ get; set; }
/// <summary>
/// 外收卷上卷kg
/// </summary>
public float BLast { get; set; }
[Description("外收卷上卷kg")]
public float BLast{ get; set; }
/// <summary>
/// 内收卷清零
/// </summary>
public bool AClear { get; set; }
[Description("内收卷清零")]
public bool AClear{ get; set; }
/// <summary>
/// 外收卷清零
/// </summary>
public bool BClear { get; set; }
[Description("外收卷清零")]
public bool BClear{ get; set; }
#endregion
public event PropertyChangedEventHandler PropertyChanged;
......
......@@ -7,6 +7,7 @@ using System.Reflection;
using System.Diagnostics;
using System.Windows.Media;
using FLY.OBJComponents.IService;
using Misc;
namespace FLY.Weight.Common
{
......@@ -42,727 +43,890 @@ namespace FLY.Weight.Common
/// <summary>
/// 报警开关
/// </summary>
public bool AlarmIsOn { get; set; }
[Description("报警开关")]
public bool AlarmIsOn{ get; set; }
/// <summary>
/// 报警复位
/// </summary>
public bool IsAlarmReseted { get; set; }
[Description("报警复位")]
public bool IsAlarmReseted{ get; set; }
/// <summary>
/// 累计产量
/// </summary>
public float CumulativeProduction { get; set; }
[Description("累计产量")]
public float CumulativeProduction{ get; set; }
/// <summary>
/// 配料斗重量显示
/// </summary>
public float MixBucketWeight { get; set; }
[Description("配料斗重量显示")]
public float MixBucketWeight{ get; set; }
/// <summary>
/// 配料斗阀门
/// </summary>
public bool BucketValveIsOpen { get; set; }
[Description("配料斗阀门")]
public bool BucketValveIsOpen{ get; set; }
/// <summary>
/// 配料操作
/// </summary>
public bool MixIsOn { get; set; }
[Description("配料操作")]
public bool MixIsOn{ get; set; }
/// <summary>
/// 失重仓重量
/// </summary>
public float BinWeight { get; set; }
[Description("失重仓重量")]
public float BinWeight{ get; set; }
/// <summary>
/// 当前产量
/// </summary>
public float CurrentFlow { get; set; }
[Description("当前产量")]
public float CurrentFlow{ get; set; }
/// <summary>
/// 设定产量
/// </summary>
public float FlowSetting { get; set; }
[Description("设定产量")]
public float FlowSetting{ get; set; }
/// <summary>
/// 运行比例
/// </summary>
public float ScrewPDisp { get; set; }
[Description("运行比例")]
public float ScrewPDisp{ get; set; }
/// <summary>
/// 设定比例
/// </summary>
public float ScrewPSet { get; set; }
[Description("设定比例")]
public float ScrewPSet{ get; set; }
/// <summary>
/// 运行频率
/// </summary>
public float ScrewMotorFreq { get; set; }
[Description("运行频率")]
public float ScrewMotorFreq{ get; set; }
/// <summary>
/// 设定频率
/// </summary>
public float ScrewManualFreq { get; set; }
[Description("设定频率")]
public float ScrewManualFreq{ get; set; }
/// <summary>
/// 设定频率确定
/// </summary>
public bool ScrewManualFreqIsSet { get; set; }
[Description("设定频率确定")]
public bool ScrewManualFreqIsSet{ get; set; }
/// <summary>
/// 螺杆模式
/// </summary>
public bool ScrewIsAutoMode { get; set; }
[Description("螺杆模式")]
public bool ScrewIsAutoMode{ get; set; }
/// <summary>
/// 螺杆操作
/// </summary>
public bool ScrewMotorIsOn { get; set; }
[Description("螺杆操作")]
public bool ScrewMotorIsOn{ get; set; }
/// <summary>
/// 配料数据保存
/// </summary>
public bool IsMixSave { get; set; }
[Description("配料数据保存")]
public bool IsMixSave{ get; set; }
/// <summary>
/// 1#比例设定
/// </summary>
public float MixPSet_1 { get; set; }
[Description("1#比例设定")]
public float MixPSet_1{ get; set; }
/// <summary>
/// 2#比例设定
/// </summary>
public float MixPSet_2 { get; set; }
[Description("2#比例设定")]
public float MixPSet_2{ get; set; }
/// <summary>
/// 3#比例设定
/// </summary>
public float MixPSet_3 { get; set; }
[Description("3#比例设定")]
public float MixPSet_3{ get; set; }
/// <summary>
/// 4#比例设定
/// </summary>
public float MixPSet_4 { get; set; }
[Description("4#比例设定")]
public float MixPSet_4{ get; set; }
/// <summary>
/// 5#比例设定
/// </summary>
public float MixPSet_5 { get; set; }
[Description("5#比例设定")]
public float MixPSet_5{ get; set; }
/// <summary>
/// 6#比例设定
/// </summary>
public float MixPSet_6 { get; set; }
[Description("6#比例设定")]
public float MixPSet_6{ get; set; }
/// <summary>
/// 1#比例显示
/// </summary>
public float MixPDisp_1 { get; set; }
[Description("1#比例显示")]
public float MixPDisp_1{ get; set; }
/// <summary>
/// 2#比例显示
/// </summary>
public float MixPDisp_2 { get; set; }
[Description("2#比例显示")]
public float MixPDisp_2{ get; set; }
/// <summary>
/// 3#比例显示
/// </summary>
public float MixPDisp_3 { get; set; }
[Description("3#比例显示")]
public float MixPDisp_3{ get; set; }
/// <summary>
/// 4#比例显示
/// </summary>
public float MixPDisp_4 { get; set; }
[Description("4#比例显示")]
public float MixPDisp_4{ get; set; }
/// <summary>
/// 5#比例显示
/// </summary>
public float MixPDisp_5 { get; set; }
[Description("5#比例显示")]
public float MixPDisp_5{ get; set; }
/// <summary>
/// 6#比例显示
/// </summary>
public float MixPDisp_6 { get; set; }
[Description("6#比例显示")]
public float MixPDisp_6{ get; set; }
/// <summary>
/// 1#重量设定
/// </summary>
public float MixSet_1 { get; set; }
[Description("1#重量设定")]
public float MixSet_1{ get; set; }
/// <summary>
/// 2#重量设定
/// </summary>
public float MixSet_2 { get; set; }
[Description("2#重量设定")]
public float MixSet_2{ get; set; }
/// <summary>
/// 3#重量设定
/// </summary>
public float MixSet_3 { get; set; }
[Description("3#重量设定")]
public float MixSet_3{ get; set; }
/// <summary>
/// 4#重量设定
/// </summary>
public float MixSet_4 { get; set; }
[Description("4#重量设定")]
public float MixSet_4{ get; set; }
/// <summary>
/// 5#重量设定
/// </summary>
public float MixSet_5 { get; set; }
[Description("5#重量设定")]
public float MixSet_5{ get; set; }
/// <summary>
/// 6#重量设定
/// </summary>
public float MixSet_6 { get; set; }
[Description("6#重量设定")]
public float MixSet_6{ get; set; }
/// <summary>
/// 1#重量显示
/// </summary>
public float MixDisp_1 { get; set; }
[Description("1#重量显示")]
public float MixDisp_1{ get; set; }
/// <summary>
/// 2#重量显示
/// </summary>
public float MixDisp_2 { get; set; }
[Description("2#重量显示")]
public float MixDisp_2{ get; set; }
/// <summary>
/// 3#重量显示
/// </summary>
public float MixDisp_3 { get; set; }
[Description("3#重量显示")]
public float MixDisp_3{ get; set; }
/// <summary>
/// 4#重量显示
/// </summary>
public float MixDisp_4 { get; set; }
[Description("4#重量显示")]
public float MixDisp_4{ get; set; }
/// <summary>
/// 5#重量显示
/// </summary>
public float MixDisp_5 { get; set; }
[Description("5#重量显示")]
public float MixDisp_5{ get; set; }
/// <summary>
/// 6#重量显示
/// </summary>
public float MixDisp_6 { get; set; }
[Description("6#重量显示")]
public float MixDisp_6{ get; set; }
/// <summary>
/// 1#放料
/// </summary>
public bool MixLight_1 { get; set; }
[Description("1#放料")]
public bool MixLight_1{ get; set; }
/// <summary>
/// 2#放料
/// </summary>
public bool MixLight_2 { get; set; }
[Description("2#放料")]
public bool MixLight_2{ get; set; }
/// <summary>
/// 3#放料
/// </summary>
public bool MixLight_3 { get; set; }
[Description("3#放料")]
public bool MixLight_3{ get; set; }
/// <summary>
/// 4#放料
/// </summary>
public bool MixLight_4 { get; set; }
[Description("4#放料")]
public bool MixLight_4{ get; set; }
/// <summary>
/// 5#放料
/// </summary>
public bool MixLight_5 { get; set; }
[Description("5#放料")]
public bool MixLight_5{ get; set; }
/// <summary>
/// 6#放料
/// </summary>
public bool MixLight_6 { get; set; }
[Description("6#放料")]
public bool MixLight_6{ get; set; }
/// <summary>
/// 配料斗卸载
/// </summary>
public bool MixUnload { get; set; }
[Description("配料斗卸载")]
public bool MixUnload{ get; set; }
/// <summary>
/// 配料斗重量设置
/// </summary>
public float MixSet { get; set; }
[Description("配料斗重量设置")]
public float MixSet{ get; set; }
/// <summary>
/// 配料斗重量显示
/// </summary>
public float MixDisp { get; set; }
[Description("配料斗重量显示")]
public float MixDisp{ get; set; }
/// <summary>
/// 1#累计重量
/// </summary>
public float MixCum_1 { get; set; }
[Description("1#累计重量")]
public float MixCum_1{ get; set; }
/// <summary>
/// 2#累计重量
/// </summary>
public float MixCum_2 { get; set; }
[Description("2#累计重量")]
public float MixCum_2{ get; set; }
/// <summary>
/// 3#累计重量
/// </summary>
public float MixCum_3 { get; set; }
[Description("3#累计重量")]
public float MixCum_3{ get; set; }
/// <summary>
/// 4#累计重量
/// </summary>
public float MixCum_4 { get; set; }
[Description("4#累计重量")]
public float MixCum_4{ get; set; }
/// <summary>
/// 5#累计重量
/// </summary>
public float MixCum_5 { get; set; }
[Description("5#累计重量")]
public float MixCum_5{ get; set; }
/// <summary>
/// 6#累计重量
/// </summary>
public float MixCum_6 { get; set; }
[Description("6#累计重量")]
public float MixCum_6{ get; set; }
/// <summary>
/// 1#累计百分比
/// </summary>
public float MixCumPercent_1 { get; set; }
[Description("1#累计百分比")]
public float MixCumPercent_1{ get; set; }
/// <summary>
/// 2#累计百分比
/// </summary>
public float MixCumPercent_2 { get; set; }
[Description("2#累计百分比")]
public float MixCumPercent_2{ get; set; }
/// <summary>
/// 3#累计百分比
/// </summary>
public float MixCumPercent_3 { get; set; }
[Description("3#累计百分比")]
public float MixCumPercent_3{ get; set; }
/// <summary>
/// 4#累计百分比
/// </summary>
public float MixCumPercent_4 { get; set; }
[Description("4#累计百分比")]
public float MixCumPercent_4{ get; set; }
/// <summary>
/// 5#累计百分比
/// </summary>
public float MixCumPercent_5 { get; set; }
[Description("5#累计百分比")]
public float MixCumPercent_5{ get; set; }
/// <summary>
/// 6#累计百分比
/// </summary>
public float MixCumPercent_6 { get; set; }
[Description("6#累计百分比")]
public float MixCumPercent_6{ get; set; }
/// <summary>
/// 产量清零
/// </summary>
public bool ClearProduction { get; set; }
[Description("产量清零")]
public bool ClearProduction{ get; set; }
/// <summary>
/// 流量方式
/// </summary>
public bool FlowCalMethodIsA { get; set; }
[Description("流量方式")]
public bool FlowCalMethodIsA{ get; set; }
/// <summary>
/// 流量反馈
/// </summary>
public float FlowDisp { get; set; }
[Description("流量反馈")]
public float FlowDisp{ get; set; }
/// <summary>
/// 滤波系数设定
/// </summary>
public float FilterParam { get; set; }
[Description("滤波系数设定")]
public float FilterParam{ get; set; }
/// <summary>
/// 切换级别设定
/// </summary>
public float SwitchLv { get; set; }
[Description("切换级别设定")]
public float SwitchLv{ get; set; }
/// <summary>
/// 升降增益设定
/// </summary>
public float UpDownGain { get; set; }
[Description("升降增益设定")]
public float UpDownGain{ get; set; }
/// <summary>
/// 比例增益设定
/// </summary>
public float PGain { get; set; }
[Description("比例增益设定")]
public float PGain{ get; set; }
/// <summary>
/// 积分时间设定
/// </summary>
public float ITime { get; set; }
[Description("积分时间设定")]
public float ITime{ get; set; }
/// <summary>
/// 调节系数设定
/// </summary>
public float AdjustFactor { get; set; }
[Description("调节系数设定")]
public float AdjustFactor{ get; set; }
/// <summary>
/// 调节上限设定
/// </summary>
public float AdjustUpper { get; set; }
[Description("调节上限设定")]
public float AdjustUpper{ get; set; }
/// <summary>
/// 调节下限设定
/// </summary>
public float AdjustLower { get; set; }
[Description("调节下限设定")]
public float AdjustLower{ get; set; }
/// <summary>
/// 稳定级别切换
/// </summary>
public float StableLvSwitch { get; set; }
[Description("稳定级别切换")]
public float StableLvSwitch{ get; set; }
/// <summary>
/// PID调节限幅
/// </summary>
public float PIDLimit { get; set; }
[Description("PID调节限幅")]
public float PIDLimit{ get; set; }
/// <summary>
/// 采样时间
/// </summary>
public float SampleTime { get; set; }
[Description("采样时间")]
public float SampleTime{ get; set; }
/// <summary>
/// PID结果
/// </summary>
public float PIDResult { get; set; }
[Description("PID结果")]
public float PIDResult{ get; set; }
/// <summary>
/// PID调节
/// </summary>
public float PIDAdjust { get; set; }
[Description("PID调节")]
public float PIDAdjust{ get; set; }
/// <summary>
/// 实际速度
/// </summary>
public float ScrewCurrentSpeed { get; set; }
[Description("实际速度")]
public float ScrewCurrentSpeed{ get; set; }
/// <summary>
/// 比例增益
/// </summary>
public float PGainDisp { get; set; }
[Description("比例增益")]
public float PGainDisp{ get; set; }
/// <summary>
/// 卸料时间
/// </summary>
public float UnloadingTime { get; set; }
[Description("卸料时间")]
public float UnloadingTime{ get; set; }
/// <summary>
/// 零位稳定时间
/// </summary>
public float ZeroStableTime { get; set; }
[Description("零位稳定时间")]
public float ZeroStableTime{ get; set; }
/// <summary>
/// 流量切换允许
/// </summary>
public float FlowSwitchEnable { get; set; }
[Description("流量切换允许")]
public float FlowSwitchEnable{ get; set; }
/// <summary>
/// 取样时间设定(s)
/// </summary>
public float SampleTimeSet { get; set; }
[Description("取样时间设定(s)")]
public float SampleTimeSet{ get; set; }
/// <summary>
/// 额定频率(Hz)
/// </summary>
public float ScrewMotorRatedFreq { get; set; }
[Description("额定频率(Hz)")]
public float ScrewMotorRatedFreq{ get; set; }
/// <summary>
/// 重量稳定时间(s)
/// </summary>
public float WeightStableTime { get; set; }
[Description("重量稳定时间(s)")]
public float WeightStableTime{ get; set; }
/// <summary>
/// 料位下限设定(kg)
/// </summary>
public float MaterialLowLimitSet { get; set; }
[Description("料位下限设定(kg)")]
public float MaterialLowLimitSet{ get; set; }
/// <summary>
/// 报警偏差设定(%)
/// </summary>
public float AlarmDeviationSet { get; set; }
[Description("报警偏差设定(%)")]
public float AlarmDeviationSet{ get; set; }
/// <summary>
/// 重量校正系数
/// </summary>
public float WeightCorrectFactor { get; set; }
[Description("重量校正系数")]
public float WeightCorrectFactor{ get; set; }
/// <summary>
/// 缺料报警设定(kg)
/// </summary>
public float LackErrorSet { get; set; }
[Description("缺料报警设定(kg)")]
public float LackErrorSet{ get; set; }
/// <summary>
/// 搅拌时间设定(s)
/// </summary>
public float MixingTimeSet { get; set; }
[Description("搅拌时间设定(s)")]
public float MixingTimeSet{ get; set; }
/// <summary>
/// 1次补料偏差
/// </summary>
public float FeedingDeviation_1 { get; set; }
[Description("1次补料偏差")]
public float FeedingDeviation_1{ get; set; }
/// <summary>
/// 2次补料偏差
/// </summary>
public float FeedingDeviation_2 { get; set; }
[Description("2次补料偏差")]
public float FeedingDeviation_2{ get; set; }
/// <summary>
/// 3次补料偏差
/// </summary>
public float FeedingDeviation_3 { get; set; }
[Description("3次补料偏差")]
public float FeedingDeviation_3{ get; set; }
/// <summary>
/// 4次补料偏差
/// </summary>
public float FeedingDeviation_4 { get; set; }
[Description("4次补料偏差")]
public float FeedingDeviation_4{ get; set; }
/// <summary>
/// 5次补料偏差
/// </summary>
public float FeedingDeviation_5 { get; set; }
[Description("5次补料偏差")]
public float FeedingDeviation_5{ get; set; }
/// <summary>
/// 6次补料偏差
/// </summary>
public float FeedingDeviation_6 { get; set; }
[Description("6次补料偏差")]
public float FeedingDeviation_6{ get; set; }
/// <summary>
/// 1次加料设定
/// </summary>
public float FeedSet_1 { get; set; }
[Description("1次加料设定")]
public float FeedSet_1{ get; set; }
/// <summary>
/// 2次加料设定
/// </summary>
public float FeedSet_2 { get; set; }
[Description("2次加料设定")]
public float FeedSet_2{ get; set; }
/// <summary>
/// 3次加料设定
/// </summary>
public float FeedSet_3 { get; set; }
[Description("3次加料设定")]
public float FeedSet_3{ get; set; }
/// <summary>
/// 4次加料设定
/// </summary>
public float FeedSet_4 { get; set; }
[Description("4次加料设定")]
public float FeedSet_4{ get; set; }
/// <summary>
/// 5次加料设定
/// </summary>
public float FeedSet_5 { get; set; }
[Description("5次加料设定")]
public float FeedSet_5{ get; set; }
/// <summary>
/// 6次加料设定
/// </summary>
public float FeedSet_6 { get; set; }
[Description("6次加料设定")]
public float FeedSet_6{ get; set; }
/// <summary>
/// 1#初始时间
/// </summary>
public float InitTime_1 { get; set; }
[Description("1#初始时间")]
public float InitTime_1{ get; set; }
/// <summary>
/// 2#初始时间
/// </summary>
public float InitTime_2 { get; set; }
[Description("2#初始时间")]
public float InitTime_2{ get; set; }
/// <summary>
/// 3#初始时间
/// </summary>
public float InitTime_3 { get; set; }
[Description("3#初始时间")]
public float InitTime_3{ get; set; }
/// <summary>
/// 4#初始时间
/// </summary>
public float InitTime_4 { get; set; }
[Description("4#初始时间")]
public float InitTime_4{ get; set; }
/// <summary>
/// 5#初始时间
/// </summary>
public float InitTime_5 { get; set; }
[Description("5#初始时间")]
public float InitTime_5{ get; set; }
/// <summary>
/// 6#初始时间
/// </summary>
public float InitTime_6 { get; set; }
[Description("6#初始时间")]
public float InitTime_6{ get; set; }
/// <summary>
/// 1#最小时间
/// </summary>
public float MinTime_1 { get; set; }
[Description("1#最小时间")]
public float MinTime_1{ get; set; }
/// <summary>
/// 2#最小时间
/// </summary>
public float MinTime_2 { get; set; }
[Description("2#最小时间")]
public float MinTime_2{ get; set; }
/// <summary>
/// 3#最小时间
/// </summary>
public float MinTime_3 { get; set; }
[Description("3#最小时间")]
public float MinTime_3{ get; set; }
/// <summary>
/// 4#最小时间
/// </summary>
public float MinTime_4 { get; set; }
[Description("4#最小时间")]
public float MinTime_4{ get; set; }
/// <summary>
/// 5#最小时间
/// </summary>
public float MinTime_5 { get; set; }
[Description("5#最小时间")]
public float MinTime_5{ get; set; }
/// <summary>
/// 6#最小时间
/// </summary>
public float MinTime_6 { get; set; }
[Description("6#最小时间")]
public float MinTime_6{ get; set; }
/// <summary>
/// 1#稳重时间
/// </summary>
public float StableTime_1 { get; set; }
[Description("1#稳重时间")]
public float StableTime_1{ get; set; }
/// <summary>
/// 2#稳重时间
/// </summary>
public float StableTime_2 { get; set; }
[Description("2#稳重时间")]
public float StableTime_2{ get; set; }
/// <summary>
/// 3#稳重时间
/// </summary>
public float StableTime_3 { get; set; }
[Description("3#稳重时间")]
public float StableTime_3{ get; set; }
/// <summary>
/// 4#稳重时间
/// </summary>
public float StableTime_4 { get; set; }
[Description("4#稳重时间")]
public float StableTime_4{ get; set; }
/// <summary>
/// 5#稳重时间
/// </summary>
public float StableTime_5 { get; set; }
[Description("5#稳重时间")]
public float StableTime_5{ get; set; }
/// <summary>
/// 6#稳重时间
/// </summary>
public float StableTime_6 { get; set; }
[Description("6#稳重时间")]
public float StableTime_6{ get; set; }
/// <summary>
/// 1次料仓报警设定
/// </summary>
public float BinAlarmSet_1 { get; set; }
[Description("1次料仓报警设定")]
public float BinAlarmSet_1{ get; set; }
/// <summary>
/// 2次料仓报警设定
/// </summary>
public float BinAlarmSet_2 { get; set; }
[Description("2次料仓报警设定")]
public float BinAlarmSet_2{ get; set; }
/// <summary>
/// 3次料仓报警设定
/// </summary>
public float BinAlarmSet_3 { get; set; }
[Description("3次料仓报警设定")]
public float BinAlarmSet_3{ get; set; }
/// <summary>
/// 4次料仓报警设定
/// </summary>
public float BinAlarmSet_4 { get; set; }
[Description("4次料仓报警设定")]
public float BinAlarmSet_4{ get; set; }
/// <summary>
/// 5次料仓报警设定
/// </summary>
public float BinAlarmSet_5 { get; set; }
[Description("5次料仓报警设定")]
public float BinAlarmSet_5{ get; set; }
/// <summary>
/// 6次料仓报警设定
/// </summary>
public float BinAlarmSet_6 { get; set; }
[Description("6次料仓报警设定")]
public float BinAlarmSet_6{ get; set; }
/// <summary>
/// No.1料仓缺料报警
/// No.1料仓缺料报警 (ON)
/// </summary>
public bool IsErrorOfLack_1 { get; set; }
[Description("No.1料仓缺料报警")]
[IsError()]
public bool IsErrorOfLack_1{ get; set; }
/// <summary>
/// No.2料仓缺料报警
/// No.2料仓缺料报警 (ON)
/// </summary>
public bool IsErrorOfLack_2 { get; set; }
[Description("No.2料仓缺料报警")]
[IsError()]
public bool IsErrorOfLack_2{ get; set; }
/// <summary>
/// No.3料仓缺料报警
/// No.3料仓缺料报警 (ON)
/// </summary>
public bool IsErrorOfLack_3 { get; set; }
[Description("No.3料仓缺料报警")]
[IsError()]
public bool IsErrorOfLack_3{ get; set; }
/// <summary>
/// No.4料仓缺料报警
/// No.4料仓缺料报警 (ON)
/// </summary>
public bool IsErrorOfLack_4 { get; set; }
[Description("No.4料仓缺料报警")]
[IsError()]
public bool IsErrorOfLack_4{ get; set; }
/// <summary>
/// No.5料仓缺料报警
/// No.5料仓缺料报警 (ON)
/// </summary>
public bool IsErrorOfLack_5 { get; set; }
[Description("No.5料仓缺料报警")]
[IsError()]
public bool IsErrorOfLack_5{ get; set; }
/// <summary>
/// No.6料仓缺料报警
/// No.6料仓缺料报警 (ON)
/// </summary>
public bool IsErrorOfLack_6 { get; set; }
[Description("No.6料仓缺料报警")]
[IsError()]
public bool IsErrorOfLack_6{ get; set; }
/// <summary>
/// No.1料斗加料异常
/// No.1料斗加料异常 (ON)
/// </summary>
public bool IsErrorOfAdd_1 { get; set; }
[Description("No.1料斗加料异常")]
[IsError()]
public bool IsErrorOfAdd_1{ get; set; }
/// <summary>
/// No.2料斗加料异常
/// No.2料斗加料异常 (ON)
/// </summary>
public bool IsErrorOfAdd_2 { get; set; }
[Description("No.2料斗加料异常")]
[IsError()]
public bool IsErrorOfAdd_2{ get; set; }
/// <summary>
/// No.3料斗加料异常
/// No.3料斗加料异常 (ON)
/// </summary>
public bool IsErrorOfAdd_3 { get; set; }
[Description("No.3料斗加料异常")]
[IsError()]
public bool IsErrorOfAdd_3{ get; set; }
/// <summary>
/// No.4料斗加料异常
/// No.4料斗加料异常 (ON)
/// </summary>
public bool IsErrorOfAdd_4 { get; set; }
[Description("No.4料斗加料异常")]
[IsError()]
public bool IsErrorOfAdd_4{ get; set; }
/// <summary>
/// No.5料斗加料异常
/// No.5料斗加料异常 (ON)
/// </summary>
public bool IsErrorOfAdd_5 { get; set; }
[Description("No.5料斗加料异常")]
[IsError()]
public bool IsErrorOfAdd_5{ get; set; }
/// <summary>
/// No.6料斗加料异常
/// No.6料斗加料异常 (ON)
/// </summary>
public bool IsErrorOfAdd_6 { get; set; }
[Description("No.6料斗加料异常")]
[IsError()]
public bool IsErrorOfAdd_6{ get; set; }
/// <summary>
/// 螺杆缺料报警
/// 螺杆缺料报警 (ON)
/// </summary>
public bool IsErrorOfScrewLack { get; set; }
[Description("螺杆缺料报警")]
[IsError()]
public bool IsErrorOfScrewLack{ get; set; }
/// <summary>
/// 螺杆流量超偏差报警
/// 螺杆流量超偏差报警 (ON)
/// </summary>
public bool IsErrorOfScrewFlow { get; set; }
[Description("螺杆流量超偏差报警")]
[IsError()]
public bool IsErrorOfScrewFlow{ get; set; }
/// <summary>
/// 搅拌电机故障
/// 搅拌电机故障 (ON)
/// </summary>
public bool IsErrorOfBlender { get; set; }
[Description("搅拌电机故障")]
[IsError()]
public bool IsErrorOfBlender{ get; set; }
/// <summary>
/// 急停开启
/// 急停开启 (ON)
/// </summary>
public bool IsErrorOfScram { get; set; }
[Description("急停开启")]
[IsError()]
public bool IsErrorOfScram{ get; set; }
/// <summary>
/// 搅拌电机急停开启
/// 搅拌电机急停开启 (ON)
/// </summary>
public bool IsErrorOfBlender2 { get; set; }
[Description("搅拌电机急停开启")]
[IsError()]
public bool IsErrorOfBlender2{ get; set; }
/// <summary>
/// 搅拌电机未启动
/// 搅拌电机未启动 (ON)
/// </summary>
public bool IsErrorOfBlender3 { get; set; }
[Description("搅拌电机未启动")]
[IsError()]
public bool IsErrorOfBlender3{ get; set; }
#endregion
......
......@@ -17,6 +17,7 @@ using FLY.OBJComponents.Common;
using FObjBase;
using System.Collections.ObjectModel;
using FLY.Weight.Server.Model;
using Misc;
namespace FLY.Weight.Server
{
......@@ -468,47 +469,45 @@ namespace FLY.Weight.Server
#region 报警
class ErrorAction
{
public Dictionary<string, ERRNO> error_property;
public delegate void ErrorHandler(ref byte errcode, ref string msg,object state);
public ErrorHandler action;
public List<string> error_property;
public object state;
public delegate void ErrorHandler(ref string msg, object state);
public ErrorHandler action;
}
Dictionary<INotifyPropertyChanged, ErrorAction> obj_error = new Dictionary<INotifyPropertyChanged, ErrorAction>();
void InitError()
{
Dictionary<string, ERRNO> error_property = new Dictionary<string, ERRNO>();
error_property = new Dictionary<string, ERRNO>();
error_property.Add("IsErrorOfLack_1", ERRNOs.WEIGHT_ERRNO_LACK1);
error_property.Add("IsErrorOfLack_2", ERRNOs.WEIGHT_ERRNO_LACK2);
error_property.Add("IsErrorOfLack_3", ERRNOs.WEIGHT_ERRNO_LACK3);
error_property.Add("IsErrorOfLack_4", ERRNOs.WEIGHT_ERRNO_LACK4);
error_property.Add("IsErrorOfLack_5", ERRNOs.WEIGHT_ERRNO_LACK5);
error_property.Add("IsErrorOfLack_6", ERRNOs.WEIGHT_ERRNO_LACK6);
error_property.Add("IsErrorOfAdd_1", ERRNOs.WEIGHT_ERRNO_ADD1);
error_property.Add("IsErrorOfAdd_2", ERRNOs.WEIGHT_ERRNO_ADD2);
error_property.Add("IsErrorOfAdd_3", ERRNOs.WEIGHT_ERRNO_ADD3);
error_property.Add("IsErrorOfAdd_4", ERRNOs.WEIGHT_ERRNO_ADD4);
error_property.Add("IsErrorOfAdd_5", ERRNOs.WEIGHT_ERRNO_ADD5);
error_property.Add("IsErrorOfAdd_6", ERRNOs.WEIGHT_ERRNO_ADD6);
error_property.Add("IsErrorOfScrewLack", ERRNOs.WEIGHT_ERRNO_SCREWLACK);
error_property.Add("IsErrorOfScrewFlow", ERRNOs.WEIGHT_ERRNO_SCREWFLOW);
error_property.Add("IsErrorOfBlender", ERRNOs.WEIGHT_ERRNO_BLENDER);
error_property.Add("IsErrorOfScram", ERRNOs.WEIGHT_ERRNO_SCRAM);
error_property.Add("IsErrorOfBlender2", ERRNOs.WEIGHT_ERRNO_BLENDER2);
error_property.Add("IsErrorOfBlender3", ERRNOs.WEIGHT_ERRNO_BLENDER3);
//反射找出全部是报警的property
List<string> error_weightc_property = new List<string>();
foreach (var propertyInfo in typeof(WeighterC).GetProperties())
{
if (propertyInfo.GetCustomAttributes(typeof(IsErrorAttribute), false).Count() > 0)
{
error_weightc_property.Add(propertyInfo.Name);
}
}
List<string> error_accessory_property = new List<string>();
foreach (var propertyInfo in typeof(WeighterAccessory).GetProperties())
{
if (propertyInfo.GetCustomAttributes(typeof(IsErrorAttribute), false).Count() > 0)
{
error_accessory_property.Add(propertyInfo.Name);
}
}
for (int i = 0; i < Items.Count(); i++)
{
obj_error.Add(Items[i], new ErrorAction()
{
error_property = error_property,
error_property = error_weightc_property,
state = i,
action = (ref byte code, ref string description, object state) =>
action = (ref string description, object state) =>
{
int idx = (int)state;
description = Items[idx].Number + "层 "+ description;
code += (byte)(idx*25);
},
});
......@@ -524,7 +523,7 @@ namespace FLY.Weight.Server
foreach (var kv in obj_error)
{
string objname = PLCos.ObjNames.First(_kv => _kv.Value == kv.Key).Key;
PLCos.SetPlan(objname, kv.Value.error_property.Keys.ToArray(), 0);
PLCos.SetPlan(objname, kv.Value.error_property.ToArray(), 0);
}
......@@ -552,21 +551,26 @@ namespace FLY.Weight.Server
{
ErrorAction errorAction = obj_error[sender as INotifyPropertyChanged];
if (errorAction.error_property.ContainsKey(e.PropertyName))
if (errorAction.error_property.Contains(e.PropertyName))
{
bool b = (bool)Misc.PropertiesManager.GetValue(sender, e.PropertyName);
//获取描述
var type = sender.GetType();
var property = type.GetProperty(e.PropertyName);
bool b = (bool)property.GetValue(type);
//肯定有,没有就让它出错!!!
string desp = (property.GetCustomAttributes(typeof(DescriptionAttribute), false).First() as DescriptionAttribute).Description;
bool offIsError = (property.GetCustomAttributes(typeof(IsErrorAttribute), false).First() as IsErrorAttribute).OffIsError;
ERRNO errno = errorAction.error_property[e.PropertyName];
ERR_STATE state;
if (!errno.OffIsError)
state = b ? ERR_STATE.ON : ERR_STATE.OFF;
else
if (offIsError)
state = !b ? ERR_STATE.ON : ERR_STATE.OFF;
else
state = b ? ERR_STATE.ON : ERR_STATE.OFF;
byte errcode = errno.Code;
string description = errno.Descrption;
byte errcode = ERRNOs.ERRNO_PLC_REG.Code;
string description = desp;
errorAction.action?.Invoke(ref errcode, ref description, errorAction.state);
errorAction.action?.Invoke(ref description, errorAction.state);
mWarning.Add(errcode, description, state);
}
......
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