|
|
|
@ -27,6 +27,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
DB2103Helper DB2103;
|
|
|
|
|
|
|
|
|
|
List<DbMCControl> McControllist;
|
|
|
|
|
List<DbMCControl> _McControllist;
|
|
|
|
|
|
|
|
|
|
OperateResult<byte[]> Read;
|
|
|
|
|
|
|
|
|
@ -63,6 +64,15 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
IBaseControl SpiralState3;
|
|
|
|
|
IBaseControl SpiralState4;
|
|
|
|
|
|
|
|
|
|
IBaseControl SetWaterValue1;
|
|
|
|
|
IBaseControl SetWaterValue2;
|
|
|
|
|
IBaseControl SetWaterValue3;
|
|
|
|
|
IBaseControl SetWaterValue4;
|
|
|
|
|
IBaseControl SetSpiralValue1;
|
|
|
|
|
IBaseControl SetSpiralValue2;
|
|
|
|
|
IBaseControl SetSpiralValue3;
|
|
|
|
|
IBaseControl SetSpiralValue4;
|
|
|
|
|
|
|
|
|
|
bool State1;
|
|
|
|
|
bool State2;
|
|
|
|
|
byte Byt;
|
|
|
|
@ -76,6 +86,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
base.RunIni(runtime); //必须要调用的
|
|
|
|
|
|
|
|
|
|
McControllist = GetAllDbMCControlsByOption(DbOptionTypes.InitData);
|
|
|
|
|
_McControllist = GetAllDbMCControlsByOption(DbOptionTypes.Modify);
|
|
|
|
|
|
|
|
|
|
WaterActualValue1 = GetBaseControl("WaterActualValue1");
|
|
|
|
|
WaterActualValue2 = GetBaseControl("WaterActualValue2");
|
|
|
|
@ -102,10 +113,30 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
SpiralState3 = GetBaseControl("SpiralState3");
|
|
|
|
|
SpiralState4 = GetBaseControl("SpiralState4");
|
|
|
|
|
|
|
|
|
|
SetWaterValue1 = _GetBaseControl("SetWaterValue1");
|
|
|
|
|
SetWaterValue2 = _GetBaseControl("SetWaterValue2");
|
|
|
|
|
SetWaterValue3 = _GetBaseControl("SetWaterValue3");
|
|
|
|
|
SetWaterValue4 = _GetBaseControl("SetWaterValue4");
|
|
|
|
|
SetSpiralValue1 = _GetBaseControl("SetSpiralValue1");
|
|
|
|
|
SetSpiralValue2 = _GetBaseControl("SetSpiralValue2");
|
|
|
|
|
SetSpiralValue3 = _GetBaseControl("SetSpiralValue3");
|
|
|
|
|
SetSpiralValue4 = _GetBaseControl("SetSpiralValue4");
|
|
|
|
|
|
|
|
|
|
materialGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ManualLogGridView").FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
LogInsertToDatabase();
|
|
|
|
|
|
|
|
|
|
SetWaterValue1.MCValue = Setting.Default.SetWaterValue1;
|
|
|
|
|
SetWaterValue2.MCValue = Setting.Default.SetWaterValue2;
|
|
|
|
|
SetWaterValue3.MCValue = Setting.Default.SetWaterValue3;
|
|
|
|
|
SetWaterValue4.MCValue = Setting.Default.SetWaterValue4;
|
|
|
|
|
SetSpiralValue1.MCValue = Setting.Default.SetSpiralValue1;
|
|
|
|
|
SetSpiralValue2.MCValue = Setting.Default.SetSpiralValue2;
|
|
|
|
|
SetSpiralValue3.MCValue = Setting.Default.SetSpiralValue3;
|
|
|
|
|
SetSpiralValue4.MCValue = Setting.Default.SetSpiralValue4;
|
|
|
|
|
MesnacServiceManager.Instance.LoggingService.Info("配置已加载");
|
|
|
|
|
ManualLogControl("配置已加载 ");
|
|
|
|
|
|
|
|
|
|
timer = new Timer();
|
|
|
|
|
timer.Interval = 1000;
|
|
|
|
|
timer.Enabled = true;
|
|
|
|
@ -356,6 +387,11 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
return McControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == name).FirstOrDefault().BaseControl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IBaseControl _GetBaseControl(string name)
|
|
|
|
|
{
|
|
|
|
|
return _McControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == name).FirstOrDefault().BaseControl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LogInsertToDatabase()
|
|
|
|
|
{
|
|
|
|
|
DataTable table = DBHelp.GetTable(@"select top 100 id, logtext, logtime from Manual_Log order by id desc");
|
|
|
|
@ -370,5 +406,17 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
ICSharpCode.Core.LoggingService<InitAction>.Warn("手动操作日志信息控件为Null...");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ManualLogControl(string logName)
|
|
|
|
|
{
|
|
|
|
|
var Log = new ManualLogEntity()
|
|
|
|
|
{
|
|
|
|
|
logtext = logName,
|
|
|
|
|
logtime = DateTime.Now,
|
|
|
|
|
userid = string.IsNullOrWhiteSpace(UserInfo.Instance.UserName) ? "Edit" : UserInfo.Instance.UserName
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FreeSqlUnit.Instance.Insert<ManualLogEntity>(Log).ExecuteIdentity();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|