add - 控件可行性分析

wangsr
wangsr 12 months ago
parent c795500b11
commit 0b9c8b3233

@ -54,4 +54,24 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl.Entity
public HslSwitch HslSwitch8 { get; set; }
}
public class HslLedDisplayEntity
{
public HslLedDisplay WetWaitDisPlay1 { get; set; }
public HslLedDisplay WetWaitDisPlay2 { get; set; }
public HslLedDisplay WetWaitDisPlay3 { get; set; }
public HslLedDisplay WetWaitDisPlay4 { get; set; }
public HslLedDisplay WetWaitDisPlay5 { get; set; }
public HslLedDisplay WetWaitDisPlay6 { get; set; }
public HslLedDisplay WetWaitDisPlay7 { get; set; }
public HslLedDisplay WetWaitDisPlay8 { get; set; }
public HslLedDisplay RGVWaitDisPlay1 { get; set; }
public HslLedDisplay RGVWaitDisPlay2 { get; set; }
public HslLedDisplay RGVWaitDisPlay3 { get; set; }
public HslLedDisplay RGVWaitDisPlay4 { get; set; }
public HslLedDisplay RGVWaitDisPlay5 { get; set; }
public HslLedDisplay RGVWaitDisPlay6 { get; set; }
public HslLedDisplay RGVWaitDisPlay7 { get; set; }
public HslLedDisplay RGVWaitDisPlay8 { get; set; }
}
}

@ -89,6 +89,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
LjSwithEntity SwithE = new LjSwithEntity();
ThreeWayValveEntity ThreeValveE = new ThreeWayValveEntity();
DeviceDetailEntity DetailE = new DeviceDetailEntity();
HslLedDisplayEntity LedDisplayE = new HslLedDisplayEntity();
#endregion
@ -145,10 +146,10 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
AllAlarmTable = DBHelp.GetTable(@"SELECT Alarm_ID, Alarm_Block, Alarm_Word, Alarm_Bit, Alarm_Cn_Info, Alarm_Other_Info FROM Pmt_Alarm");
timer = new Timer();
timer.Interval = 1000;
timer.Enabled = true;
timer.Tick += GetPlcValue;//添加事件
//timer = new Timer();
//timer.Interval = 1000;
//timer.Enabled = true;
//timer.Tick += GetPlcValue;//添加事件
}
@ -168,6 +169,26 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
ControlsHelper.ControlImport<ControlCabinet>(ControlCabinetE, Controls);
ControlsHelper.ControlImport<LjSwith>(SwithE, Controls);
ControlsHelper.ControlImport<ThreeWayValve>(ThreeValveE, Controls);
ControlsHelper.ControlImport<HslLedDisplay>(LedDisplayE, Controls);
Type ledDisplayType = LedDisplayE.GetType();
PropertyInfo[] properties = ledDisplayType.GetProperties();
foreach (PropertyInfo sourceProperty in properties)
{
string name = sourceProperty.Name;
PropertyInfo property = ledDisplayType.GetProperty(name);
HslLedDisplay ledDisplay = (HslLedDisplay)property.GetValue(LedDisplayE);
//bottle.Value = n * i++;
ledDisplay.BackColor = Color.FromArgb(46, 46, 46);
ledDisplay.DisplayBackColor = Color.FromArgb(62, 62, 62);
ledDisplay.DisplayNumber = 5;
ledDisplay.DisplayText = "12:00";
ledDisplay.ForeColor = Color.Pink;
ledDisplay.LedNumberSize = 2;
ledDisplay.Margin = new Padding(1, 1, 1, 1);
ledDisplay.TabIndex = 8;
property.SetValue(LedDisplayE, ledDisplay);
}
}
#endregion
@ -360,6 +381,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
case 1:
LabelE.WetWait1.Text = MixWaitTime(record);
LabelE.WetWait1.ForeColor = MixTimeBackColor(record);
LedDisplayE.WetWaitDisPlay1.DisplayText = "12:45";
LabelE.RGVWait1.Text = "0";
break;
case 2:

@ -8,23 +8,24 @@ namespace DataBlockHelper.DBHelpers
public static List<bool> ReadDb()
{
List<bool> ls = new List<bool>();
var operateResult = PlcConnect.Instance.Read("DB3000.0.0",1);
var operateResult = PlcConnect.Instance.Read("DB3000.0.0", 1);
if (operateResult.IsSuccess)
{
var context = operateResult.Content;
for (var i = 0; i < 6; i++)
{
var bo= context.GetBoolByIndex(i);
var bo = context.GetBoolByIndex(i);
ls.Add(bo);
}
}
else
{
for (var i = 0; i < 6; i++)
{
ls.Add(false);
}
}
return ls;
}
@ -34,7 +35,8 @@ namespace DataBlockHelper.DBHelpers
/// </summary>
/// <returns></returns>
public static List<bool> ReadModel() {
public static List<bool> ReadModel()
{
List<bool> ls = new List<bool>();
var operateResult = PlcConnect.Instance.Read("DB3000.2.0", 1);
@ -42,21 +44,29 @@ namespace DataBlockHelper.DBHelpers
{
var context = operateResult.Content;
for (var i = 0; i <8; i++)
for (var i = 0; i < 8; i++)
{
var bo = context.GetBoolByIndex(i);
ls.Add(bo);
}
}
else
{
for (var i = 0; i < 8; i++)
{
ls.Add(false);
}
}
return ls;
}
public static void WriteModel(int no,bool b)
public static void WriteModel(int no, bool b)
{
int id = no - 1;
string address = $"DB3000.2.{id}";
PlcConnect.Instance.Write(address,b);
PlcConnect.Instance.Write(address, b);
}
}
}

