change - 界面时间不同改变颜色

wangsr
wangsr 1 year ago
parent 18c2186017
commit 2e2603aae2

@ -122,6 +122,5 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
}
return ls;
}
}
}

@ -14,6 +14,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Serialization;
using static Mesnac.Action.ChemicalWeighing.AutoControl.AutoLogHelper;
@ -243,6 +244,57 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
}
GWlog(recipes, steps, mixSteps, RadioE);
//if(!GWComparePLC(recipes, steps, mixSteps, RadioE))
//{
// MessageBox.Show("下传数据不完整,请重新下传数据!");
//}
}
private static bool GWComparePLC(List<RecipePlcView> recipes, List<Step> steps, List<MixStep> mixSteps, MCRadioButtonEntity RadioE)
{
bool flag = false;
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 (ControlsHelper.SingleSelect(RadioE))
{
case 1:
return getGelatG1.RecipePlcViews.SequenceEqual(recipes) && getGelatG1.RecipeSteps.SequenceEqual(steps) && getWeterM1.SequenceEqual(mixSteps);
case 2:
return getGelatG2.RecipePlcViews.SequenceEqual(recipes) && getGelatG2.RecipeSteps.SequenceEqual(steps) && getWeterM2.SequenceEqual(mixSteps);
case 3:
return getGelatG3.RecipePlcViews.SequenceEqual(recipes) && getGelatG3.RecipeSteps.SequenceEqual(steps) && getWeterM3.SequenceEqual(mixSteps);
case 4:
return getGelatG4.RecipePlcViews.SequenceEqual(recipes) && getGelatG4.RecipeSteps.SequenceEqual(steps) && getWeterM4.SequenceEqual(mixSteps);
case 5:
return getGelatG5.RecipePlcViews.SequenceEqual(recipes) && getGelatG5.RecipeSteps.SequenceEqual(steps) && getWeterM5.SequenceEqual(mixSteps);
case 6:
return getGelatG6.RecipePlcViews.SequenceEqual(recipes) && getGelatG6.RecipeSteps.SequenceEqual(steps) && getWeterM6.SequenceEqual(mixSteps);
case 7:
return getGelatG7.RecipePlcViews.SequenceEqual(recipes) && getGelatG7.RecipeSteps.SequenceEqual(steps) && getWeterM7.SequenceEqual(mixSteps);
case 8:
return getGelatG8.RecipePlcViews.SequenceEqual(recipes) && getGelatG8.RecipeSteps.SequenceEqual(steps) && getWeterM8.SequenceEqual(mixSteps);
default:
MessageBox.Show("未选择产线!");
return true;
}
}
#endregion
@ -676,7 +728,6 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
#endregion
#endregion
#region 维修模式
public static void RepairOnOff(MCLabelEntity LabelE, MCRadioButtonEntity RadioE)
@ -752,7 +803,6 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl
DeviceMaterrial deviceMaterial1 = new DeviceMaterrial()
{
DeviceId = ControlsHelper.DrySelect(RadioE),
MaterrialId = b,
Type = 1,
Code = StockMaterrialDbHelp.GetCodeById(b)

@ -27,6 +27,7 @@ using Mesnac.Action.ChemicalWeighing.MinAn;
using HslCommunication.Core;
using Mesnac.Action.ChemicalWeighing.FreeDb;
using Mesnac.Action.ChemicalWeighing.ManualControl;
using DevExpress.Pdf.Native;
namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
{
@ -285,7 +286,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
private void RGVRecord(List<RGVEntity> RGVEs, List<bool> Mixes)
{
if(RGVEs.Count == 0 || Mixes.Count == 0)
if (RGVEs.Count == 0 || Mixes.Count == 0)
{
return;
}
@ -360,26 +361,32 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
{
case 1:
LabelE.WetWait1.Text = MixWaitTime(record);
LabelE.WetWait1.ForeColor = MixTimeBackColor(record);
LabelE.RGVWait1.Text = "0";
break;
case 2:
LabelE.WetWait2.Text = MixWaitTime(record);
LabelE.WetWait2.ForeColor = MixTimeBackColor(record);
LabelE.RGVWait2.Text = "0";
break;
case 3:
LabelE.WetWait3.Text = MixWaitTime(record);
LabelE.WetWait3.ForeColor = MixTimeBackColor(record);
LabelE.RGVWait3.Text = "0";
break;
case 4:
LabelE.WetWait4.Text = MixWaitTime(record);
LabelE.WetWait4.ForeColor = MixTimeBackColor(record);
LabelE.RGVWait4.Text = "0";
break;
case 5:
LabelE.WetWait5.Text = MixWaitTime(record);
LabelE.WetWait5.ForeColor = MixTimeBackColor(record);
LabelE.RGVWait5.Text = "0";
break;
case 6:
LabelE.WetWait6.Text = MixWaitTime(record);
LabelE.WetWait6.ForeColor = MixTimeBackColor(record);
LabelE.RGVWait6.Text = "0";
break;
default:
@ -392,21 +399,27 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
{
case 1:
LabelE.RGVWait1.Text = RGVWaitTime(record);
LabelE.WetWait1.ForeColor = RGVTimeBackColor(record);
break;
case 2:
LabelE.RGVWait2.Text = RGVWaitTime(record);
LabelE.WetWait2.ForeColor = RGVTimeBackColor(record);
break;
case 3:
LabelE.RGVWait3.Text = RGVWaitTime(record);
LabelE.WetWait3.ForeColor = RGVTimeBackColor(record);
break;
case 4:
LabelE.RGVWait4.Text = RGVWaitTime(record);
LabelE.WetWait4.ForeColor = RGVTimeBackColor(record);
break;
case 5:
LabelE.RGVWait5.Text = RGVWaitTime(record);
LabelE.WetWait5.ForeColor = RGVTimeBackColor(record);
break;
case 6:
LabelE.RGVWait6.Text = RGVWaitTime(record);
LabelE.WetWait6.ForeColor = RGVTimeBackColor(record);
break;
default:
break;
@ -428,6 +441,35 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
return SecondToMinute(t);
}
private Color RGVTimeBackColor(Lj_RGVTimeRecord record)
{
int t = Convert.ToInt32((DateTime.Now - record.RGVReachTime).TotalSeconds);
return SelectColor(t);
}
private Color MixTimeBackColor(Lj_RGVTimeRecord record)
{
int t = Convert.ToInt32((DateTime.Now - record.MixReadyStartTime).TotalSeconds);
return SelectColor(t);
}
private Color SelectColor(int t)
{
int m = t / 60;
if (m >= 10 && m < 20)
{
return Color.Yellow;
}
else if (m >= 20)
{
return Color.Red;
}
else
{
return Color.White;
}
}
private string SecondToMinute(int t)
{
int m = t / 60;

Loading…
Cancel
Save