ancora altre variabili sistemate...
This commit is contained in:
@@ -4324,25 +4324,34 @@ namespace MTC_Adapter
|
||||
public bool procGiriTotUnOp(bool needSave)
|
||||
{
|
||||
uint delta = 0;
|
||||
uint valore = 0;
|
||||
string outString = string.Format("UnOp_[1-{0}]_KRev: ", currAdpConf.nUnOp);
|
||||
for (int i = 0; i < currAdpConf.nUnOp; i++)
|
||||
{
|
||||
delta = Convert.ToUInt32(istGiriElettrom[i].vcMedian) - contGiriElettrom[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
// procedo solo SE HO FINESTRA VALIDA...
|
||||
if (istGiriElettrom[i].vcValid)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
uint contatore = updateValUIntByIncr(i, delta, "UnOp_{0:00}_AccTime");
|
||||
// passo valore num giri (migliaia) all'adapter
|
||||
vettUnOp[i].mUnOpAccTime.Value = contatore;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
valore = Convert.ToUInt32(istGiriElettrom[i].vcMedian);
|
||||
if (valore >= contGiriElettrom[i])
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
delta = valore - contGiriElettrom[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
uint contatore = updateValUIntByIncr(i, delta, "UnOp_{0:00}_AccTime");
|
||||
// passo valore num giri (migliaia) all'adapter
|
||||
vettUnOp[i].mUnOpAccTime.Value = contatore;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
contGiriElettrom[i] = Convert.ToUInt32(istGiriElettrom[i].vcMedian);
|
||||
contGiriElettrom[i] = valore;
|
||||
}
|
||||
outString += string.Format("{0} | ", vettUnOp[i].mUnOpAccTime.Value);
|
||||
}
|
||||
@@ -4358,25 +4367,34 @@ namespace MTC_Adapter
|
||||
public bool procNumCU(bool needSave)
|
||||
{
|
||||
uint delta = 0;
|
||||
uint valore = 0;
|
||||
string outString = string.Format("UnOp_[1-{0}]_NumCU: ", currAdpConf.nUnOp);
|
||||
for (int i = 0; i < currAdpConf.nUnOp; i++)
|
||||
{
|
||||
delta = Convert.ToUInt32(istNumCambiUt[i].vcMedian) - currNumCambiUt[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
// procedo solo SE HO FINESTRA VALIDA...
|
||||
if (istNumCambiUt[i].vcValid)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
uint contatore = updateValUIntByIncr(i, delta, "UnOp_{0:00}_NumCU");
|
||||
// passo valore num CU all'adapter
|
||||
vettUnOp[i].mUnOpNumCU.Value = contatore;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
valore = Convert.ToUInt32(istNumCambiUt[i].vcMedian);
|
||||
if (valore >= currNumCambiUt[i])
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
delta = valore - currNumCambiUt[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
uint contatore = updateValUIntByIncr(i, delta, "UnOp_{0:00}_NumCU");
|
||||
// passo valore num CU all'adapter
|
||||
vettUnOp[i].mUnOpNumCU.Value = contatore;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
currNumCambiUt[i] = Convert.ToUInt32(istNumCambiUt[i].vcMedian);
|
||||
currNumCambiUt[i] = valore;
|
||||
}
|
||||
outString += string.Format("{0} | ", vettUnOp[i].mUnOpNumCU.Value);
|
||||
}
|
||||
@@ -4392,25 +4410,34 @@ namespace MTC_Adapter
|
||||
public bool procMovTotAssi(bool needSave)
|
||||
{
|
||||
double delta = 0;
|
||||
uint valore = 0;
|
||||
string outString = string.Format("Axis_[1-{0}]_DistDone: ", currAdpConf.nAxis);
|
||||
for (int i = 0; i < currAdpConf.nAxis; i++)
|
||||
{
|
||||
delta = Convert.ToUInt32(istDistMovAssi[i].vcMedian) - contDistMovAssi[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < double.MaxValue / 2)
|
||||
// procedo solo SE HO FINESTRA VALIDA...
|
||||
if (istDistMovAssi[i].vcValid)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
double contTot = updateValDoubleByIncr(i, delta, "Axis_{0:00}_DistDone");
|
||||
// passo valore totale all'adapter
|
||||
vettAxis[i].mAxDistDone.Value = contTot.ToString("0.000", CultureInfo.InvariantCulture);
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
valore = Convert.ToUInt32(istDistMovAssi[i].vcMedian);
|
||||
if (valore >= contDistMovAssi[i])
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
delta = valore - contDistMovAssi[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < double.MaxValue / 2)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
double contTot = updateValDoubleByIncr(i, delta, "Axis_{0:00}_DistDone");
|
||||
// passo valore totale all'adapter
|
||||
vettAxis[i].mAxDistDone.Value = contTot.ToString("0.000", CultureInfo.InvariantCulture);
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
contDistMovAssi[i] = Convert.ToUInt32(istDistMovAssi[i].vcMedian);
|
||||
contDistMovAssi[i] = valore;
|
||||
}
|
||||
outString += string.Format("{0} | ", vettAxis[i].mAxDistDone.Value);
|
||||
}
|
||||
@@ -4426,24 +4453,33 @@ namespace MTC_Adapter
|
||||
public bool procAccTimeAssi(bool needSave)
|
||||
{
|
||||
double delta = 0;
|
||||
uint valore = 0;
|
||||
string outString = string.Format("Axis_[1-{0}]_AccTime: ", currAdpConf.nAxis);
|
||||
for (int i = 0; i < currAdpConf.nAxis; i++)
|
||||
{
|
||||
delta = Convert.ToUInt32(istAccTimeAssi[i].vcMedian) - contAccTimeAssi[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < double.MaxValue / 2)
|
||||
// procedo solo SE HO FINESTRA VALIDA...
|
||||
if (istAccTimeAssi[i].vcValid)
|
||||
{
|
||||
// salvo valore aggiuntivo x ore lavoro assi...
|
||||
double oreTot = updateValDoubleByIncr(i, delta, "Axis_{0:00}_AccTime");
|
||||
vettAxis[i].mAxAccTime.Value = oreTot.ToString("0.000", CultureInfo.InvariantCulture);
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
valore = Convert.ToUInt32(istAccTimeAssi[i].vcMedian);
|
||||
if (valore >= contAccTimeAssi[i])
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
delta = valore - contAccTimeAssi[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < double.MaxValue / 2)
|
||||
{
|
||||
// salvo valore aggiuntivo x ore lavoro assi...
|
||||
double oreTot = updateValDoubleByIncr(i, delta, "Axis_{0:00}_AccTime");
|
||||
vettAxis[i].mAxAccTime.Value = oreTot.ToString("0.000", CultureInfo.InvariantCulture);
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
contAccTimeAssi[i] = Convert.ToUInt32(istAccTimeAssi[i].vcMedian);
|
||||
contAccTimeAssi[i] = valore;
|
||||
}
|
||||
outString += string.Format("{0} | ", vettAxis[i].mAxAccTime.Value);
|
||||
}
|
||||
@@ -4459,25 +4495,34 @@ namespace MTC_Adapter
|
||||
public bool procNumInvAssi(bool needSave)
|
||||
{
|
||||
long delta = 0;
|
||||
uint valore = 0;
|
||||
string outString = string.Format("Axis_[1-{0}]_InvDDone: ", currAdpConf.nAxis);
|
||||
for (int i = 0; i < currAdpConf.nAxis; i++)
|
||||
{
|
||||
delta = Convert.ToUInt32(istNumInvAssi[i].vcMedian) - contNumInvAssi[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < long.MaxValue / 2)
|
||||
// procedo solo SE HO FINESTRA VALIDA...
|
||||
if (istNumInvAssi[i].vcValid)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
long contTot = updateValLongByIncr(i, delta, "Axis_{0:00}_InvDDone");
|
||||
// passo valore totale all'adapter
|
||||
vettAxis[i].mAxInvDDone.Value = contTot;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
valore = Convert.ToUInt32(istNumInvAssi[i].vcMedian);
|
||||
if (valore >= contNumInvAssi[i])
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
delta = valore - contNumInvAssi[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < long.MaxValue / 2)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
long contTot = updateValLongByIncr(i, delta, "Axis_{0:00}_InvDDone");
|
||||
// passo valore totale all'adapter
|
||||
vettAxis[i].mAxInvDDone.Value = contTot;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
contNumInvAssi[i] = Convert.ToUInt32(istNumInvAssi[i].vcMedian);
|
||||
contNumInvAssi[i] = valore;
|
||||
}
|
||||
outString += string.Format("{0} | ", vettAxis[i].mAxInvDDone.Value);
|
||||
}
|
||||
@@ -4493,25 +4538,34 @@ namespace MTC_Adapter
|
||||
public bool procVacPump(bool needSave)
|
||||
{
|
||||
uint delta = 0;
|
||||
uint valore = 0;
|
||||
string outString = string.Format("VacPump_[1-{0}]_WrkTime: ", currAdpConf.nVacuumPump);
|
||||
for (int i = 0; i < currAdpConf.nVacuumPump; i++)
|
||||
{
|
||||
delta = Convert.ToUInt32(istVacPumpWrkTime[i].vcMedian) - currVacPumpWrkTime[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
// procedo solo SE HO FINESTRA VALIDA...
|
||||
if (istVacPumpWrkTime[i].vcValid)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
uint contTot = updateValUIntByIncr(i, delta, "VacPump_{0:00}_WrkTime");
|
||||
// passo valore totale all'adapter
|
||||
vettVacPump[i].mVacPumpWrkTime.Value = contTot;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
valore = Convert.ToUInt32(istVacPumpWrkTime[i].vcMedian);
|
||||
if (valore >= currVacPumpWrkTime[i])
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
delta = valore - currVacPumpWrkTime[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
uint contTot = updateValUIntByIncr(i, delta, "VacPump_{0:00}_WrkTime");
|
||||
// passo valore totale all'adapter
|
||||
vettVacPump[i].mVacPumpWrkTime.Value = contTot;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
currVacPumpWrkTime[i] = Convert.ToUInt32(istVacPumpWrkTime[i].vcMedian);
|
||||
currVacPumpWrkTime[i] = valore;
|
||||
}
|
||||
outString += string.Format("{0} | ", vettVacPump[i].mVacPumpWrkTime.Value);
|
||||
}
|
||||
@@ -4527,25 +4581,34 @@ namespace MTC_Adapter
|
||||
public bool procVacAct(bool needSave)
|
||||
{
|
||||
uint delta = 0;
|
||||
uint valore = 0;
|
||||
string outString = string.Format("VacPump_[1-{0}]_Count: ", currAdpConf.nVacuumPump);
|
||||
for (int i = 0; i < currAdpConf.nVacuumAct; i++)
|
||||
{
|
||||
delta = Convert.ToUInt32(istVacActCount[i].vcMedian) - currVacActCount[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
// procedo solo SE HO FINESTRA VALIDA...
|
||||
if (istVacActCount[i].vcValid)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
uint contTot = updateValUIntByIncr(i, delta, "VacAct_{0:00}_Count");
|
||||
// passo valore totale all'adapter
|
||||
vettVacAct[i].mVacActCount.Value = contTot;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
valore = Convert.ToUInt32(istVacActCount[i].vcMedian);
|
||||
if (valore >= currVacActCount[i])
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
delta = valore - currVacActCount[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
{
|
||||
// processo comunque sempre...
|
||||
uint contTot = updateValUIntByIncr(i, delta, "VacAct_{0:00}_Count");
|
||||
// passo valore totale all'adapter
|
||||
vettVacAct[i].mVacActCount.Value = contTot;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
currVacActCount[i] = Convert.ToUInt32(istVacActCount[i].vcMedian);
|
||||
currVacActCount[i] = valore;
|
||||
}
|
||||
outString += string.Format("{0} | ", vettVacAct[i].mVacActCount.Value);
|
||||
}
|
||||
@@ -4654,8 +4717,6 @@ namespace MTC_Adapter
|
||||
if (valore >= currSlittaMag[i])
|
||||
{
|
||||
delta = valore - currSlittaMag[i];
|
||||
|
||||
delta = Convert.ToUInt32(istSlittaMag[i].vcMedian) - currSlittaMag[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
{
|
||||
@@ -4672,7 +4733,7 @@ namespace MTC_Adapter
|
||||
}
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
currSlittaMag[i] = Convert.ToUInt32(istSlittaMag[i].vcMedian);
|
||||
currSlittaMag[i] = valore;
|
||||
}
|
||||
outString += string.Format("{0} | ", vettSlittaMag[i].mSlittaMagCount.Value);
|
||||
}
|
||||
@@ -4698,7 +4759,6 @@ namespace MTC_Adapter
|
||||
if (valore >= currProtMag[i])
|
||||
{
|
||||
delta = valore - currProtMag[i];
|
||||
delta = Convert.ToUInt32(istProtMag[i].vcMedian) - currProtMag[i];
|
||||
// controllo delta < 50% max...
|
||||
if (delta < uint.MaxValue / 2)
|
||||
{
|
||||
@@ -4715,7 +4775,7 @@ namespace MTC_Adapter
|
||||
}
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
currProtMag[i] = Convert.ToUInt32(istProtMag[i].vcMedian);
|
||||
currProtMag[i] = valore;
|
||||
}
|
||||
outString += string.Format("{0} | ", vettProtMag[i].mProtMagCount.Value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user