Commit 863c699d authored by claes's avatar claes

*** empty log message ***

parent 33e9fc5f
......@@ -274,18 +274,35 @@ public class Mh
}
public static void messReceived(String messString, String nameString, String
timeString, int flags, int prio, int status, int eventId_nix, String eventId_birthTime, int
eventId_idx, int eventType, PwrtObjid object)
public static void messReceived(String messString,
String nameString,
String timeString,
int flags,
int prio,
int status,
int eventId_nix,
String eventId_birthTime,
int eventId_idx,
int targetId_nix,
String targetId_birthTime,
int targetId_idx,
int eventType,
PwrtObjid object)
{
//System.out.println("Larm " + timeString + " " + messString + " " + nameString + " flags " + flags + " prio " + prio + " sts " +
//status + " nix " + eventId_nix + " birttime " + eventId_birthTime + " idx " + eventId_idx +
//" typ " + eventType);
//hantera det mottagna meddelandet
//System.out.println("messReceived " + eventType);
MhrEvent evItem = new MhrEvent(messString, nameString,
timeString, flags, prio, status, eventId_nix, eventId_birthTime,
eventId_idx, eventType, object);
MhrEvent evItem = new MhrEvent(messString,
nameString,
timeString,
flags,
prio,
status,
eventId_nix, eventId_birthTime, eventId_idx,
targetId_nix, targetId_birthTime, targetId_idx,
eventType, object);
lastMhrEvent = evItem;
newAlarmArrived = true;
......
......@@ -74,25 +74,20 @@ public class MhData
*/
public void insertNewMess(MhrEvent ev)
{
//System.out.println(ev.eventTime + " " + ev.eventText + " sts " + ev.eventStatus + " type " + ev.eventType);
switch (ev.eventType)
{
case Mh.mh_eEvent_Alarm:
//addera till larm-listan
this.addMessToVectorInSortedOrder(alarmVec, ev);
//***alarmVec.add(0, ev);
//addera kopia till hndelse-listan
this.addMessToVectorInSortedOrder(eventVec, ev.getCopy());
//***eventVec.add(0, ev.getCopy());
break;
case Mh.mh_eEvent_Return:
//leta reda p objektet i larmlistan och vidta lmplig tgrd
for(int i = 0; i < alarmVec.size(); i++)
{
MhrEvent alEv = (MhrEvent)alarmVec.get(i);
//System.out.println("loopar " + ev.eventId.nix + " " + alEv.eventId.nix + " " + ev.eventId.idx + " " + alEv.eventId.idx);
if((ev.object.oix == alEv.object.oix) && (ev.object.oix == alEv.object.oix))
if((ev.targetId.nix == alEv.eventId.nix) && (ev.targetId.idx == alEv.eventId.idx))
{
//larmet r kvitterat och kan tas bort
if((alEv.eventStatus & Mh.mh_mEventStatus_NotAck) == 0)
......@@ -119,7 +114,7 @@ public class MhData
for(int i = 0; i < alarmVec.size(); i++)
{
MhrEvent alEv = (MhrEvent)alarmVec.get(i);
if((ev.object.oix == alEv.object.oix) && (ev.object.oix == alEv.object.oix))
if((ev.targetId.nix == alEv.eventId.nix) && (ev.targetId.idx == alEv.eventId.idx))
{
if((alEv.eventStatus & Mh.mh_mEventStatus_NotRet) == 0)
{
......@@ -132,7 +127,6 @@ public class MhData
break;
}
}
//System.out.println("AckMess eventFlags " + ev.eventFlags);
//skall det lggas till i hndelselistan
if((ev.eventFlags & Mh.mh_mEventFlags_Ack) != 0)
{
......@@ -142,7 +136,6 @@ public class MhData
}
break;
case Mh.mh_eEvent_Info:
//System.out.println("InfoMeddelande: " + ev.eventPrio + " " + ev.eventTime + " " + ev.eventText + " sts " + ev.eventStatus + " type " + ev.eventType);
//addera till larm-listan
if((ev.eventFlags & Mh.mh_mEventFlags_InfoWindow) != 0)
{
......@@ -170,9 +163,6 @@ public class MhData
{
eventVec.removeElementAt(eventVec.size() - 1);
}
//System.out.println("eventtyp " + ev.eventType + " evestst "+ ev.eventStatus + " NotAck " + Mh.mh_mEventStatus_NotAck + " uttryck " + (ev.eventStatus &
//Mh.mh_mEventStatus_NotAck));
}
}
......
......@@ -15,6 +15,7 @@ public class MhrEvent implements Serializable
public int eventStatus;
public int eventPrio;
public MhrsEventId eventId;
public MhrsEventId targetId;
public int eventType;
public PwrtObjid object;
......@@ -27,6 +28,9 @@ public class MhrEvent implements Serializable
int eventId_nix,
String eventId_birthTime,
int eventId_idx,
int targetId_nix,
String targetId_birthTime,
int targetId_idx,
int eventType,
PwrtObjid object)
{
......@@ -37,6 +41,7 @@ public class MhrEvent implements Serializable
this.eventPrio = eventPrio;
this.eventStatus = eventStatus;
this.eventId = new MhrsEventId(eventId_nix, eventId_birthTime, eventId_idx);
this.targetId = new MhrsEventId(targetId_nix, targetId_birthTime, targetId_idx);
this.eventType = eventType;
this.object = object;
}
......@@ -51,6 +56,9 @@ public class MhrEvent implements Serializable
eventId.nix,
eventId.birthTime,
eventId.idx,
targetId.nix,
targetId.birthTime,
targetId.idx,
eventType,
object);
}
......
......@@ -274,18 +274,35 @@ public class Mh
}
public static void messReceived(String messString, String nameString, String
timeString, int flags, int prio, int status, int eventId_nix, String eventId_birthTime, int
eventId_idx, int eventType, PwrtObjid object)
public static void messReceived(String messString,
String nameString,
String timeString,
int flags,
int prio,
int status,
int eventId_nix,
String eventId_birthTime,
int eventId_idx,
int targetId_nix,
String targetId_birthTime,
int targetId_idx,
int eventType,
PwrtObjid object)
{
//System.out.println("Larm " + timeString + " " + messString + " " + nameString + " flags " + flags + " prio " + prio + " sts " +
//status + " nix " + eventId_nix + " birttime " + eventId_birthTime + " idx " + eventId_idx +
//" typ " + eventType);
//hantera det mottagna meddelandet
//System.out.println("messReceived " + eventType);
MhrEvent evItem = new MhrEvent(messString, nameString,
timeString, flags, prio, status, eventId_nix, eventId_birthTime,
eventId_idx, eventType, object);
MhrEvent evItem = new MhrEvent(messString,
nameString,
timeString,
flags,
prio,
status,
eventId_nix, eventId_birthTime, eventId_idx,
targetId_nix, targetId_birthTime, targetId_idx,
eventType, object);
lastMhrEvent = evItem;
newAlarmArrived = true;
......
......@@ -74,25 +74,20 @@ public class MhData
*/
public void insertNewMess(MhrEvent ev)
{
//System.out.println(ev.eventTime + " " + ev.eventText + " sts " + ev.eventStatus + " type " + ev.eventType);
switch (ev.eventType)
{
case Mh.mh_eEvent_Alarm:
//addera till larm-listan
this.addMessToVectorInSortedOrder(alarmVec, ev);
//***alarmVec.add(0, ev);
//addera kopia till hndelse-listan
this.addMessToVectorInSortedOrder(eventVec, ev.getCopy());
//***eventVec.add(0, ev.getCopy());
break;
case Mh.mh_eEvent_Return:
//leta reda p objektet i larmlistan och vidta lmplig tgrd
for(int i = 0; i < alarmVec.size(); i++)
{
MhrEvent alEv = (MhrEvent)alarmVec.get(i);
//System.out.println("loopar " + ev.eventId.nix + " " + alEv.eventId.nix + " " + ev.eventId.idx + " " + alEv.eventId.idx);
if((ev.object.oix == alEv.object.oix) && (ev.object.oix == alEv.object.oix))
if((ev.targetId.nix == alEv.eventId.nix) && (ev.targetId.idx == alEv.eventId.idx))
{
//larmet r kvitterat och kan tas bort
if((alEv.eventStatus & Mh.mh_mEventStatus_NotAck) == 0)
......@@ -119,7 +114,7 @@ public class MhData
for(int i = 0; i < alarmVec.size(); i++)
{
MhrEvent alEv = (MhrEvent)alarmVec.get(i);
if((ev.object.oix == alEv.object.oix) && (ev.object.oix == alEv.object.oix))
if((ev.targetId.nix == alEv.eventId.nix) && (ev.targetId.idx == alEv.eventId.idx))
{
if((alEv.eventStatus & Mh.mh_mEventStatus_NotRet) == 0)
{
......@@ -132,7 +127,6 @@ public class MhData
break;
}
}
//System.out.println("AckMess eventFlags " + ev.eventFlags);
//skall det lggas till i hndelselistan
if((ev.eventFlags & Mh.mh_mEventFlags_Ack) != 0)
{
......@@ -142,7 +136,6 @@ public class MhData
}
break;
case Mh.mh_eEvent_Info:
//System.out.println("InfoMeddelande: " + ev.eventPrio + " " + ev.eventTime + " " + ev.eventText + " sts " + ev.eventStatus + " type " + ev.eventType);
//addera till larm-listan
if((ev.eventFlags & Mh.mh_mEventFlags_InfoWindow) != 0)
{
......@@ -170,9 +163,6 @@ public class MhData
{
eventVec.removeElementAt(eventVec.size() - 1);
}
//System.out.println("eventtyp " + ev.eventType + " evestst "+ ev.eventStatus + " NotAck " + Mh.mh_mEventStatus_NotAck + " uttryck " + (ev.eventStatus &
//Mh.mh_mEventStatus_NotAck));
}
}
......
......@@ -15,6 +15,7 @@ public class MhrEvent implements Serializable
public int eventStatus;
public int eventPrio;
public MhrsEventId eventId;
public MhrsEventId targetId;
public int eventType;
public PwrtObjid object;
......@@ -27,6 +28,9 @@ public class MhrEvent implements Serializable
int eventId_nix,
String eventId_birthTime,
int eventId_idx,
int targetId_nix,
String targetId_birthTime,
int targetId_idx,
int eventType,
PwrtObjid object)
{
......@@ -37,6 +41,7 @@ public class MhrEvent implements Serializable
this.eventPrio = eventPrio;
this.eventStatus = eventStatus;
this.eventId = new MhrsEventId(eventId_nix, eventId_birthTime, eventId_idx);
this.targetId = new MhrsEventId(targetId_nix, targetId_birthTime, targetId_idx);
this.eventType = eventType;
this.object = object;
}
......@@ -51,6 +56,9 @@ public class MhrEvent implements Serializable
eventId.nix,
eventId.birthTime,
eventId.idx,
targetId.nix,
targetId.birthTime,
targetId.idx,
eventType,
object);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment