correzione errore checkBit (da liminare quel metodo!!!)

This commit is contained in:
Samuele E. Locatelli
2016-05-16 12:30:02 +02:00
parent a45af63796
commit d003cdd389
2 changed files with 8 additions and 4 deletions
Binary file not shown.
+8 -4
View File
@@ -146,6 +146,8 @@ namespace MTC_Sim
DateTime inizio = DateTime.Now;
// byte di acknowledge...
byte[] retACK_DW1 = new byte[4];
// inizializzo userAction
string UserAction = "";
// controllo TUTTI i flag: se ce ne sono di alzati DEVO processare...
if (STRB_DW1 != StFlag32.NONE)
{
@@ -181,7 +183,6 @@ namespace MTC_Sim
}
// AREA strobe USER ACTION
string UserAction = "";
// chiamato Start...
bitNum = 4;
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, "# START # ");
@@ -192,8 +193,6 @@ namespace MTC_Sim
bitNum = 6;
gestStrobeUserAction(bitNum, ref retACK_DW1, ref UserAction, "# RESET # ");
// se ci sono state azioni (1 o +) le invio...
if (UserAction != "") mUserAction.Value = UserAction.Trim();
}
else
{
@@ -204,7 +203,11 @@ namespace MTC_Sim
retACK_DW1 = new byte[4];
}
}
// INVIO COMUNQUE vettore azioni (0 o +)...
mUserAction.Value = UserAction.Trim();
memIndex = 10504;
// scrivo update ad ack SE VARIATO!!!
if (ACK_DW1 != (StFlag32)BitConverter.ToUInt32(retACK_DW1, 0))
{
@@ -261,7 +264,8 @@ namespace MTC_Sim
/// <param name="azione"></param>
private void gestStrobeUserAction(int bitNum, ref byte[] retACK_DW1, ref string UserAction, string azione)
{
if (STRB_DW1.getBit<StFlag32>(bitNum))
if (STRB_DW1.HasFlag((StFlag32)Math.Pow(2, bitNum)))
//if (STRB_DW1.getBit<StFlag32>(bitNum))
{
// salvo evento UserAction in variabile...
UserAction += azione;