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
c5e6f791
Commit
c5e6f791
authored
Jun 17, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Color dynamics for status
parent
7299db82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
310 additions
and
0 deletions
+310
-0
java/jpwr/jop/src/GeDynStatusColor.java
java/jpwr/jop/src/GeDynStatusColor.java
+155
-0
src/jpwr/jop/src/GeDynStatusColor.java
src/jpwr/jop/src/GeDynStatusColor.java
+155
-0
No files found.
java/jpwr/jop/src/GeDynStatusColor.java
0 → 100644
View file @
c5e6f791
package
jpwr.jop
;
import
jpwr.rt.*
;
public
class
GeDynStatusColor
extends
GeDynElem
{
String
attribute
;
int
nostatusColor
;
boolean
attrFound
;
PwrtRefId
subid
;
int
p
;
boolean
inverted
;
int
oldValue
;
boolean
firstScan
=
true
;
boolean
on
;
int
oldStatus
;
public
static
final
int
NO
=
0
;
public
static
final
int
SUCCESS
=
1
;
public
static
final
int
WARNING
=
2
;
public
static
final
int
ERROR
=
3
;
public
static
final
int
FATAL
=
4
;
public
GeDynStatusColor
(
GeDyn
dyn
,
String
attribute
,
int
nostatusColor
)
{
super
(
dyn
,
GeDyn
.
mDynType_DigLowColor
,
GeDyn
.
mActionType_No
);
this
.
attribute
=
attribute
;
this
.
nostatusColor
=
nostatusColor
;
}
public
void
connect
()
{
String
attrName
=
dyn
.
getAttrName
(
attribute
);
if
(
attrName
.
compareTo
(
""
)
!=
0
)
{
GdhrRefObjectInfo
ret
=
dyn
.
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
ret
.
evenSts
())
System
.
out
.
println
(
"StatusColor: "
+
attrName
);
else
{
attrFound
=
true
;
p
=
ret
.
id
;
subid
=
ret
.
refid
;
inverted
=
GeDyndata
.
getAttrInverted
(
attribute
);
}
}
}
public
void
disconnect
()
{
if
(
attrFound
)
dyn
.
en
.
gdh
.
unrefObjectInfo
(
subid
);
System
.
out
.
println
(
"Disconnecting: "
+
attribute
);
}
public
void
scan
()
{
if
(
!
attrFound
||
dyn
.
ignoreColor
)
return
;
int
value
=
dyn
.
en
.
gdh
.
getObjectRefInfoInt
(
p
);
int
stsValue
;
if
(
value
==
0
)
stsValue
=
NO
;
else
{
switch
(
value
&
7
)
{
case
3
:
case
1
:
stsValue
=
SUCCESS
;
break
;
case
0
:
stsValue
=
WARNING
;
break
;
case
2
:
stsValue
=
ERROR
;
break
;
case
4
:
stsValue
=
FATAL
;
break
;
default
:
stsValue
=
NO
;
}
}
if
(
!
firstScan
&&
oldStatus
!=
FATAL
)
{
if
(
oldValue
==
value
&&
!
dyn
.
resetColor
)
return
;
}
else
firstScan
=
false
;
if
(
(
dyn
.
dynType
&
GeDyn
.
mDynType_Tone
)
!=
0
)
{
switch
(
stsValue
)
{
case
NO:
if
(
nostatusColor
<=
GeColor
.
COLOR_TONE_MAX
)
dyn
.
comp
.
tsetColorTone
(
nostatusColor
);
else
dyn
.
comp
.
tsetFillColor
(
nostatusColor
);
break
;
case
SUCCESS:
dyn
.
comp
.
resetFillColor
();
dyn
.
comp
.
resetColorTone
();
break
;
case
WARNING:
dyn
.
comp
.
tsetColorTone
(
GeColor
.
COLOR_TONE_YELLOW
);
break
;
case
ERROR:
dyn
.
comp
.
tsetColorTone
(
GeColor
.
COLOR_TONE_RED
);
break
;
case
FATAL:
on
=
!
on
;
if
(
on
)
dyn
.
comp
.
tsetColorTone
(
GeColor
.
COLOR_TONE_RED
);
else
{
if
(
nostatusColor
<=
GeColor
.
COLOR_TONE_MAX
)
dyn
.
comp
.
tsetColorTone
(
nostatusColor
);
else
dyn
.
comp
.
tsetFillColor
(
nostatusColor
);
}
break
;
}
}
else
{
switch
(
stsValue
)
{
case
NO:
dyn
.
comp
.
tsetFillColor
(
nostatusColor
);
break
;
case
SUCCESS:
dyn
.
comp
.
resetFillColor
();
break
;
case
WARNING:
dyn
.
comp
.
tsetFillColor
(
GeColor
.
COLOR_6
);
break
;
case
ERROR:
dyn
.
comp
.
tsetFillColor
(
GeColor
.
COLOR_RED
);
break
;
case
FATAL:
on
=
!
on
;
if
(
on
)
dyn
.
comp
.
tsetFillColor
(
GeColor
.
COLOR_RED
);
else
dyn
.
comp
.
tsetFillColor
(
nostatusColor
);
break
;
}
}
dyn
.
repaintNow
=
true
;
oldValue
=
value
;
oldStatus
=
stsValue
;
}
}
src/jpwr/jop/src/GeDynStatusColor.java
0 → 100644
View file @
c5e6f791
package
jpwr.jop
;
import
jpwr.rt.*
;
public
class
GeDynStatusColor
extends
GeDynElem
{
String
attribute
;
int
nostatusColor
;
boolean
attrFound
;
PwrtRefId
subid
;
int
p
;
boolean
inverted
;
int
oldValue
;
boolean
firstScan
=
true
;
boolean
on
;
int
oldStatus
;
public
static
final
int
NO
=
0
;
public
static
final
int
SUCCESS
=
1
;
public
static
final
int
WARNING
=
2
;
public
static
final
int
ERROR
=
3
;
public
static
final
int
FATAL
=
4
;
public
GeDynStatusColor
(
GeDyn
dyn
,
String
attribute
,
int
nostatusColor
)
{
super
(
dyn
,
GeDyn
.
mDynType_DigLowColor
,
GeDyn
.
mActionType_No
);
this
.
attribute
=
attribute
;
this
.
nostatusColor
=
nostatusColor
;
}
public
void
connect
()
{
String
attrName
=
dyn
.
getAttrName
(
attribute
);
if
(
attrName
.
compareTo
(
""
)
!=
0
)
{
GdhrRefObjectInfo
ret
=
dyn
.
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
ret
.
evenSts
())
System
.
out
.
println
(
"StatusColor: "
+
attrName
);
else
{
attrFound
=
true
;
p
=
ret
.
id
;
subid
=
ret
.
refid
;
inverted
=
GeDyndata
.
getAttrInverted
(
attribute
);
}
}
}
public
void
disconnect
()
{
if
(
attrFound
)
dyn
.
en
.
gdh
.
unrefObjectInfo
(
subid
);
System
.
out
.
println
(
"Disconnecting: "
+
attribute
);
}
public
void
scan
()
{
if
(
!
attrFound
||
dyn
.
ignoreColor
)
return
;
int
value
=
dyn
.
en
.
gdh
.
getObjectRefInfoInt
(
p
);
int
stsValue
;
if
(
value
==
0
)
stsValue
=
NO
;
else
{
switch
(
value
&
7
)
{
case
3
:
case
1
:
stsValue
=
SUCCESS
;
break
;
case
0
:
stsValue
=
WARNING
;
break
;
case
2
:
stsValue
=
ERROR
;
break
;
case
4
:
stsValue
=
FATAL
;
break
;
default
:
stsValue
=
NO
;
}
}
if
(
!
firstScan
&&
oldStatus
!=
FATAL
)
{
if
(
oldValue
==
value
&&
!
dyn
.
resetColor
)
return
;
}
else
firstScan
=
false
;
if
(
(
dyn
.
dynType
&
GeDyn
.
mDynType_Tone
)
!=
0
)
{
switch
(
stsValue
)
{
case
NO:
if
(
nostatusColor
<=
GeColor
.
COLOR_TONE_MAX
)
dyn
.
comp
.
tsetColorTone
(
nostatusColor
);
else
dyn
.
comp
.
tsetFillColor
(
nostatusColor
);
break
;
case
SUCCESS:
dyn
.
comp
.
resetFillColor
();
dyn
.
comp
.
resetColorTone
();
break
;
case
WARNING:
dyn
.
comp
.
tsetColorTone
(
GeColor
.
COLOR_TONE_YELLOW
);
break
;
case
ERROR:
dyn
.
comp
.
tsetColorTone
(
GeColor
.
COLOR_TONE_RED
);
break
;
case
FATAL:
on
=
!
on
;
if
(
on
)
dyn
.
comp
.
tsetColorTone
(
GeColor
.
COLOR_TONE_RED
);
else
{
if
(
nostatusColor
<=
GeColor
.
COLOR_TONE_MAX
)
dyn
.
comp
.
tsetColorTone
(
nostatusColor
);
else
dyn
.
comp
.
tsetFillColor
(
nostatusColor
);
}
break
;
}
}
else
{
switch
(
stsValue
)
{
case
NO:
dyn
.
comp
.
tsetFillColor
(
nostatusColor
);
break
;
case
SUCCESS:
dyn
.
comp
.
resetFillColor
();
break
;
case
WARNING:
dyn
.
comp
.
tsetFillColor
(
GeColor
.
COLOR_6
);
break
;
case
ERROR:
dyn
.
comp
.
tsetFillColor
(
GeColor
.
COLOR_RED
);
break
;
case
FATAL:
on
=
!
on
;
if
(
on
)
dyn
.
comp
.
tsetFillColor
(
GeColor
.
COLOR_RED
);
else
dyn
.
comp
.
tsetFillColor
(
nostatusColor
);
break
;
}
}
dyn
.
repaintNow
=
true
;
oldValue
=
value
;
oldStatus
=
stsValue
;
}
}
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