You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1044 lines
40 KiB
C#
1044 lines
40 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using DevExpress.XtraGauges.Core.Model;
|
|
using DevExpress.XtraRichEdit.API.Layout;
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.LjPressure
|
|
{
|
|
public class PressurePLC
|
|
{
|
|
private static BasePlcHelper GetPlcHelper => BasePlcHelper.Instance;
|
|
|
|
#region 压送秤A气源压力 DBW12 数组Id=1
|
|
|
|
private static void DownDbw12(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V1_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V1_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V1_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw12()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView();
|
|
view.Id = 1;
|
|
view.LowLimit = basePlcHelper.mainPress_V1_LowLimit.NowValue.ToFloat();
|
|
view.HighLimit = basePlcHelper.mainPress_V1_HighLimit.NowValue.ToFloat();
|
|
view.Alarm = basePlcHelper.mainPress_V1_LowLimit.NowValue.ToInt();
|
|
return view;
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
private static void DownDbw26(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V1_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V1_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.topPres_V1_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw26()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView();
|
|
view.Id = 2;
|
|
view.LowLimit = basePlcHelper.topPres_V1_LowLimit.NowValue.ToFloat();
|
|
view.HighLimit = basePlcHelper.topPres_V1_HighLimit.NowValue.ToFloat();
|
|
view.Alarm = basePlcHelper.topPres_V1_Alarm.NowValue.ToInt();
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDbw40(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V1_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V1_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePres_V1_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw40()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView();
|
|
view.Id = 3;
|
|
view.LowLimit = basePlcHelper.linePres_V1_LowLimit.NowValue.ToFloat();
|
|
view.HighLimit = basePlcHelper.linePres_V1_HighLimit.NowValue.ToFloat();
|
|
view.Alarm = basePlcHelper.linePres_V1_Alarm.NowValue.ToInt();
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDbw54(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V2_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V2_HighLimit, view.HighLimit);
|
|
basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V2_Alarm,
|
|
new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw54()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView();
|
|
view.Id = 4;
|
|
view.LowLimit = basePlcHelper.mainPress_V2_LowLimit.NowValue.ToFloat();
|
|
view.HighLimit = basePlcHelper.mainPress_V2_HighLimit.NowValue.ToFloat();
|
|
view.Alarm = basePlcHelper.mainPress_V2_Alarm.NowValue.ToInt();
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDbw68(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V2_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V2_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.topPres_V2_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw68()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView();
|
|
view.Id = 5;
|
|
view.LowLimit = basePlcHelper.topPres_V2_LowLimit.NowValue.ToFloat();
|
|
view.HighLimit = basePlcHelper.topPres_V2_HighLimit.NowValue.ToFloat();
|
|
view.Alarm = basePlcHelper.topPres_V2_Alarm.NowValue.ToInt();
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDbw82(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V2_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V2_HighLimit, view.HighLimit);
|
|
basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePres_V2_Alarm,
|
|
new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw82()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView();
|
|
view.Id = 6;
|
|
view.LowLimit = basePlcHelper.linePres_V2_LowLimit.NowValue.ToFloat();
|
|
view.HighLimit = basePlcHelper.linePres_V2_HighLimit.NowValue.ToFloat();
|
|
view.Alarm = basePlcHelper.linePres_V2_Alarm.NowValue.ToInt();
|
|
return view;
|
|
}
|
|
|
|
private static void DownDbw96(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V3_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V3_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V3_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw96()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView();
|
|
view.Id = 7;
|
|
view.LowLimit = basePlcHelper.mainPress_V3_LowLimit.NowValue.ToFloat();
|
|
view.HighLimit = basePlcHelper.mainPress_V3_HighLimit.NowValue.ToFloat();
|
|
view.Alarm = basePlcHelper.mainPress_V3_Alarm.NowValue.ToInt();
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDbw110(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V3_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V3_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.topPres_V3_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw110()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView();
|
|
view.Id = 8;
|
|
view.LowLimit = basePlcHelper.topPres_V3_LowLimit.NowValue.ToFloat();
|
|
view.HighLimit = basePlcHelper.topPres_V3_HighLimit.NowValue.ToFloat();
|
|
view.Alarm = basePlcHelper.topPres_V3_Alarm.NowValue.ToInt();
|
|
return view;
|
|
}
|
|
|
|
private static void DownDbw124(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V3_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V3_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePres_V3_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw124()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 9,
|
|
LowLimit = basePlcHelper.linePres_V3_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.linePres_V3_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.linePres_V3_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDbw138(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V4_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V4_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V4_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
private static PressureSettingView UpDbw138()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 10,
|
|
LowLimit = basePlcHelper.mainPress_V4_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.mainPress_V4_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.mainPress_V4_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDbw152(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V4_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V4_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.topPres_V4_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw152()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 11,
|
|
LowLimit = basePlcHelper.topPres_V4_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.topPres_V4_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.topPres_V4_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDbw166(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V4_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V4_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePres_V4_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw166()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 12,
|
|
LowLimit = basePlcHelper.linePres_V4_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.linePres_V4_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.linePres_V4_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDbw180(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V5_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.mainPress_V5_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.mainPress_V5_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw180()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 13,
|
|
LowLimit = basePlcHelper.mainPress_V5_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.mainPress_V5_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.mainPress_V5_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDbw194(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V5_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.topPres_V5_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.topPres_V5_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw194()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 14,
|
|
LowLimit = basePlcHelper.topPres_V5_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.topPres_V5_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.topPres_V5_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDbw208(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V5_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.linePres_V5_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.linePres_V5_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw208()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 15,
|
|
LowLimit = basePlcHelper.linePres_V5_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.linePres_V5_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.linePres_V5_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
|
|
|
|
private static void DownDBW222(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B1_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B1_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B1_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw222()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 16,
|
|
LowLimit = basePlcHelper.presDay_B1_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B1_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B1_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW236(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B2_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B2_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B2_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw236()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 17,
|
|
LowLimit = basePlcHelper.presDay_B2_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B2_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B2_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW250(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B3_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B3_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B3_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw250()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 18,
|
|
LowLimit = basePlcHelper.presDay_B3_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B3_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B3_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW264(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B4_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B4_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B4_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw264()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 19,
|
|
LowLimit = basePlcHelper.presDay_B4_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B4_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B4_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW278(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B5_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B5_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B5_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw278()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 20,
|
|
LowLimit = basePlcHelper.presDay_B5_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B5_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B5_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW292(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B6_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B6_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B6_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
private static PressureSettingView UpDbw292()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 21,
|
|
LowLimit = basePlcHelper.presDay_B6_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B6_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B6_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW306(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B7_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B7_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B7_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw306()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 22,
|
|
LowLimit = basePlcHelper.presDay_B7_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B7_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B7_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW320(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B8_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B8_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B8_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw320()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 23,
|
|
LowLimit = basePlcHelper.presDay_B8_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B8_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B8_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW334(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B9_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B9_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B9_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw334()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 24,
|
|
LowLimit = basePlcHelper.presDay_B9_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B9_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B9_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW348(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B10_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B10_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B10_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw348()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 25,
|
|
LowLimit = basePlcHelper.presDay_B10_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B10_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B10_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW362(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B11_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B11_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B11_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw362()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 26,
|
|
LowLimit = basePlcHelper.presDay_B11_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B11_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B11_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
private static void DownDBW376(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B12_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.presDay_B12_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.presDay_B12_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw376()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 27,
|
|
LowLimit = basePlcHelper.presDay_B12_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.presDay_B12_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.presDay_B12_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDBW390(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP01_B12_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP01_B12_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.PR2PCP01_B12_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw390()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 28,
|
|
LowLimit = basePlcHelper.PR2PCP01_B12_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.PR2PCP01_B12_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.PR2PCP01_B12_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDBW404(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP02_B12_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP02_B12_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.PR2PCP02_B12_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw404()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 29,
|
|
LowLimit = basePlcHelper.PR2PCP02_B12_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.PR2PCP02_B12_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.PR2PCP02_B12_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
|
|
private static void DownDBW418(PressureSettingView view)
|
|
{
|
|
if (view != null)
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP03_B12_LowLimit, view.LowLimit);
|
|
basePlcHelper.PlcWriteFloatByDataKey(basePlcHelper.PR2PCP03_B12_HighLimit, view.HighLimit);
|
|
// basePlcHelper.PlcWriteByDataKey(basePlcHelper.PR2PCP03_B12_Alarm,
|
|
// new object[] { Convert.ToBoolean(view.Alarm) });
|
|
}
|
|
}
|
|
|
|
private static PressureSettingView UpDbw418()
|
|
{
|
|
var basePlcHelper = GetPlcHelper;
|
|
PressureSettingView view = new PressureSettingView
|
|
{
|
|
Id = 30,
|
|
LowLimit = basePlcHelper.PR2PCP03_B12_LowLimit.NowValue.ToFloat(),
|
|
HighLimit = basePlcHelper.PR2PCP03_B12_HighLimit.NowValue.ToFloat(),
|
|
Alarm = basePlcHelper.PR2PCP03_B12_Alarm.NowValue.ToInt()
|
|
};
|
|
return view;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 下发到plc
|
|
/// </summary>
|
|
/// <param name="ls"></param>
|
|
public static void DownToPlc(List<PressureSettingView> ls)
|
|
{
|
|
foreach (var pressureSettingView in ls)
|
|
{
|
|
int id = pressureSettingView.Id;
|
|
switch (id)
|
|
{
|
|
case 1:
|
|
DownDbw12(pressureSettingView);
|
|
break;
|
|
|
|
case 2:
|
|
DownDbw26(pressureSettingView);
|
|
break;
|
|
case 3:
|
|
DownDbw40(pressureSettingView);
|
|
break;
|
|
|
|
case 4:
|
|
DownDbw54(pressureSettingView);
|
|
break;
|
|
|
|
case 5:
|
|
DownDbw68(pressureSettingView);
|
|
break;
|
|
case 6:
|
|
DownDbw82(pressureSettingView);
|
|
break;
|
|
|
|
case 7:
|
|
DownDbw96(pressureSettingView);
|
|
break;
|
|
|
|
case 8:
|
|
DownDbw110(pressureSettingView);
|
|
break;
|
|
|
|
case 9:
|
|
DownDbw124(pressureSettingView);
|
|
break;
|
|
case 10:
|
|
DownDbw138(pressureSettingView);
|
|
break;
|
|
|
|
case 11:
|
|
DownDbw152(pressureSettingView);
|
|
break;
|
|
|
|
case 12:
|
|
DownDbw166(pressureSettingView);
|
|
break;
|
|
|
|
case 13:
|
|
DownDbw180(pressureSettingView);
|
|
break;
|
|
|
|
case 14:
|
|
DownDbw194(pressureSettingView);
|
|
break;
|
|
|
|
case 15:
|
|
DownDbw208(pressureSettingView);
|
|
break;
|
|
|
|
case 16:
|
|
DownDBW222(pressureSettingView);
|
|
break;
|
|
|
|
case 17:
|
|
DownDBW236(pressureSettingView);
|
|
break;
|
|
|
|
case 18:
|
|
DownDBW250(pressureSettingView);
|
|
break;
|
|
case 19:
|
|
DownDBW264(pressureSettingView);
|
|
break;
|
|
|
|
case 20:
|
|
DownDBW278(pressureSettingView);
|
|
break;
|
|
|
|
case 21:
|
|
DownDBW292(pressureSettingView);
|
|
break;
|
|
|
|
case 22:
|
|
DownDBW306(pressureSettingView);
|
|
break;
|
|
|
|
case 23:
|
|
DownDBW320(pressureSettingView);
|
|
break;
|
|
|
|
case 24:
|
|
DownDBW334(pressureSettingView);
|
|
break;
|
|
|
|
case 25:
|
|
DownDBW348(pressureSettingView);
|
|
break;
|
|
|
|
case 26:
|
|
DownDBW362(pressureSettingView);
|
|
break;
|
|
case 27:
|
|
DownDBW376(pressureSettingView);
|
|
break;
|
|
|
|
case 28:
|
|
DownDBW390(pressureSettingView);
|
|
break;
|
|
case 29:
|
|
DownDBW404(pressureSettingView);
|
|
break;
|
|
|
|
case 30:
|
|
DownDBW418(pressureSettingView);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 下发到plc
|
|
/// </summary>
|
|
/// <param name="ls"></param>
|
|
public static List<PressureSettingView> UpdateFromPlc()
|
|
{
|
|
|
|
List<PressureSettingView> ls = new List<PressureSettingView>
|
|
{
|
|
UpDbw12(),
|
|
UpDbw26(),
|
|
UpDbw40(),
|
|
UpDbw54(),
|
|
UpDbw68(),
|
|
UpDbw82(),
|
|
UpDbw96(),
|
|
UpDbw110(),
|
|
UpDbw124(),
|
|
UpDbw138(),
|
|
UpDbw152(),
|
|
UpDbw166(),
|
|
UpDbw180(),
|
|
UpDbw194(),
|
|
UpDbw208(),
|
|
UpDbw222(),
|
|
UpDbw236(),
|
|
UpDbw250(),
|
|
UpDbw264(),
|
|
UpDbw278(),
|
|
UpDbw292(),
|
|
UpDbw306(),
|
|
UpDbw320(),
|
|
UpDbw334(),
|
|
UpDbw348(),
|
|
UpDbw362(),
|
|
UpDbw376(),
|
|
UpDbw390(),
|
|
UpDbw404(),
|
|
UpDbw418()
|
|
};
|
|
|
|
|
|
|
|
return ls;
|
|
|
|
}
|
|
|
|
|
|
public static PressureSettingView UpdateFromPlc(int id)
|
|
{
|
|
PressureSettingView view = new PressureSettingView();
|
|
switch (id)
|
|
{
|
|
case 1:
|
|
view= UpDbw12();
|
|
break;
|
|
case 2:
|
|
view= UpDbw26();
|
|
break;
|
|
case 3:
|
|
view= UpDbw40();
|
|
break;
|
|
case 4:
|
|
view= UpDbw54();
|
|
break;
|
|
case 5:
|
|
view= UpDbw68();
|
|
break;
|
|
case 6:
|
|
view= UpDbw82();
|
|
break;
|
|
case 7:
|
|
view= UpDbw96();
|
|
break;
|
|
case 8:
|
|
view= UpDbw110();
|
|
break;
|
|
case 9:
|
|
view= UpDbw124();
|
|
break;
|
|
case 10:
|
|
view= UpDbw138();
|
|
break;
|
|
case 11:
|
|
view= UpDbw152();
|
|
break;
|
|
case 12:
|
|
view= UpDbw166();
|
|
break;
|
|
case 13:
|
|
view= UpDbw180();
|
|
break;
|
|
case 14:
|
|
view= UpDbw194();
|
|
break;
|
|
case 15:
|
|
view= UpDbw208();
|
|
break;
|
|
case 16:
|
|
view= UpDbw222();
|
|
break;
|
|
case 17:
|
|
view= UpDbw236();
|
|
break;
|
|
case 18:
|
|
view= UpDbw250();
|
|
break;
|
|
case 19:
|
|
view= UpDbw264();
|
|
break;
|
|
case 20:
|
|
view= UpDbw278();
|
|
break;
|
|
case 21:
|
|
view= UpDbw292();
|
|
break;
|
|
case 22:
|
|
view= UpDbw306();
|
|
break;
|
|
case 23:
|
|
view= UpDbw320();
|
|
break;
|
|
case 24:
|
|
view= UpDbw334();
|
|
break;
|
|
case 25:
|
|
view= UpDbw348();
|
|
break;
|
|
case 26:
|
|
view= UpDbw362();
|
|
break;
|
|
case 27:
|
|
view= UpDbw376();
|
|
break;
|
|
case 28:
|
|
view= UpDbw390();
|
|
break;
|
|
case 29:
|
|
view= UpDbw404();
|
|
break;
|
|
case 30:
|
|
view= UpDbw418();
|
|
break;
|
|
|
|
}
|
|
|
|
return view;
|
|
}
|
|
}
|
|
} |