Rename adapter DEMO --> SIMULA x creazioen simulatore

This commit is contained in:
Samuele E. Locatelli
2019-01-09 10:55:40 +01:00
parent 825f66ebf6
commit 3cfb3bc4f2
5 changed files with 28 additions and 14 deletions
+20 -6
View File
@@ -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
{
/// <summary>
/// Adapter generico/demo
/// Adapter SIMULAZIONE
/// </summary>
DEMO,
SIMULA,
/// <summary>
/// adapter FANUC
/// </summary>
@@ -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]));
+4 -4
View File
@@ -66,7 +66,7 @@ namespace IOB_WIN
/// <summary>
/// tipo di adapter prescelto...
/// </summary>
public tipoAdapter tipoScelto = tipoAdapter.DEMO;
public tipoAdapter tipoScelto = tipoAdapter.SIMULA;
/// <summary>
/// Vendor macchina
/// </summary>
@@ -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;
}
+1 -1
View File
@@ -113,7 +113,7 @@
<Compile Include="IobConfiguration.cs" />
<Compile Include="IobSiemensTorri.cs" />
<Compile Include="IobSiemens.cs" />
<Compile Include="IobDemo.cs" />
<Compile Include="IobSimulator.cs" />
<Compile Include="IobFanuc.cs" />
<Compile Include="IobGeneric.cs" />
<Compile Include="AdapterForm.cs">
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -7,14 +7,14 @@ using IOB_UT;
namespace IOB_WIN
{
public class IobDemo : IobGeneric
public class IobSimulator : IobGeneric
{
/// <summary>
/// estende l'init della classe base...
/// </summary>
/// <param name="caller"></param>
/// <param name="adpConf"></param>
public IobDemo(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
public IobSimulator(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
}
}