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

88 lines
2.6 KiB
C#

using System;
using System.Collections.Generic;
1 year ago
using System.Data;
using System.Diagnostics;
12 months ago
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using DataBlockHelper.DBHelpers;
using DevExpress.XtraEditors.Filtering.Templates;
using ICSharpCode.Core;
using log4net;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
using Mesnac.Action.ChemicalWeighing.MinAn;
using Mesnac.Action.ChemicalWeighing.Report;
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
{
MCButton mCButton;
12 months ago
// LoggingService<TestAction> _log;
HslMoveText hslMove;
public void theout(object source, EventArgs e)
1 year ago
{
1 year ago
1 year ago
}
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
var allDb = GetAllControls();
mCButton = allDb.FirstOrDefault(x => x.Name == "MCButton1") as MCButton;
hslMove = allDb.FirstOrDefault(x => x.Name == "HslMoveText1") as HslMoveText;
12 months ago
this.hslMove.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
this.hslMove.BackColor = Color.FromArgb(128, 128, 255);
this.hslMove.Font = new Font("楷体", 15f, FontStyle.Regular, GraphicsUnit.Point, 134);
this.hslMove.ForeColor = Color.Yellow;
12 months ago
this.hslMove.Margin = new Padding(5, 6, 5, 6);
this.hslMove.MoveSpeed = 20f;
12 months ago
this.hslMove.Size = new Size(726, 49);
this.hslMove.TabIndex = 8;
this.hslMove.Text = @"公告这是一条测试的公告信息11111111111111111111111111111111111111111111111111111111111" +
"1111111111111112312321" +
"3213213213213" +
"3213333333333333333311111。";
12 months ago
12 months ago
mCButton.Click += MCButton_Click;
System.Timers.Timer t = new System.Timers.Timer(5000);//实例化Timer类设置间隔时间为10000毫秒
t.Elapsed += new System.Timers.ElapsedEventHandler(theout);//到达时间的时候执行事件;
t.AutoReset = true;//设置是执行一次false还是一直执行(true)
t.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件
1 year ago
}
12 months ago
private void MCButton_Click(object sender, EventArgs e)
{
ReportReadDb.Read();
}
}
}