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/LjDeliver/ControlsHelper.cs

80 lines
2.0 KiB
C#

using Mesnac.Action.ChemicalWeighing.AutoControl.Entity;
using Mesnac.Action.ChemicalWeighing.LjDeliver.Entity;
using Mesnac.Action.ChemicalWeighing.Util;
using Mesnac.Controls.ChemicalWeighing;
using Mesnac.Controls.Default;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.LjDeliver
{
public class ControlsHelper : ControlsImprot
{
internal static double NoNegative(double value)
{
if (value < 0)
{
return 0;
}
else
{
return value;
}
}
internal static void SetTubeColor(SpecialLabelBlue tube, bool valve1, bool valve2)
{
if (valve1 && valve2)
{
tube.BackColor = Color.LightGreen;
}
else
{
tube.BackColor = Color.White;
}
}
internal static double SetPressureCurve(double value)
{
if (value < 0.005)
{
value = 0;
}
return Math.Round(value, 4);
}
internal static int JudgePFTStatus(bool[] step)
{
for (int i = 0; i < step.Length; i++)
{
if (step[i])
{
return i + 1;
}
}
return 0;
}
internal static string ConvertStepName(int step)
{
switch (step)
{
case 1: return "压力检测";
case 2: return "超压泄压";
case 3: return "落料运行";
case 4: return "充压输送运行";
case 5: return "输送运行";
case 6: return "单次输送完成";
case 7: return "清扫";
default: return "无";
}
}
}
}