diff --git a/MTC_Adapter/MTC_Adapter/AdapterFanuc.cs b/MTC_Adapter/MTC_Adapter/AdapterFanuc.cs index 3d9096a..baa64c0 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterFanuc.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterFanuc.cs @@ -224,7 +224,7 @@ namespace MTC_Adapter string UnkStrobe = ""; // !!!FARE!!! multipath... // verifico i vari strobe x recuperare i dati... PER ORA SOLO DW1 per path1 (indice 0)... - int idxPath = 0; + //int idxPath = 0; int memIndex = 0; int bitNum = 0; inizio = DateTime.Now; @@ -646,19 +646,19 @@ namespace MTC_Adapter FanucMemRW(R, FANUC.MemType.R, memIndex + i * 4, ref MemBlock); if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STRB_DW0", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks); - // da testare metodo copia alternativo !!!FARE!!! - if (true) + // da testare metodo copia alternativo, condizionato a web.config + if (!utils.CRB("fastCopy")) { // aggiorno nel vettore allarmi i byte interessati for (int j = 0; j < 4; j++) { - // copy array o byte?!? !!!FARE!!! verifica + // copy array a blocchi AlarmFlags[i * 4 + j] = MemBlock[j]; } } else { - Buffer.BlockCopy(MemBlock, i, AlarmFlags, i, MemBlock.Length); + Buffer.BlockCopy(MemBlock, 0, AlarmFlags, 0, AlarmFlags.Length); } // segnalo allarme letto! memorizzo allarme nel vettore ack.... diff --git a/MTC_Adapter/MTC_Adapter/AdapterSiemens.cs b/MTC_Adapter/MTC_Adapter/AdapterSiemens.cs index 10cc94f..a6634b8 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterSiemens.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterSiemens.cs @@ -1,10 +1,10 @@ -using System; +using CMSCncLib.CNC; +using MTC; +using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; -using CMSCncLib.CNC; -using System.IO; -using MTC; namespace MTC_Adapter { @@ -210,7 +210,7 @@ namespace MTC_Adapter // !!!FARE!!! multipath... // verifico i vari strobe x recuperare i dati... PER ORA SOLO DW1 per path1 (indice 0)... - int idxPath = 0; + //int idxPath = 0; int memIndex = 0; int bitNum = 0; inizio = DateTime.Now; @@ -590,19 +590,19 @@ namespace MTC_Adapter FanucMemRW(R, FANUC.MemType.R, memIndex + i * 4, ref MemBlock); if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STRB_DW0", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks); - // da testare metodo copia alternativo !!!FARE!!! - if (true) + // da testare metodo copia alternativo, condizionato a web.config + if (!utils.CRB("fastCopy")) { // aggiorno nel vettore allarmi i byte interessati for (int j = 0; j < 4; j++) { - // copy array o byte?!? !!!FARE!!! verifica + // copy array a blocchi AlarmFlags[i * 4 + j] = MemBlock[j]; } } else { - Buffer.BlockCopy(MemBlock, i, AlarmFlags, i, MemBlock.Length); + Buffer.BlockCopy(MemBlock, 0, AlarmFlags, 0, AlarmFlags.Length); } // segnalo allarme letto! memorizzo allarme nel vettore ack.... @@ -771,8 +771,8 @@ namespace MTC_Adapter if (vettPath[idxPath].mPathSubMode.Value.ToString() != SubMode.Trim()) { // INVIO SEMPRE (x prendere il reset/fronte discesa)... - vettPath[idxPath].mPathSubMode.Value = SubMode.Trim(); - } + vettPath[idxPath].mPathSubMode.Value = SubMode.Trim(); + } } public override void getConfigParam() @@ -1292,7 +1292,7 @@ namespace MTC_Adapter inizio = DateTime.Now; FanucMemRW(R, FANUC.MemType.D, memIndex, ref unOpSpeedMem); if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-SPEED_UNOP", unOpSpeedMem.Length), DateTime.Now.Subtract(inizio).Ticks); - + StringBuilder sb = new StringBuilder(); int numUnOp = currAdpConf.nUnOp; diff --git a/MTC_Adapter/MTC_Adapter/App.config b/MTC_Adapter/MTC_Adapter/App.config index 0742eef..199b52d 100644 --- a/MTC_Adapter/MTC_Adapter/App.config +++ b/MTC_Adapter/MTC_Adapter/App.config @@ -82,6 +82,7 @@ +