|
|
|
@ -24,6 +24,9 @@ using System.Windows.Forms;
|
|
|
|
|
using HslCommunication;
|
|
|
|
|
using IAction = Mesnac.Action.Base.IAction;
|
|
|
|
|
using Timer = System.Windows.Forms.Timer;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.Report.DeviceDetail2Report.Entity;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjMaterial;
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
{
|
|
|
|
@ -35,7 +38,13 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
DB2103Helper DB2103;
|
|
|
|
|
DB2107Helper DB2107;
|
|
|
|
|
ConcurrentDictionary<string, object> conCurrentCache = new ConcurrentDictionary<string, object>();
|
|
|
|
|
|
|
|
|
|
Timer timer;
|
|
|
|
|
Timer timer1;
|
|
|
|
|
|
|
|
|
|
List<DbMCControl> McControllist;
|
|
|
|
|
DeviceDetail2Entity DeviceDetailForm = new DeviceDetail2Entity();
|
|
|
|
|
private DbMCControl AlarmForm = null; //物料列表控件
|
|
|
|
|
|
|
|
|
|
#region 控件声明
|
|
|
|
|
|
|
|
|
@ -846,10 +855,217 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
base.RunIni(runtime); //必须要调用
|
|
|
|
|
|
|
|
|
|
McControllist = GetAllDbMCControlsByOption(DbOptionTypes.InitData);//获取所有待初始化控件
|
|
|
|
|
|
|
|
|
|
this.AlarmForm = McControllist.FirstOrDefault(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "AlarmForm");
|
|
|
|
|
|
|
|
|
|
//this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "AlarmForm").FirstOrDefault(); //获取物料数据控件
|
|
|
|
|
|
|
|
|
|
#region 报表实体类对应前端控件
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.DAMode = StringToLable("DAMode");
|
|
|
|
|
DeviceDetailForm.DAStatus = StringToLable("DAStatus");
|
|
|
|
|
DeviceDetailForm.DABatch = StringToLable("DABatch");
|
|
|
|
|
DeviceDetailForm.DAStep = StringToLable("DAStep");
|
|
|
|
|
DeviceDetailForm.DAStepCode = StringToLable("DAStepCode");
|
|
|
|
|
DeviceDetailForm.DATotalTime = StringToLable("DATotalTime");
|
|
|
|
|
DeviceDetailForm.DAStepTime = StringToLable("DAStepTime");
|
|
|
|
|
DeviceDetailForm.DASpeed = StringToLable("DASpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.DBMode = StringToLable("DBMode");
|
|
|
|
|
DeviceDetailForm.DBStatus = StringToLable("DBStatus");
|
|
|
|
|
DeviceDetailForm.DBBatch = StringToLable("DBBatch");
|
|
|
|
|
DeviceDetailForm.DBStep = StringToLable("DBStep");
|
|
|
|
|
DeviceDetailForm.DBStepCode = StringToLable("DBStepCode");
|
|
|
|
|
DeviceDetailForm.DBTotalTime = StringToLable("DBTotalTime");
|
|
|
|
|
DeviceDetailForm.DBStepTime = StringToLable("DBStepTime");
|
|
|
|
|
DeviceDetailForm.DBSpeed = StringToLable("DBSpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.DCMode = StringToLable("DCMode");
|
|
|
|
|
DeviceDetailForm.DCStatus = StringToLable("DCStatus");
|
|
|
|
|
DeviceDetailForm.DCBatch = StringToLable("DCBatch");
|
|
|
|
|
DeviceDetailForm.DCStep = StringToLable("DCStep");
|
|
|
|
|
DeviceDetailForm.DCStepCode = StringToLable("DCStepCode");
|
|
|
|
|
DeviceDetailForm.DCTotalTime = StringToLable("DCTotalTime");
|
|
|
|
|
DeviceDetailForm.DCStepTime = StringToLable("DCStepTime");
|
|
|
|
|
DeviceDetailForm.DCSpeed = StringToLable("DCSpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.DDMode = StringToLable("DDMode");
|
|
|
|
|
DeviceDetailForm.DDStatus = StringToLable("DDStatus");
|
|
|
|
|
DeviceDetailForm.DDBatch = StringToLable("DDBatch");
|
|
|
|
|
DeviceDetailForm.DDStep = StringToLable("DDStep");
|
|
|
|
|
DeviceDetailForm.DDStepCode = StringToLable("DDStepCode");
|
|
|
|
|
DeviceDetailForm.DDTotalTime = StringToLable("DDTotalTime");
|
|
|
|
|
DeviceDetailForm.DDStepTime = StringToLable("DDStepTime");
|
|
|
|
|
DeviceDetailForm.DDSpeed = StringToLable("DDSpeed");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.WAMode = StringToLable("WAMode");
|
|
|
|
|
DeviceDetailForm.WAStatus = StringToLable("WAStatus");
|
|
|
|
|
DeviceDetailForm.WABatch = StringToLable("WABatch");
|
|
|
|
|
DeviceDetailForm.WAStep = StringToLable("WAStep");
|
|
|
|
|
DeviceDetailForm.WAStepCode = StringToLable("WAStepCode");
|
|
|
|
|
DeviceDetailForm.WATotalTime = StringToLable("WATotalTime");
|
|
|
|
|
DeviceDetailForm.WAStepTime = StringToLable("WAStepTime");
|
|
|
|
|
DeviceDetailForm.WASpeed = StringToLable("WASpeed");
|
|
|
|
|
DeviceDetailForm.WACurrent = StringToLable("WACurrent");
|
|
|
|
|
DeviceDetailForm.WAPressure = StringToLable("WAPressure");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.WBMode = StringToLable("WBMode");
|
|
|
|
|
DeviceDetailForm.WBStatus = StringToLable("WBStatus");
|
|
|
|
|
DeviceDetailForm.WBBatch = StringToLable("WBBatch");
|
|
|
|
|
DeviceDetailForm.WBStep = StringToLable("WBStep");
|
|
|
|
|
DeviceDetailForm.WBStepCode = StringToLable("WBStepCode");
|
|
|
|
|
DeviceDetailForm.WBTotalTime = StringToLable("WBTotalTime");
|
|
|
|
|
DeviceDetailForm.WBStepTime = StringToLable("WBStepTime");
|
|
|
|
|
DeviceDetailForm.WBSpeed = StringToLable("WBSpeed");
|
|
|
|
|
DeviceDetailForm.WBCurrent = StringToLable("WBCurrent");
|
|
|
|
|
DeviceDetailForm.WBPressure = StringToLable("WBPressure");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.WCMode = StringToLable("WCMode");
|
|
|
|
|
DeviceDetailForm.WCStatus = StringToLable("WCStatus");
|
|
|
|
|
DeviceDetailForm.WCBatch = StringToLable("WCBatch");
|
|
|
|
|
DeviceDetailForm.WCStep = StringToLable("WCStep");
|
|
|
|
|
DeviceDetailForm.WCStepCode = StringToLable("WCStepCode");
|
|
|
|
|
DeviceDetailForm.WCTotalTime = StringToLable("WCTotalTime");
|
|
|
|
|
DeviceDetailForm.WCStepTime = StringToLable("WCStepTime");
|
|
|
|
|
DeviceDetailForm.WCSpeed = StringToLable("WCSpeed");
|
|
|
|
|
DeviceDetailForm.WCCurrent = StringToLable("WCCurrent");
|
|
|
|
|
DeviceDetailForm.WCPressure = StringToLable("WCPressure");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.WDMode = StringToLable("WDMode");
|
|
|
|
|
DeviceDetailForm.WDStatus = StringToLable("WDStatus");
|
|
|
|
|
DeviceDetailForm.WDBatch = StringToLable("WDBatch");
|
|
|
|
|
DeviceDetailForm.WDStep = StringToLable("WDStep");
|
|
|
|
|
DeviceDetailForm.WDStepCode = StringToLable("WDStepCode");
|
|
|
|
|
DeviceDetailForm.WDTotalTime = StringToLable("WDTotalTime");
|
|
|
|
|
DeviceDetailForm.WDStepTime = StringToLable("WDStepTime");
|
|
|
|
|
DeviceDetailForm.WDSpeed = StringToLable("WDSpeed");
|
|
|
|
|
DeviceDetailForm.WDCurrent = StringToLable("WDCurrent");
|
|
|
|
|
DeviceDetailForm.WDPressure = StringToLable("WDPressure");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.WEMode = StringToLable("WEMode");
|
|
|
|
|
DeviceDetailForm.WEStatus = StringToLable("WEStatus");
|
|
|
|
|
DeviceDetailForm.WEBatch = StringToLable("WEBatch");
|
|
|
|
|
DeviceDetailForm.WEStep = StringToLable("WEStep");
|
|
|
|
|
DeviceDetailForm.WEStepCode = StringToLable("WEStepCode");
|
|
|
|
|
DeviceDetailForm.WETotalTime = StringToLable("WETotalTime");
|
|
|
|
|
DeviceDetailForm.WEStepTime = StringToLable("WEStepTime");
|
|
|
|
|
DeviceDetailForm.WESpeed = StringToLable("WESpeed");
|
|
|
|
|
DeviceDetailForm.WECurrent = StringToLable("WECurrent");
|
|
|
|
|
DeviceDetailForm.WEPressure = StringToLable("WEPressure");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.WFMode = StringToLable("WFMode");
|
|
|
|
|
DeviceDetailForm.WFStatus = StringToLable("WFStatus");
|
|
|
|
|
DeviceDetailForm.WFBatch = StringToLable("WFBatch");
|
|
|
|
|
DeviceDetailForm.WFStep = StringToLable("WFStep");
|
|
|
|
|
DeviceDetailForm.WFStepCode = StringToLable("WFStepCode");
|
|
|
|
|
DeviceDetailForm.WFTotalTime = StringToLable("WFTotalTime");
|
|
|
|
|
DeviceDetailForm.WFStepTime = StringToLable("WFStepTime");
|
|
|
|
|
DeviceDetailForm.WFSpeed = StringToLable("WFSpeed");
|
|
|
|
|
DeviceDetailForm.WFCurrent = StringToLable("WFCurrent");
|
|
|
|
|
DeviceDetailForm.WFPressure = StringToLable("WFPressure");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.WGMode = StringToLable("WGMode");
|
|
|
|
|
DeviceDetailForm.WGStatus = StringToLable("WGStatus");
|
|
|
|
|
DeviceDetailForm.WGBatch = StringToLable("WGBatch");
|
|
|
|
|
DeviceDetailForm.WGStep = StringToLable("WGStep");
|
|
|
|
|
DeviceDetailForm.WGStepCode = StringToLable("WGStepCode");
|
|
|
|
|
DeviceDetailForm.WGTotalTime = StringToLable("WGTotalTime");
|
|
|
|
|
DeviceDetailForm.WGStepTime = StringToLable("WGStepTime");
|
|
|
|
|
DeviceDetailForm.WGSpeed = StringToLable("WGSpeed");
|
|
|
|
|
DeviceDetailForm.WGCurrent = StringToLable("WGCurrent");
|
|
|
|
|
DeviceDetailForm.WGPressure = StringToLable("WGPressure");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.WHMode = StringToLable("WHMode");
|
|
|
|
|
DeviceDetailForm.WHStatus = StringToLable("WHStatus");
|
|
|
|
|
DeviceDetailForm.WHBatch = StringToLable("WHBatch");
|
|
|
|
|
DeviceDetailForm.WHStep = StringToLable("WHStep");
|
|
|
|
|
DeviceDetailForm.WHStepCode = StringToLable("WHStepCode");
|
|
|
|
|
DeviceDetailForm.WHTotalTime = StringToLable("WHTotalTime");
|
|
|
|
|
DeviceDetailForm.WHStepTime = StringToLable("WHStepTime");
|
|
|
|
|
DeviceDetailForm.WHSpeed = StringToLable("WHSpeed");
|
|
|
|
|
DeviceDetailForm.WHCurrent = StringToLable("WHCurrent");
|
|
|
|
|
DeviceDetailForm.WHPressure = StringToLable("WHPressure");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.GAMode = StringToLable("GAMode");
|
|
|
|
|
DeviceDetailForm.GAStatus = StringToLable("GAStatus");
|
|
|
|
|
DeviceDetailForm.GABatch = StringToLable("GABatch");
|
|
|
|
|
DeviceDetailForm.GAStep = StringToLable("GAStep");
|
|
|
|
|
DeviceDetailForm.GAStepCode = StringToLable("GAStepCode");
|
|
|
|
|
DeviceDetailForm.GATotalTime = StringToLable("GATotalTime");
|
|
|
|
|
DeviceDetailForm.GAStepTime = StringToLable("GAStepTime");
|
|
|
|
|
DeviceDetailForm.GASpeed = StringToLable("GASpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.GBMode = StringToLable("GBMode");
|
|
|
|
|
DeviceDetailForm.GBStatus = StringToLable("GBStatus");
|
|
|
|
|
DeviceDetailForm.GBBatch = StringToLable("GBBatch");
|
|
|
|
|
DeviceDetailForm.GBStep = StringToLable("GBStep");
|
|
|
|
|
DeviceDetailForm.GBStepCode = StringToLable("GBStepCode");
|
|
|
|
|
DeviceDetailForm.GBTotalTime = StringToLable("GBTotalTime");
|
|
|
|
|
DeviceDetailForm.GBStepTime = StringToLable("GBStepTime");
|
|
|
|
|
DeviceDetailForm.GBSpeed = StringToLable("GBSpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.GCMode = StringToLable("GCMode");
|
|
|
|
|
DeviceDetailForm.GCStatus = StringToLable("GCStatus");
|
|
|
|
|
DeviceDetailForm.GCBatch = StringToLable("GCBatch");
|
|
|
|
|
DeviceDetailForm.GCStep = StringToLable("GCStep");
|
|
|
|
|
DeviceDetailForm.GCStepCode = StringToLable("GCStepCode");
|
|
|
|
|
DeviceDetailForm.GCTotalTime = StringToLable("GCTotalTime");
|
|
|
|
|
DeviceDetailForm.GCStepTime = StringToLable("GCStepTime");
|
|
|
|
|
DeviceDetailForm.GCSpeed = StringToLable("GCSpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.GDMode = StringToLable("GDMode");
|
|
|
|
|
DeviceDetailForm.GDStatus = StringToLable("GDStatus");
|
|
|
|
|
DeviceDetailForm.GDBatch = StringToLable("GDBatch");
|
|
|
|
|
DeviceDetailForm.GDStep = StringToLable("GDStep");
|
|
|
|
|
DeviceDetailForm.GDStepCode = StringToLable("GDStepCode");
|
|
|
|
|
DeviceDetailForm.GDTotalTime = StringToLable("GDTotalTime");
|
|
|
|
|
DeviceDetailForm.GDStepTime = StringToLable("GDStepTime");
|
|
|
|
|
DeviceDetailForm.GDSpeed = StringToLable("GDSpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.GEMode = StringToLable("GEMode");
|
|
|
|
|
DeviceDetailForm.GEStatus = StringToLable("GEStatus");
|
|
|
|
|
DeviceDetailForm.GEBatch = StringToLable("GEBatch");
|
|
|
|
|
DeviceDetailForm.GEStep = StringToLable("GEStep");
|
|
|
|
|
DeviceDetailForm.GEStepCode = StringToLable("GEStepCode");
|
|
|
|
|
DeviceDetailForm.GETotalTime = StringToLable("GETotalTime");
|
|
|
|
|
DeviceDetailForm.GEStepTime = StringToLable("GEStepTime");
|
|
|
|
|
DeviceDetailForm.GESpeed = StringToLable("GESpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.GFMode = StringToLable("GFMode");
|
|
|
|
|
DeviceDetailForm.GFStatus = StringToLable("GFStatus");
|
|
|
|
|
DeviceDetailForm.GFBatch = StringToLable("GFBatch");
|
|
|
|
|
DeviceDetailForm.GFStep = StringToLable("GFStep");
|
|
|
|
|
DeviceDetailForm.GFStepCode = StringToLable("GFStepCode");
|
|
|
|
|
DeviceDetailForm.GFTotalTime = StringToLable("GFTotalTime");
|
|
|
|
|
DeviceDetailForm.GFStepTime = StringToLable("GFStepTime");
|
|
|
|
|
DeviceDetailForm.GFSpeed = StringToLable("GFSpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.GGMode = StringToLable("GGMode");
|
|
|
|
|
DeviceDetailForm.GGStatus = StringToLable("GGStatus");
|
|
|
|
|
DeviceDetailForm.GGBatch = StringToLable("GGBatch");
|
|
|
|
|
DeviceDetailForm.GGStep = StringToLable("GGStep");
|
|
|
|
|
DeviceDetailForm.GGStepCode = StringToLable("GGStepCode");
|
|
|
|
|
DeviceDetailForm.GGTotalTime = StringToLable("GGTotalTime");
|
|
|
|
|
DeviceDetailForm.GGStepTime = StringToLable("GGStepTime");
|
|
|
|
|
DeviceDetailForm.GGSpeed = StringToLable("GGSpeed");
|
|
|
|
|
|
|
|
|
|
DeviceDetailForm.GHMode = StringToLable("GHMode");
|
|
|
|
|
DeviceDetailForm.GHStatus = StringToLable("GHStatus");
|
|
|
|
|
DeviceDetailForm.GHBatch = StringToLable("GHBatch");
|
|
|
|
|
DeviceDetailForm.GHStep = StringToLable("GHStep");
|
|
|
|
|
DeviceDetailForm.GHStepCode = StringToLable("GHStepCode");
|
|
|
|
|
DeviceDetailForm.GHTotalTime = StringToLable("GHTotalTime");
|
|
|
|
|
DeviceDetailForm.GHStepTime = StringToLable("GHStepTime");
|
|
|
|
|
DeviceDetailForm.GHSpeed = StringToLable("GHSpeed");
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
Controls = GetAllControls();
|
|
|
|
|
|
|
|
|
|
SetControl();
|
|
|
|
@ -859,6 +1075,11 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
timer.Enabled = true;
|
|
|
|
|
timer.Tick += GetPlcValue;//添加事件
|
|
|
|
|
|
|
|
|
|
timer1 = new Timer();
|
|
|
|
|
timer1.Interval = 2000;
|
|
|
|
|
timer1.Enabled = true;
|
|
|
|
|
timer1.Tick += new EventHandler(GetDataFromPLCToForm);//添加事件
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -2180,7 +2401,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 控件交互
|
|
|
|
|
#region 图像控件交互
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 看门狗
|
|
|
|
@ -2430,5 +2651,357 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 报表数据处理 控件交互
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 从Plc读取数据在lable上显示
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="source"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
public void GetDataFromPLCToForm(object source, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (GetAllDbMCControlsByOption(DbOptionTypes.InitData).Count == 0)
|
|
|
|
|
{
|
|
|
|
|
timer1.Stop();
|
|
|
|
|
timer1.Dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.Data.DataTable AlarmTable = DBHelp.GetTable(@"SELECT
|
|
|
|
|
t2.Alarm_ID,
|
|
|
|
|
t2.Alarm_Other_Info,
|
|
|
|
|
t2.Alarm_Block,
|
|
|
|
|
t2.Alarm_Word,
|
|
|
|
|
t2.Alarm_Bit,
|
|
|
|
|
t1.Alarm_OccurTime
|
|
|
|
|
FROM
|
|
|
|
|
LR_Alarmlog t1
|
|
|
|
|
LEFT JOIN Pmt_Alarm t2 ON t1.Alarm_ID = t2.Alarm_ID
|
|
|
|
|
WHERE
|
|
|
|
|
t1.Alarm_Status = 1
|
|
|
|
|
ORDER BY
|
|
|
|
|
t1.Alarm_OccurTime desc");
|
|
|
|
|
|
|
|
|
|
if (this.AlarmForm != null && this.AlarmForm.BaseControl != null)
|
|
|
|
|
{
|
|
|
|
|
this.AlarmForm.BaseControl.BindDataSource = null;
|
|
|
|
|
this.AlarmForm.BaseControl.BindDataSource = AlarmTable;
|
|
|
|
|
//DBLog("成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.Data.DataTable parametersWithPCTable = DBHelp.GetTable("select Id, mode, status, batch, step, stepName, totalTime, stepTime, temperature, speed, currnet, pressure from ParametersWithPC");
|
|
|
|
|
|
|
|
|
|
foreach (DataRow row in parametersWithPCTable.Rows)
|
|
|
|
|
{
|
|
|
|
|
string id = row["Id"].ToString();
|
|
|
|
|
System.Drawing.Color modeColor = System.Drawing.Color.White;
|
|
|
|
|
string mode;
|
|
|
|
|
if ((bool)row["mode"])
|
|
|
|
|
{
|
|
|
|
|
mode = "自动";
|
|
|
|
|
modeColor = System.Drawing.Color.Green;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
mode = "手动";
|
|
|
|
|
modeColor = System.Drawing.Color.Yellow;
|
|
|
|
|
}
|
|
|
|
|
string status;
|
|
|
|
|
System.Drawing.Color statusColor = System.Drawing.Color.White;
|
|
|
|
|
if ((bool)row["status"])
|
|
|
|
|
{
|
|
|
|
|
status = "运行";
|
|
|
|
|
statusColor = System.Drawing.Color.Green;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
status = "空闲";
|
|
|
|
|
statusColor = System.Drawing.Color.Yellow;
|
|
|
|
|
}
|
|
|
|
|
int batch = (int)row["batch"];
|
|
|
|
|
int step = (int)row["step"];
|
|
|
|
|
string stepName = Convert.ToString(row["stepName"]);
|
|
|
|
|
int totalTime = (int)row["totalTime"];
|
|
|
|
|
int stepTime = (int)row["stepTime"];
|
|
|
|
|
float speed = (float)Math.Round(Convert.ToSingle(row["speed"]), 2);
|
|
|
|
|
float current = (float)Math.Round(Convert.ToSingle(row["currnet"]), 2);
|
|
|
|
|
float pressure = (float)Math.Round(Convert.ToSingle(row["pressure"]), 2);
|
|
|
|
|
|
|
|
|
|
#region 控件赋值
|
|
|
|
|
switch (id)
|
|
|
|
|
{
|
|
|
|
|
case "Dryer0":
|
|
|
|
|
this.DeviceDetailForm.DAMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.DAMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.DAStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.DAStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.DABatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.DAStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.DAStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.DATotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.DAStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.DASpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Dryer1":
|
|
|
|
|
this.DeviceDetailForm.DBMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.DBMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.DBStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.DBStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.DBBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.DBStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.DBStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.DBTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.DBStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.DBSpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Dryer2":
|
|
|
|
|
this.DeviceDetailForm.DCMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.DCMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.DCStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.DCStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.DCBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.DCStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.DCStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.DCTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.DCStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.DCSpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Dryer3":
|
|
|
|
|
this.DeviceDetailForm.DDMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.DDMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.DDStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.DDStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.DDBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.DDStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.DDStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.DDTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.DDStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.DDSpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Weter0":
|
|
|
|
|
this.DeviceDetailForm.WAMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.WAMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.WAStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.WAStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.WABatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.WAStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.WAStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.WATotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.WAStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.WASpeed.MCValue = speed;
|
|
|
|
|
this.DeviceDetailForm.WACurrent.MCValue = current;
|
|
|
|
|
this.DeviceDetailForm.WAPressure.MCValue = pressure;
|
|
|
|
|
break;
|
|
|
|
|
case "Weter1":
|
|
|
|
|
this.DeviceDetailForm.WBMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.WBMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.WBStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.WBStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.WBBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.WBStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.WBStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.WBTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.WBStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.WBSpeed.MCValue = speed;
|
|
|
|
|
this.DeviceDetailForm.WBCurrent.MCValue = current;
|
|
|
|
|
this.DeviceDetailForm.WBPressure.MCValue = pressure;
|
|
|
|
|
break;
|
|
|
|
|
case "Weter2":
|
|
|
|
|
this.DeviceDetailForm.WCMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.WCMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.WCStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.WCStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.WCBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.WCStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.WCStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.WCTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.WCStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.WCSpeed.MCValue = speed;
|
|
|
|
|
this.DeviceDetailForm.WCCurrent.MCValue = current;
|
|
|
|
|
this.DeviceDetailForm.WCPressure.MCValue = pressure;
|
|
|
|
|
break;
|
|
|
|
|
case "Weter3":
|
|
|
|
|
this.DeviceDetailForm.WDMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.WDMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.WDStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.WDStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.WDBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.WDStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.WDStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.WDTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.WDStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.WDSpeed.MCValue = speed;
|
|
|
|
|
this.DeviceDetailForm.WDCurrent.MCValue = current;
|
|
|
|
|
this.DeviceDetailForm.WDPressure.MCValue = pressure;
|
|
|
|
|
break;
|
|
|
|
|
case "Weter4":
|
|
|
|
|
this.DeviceDetailForm.WEMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.WEMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.WEStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.WEStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.WEBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.WEStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.WEStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.WETotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.WEStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.WESpeed.MCValue = speed;
|
|
|
|
|
this.DeviceDetailForm.WECurrent.MCValue = current;
|
|
|
|
|
this.DeviceDetailForm.WEPressure.MCValue = pressure;
|
|
|
|
|
break;
|
|
|
|
|
case "Weter5":
|
|
|
|
|
this.DeviceDetailForm.WFMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.WFMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.WFStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.WFStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.WFBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.WFStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.WFStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.WFTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.WFStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.WFSpeed.MCValue = speed;
|
|
|
|
|
this.DeviceDetailForm.WFCurrent.MCValue = current;
|
|
|
|
|
this.DeviceDetailForm.WFPressure.MCValue = pressure;
|
|
|
|
|
break;
|
|
|
|
|
case "Weter6":
|
|
|
|
|
this.DeviceDetailForm.WGMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.WGMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.WGStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.WGStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.WGBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.WGStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.WGStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.WGTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.WGStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.WGSpeed.MCValue = speed;
|
|
|
|
|
this.DeviceDetailForm.WGCurrent.MCValue = current;
|
|
|
|
|
this.DeviceDetailForm.WGPressure.MCValue = pressure;
|
|
|
|
|
break;
|
|
|
|
|
case "Weter7":
|
|
|
|
|
this.DeviceDetailForm.WHMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.WHMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.WHStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.WHStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.WHBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.WHStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.WHStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.WHTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.WHStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.WHSpeed.MCValue = speed;
|
|
|
|
|
this.DeviceDetailForm.WHCurrent.MCValue = current;
|
|
|
|
|
this.DeviceDetailForm.WHPressure.MCValue = pressure;
|
|
|
|
|
break;
|
|
|
|
|
case "Gelater0":
|
|
|
|
|
this.DeviceDetailForm.GAMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.GAMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.GAStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.GAStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.GABatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.GAStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.GAStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.GATotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.GAStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.GASpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Gelater1":
|
|
|
|
|
this.DeviceDetailForm.GBMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.GBMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.GBStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.GBStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.GBBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.GBStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.GBStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.GBTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.GBStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.GBSpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Gelater2":
|
|
|
|
|
this.DeviceDetailForm.GCMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.GCMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.GCStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.GCStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.GCBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.GCStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.GCStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.GCTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.GCStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.GCSpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Gelater3":
|
|
|
|
|
this.DeviceDetailForm.GDMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.GDMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.GDStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.GDStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.GDBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.GDStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.GDStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.GDTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.GDStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.GDSpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Gelater4":
|
|
|
|
|
this.DeviceDetailForm.GEMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.GEMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.GEStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.GEStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.GEBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.GEStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.GEStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.GETotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.GEStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.GESpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Gelater5":
|
|
|
|
|
this.DeviceDetailForm.GFMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.GFMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.GFStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.GFStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.GFBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.GFStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.GFStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.GFTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.GFStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.GFSpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Gelater6":
|
|
|
|
|
this.DeviceDetailForm.GGMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.GGMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.GGStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.GGStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.GGBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.GGStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.GGStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.GGTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.GGStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.GGSpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
case "Gelater7":
|
|
|
|
|
this.DeviceDetailForm.GHMode.MCValue = mode;
|
|
|
|
|
this.DeviceDetailForm.GHMode.ForeColor = modeColor;
|
|
|
|
|
this.DeviceDetailForm.GHStatus.MCValue = status;
|
|
|
|
|
this.DeviceDetailForm.GHStatus.ForeColor = statusColor;
|
|
|
|
|
this.DeviceDetailForm.GHBatch.MCValue = batch;
|
|
|
|
|
this.DeviceDetailForm.GHStep.MCValue = step;
|
|
|
|
|
this.DeviceDetailForm.GHStepCode.MCValue = stepName;
|
|
|
|
|
this.DeviceDetailForm.GHTotalTime.MCValue = totalTime;
|
|
|
|
|
this.DeviceDetailForm.GHStepTime.MCValue = stepTime;
|
|
|
|
|
this.DeviceDetailForm.GHSpeed.MCValue = speed;
|
|
|
|
|
break;
|
|
|
|
|
default: break;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MCLabel StringToLable(string lableName)
|
|
|
|
|
{
|
|
|
|
|
return McControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == lableName).FirstOrDefault().BaseControl as MCLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|