diff --git a/MTC_Adapter/MTC_Adapter/AdapterFanuc.cs b/MTC_Adapter/MTC_Adapter/AdapterFanuc.cs index 9327d98..1cae6de 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterFanuc.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterFanuc.cs @@ -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(); diff --git a/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs b/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs index 04949c9..193e907 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs @@ -819,9 +819,7 @@ namespace MTC_Adapter return (StFlag32)BitConverter.ToUInt32(Acknowl, 12); } } - - -#if true + /// /// Strobe mask PLC /// @@ -838,8 +836,6 @@ namespace MTC_Adapter /// Variabili stato macchina principali /// public StFlag8 ST_MACCH = 0; -#endif - public List codaM = new List(); public List codaS = new List(); @@ -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 - /// /// Aggiunge nel vettore coda codici M /// @@ -2062,198 +2002,6 @@ namespace MTC_Adapter #region metodi che prevedono salvataggio valori su file XML/BIN -#if false - /// - /// Aggiorna un valore RefList del vettore PATH in OVERWRITE - /// - /// - /// - /// - private void updatePathRefList(int i, string searchString, string newVal) - { - // leggo tutti i dati... - List> listaDR = currAdpConf.Path[i].dataRefList; - // punto all'item - DataRefItem 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; - } - /// - /// Aggiornamento vettore RefList generico - /// - /// - /// - /// - /// - /// - private static uint updateRefListByIncr(int i, uint deltaPz, string searchString, ref List> listaDR) - { - // punto all'item - DataRefItem 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; - } - /// - /// 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 - /// - /// - /// - /// - /// Nuovo valore incrementato - private uint updateAxisRefListByIncr(int i, uint delta, string searchString) - { - // leggo tutti i dati... - List> 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; - } - /// - /// 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... - List> 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; - } - /// - /// Aggiorna un valore RefList del vettore UnOp in INCREMENTO e lo restituisce - /// - /// - /// - /// - /// Nuovo valore incrementato - private uint updateUnOpRefListByIncr(int i, uint delta, string searchString) - { - // leggo tutti i dati... - List> 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; - } - /// - /// Aggiorna un valore RefList del vettore VacPump in INCREMENTO e lo restituisce - /// - /// - /// - /// - /// Nuovo valore incrementato - private uint updateVacPumpRefListByIncr(int i, uint delta, string searchString) - { - // leggo tutti i dati... - List> 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; - } - /// - /// Aggiorna un valore RefList del vettore VacAct in INCREMENTO e lo restituisce - /// - /// - /// - /// - /// Nuovo valore incrementato - private uint updateVacActRefListByIncr(int i, uint delta, string searchString) - { - // leggo tutti i dati... - List> 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; - } - /// - /// Aggiorna un valore RefList del vettore Lubro in INCREMENTO e lo restituisce - /// - /// - /// - /// - /// Nuovo valore incrementato - private uint updateLubroRefListByIncr(int i, uint delta, string searchString) - { - // leggo tutti i dati... - List> 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 - /// /// Processing delle ore macchina ACCESA ///