|
|
@ -12,6 +12,7 @@ using ICSharpCode.Core;
|
|
|
|
using Mesnac.Action.Base;
|
|
|
|
using Mesnac.Action.Base;
|
|
|
|
|
|
|
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
|
|
|
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.MinAn;
|
|
|
|
using Mesnac.Basic;
|
|
|
|
using Mesnac.Basic;
|
|
|
|
using Mesnac.Codd.Session;
|
|
|
|
using Mesnac.Codd.Session;
|
|
|
|
using Mesnac.Controls.Base;
|
|
|
|
using Mesnac.Controls.Base;
|
|
|
@ -29,47 +30,25 @@ namespace Mesnac.Action.ChemicalWeighing.Test
|
|
|
|
public void timer1EventProcessor(object source, EventArgs e)
|
|
|
|
public void timer1EventProcessor(object source, EventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
OpenDoorService.Insert(new OpenDoorEntity()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DeviceId = 0,
|
|
|
|
|
|
|
|
OpenTime = DateTime.Now,
|
|
|
|
|
|
|
|
CreateTime = DateTime.Now,
|
|
|
|
|
|
|
|
Status = 0
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
base.RunIni(runtime); //必须调用
|
|
|
|
|
|
|
|
var allDb=GetAllControls();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
|
|
|
|
DialogResult result =
|
|
|
|
if (dbHelper == null)
|
|
|
|
MessageBox.Show("正在上料", "温馨提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
|
|
|
|
|
if (result == DialogResult.OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// dbHelper.ClearParameter();
|
|
|
|
|
|
|
|
// dbHelper.CommandType = CommandType.Text;
|
|
|
|
|
|
|
|
// dbHelper.CommandText = sql;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int[] ssss = new int [] { };
|
|
|
|
string a = MinAnPlc.Heir1.ToString();
|
|
|
|
var ss2s = BasePlcHelper.Instance.PlcReadByRunName("BU1BLT01_Set", out ssss);
|
|
|
|
string b = MinAnPlc.Heir2.ToString();
|
|
|
|
|
|
|
|
string c = MinAnPlc.Heir3.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Timer timer1 = new Timer();
|
|
|
|
|
|
|
|
timer1.Interval = 1000;
|
|
|
|
|
|
|
|
timer1.Enabled = true;
|
|
|
|
|
|
|
|
timer1.Tick += new EventHandler(timer1EventProcessor);//添加事件
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
base.RunIni(runtime); //必须调用
|
|
|
|
|
|
|
|
var allDb=GetAllControls();
|
|
|
|
mCButton = allDb.FirstOrDefault(x => x.Name == "MCButton1") as MCButton;
|
|
|
|
mCButton = allDb.FirstOrDefault(x => x.Name == "MCButton1") as MCButton;
|
|
|
|
|
|
|
|
|
|
|
|
mCButton.Click += new EventHandler(timer1EventProcessor);
|
|
|
|
mCButton.Click += new EventHandler(timer1EventProcessor);
|
|
|
|