change - 修改Ip错误

dep_deliver
wangsr 1 year ago
parent 72a9fd96b2
commit 5fd498b56f

@ -166,7 +166,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
#region plc读取前端控件值写入
private void DB1GetData()
{
PlcTemp.PR1ASI01_Set = DB1.PR1ASI01.ACT_VALUE;

@ -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);//到达时间的时候执行事件;

@ -26,7 +26,7 @@ namespace DataBlockHelper
s7.IpAddress = "192.168.1.110";
//配料IP
//s7.IpAddress = "127.18.4.100";
//s7.IpAddress = "172.18.4.100";
s7.Port = 102;
var su = s7.ConnectServer();

@ -2,7 +2,7 @@
<Object type="Mesnac.Gui.Common.FrmRunTemplate, Mesnac.Gui.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Form1" children="Controls">
<Object type="System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Panel1" children="Controls">
<Object type="Mesnac.Controls.ChemicalWeighing.HslCurve.HslCurve, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="PressureCurve" children="Controls">
<Property name="Location">225, 614</Property>
<Property name="Location">257, 624</Property>
<Property name="Name">PressureCurve</Property>
<Property name="Size">777, 314</Property>
</Object>

Loading…
Cancel
Save