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.
lj_plc/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs

105 lines
2.9 KiB
C#

using System;
using System.Collections.Generic;
1 year ago
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors.Filtering.Templates;
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.Entity;
1 year ago
using Mesnac.Action.ChemicalWeighing.FreeDb;
using Mesnac.Action.ChemicalWeighing.LjMetageFormula;
1 year ago
using Mesnac.Action.ChemicalWeighing.LjMixFormula;
1 year ago
using Mesnac.Action.ChemicalWeighing.LjMixManager;
using Mesnac.Action.ChemicalWeighing.LjPlanning;
using Mesnac.Action.ChemicalWeighing.LjProdcutLine;
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
using Mesnac.Basic;
1 year ago
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
using Mesnac.Controls.Default;
1 year ago
namespace Mesnac.Action.ChemicalWeighing.Test
{
public class TestAction : DatabaseAction, IAction
{
1 year ago
MCButton mCButton;
1 year ago
public void timer1EventProcessor(object source, EventArgs e)
{
1 year ago
OpenDoorService.Insert(new OpenDoorEntity()
{
DeviceId = 0,
OpenTime = DateTime.Now,
CreateTime = DateTime.Now,
Status = 0
});
1 year ago
}
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
var allDb=GetAllControls();
1 year ago
<<<<<<< HEAD
//int adsa = BasePlcHelper.Instance.BU1BLT01_Alarm.NowValue.ToInt();
1 year ago
string sql = "insert into ActionCode values (13,'test','',1) select @@IDENTITY";
1 year ago
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
if (dbHelper == null)
{
throw new Exception(Mesnac.Basic.LanguageHelper.DataBaseConnectError);
}
1 year ago
// dbHelper.ClearParameter();
// dbHelper.CommandType = CommandType.Text;
// dbHelper.CommandText = sql;
int[] ssss = new int [] { };
var ss2s = BasePlcHelper.Instance.PlcReadByRunName("BU1BLT01_Set", out ssss);
mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.None);//获取所有待初始化控件
1 year ago
startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "MCLabel153".ToLower()).FirstOrDefault().BaseControl;
Timer timer1 = new Timer();
timer1.Interval = 1000;
timer1.Enabled = true;
timer1.Tick += new EventHandler(timer1EventProcessor);//添加事件
//ParametersWithPc.B1.FirstWord 256 768
//badc1el26587193265870
=======
mCButton = allDb.FirstOrDefault(x => x.Name == "MCButton1") as MCButton;
mCButton.Click += new EventHandler(timer1EventProcessor);
>>>>>>> dep
1 year ago
1 year ago
1 year ago
//MCButton1
//OpenDoorService
1 year ago
}
}
}