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.
CaiQie/RfidWeb/Frm/FormPar.cs

303 lines
11 KiB
C#

2 weeks ago
using HslCommunication.LogNet;
using HZH_Controls.Forms;
using NewLife.Caching;
using NewLife.Threading;
using System;
1 month ago
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
2 weeks ago
using System.Diagnostics;
1 month ago
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
2 weeks ago
using Tool;
using Tool.Model;
1 month ago
namespace RfidWeb.Frm
{
public partial class FormPar : UserControl
{
2 weeks ago
private ICache cache = Cache.Default;
private ILogNet logNet = ILogNetFactory.GetLogNet;
private TimerX _timer;
1 month ago
public FormPar()
{
InitializeComponent();
2 weeks ago
FillA();
FillB();
//_timer = new TimerX(TimeState, null, 2000, 1000);
//_timer.Async = true;
}
private Dictionary<string, string> dicA = new Dictionary<string, string>();
private Dictionary<string, string> dicB = new Dictionary<string, string>();
private void FillA()
{
dicA.Clear();
2 weeks ago
textBoxExFeedingMotorSpeed.Text=HmiPointInfo.GetFeedingMotorSpeed.ToString();
textBoxExLaminatedMotorSpeed.Text= HmiPointInfo.GetLaminatedMotorSpeed.ToString();
double result = HmiPointInfo.GetSWSS / 10.0;
2 weeks ago
textBoxExSWSD.Text = result.ToString();
2 weeks ago
textBoxExFelt.Text = HmiPointInfo.GetFeltBeltMotorSpeed.ToString();
textBoxReceiving.Text = HmiPointInfo.GeReceivingMotorSpeed.ToString();
2 weeks ago
dicA["A"] = textBoxExFeedingMotorSpeed.Text;
dicA["B"] = textBoxExLaminatedMotorSpeed.Text;
2 weeks ago
dicA["C"] = HmiPointInfo.GetSWSS.ToString();
2 weeks ago
dicA["D"] = textBoxExFelt.Text;
dicA["E"] = textBoxReceiving.Text;
}
private void button8_Click(object sender, EventArgs e)
{
var plc = PlcConnect.Instance;
var a = textBoxExFeedingMotorSpeed.Text;
if (a != dicA["A"])
{
2 weeks ago
plc.Write(HmiPointInfo.feeding_motor_speed, int.Parse(a));
2 weeks ago
}
var b = textBoxExLaminatedMotorSpeed.Text;
if (b != dicA["B"])
{
2 weeks ago
plc.Write(HmiPointInfo.Laminated_motor_speed, int.Parse(b));
2 weeks ago
}
var c = UInt32.Parse((Convert.ToDouble(textBoxExSWSD.Text) * 10).ToString()).ToString();
if (c != dicA["C"])
{
2 weeks ago
plc.Write(HmiPointInfo.SWSS, int.Parse(c));
2 weeks ago
}
var d = textBoxExFelt.Text;
if (d != dicA["D"])
{
2 weeks ago
plc.Write(HmiPointInfo.Felt_belt_motor_speed, int.Parse(d));
2 weeks ago
}
var ee = textBoxExFelt.Text;
if (ee != dicA["E"])
{
2 weeks ago
plc.Write(HmiPointInfo.Receiving_Electric_motor_speed, int.Parse(ee));
2 weeks ago
}
MessageBox.Show("保存成功");
}
private void FillB()
{
dicB.Clear();
2 weeks ago
txtCUTTING_SET_TEMPERATURE1_1.Text = HmiPointInfo.GetCUTTING_SET_TEMPERATURE1_1.ToString();
2 weeks ago
dicB["CUTTING_SET_TEMPERATURE1_1"] = txtCUTTING_SET_TEMPERATURE1_1.Text;
2 weeks ago
txtCUTTING_SET_TEMPERATURE1_2.Text = HmiPointInfo.GetCUTTING_SET_TEMPERATURE1_2.ToString();
2 weeks ago
dicB["CUTTING_SET_TEMPERATURE1_2"] = txtCUTTING_SET_TEMPERATURE1_2.Text;
2 weeks ago
txtCUTTING_SET_TEMPERATURE1_3.Text = HmiPointInfo.GetCUTTING_SET_TEMPERATURE1_3.ToString();
2 weeks ago
dicB["CUTTING_SET_TEMPERATURE1_3"] = txtCUTTING_SET_TEMPERATURE1_3.Text;
2 weeks ago
txtCUTTING_SET_TEMPERATURE1_4.Text = HmiPointInfo.GetCUTTING_SET_TEMPERATURE1_4.ToString();
2 weeks ago
dicB["CUTTING_SET_TEMPERATURE1_4"] = txtCUTTING_SET_TEMPERATURE1_4.Text;
2 weeks ago
txtCUTTING_SET_TEMPERATURE2_1.Text = HmiPointInfo.GetCUTTING_SET_TEMPERATURE2_1.ToString();
2 weeks ago
dicB["CUTTING_SET_TEMPERATURE2_1"] = txtCUTTING_SET_TEMPERATURE2_1.Text;
2 weeks ago
txtCUTTING_SET_TEMPERATURE2_2.Text = HmiPointInfo.GetCUTTING_SET_TEMPERATURE2_2.ToString();
2 weeks ago
dicB["CUTTING_SET_TEMPERATURE2_2"] = txtCUTTING_SET_TEMPERATURE2_2.Text;
2 weeks ago
txtCUTTING_SET_TEMPERATURE2_3.Text = HmiPointInfo.GetCUTTING_SET_TEMPERATURE2_3.ToString();
2 weeks ago
dicB["CUTTING_SET_TEMPERATURE2_3"] = txtCUTTING_SET_TEMPERATURE2_3.Text;
2 weeks ago
txtCUTTING_SET_TEMPERATURE2_4.Text = HmiPointInfo.GetCUTTING_SET_TEMPERATURE2_4.ToString();
2 weeks ago
dicB["CUTTING_SET_TEMPERATURE2_4"] = txtCUTTING_SET_TEMPERATURE2_4.Text;
2 weeks ago
txtCUTTING_SET_TIME1_1.Text = HmiPointInfo.GetCUTTING_SET_TIME1_1.ToString();
2 weeks ago
dicB["CUTTING_SET_TIME1_1"] = txtCUTTING_SET_TIME1_1.Text;
2 weeks ago
txtCUTTING_SET_TIME1_2.Text = HmiPointInfo.GetCUTTING_SET_TIME1_2.ToString();
2 weeks ago
dicB["CUTTING_SET_TIME1_2"] = txtCUTTING_SET_TIME1_2.Text;
2 weeks ago
txtCUTTING_SET_TIME1_3.Text = HmiPointInfo.GetCUTTING_SET_TIME1_3.ToString();
2 weeks ago
dicB["CUTTING_SET_TIME1_3"] = txtCUTTING_SET_TIME1_3.Text;
2 weeks ago
txtCUTTING_SET_TIME1_4.Text = HmiPointInfo.GetCUTTING_SET_TIME1_4.ToString();
2 weeks ago
dicB["CUTTING_SET_TIME1_4"] = txtCUTTING_SET_TIME1_4.Text;
2 weeks ago
txtCUTTING_SET_TIME2_1.Text = HmiPointInfo.GetCUTTING_SET_TIME2_1.ToString();
2 weeks ago
dicB["CUTTING_SET_TIME2_1"] = txtCUTTING_SET_TIME2_1.Text;
2 weeks ago
txtCUTTING_SET_TIME2_2.Text = HmiPointInfo.GetCUTTING_SET_TIME2_2.ToString();
2 weeks ago
dicB["CUTTING_SET_TIME2_2"] = txtCUTTING_SET_TIME2_2.Text;
2 weeks ago
txtCUTTING_SET_TIME2_3.Text = HmiPointInfo.GetCUTTING_SET_TIME2_3.ToString();
2 weeks ago
dicB["CUTTING_SET_TIME2_3"] = txtCUTTING_SET_TIME2_3.Text;
2 weeks ago
txtCUTTING_SET_TIME2_4.Text = HmiPointInfo.GetCUTTING_SET_TIME2_4.ToString();
2 weeks ago
dicB["CUTTING_SET_TIME2_4"] = txtCUTTING_SET_TIME2_4.Text;
}
private void button7_Click(object sender, EventArgs e)
{
var plc = PlcConnect.Instance;
2 weeks ago
var CUTTING_SET_TEMPERATURE1_1= HmiPointInfo.GetCUTTING_SET_TEMPERATURE1_1.ToString();
2 weeks ago
if (CUTTING_SET_TEMPERATURE1_1 != dicB["CUTTING_SET_TEMPERATURE1_1"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TEMPERATURE1_1, int.Parse(CUTTING_SET_TEMPERATURE1_1));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TEMPERATURE1_2 = HmiPointInfo.GetCUTTING_SET_TEMPERATURE1_2.ToString();
2 weeks ago
if (CUTTING_SET_TEMPERATURE1_2 != dicB["CUTTING_SET_TEMPERATURE1_2"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TEMPERATURE1_2, int.Parse(CUTTING_SET_TEMPERATURE1_2));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TEMPERATURE1_3 = HmiPointInfo.GetCUTTING_SET_TEMPERATURE1_3.ToString();
2 weeks ago
if (CUTTING_SET_TEMPERATURE1_3 != dicB["CUTTING_SET_TEMPERATURE1_3"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TEMPERATURE1_3, int.Parse(CUTTING_SET_TEMPERATURE1_3));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TEMPERATURE1_4 = HmiPointInfo.GetCUTTING_SET_TEMPERATURE1_4.ToString();
2 weeks ago
if (CUTTING_SET_TEMPERATURE1_4 != dicB["CUTTING_SET_TEMPERATURE1_4"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TEMPERATURE1_4, int.Parse(CUTTING_SET_TEMPERATURE1_4));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TEMPERATURE2_1 = HmiPointInfo.GetCUTTING_SET_TEMPERATURE2_1.ToString();
2 weeks ago
if (CUTTING_SET_TEMPERATURE2_1 != dicB["CUTTING_SET_TEMPERATURE2_1"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TEMPERATURE2_1, int.Parse(CUTTING_SET_TEMPERATURE2_1));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TEMPERATURE2_2 = HmiPointInfo.GetCUTTING_SET_TEMPERATURE2_2.ToString();
2 weeks ago
if (CUTTING_SET_TEMPERATURE2_2 != dicB["CUTTING_SET_TEMPERATURE2_2"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TEMPERATURE2_2, int.Parse(CUTTING_SET_TEMPERATURE2_2));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TEMPERATURE2_3 = HmiPointInfo.GetCUTTING_SET_TEMPERATURE2_3.ToString();
2 weeks ago
if (CUTTING_SET_TEMPERATURE2_3 != dicB["CUTTING_SET_TEMPERATURE2_3"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TEMPERATURE2_3, int.Parse(CUTTING_SET_TEMPERATURE2_3));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TEMPERATURE2_4 = HmiPointInfo.GetCUTTING_SET_TEMPERATURE2_4.ToString();
2 weeks ago
if (CUTTING_SET_TEMPERATURE2_4 != dicB["CUTTING_SET_TEMPERATURE2_4"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TEMPERATURE2_4, int.Parse(CUTTING_SET_TEMPERATURE2_4));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TIME1_1 = HmiPointInfo.GetCUTTING_SET_TIME1_1.ToString();
2 weeks ago
if (CUTTING_SET_TIME1_1 != dicB["CUTTING_SET_TIME1_1"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TIME1_1, int.Parse(CUTTING_SET_TIME1_1));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TIME1_2 = HmiPointInfo.GetCUTTING_SET_TIME1_2.ToString();
2 weeks ago
if (CUTTING_SET_TIME1_2 != dicB["CUTTING_SET_TIME1_2"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TIME1_2, int.Parse(CUTTING_SET_TIME1_2));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TIME1_3 = HmiPointInfo.GetCUTTING_SET_TIME1_3.ToString();
2 weeks ago
if (CUTTING_SET_TIME1_3 != dicB["CUTTING_SET_TIME1_3"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TIME1_3, int.Parse(CUTTING_SET_TIME1_3));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TIME1_4 = HmiPointInfo.GetCUTTING_SET_TIME1_4.ToString();
2 weeks ago
if (CUTTING_SET_TIME1_4 != dicB["CUTTING_SET_TIME1_4"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TIME1_4, int.Parse(CUTTING_SET_TIME1_4));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TIME2_1 = HmiPointInfo.GetCUTTING_SET_TIME2_1.ToString();
2 weeks ago
if (CUTTING_SET_TIME2_1 != dicB["CUTTING_SET_TIME2_1"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TIME2_1, int.Parse(CUTTING_SET_TIME2_1));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TIME2_2 = HmiPointInfo.GetCUTTING_SET_TIME2_2.ToString();
2 weeks ago
if (CUTTING_SET_TIME2_2 != dicB["CUTTING_SET_TIME2_2"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TIME2_2, int.Parse(CUTTING_SET_TIME2_2));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TIME2_3 = HmiPointInfo.GetCUTTING_SET_TIME2_3.ToString();
2 weeks ago
if (CUTTING_SET_TIME2_3 != dicB["CUTTING_SET_TIME2_3"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TIME2_3, int.Parse(CUTTING_SET_TIME2_3));
2 weeks ago
}
2 weeks ago
var CUTTING_SET_TIME2_4 = HmiPointInfo.GetCUTTING_SET_TIME2_4.ToString();
2 weeks ago
if (CUTTING_SET_TIME2_4 != dicB["CUTTING_SET_TIME2_4"])
{
2 weeks ago
plc.Write(HmiPointInfo.CUTTING_SET_TIME2_4, int.Parse(CUTTING_SET_TIME2_4));
2 weeks ago
}
MessageBox.Show("保存成功");
1 month ago
}
1 week ago
private void button6_Click(object sender, EventArgs e)
{
WriteTrue(HmiPointInfo.CQ_QD1_counter_reset);
MessageBox.Show("清除成功");
}
private void WriteTrue(string address)
{
PlcConnect.Instance.Write(address, true);
}
private void button5_Click(object sender, EventArgs e)
{
WriteTrue(HmiPointInfo.CQ_QD2_counter_reset);
MessageBox.Show("清除成功");
}
private void button2_Click(object sender, EventArgs e)
{
WriteTrue(HmiPointInfo.CQ_MZD_counter_reset);
MessageBox.Show("清除成功");
}
1 month ago
}
}