diff --git a/IOB-UT/baseUtils.cs b/IOB-UT/baseUtils.cs index ec55d536..2a3e4fd8 100644 --- a/IOB-UT/baseUtils.cs +++ b/IOB-UT/baseUtils.cs @@ -170,7 +170,10 @@ namespace IOB_UT public static byte[] setBitOnStFlag(byte[] original, bool bitBool, int bitIndex) { int bitVal = 0; - if (bitBool) bitVal = 1; + if (bitBool) + { + bitVal = 1; + } // risposta è identica ad originale... byte[] answ = original; // verifico se il bit è 0/1b @@ -199,7 +202,10 @@ namespace IOB_UT public static byte[] ToByteArray(BitArray bits) { int numBytes = bits.Count / 8; - if (bits.Count % 8 != 0) numBytes++; + if (bits.Count % 8 != 0) + { + numBytes++; + } byte[] bytes = new byte[numBytes]; int byteIndex = 0, bitIndex = 0; @@ -207,7 +213,9 @@ namespace IOB_UT for (int i = 0; i < bits.Count; i++) { if (bits[i]) + { bytes[byteIndex] |= (byte)(1 << (7 - bitIndex)); + } bitIndex++; if (bitIndex == 8) @@ -626,7 +634,10 @@ namespace IOB_UT for (int i = 0; i < results.Count; i++) { // se il codice è quello cercato... - if (results[i].codCall == codice && results[i].classCall == caller) indice = i; + if (results[i].codCall == codice && results[i].classCall == caller) + { + indice = i; + } } // se c'è aggiorno... if (indice >= 0) @@ -696,9 +707,9 @@ namespace IOB_UT public enum tipoAdapter { /// - /// Adapter generico/demo + /// Adapter SIMULAZIONE /// - DEMO, + SIMULA, /// /// adapter FANUC /// @@ -899,7 +910,10 @@ namespace IOB_UT stop = DateTime.Today.AddHours(Convert.ToInt16(valori[9])).AddMinutes(Convert.ToInt16(valori[10])).AddSeconds(Convert.ToInt16(valori[11])); // se ore == 0 --> aggiungo 1 gg!!! - if (Convert.ToInt16(valori[9]) == 0) stop.AddDays(1); + if (Convert.ToInt16(valori[9]) == 0) + { + stop.AddDays(1); + } tEff = new TimeSpan(Convert.ToInt16(valori[12]), Convert.ToInt16(valori[13]), Convert.ToInt16(valori[14])); diff --git a/IOB-WIN/AdapterForm.cs b/IOB-WIN/AdapterForm.cs index a2795ae7..5a3920fc 100644 --- a/IOB-WIN/AdapterForm.cs +++ b/IOB-WIN/AdapterForm.cs @@ -66,7 +66,7 @@ namespace IOB_WIN /// /// tipo di adapter prescelto... /// - public tipoAdapter tipoScelto = tipoAdapter.DEMO; + public tipoAdapter tipoScelto = tipoAdapter.SIMULA; /// /// Vendor macchina /// @@ -626,8 +626,8 @@ namespace IOB_WIN { switch (tipoScelto) { - case tipoAdapter.DEMO: - iobObj = new IobDemo(this, IOBConf); + case tipoAdapter.SIMULA: + iobObj = new IobSimulator(this, IOBConf); start.Enabled = true; break; case tipoAdapter.FANUC: @@ -659,7 +659,7 @@ namespace IOB_WIN break; case tipoAdapter.ND: default: - iobObj = new IobDemo(this, IOBConf); + iobObj = new IobSimulator(this, IOBConf); start.Enabled = false; break; } diff --git a/IOB-WIN/IOB-WIN.csproj b/IOB-WIN/IOB-WIN.csproj index b6fad738..213c0c5f 100644 --- a/IOB-WIN/IOB-WIN.csproj +++ b/IOB-WIN/IOB-WIN.csproj @@ -113,7 +113,7 @@ - + diff --git a/IOB-WIN/IobConfiguration.cs b/IOB-WIN/IobConfiguration.cs index 43eb0889..c8653751 100644 --- a/IOB-WIN/IobConfiguration.cs +++ b/IOB-WIN/IobConfiguration.cs @@ -94,7 +94,7 @@ namespace IOB_WIN cpuType = ""; rack = 0; slot = 0; - tipoIob = tipoAdapter.DEMO; + tipoIob = tipoAdapter.SIMULA; serverData = new serverMapo("127.0.0.1", "/", "/IOB/input/", "/IOB/flog/", "/IOB", "/IOB/enabled/", "/sendReboot.aspx?idxMacchina="); MAX_COUNTER_BLINK = 10; BLINK_FILT = 0; diff --git a/IOB-WIN/IobDemo.cs b/IOB-WIN/IobSimula.cs similarity index 71% rename from IOB-WIN/IobDemo.cs rename to IOB-WIN/IobSimula.cs index de9ad4f6..7422cd62 100644 --- a/IOB-WIN/IobDemo.cs +++ b/IOB-WIN/IobSimula.cs @@ -7,14 +7,14 @@ using IOB_UT; namespace IOB_WIN { - public class IobDemo : IobGeneric + public class IobSimulator : IobGeneric { /// /// estende l'init della classe base... /// /// /// - public IobDemo(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf) + public IobSimulator(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf) { } }