发送停止保温

dep_yangw
我叫锄头 10 months ago
parent 3987a126d1
commit c61055ba0d

@ -100,7 +100,7 @@ namespace ProductionSystem.Untils.Tool
} }
public void Send() public string GetMsg(int num)
{ {
uint seep = uint.Parse((mo * 0.4).ToString()); uint seep = uint.Parse((mo * 0.4).ToString());
Write = seep.ToString(); Write = seep.ToString();
@ -109,8 +109,13 @@ namespace ProductionSystem.Untils.Tool
MFMsgVariable me = new MFMsgVariable(8); MFMsgVariable me = new MFMsgVariable(8);
me.AddMotoralaLsb(0, 8, seep); me.AddMotoralaLsb(0, 8, seep);
var by = me.GetByteDat(); return me.GetByteDat().ToHex();
var sendMes = by.ToHex(" "); }
public void Send()
{
var sendMes = GetMsg(mo);
Task.Run(() => Task.Run(() =>
{ {
@ -128,7 +133,12 @@ namespace ProductionSystem.Untils.Tool
public void closeSend() public void closeSend()
{ {
Exit = true; Exit = true;
Thread.Sleep(1000); var sendMes = GetMsg(0);
for (int i = 0; i < 100; i++)
{
mfSerialInfo.SendMessage(sendMes);
}
Exit = true; Exit = true;
Dispose(); Dispose();
} }

@ -105,15 +105,8 @@ namespace ProductionSystem.Untils.Tool
public void Send() public void Send()
{ {
uint seep = uint.Parse((mo * 0.4).ToString());
Write = seep.ToString();
XTrace.WriteLine($"水泵Uy 第[{mo}-{com}]个 写入真实速度:{seep}");
MFMsgVariable me = new MFMsgVariable(8); var sendMes = GetMsg(mo);
me.AddMotoralaLsb(8, 8, seep);
var by = me.GetByteDat();
var sendMes = by.ToHex(" ");
Task.Run(() => Task.Run(() =>
{ {
@ -126,10 +119,29 @@ namespace ProductionSystem.Untils.Tool
} }
public string GetMsg(int num)
{
uint seep = uint.Parse((num * 0.4).ToString());
Write = seep.ToString();
XTrace.WriteLine($"水泵Uy 第[{mo}-{com}]个 写入真实速度:{seep}");
MFMsgVariable me = new MFMsgVariable(8);
me.AddMotoralaLsb(8, 8, seep);
var by = me.GetByteDat();
var sendMes = by.ToHex(" ");
return sendMes;
}
public void closeSend() public void closeSend()
{ {
Exit = true; Exit = true;
Thread.Sleep(1000); var sendMes = GetMsg(0);
for (int i = 0; i < 100; i++)
{
mfSerialInfo.SendMessage(sendMes);
}
Exit = true; Exit = true;
Dispose(); Dispose();
} }

Loading…
Cancel
Save