|
|
@@ -21,6 +21,7 @@ using FryPot_DosingSystem.AGV; |
|
|
|
using FryPot_DosingSystem.FryPotStatus; |
|
|
|
using System.IO; |
|
|
|
using System.Runtime.Serialization.Formatters.Binary; |
|
|
|
using System.Diagnostics; |
|
|
|
|
|
|
|
namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
@@ -106,6 +107,11 @@ namespace FryPot_DosingSystem.Control |
|
|
|
bool ErrorRecipe;//线体1错误配方标识 |
|
|
|
bool LTwoErrorRecipe;//线体2错误配方标识 |
|
|
|
bool LThreeErrorRecipe;//线体3错误配方标识 |
|
|
|
string fryOneRecipe = string.Empty; |
|
|
|
string fryTwoRecipe = string.Empty; |
|
|
|
string fryThreeRecipe = string.Empty; |
|
|
|
string fryFourRecipe = string.Empty; |
|
|
|
string fryFiveRecipe = string.Empty; |
|
|
|
#endregion |
|
|
|
#region agv临时变量 |
|
|
|
//bool agvArriveUpLoad = false;//agv是否到达线体1上料位置 |
|
|
@@ -248,6 +254,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
//fryFive = new PotFiveStatus(); |
|
|
|
hardWareStatusModel = HardWareStatusViewModel.GetInstance; |
|
|
|
DateTimeJudge(); |
|
|
|
FileRegClean(); |
|
|
|
ActionManage.GetInstance.Register(new Action<object[]>(RecipeDataParse), "RecipeSetDown"); |
|
|
|
//ActionManage.GetInstance.Register(new Action(() => { RecipeQuene.Clear(); InputMaterialQuene.Clear(); OutputMaterialQuene.Clear(); LTwoInputMaterialQuene.Clear(); LTwoOutputMaterialQuene.Clear(); LThreeInputMaterialQuene.Clear(); LThreeOutputMaterialQuene.Clear(); }), "ClearRecipes"); |
|
|
|
ActionManage.GetInstance.Register(new Action(() => { RecipeQuene.Clear(); InputMaterialQuene.Clear(); OutputMaterialQuene.Clear(); }), "ClearOneRecipes"); |
|
|
@@ -262,58 +269,220 @@ namespace FryPot_DosingSystem.Control |
|
|
|
HubHelper.GetInstance.Upstreamrequest = new Action<object>(AgvFeedBackUpReportDataAnalysis); |
|
|
|
// ResetProgram(); |
|
|
|
ReadPlcData(); |
|
|
|
SaveFryPotData(); |
|
|
|
MainTask(); |
|
|
|
CommandRegist(); |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 时间判断,数据处理 |
|
|
|
/// 文件数据定期清理 |
|
|
|
/// </summary> |
|
|
|
private void DateTimeJudge() |
|
|
|
/// <exception cref="NotImplementedException"></exception> |
|
|
|
private void FileRegClean() |
|
|
|
{ |
|
|
|
if (Sqlite<PotOneStatus>.GetInstance.GetData().Count > 0) |
|
|
|
string[] filesOne = Directory.GetFiles("AccessFile//DB//炒锅1状态数据"); |
|
|
|
if (filesOne.Count() > 0) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
string[] filesTwo = Directory.GetFiles("AccessFile//DB//炒锅2状态数据"); |
|
|
|
if (filesTwo.Count() > 0) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
string[] filesThree = Directory.GetFiles("AccessFile//DB//炒锅3状态数据"); |
|
|
|
if (filesThree.Count() > 0) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
string[] filesFour = Directory.GetFiles("AccessFile//DB//炒锅4状态数据"); |
|
|
|
if (filesFour.Count() > 0) |
|
|
|
{ |
|
|
|
string time1 = Sqlite<PotOneStatus>.GetInstance.GetData().Last().Time; |
|
|
|
if (time1.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
|
|
|
|
} |
|
|
|
string[] filesFive = Directory.GetDirectories("AccessFile//DB//炒锅5状态数据"); |
|
|
|
if (filesFive.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var item in filesFive) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy = Sqlite<PotOneStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
FryPotMonitorManage.GetInstance.fryOne.TotalProduct = Sqlite<PotOneStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
FileInfo info = new FileInfo(item); |
|
|
|
DateTime createTime = info.CreationTime; |
|
|
|
DateTime timeNow = DateTime.Now; |
|
|
|
if (TimeDiff(timeNow, createTime) != 0 && TimeDiff(timeNow, createTime) > 30) |
|
|
|
{ |
|
|
|
Directory.Delete(item); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (Sqlite<PotTwoStatus>.GetInstance.GetData().Count > 0) |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 时间差计算 |
|
|
|
/// </summary> |
|
|
|
/// <param name="t">当前时间</param> |
|
|
|
/// <param name="t2">创建时间</param> |
|
|
|
/// <returns></returns> |
|
|
|
private int TimeDiff(DateTime t, DateTime t2) |
|
|
|
{ |
|
|
|
long lReturn = -1; |
|
|
|
System.TimeSpan NowValue = new TimeSpan(t.Ticks); |
|
|
|
System.TimeSpan TimeValue = new TimeSpan(t2.Ticks); |
|
|
|
System.TimeSpan DateDiff = TimeSpan.Zero; |
|
|
|
try |
|
|
|
{ |
|
|
|
//计算时间差 |
|
|
|
//DateDiff = TimeValue.Subtract(NowValue).Duration(); |
|
|
|
DateDiff = NowValue.Subtract(TimeValue); |
|
|
|
int h= DateDiff.Hours; |
|
|
|
int m= DateDiff.Minutes; |
|
|
|
return DateDiff.Days; |
|
|
|
} |
|
|
|
catch |
|
|
|
{ |
|
|
|
string time2 = Sqlite<PotTwoStatus>.GetInstance.GetData().Last().Time; |
|
|
|
if (time2.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 炒锅数据实时保存 |
|
|
|
/// </summary> |
|
|
|
/// <exception cref="NotImplementedException"></exception> |
|
|
|
private void SaveFryPotData() |
|
|
|
{ |
|
|
|
Task.Run(new Action(() => |
|
|
|
{ |
|
|
|
while (true) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy = Sqlite<PotTwoStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
FryPotMonitorManage.GetInstance.fryTwo.TotalProduct = Sqlite<PotTwoStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
FryPotDataSaveToBinaryFile(); Thread.Sleep(1000); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 时间判断,数据处理 |
|
|
|
/// </summary> |
|
|
|
private void DateTimeJudge() |
|
|
|
{ |
|
|
|
#region sqlite数据库保存 |
|
|
|
//if (Sqlite<PotOneStatus>.GetInstance.GetData().Count > 0) |
|
|
|
//{ |
|
|
|
// string time1 = Sqlite<PotOneStatus>.GetInstance.GetData().Last().Time; |
|
|
|
// if (time1.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
// { |
|
|
|
// FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy = Sqlite<PotOneStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
// FryPotMonitorManage.GetInstance.fryOne.TotalProduct = Sqlite<PotOneStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
// } |
|
|
|
//} |
|
|
|
//if (Sqlite<PotTwoStatus>.GetInstance.GetData().Count > 0) |
|
|
|
//{ |
|
|
|
// string time2 = Sqlite<PotTwoStatus>.GetInstance.GetData().Last().Time; |
|
|
|
// if (time2.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
// { |
|
|
|
// FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy = Sqlite<PotTwoStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
// FryPotMonitorManage.GetInstance.fryTwo.TotalProduct = Sqlite<PotTwoStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
// } |
|
|
|
//} |
|
|
|
//if (Sqlite<PotThreeStatus>.GetInstance.GetData().Count > 0) |
|
|
|
//{ |
|
|
|
// string time3 = Sqlite<PotThreeStatus>.GetInstance.GetData().Last().Time; |
|
|
|
// if (time3.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
// { |
|
|
|
// FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy = Sqlite<PotThreeStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
// FryPotMonitorManage.GetInstance.fryThree.TotalProduct = Sqlite<PotThreeStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
// } |
|
|
|
//} |
|
|
|
//if (Sqlite<PotFourStatus>.GetInstance.GetData().Count > 0) |
|
|
|
//{ |
|
|
|
// string time4 = Sqlite<PotFourStatus>.GetInstance.GetData().Last().Time; |
|
|
|
// if (time4.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
// { |
|
|
|
// FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy = Sqlite<PotFourStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
// FryPotMonitorManage.GetInstance.fryFour.TotalProduct = Sqlite<PotFourStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
// } |
|
|
|
//} |
|
|
|
|
|
|
|
//if (Sqlite<PotFiveStatus>.GetInstance.GetData().Count > 0) |
|
|
|
//{ |
|
|
|
// string time5 = Sqlite<PotFiveStatus>.GetInstance.GetData().Last().Time; |
|
|
|
// if (time5.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
// { |
|
|
|
// FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy = Sqlite<PotFiveStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
// FryPotMonitorManage.GetInstance.fryFive.TotalProduct = Sqlite<PotFiveStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
// } |
|
|
|
//} |
|
|
|
#endregion |
|
|
|
string p1 = "AccessFile//" + "Statistic//" + "FryOne.txt"; |
|
|
|
string p2 = "AccessFile//" + "Statistic//" + "FryTwo.txt"; |
|
|
|
string p3 = "AccessFile//" + "Statistic//" + "FryThree.txt"; |
|
|
|
string p4 = "AccessFile//" + "Statistic//" + "FryFour.txt"; |
|
|
|
string p5 = "AccessFile//" + "Statistic//" + "FryFive.txt"; |
|
|
|
if (!Directory.Exists("AccessFile//" + "Statistic")) |
|
|
|
Directory.CreateDirectory("AccessFile//" + "Statistic"); |
|
|
|
if (File.Exists(p1)) |
|
|
|
{ |
|
|
|
using (StreamReader sReader = new StreamReader(p1, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
string time = sReader.ReadLine(); |
|
|
|
string statistic = sReader.ReadLine(); |
|
|
|
if (DateTime.Now.ToShortDateString() == time) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryOne.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); |
|
|
|
FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (Sqlite<PotThreeStatus>.GetInstance.GetData().Count > 0) |
|
|
|
if (File.Exists(p2)) |
|
|
|
{ |
|
|
|
string time3 = Sqlite<PotThreeStatus>.GetInstance.GetData().Last().Time; |
|
|
|
if (time3.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
using (StreamReader sReader = new StreamReader(p2, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy = Sqlite<PotThreeStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
FryPotMonitorManage.GetInstance.fryThree.TotalProduct = Sqlite<PotThreeStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
string time = sReader.ReadLine(); |
|
|
|
string statistic = sReader.ReadLine(); |
|
|
|
if (DateTime.Now.ToShortDateString() == time) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryTwo.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); |
|
|
|
FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (Sqlite<PotFourStatus>.GetInstance.GetData().Count > 0) |
|
|
|
if (File.Exists(p3)) |
|
|
|
{ |
|
|
|
string time4 = Sqlite<PotFourStatus>.GetInstance.GetData().Last().Time; |
|
|
|
if (time4.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
using (StreamReader sReader = new StreamReader(p3, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy = Sqlite<PotFourStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
FryPotMonitorManage.GetInstance.fryFour.TotalProduct = Sqlite<PotFourStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
string time = sReader.ReadLine(); |
|
|
|
string statistic = sReader.ReadLine(); |
|
|
|
if (DateTime.Now.ToShortDateString() == time) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryThree.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); |
|
|
|
FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (File.Exists(p4)) |
|
|
|
{ |
|
|
|
using (StreamReader sReader = new StreamReader(p4, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
string time = sReader.ReadLine(); |
|
|
|
string statistic = sReader.ReadLine(); |
|
|
|
if (DateTime.Now.ToShortDateString() == time) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryFour.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); |
|
|
|
FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); |
|
|
|
|
|
|
|
if (Sqlite<PotFiveStatus>.GetInstance.GetData().Count > 0) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (File.Exists(p5)) |
|
|
|
{ |
|
|
|
string time5 = Sqlite<PotFiveStatus>.GetInstance.GetData().Last().Time; |
|
|
|
if (time5.Equals(DateTime.Now.ToShortDateString()))//和当天时间一样 |
|
|
|
using (StreamReader sReader = new StreamReader(p5, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy = Sqlite<PotFiveStatus>.GetInstance.GetData().Last().TotalOilCapactiy; |
|
|
|
FryPotMonitorManage.GetInstance.fryFive.TotalProduct = Sqlite<PotFiveStatus>.GetInstance.GetData().Last().TotalProduct; |
|
|
|
string time = sReader.ReadLine(); |
|
|
|
string statistic = sReader.ReadLine(); |
|
|
|
if (DateTime.Now.ToShortDateString() == time) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryFive.TotalProduct = Convert.ToInt32(statistic.Split('/')[0]); |
|
|
|
FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy = Convert.ToDouble(statistic.Split('/')[1]); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -862,10 +1031,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
} |
|
|
|
//炒锅状态实时显示 |
|
|
|
FryPotStatusDisplay(); |
|
|
|
|
|
|
|
|
|
|
|
RollerLineStatusDisplay(); |
|
|
|
|
|
|
|
Thread.Sleep(10); |
|
|
|
}), "MainViewReadPlcData"); |
|
|
|
|
|
|
@@ -912,7 +1078,14 @@ namespace FryPot_DosingSystem.Control |
|
|
|
FryPotInfoManage.GetInstance.variableInfos.FirstOrDefault(p => p.VarName == "FryPotFiveOil").CurrentValue = FryPotMonitorManage.GetInstance.fryFive.OilCapacity.ToString(); |
|
|
|
FryPotInfoManage.GetInstance.variableInfos.FirstOrDefault(p => p.VarName == "FryPotFiveTotalOil").CurrentValue = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy.ToString(); |
|
|
|
FryPotInfoManage.GetInstance.variableInfos.FirstOrDefault(p => p.VarName == "FryPotFiveTotalProduct").CurrentValue = FryPotMonitorManage.GetInstance.fryFive.TotalProduct.ToString(); |
|
|
|
FryPotDataSaveToBinaryFile(); |
|
|
|
|
|
|
|
//FryPotMonitorManage.GetInstance.fryFive.Temperature = 10; |
|
|
|
//FryPotMonitorManage.GetInstance.fryFive.HotPower = "9"; |
|
|
|
//FryPotMonitorManage.GetInstance.fryFive.Speed = 8; |
|
|
|
//FryPotMonitorManage.GetInstance.fryFive.FryPotWeight=7; |
|
|
|
//FryPotMonitorManage.GetInstance.fryFive.OilCapacity = 6; |
|
|
|
//FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy = 5; |
|
|
|
//FryPotMonitorManage.GetInstance.fryFive.TotalProduct = 4; |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 炒锅状态数据保存到二进制文件 |
|
|
@@ -927,12 +1100,12 @@ namespace FryPot_DosingSystem.Control |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
|
|
|
|
if (globalVar.LOneFryPotSerial == 1) |
|
|
|
if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm:ss") + "-" + globalVar.LOneCurrentRecipeName + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
|
|
|
|
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
writeStream.Position = writeStream.Length; |
|
|
|
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
@@ -943,12 +1116,12 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
if (globalVar.LOneFryPotSerial == 1) |
|
|
|
if (globalVar.LOneFryPotSerial == 1 && fryOneRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm:ss") + "-" + globalVar.LOneCurrentRecipeName + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅1状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryOneRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
|
|
|
|
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
writeStream.Position = writeStream.Length; |
|
|
|
PotOneStatus p1 = new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, RecipeName = fryOneRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
@@ -956,18 +1129,19 @@ namespace FryPot_DosingSystem.Control |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#region 炒锅2状态数据保存 |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅2状态数据")) |
|
|
|
{ |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅2状态数据"); |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
|
|
|
|
if (globalVar.LOneFryPotSerial == 2) |
|
|
|
if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm:ss") + "-" + globalVar.LTwoCurrentRecipeName + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
|
|
|
|
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
@@ -978,18 +1152,127 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
if (globalVar.LOneFryPotSerial == 2) |
|
|
|
if (globalVar.LTwoFryPotSerial == 2 && fryTwoRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryTwoRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
|
|
|
|
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, RecipeName = fryTwoRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#region 炒锅3状态数据保存 |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅3状态数据")) |
|
|
|
{ |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅3状态数据"); |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
|
|
|
|
if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
|
|
|
|
PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
if (globalVar.LThreeFryPotSerial == 3 && fryThreeRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅3状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryThreeRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
|
|
|
|
PotThreeStatus p1 = new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, RecipeName = fryThreeRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#region 炒锅4状态数据保存 |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅4状态数据")) |
|
|
|
{ |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅4状态数据"); |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
|
|
|
|
if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
writeStream.Position = writeStream.Length; |
|
|
|
PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
if (globalVar.LOneFryPotSerial == 4 && fryFourRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅4状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFourRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
writeStream.Position = writeStream.Length; |
|
|
|
PotFourStatus p1 = new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, RecipeName = fryFourRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#region 炒锅5状态数据保存 |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅5状态数据")) |
|
|
|
{ |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅5状态数据"); |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
|
|
|
|
if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅2状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm:ss") + "-" + globalVar.LTwoCurrentRecipeName + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
writeStream.Position = writeStream.Length; |
|
|
|
PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
|
PotTwoStatus p1 = new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (!Directory.Exists("AccessFile\\" + "DB" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString())) |
|
|
|
Directory.CreateDirectory("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString()); |
|
|
|
if (globalVar.LTwoFryPotSerial == 5 && fryFiveRecipe != string.Empty) |
|
|
|
{ |
|
|
|
using (FileStream writeStream = new FileStream("AccessFile\\" + "DB\\" + "炒锅5状态数据\\" + DateTime.Now.ToShortDateString() + "\\" + DateTime.Now.ToString("hh:mm").Replace(':', '.') + fryFiveRecipe + ".bin", FileMode.OpenOrCreate, FileAccess.Write)) |
|
|
|
{ |
|
|
|
writeStream.Position = writeStream.Length; |
|
|
|
PotFiveStatus p1 = new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, RecipeName = fryFiveRecipe, Time = DateTime.Now.ToShortDateString() }; |
|
|
|
BinaryFormatter bf = new BinaryFormatter(); |
|
|
|
bf.Serialize(writeStream, p1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 滚筒线运行状态显示 |
|
|
@@ -1234,13 +1517,19 @@ namespace FryPot_DosingSystem.Control |
|
|
|
if (globalVar.LThreeCurrentRecipeName != string.Empty) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成"); |
|
|
|
globalVar.LThreeCurrentRecipeName = string.Empty; |
|
|
|
if (globalVar.LThreeFryPotSerial == 3) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryThree.TotalProduct++; |
|
|
|
Sqlite<PotThreeStatus>.GetInstance.Base.Add(new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotThreeStatus>.GetInstance.Save();//保存数据 |
|
|
|
using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryThree.txt", false, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
txtWriter.WriteLine(DateTime.Now.ToShortDateString()); |
|
|
|
txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryThree.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy);//炒锅1产量以及总油量记录 |
|
|
|
} |
|
|
|
//Sqlite<PotThreeStatus>.GetInstance.Base.Add(new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
//Sqlite<PotThreeStatus>.GetInstance.Save();//保存数据 |
|
|
|
} |
|
|
|
globalVar.LThreeCurrentRecipeName = string.Empty; |
|
|
|
Task.Run(() => { Thread.Sleep(1500); fryThreeRecipe = string.Empty; }); |
|
|
|
} |
|
|
|
} |
|
|
|
if (LThreeRecipeQuene.Count > 0 && LThreeOutputMaterialQuene.Count == 0 && LThreeInputMaterialQuene.Count == 0)//后续添加其它限制条件 |
|
|
@@ -1257,12 +1546,14 @@ namespace FryPot_DosingSystem.Control |
|
|
|
globalVar.LThreeMaterialNum = result.materialCollection.Count; |
|
|
|
globalVar.LThreeFryPotSerial = headNum; |
|
|
|
globalVar.LThreeCurrentRecipeName = result.RecipeName; |
|
|
|
|
|
|
|
AgvViewModel.GetInstance().Set滚筒线上数量(3, globalVar.LThreeMaterialNum.ToString()); |
|
|
|
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线开始制作【{result.RecipeName}】 配方"); |
|
|
|
for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料 |
|
|
|
{ |
|
|
|
if (result.materialCollection[i].MaterialLoc % 100 == i + 1 && result.materialCollection[i].MaterialLoc / 100 == headNum && headNum == 3) |
|
|
|
{ |
|
|
|
fryThreeRecipe = result.RecipeName;//炒锅状态开始记录 |
|
|
|
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_3.goodsName = result.RecipeName; })); |
|
|
|
//将配方中原料加入新的队列 |
|
|
|
LThreeInputMaterialQuene.Enqueue(new MaterialInfo() |
|
|
@@ -1299,19 +1590,30 @@ namespace FryPot_DosingSystem.Control |
|
|
|
if (globalVar.LTwoCurrentRecipeName != string.Empty) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成"); |
|
|
|
globalVar.LTwoCurrentRecipeName = string.Empty; |
|
|
|
if (globalVar.LTwoFryPotSerial == 2) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryTwo.TotalProduct++; |
|
|
|
Sqlite<PotTwoStatus>.GetInstance.Base.Add(new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotTwoStatus>.GetInstance.Save();//保存数据 |
|
|
|
using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryTwo.txt", false, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
txtWriter.WriteLine(DateTime.Now.ToShortDateString()); |
|
|
|
txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryTwo.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy);//炒锅1产量以及总油量记录 |
|
|
|
} |
|
|
|
//Sqlite<PotTwoStatus>.GetInstance.Base.Add(new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
//Sqlite<PotTwoStatus>.GetInstance.Save();//保存数据 |
|
|
|
} |
|
|
|
if (globalVar.LTwoFryPotSerial == 5) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryFive.TotalProduct++; |
|
|
|
Sqlite<PotFiveStatus>.GetInstance.Base.Add(new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotFiveStatus>.GetInstance.Save();//保存数据 |
|
|
|
using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryFive.txt", false, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
txtWriter.WriteLine(DateTime.Now.ToShortDateString()); |
|
|
|
txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryFive.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy);//炒锅1产量以及总油量记录 |
|
|
|
} |
|
|
|
//Sqlite<PotFiveStatus>.GetInstance.Base.Add(new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
//Sqlite<PotFiveStatus>.GetInstance.Save();//保存数据 |
|
|
|
} |
|
|
|
globalVar.LTwoCurrentRecipeName = string.Empty; |
|
|
|
Task.Run(() => { Thread.Sleep(2000); fryTwoRecipe = string.Empty; fryFiveRecipe = string.Empty; }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -1346,10 +1648,12 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
if (headNum == 1)//炒锅2 |
|
|
|
{ |
|
|
|
fryTwoRecipe = result.RecipeName;//炒锅状态开始记录 |
|
|
|
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_2.goodsName = result.RecipeName; })); |
|
|
|
} |
|
|
|
else//炒锅5 |
|
|
|
{ |
|
|
|
fryFiveRecipe = result.RecipeName;//炒锅状态开始记录 |
|
|
|
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_5.goodsName = result.RecipeName; })); |
|
|
|
} |
|
|
|
//将配方中原料加入新的队列 |
|
|
@@ -1387,20 +1691,30 @@ namespace FryPot_DosingSystem.Control |
|
|
|
if (globalVar.LOneCurrentRecipeName != string.Empty) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成"); |
|
|
|
globalVar.LOneCurrentRecipeName = string.Empty; |
|
|
|
if (globalVar.LOneFryPotSerial == 1) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryOne.TotalProduct++; |
|
|
|
Sqlite<PotOneStatus>.GetInstance.Base.Add(new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotOneStatus>.GetInstance.Save();//保存数据 |
|
|
|
using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryOne.txt", false, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
txtWriter.WriteLine(DateTime.Now.ToShortDateString()); |
|
|
|
txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryOne.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy);//炒锅1产量以及总油量记录 |
|
|
|
} |
|
|
|
//Sqlite<PotOneStatus>.GetInstance.Base.Add(new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
//Sqlite<PotOneStatus>.GetInstance.Save();//保存数据 |
|
|
|
} |
|
|
|
if (globalVar.LOneFryPotSerial == 4) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryFour.TotalProduct++; |
|
|
|
Sqlite<PotFourStatus>.GetInstance.Base.Add(new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotFourStatus>.GetInstance.Save();//保存数据 |
|
|
|
using (StreamWriter txtWriter = new StreamWriter("AccessFile//" + "Statistic//" + "FryFour.txt", false, Encoding.UTF8)) |
|
|
|
{ |
|
|
|
txtWriter.WriteLine(DateTime.Now.ToShortDateString()); |
|
|
|
txtWriter.WriteLine(FryPotMonitorManage.GetInstance.fryFour.TotalProduct + "/" + FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy);//炒锅1产量以及总油量记录 |
|
|
|
} |
|
|
|
//Sqlite<PotFourStatus>.GetInstance.Base.Add(new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
//Sqlite<PotFourStatus>.GetInstance.Save();//保存数据 |
|
|
|
} |
|
|
|
|
|
|
|
globalVar.LOneCurrentRecipeName = string.Empty; |
|
|
|
Task.Run(() => { Thread.Sleep(1500); fryOneRecipe = string.Empty; fryFourRecipe = string.Empty; }); |
|
|
|
} |
|
|
|
} |
|
|
|
if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0)//后续添加其它限制条件 |
|
|
@@ -1432,10 +1746,12 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
if (headNum == 1)//炒锅1 |
|
|
|
{ |
|
|
|
fryOneRecipe = result.RecipeName;//炒锅状态开始记录 |
|
|
|
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_1.goodsName = result.RecipeName; })); |
|
|
|
} |
|
|
|
else//炒锅4 |
|
|
|
{ |
|
|
|
fryFourRecipe = result.RecipeName;//炒锅状态开始记录 |
|
|
|
Application.Current.Dispatcher.Invoke(new Action(() => { AgvViewModel.GetInstance().wokModel_4.goodsName = result.RecipeName; })); |
|
|
|
} |
|
|
|
//将配方中原料加入新的队列 |
|
|
@@ -1631,16 +1947,16 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
if (!globalVar.InOrOutputLock && (globalVar.fryPotOne.InputMaterialArrivedSingle == 1 || globalVar.fryPotFour.InputMaterialArrivedSingle == 1) && globalVar.PotOneInputMaterialArrive && OutputMaterialQuene.Count > 0 && !globalVar.PotOneOutputRollerArrive) |
|
|
|
{ |
|
|
|
if (globalVar.LOneFryPotSerial == 1) |
|
|
|
{ |
|
|
|
Sqlite<PotOneStatus>.GetInstance.Base.Add(new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotOneStatus>.GetInstance.Save();//保存数据 |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Sqlite<PotFourStatus>.GetInstance.Base.Add(new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotFourStatus>.GetInstance.Save();//保存数据 |
|
|
|
} |
|
|
|
//if (globalVar.LOneFryPotSerial == 1) |
|
|
|
//{ |
|
|
|
// Sqlite<PotOneStatus>.GetInstance.Base.Add(new PotOneStatus { Temperature = FryPotMonitorManage.GetInstance.fryOne.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryOne.HotPower, Speed = FryPotMonitorManage.GetInstance.fryOne.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryOne.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryOne.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryOne.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryOne.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
// Sqlite<PotOneStatus>.GetInstance.Save();//保存数据 |
|
|
|
//} |
|
|
|
//else |
|
|
|
//{ |
|
|
|
// Sqlite<PotFourStatus>.GetInstance.Base.Add(new PotFourStatus { Temperature = FryPotMonitorManage.GetInstance.fryFour.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFour.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFour.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFour.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFour.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFour.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFour.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
// Sqlite<PotFourStatus>.GetInstance.Save();//保存数据 |
|
|
|
//} |
|
|
|
FryPotOneRollerTroubleCheck(); |
|
|
|
if (FryPotAlarm == 1 || FryPotFourAlarm == 1)//炒锅滚筒无故障 |
|
|
|
{ |
|
|
@@ -1690,16 +2006,16 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
if (!globalVar.LTwoInOrOutputLock && (globalVar.fryPotTwo.InputMaterialArrivedSingle == 1 || globalVar.fryPotFive.InputMaterialArrivedSingle == 1) && globalVar.LTwoPotInputMaterialArrive && LTwoOutputMaterialQuene.Count > 0 && !globalVar.LTwoPotOutputRollerArrive) |
|
|
|
{ |
|
|
|
if (globalVar.LTwoFryPotSerial == 2) |
|
|
|
{ |
|
|
|
Sqlite<PotTwoStatus>.GetInstance.Base.Add(new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotTwoStatus>.GetInstance.Save();//保存数据 |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Sqlite<PotFiveStatus>.GetInstance.Base.Add(new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotFiveStatus>.GetInstance.Save();//保存数据 |
|
|
|
} |
|
|
|
//if (globalVar.LTwoFryPotSerial == 2) |
|
|
|
//{ |
|
|
|
// Sqlite<PotTwoStatus>.GetInstance.Base.Add(new PotTwoStatus { Temperature = FryPotMonitorManage.GetInstance.fryTwo.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryTwo.HotPower, Speed = FryPotMonitorManage.GetInstance.fryTwo.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryTwo.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryTwo.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryTwo.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryTwo.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
// Sqlite<PotTwoStatus>.GetInstance.Save();//保存数据 |
|
|
|
//} |
|
|
|
//else |
|
|
|
//{ |
|
|
|
// Sqlite<PotFiveStatus>.GetInstance.Base.Add(new PotFiveStatus { Temperature = FryPotMonitorManage.GetInstance.fryFive.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryFive.HotPower, Speed = FryPotMonitorManage.GetInstance.fryFive.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryFive.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryFive.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryFive.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
// Sqlite<PotFiveStatus>.GetInstance.Save();//保存数据 |
|
|
|
//} |
|
|
|
FryPotTwoRollerTroubleCheck(); |
|
|
|
if (FryPotTwoAlarm == 1 || FryPotFiveAlarm == 1)//炒锅滚筒无故障 |
|
|
|
{ |
|
|
@@ -1743,8 +2059,8 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
if (!globalVar.LThreeInOrOutputLock && globalVar.fryPotThree.InputMaterialArrivedSingle == 1 && globalVar.LThreePotInputMaterialArrive && LThreeOutputMaterialQuene.Count > 0 && !globalVar.LThreePotOutputRollerArrive) |
|
|
|
{ |
|
|
|
Sqlite<PotThreeStatus>.GetInstance.Base.Add(new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
Sqlite<PotThreeStatus>.GetInstance.Save();//保存数据 |
|
|
|
//Sqlite<PotThreeStatus>.GetInstance.Base.Add(new PotThreeStatus { Temperature = FryPotMonitorManage.GetInstance.fryThree.Temperature, HotPower = FryPotMonitorManage.GetInstance.fryThree.HotPower, Speed = FryPotMonitorManage.GetInstance.fryThree.Speed, FryPotWeight = FryPotMonitorManage.GetInstance.fryThree.FryPotWeight, OilCapacity = FryPotMonitorManage.GetInstance.fryThree.OilCapacity, TotalOilCapactiy = FryPotMonitorManage.GetInstance.fryThree.TotalOilCapactiy, TotalProduct = FryPotMonitorManage.GetInstance.fryThree.TotalProduct, Time = DateTime.Now.ToShortDateString() });//向表中新增数据 |
|
|
|
//Sqlite<PotThreeStatus>.GetInstance.Save();//保存数据 |
|
|
|
FryPotThreeRollerTroubleCheck(); |
|
|
|
if (FryPotThreeAlarm == 1)//炒锅滚筒无故障 |
|
|
|
{ |
|
|
|