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/DeviceParamManage/SelectDeviceParamInfo.cs

36 lines
1.4 KiB
C#

using Mesnac.Action.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.DeviceParamManage
{
public class SelectDeviceParamInfo : ChemicalWeighingAction, IAction
{
private RuntimeParameter _runtime;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须要调用
this._runtime = runtime;
foreach (var item in BasePlcHelper.Instance.dataKeyValues)
{
if (item.Name == "VccHighWei" || item.Name == "VccLowWei" || item.Name == "VccJogWei"|| item.Name == "VccExcWei" || item.Name == "GFAHighWei" || item.Name == "GFALowWei" || item.Name == "GFAJogWei" || item.Name == "GFAExcWei" || item.Name == "ResinHighWei" || item.Name == "ResinLowWei" || item.Name == "ResinJogWei" || item.Name == "ResinExcWei")
{
TextBox comboBox = base.GetControlById(item.Name) as TextBox;
comboBox.Text = item.NowValue.ToFloat().ToString();
}
else
{
TextBox comboBox = base.GetControlById(item.Name) as TextBox;
comboBox.Text = item.NowValue.ToInt().ToString();
}
}
}
}
}