1. 데이터 수신전에는 알람이 울리지 않도록 함

This commit is contained in:
2025-07-01 23:02:33 +09:00
parent f480b508b7
commit 7e3f87542c
7 changed files with 102 additions and 52 deletions

View File

@@ -96,7 +96,7 @@ namespace vmsnet
this.DispCtrl1.Size = new System.Drawing.Size(774, 699);
this.DispCtrl1.TabIndex = 3;
this.DispCtrl1.Times = null;
this.DispCtrl1.Values = null;
this.DispCtrl1._Values = null;
this.DispCtrl1.OnAlamChange += DispCtrl1_OnAlamChangeL;
this.DispCtrl1.OnChangedShowIndex += DispCtrl1_OnChangedShowIndex;
this.DispCtrl1.OnClickCell += DispCtrl1_OnClickCell;
@@ -1249,7 +1249,8 @@ namespace vmsnet
if (maxunno < 0) maxunno = 5;
if (maxchno < 0) maxchno = 59;
PUB.Values = new int[maxmcno + 1, maxunno + 1, maxchno + 1];
PUB._Values = new int[maxmcno + 1, maxunno + 1, maxchno + 1];
PUB.Received = new bool[maxmcno + 1, maxunno + 1, maxchno + 1];
PUB.Times = new string[maxmcno + 1, maxunno + 1, maxchno + 1];
PUB.ChNos = new int[maxmcno + 1, maxunno + 1, maxchno + 1];
PUB.ChVOffset = new float[maxmcno + 1, maxunno + 1, maxchno + 1];
@@ -1263,7 +1264,8 @@ namespace vmsnet
{
for (int k = 0; k <= maxchno; k++)
{
PUB.Values[c, i, k] = 0;
PUB._Values[c, i, k] = 0;
PUB.Received[c, i, k] = false;
PUB.Times[c, i, k] = "";
PUB.ChVOffset[c, i, k] = 0f;
PUB.ChDecPos[c, i, k] = 0;
@@ -1289,7 +1291,8 @@ namespace vmsnet
PUB.StatusMSG("Ready...");
this.DispCtrl1.initmsg = "Complete";
this.DispCtrl1.init = true;
this.DispCtrl1.Values = PUB.Values;
this.DispCtrl1._Values = PUB._Values;
this.DispCtrl1.Received = PUB.Received;
this.DispCtrl1.Times = PUB.Times;
this.DispCtrl1.SmallSize = PUB.CONFIG.viewSize; ////개별표시모드일떄 사용하는 윈도우의 크기
this.DispCtrl1.FullScreen = true;

View File

@@ -64,7 +64,7 @@ namespace vmsnet
this.DispCtrl1.Size = new System.Drawing.Size(774, 699);
this.DispCtrl1.TabIndex = 3;
this.DispCtrl1.Times = null;
this.DispCtrl1.Values = null;
this.DispCtrl1._Values = null;
this.DispCtrl1.OnAlamChange += DispCtrl1_OnAlamChangeL;
this.DispCtrl1.OnChangedShowIndex += DispCtrl1_OnChangedShowIndex;
this.DispCtrl1.OnClickCell += DispCtrl1_OnClickCell;
@@ -768,7 +768,8 @@ namespace vmsnet
PUB.StatusMSG("Ready...");
this.DispCtrl1.initmsg = "Complete";
this.DispCtrl1.init = true;
this.DispCtrl1.Values = PUB.Values;
this.DispCtrl1._Values = PUB._Values;
this.DispCtrl1.Received = PUB.Received;
this.DispCtrl1.Times = PUB.Times;
//Me.DispCtrl1.WINDOW.restarttime = CONFIG.Restart
this.DispCtrl1.SmallSize = System.Convert.ToInt32(PUB.CONFIG.viewSize);

View File

@@ -69,6 +69,7 @@ namespace vmsnet.HMI
private String _value = "";
public int value2 = 0; //소수자리가 들어가기전의 값
public bool received = false;
public Single CurValue =0f;
public Single CurValue1 = 0f;
@@ -92,6 +93,7 @@ namespace vmsnet.HMI
BarRect = new RectangleF(0, 0, 0, 0);
_value = "";
value2 = 0;
received = false;
mtime = "";
idx = 0;
// detailform = null;

View File

@@ -129,7 +129,8 @@ namespace vmsnet.HMI
// }
//}
private int[,,] values;
private bool[,,] received;
private int[,,] _values;
private String[,,] times;
private Boolean _init = false; //그리드초기화완료여부
@@ -309,10 +310,20 @@ namespace vmsnet.HMI
#region *** Constructors ***
public int[,,] Values
/// <summary>
/// 데이터를 수신했는지
/// </summary>
public bool[,,] Received
{
get { return this.values; }
set { this.values = value; }
get { return this.received; }
set { this.received = value; }
}
public int[,,] _Values
{
get { return this._values; }
set { this._values = value; }
}
public String[,,] Times
@@ -670,9 +681,10 @@ namespace vmsnet.HMI
//값의 저장소가 아에없다면?
//Boolean OverDATA = false;
var alarmRemark = string.Empty;
if (this.Values == null)
if (this._Values == null)
{
Item.value2 = 0;
Item.received = false;
Item.CurValue = 0f;
Item.CurValue1 = 0f;
TimeStr = "Null Error";
@@ -685,6 +697,7 @@ namespace vmsnet.HMI
if (!Item.) //사용여부자체를 설정한다.
{
Item.value2 = 0;
Item.received = false;
Item.alamv = -999;
Item.CurValue = 0f; //미설정상태라면 값을 표시하지 않는다.
Item.CurValue1 = 0f;
@@ -698,18 +711,20 @@ namespace vmsnet.HMI
//Br = new SolidBrush(Color.Black);
Offset = Item.Offset; //수동으로입력된 옾셋
var u1 = this.Values.GetUpperBound(0);
var u2 = this.Values.GetUpperBound(1);
var u3 = this.Values.GetUpperBound(2);
var u1 = this._Values.GetUpperBound(0);
var u2 = this._Values.GetUpperBound(1);
var u3 = this._Values.GetUpperBound(2);
if (Item.idx_dev >= 0 && Item.idx_unit >= 0 && Item.idx_ch >= 0 &&
Item.idx_dev <= u1 && Item.idx_unit <= u2 && Item.idx_ch <= u3)
{
Item.value2 = this.Values[Item.idx_dev, Item.idx_unit, Item.idx_ch]; //측정값
Item.value2 = this._Values[Item.idx_dev, Item.idx_unit, Item.idx_ch]; //측정값
TimeStr = this.Times[Item.idx_dev, Item.idx_unit, Item.idx_ch]; //측정시간
Item.received = this.Received[Item.idx_dev, Item.idx_unit, Item.idx_ch]; //수신여부
}
else
{
Item.value2 = 0;
Item.received = false;
TimeStr = "";
}
@@ -791,7 +806,12 @@ namespace vmsnet.HMI
if (Item.alamv == -999 || Item.alamv == 0) Item.alamv = Item.CurValue;
Item. = "AUTO";
if (Item.CurValue > Item.alamv) //큰값이 있을경우 상한선을 확인한다.
if (Item.received == false)
{
Item.onalamh = false;
Item.onalaml = false;
}
else if (Item.CurValue > Item.alamv) //큰값이 있을경우 상한선을 확인한다.
{
Single gap = Math.Abs(Item.CurValue - Item.alamv);
if (gap >= Math.Abs(Item.aalamh))
@@ -818,7 +838,12 @@ namespace vmsnet.HMI
else if (grp.AlarmType == "MANUAL")
{
Item. = "MANUAL";
if (Item.CurValue >= Item.alamh)
if (Item.received == false)
{
Item.onalamh = false;
Item.onalaml = false;
}
else if (Item.CurValue >= Item.alamh)
{
Item.onalamh = true;
Item.onalaml = false;
@@ -842,7 +867,12 @@ namespace vmsnet.HMI
break;
case COMM.EALAMTYPE.:
Item. = "MANUAL";
if (Item.CurValue >= Item.alamh)
if (Item.received == false)
{
Item.onalamh = false;
Item.onalaml = false;
}
else if (Item.CurValue >= Item.alamh)
{
Item.onalamh = true;
Item.onalaml = false;
@@ -864,7 +894,12 @@ namespace vmsnet.HMI
/* 작성자: 이재웅, 작성일: 2025-06-17, 작성내용: 'Item.alamv == 0' OR조건 추가 */
if (Item.alamv == -999 || Item.alamv == 0) Item.alamv = Item.CurValue;
if (Item.CurValue > Item.alamv) //큰값이 있을경우 상한선을 확인한다.
if (Item.received == false)
{
Item.onalamh = false;
Item.onalaml = false;
}
else if (Item.CurValue > Item.alamv) //큰값이 있을경우 상한선을 확인한다.
{
Single gap = Math.Abs(Item.CurValue - Item.alamv);
if (gap >= Math.Abs(Item.aalamh))
@@ -934,7 +969,7 @@ namespace vmsnet.HMI
}
}
if (!Item. && Item.)
if ((!Item. && Item.) || Item.received == false)
{
Item._onalamover = false;
Item._onalamh = false;
@@ -954,6 +989,10 @@ namespace vmsnet.HMI
BrColor = (Color.DarkMagenta);
grp._errorcount += 1;
}
else if (Item.received == false)
{
ValueStr = "--";
}
else if (!Item.)
{
ValueStr = "--";
@@ -1306,7 +1345,7 @@ namespace vmsnet.HMI
try
{
grp._ampdecpos = 3;
grp._amp = (float)(this.Values[di1, di2, di3 - 1] / (Math.Pow(10, grp._ampdecpos)));
grp._amp = (float)(this._Values[di1, di2, di3 - 1] / (Math.Pow(10, grp._ampdecpos)));
}
catch
{

View File

@@ -74,7 +74,7 @@ namespace vmsnet
try
{
PUB.KA1_SUM += (float)(PUB.Values[di1, di2, di3 - 1] / (Math.Pow(10, _ampdecpos)));
PUB.KA1_SUM += (float)(PUB._Values[di1, di2, di3 - 1] / (Math.Pow(10, _ampdecpos)));
}
catch { }
}
@@ -89,7 +89,7 @@ namespace vmsnet
try
{
PUB.KA2_SUM += (float)(PUB.Values[di1, di2, di3 - 1] / (Math.Pow(10, _ampdecpos)));
PUB.KA2_SUM += (float)(PUB._Values[di1, di2, di3 - 1] / (Math.Pow(10, _ampdecpos)));
}
catch { }
}

View File

@@ -15,7 +15,7 @@ namespace vmsnet
}
//셀정보자동저장
if (PUB.CONFIG.savetermcellinfo > 0)
if (PUB.sm != null && PUB.sm.Step == ESMStep.RUN && PUB.CONFIG.savetermcellinfo > 0)
{
var ts_saveCellinfo = DateTime.Now - PUB.LastWindowCellinfoSaved;
if (ts_saveCellinfo.TotalMinutes > PUB.CONFIG.savetermcellinfo)

View File

@@ -48,10 +48,14 @@ namespace vmsnet
public static DigitalIndicator indicator;
public static int sleepoffset = 0; ////쓰레드슬립시간
/// <summary>
/// 데이터를 수신받았는지 체크
/// </summary>
public static bool[,,] Received;
/// <summary>
/// 측정값(전압)이 들어있다(mcidx/unitno/chidx)
/// </summary>
public static int[,,] Values;
public static int[,,] _Values;
/// <summary>
/// 측정값(시간)이 들어있다(mcidx/unitno/chidx)
/// yyyy-MM-dd HH:mm:ss
@@ -221,16 +225,17 @@ namespace vmsnet
/// <returns></returns>
public static bool AddMeasureValue(int mcidx, int unit, int ch, int value, string time)
{
var l0 = PUB.Values.GetUpperBound(0) + 1; //mc array size
var l1 = PUB.Values.GetUpperBound(1) + 1; //unit array size
var l2 = PUB.Values.GetUpperBound(2) + 1; //ch array size
var l0 = PUB._Values.GetUpperBound(0) + 1; //mc array size
var l1 = PUB._Values.GetUpperBound(1) + 1; //unit array size
var l2 = PUB._Values.GetUpperBound(2) + 1; //ch array size
if (mcidx < l0 && unit < l1 && ch > 0 && ch <= l2)
{
try
{
PUB.Values[mcidx, unit, ch - 1] = value;
PUB._Values[mcidx, unit, ch - 1] = value;
PUB.Times[mcidx, unit, ch - 1] = time;
PUB.Received[mcidx, unit, ch - 1] = true;
return true;
}
catch (Exception)