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

94 lines
2.4 KiB
C#

using System;
using System.Collections.Generic;
1 year ago
using System.Data;
using System.Diagnostics;
1 year ago
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DataBlockHelper.DBHelpers;
using DevExpress.XtraEditors.Filtering.Templates;
using ICSharpCode.Core;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
using Mesnac.Action.ChemicalWeighing.MinAn;
using Mesnac.Action.ChemicalWeighing.RgvPlc;
using Mesnac.Basic;
1 year ago
using Mesnac.Codd.Session;
using Mesnac.Controls.Base;
using Mesnac.Controls.ChemicalWeighing;
using Mesnac.Controls.Default;
1 year ago
namespace Mesnac.Action.ChemicalWeighing.Test
{
public class TestAction : DatabaseAction, IAction
{
HslLanternAlarm lanternAlarm;
MCButton mCButton;
HslSwitch hslSwitch;
HslLedDisplay hslLed;
1 year ago
public void timer1EventProcessor(object source, EventArgs e)
{
1 year ago
hslLed.DisplayText = DateTime.Now.ToString("mm:ss");
1 year ago
}
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
var allDb=GetAllControls();
mCButton = allDb.FirstOrDefault(x => x.Name == "MCButton1") as MCButton;
mCButton.Click += new EventHandler(timer1EventProcessor);
1 year ago
hslSwitch = allDb.FirstOrDefault(x => x.Name == "HsSwitch1") as HslSwitch;
hslSwitch.OnSwitchChanged += HslSwitch_OnSwitchChanged;
1 year ago
1 year ago
hslLed= allDb.FirstOrDefault(x => x.Name == "HslLedDisplay1") as HslLedDisplay;
1 year ago
hslLed.LeftRightOffect = 0;
this.hslLed.BackColor = Color.FromArgb(46, 46, 46);
this.hslLed.DisplayBackColor = Color.FromArgb(62, 62, 62);
this.hslLed.DisplayNumber = 5;
this.hslLed.DisplayText = "12:00";
this.hslLed.ForeColor = Color.Pink;
this.hslLed.LedNumberSize = 2;
this.hslLed.Location = new Point(555, 203);
this.hslLed.Margin = new Padding(3, 16, 3, 16);
this.hslLed.Name = "hslLedDisplay12";
this.hslLed.Size = new Size(113, 33);
this.hslLed.TabIndex = 8;
//MCButton1
//OpenDoorService
1 year ago
}
private void HslSwitch_OnSwitchChanged(object arg1, bool arg2)
{
HslSwitch hsl= (HslSwitch)arg1;
hslSwitch.Text = "测试:"+arg2;
bool b = arg2;
}
}
}