diff --git a/MTC_Sim/MTC_Sim/AdapterGeneric.cs b/MTC_Sim/MTC_Sim/AdapterGeneric.cs
index de3a67a..68e30e8 100644
--- a/MTC_Sim/MTC_Sim/AdapterGeneric.cs
+++ b/MTC_Sim/MTC_Sim/AdapterGeneric.cs
@@ -610,6 +610,10 @@ namespace MTC_Adapter
/// Vettore ATTUALE dei contatori del Lubro
///
public uint[] currLubroCount;
+ ///
+ /// Vettore ATTUALE dei contatori del tempo cumulato lavoro degli assi (h)
+ ///
+ public double[] contAxisAccumTime;
///
@@ -652,6 +656,14 @@ namespace MTC_Adapter
/// Vettore ISTANTANEO dei contatori del Lubro
///
public uint[] istLubroCount;
+ ///
+ /// Vettore ISTANTANEO dei contatori del tempo cumulato lavoro degli assi (h)
+ ///
+ public double[] istAxisAccumTime;
+ ///
+ /// data-ora ultimo controllo movimento assi
+ ///
+ public DateTime lastChekAccumTimeAxis;
///
/// posizione precedente assi per calcolo distanze...
@@ -1245,6 +1257,9 @@ namespace MTC_Adapter
istDistMovAssi = new uint[currAdpConf.nAxis];
contNumInvAssi = new uint[currAdpConf.nAxis];
istNumInvAssi = new uint[currAdpConf.nAxis];
+ contAxisAccumTime = new double[currAdpConf.nAxis];
+ istAxisAccumTime = new double[currAdpConf.nAxis];
+ lastChekAccumTimeAxis = DateTime.Now;
for (int i = 0; i < currAdpConf.nAxis; i++)
{
// leggo tutti i dati...
@@ -1252,9 +1267,11 @@ namespace MTC_Adapter
// punto all'item
DataRefItem riContDist = listaDR.Find(x => x.Key == string.Format("Axis_{0:00}_DistDone", i + 1));
DataRefItem riNumInv = listaDR.Find(x => x.Key == string.Format("Axis_{0:00}_Invers", i + 1));
+ DataRefItem riAccTime = listaDR.Find(x => x.Key == string.Format("Axis_{0:00}_AccTime", i + 1));
// recupero valori...
contDistMovAssi[i] = Convert.ToUInt32(riContDist.Value);
contNumInvAssi[i] = Convert.ToUInt32(riNumInv.Value);
+ contAxisAccumTime[i] = Convert.ToDouble(riAccTime.Value);
}
currPathPartId = new string[currAdpConf.nPath];
istPathPartId = new string[currAdpConf.nPath];
@@ -1931,6 +1948,30 @@ namespace MTC_Adapter
return contTotPz;
}
///
+ /// Aggiornamento vettore RefList generico tipo DOUBLE
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private static double updateRefListByIncrDouble(int i, double delta, string searchString, ref List> listaDR)
+ {
+ // punto all'item
+ DataRefItem riValore = listaDR.Find(x => x.Key == string.Format(searchString, i + 1));
+ // recupero valore giri...
+ double contTot = Convert.ToDouble(riValore.Value);
+ // aggiungo giri...
+ contTot += delta;
+ // tolgo vecchio item
+ listaDR.Remove(riValore);
+ // lo aggiorno...
+ riValore.Value = contTot.ToString();
+ // ri-aggiungo item
+ listaDR.Add(riValore);
+ return contTot;
+ }
+ ///
/// Aggiorna un valore RefList del vettore Axis in INCREMENTO e lo restituisce
///
///
@@ -1947,12 +1988,29 @@ namespace MTC_Adapter
currAdpConf.Axis[i].dataRefList = listaDR;
return contTot;
}///
- /// Aggiorna un valore RefList del vettore PATH in INCREMENTO e lo restituisce
+ /// Aggiorna un valore RefList del vettore Axis in INCREMENTO tipo double e lo restituisce
///
///
///
///
/// Nuovo valore incrementato
+ private double updateAxisRefListByIncrDouble(int i, double delta, string searchString)
+ {
+ // leggo tutti i dati...
+ List> listaDR = currAdpConf.Axis[i].dataRefList;
+ // recupero valore giri...
+ double contTot = updateRefListByIncrDouble(i, delta, searchString, ref listaDR);
+ // salvo in adapter!
+ currAdpConf.Axis[i].dataRefList = listaDR;
+ return contTot;
+ }
+ ///
+ /// Aggiorna un valore RefList del vettore PATH in INCREMENTO e lo restituisce
+ ///
+ ///
+ ///
+ ///
+ /// Nuovo valore incrementato
private uint updatePathRefListByIncr(int i, uint delta, string searchString)
{
// leggo tutti i dati...
@@ -2168,6 +2226,8 @@ namespace MTC_Adapter
///
public bool procMovTotAssi(bool needSave)
{
+ DateTime adesso = DateTime.Now;
+ TimeSpan accumTime = adesso.Subtract(lastChekAccumTimeAxis);
for (int i = 0; i < currAdpConf.nAxis; i++)
{
// controllo valore riferimento...
@@ -2179,12 +2239,18 @@ namespace MTC_Adapter
// passo valore totale all'adapter
vettAxis[i].mAxDistDone.Value = contTot.ToString();
+ // salvo valore aggiuntivo x ore lavoro assi...
+ double oreTot = updateAxisRefListByIncrDouble(i, accumTime.TotalHours, "Axis_{0:00}_AccTime");
+ vettAxis[i].mAxAccTime.Value = oreTot.ToString("0.000", CultureInfo.InvariantCulture);
+
// segnalo necessità salvataggio!
needSave = true;
}
// ...aggiorno valore riferimento...
contDistMovAssi[i] = istDistMovAssi[i];
}
+ // salvo valore lastChekAccumTimeAxis
+ lastChekAccumTimeAxis = adesso;
return needSave;
}
diff --git a/MTC_Sim/MTC_Sim/App.config b/MTC_Sim/MTC_Sim/App.config
index cbb9eb8..13b2f24 100644
--- a/MTC_Sim/MTC_Sim/App.config
+++ b/MTC_Sim/MTC_Sim/App.config
@@ -56,7 +56,9 @@
-
+
+
+
diff --git a/MTC_Sim/VersGen/AdapterVers.cs b/MTC_Sim/VersGen/AdapterVers.cs
index 938b6e0..56ca367 100644
--- a/MTC_Sim/VersGen/AdapterVers.cs
+++ b/MTC_Sim/VersGen/AdapterVers.cs
@@ -5,7 +5,7 @@
using System.Reflection;
-[assembly: AssemblyVersion("1.1.13.93")]
-[assembly: AssemblyFileVersion("1.1.13.93")]
+[assembly: AssemblyVersion("1.1.14.93")]
+[assembly: AssemblyFileVersion("1.1.14.93")]
[assembly: AssemblyCopyright("Steamware-SCM-CMS © 2015-2016")]
[assembly: AssemblyCompany("Steamware-SCM-CMS")]
diff --git a/MTC_Sim/VersGen/AdapterVers.tt b/MTC_Sim/VersGen/AdapterVers.tt
index da8fd5f..e381074 100644
--- a/MTC_Sim/VersGen/AdapterVers.tt
+++ b/MTC_Sim/VersGen/AdapterVers.tt
@@ -6,8 +6,8 @@
using System.Reflection;
-[assembly: AssemblyVersion("1.1.13.<#= this.RevisionNumber #>")]
-[assembly: AssemblyFileVersion("1.1.13.<#= this.RevisionNumber #>")]
+[assembly: AssemblyVersion("1.1.14.<#= this.RevisionNumber #>")]
+[assembly: AssemblyFileVersion("1.1.14.<#= this.RevisionNumber #>")]
[assembly: AssemblyCopyright("Steamware-SCM-CMS © 2015-<#= DateTime.Now.Year #>")]
[assembly: AssemblyCompany("Steamware-SCM-CMS")]
<#+