diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/ControlsHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/ControlsHelper.cs index e779b94..bedf890 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/ControlsHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/ControlsHelper.cs @@ -101,52 +101,55 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl ComboE.ChooseMaterial2.SelectedIndex = 0; } - var getGelatG1 = LjPlanningPlcHelp.GetGelatG1; - var getWeterM1 = LjPlanningPlcHelp.GetWeterM1; - var getGelatG2 = LjPlanningPlcHelp.GetGelatG2; - var getWeterM2 = LjPlanningPlcHelp.GetWeterM2; - var getGelatG3 = LjPlanningPlcHelp.GetGelatG3; - var getWeterM3 = LjPlanningPlcHelp.GetWeterM3; - var getGelatG4 = LjPlanningPlcHelp.GetGelatG4; - var getWeterM4 = LjPlanningPlcHelp.GetWeterM4; - var getGelatG5 = LjPlanningPlcHelp.GetGelatG5; - var getWeterM5 = LjPlanningPlcHelp.GetWeterM5; - var getGelatG6 = LjPlanningPlcHelp.GetGelatG6; - var getWeterM6 = LjPlanningPlcHelp.GetWeterM6; - var getGelatG7 = LjPlanningPlcHelp.GetGelatG7; - var getWeterM7 = LjPlanningPlcHelp.GetWeterM7; - var getGelatG8 = LjPlanningPlcHelp.GetGelatG8; - var getWeterM8 = LjPlanningPlcHelp.GetWeterM8; - - switch (select) - { - case 1: - GWDataShow(getGelatG1, getWeterM1, TextE); - break; - case 2: - GWDataShow(getGelatG2, getWeterM2, TextE); - break; - case 3: - GWDataShow(getGelatG3, getWeterM3, TextE); - break; - case 4: - GWDataShow(getGelatG4, getWeterM4, TextE); - break; - case 5: - GWDataShow(getGelatG5, getWeterM5, TextE); - break; - case 6: - GWDataShow(getGelatG6, getWeterM6, TextE); - break; - case 7: - GWDataShow(getGelatG7, getWeterM7, TextE); - break; - case 8: - GWDataShow(getGelatG8, getWeterM8, TextE); - break; - default: - return; - } + GWDataShow(selected, TextE, select); + + + //var getGelatG1 = LjPlanningPlcHelp.GetGelatG1; + //var getWeterM1 = LjPlanningPlcHelp.GetWeterM1; + //var getGelatG2 = LjPlanningPlcHelp.GetGelatG2; + //var getWeterM2 = LjPlanningPlcHelp.GetWeterM2; + //var getGelatG3 = LjPlanningPlcHelp.GetGelatG3; + //var getWeterM3 = LjPlanningPlcHelp.GetWeterM3; + //var getGelatG4 = LjPlanningPlcHelp.GetGelatG4; + //var getWeterM4 = LjPlanningPlcHelp.GetWeterM4; + //var getGelatG5 = LjPlanningPlcHelp.GetGelatG5; + //var getWeterM5 = LjPlanningPlcHelp.GetWeterM5; + //var getGelatG6 = LjPlanningPlcHelp.GetGelatG6; + //var getWeterM6 = LjPlanningPlcHelp.GetWeterM6; + //var getGelatG7 = LjPlanningPlcHelp.GetGelatG7; + //var getWeterM7 = LjPlanningPlcHelp.GetWeterM7; + //var getGelatG8 = LjPlanningPlcHelp.GetGelatG8; + //var getWeterM8 = LjPlanningPlcHelp.GetWeterM8; + + //switch (select) + //{ + // case 1: + // GWDataShow(getGelatG1, getWeterM1, TextE); + // break; + // case 2: + // GWDataShow(getGelatG2, getWeterM2, TextE); + // break; + // case 3: + // GWDataShow(getGelatG3, getWeterM3, TextE); + // break; + // case 4: + // GWDataShow(getGelatG4, getWeterM4, TextE); + // break; + // case 5: + // GWDataShow(getGelatG5, getWeterM5, TextE); + // break; + // case 6: + // GWDataShow(getGelatG6, getWeterM6, TextE); + // break; + // case 7: + // GWDataShow(getGelatG7, getWeterM7, TextE); + // break; + // case 8: + // GWDataShow(getGelatG8, getWeterM8, TextE); + // break; + // default: + // return; + //} } @@ -167,52 +170,54 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl ComboE.ChooseMaterial2.SelectedIndex = 0; } - var getGelatG1 = LjPlanningPlcHelp.GetGelatG1; - var getWeterM1 = LjPlanningPlcHelp.GetWeterM1; - var getGelatG2 = LjPlanningPlcHelp.GetGelatG2; - var getWeterM2 = LjPlanningPlcHelp.GetWeterM2; - var getGelatG3 = LjPlanningPlcHelp.GetGelatG3; - var getWeterM3 = LjPlanningPlcHelp.GetWeterM3; - var getGelatG4 = LjPlanningPlcHelp.GetGelatG4; - var getWeterM4 = LjPlanningPlcHelp.GetWeterM4; - var getGelatG5 = LjPlanningPlcHelp.GetGelatG5; - var getWeterM5 = LjPlanningPlcHelp.GetWeterM5; - var getGelatG6 = LjPlanningPlcHelp.GetGelatG6; - var getWeterM6 = LjPlanningPlcHelp.GetWeterM6; - var getGelatG7 = LjPlanningPlcHelp.GetGelatG7; - var getWeterM7 = LjPlanningPlcHelp.GetWeterM7; - var getGelatG8 = LjPlanningPlcHelp.GetGelatG8; - var getWeterM8 = LjPlanningPlcHelp.GetWeterM8; - - switch (select) - { - case 1: - GWDataShow2(getGelatG1, getWeterM1, TextE); - break; - case 2: - GWDataShow2(getGelatG2, getWeterM2, TextE); - break; - case 3: - GWDataShow2(getGelatG3, getWeterM3, TextE); - break; - case 4: - GWDataShow2(getGelatG4, getWeterM4, TextE); - break; - case 5: - GWDataShow2(getGelatG5, getWeterM5, TextE); - break; - case 6: - GWDataShow2(getGelatG6, getWeterM6, TextE); - break; - case 7: - GWDataShow2(getGelatG7, getWeterM7, TextE); - break; - case 8: - GWDataShow2(getGelatG8, getWeterM8, TextE); - break; - default: - return; - } + GWDataShow2(selected, TextE, select); + + //var getGelatG1 = LjPlanningPlcHelp.GetGelatG1; + //var getWeterM1 = LjPlanningPlcHelp.GetWeterM1; + //var getGelatG2 = LjPlanningPlcHelp.GetGelatG2; + //var getWeterM2 = LjPlanningPlcHelp.GetWeterM2; + //var getGelatG3 = LjPlanningPlcHelp.GetGelatG3; + //var getWeterM3 = LjPlanningPlcHelp.GetWeterM3; + //var getGelatG4 = LjPlanningPlcHelp.GetGelatG4; + //var getWeterM4 = LjPlanningPlcHelp.GetWeterM4; + //var getGelatG5 = LjPlanningPlcHelp.GetGelatG5; + //var getWeterM5 = LjPlanningPlcHelp.GetWeterM5; + //var getGelatG6 = LjPlanningPlcHelp.GetGelatG6; + //var getWeterM6 = LjPlanningPlcHelp.GetWeterM6; + //var getGelatG7 = LjPlanningPlcHelp.GetGelatG7; + //var getWeterM7 = LjPlanningPlcHelp.GetWeterM7; + //var getGelatG8 = LjPlanningPlcHelp.GetGelatG8; + //var getWeterM8 = LjPlanningPlcHelp.GetWeterM8; + + //switch (select) + //{ + // case 1: + // GWDataShow2(getGelatG1, getWeterM1, TextE); + // break; + // case 2: + // GWDataShow2(getGelatG2, getWeterM2, TextE); + // break; + // case 3: + // GWDataShow2(getGelatG3, getWeterM3, TextE); + // break; + // case 4: + // GWDataShow2(getGelatG4, getWeterM4, TextE); + // break; + // case 5: + // GWDataShow2(getGelatG5, getWeterM5, TextE); + // break; + // case 6: + // GWDataShow2(getGelatG6, getWeterM6, TextE); + // break; + // case 7: + // GWDataShow2(getGelatG7, getWeterM7, TextE); + // break; + // case 8: + // GWDataShow2(getGelatG8, getWeterM8, TextE); + // break; + // default: + // return; + //} } @@ -272,28 +277,71 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl //ComboE.DryM15.SelectedIndex = 0; } - var getDryerD1 = LjPlanningPlcHelp.GetDryerD1; - var getDryerD2 = LjPlanningPlcHelp.GetDryerD2; - var getDryerD3 = LjPlanningPlcHelp.GetDryerD3; - var getDryerD4 = LjPlanningPlcHelp.GetDryerD4; + //var getDryerD1 = LjPlanningPlcHelp.GetDryerD1; + //var getDryerD2 = LjPlanningPlcHelp.GetDryerD2; + //var getDryerD3 = LjPlanningPlcHelp.GetDryerD3; + //var getDryerD4 = LjPlanningPlcHelp.GetDryerD4; + + + DryDataShow(drtSelected, TextE, select); - switch (select) - { - case 1: - DryDataShow(getDryerD1, TextE); - break; - case 2: - DryDataShow(getDryerD2, TextE); - break; - case 3: - DryDataShow(getDryerD3, TextE); - break; - case 4: - DryDataShow(getDryerD4, TextE); - break; - default: return; - } + //switch (select) + //{ + // case 1: + // DryDataShow(getDryerD1, TextE); + // break; + // case 2: + // DryDataShow(getDryerD2, TextE); + // break; + // case 3: + // DryDataShow(getDryerD3, TextE); + // break; + // case 4: + // DryDataShow(getDryerD4, TextE); + // break; + // default: return; + //} + + } + + public static void DryDataShow(List Dry, MCTextBoxEntity TextE,int sel) + { + TextE.DryW1.MCValue = Dry[0].Weight; + TextE.DryW2.MCValue = Dry[1].Weight; + TextE.DryW3.MCValue = Dry[2].Weight; + TextE.DryW4.MCValue = Dry[3].Weight; + TextE.DryW5.MCValue = Dry[4].Weight; + TextE.DryW6.MCValue = Dry[5].Weight; + TextE.DryW7.MCValue = Dry[6].Weight; + TextE.DryW8.MCValue = Dry[7].Weight; + TextE.DryW9.MCValue = Dry[8].Weight; + TextE.DryW10.MCValue = Dry[9].Weight; + TextE.DryW11.MCValue = Dry[10].Weight; + TextE.DryW12.MCValue = Dry[11].Weight; + //TextE.DryW13.MCValue = Dry.RecipePlcViews[12].Set; + //TextE.DryW14.MCValue = Dry.RecipePlcViews[13].Set; + //TextE.DryW15.MCValue = Dry.RecipePlcViews[14].Set; + TextE.DryT1.MCValue = Dry[0].Allowance; + TextE.DryT2.MCValue = Dry[1].Allowance; + TextE.DryT3.MCValue = Dry[2].Allowance; + TextE.DryT4.MCValue = Dry[3].Allowance; + TextE.DryT5.MCValue = Dry[4].Allowance; + TextE.DryT6.MCValue = Dry[5].Allowance; + TextE.DryT7.MCValue = Dry[6].Allowance; + TextE.DryT8.MCValue = Dry[7].Allowance; + TextE.DryT9.MCValue = Dry[8].Allowance; + TextE.DryT10.MCValue = Dry[9].Allowance; + TextE.DryT11.MCValue = Dry[10].Allowance; + TextE.DryT12.MCValue = Dry[11].Allowance; + + var d= FreeSqlUnit.Instance.Queryable().Where(x => x.Id == sel).First(); + + TextE.DryWaitTime.MCValue = d.WaitTime; + TextE.DryOutDelayTime.MCValue = d.OutDelayTime; + TextE.DrySpeed1.MCValue = d.Speed1; + TextE.DrySpeed2.MCValue =d.Speed2; + TextE.DrySpeed3.MCValue = d.Speed3; } public static void DryDataShow(DryerView Dry, MCTextBoxEntity TextE) @@ -335,6 +383,31 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl TextE.DrySpeed3.MCValue = Dry.RecipeSteps[2].MixSpeed; } + public static void GWDataShow(List Gels, MCTextBoxEntity TextE,int sel) + { + TextE.MaterialWeight1.MCValue = Gels[0].Weight; + TextE.MaterialWeight2.MCValue = Gels[1].Weight; + TextE.MaterialTolerance1.MCValue = Gels[0].Allowance; + TextE.MaterialTolerance2.MCValue = Gels[1].Allowance; + + WetDetail web=FreeDb.FreeSqlUnit.Instance.Queryable().Where(x=>x.Id==sel).First(); + + TextE.GelSpeedSet.MCValue = web.MixSpeed; + TextE.GelPosTimeA.MCValue =web.GelPosA; + TextE.GelNagTimeB.MCValue = web.GelPosB; + TextE.GelPosTimeC.MCValue = web.GelPosC; + TextE.GelWaterTime.MCValue = web.GelWater; + TextE.GelWaitTime.MCValue = web.GelWait; + TextE.GelCloseHeatTime.MCValue = web.GelCloseHeat; + TextE.GelOutDelayTime.MCValue = web.WetOutDelay; + + + TextE.WetDryWeight.MCValue = web.WetDryWei; + TextE.WetMixTime.MCValue = web.WetMix; + TextE.WetOutDelayTime.MCValue = web.WetOutDelay; + } + + public static void GWDataShow(DryerView Gel, List Wet, MCTextBoxEntity TextE) { TextE.MaterialWeight1.MCValue = Gel.RecipePlcViews[0].Set; @@ -349,8 +422,8 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl TextE.GelWaitTime.MCValue = Gel.RecipeSteps[6].MixTime; TextE.GelCloseHeatTime.MCValue = Gel.RecipeSteps[7].MixTime; TextE.GelOutDelayTime.MCValue = Gel.RecipeSteps[7].MixTemp; - - + + TextE.WetDryWeight.MCValue = Wet[1].SetValue; TextE.WetMixTime.MCValue = Wet[2].MixTime; TextE.WetOutDelayTime.MCValue = Wet[4].MixTime; @@ -378,6 +451,30 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl TextE.WetOutDelayTime.MCValue = Wet[4].MixTime; } + public static void GWDataShow2(List Gels, MCTextBoxEntity TextE, int sel) + { + TextE.MaterialWeight1.MCValue = Gels[0].Weight; + TextE.MaterialWeight2.MCValue = Gels[1].Weight; + TextE.MaterialTolerance1.MCValue = Gels[0].Allowance; + TextE.MaterialTolerance2.MCValue = Gels[1].Allowance; + + WetDetail web = FreeDb.FreeSqlUnit.Instance.Queryable().Where(x => x.Id == sel).First(); + + TextE.GelSpeedSet.MCValue = web.MixSpeed; + TextE.GelPosTimeA.MCValue = web.GelPosA; + TextE.GelNagTimeB.MCValue = web.GelPosB; + TextE.GelPosTimeC.MCValue = web.GelPosC; + TextE.GelWaterTime.MCValue = web.GelWater; + TextE.GelWaitTime.MCValue = web.GelWait; + TextE.GelCloseHeatTime.MCValue = web.GelCloseHeat; + TextE.GelOutDelayTime.MCValue = web.WetOutDelay; + + + + TextE.WetMixTime.MCValue = web.WetMix; + TextE.WetOutDelayTime.MCValue = web.WetOutDelay; + } + /// /// 将C#数据实体转化为JSON数据 diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/DB/DeviceMaterrial.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/DB/DeviceMaterrial.cs index e15fcd7..0f771cd 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/DB/DeviceMaterrial.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/DB/DeviceMaterrial.cs @@ -29,6 +29,11 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB /// 数据库code /// list = FreeSqlUnit.Instance.Select().ToList(); + var coldA=list.First(x=>x.Id==1); + var coldB=list.First(x=>x.Id==2); + var hotA = list.First(x => x.Id == 3); + var hotB=list.First(x=>x.Id==4); + //1 冷水a 2 冷水b 3 热水a 4 热水b + + // TextE.ColdValueA.MCValue = dB2104Helper.GetAColWater.Set; + + TextE.ColdValueA.MCValue= coldA.Set; + + // TextE.ColdValueB.MCValue = dB2104Helper.GetBColWater.Set; + TextE.ColdValueB. MCValue = coldB.Set; + + // TextE.HotValueA.MCValue = dB2104Helper.GetAHotWater.Set; + + TextE.HotValueA. MCValue = hotA.Set; + + // TextE.HotValueB.MCValue = dB2104Helper.GetBHotWater.Set; + + TextE.HotValueB.MCValue =hotB.Set; + + // TextE.ColdToleranceA.MCValue = dB2104Helper.GetAColWater.Tolerance; + + TextE.ColdToleranceA.MCValue = coldA.Tolerance; + + // TextE.ColdToleranceB.MCValue = dB2104Helper.GetBColWater.Tolerance; + TextE.ColdToleranceB.MCValue = coldB.Tolerance; + + // TextE.HotToleranceA.MCValue = dB2104Helper.GetAHotWater.Tolerance; + TextE.HotToleranceA.MCValue = hotA.Tolerance; + // TextE.HotToleranceB.MCValue = dB2104Helper.GetBHotWater.Tolerance; + TextE.HotToleranceB.MCValue = hotB.Tolerance; + + + ComboE.DryM1.DataSource = StockMaterrialDbHelp.GetDryerMaterrial(); ComboE.DryM2.DataSource = StockMaterrialDbHelp.GetDryerMaterrial(); @@ -386,21 +418,21 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl ComboE.CBLeftOrRight.DataSource = dataB.Copy(); ComboE.HBLeftOrRight.DataSource = dataB.Copy(); - var ha = dB2104Helper.GetAHotWater; - TextE.HADeviation.MCValue = ha.differ; - ComboE.HALeftOrRight.MCValue = ha.stand; + // var ha = dB2104Helper.GetAHotWater; + TextE.HADeviation.MCValue = hotA.differ; + ComboE.HALeftOrRight.MCValue = hotA.stand; - var hb = dB2104Helper.GetBHotWater; - TextE.HBDeviation.MCValue = hb.differ; - ComboE.HBLeftOrRight.MCValue = hb.stand; + // var hb = dB2104Helper.GetBHotWater; + TextE.HBDeviation.MCValue = hotB.differ; + ComboE.HBLeftOrRight.MCValue = hotB.stand; - var ca = dB2104Helper.GetAColWater; - TextE.CADeviation.MCValue = ca.differ; - ComboE.CALeftOrRight.MCValue = ca.stand; + // var ca = dB2104Helper.GetAColWater; + TextE.CADeviation.MCValue = coldA.differ; + ComboE.CALeftOrRight.MCValue = coldA.stand; - var cb = dB2104Helper.GetBColWater; - TextE.CBDeviation.MCValue = cb.differ; - ComboE.CBLeftOrRight.MCValue = cb.stand; + // var cb = dB2104Helper.GetBColWater; + TextE.CBDeviation.MCValue = coldB.differ; + ComboE.CBLeftOrRight.MCValue = coldB.stand; if (!DB2105WriteHelper.GetWaterStatus()[0]) { diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs index dafe3a8..a0d5771 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/AutoControl/PlcAutoWriteHelper.cs @@ -29,6 +29,8 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl public static void GelWetDownload(MCTextBoxEntity TextE, MCComboBoxEntity ComboE, MCRadioButtonEntity RadioE) { + WetDetail wet=new WetDetail(); + int b1 = Convert.ToInt32(ComboE.ChooseMaterial1.MCValue.ToString()); int b2 = Convert.ToInt32(ComboE.ChooseMaterial2.MCValue.ToString()); @@ -41,16 +43,28 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl float MatWei1 = Convert.ToSingle(TextE.MaterialWeight1.MCValue.ToString()); float MatWei2 = Convert.ToSingle(TextE.MaterialWeight2.MCValue.ToString()); + + float GelSpeed = Convert.ToSingle(TextE.GelSpeedSet.MCValue.ToString()); + wet.MixSpeed = GelSpeed; + + float GelPosA = Convert.ToSingle(TextE.GelPosTimeA.MCValue.ToString()); + wet.GelPosA = GelPosA; float GelNagB = Convert.ToSingle(TextE.GelNagTimeB.MCValue.ToString()); + wet.GelPosB = GelNagB; short GelPosC = Convert.ToInt16(TextE.GelPosTimeC.MCValue.ToString()); + wet.GelPosC = GelPosC; short GelWater = Convert.ToInt16(TextE.GelWaterTime.MCValue.ToString()); + wet.GelWater = GelWater; short GelWait = Convert.ToInt16(TextE.GelWaitTime.MCValue.ToString()); + wet.GelWait = GelWait; short GelCloseHeat = Convert.ToInt16(TextE.GelCloseHeatTime.MCValue.ToString()); + wet.GelCloseHeat = GelCloseHeat; float GelDelayTime = Convert.ToSingle(TextE.GelOutDelayTime.MCValue.ToString()); + wet.GelDelayTime = GelDelayTime; if (b2 == -1) { @@ -154,9 +168,14 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl steps.Add(step9); steps.Add(step9); + + float WetDryWei = Convert.ToSingle(TextE.WetDryWeight.MCValue.ToString()); + wet.WetDryWei = WetDryWei; short WetMix = Convert.ToInt16(TextE.WetMixTime.MCValue.ToString()); + wet.WetMix = WetMix; short WetOutDelay = Convert.ToInt16(TextE.WetOutDelayTime.MCValue.ToString()); + wet.WetOutDelay = WetOutDelay; List mixSteps = new List(); @@ -204,7 +223,9 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl DeviceId = ControlsHelper.SingleSelect(RadioE), MaterrialId = b1, Type = 2, - Code = StockMaterrialDbHelp.GetCodeById(b1) + Code = StockMaterrialDbHelp.GetCodeById(b1), + Weight= MatWei1, + Allowance= MatTol1, }; DeviceMaterrial deviceMaterial2 = new DeviceMaterrial() @@ -212,7 +233,9 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl DeviceId = ControlsHelper.SingleSelect(RadioE), MaterrialId = b2, Type = 2, - Code = StockMaterrialDbHelp.GetCodeById(b2) + Code = StockMaterrialDbHelp.GetCodeById(b2), + Weight = MatWei2, + Allowance = MatTol2, }; materials.Add(deviceMaterial1); @@ -265,6 +288,9 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl return; } + wet.Id = ControlsHelper.SingleSelect(RadioE); + FreeDb.FreeSqlUnit.Instance.Update().SetSource(wet).ExecuteAffrows(); + GWlog(recipes, steps, mixSteps, RadioE); //if (!GWComparePLC(recipes, steps, mixSteps, RadioE)) @@ -387,6 +413,13 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl float drySpeed2 = Convert.ToSingle(TextE.DrySpeed2.MCValue.ToString()); float drySpeed3 = Convert.ToSingle(TextE.DrySpeed3.MCValue.ToString()); + DryDownloadDetail detail = new DryDownloadDetail(); + detail.WaitTime = dryWaitTime; + detail.OutDelayTime = dryOutDelayTime; + detail.Speed1 = Convert.ToInt32((short)drySpeed1); + detail.Speed2 = Convert.ToInt32((short)drySpeed2); + detail.Speed3 = Convert.ToInt32((short)drySpeed3); + if (drySpeed1 > 50 || drySpeed2 > 50 || drySpeed3 > 50) { MessageBox.Show("速度值不能大于五十!"); @@ -429,21 +462,28 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl LjPlanningPlcHelp.DownD1Recipe(recipes, steps); DeviceMaterrialService.Save(materials); + detail.Id = 1; + break; case 2: LjPlanningPlcHelp.DownD2Recipe(recipes, steps); DeviceMaterrialService.Save(materials); + detail.Id = 2; break; case 3: LjPlanningPlcHelp.DownD3Recipe(recipes, steps); DeviceMaterrialService.Save(materials); + detail.Id = 3; break; case 4: LjPlanningPlcHelp.DownD4Recipe(recipes, steps); DeviceMaterrialService.Save(materials); + detail.Id = 4; break; } + FreeSqlUnit.Instance.Update().SetSource(detail).ExecuteUpdated(); + //if (!DYComparePLC(recipes, steps, RadioE)) //{ // MessageBox.Show("干混产线下传数据不完整,请重新下传数据!"); @@ -1369,7 +1409,9 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl DeviceId = ControlsHelper.DrySelect(RadioE), MaterrialId = b, Type = 1, - Code = StockMaterrialDbHelp.GetCodeById(b) + Code = StockMaterrialDbHelp.GetCodeById(b), + Weight = w, + Allowance = t }; materials.Add(deviceMaterial1); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FreeDb/DryDownloadDetail.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FreeDb/DryDownloadDetail.cs new file mode 100644 index 0000000..c0bc0f0 --- /dev/null +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/FreeDb/DryDownloadDetail.cs @@ -0,0 +1,56 @@ +using FreeSql.DataAnnotations; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Mesnac.Action.ChemicalWeighing.FreeDb +{ + + [Table(Name = "DryDownloadDetail")] + public class DryDownloadDetail + { + + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = false)] + public int Id { get; set; } + + public int Speed1 { get; set; } + public int Speed2 { get; set; } + public int Speed3 { get; set; } + + public int WaitTime { get; set; } + + public int OutDelayTime { get; set; } + } + + [Table(Name = "WetDetail")] + public class WetDetail + { + /// + /// 主键 + /// + [Column(IsPrimary = true, IsIdentity = false)] + public int Id { get; set; } + + public float MixSpeed { get; set; } + public float GelPosA { get; set; } + public float GelPosB { get; set; } + public float GelPosC { get; set; } + public int GelWater { get; set; } + + public int GelWait { get; set; } + public int GelCloseHeat { get; set; } + public float GelDelayTime { get; set; } + public float WetDryWei { get; set; } + + public int WetMix { get; set; } + public float WetOutDelay { get; set; } + public float ManualWeight { get; set; } + public float ManualTolerance { get; set; } + } +} diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj index 4da5c17..7a99195 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Mesnac.Action.ChemicalWeighing.csproj @@ -284,6 +284,7 @@ +