using Mesnac.Action.ChemicalWeighing.AutoControl.DB;
using Mesnac.Action.ChemicalWeighing.AutoControl.Entity;
using Mesnac.Action.ChemicalWeighing.FreeDb;
using Mesnac.Action.ChemicalWeighing.LjMixManager;
using Mesnac.Basic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mesnac.Action.ChemicalWeighing.AutoControl
{
public static class AutoLogHelper
{
///
/// 无数据log
///
/// log说明
/// 产线选择
public static void SingleLog(string logText, MCRadioButtonEntity RadioE)
{
Auto_Log log = new Auto_Log()
{
ActionKind = logText,
LogTime = DateTime.Now,
LineNo = ControlsHelper.SingleSelect(RadioE),
UserID = string.IsNullOrWhiteSpace(UserInfo.Instance.UserName) ? "Edit" : UserInfo.Instance.UserName,
};
FreeSqlUnit.Instance.Insert(log).ExecuteIdentity();
}
public static void ManualWeightLog(float w, float t, MCRadioButtonEntity RadioE)
{
Auto_Log log = new Auto_Log()
{
ActionKind = "手动下黑粉",
LogTime = DateTime.Now,
UserID = string.IsNullOrWhiteSpace(UserInfo.Instance.UserName) ? "Edit" : UserInfo.Instance.UserName,
ManualTolerance = t,
LineNo = ControlsHelper.SingleSelect(RadioE),
ManualWeight = w,
};
FreeSqlUnit.Instance.Insert(log).ExecuteIdentity();
}
public static void GWlog(List recipes, List steps, List mixSteps, MCRadioButtonEntity RadioE)
{
Auto_Log log = new Auto_Log()
{
ActionKind = "糊化湿混数据下传",
LogTime = DateTime.Now,
UserID = string.IsNullOrWhiteSpace(UserInfo.Instance.UserName) ? "Edit" : UserInfo.Instance.UserName,
LineNo = ControlsHelper.SingleSelect(RadioE),
MaterialBin1 = recipes[0].Bin,
MaterialBin2 = recipes[1].Bin,
MaterialWeight1 = recipes[0].Set,
MaterialWeight2 = recipes[1].Set,
MaterialTolerance1 = recipes[0].Tolerance,
MaterialTolerance2 = recipes[1].Tolerance,
GelSpeedSet = steps[0].MixSpeed,
GelPosTimeA = steps[2].MixTemp,
GelNagTimeB = steps[2].MixSpeed,
GelPosTimeC = steps[2].MixTime,
GelWaterTime = steps[4].MixTime,
GelWaitTime = steps[6].MixTime,
GelCloseHeatTime = steps[7].MixTime,
GelOutDelayTime = steps[7].MixTemp,
WetDryWeight = mixSteps[1].SetValue,
WetMixTime = mixSteps[2].MixTime,
WetOutDelayTime = mixSteps[4].MixTime
};
FreeSqlUnit.Instance.Insert(log).ExecuteIdentity();
}
}
}