@ -1,6 +1,86 @@
<Object type="Mesnac.Gui.Common.FrmRunTemplate, Mesnac.Gui.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MainDetail" children="Controls">
<Object type="System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Panel1" children="Controls">
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="RGVWaitDisPlay8" children="Controls">
<Property name="Location">1775, 659</Property>
<Property name="Name">RGVWaitDisPlay8</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="RGVWaitDisPlay7" children="Controls">
<Property name="Location">1694, 659</Property>
<Property name="Name">RGVWaitDisPlay7</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WetWaitDisPlay8" children="Controls">
<Property name="Location">1775, 631</Property>
<Property name="Name">WetWaitDisPlay8</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WetWaitDisPlay7" children="Controls">
<Property name="Location">1694, 631</Property>
<Property name="Name">WetWaitDisPlay7</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="RGVWaitDisPlay6" children="Controls">
<Property name="Location">1467, 659</Property>
<Property name="Name">RGVWaitDisPlay6</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="RGVWaitDisPlay5" children="Controls">
<Property name="Location">1386, 659</Property>
<Property name="Name">RGVWaitDisPlay5</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WetWaitDisPlay6" children="Controls">
<Property name="Location">1467, 631</Property>
<Property name="Name">WetWaitDisPlay6</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WetWaitDisPlay5" children="Controls">
<Property name="Location">1386, 631</Property>
<Property name="Name">WetWaitDisPlay5</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="RGVWaitDisPlay4" children="Controls">
<Property name="Location">1221, 659</Property>
<Property name="Name">RGVWaitDisPlay4</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="RGVWaitDisPlay3" children="Controls">
<Property name="Location">1140, 659</Property>
<Property name="Name">RGVWaitDisPlay3</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WetWaitDisPlay4" children="Controls">
<Property name="Location">1221, 631</Property>
<Property name="Name">WetWaitDisPlay4</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WetWaitDisPlay3" children="Controls">
<Property name="Location">1140, 631</Property>
<Property name="Name">WetWaitDisPlay3</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="RGVWaitDisPlay2" children="Controls">
<Property name="Location">915, 659</Property>
<Property name="Name">RGVWaitDisPlay2</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="RGVWaitDisPlay1" children="Controls">
<Property name="Location">834, 659</Property>
<Property name="Name">RGVWaitDisPlay1</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WetWaitDisPlay2" children="Controls">
<Property name="Location">915, 631</Property>
<Property name="Name">WetWaitDisPlay2</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslLedDisplay, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="WetWaitDisPlay1" children="Controls">
<Property name="Location">834, 631</Property>
<Property name="Name">WetWaitDisPlay1</Property>
<Property name="Size">72, 22</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="RGVWait8" children="Controls">
<Property name="Format" />
<Property name="TextName" />
@ -1890,7 +1970,6 @@
<Property name="Size">31, 15</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM2BSF01L" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">1185, 423</Property>
<Property name="Name">DM2BSF01L</Property>
@ -1903,7 +1982,6 @@
<Property name="Size">31, 15</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM2CSF01L" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">1425, 423</Property>
<Property name="Name">DM2CSF01L</Property>
@ -1916,7 +1994,6 @@
<Property name="Size">31, 15</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM2DSF01L" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">1739, 423</Property>
<Property name="Name">DM2DSF01L</Property>
@ -1929,7 +2006,6 @@
<Property name="Size">31, 15</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM2ASF01L" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">878, 423</Property>
<Property name="Name">DM2ASF01L</Property>
@ -2443,42 +2519,36 @@
<Property name="Size">41, 14</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM1CSF01" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">143, 12</Property>
<Property name="Name">DM1CSF01</Property>
<Property name="Size">41, 14</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM1FSF01" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">279, 29</Property>
<Property name="Name">DM1FSF01</Property>
<Property name="Size">41, 14</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM1JSF01" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">409, 29</Property>
<Property name="Name">DM1JSF01</Property>
<Property name="Size">41, 14</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM1ISF01" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">397, 12</Property>
<Property name="Name">DM1ISF01</Property>
<Property name="Size">41, 14</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM1NSF01" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">543, 28</Property>
<Property name="Name">DM1NSF01</Property>
<Property name="Size">41, 14</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM1MSF01" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">531, 12</Property>
<Property name="Name">DM1MSF01</Property>
@ -3315,7 +3385,6 @@
<Property name="Size">6, 1</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.LSCREWBIG, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="DM1DSF01" children="Controls">
<Property name="StatusName" />
<Property name="Status">ylNormal</Property>
<Property name="Location">153, 29</Property>
<Property name="Name">DM1DSF01</Property>

Loading…
Cancel
Save