You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/AutoLogHelper.cs

82 lines
3.1 KiB
C#

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
{
/// <summary>
/// 无数据log
/// </summary>
/// <param name="logText">log说明</param>
/// <param name="RadioE">产线选择</param>
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<RecipePlcView> recipes, List<Step> steps, List<MixStep> 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();
}
}
}