整理代码

dep_yangw
yangw 11 months ago
parent 164d304e53
commit 7c53baa698

@ -35,6 +35,7 @@ using SqlSugar;
using ProductionSystem_Model.DbModel;
using NewLife.Reflection;
using System.Collections;
using System.Globalization;
namespace ProductionSystem.Forms
{
@ -737,40 +738,54 @@ namespace ProductionSystem.Forms
step.ProductBarcode = GetCode();
var model = paraConfigService.GetParaTargetVal(ModeTypeEnum.BZ1_DB, Program.ProductType);
Stopwatch stopwatch = new Stopwatch();
// 开始计时
stopwatch.Start();
//四通1
var stf1= model.STF1;
int val = stf1.TargetVal.ToDouble().ToInt();
val = 3;
SitongTool sitongTool = new SitongTool(stf1.Com,val);
var si1 = sitongTool.ToAction();
sitongTool.Dispose();
stopwatch.Stop();
var miao = stopwatch.Elapsed.TotalSeconds;
step.Id = Guid.NewGuid().ToString("N");
step.ReturnValue = sitongTool.Val;
step.WriteValue = val.ToString();
step.CreateTime = DateTime.Now;
step.EquipmentName = "FKSTF1ZT_DB";
step.Ms = miao.ToString(CultureInfo.InvariantCulture);
stepService.AddProductStep(step);
stopwatch.Restart();
// //四通2
// var stf2 = model.STF2;
// sitongTool = new SitongTool(stf2.Com, stf2.TargetVal.ToDouble().ToInt());
// var si2 = sitongTool.ToAction();
// sitongTool.Dispose();
//
// step.Id = Guid.NewGuid().ToString("N");
// step.ReturnValue = sitongTool.Val;
// step.WriteValue = val.ToString();
// step.CreateTime = DateTime.Now;
//
// step.EquipmentName = "FKSTF2ZT_DB";
// stepService.AddProductStep(step);
var stf2 = model.STF2;
sitongTool = new SitongTool(stf2.Com, stf2.TargetVal.ToDouble().ToInt());
// var si2 = sitongTool.ToAction();
sitongTool.Dispose();
step.Id = Guid.NewGuid().ToString("N");
step.ReturnValue = sitongTool.Val;
step.WriteValue = val.ToString();
step.CreateTime = DateTime.Now;
step.EquipmentName = "FKSTF2ZT_DB";
step.Ms = miao.ToString(CultureInfo.InvariantCulture);
stepService.AddProductStep(step);
stopwatch.Stop();
miao = stopwatch.Elapsed.TotalSeconds;
var ss = miao;
//
//
// //// lin 1 com10
// ////1 调试成功
////1 调试成功
//
// //电子膨胀阀
//

@ -27,7 +27,7 @@ namespace ProductionSystem.Untils
{
_mfser.Lin_Open(com, int.Parse(fre));
}
_timer = new TimerX(DoBackup, _mfser, 200, 300) { Async = true };
_timer = new TimerX(DoBackup, _mfser, 100, 200) { Async = true };
@ -81,6 +81,14 @@ namespace ProductionSystem.Untils
public void SendMsg2(string data, int num = 3, int mill = 500)
{
for (int i = 0; i < 8; i++)
{
_mfser.SendMsg(Entrance, data);
Thread.Sleep(500);
}
for (int i = 0; i < num; i++)
{
@ -89,9 +97,7 @@ namespace ProductionSystem.Untils
break;
}
_mfser.SendMsg(Entrance, data);
Thread.Sleep(mill);
_mfser.SendLinMasterSend(Export);
Thread.Sleep(mill);
_mfser.SendLinMasterSend(Export);

@ -145,7 +145,7 @@ namespace ProductionSystem.Untils.Tool
};
mfSerialInfo.SendMsg2(sendMes,50,500);
mfSerialInfo.SendMsg2(sendMes,10,300);
return b;

@ -38,5 +38,8 @@ namespace ProductionSystem_Model.DbModel
[SugarColumn(ColumnName = "product_barcode")]
public string ProductBarcode { get; set; }
[SugarColumn(ColumnName = "ms")]
public string Ms { get; set; }
}
}

Loading…
Cancel
Save