Aggiunta gestione SlittaMag e ProtMag
This commit is contained in:
@@ -30,6 +30,8 @@ namespace MTC_Adapter
|
||||
element[] _VacuumPump;
|
||||
element[] _VacuumAct;
|
||||
element[] _Lubro;
|
||||
element[] _SlittaMag;
|
||||
element[] _ProtMag;
|
||||
element[] _Cooler;
|
||||
element[] _Press;
|
||||
element[] _Temp;
|
||||
@@ -97,6 +99,40 @@ namespace MTC_Adapter
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
public int nSlittaMag
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
if (SlittaMag != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(SlittaMag.Length);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
public int nProtMag
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
if (ProtMag != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(ProtMag.Length);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
public int nCooler
|
||||
{
|
||||
get
|
||||
@@ -319,6 +355,16 @@ namespace MTC_Adapter
|
||||
get { return _Lubro; }
|
||||
set { _Lubro = value; }
|
||||
}
|
||||
public element[] SlittaMag
|
||||
{
|
||||
get { return _SlittaMag; }
|
||||
set { _SlittaMag = value; }
|
||||
}
|
||||
public element[] ProtMag
|
||||
{
|
||||
get { return _ProtMag; }
|
||||
set { _ProtMag = value; }
|
||||
}
|
||||
public element[] Cooler
|
||||
{
|
||||
get { return _Cooler; }
|
||||
|
||||
@@ -88,6 +88,48 @@ namespace MTC_Adapter
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Singola Slitta Mag, 0..n
|
||||
/// </summary>
|
||||
public class SlittaMag : element
|
||||
{
|
||||
/// <summary>
|
||||
/// valore numero attivazioni/disattivazioni slitta magazzino
|
||||
/// </summary>
|
||||
public Event mSlittaMagCount;
|
||||
/// <summary>
|
||||
/// Classe Slitta Magazzino
|
||||
/// </summary>
|
||||
/// <param name="baseElem">element base contenente parametri (da XML)</param>
|
||||
public SlittaMag(element baseElem)
|
||||
{
|
||||
ident = baseElem.ident;
|
||||
dataRefList = baseElem.dataRefList;
|
||||
|
||||
mSlittaMagCount = new Event(string.Format("{0}_Count", ident));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Singolo attuatore Protezione Magazzino, 0..n
|
||||
/// </summary>
|
||||
public class ProtMag : element
|
||||
{
|
||||
/// <summary>
|
||||
/// valore numero attivazioni/disattivazioni valvola
|
||||
/// </summary>
|
||||
public Event mProtMagCount;
|
||||
/// <summary>
|
||||
/// Classe Protezione Magazzino
|
||||
/// </summary>
|
||||
/// <param name="baseElem">element base contenente parametri (da XML)</param>
|
||||
public ProtMag(element baseElem)
|
||||
{
|
||||
ident = baseElem.ident;
|
||||
dataRefList = baseElem.dataRefList;
|
||||
|
||||
mProtMagCount = new Event(string.Format("{0}_Count", ident));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Singolo refrigeratore, 0..n
|
||||
/// </summary>
|
||||
public class Cooler : element
|
||||
@@ -662,7 +704,18 @@ namespace MTC_Adapter
|
||||
/// Vettore ATTUALE dei contatori del numero cambi utensili x UnOp
|
||||
/// </summary>
|
||||
public uint[] currNumCambiUt;
|
||||
|
||||
/// <summary>
|
||||
/// Conteggio ATTUALE numero movimenti Slitta Tastatore
|
||||
/// </summary>
|
||||
public double contSlittaTast;
|
||||
/// <summary>
|
||||
/// Vettore ATTUALE dei contatori del numero movimenti Slitta Magazzino
|
||||
/// </summary>
|
||||
public uint[] currSlittaMag;
|
||||
/// <summary>
|
||||
/// Vettore ATTUALE dei contatori del numero movimenti Protezione Magazzino
|
||||
/// </summary>
|
||||
public uint[] currProtMag;
|
||||
|
||||
/// <summary>
|
||||
/// Conteggio ISTANTANEO ore macchina ON
|
||||
@@ -716,7 +769,18 @@ namespace MTC_Adapter
|
||||
/// Vettore ISTANTANEO dei contatori del numero cambi utensili x UnOp
|
||||
/// </summary>
|
||||
public uint[] istNumCambiUt;
|
||||
|
||||
/// <summary>
|
||||
/// Conteggio ISTANTANEO contatore del numero movimenti Slitta Tastatore
|
||||
/// </summary>
|
||||
public double istSlittaTast;
|
||||
/// <summary>
|
||||
/// Vettore ISTANTANEO dei contatori del numero movimenti Slitta Magazzino
|
||||
/// </summary>
|
||||
public uint[] istSlittaMag;
|
||||
/// <summary>
|
||||
/// Vettore ISTANTANEO dei contatori del numero movimenti Protezione Magazzino
|
||||
/// </summary>
|
||||
public uint[] istProtMag;
|
||||
|
||||
/// <summary>
|
||||
/// data-ora ultimo controllo movimento assi
|
||||
@@ -974,6 +1038,8 @@ namespace MTC_Adapter
|
||||
public VacuumPump[] vettVacPump;
|
||||
public VacuumAct[] vettVacAct;
|
||||
public Lubro[] vettLubro;
|
||||
public SlittaMag[] vettSlittaMag;
|
||||
public ProtMag[] vettProtMag;
|
||||
public Cooler[] vettCooler;
|
||||
public Press[] vettPress;
|
||||
public Tempe[] vettTempe;
|
||||
@@ -1077,6 +1143,20 @@ namespace MTC_Adapter
|
||||
mAdapter.AddDataItem(vettLubro[i].mLubroNum);
|
||||
mAdapter.AddDataItem(vettLubro[i].mLubroStatus);
|
||||
}
|
||||
// Slitta Mag
|
||||
vettSlittaMag = new SlittaMag[adpConf.nSlittaMag];
|
||||
for (int i = 0; i < adpConf.nLubro; i++)
|
||||
{
|
||||
vettSlittaMag[i] = new SlittaMag(adpConf.SlittaMag[i]);
|
||||
mAdapter.AddDataItem(vettSlittaMag[i].mSlittaMagCount);
|
||||
}
|
||||
// Protezione Mag
|
||||
vettProtMag = new ProtMag[adpConf.nProtMag];
|
||||
for (int i = 0; i < adpConf.nLubro; i++)
|
||||
{
|
||||
vettProtMag[i] = new ProtMag(adpConf.ProtMag[i]);
|
||||
mAdapter.AddDataItem(vettProtMag[i].mProtMagCount);
|
||||
}
|
||||
// Cooler
|
||||
vettCooler = new Cooler[adpConf.nCooler];
|
||||
for (int i = 0; i < adpConf.nCooler; i++)
|
||||
@@ -1392,6 +1472,16 @@ namespace MTC_Adapter
|
||||
{
|
||||
currLubroCount[i] = getStoredValUInt(string.Format("Lubro_{0:00}_Count", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nSlittaMag; i++)
|
||||
{
|
||||
currSlittaMag[i] = getStoredValUInt(string.Format("SlittaMagazzino_{0:00}_Count", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nProtMag; i++)
|
||||
{
|
||||
currProtMag[i] = getStoredValUInt(string.Format("ProtMagazzino_{0:00}_Count", i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1519,6 +1609,28 @@ namespace MTC_Adapter
|
||||
// recupero valori...
|
||||
currLubroCount[i] = Convert.ToUInt32(riLubro.Value);
|
||||
}
|
||||
currSlittaMag = new uint[currAdpConf.nSlittaMag];
|
||||
istSlittaMag = new uint[currAdpConf.nSlittaMag];
|
||||
for (int i = 0; i < currAdpConf.nSlittaMag; i++)
|
||||
{
|
||||
// leggo tutti i dati...
|
||||
List<DataRefItem<string, string>> listaDR = currAdpConf.SlittaMag[i].dataRefList;
|
||||
// punto all'item
|
||||
DataRefItem<string, string> riSlittaMag = listaDR.Find(x => x.Key == string.Format("SlittaMagazzino_{0:00}_Count", i + 1));
|
||||
// recupero valori...
|
||||
currSlittaMag[i] = Convert.ToUInt32(riSlittaMag.Value);
|
||||
}
|
||||
currProtMag = new uint[currAdpConf.nProtMag];
|
||||
istProtMag = new uint[currAdpConf.nProtMag];
|
||||
for (int i = 0; i < currAdpConf.nProtMag; i++)
|
||||
{
|
||||
// leggo tutti i dati...
|
||||
List<DataRefItem<string, string>> listaDR = currAdpConf.ProtMag[i].dataRefList;
|
||||
// punto all'item
|
||||
DataRefItem<string, string> riProtMag= listaDR.Find(x => x.Key == string.Format("ProtMagazzino_{0:00}_Count", i + 1));
|
||||
// recupero valori...
|
||||
currProtMag[i] = Convert.ToUInt32(riProtMag.Value);
|
||||
}
|
||||
|
||||
//mAlarmSystem.Normal();
|
||||
mAlarmCNC.Normal();
|
||||
@@ -2132,6 +2244,42 @@ namespace MTC_Adapter
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (maintData[i].varName== "SlittaTastatore_Count")
|
||||
{
|
||||
//istOreMaccLav = tabDatiMtz[i];
|
||||
}
|
||||
else if (maintData[i].varName.StartsWith("SlittaMagazzino_"))
|
||||
{
|
||||
// if (maintData[i].varName.EndsWith("_Count"))
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// numero = Convert.ToInt32(maintData[i].varName.Replace("SlittaMagazzino_", "").Replace("_Count", ""));
|
||||
// }
|
||||
// catch
|
||||
// { }
|
||||
// if (numero > 0)
|
||||
// {
|
||||
// istLubroCount[numero - 1] = tabDatiMtz[i];
|
||||
// }
|
||||
// }
|
||||
}
|
||||
else if (maintData[i].varName.StartsWith("ProtMagazzino_"))
|
||||
{
|
||||
// if (maintData[i].varName.EndsWith("_Count"))
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// numero = Convert.ToInt32(maintData[i].varName.Replace("ProtMagazzino_", "").Replace("_Count", ""));
|
||||
// }
|
||||
// catch
|
||||
// { }
|
||||
// if (numero > 0)
|
||||
// {
|
||||
// istLubroCount[numero - 1] = tabDatiMtz[i];
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -2156,6 +2304,8 @@ namespace MTC_Adapter
|
||||
needSave = procVacPump(needSave);
|
||||
needSave = procVacAct(needSave);
|
||||
needSave = procLubro(needSave);
|
||||
needSave = procSlittaMag(needSave);
|
||||
needSave = procProtMag(needSave);
|
||||
|
||||
// salvo se necessario!
|
||||
if (needSave) parentForm.persistData();
|
||||
@@ -2708,6 +2858,66 @@ namespace MTC_Adapter
|
||||
parentForm.dataMonitor += string.Format("{0}{1}", outString.Substring(0, outString.Length - 3), Environment.NewLine);
|
||||
return needSave;
|
||||
}
|
||||
/// <summary>
|
||||
/// Processing delle variabili sui componenti SlittaMag
|
||||
/// </summary>
|
||||
/// <param name="needSave"></param>
|
||||
/// <returns></returns>
|
||||
public bool procSlittaMag(bool needSave)
|
||||
{
|
||||
uint delta = 0;
|
||||
string outString = string.Format("SlittaMagazzino_[1-{0}]_Count: ", currAdpConf.nSlittaMag);
|
||||
for (int i = 0; i < currAdpConf.nSlittaMag; i++)
|
||||
{
|
||||
delta = istSlittaMag[i] - currSlittaMag[i];
|
||||
//processo comunque sempre...
|
||||
uint contTot = updateValUIntByIncr(i, delta, "SlittaMagazzino_{0:00}_Count");
|
||||
// passo valore totale all'adapter
|
||||
vettSlittaMag[i].mSlittaMagCount.Value = contTot;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
currSlittaMag[i] = istSlittaMag[i];
|
||||
outString += string.Format("{0} | ", vettSlittaMag[i].mSlittaMagCount.Value);
|
||||
}
|
||||
// salvo su maschera...
|
||||
parentForm.dataMonitor += string.Format("{0}{1}", outString.Substring(0, outString.Length - 3), Environment.NewLine);
|
||||
return needSave;
|
||||
}
|
||||
/// <summary>
|
||||
/// Processing delle variabili sui componenti ProtMag
|
||||
/// </summary>
|
||||
/// <param name="needSave"></param>
|
||||
/// <returns></returns>
|
||||
public bool procProtMag(bool needSave)
|
||||
{
|
||||
uint delta = 0;
|
||||
string outString = string.Format("ProtMagazzino_[1-{0}]_Count: ", currAdpConf.nProtMag);
|
||||
for (int i = 0; i < currAdpConf.nProtMag; i++)
|
||||
{
|
||||
delta = istProtMag[i] - currProtMag[i];
|
||||
//processo comunque sempre...
|
||||
uint contTot = updateValUIntByIncr(i, delta, "ProtMagazzino_{0:00}_Count");
|
||||
// passo valore totale all'adapter
|
||||
vettProtMag[i].mProtMagCount.Value = contTot;
|
||||
// controllo valore riferimento...
|
||||
if (delta > 0)
|
||||
{
|
||||
// segnalo necessità salvataggio!
|
||||
needSave = true;
|
||||
}
|
||||
// ...aggiorno valore riferimento...
|
||||
currProtMag[i] = istProtMag[i];
|
||||
outString += string.Format("{0} | ", vettProtMag[i].mProtMagCount.Value);
|
||||
}
|
||||
// salvo su maschera...
|
||||
parentForm.dataMonitor += string.Format("{0}{1}", outString.Substring(0, outString.Length - 3), Environment.NewLine);
|
||||
return needSave;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1120,7 +1120,6 @@ namespace MTC_Adapter
|
||||
checkSavePersDataLayer();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gestione lettura dati status da PLC
|
||||
/// </summary>
|
||||
|
||||
@@ -163,13 +163,13 @@
|
||||
<EmbeddedResource Include="SetupAdapter.resx">
|
||||
<DependentUpon>SetupAdapter.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<Content Include="Resources\CMS\Appunti CMS OSAI.txt" />
|
||||
<Content Include="Resources\CMS\OSAI.xml">
|
||||
<None Include="Resources\CMS\Appunti CMS OSAI.txt" />
|
||||
<None Include="Resources\CMS\OSAI.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Resources\CMS\SIEMENS.xml">
|
||||
</None>
|
||||
<None Include="Resources\CMS\SIEMENS.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</None>
|
||||
<Content Include="Resources\SCM\SCM_ESA.xml" />
|
||||
<Content Include="Readme\Analisi tempi.txt" />
|
||||
<None Include="App.CMS-OSAI.config">
|
||||
@@ -214,6 +214,9 @@
|
||||
</None>
|
||||
<None Include="Resources\CMS\AlarmListOSAI.map" />
|
||||
<None Include="Resources\CMS\AlarmListEmpty.map" />
|
||||
<None Include="Resources\CMS\CounterListOSAI.map" />
|
||||
<None Include="Resources\CMS\CounterListFANUC.map" />
|
||||
<None Include="Resources\CMS\CounterListSIEMENS.map" />
|
||||
<None Include="Resources\SCM\AlarmListEsaGvCNC.map" />
|
||||
<None Include="Resources\SCM\cnc.msg" />
|
||||
<None Include="Resources\SCM\IOT_StringList.map" />
|
||||
@@ -227,9 +230,9 @@
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="ExtLib\DotNetAdapterSDK.dll" />
|
||||
<Content Include="Resources\CMS\probe.xml">
|
||||
<None Include="Resources\CMS\probe.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</None>
|
||||
<None Include="Resources\SCM\IOT_ByteList.map" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\CMS\AlarmListSIEMENS.map" />
|
||||
@@ -242,7 +245,7 @@
|
||||
<Content Include="Resources\SCM\scm_logo_blu.png" />
|
||||
<Content Include="Resources\SCM\scm_logo_blu_resize.png" />
|
||||
<Content Include="Resources\SCM\VariabiliContatori.txt" />
|
||||
<Content Include="Resources\CMS\CMS.ico" />
|
||||
<None Include="Resources\CMS\CMS.ico" />
|
||||
<Content Include="dump\dump.exe">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
@@ -311,14 +314,14 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\CMS\FANUC.xml">
|
||||
<None Include="Resources\CMS\FANUC.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</None>
|
||||
<None Include="DATA\CONF\AlarmList.map">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Resources\CMS\AlarmListFANUC.map" />
|
||||
<Content Include="Resources\CMS\Appunti CMS FANUC.txt" />
|
||||
<None Include="Resources\CMS\Appunti CMS FANUC.txt" />
|
||||
<None Include="DATA\CONF\HaltTypeList.map">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
Reference in New Issue
Block a user