Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
863c699d
Commit
863c699d
authored
Nov 24, 2003
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
33e9fc5f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
36 deletions
+66
-36
java/jpwr/rt/src/Mh.java
java/jpwr/rt/src/Mh.java
+23
-6
java/jpwr/rt/src/MhData.java
java/jpwr/rt/src/MhData.java
+2
-12
java/jpwr/rt/src/MhrEvent.java
java/jpwr/rt/src/MhrEvent.java
+8
-0
src/jpwr/rt/src/Mh.java
src/jpwr/rt/src/Mh.java
+23
-6
src/jpwr/rt/src/MhData.java
src/jpwr/rt/src/MhData.java
+2
-12
src/jpwr/rt/src/MhrEvent.java
src/jpwr/rt/src/MhrEvent.java
+8
-0
No files found.
java/jpwr/rt/src/Mh.java
View file @
863c699d
...
@@ -274,18 +274,35 @@ public class Mh
...
@@ -274,18 +274,35 @@ public class Mh
}
}
public
static
void
messReceived
(
String
messString
,
String
nameString
,
String
public
static
void
messReceived
(
String
messString
,
timeString
,
int
flags
,
int
prio
,
int
status
,
int
eventId_nix
,
String
eventId_birthTime
,
int
String
nameString
,
eventId_idx
,
int
eventType
,
PwrtObjid
object
)
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 " +
//System.out.println("Larm " + timeString + " " + messString + " " + nameString + " flags " + flags + " prio " + prio + " sts " +
//status + " nix " + eventId_nix + " birttime " + eventId_birthTime + " idx " + eventId_idx +
//status + " nix " + eventId_nix + " birttime " + eventId_birthTime + " idx " + eventId_idx +
//" typ " + eventType);
//" typ " + eventType);
//hantera det mottagna meddelandet
//hantera det mottagna meddelandet
//System.out.println("messReceived " + eventType);
//System.out.println("messReceived " + eventType);
MhrEvent
evItem
=
new
MhrEvent
(
messString
,
nameString
,
MhrEvent
evItem
=
new
MhrEvent
(
messString
,
timeString
,
flags
,
prio
,
status
,
eventId_nix
,
eventId_birthTime
,
nameString
,
eventId_idx
,
eventType
,
object
);
timeString
,
flags
,
prio
,
status
,
eventId_nix
,
eventId_birthTime
,
eventId_idx
,
targetId_nix
,
targetId_birthTime
,
targetId_idx
,
eventType
,
object
);
lastMhrEvent
=
evItem
;
lastMhrEvent
=
evItem
;
newAlarmArrived
=
true
;
newAlarmArrived
=
true
;
...
...
java/jpwr/rt/src/MhData.java
View file @
863c699d
...
@@ -74,25 +74,20 @@ public class MhData
...
@@ -74,25 +74,20 @@ public class MhData
*/
*/
public
void
insertNewMess
(
MhrEvent
ev
)
public
void
insertNewMess
(
MhrEvent
ev
)
{
{
//System.out.println(ev.eventTime + " " + ev.eventText + " sts " + ev.eventStatus + " type " + ev.eventType);
switch
(
ev
.
eventType
)
switch
(
ev
.
eventType
)
{
{
case
Mh
.
mh_eEvent_Alarm
:
case
Mh
.
mh_eEvent_Alarm
:
//addera till larm-listan
//addera till larm-listan
this
.
addMessToVectorInSortedOrder
(
alarmVec
,
ev
);
this
.
addMessToVectorInSortedOrder
(
alarmVec
,
ev
);
//***alarmVec.add(0, ev);
//addera kopia till hndelse-listan
//addera kopia till hndelse-listan
this
.
addMessToVectorInSortedOrder
(
eventVec
,
ev
.
getCopy
());
this
.
addMessToVectorInSortedOrder
(
eventVec
,
ev
.
getCopy
());
//***eventVec.add(0, ev.getCopy());
break
;
break
;
case
Mh
.
mh_eEvent_Return
:
case
Mh
.
mh_eEvent_Return
:
//leta reda p objektet i larmlistan och vidta lmplig tgrd
//leta reda p objektet i larmlistan och vidta lmplig tgrd
for
(
int
i
=
0
;
i
<
alarmVec
.
size
();
i
++)
for
(
int
i
=
0
;
i
<
alarmVec
.
size
();
i
++)
{
{
MhrEvent
alEv
=
(
MhrEvent
)
alarmVec
.
get
(
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
.
targetId
.
nix
==
alEv
.
eventId
.
nix
)
&&
(
ev
.
targetId
.
idx
==
alEv
.
eventId
.
idx
))
if
((
ev
.
object
.
oix
==
alEv
.
object
.
oix
)
&&
(
ev
.
object
.
oix
==
alEv
.
object
.
oix
))
{
{
//larmet r kvitterat och kan tas bort
//larmet r kvitterat och kan tas bort
if
((
alEv
.
eventStatus
&
Mh
.
mh_mEventStatus_NotAck
)
==
0
)
if
((
alEv
.
eventStatus
&
Mh
.
mh_mEventStatus_NotAck
)
==
0
)
...
@@ -119,7 +114,7 @@ public class MhData
...
@@ -119,7 +114,7 @@ public class MhData
for
(
int
i
=
0
;
i
<
alarmVec
.
size
();
i
++)
for
(
int
i
=
0
;
i
<
alarmVec
.
size
();
i
++)
{
{
MhrEvent
alEv
=
(
MhrEvent
)
alarmVec
.
get
(
i
);
MhrEvent
alEv
=
(
MhrEvent
)
alarmVec
.
get
(
i
);
if
((
ev
.
object
.
oix
==
alEv
.
object
.
oix
)
&&
(
ev
.
object
.
oix
==
alEv
.
object
.
oi
x
))
if
((
ev
.
targetId
.
nix
==
alEv
.
eventId
.
nix
)
&&
(
ev
.
targetId
.
idx
==
alEv
.
eventId
.
id
x
))
{
{
if
((
alEv
.
eventStatus
&
Mh
.
mh_mEventStatus_NotRet
)
==
0
)
if
((
alEv
.
eventStatus
&
Mh
.
mh_mEventStatus_NotRet
)
==
0
)
{
{
...
@@ -132,7 +127,6 @@ public class MhData
...
@@ -132,7 +127,6 @@ public class MhData
break
;
break
;
}
}
}
}
//System.out.println("AckMess eventFlags " + ev.eventFlags);
//skall det lggas till i hndelselistan
//skall det lggas till i hndelselistan
if
((
ev
.
eventFlags
&
Mh
.
mh_mEventFlags_Ack
)
!=
0
)
if
((
ev
.
eventFlags
&
Mh
.
mh_mEventFlags_Ack
)
!=
0
)
{
{
...
@@ -142,7 +136,6 @@ public class MhData
...
@@ -142,7 +136,6 @@ public class MhData
}
}
break
;
break
;
case
Mh
.
mh_eEvent_Info
:
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
//addera till larm-listan
if
((
ev
.
eventFlags
&
Mh
.
mh_mEventFlags_InfoWindow
)
!=
0
)
if
((
ev
.
eventFlags
&
Mh
.
mh_mEventFlags_InfoWindow
)
!=
0
)
{
{
...
@@ -170,9 +163,6 @@ public class MhData
...
@@ -170,9 +163,6 @@ public class MhData
{
{
eventVec
.
removeElementAt
(
eventVec
.
size
()
-
1
);
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));
}
}
}
}
...
...
java/jpwr/rt/src/MhrEvent.java
View file @
863c699d
...
@@ -15,6 +15,7 @@ public class MhrEvent implements Serializable
...
@@ -15,6 +15,7 @@ public class MhrEvent implements Serializable
public
int
eventStatus
;
public
int
eventStatus
;
public
int
eventPrio
;
public
int
eventPrio
;
public
MhrsEventId
eventId
;
public
MhrsEventId
eventId
;
public
MhrsEventId
targetId
;
public
int
eventType
;
public
int
eventType
;
public
PwrtObjid
object
;
public
PwrtObjid
object
;
...
@@ -27,6 +28,9 @@ public class MhrEvent implements Serializable
...
@@ -27,6 +28,9 @@ public class MhrEvent implements Serializable
int
eventId_nix
,
int
eventId_nix
,
String
eventId_birthTime
,
String
eventId_birthTime
,
int
eventId_idx
,
int
eventId_idx
,
int
targetId_nix
,
String
targetId_birthTime
,
int
targetId_idx
,
int
eventType
,
int
eventType
,
PwrtObjid
object
)
PwrtObjid
object
)
{
{
...
@@ -37,6 +41,7 @@ public class MhrEvent implements Serializable
...
@@ -37,6 +41,7 @@ public class MhrEvent implements Serializable
this
.
eventPrio
=
eventPrio
;
this
.
eventPrio
=
eventPrio
;
this
.
eventStatus
=
eventStatus
;
this
.
eventStatus
=
eventStatus
;
this
.
eventId
=
new
MhrsEventId
(
eventId_nix
,
eventId_birthTime
,
eventId_idx
);
this
.
eventId
=
new
MhrsEventId
(
eventId_nix
,
eventId_birthTime
,
eventId_idx
);
this
.
targetId
=
new
MhrsEventId
(
targetId_nix
,
targetId_birthTime
,
targetId_idx
);
this
.
eventType
=
eventType
;
this
.
eventType
=
eventType
;
this
.
object
=
object
;
this
.
object
=
object
;
}
}
...
@@ -51,6 +56,9 @@ public class MhrEvent implements Serializable
...
@@ -51,6 +56,9 @@ public class MhrEvent implements Serializable
eventId
.
nix
,
eventId
.
nix
,
eventId
.
birthTime
,
eventId
.
birthTime
,
eventId
.
idx
,
eventId
.
idx
,
targetId
.
nix
,
targetId
.
birthTime
,
targetId
.
idx
,
eventType
,
eventType
,
object
);
object
);
}
}
...
...
src/jpwr/rt/src/Mh.java
View file @
863c699d
...
@@ -274,18 +274,35 @@ public class Mh
...
@@ -274,18 +274,35 @@ public class Mh
}
}
public
static
void
messReceived
(
String
messString
,
String
nameString
,
String
public
static
void
messReceived
(
String
messString
,
timeString
,
int
flags
,
int
prio
,
int
status
,
int
eventId_nix
,
String
eventId_birthTime
,
int
String
nameString
,
eventId_idx
,
int
eventType
,
PwrtObjid
object
)
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 " +
//System.out.println("Larm " + timeString + " " + messString + " " + nameString + " flags " + flags + " prio " + prio + " sts " +
//status + " nix " + eventId_nix + " birttime " + eventId_birthTime + " idx " + eventId_idx +
//status + " nix " + eventId_nix + " birttime " + eventId_birthTime + " idx " + eventId_idx +
//" typ " + eventType);
//" typ " + eventType);
//hantera det mottagna meddelandet
//hantera det mottagna meddelandet
//System.out.println("messReceived " + eventType);
//System.out.println("messReceived " + eventType);
MhrEvent
evItem
=
new
MhrEvent
(
messString
,
nameString
,
MhrEvent
evItem
=
new
MhrEvent
(
messString
,
timeString
,
flags
,
prio
,
status
,
eventId_nix
,
eventId_birthTime
,
nameString
,
eventId_idx
,
eventType
,
object
);
timeString
,
flags
,
prio
,
status
,
eventId_nix
,
eventId_birthTime
,
eventId_idx
,
targetId_nix
,
targetId_birthTime
,
targetId_idx
,
eventType
,
object
);
lastMhrEvent
=
evItem
;
lastMhrEvent
=
evItem
;
newAlarmArrived
=
true
;
newAlarmArrived
=
true
;
...
...
src/jpwr/rt/src/MhData.java
View file @
863c699d
...
@@ -74,25 +74,20 @@ public class MhData
...
@@ -74,25 +74,20 @@ public class MhData
*/
*/
public
void
insertNewMess
(
MhrEvent
ev
)
public
void
insertNewMess
(
MhrEvent
ev
)
{
{
//System.out.println(ev.eventTime + " " + ev.eventText + " sts " + ev.eventStatus + " type " + ev.eventType);
switch
(
ev
.
eventType
)
switch
(
ev
.
eventType
)
{
{
case
Mh
.
mh_eEvent_Alarm
:
case
Mh
.
mh_eEvent_Alarm
:
//addera till larm-listan
//addera till larm-listan
this
.
addMessToVectorInSortedOrder
(
alarmVec
,
ev
);
this
.
addMessToVectorInSortedOrder
(
alarmVec
,
ev
);
//***alarmVec.add(0, ev);
//addera kopia till hndelse-listan
//addera kopia till hndelse-listan
this
.
addMessToVectorInSortedOrder
(
eventVec
,
ev
.
getCopy
());
this
.
addMessToVectorInSortedOrder
(
eventVec
,
ev
.
getCopy
());
//***eventVec.add(0, ev.getCopy());
break
;
break
;
case
Mh
.
mh_eEvent_Return
:
case
Mh
.
mh_eEvent_Return
:
//leta reda p objektet i larmlistan och vidta lmplig tgrd
//leta reda p objektet i larmlistan och vidta lmplig tgrd
for
(
int
i
=
0
;
i
<
alarmVec
.
size
();
i
++)
for
(
int
i
=
0
;
i
<
alarmVec
.
size
();
i
++)
{
{
MhrEvent
alEv
=
(
MhrEvent
)
alarmVec
.
get
(
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
.
targetId
.
nix
==
alEv
.
eventId
.
nix
)
&&
(
ev
.
targetId
.
idx
==
alEv
.
eventId
.
idx
))
if
((
ev
.
object
.
oix
==
alEv
.
object
.
oix
)
&&
(
ev
.
object
.
oix
==
alEv
.
object
.
oix
))
{
{
//larmet r kvitterat och kan tas bort
//larmet r kvitterat och kan tas bort
if
((
alEv
.
eventStatus
&
Mh
.
mh_mEventStatus_NotAck
)
==
0
)
if
((
alEv
.
eventStatus
&
Mh
.
mh_mEventStatus_NotAck
)
==
0
)
...
@@ -119,7 +114,7 @@ public class MhData
...
@@ -119,7 +114,7 @@ public class MhData
for
(
int
i
=
0
;
i
<
alarmVec
.
size
();
i
++)
for
(
int
i
=
0
;
i
<
alarmVec
.
size
();
i
++)
{
{
MhrEvent
alEv
=
(
MhrEvent
)
alarmVec
.
get
(
i
);
MhrEvent
alEv
=
(
MhrEvent
)
alarmVec
.
get
(
i
);
if
((
ev
.
object
.
oix
==
alEv
.
object
.
oix
)
&&
(
ev
.
object
.
oix
==
alEv
.
object
.
oi
x
))
if
((
ev
.
targetId
.
nix
==
alEv
.
eventId
.
nix
)
&&
(
ev
.
targetId
.
idx
==
alEv
.
eventId
.
id
x
))
{
{
if
((
alEv
.
eventStatus
&
Mh
.
mh_mEventStatus_NotRet
)
==
0
)
if
((
alEv
.
eventStatus
&
Mh
.
mh_mEventStatus_NotRet
)
==
0
)
{
{
...
@@ -132,7 +127,6 @@ public class MhData
...
@@ -132,7 +127,6 @@ public class MhData
break
;
break
;
}
}
}
}
//System.out.println("AckMess eventFlags " + ev.eventFlags);
//skall det lggas till i hndelselistan
//skall det lggas till i hndelselistan
if
((
ev
.
eventFlags
&
Mh
.
mh_mEventFlags_Ack
)
!=
0
)
if
((
ev
.
eventFlags
&
Mh
.
mh_mEventFlags_Ack
)
!=
0
)
{
{
...
@@ -142,7 +136,6 @@ public class MhData
...
@@ -142,7 +136,6 @@ public class MhData
}
}
break
;
break
;
case
Mh
.
mh_eEvent_Info
:
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
//addera till larm-listan
if
((
ev
.
eventFlags
&
Mh
.
mh_mEventFlags_InfoWindow
)
!=
0
)
if
((
ev
.
eventFlags
&
Mh
.
mh_mEventFlags_InfoWindow
)
!=
0
)
{
{
...
@@ -170,9 +163,6 @@ public class MhData
...
@@ -170,9 +163,6 @@ public class MhData
{
{
eventVec
.
removeElementAt
(
eventVec
.
size
()
-
1
);
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));
}
}
}
}
...
...
src/jpwr/rt/src/MhrEvent.java
View file @
863c699d
...
@@ -15,6 +15,7 @@ public class MhrEvent implements Serializable
...
@@ -15,6 +15,7 @@ public class MhrEvent implements Serializable
public
int
eventStatus
;
public
int
eventStatus
;
public
int
eventPrio
;
public
int
eventPrio
;
public
MhrsEventId
eventId
;
public
MhrsEventId
eventId
;
public
MhrsEventId
targetId
;
public
int
eventType
;
public
int
eventType
;
public
PwrtObjid
object
;
public
PwrtObjid
object
;
...
@@ -27,6 +28,9 @@ public class MhrEvent implements Serializable
...
@@ -27,6 +28,9 @@ public class MhrEvent implements Serializable
int
eventId_nix
,
int
eventId_nix
,
String
eventId_birthTime
,
String
eventId_birthTime
,
int
eventId_idx
,
int
eventId_idx
,
int
targetId_nix
,
String
targetId_birthTime
,
int
targetId_idx
,
int
eventType
,
int
eventType
,
PwrtObjid
object
)
PwrtObjid
object
)
{
{
...
@@ -37,6 +41,7 @@ public class MhrEvent implements Serializable
...
@@ -37,6 +41,7 @@ public class MhrEvent implements Serializable
this
.
eventPrio
=
eventPrio
;
this
.
eventPrio
=
eventPrio
;
this
.
eventStatus
=
eventStatus
;
this
.
eventStatus
=
eventStatus
;
this
.
eventId
=
new
MhrsEventId
(
eventId_nix
,
eventId_birthTime
,
eventId_idx
);
this
.
eventId
=
new
MhrsEventId
(
eventId_nix
,
eventId_birthTime
,
eventId_idx
);
this
.
targetId
=
new
MhrsEventId
(
targetId_nix
,
targetId_birthTime
,
targetId_idx
);
this
.
eventType
=
eventType
;
this
.
eventType
=
eventType
;
this
.
object
=
object
;
this
.
object
=
object
;
}
}
...
@@ -51,6 +56,9 @@ public class MhrEvent implements Serializable
...
@@ -51,6 +56,9 @@ public class MhrEvent implements Serializable
eventId
.
nix
,
eventId
.
nix
,
eventId
.
birthTime
,
eventId
.
birthTime
,
eventId
.
idx
,
eventId
.
idx
,
targetId
.
nix
,
targetId
.
birthTime
,
targetId
.
idx
,
eventType
,
eventType
,
object
);
object
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment