tolti commenti + impiego non necessario del separatore "#" nelle stringhe...

This commit is contained in:
Samuele E. Locatelli
2017-01-16 12:52:40 +01:00
parent bb74a6943a
commit 6710162648
2 changed files with 35 additions and 287 deletions
+34 -34
View File
@@ -743,7 +743,7 @@ namespace MTC_Adapter
// converto! e aggiungo allarmi sollevati al corretto controller allarmi...
if (STRB_DW2.HasFlag((StFlag32)Math.Pow(2, i)))
{
UnkStatus += string.Format("# STATUS_{0:00} # ", i);
UnkStatus += string.Format(" [STATUS_{0:00}] ", i);
}
}
// invio comunque... SE !=""
@@ -760,7 +760,7 @@ namespace MTC_Adapter
// converto! e aggiungo allarmi sollevati al corretto controller allarmi...
if (STRB_DW3.HasFlag((StFlag32)Math.Pow(2, i)))
{
SubMode += string.Format("# {0} #", elencoSubMode[i.ToString()]);
SubMode += string.Format(" [{0}]", elencoSubMode[i.ToString()]);
}
}
@@ -1473,42 +1473,42 @@ namespace MTC_Adapter
if (utils.CRB("recTime")) TimingData.addResult("R-GCodModal", DateTime.Now.Subtract(inizio).Ticks);
string GCodAttivi = "";
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd0.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd1.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd2.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd3.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd4.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd5.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd6.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd7.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd8.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd9.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd10.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd11.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd12.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd13.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd14.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd15.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd16.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd17.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd18.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd19.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd20.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd21.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd22.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd23.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd24.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd25.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd26.code);
GCodAttivi += string.Format("# {0} #", vettGCodes.gcd27.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd0.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd1.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd2.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd3.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd4.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd5.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd6.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd7.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd8.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd9.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd10.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd11.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd12.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd13.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd14.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd15.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd16.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd17.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd18.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd19.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd20.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd21.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd22.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd23.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd24.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd25.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd26.code);
GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd27.code);
inizio = DateTime.Now;
vettGCodes = FANUC_ref.getPathGCode1Shot();
if (utils.CRB("recTime")) TimingData.addResult("R-GCodOneShot", DateTime.Now.Subtract(inizio).Ticks);
if (vettGCodes.gcd0.flag > 0) GCodAttivi += string.Format("# {0} #", vettGCodes.gcd0.code);
if (vettGCodes.gcd1.flag > 0) GCodAttivi += string.Format("# {0} #", vettGCodes.gcd1.code);
if (vettGCodes.gcd2.flag > 0) GCodAttivi += string.Format("# {0} #", vettGCodes.gcd2.code);
if (vettGCodes.gcd3.flag > 0) GCodAttivi += string.Format("# {0} #", vettGCodes.gcd3.code);
if (vettGCodes.gcd0.flag > 0) GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd0.code);
if (vettGCodes.gcd1.flag > 0) GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd1.code);
if (vettGCodes.gcd2.flag > 0) GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd2.code);
if (vettGCodes.gcd3.flag > 0) GCodAttivi += string.Format(" [{0}] ", vettGCodes.gcd3.code);
inizio = DateTime.Now;
CMSCncLib.Focas1.ODB5AXMAN vettTTCoord = FANUC_ref.getPathTTCoord();
+1 -253
View File
@@ -819,9 +819,7 @@ namespace MTC_Adapter
return (StFlag32)BitConverter.ToUInt32(Acknowl, 12);
}
}
#if true
/// <summary>
/// Strobe mask PLC
/// </summary>
@@ -838,8 +836,6 @@ namespace MTC_Adapter
/// Variabili stato macchina principali
/// </summary>
public StFlag8 ST_MACCH = 0;
#endif
public List<string> codaM = new List<string>();
public List<string> codaS = new List<string>();
@@ -1925,62 +1921,6 @@ namespace MTC_Adapter
}
}
#if false
public void checkCodM()
{
if (utils.IsSetAll(STROBE_PLC, Strobe.M_CODE))
{
mCod_M.Value = getNextMCode;
// se il valore è "" allora alzo flag lettura...
if (mCod_M.Value.ToString() == "") STROBE_ADP = STROBE_ADP | Strobe.M_CODE;
}
else
{
// resetto eventuali flag di lettura...
if (utils.IsSetAll(STROBE_ADP, Strobe.M_CODE))
{
STROBE_ADP -= Strobe.M_CODE;
}
}
}
public void checkCodS()
{
if (utils.IsSetAll(STROBE_PLC, Strobe.S_CODE))
{
mCod_S.Value = getNextSCode;
// se il valore è "" allora alzo flag lettura...
if (mCod_S.Value.ToString() == "") STROBE_ADP = STROBE_ADP | Strobe.S_CODE;
}
else
{
// resetto eventuali flag di lettura...
if (utils.IsSetAll(STROBE_ADP, Strobe.S_CODE))
{
STROBE_ADP -= Strobe.S_CODE;
}
}
}
public void checkCodT()
{
if (utils.IsSetAll(STROBE_PLC, Strobe.T_CODE))
{
mCod_T.Value = getNextTCode;
// se il valore è "" allora alzo flag lettura...
if (mCod_T.Value.ToString() == "") STROBE_ADP = STROBE_ADP | Strobe.T_CODE;
}
else
{
// resetto eventuali flag di lettura...
if (utils.IsSetAll(STROBE_ADP, Strobe.T_CODE))
{
STROBE_ADP -= Strobe.T_CODE;
}
}
}
#endif
/// <summary>
/// Aggiunge nel vettore coda codici M
/// </summary>
@@ -2062,198 +2002,6 @@ namespace MTC_Adapter
#region metodi che prevedono salvataggio valori su file XML/BIN
#if false
/// <summary>
/// Aggiorna un valore RefList del vettore PATH in OVERWRITE
/// </summary>
/// <param name="i"></param>
/// <param name="searchString"></param>
/// <param name="newVal"></param>
private void updatePathRefList(int i, string searchString, string newVal)
{
// leggo tutti i dati...
List<DataRefItem<string, string>> listaDR = currAdpConf.Path[i].dataRefList;
// punto all'item
DataRefItem<string, string> riValore = listaDR.Find(x => x.Key == string.Format(searchString, i + 1));
// tolgo vecchio item
listaDR.Remove(riValore);
// lo aggiorno...
riValore.Value = newVal;
// ri-aggiungo item
listaDR.Add(riValore);
// salvo in adapter!
currAdpConf.Path[i].dataRefList = listaDR;
}
/// <summary>
/// Aggiornamento vettore RefList generico
/// </summary>
/// <param name="i"></param>
/// <param name="deltaPz"></param>
/// <param name="searchString"></param>
/// <param name="listaDR"></param>
/// <returns></returns>
private static uint updateRefListByIncr(int i, uint deltaPz, string searchString, ref List<DataRefItem<string, string>> listaDR)
{
// punto all'item
DataRefItem<string, string> riValore = listaDR.Find(x => x.Key == string.Format(searchString, i + 1));
// recupero valore giri...
uint contTotPz = Convert.ToUInt32(riValore.Value);
// aggiungo giri...
contTotPz += deltaPz;
// tolgo vecchio item
listaDR.Remove(riValore);
// lo aggiorno...
riValore.Value = contTotPz.ToString();
// ri-aggiungo item
listaDR.Add(riValore);
return contTotPz;
}
/// <summary>
/// Aggiornamento vettore RefList generico tipo DOUBLE
/// </summary>
/// <param name="i"></param>
/// <param name="delta"></param>
/// <param name="searchString"></param>
/// <param name="listaDR"></param>
/// <returns></returns>
private static double updateRefListByIncrDouble(int i, double delta, string searchString, ref List<DataRefItem<string, string>> listaDR)
{
// punto all'item
DataRefItem<string, string> 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;
}
/// <summary>
/// Aggiorna un valore RefList del vettore Axis in INCREMENTO e lo restituisce
/// </summary>
/// <param name="i"></param>
/// <param name="delta"></param>
/// <param name="searchString"></param>
/// <returns>Nuovo valore incrementato</returns>
private uint updateAxisRefListByIncr(int i, uint delta, string searchString)
{
// leggo tutti i dati...
List<DataRefItem<string, string>> listaDR = currAdpConf.Axis[i].dataRefList;
// recupero valore giri...
uint contTot = updateRefListByIncr(i, delta, searchString, ref listaDR);
// salvo in adapter!
currAdpConf.Axis[i].dataRefList = listaDR;
return contTot;
}
/// <summary>
/// Aggiorna un valore RefList del vettore Axis in INCREMENTO tipo double e lo restituisce
/// </summary>
/// <param name="i"></param>
/// <param name="delta"></param>
/// <param name="searchString"></param>
/// <returns>Nuovo valore incrementato</returns>
private double updateAxisRefListByIncrDouble(int i, double delta, string searchString)
{
// leggo tutti i dati...
List<DataRefItem<string, string>> 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;
}
/// <summary>
/// Aggiorna un valore RefList del vettore PATH in INCREMENTO e lo restituisce
/// </summary>
/// <param name="i"></param>
/// <param name="delta"></param>
/// <param name="searchString"></param>
/// <returns>Nuovo valore incrementato</returns>
private uint updatePathRefListByIncr(int i, uint delta, string searchString)
{
// leggo tutti i dati...
List<DataRefItem<string, string>> listaDR = currAdpConf.Path[i].dataRefList;
// recupero valore tot..
uint contTot = updateRefListByIncr(i, delta, searchString, ref listaDR);
// salvo in adapter!
currAdpConf.Path[i].dataRefList = listaDR;
return contTot;
}
/// <summary>
/// Aggiorna un valore RefList del vettore UnOp in INCREMENTO e lo restituisce
/// </summary>
/// <param name="i"></param>
/// <param name="delta"></param>
/// <param name="searchString"></param>
/// <returns>Nuovo valore incrementato</returns>
private uint updateUnOpRefListByIncr(int i, uint delta, string searchString)
{
// leggo tutti i dati...
List<DataRefItem<string, string>> listaDR = currAdpConf.UnOp[i].dataRefList;
// recupero valore giri...
uint contTot = updateRefListByIncr(i, delta, searchString, ref listaDR);
// salvo in adapter!
currAdpConf.UnOp[i].dataRefList = listaDR;
return contTot;
}
/// <summary>
/// Aggiorna un valore RefList del vettore VacPump in INCREMENTO e lo restituisce
/// </summary>
/// <param name="i"></param>
/// <param name="delta"></param>
/// <param name="searchString"></param>
/// <returns>Nuovo valore incrementato</returns>
private uint updateVacPumpRefListByIncr(int i, uint delta, string searchString)
{
// leggo tutti i dati...
List<DataRefItem<string, string>> listaDR = currAdpConf.VacuumPump[i].dataRefList;
// recupero valore giri...
uint contTot = updateRefListByIncr(i, delta, searchString, ref listaDR);
// salvo in adapter!
currAdpConf.VacuumPump[i].dataRefList = listaDR;
return contTot;
}
/// <summary>
/// Aggiorna un valore RefList del vettore VacAct in INCREMENTO e lo restituisce
/// </summary>
/// <param name="i"></param>
/// <param name="delta"></param>
/// <param name="searchString"></param>
/// <returns>Nuovo valore incrementato</returns>
private uint updateVacActRefListByIncr(int i, uint delta, string searchString)
{
// leggo tutti i dati...
List<DataRefItem<string, string>> listaDR = currAdpConf.VacuumAct[i].dataRefList;
// recupero valore giri...
uint contTot = updateRefListByIncr(i, delta, searchString, ref listaDR);
// salvo in adapter!
currAdpConf.VacuumAct[i].dataRefList = listaDR;
return contTot;
}
/// <summary>
/// Aggiorna un valore RefList del vettore Lubro in INCREMENTO e lo restituisce
/// </summary>
/// <param name="i"></param>
/// <param name="delta"></param>
/// <param name="searchString"></param>
/// <returns>Nuovo valore incrementato</returns>
private uint updateLubroRefListByIncr(int i, uint delta, string searchString)
{
// leggo tutti i dati...
List<DataRefItem<string, string>> listaDR = currAdpConf.Lubro[i].dataRefList;
// recupero valore giri...
uint contTot = updateRefListByIncr(i, delta, searchString, ref listaDR);
// salvo in adapter!
currAdpConf.Lubro[i].dataRefList = listaDR;
return contTot;
}
#endif
/// <summary>
/// Processing delle ore macchina ACCESA
/// </summary>