Agganciati allarmi!!!
This commit is contained in:
Binary file not shown.
@@ -33,6 +33,7 @@ namespace MTC_Sim
|
||||
base.startAdapter(port);
|
||||
|
||||
// aggiungo altre condizioni specifiche...
|
||||
|
||||
mTemp.Normal();
|
||||
mFillLevel.Normal();
|
||||
}
|
||||
@@ -86,24 +87,57 @@ namespace MTC_Sim
|
||||
mMessage.Value = parentForm.datiProd.MessageText;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void addSystemAlarm(int numAllarme)
|
||||
{
|
||||
mAlarmSystem.Add(Condition.Level.FAULT, string.Format("ERR_{0:###}: Errore", numAllarme), string.Format("ERR_{0:###}", numAllarme));
|
||||
}
|
||||
protected void addPlcAlarm(int numAllarme)
|
||||
{
|
||||
mAlarmPLC.Add(Condition.Level.FAULT, string.Format("ERR_{0:###}: Errore", numAllarme), string.Format("ERR_{0:###}", numAllarme));
|
||||
}
|
||||
protected void addCncAlarm(int numAllarme)
|
||||
{
|
||||
mAlarmCNC.Add(Condition.Level.FAULT, string.Format("ERR_{0:###}: Errore", numAllarme), string.Format("ERR_{0:###}", numAllarme));
|
||||
}
|
||||
protected void addGenericAlarm(DataRefItem<int, string> allarme)
|
||||
{
|
||||
mAlarmGeneral.Add(Condition.Level.FAULT, string.Format("ERR_{0:###}: Errore {1}", allarme.Key, allarme.Value), string.Format("ERR_{0:###}_{1}", allarme.Key, allarme.Value));
|
||||
}
|
||||
|
||||
public override void getAlarms()
|
||||
{
|
||||
base.getAlarms();
|
||||
|
||||
if (parentForm.datiProd.err_01)
|
||||
mAlarmSystem.Add(Condition.Level.FAULT, "ERR_01: Yur Flaz Bat is flapping", "FLAZBAT");
|
||||
if (parentForm.datiProd.err_02)
|
||||
mAlarmSystem.Add(Condition.Level.WARNING, "ERR_02: Something went wrong", "AKAK");
|
||||
if (parentForm.datiProd.err_03)
|
||||
mAlarmSystem.Add(Condition.Level.FAULT, "ERR_03: No program loaded", "PROG");
|
||||
|
||||
if (parentForm.datiProd.err_04)
|
||||
mTemp.Add(Condition.Level.WARNING, "ERR_04: Temperature is too high", "OT");
|
||||
if (parentForm.datiProd.err_05)
|
||||
mAlarmCNC.Add(Condition.Level.FAULT, "ERR_05: Axis overload", "OL");
|
||||
if (parentForm.datiProd.err_06)
|
||||
mAlarmPLC.Add(Condition.Level.FAULT, "ERR_06: Travel outside boundaries", "OP");
|
||||
if (parentForm.systemAlarm.Count > 0)
|
||||
{
|
||||
foreach (Int32 alarm in parentForm.systemAlarm)
|
||||
{
|
||||
addSystemAlarm(alarm);
|
||||
}
|
||||
}
|
||||
if (parentForm.plcAlarm.Count > 0)
|
||||
{
|
||||
foreach (Int32 alarm in parentForm.plcAlarm)
|
||||
{
|
||||
addPlcAlarm(alarm);
|
||||
}
|
||||
}
|
||||
if (parentForm.cncAlarm.Count > 0)
|
||||
{
|
||||
foreach (Int32 alarm in parentForm.cncAlarm)
|
||||
{
|
||||
addCncAlarm(alarm);
|
||||
}
|
||||
}
|
||||
if (parentForm.genericAlarm.Count > 0)
|
||||
{
|
||||
foreach (DataRefItem<int, string> alarm in parentForm.genericAlarm)
|
||||
{
|
||||
addGenericAlarm(alarm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void getPath()
|
||||
|
||||
@@ -566,10 +566,11 @@ namespace MTC_Sim
|
||||
#region Conditions
|
||||
|
||||
// vettori vari: allarmi sistema, PLC, CNC ed allarmi HMI
|
||||
public Condition mAlarmSystem = new Condition("system");
|
||||
public Condition mAlarmSystem = new Condition("System");
|
||||
public Condition mAlarmCNC = new Condition("CNC");
|
||||
public Condition mAlarmPLC = new Condition("PLC");
|
||||
public Condition mAlarmHMI = new Condition("HMI");
|
||||
public Condition mAlarmGeneral = new Condition("General");
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -756,6 +757,7 @@ namespace MTC_Sim
|
||||
mAdapter.AddDataItem(mAlarmCNC);
|
||||
mAdapter.AddDataItem(mAlarmPLC);
|
||||
mAdapter.AddDataItem(mAlarmHMI);
|
||||
mAdapter.AddDataItem(mAlarmGeneral);
|
||||
}
|
||||
|
||||
|
||||
@@ -775,7 +777,8 @@ namespace MTC_Sim
|
||||
mAlarmSystem.Normal();
|
||||
mAlarmCNC.Normal();
|
||||
mAlarmPLC.Normal();
|
||||
mAlarmHMI.Normal();
|
||||
mAlarmCNC.Normal();
|
||||
mAlarmGeneral.Normal();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -595,13 +595,15 @@ namespace MTC_Sim
|
||||
answ.pzTot = pzOk + pzKo;
|
||||
|
||||
|
||||
#if false
|
||||
// allarmi...
|
||||
answ.err_01 = SysErr_01.Checked;
|
||||
answ.err_02 = SysErr_02.Checked;
|
||||
answ.err_03 = SysErr_03.Checked;
|
||||
answ.err_04 = PlcErr_01.Checked;
|
||||
answ.err_05 = PlcErr_02.Checked;
|
||||
answ.err_06 = PlcErr_03.Checked;
|
||||
answ.err_06 = PlcErr_03.Checked;
|
||||
#endif
|
||||
|
||||
|
||||
// ritorno oggetto!
|
||||
@@ -943,7 +945,7 @@ namespace MTC_Sim
|
||||
}
|
||||
}
|
||||
|
||||
public List<DataRefItem<int, string>> otherAlarm
|
||||
public List<DataRefItem<int, string>> genericAlarm
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -147,14 +147,6 @@ namespace MTC_Sim
|
||||
public int pzTot;
|
||||
public int pzOk;
|
||||
public int pzKo;
|
||||
|
||||
|
||||
public bool err_01;
|
||||
public bool err_02;
|
||||
public bool err_03;
|
||||
public bool err_04;
|
||||
public bool err_05;
|
||||
public bool err_06;
|
||||
}
|
||||
|
||||
public struct PathData
|
||||
|
||||
Reference in New Issue
Block a user