|
|
|
@ -25,6 +25,7 @@ using Mesnac.Basic;
|
|
|
|
|
using Mesnac.Codd.Session;
|
|
|
|
|
using Mesnac.Controls.Base;
|
|
|
|
|
using Mesnac.Controls.ChemicalWeighing;
|
|
|
|
|
using Mesnac.Controls.ChemicalWeighing.HslCurve;
|
|
|
|
|
using Mesnac.Controls.Default;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -40,14 +41,42 @@ namespace Mesnac.Action.ChemicalWeighing.Test
|
|
|
|
|
|
|
|
|
|
HslMoveText hslMove;
|
|
|
|
|
MultiCurve MultiCurve1;
|
|
|
|
|
HslCurve PressureCurve;
|
|
|
|
|
double a = 0;
|
|
|
|
|
int count = 0;
|
|
|
|
|
public void theout(object source, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
a += 1;
|
|
|
|
|
//LoggingService<TestAction>.InfoFormatted("定时器开始运行");
|
|
|
|
|
//ReportReadDb.ReadReport();
|
|
|
|
|
MultiCurve1.PointValue1 = Math.Sqrt(Math.Abs(Math.Sin(a))) + Math.Sqrt(Math.Abs(Math.Cos(a)));
|
|
|
|
|
MultiCurve1.PointValue2 = Math.Sqrt(Math.Abs(Math.Sin(a))) - Math.Sqrt(Math.Abs(Math.Cos(a)));
|
|
|
|
|
//MultiCurve1.PointValue1 = Math.Sqrt(Math.Abs(Math.Sin(a))) + Math.Sqrt(Math.Abs(Math.Cos(a)));
|
|
|
|
|
//MultiCurve1.PointValue2 = Math.Sqrt(Math.Abs(Math.Sin(a))) - Math.Sqrt(Math.Abs(Math.Cos(a)));
|
|
|
|
|
a++;
|
|
|
|
|
if (a > 200 && a < 400)
|
|
|
|
|
{
|
|
|
|
|
this.PressureCurve.ReferenceAxisLeft.Max = 500;
|
|
|
|
|
}
|
|
|
|
|
else if (a > 400)
|
|
|
|
|
{
|
|
|
|
|
this.PressureCurve.ReferenceAxisLeft.Max = 200;
|
|
|
|
|
}
|
|
|
|
|
var random = new
|
|
|
|
|
Random();
|
|
|
|
|
this.count++;
|
|
|
|
|
float num = (float)(Math.Sin(6.283185307179586 * (double)this.count / 30.0) * 0.5 + 0.5);
|
|
|
|
|
float num2 = (float)(Math.Sin(6.283185307179586 * (double)this.count / 50.0) * 0.5 + 0.5);
|
|
|
|
|
float num3 = (float)(Math.Cos(6.283185307179586 * (double)this.count / 80.0) * 0.5 + 0.5);
|
|
|
|
|
this.PressureCurve.AddCurveData(new string[]
|
|
|
|
|
{
|
|
|
|
|
"A",
|
|
|
|
|
"B",
|
|
|
|
|
"C"
|
|
|
|
|
}, new float[]
|
|
|
|
|
{
|
|
|
|
|
num * 10f + 80f,
|
|
|
|
|
num2 * 20f + 50f,
|
|
|
|
|
num2 * 10f
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -59,9 +88,23 @@ namespace Mesnac.Action.ChemicalWeighing.Test
|
|
|
|
|
|
|
|
|
|
hslMove = allDb.FirstOrDefault(x => x.Name == "HslMoveText1") as HslMoveText;
|
|
|
|
|
MultiCurve1 = allDb.FirstOrDefault(x => x.Name == "MultiCurve1") as MultiCurve;
|
|
|
|
|
|
|
|
|
|
PressureCurve = allDb.FirstOrDefault(x => x.Name == "PressureCurve") as HslCurve;
|
|
|
|
|
//MultiCurve1.AxesAuto = true;
|
|
|
|
|
|
|
|
|
|
this.PressureCurve.ColorDashLines = Color.LightGray;
|
|
|
|
|
this.PressureCurve.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
|
|
|
this.PressureCurve.FontCalibration = new Font("微软雅黑", 9f);
|
|
|
|
|
this.PressureCurve.IsRenderRightCoordinate = false;
|
|
|
|
|
//this.PressureCurve.ReferenceAxisLeft.Color = Color.FromArgb(255, 128, 0);
|
|
|
|
|
this.PressureCurve.ReferenceAxisLeft.Unit = "℃";
|
|
|
|
|
//this.PressureCurve.ReferenceAxisLeft.Max = 500;
|
|
|
|
|
//this.PressureCurve.ReferenceAxisLeft.Min = 0;
|
|
|
|
|
this.PressureCurve.TabIndex = 2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.PressureCurve.SetLeftCurve("A", null, Color.DodgerBlue);
|
|
|
|
|
this.PressureCurve.SetLeftCurve("B", null, Color.DarkOrange);
|
|
|
|
|
this.PressureCurve.SetLeftCurve("C", null, Color.LimeGreen);
|
|
|
|
|
|
|
|
|
|
this.hslMove.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
|
|
|
|
|
this.hslMove.BackColor = Color.FromArgb(128, 128, 255);
|
|
|
|
@ -76,7 +119,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test
|
|
|
|
|
this.hslMove.Text = @"公告:这是一条测试的公告信息";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mCButton.Click += MCButton_Click;
|
|
|
|
|
//mCButton.Click += MCButton_Click;
|
|
|
|
|
|
|
|
|
|
System.Timers.Timer t = new System.Timers.Timer(1000);//实例化Timer类,设置间隔时间为10000毫秒;
|
|
|
|
|
t.Elapsed += new System.Timers.ElapsedEventHandler(theout);//到达时间的时候执行事件;
|
|
|
|
|