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
7cc405a5
Commit
7cc405a5
authored
Nov 02, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attributes for minvalue, maxvalue
parent
aee83ace
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
340 additions
and
30 deletions
+340
-30
java/jpwr/jop/src/GeDynFillLevel.java
java/jpwr/jop/src/GeDynFillLevel.java
+52
-3
java/jpwr/jop/src/GeDynValueInput.java
java/jpwr/jop/src/GeDynValueInput.java
+44
-7
java/jpwr/jop/src/JopBar.java
java/jpwr/jop/src/JopBar.java
+33
-2
java/jpwr/jop/src/JopTrend.java
java/jpwr/jop/src/JopTrend.java
+41
-3
src/jpwr/jop/src/GeDynFillLevel.java
src/jpwr/jop/src/GeDynFillLevel.java
+52
-3
src/jpwr/jop/src/GeDynValueInput.java
src/jpwr/jop/src/GeDynValueInput.java
+44
-7
src/jpwr/jop/src/JopBar.java
src/jpwr/jop/src/JopBar.java
+33
-2
src/jpwr/jop/src/JopTrend.java
src/jpwr/jop/src/JopTrend.java
+41
-3
No files found.
java/jpwr/jop/src/GeDynFillLevel.java
View file @
7cc405a5
/*
* Proview $Id: GeDynFillLevel.java,v 1.
2 2005-09-01 14:57:5
0 claes Exp $
* Proview $Id: GeDynFillLevel.java,v 1.
3 2005-11-02 14:00:1
0 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -29,15 +29,22 @@ public class GeDynFillLevel extends GeDynElem {
double
maxValue
;
double
minPos
;
double
maxPos
;
String
minValueAttr
;
String
maxValueAttr
;
boolean
attrFound
;
PwrtRefId
subid
;
int
p
;
float
oldValue
;
boolean
firstScan
=
true
;
int
minValueP
;
int
maxValueP
;
PwrtRefId
minValueSubid
;
PwrtRefId
maxValueSubid
;
public
GeDynFillLevel
(
GeDyn
dyn
,
String
attribute
,
int
color
,
int
direction
,
double
minValue
,
double
maxValue
,
double
minPos
,
double
maxPos
)
{
double
minValue
,
double
maxValue
,
double
minPos
,
double
maxPos
,
String
minValueAttr
,
String
maxValueAttr
)
{
super
(
dyn
,
GeDyn
.
mDynType_FillLevel
,
GeDyn
.
mActionType_No
);
this
.
attribute
=
attribute
;
this
.
color
=
color
;
...
...
@@ -46,9 +53,11 @@ public class GeDynFillLevel extends GeDynElem {
this
.
maxValue
=
maxValue
;
this
.
minPos
=
minPos
;
this
.
maxPos
=
maxPos
;
this
.
minValueAttr
=
minValueAttr
;
this
.
maxValueAttr
=
maxValueAttr
;
}
public
void
connect
()
{
if
(
minValue
==
maxValue
)
if
(
minValue
==
maxValue
&&
minValueAttr
==
null
&&
maxValueAttr
==
null
)
return
;
String
attrName
=
dyn
.
getAttrName
(
attribute
);
...
...
@@ -74,14 +83,54 @@ public class GeDynFillLevel extends GeDynElem {
dyn
.
comp
.
setLevelFillColor
(
color
);
}
}
minValueP
=
0
;
if
(
minValueAttr
!=
null
)
{
attrName
=
dyn
.
getAttrName
(
minValueAttr
);
if
(
attrName
.
compareTo
(
""
)
!=
0
)
{
GdhrRefObjectInfo
ret
=
dyn
.
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
ret
.
evenSts
())
System
.
out
.
println
(
"FillLevel: "
+
attrName
);
else
{
minValueP
=
ret
.
id
;
minValueSubid
=
ret
.
refid
;
}
}
}
maxValueP
=
0
;
if
(
maxValueAttr
!=
null
)
{
attrName
=
dyn
.
getAttrName
(
maxValueAttr
);
if
(
attrName
.
compareTo
(
""
)
!=
0
)
{
GdhrRefObjectInfo
ret
=
dyn
.
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
ret
.
evenSts
())
System
.
out
.
println
(
"FillLevel: "
+
attrName
);
else
{
maxValueP
=
ret
.
id
;
maxValueSubid
=
ret
.
refid
;
}
}
}
}
public
void
disconnect
()
{
if
(
attrFound
)
dyn
.
en
.
gdh
.
unrefObjectInfo
(
subid
);
if
(
minValueP
!=
0
)
dyn
.
en
.
gdh
.
unrefObjectInfo
(
minValueSubid
);
if
(
maxValueP
!=
0
)
dyn
.
en
.
gdh
.
unrefObjectInfo
(
maxValueSubid
);
}
public
void
scan
()
{
if
(
!
attrFound
)
return
;
if
(
minValueP
!=
0
&&
maxValueP
!=
0
)
{
double
minVal
=
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
minValueP
);
double
maxVal
=
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
maxValueP
);
if
(
(
minVal
!=
minValue
||
maxVal
!=
maxValue
)
&&
maxVal
!=
minVal
)
{
minValue
=
minVal
;
maxValue
=
maxVal
;
firstScan
=
true
;
}
}
float
value
=
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
p
);
if
(
!
firstScan
)
{
if
(
value
==
oldValue
)
...
...
java/jpwr/jop/src/GeDynValueInput.java
View file @
7cc405a5
/*
* Proview $Id: GeDynValueInput.java,v 1.
4 2005-09-01 14:57:50
claes Exp $
* Proview $Id: GeDynValueInput.java,v 1.
5 2005-11-02 14:00:47
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -25,15 +25,20 @@ import javax.swing.*;
public
class
GeDynValueInput
extends
GeDynElem
{
double
minValue
;
double
maxValue
;
String
minValueAttr
;
String
maxValueAttr
;
boolean
attrFound
=
false
;
int
typeId
;
GeDynValue
valueElement
;
public
GeDynValueInput
(
GeDyn
dyn
,
double
minValue
,
double
maxValue
)
{
public
GeDynValueInput
(
GeDyn
dyn
,
double
minValue
,
double
maxValue
,
String
minValueAttr
,
String
maxValueAttr
)
{
super
(
dyn
,
GeDyn
.
mDynType_No
,
GeDyn
.
mActionType_ValueInput
);
this
.
minValue
=
minValue
;
this
.
maxValue
=
maxValue
;
this
.
minValueAttr
=
minValueAttr
;
this
.
maxValueAttr
=
maxValueAttr
;
}
public
void
connect
()
{
// Find the value element
...
...
@@ -73,10 +78,42 @@ public class GeDynValueInput extends GeDynElem {
PwrtStatus
sts
;
try
{
double
minval
=
0
;
double
maxval
=
0
;
if
(
minValueAttr
!=
null
)
{
String
attrName
=
dyn
.
getAttrName
(
minValueAttr
);
int
typeId
=
dyn
.
getTypeId
(
minValueAttr
);
if
(
typeId
<
0
||
typeId
==
Pwr
.
eType_Float32
)
{
CdhrFloat
ret
=
dyn
.
en
.
gdh
.
getObjectInfoFloat
(
attrName
);
if
(
ret
.
evenSts
())
{
System
.
out
.
println
(
"ValueInput "
+
attrName
);
return
;
}
minval
=
ret
.
value
;
}
}
else
minval
=
minValue
;
if
(
maxValueAttr
!=
null
)
{
String
attrName
=
dyn
.
getAttrName
(
maxValueAttr
);
int
typeId
=
dyn
.
getTypeId
(
maxValueAttr
);
if
(
typeId
<
0
||
typeId
==
Pwr
.
eType_Float32
)
{
CdhrFloat
ret
=
dyn
.
en
.
gdh
.
getObjectInfoFloat
(
attrName
);
if
(
ret
.
evenSts
())
{
System
.
out
.
println
(
"ValueInput "
+
attrName
);
return
;
}
maxval
=
ret
.
value
;
}
}
else
maxval
=
maxValue
;
if
(
typeId
==
Pwr
.
eType_Float32
)
{
float
inputValue
=
Float
.
parseFloat
(
text
.
trim
());
valueElement
.
oldValueF
=
inputValue
;
if
(
min
Value
==
0
&&
maxValue
==
0
)
{
if
(
min
val
==
0
&&
maxval
==
0
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
!
valueElement
.
localDb
)
sts
=
dyn
.
en
.
gdh
.
setObjectInfo
(
attrName
,
inputValue
);
...
...
@@ -86,8 +123,8 @@ public class GeDynValueInput extends GeDynElem {
System
.
out
.
println
(
"setObjectInfoError "
+
sts
);
}
else
{
if
(
inputValue
>=
min
Value
&&
inputValue
<=
maxValue
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
inputValue
>=
min
val
&&
inputValue
<=
maxval
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
!
valueElement
.
localDb
)
sts
=
dyn
.
en
.
gdh
.
setObjectInfo
(
attrName
,
inputValue
);
else
...
...
@@ -107,7 +144,7 @@ public class GeDynValueInput extends GeDynElem {
typeId
==
Pwr
.
eType_UInt8
)
{
int
inputValue
=
Integer
.
parseInt
(
text
.
trim
(),
10
);
valueElement
.
oldValueI
=
inputValue
;
if
(
min
Value
==
0
&&
maxValue
==
0
)
{
if
(
min
val
==
0
&&
maxval
==
0
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
!
valueElement
.
localDb
)
sts
=
dyn
.
en
.
gdh
.
setObjectInfo
(
attrName
,
inputValue
);
...
...
@@ -117,7 +154,7 @@ public class GeDynValueInput extends GeDynElem {
System
.
out
.
println
(
"setObjectInfoError "
+
sts
);
}
else
{
if
(
inputValue
>=
min
Value
&&
inputValue
<=
maxValue
)
{
if
(
inputValue
>=
min
val
&&
inputValue
<=
maxval
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
!
valueElement
.
localDb
)
sts
=
dyn
.
en
.
gdh
.
setObjectInfo
(
attrName
,
inputValue
);
...
...
java/jpwr/jop/src/JopBar.java
View file @
7cc405a5
/*
* Proview $Id: JopBar.java,v 1.
5 2005-09-01 14:57:5
0 claes Exp $
* Proview $Id: JopBar.java,v 1.
6 2005-11-02 14:00:1
0 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -242,12 +242,18 @@ public class JopBar extends JComponent implements GeComponentIfc,
public
void
setLowColor
(
int
lowColor
)
{
this
.
lowColor
=
lowColor
;}
public
int
getLowColor
()
{
return
lowColor
;}
String
pwrAttribute
=
new
String
();
String
minValueAttr
;
String
maxValueAttr
;
public
void
setPwrAttribute
(
String
pwrAttribute
)
{
this
.
pwrAttribute
=
pwrAttribute
;}
public
String
getPwrAttribute
()
{
return
pwrAttribute
;}
public
void
setMinValueAttr
(
String
minValueAttr
)
{
this
.
minValueAttr
=
minValueAttr
;}
public
void
setMaxValueAttr
(
String
maxValueAttr
)
{
this
.
maxValueAttr
=
maxValueAttr
;}
float
valueColor
;
float
valueColorOld
;
boolean
firstScan
=
true
;
GdhrRefObjectInfo
retColor
=
null
;
GdhrRefObjectInfo
retMinVal
=
null
;
GdhrRefObjectInfo
retMaxVal
=
null
;
boolean
colorAttrFound
=
false
;
float
minValue
=
0
;
float
maxValue
=
100
;
...
...
@@ -281,19 +287,44 @@ public class JopBar extends JComponent implements GeComponentIfc,
else
colorAttrFound
=
true
;
}
if
(
minValueAttr
!=
null
)
{
String
attrName
=
dd
.
getAttrName
(
minValueAttr
);
retMinVal
=
en
.
gdh
.
refObjectInfo
(
attrName
);
}
if
(
maxValueAttr
!=
null
)
{
String
attrName
=
dd
.
getAttrName
(
maxValueAttr
);
retMaxVal
=
en
.
gdh
.
refObjectInfo
(
attrName
);
}
}
public
void
dynamicClose
()
{
if
(
colorAttrFound
)
en
.
gdh
.
unrefObjectInfo
(
retColor
.
refid
);
if
(
retMinVal
!=
null
&&
retMinVal
.
oddSts
())
en
.
gdh
.
unrefObjectInfo
(
retMinVal
.
refid
);
if
(
retMaxVal
!=
null
&&
retMinVal
.
oddSts
())
en
.
gdh
.
unrefObjectInfo
(
retMaxVal
.
refid
);
}
public
void
dynamicUpdate
(
boolean
animationOnly
)
{
if
(
maxValue
==
minValue
)
if
(
maxValue
==
minValue
&&
minValueAttr
==
null
&&
maxValueAttr
==
null
)
return
;
if
(
animationOnly
)
return
;
if
(
colorAttrFound
)
{
if
(
shapes
[
0
]
==
null
)
return
;
if
(
retMinVal
!=
null
&&
retMaxVal
!=
null
&&
retMinVal
.
oddSts
()
&&
retMaxVal
.
oddSts
())
{
float
minVal
=
en
.
gdh
.
getObjectRefInfoFloat
(
retMinVal
.
id
);
float
maxVal
=
en
.
gdh
.
getObjectRefInfoFloat
(
retMaxVal
.
id
);
if
(
(
minVal
!=
minValue
||
maxVal
!=
maxValue
)
&&
maxVal
!=
minVal
)
{
minValue
=
minVal
;
maxValue
=
maxVal
;
firstScan
=
true
;
}
}
valueColor
=
en
.
gdh
.
getObjectRefInfoFloat
(
retColor
.
id
);
if
(
valueColorOld
!=
valueColor
||
firstScan
)
{
float
bar_height
;
...
...
java/jpwr/jop/src/JopTrend.java
View file @
7cc405a5
/*
* Proview $Id: JopTrend.java,v 1.
5 2005-09-01 14:57:5
0 claes Exp $
* Proview $Id: JopTrend.java,v 1.
6 2005-11-02 14:00:1
0 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -376,13 +376,21 @@ public class JopTrend extends JComponent implements GeComponentIfc,
public
Dimension
getPreferredSize
()
{
return
size
;}
public
Dimension
getMinimumSize
()
{
return
size
;}
String
[]
pwrAttribute
=
new
String
[
2
];
String
[]
minValueAttr
=
new
String
[
2
];
String
[]
maxValueAttr
=
new
String
[
2
];
public
void
setPwrAttribute1
(
String
pwrAttribute
)
{
this
.
pwrAttribute
[
0
]
=
pwrAttribute
;}
public
String
getPwrAttribute1
()
{
return
pwrAttribute
[
0
];}
public
void
setPwrAttribute2
(
String
pwrAttribute
)
{
this
.
pwrAttribute
[
1
]
=
pwrAttribute
;}
public
String
getPwrAttribute2
()
{
return
pwrAttribute
[
1
];}
public
void
setMinValueAttr1
(
String
minValueAttr1
)
{
this
.
minValueAttr
[
0
]
=
minValueAttr1
;}
public
void
setMaxValueAttr1
(
String
maxValueAttr1
)
{
this
.
maxValueAttr
[
0
]
=
maxValueAttr1
;}
public
void
setMinValueAttr2
(
String
minValueAttr2
)
{
this
.
minValueAttr
[
1
]
=
minValueAttr2
;}
public
void
setMaxValueAttr2
(
String
maxValueAttr2
)
{
this
.
maxValueAttr
[
1
]
=
maxValueAttr2
;}
float
[]
valueOld
=
new
float
[
2
];
boolean
firstScan
=
true
;
GdhrRefObjectInfo
[]
retColor
=
{
null
,
null
};
GdhrRefObjectInfo
[]
retMinVal
=
{
null
,
null
};
GdhrRefObjectInfo
[]
retMaxVal
=
{
null
,
null
};
boolean
[]
attrFound
=
{
false
,
false
};
float
[]
minValue
=
{
0
,
0
};
float
[]
maxValue
=
{
100
,
100
};
...
...
@@ -415,8 +423,10 @@ public class JopTrend extends JComponent implements GeComponentIfc,
}
public
void
reset
()
{
for
(
int
j
=
0
;
j
<
2
;
j
++)
{
for
(
int
i
=
0
;
i
<
noOfPoints
;
i
++)
y_values
[
j
][
i
]
=
original_height
;
if
(
y_values
[
j
]
!=
null
)
{
for
(
int
i
=
0
;
i
<
noOfPoints
;
i
++)
y_values
[
j
][
i
]
=
original_height
;
}
}
repaint
();
}
...
...
@@ -432,12 +442,28 @@ public class JopTrend extends JComponent implements GeComponentIfc,
else
attrFound
[
j
]
=
true
;
}
if
(
minValueAttr
[
j
]
!=
null
&&
minValueAttr
[
j
].
compareTo
(
""
)
!=
0
)
{
String
attrName
=
dd
.
getAttrName
(
minValueAttr
[
j
]);
retMinVal
[
j
]
=
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
retMinVal
[
j
].
evenSts
())
System
.
out
.
println
(
"refObjectInfoError "
+
minValueAttr
[
j
]);
}
if
(
maxValueAttr
[
j
]
!=
null
&&
maxValueAttr
[
j
].
compareTo
(
""
)
!=
0
)
{
String
attrName
=
dd
.
getAttrName
(
maxValueAttr
[
j
]);
retMaxVal
[
j
]
=
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
retMaxVal
[
j
].
evenSts
())
System
.
out
.
println
(
"refObjectInfoError "
+
maxValueAttr
[
j
]);
}
}
}
public
void
dynamicClose
()
{
for
(
int
j
=
0
;
j
<
2
;
j
++)
{
if
(
attrFound
[
j
])
en
.
gdh
.
unrefObjectInfo
(
retColor
[
j
].
refid
);
if
(
retMinVal
[
j
]
!=
null
&&
retMinVal
[
j
].
oddSts
())
en
.
gdh
.
unrefObjectInfo
(
retMinVal
[
j
].
refid
);
if
(
retMaxVal
[
j
]
!=
null
&&
retMaxVal
[
j
].
oddSts
())
en
.
gdh
.
unrefObjectInfo
(
retMaxVal
[
j
].
refid
);
}
}
public
void
dynamicUpdate
(
boolean
animationOnly
)
{
...
...
@@ -455,6 +481,18 @@ public class JopTrend extends JComponent implements GeComponentIfc,
for
(
j
=
0
;
j
<
2
;
j
++)
{
if
(
attrFound
[
j
])
{
if
(
retMinVal
[
j
]
!=
null
&&
retMaxVal
[
j
]
!=
null
&&
retMinVal
[
j
].
oddSts
()
&&
retMaxVal
[
j
].
oddSts
())
{
float
minVal
=
en
.
gdh
.
getObjectRefInfoFloat
(
retMinVal
[
j
].
id
);
float
maxVal
=
en
.
gdh
.
getObjectRefInfoFloat
(
retMaxVal
[
j
].
id
);
if
(
(
minVal
!=
minValue
[
j
]
||
maxVal
!=
maxValue
[
j
])
&&
maxVal
!=
minVal
)
{
minValue
[
j
]
=
minVal
;
maxValue
[
j
]
=
maxVal
;
reset
();
}
}
switch
(
retColor
[
j
].
typeId
)
{
case
Pwr
.
eType_Boolean
:
if
(
en
.
gdh
.
getObjectRefInfoBoolean
(
retColor
[
j
].
id
))
...
...
src/jpwr/jop/src/GeDynFillLevel.java
View file @
7cc405a5
/*
* Proview $Id: GeDynFillLevel.java,v 1.
2 2005-09-01 14:57:5
0 claes Exp $
* Proview $Id: GeDynFillLevel.java,v 1.
3 2005-11-02 14:00:1
0 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -29,15 +29,22 @@ public class GeDynFillLevel extends GeDynElem {
double
maxValue
;
double
minPos
;
double
maxPos
;
String
minValueAttr
;
String
maxValueAttr
;
boolean
attrFound
;
PwrtRefId
subid
;
int
p
;
float
oldValue
;
boolean
firstScan
=
true
;
int
minValueP
;
int
maxValueP
;
PwrtRefId
minValueSubid
;
PwrtRefId
maxValueSubid
;
public
GeDynFillLevel
(
GeDyn
dyn
,
String
attribute
,
int
color
,
int
direction
,
double
minValue
,
double
maxValue
,
double
minPos
,
double
maxPos
)
{
double
minValue
,
double
maxValue
,
double
minPos
,
double
maxPos
,
String
minValueAttr
,
String
maxValueAttr
)
{
super
(
dyn
,
GeDyn
.
mDynType_FillLevel
,
GeDyn
.
mActionType_No
);
this
.
attribute
=
attribute
;
this
.
color
=
color
;
...
...
@@ -46,9 +53,11 @@ public class GeDynFillLevel extends GeDynElem {
this
.
maxValue
=
maxValue
;
this
.
minPos
=
minPos
;
this
.
maxPos
=
maxPos
;
this
.
minValueAttr
=
minValueAttr
;
this
.
maxValueAttr
=
maxValueAttr
;
}
public
void
connect
()
{
if
(
minValue
==
maxValue
)
if
(
minValue
==
maxValue
&&
minValueAttr
==
null
&&
maxValueAttr
==
null
)
return
;
String
attrName
=
dyn
.
getAttrName
(
attribute
);
...
...
@@ -74,14 +83,54 @@ public class GeDynFillLevel extends GeDynElem {
dyn
.
comp
.
setLevelFillColor
(
color
);
}
}
minValueP
=
0
;
if
(
minValueAttr
!=
null
)
{
attrName
=
dyn
.
getAttrName
(
minValueAttr
);
if
(
attrName
.
compareTo
(
""
)
!=
0
)
{
GdhrRefObjectInfo
ret
=
dyn
.
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
ret
.
evenSts
())
System
.
out
.
println
(
"FillLevel: "
+
attrName
);
else
{
minValueP
=
ret
.
id
;
minValueSubid
=
ret
.
refid
;
}
}
}
maxValueP
=
0
;
if
(
maxValueAttr
!=
null
)
{
attrName
=
dyn
.
getAttrName
(
maxValueAttr
);
if
(
attrName
.
compareTo
(
""
)
!=
0
)
{
GdhrRefObjectInfo
ret
=
dyn
.
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
ret
.
evenSts
())
System
.
out
.
println
(
"FillLevel: "
+
attrName
);
else
{
maxValueP
=
ret
.
id
;
maxValueSubid
=
ret
.
refid
;
}
}
}
}
public
void
disconnect
()
{
if
(
attrFound
)
dyn
.
en
.
gdh
.
unrefObjectInfo
(
subid
);
if
(
minValueP
!=
0
)
dyn
.
en
.
gdh
.
unrefObjectInfo
(
minValueSubid
);
if
(
maxValueP
!=
0
)
dyn
.
en
.
gdh
.
unrefObjectInfo
(
maxValueSubid
);
}
public
void
scan
()
{
if
(
!
attrFound
)
return
;
if
(
minValueP
!=
0
&&
maxValueP
!=
0
)
{
double
minVal
=
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
minValueP
);
double
maxVal
=
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
maxValueP
);
if
(
(
minVal
!=
minValue
||
maxVal
!=
maxValue
)
&&
maxVal
!=
minVal
)
{
minValue
=
minVal
;
maxValue
=
maxVal
;
firstScan
=
true
;
}
}
float
value
=
dyn
.
en
.
gdh
.
getObjectRefInfoFloat
(
p
);
if
(
!
firstScan
)
{
if
(
value
==
oldValue
)
...
...
src/jpwr/jop/src/GeDynValueInput.java
View file @
7cc405a5
/*
* Proview $Id: GeDynValueInput.java,v 1.
4 2005-09-01 14:57:50
claes Exp $
* Proview $Id: GeDynValueInput.java,v 1.
5 2005-11-02 14:00:47
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -25,15 +25,20 @@ import javax.swing.*;
public
class
GeDynValueInput
extends
GeDynElem
{
double
minValue
;
double
maxValue
;
String
minValueAttr
;
String
maxValueAttr
;
boolean
attrFound
=
false
;
int
typeId
;
GeDynValue
valueElement
;
public
GeDynValueInput
(
GeDyn
dyn
,
double
minValue
,
double
maxValue
)
{
public
GeDynValueInput
(
GeDyn
dyn
,
double
minValue
,
double
maxValue
,
String
minValueAttr
,
String
maxValueAttr
)
{
super
(
dyn
,
GeDyn
.
mDynType_No
,
GeDyn
.
mActionType_ValueInput
);
this
.
minValue
=
minValue
;
this
.
maxValue
=
maxValue
;
this
.
minValueAttr
=
minValueAttr
;
this
.
maxValueAttr
=
maxValueAttr
;
}
public
void
connect
()
{
// Find the value element
...
...
@@ -73,10 +78,42 @@ public class GeDynValueInput extends GeDynElem {
PwrtStatus
sts
;
try
{
double
minval
=
0
;
double
maxval
=
0
;
if
(
minValueAttr
!=
null
)
{
String
attrName
=
dyn
.
getAttrName
(
minValueAttr
);
int
typeId
=
dyn
.
getTypeId
(
minValueAttr
);
if
(
typeId
<
0
||
typeId
==
Pwr
.
eType_Float32
)
{
CdhrFloat
ret
=
dyn
.
en
.
gdh
.
getObjectInfoFloat
(
attrName
);
if
(
ret
.
evenSts
())
{
System
.
out
.
println
(
"ValueInput "
+
attrName
);
return
;
}
minval
=
ret
.
value
;
}
}
else
minval
=
minValue
;
if
(
maxValueAttr
!=
null
)
{
String
attrName
=
dyn
.
getAttrName
(
maxValueAttr
);
int
typeId
=
dyn
.
getTypeId
(
maxValueAttr
);
if
(
typeId
<
0
||
typeId
==
Pwr
.
eType_Float32
)
{
CdhrFloat
ret
=
dyn
.
en
.
gdh
.
getObjectInfoFloat
(
attrName
);
if
(
ret
.
evenSts
())
{
System
.
out
.
println
(
"ValueInput "
+
attrName
);
return
;
}
maxval
=
ret
.
value
;
}
}
else
maxval
=
maxValue
;
if
(
typeId
==
Pwr
.
eType_Float32
)
{
float
inputValue
=
Float
.
parseFloat
(
text
.
trim
());
valueElement
.
oldValueF
=
inputValue
;
if
(
min
Value
==
0
&&
maxValue
==
0
)
{
if
(
min
val
==
0
&&
maxval
==
0
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
!
valueElement
.
localDb
)
sts
=
dyn
.
en
.
gdh
.
setObjectInfo
(
attrName
,
inputValue
);
...
...
@@ -86,8 +123,8 @@ public class GeDynValueInput extends GeDynElem {
System
.
out
.
println
(
"setObjectInfoError "
+
sts
);
}
else
{
if
(
inputValue
>=
min
Value
&&
inputValue
<=
maxValue
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
inputValue
>=
min
val
&&
inputValue
<=
maxval
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
!
valueElement
.
localDb
)
sts
=
dyn
.
en
.
gdh
.
setObjectInfo
(
attrName
,
inputValue
);
else
...
...
@@ -107,7 +144,7 @@ public class GeDynValueInput extends GeDynElem {
typeId
==
Pwr
.
eType_UInt8
)
{
int
inputValue
=
Integer
.
parseInt
(
text
.
trim
(),
10
);
valueElement
.
oldValueI
=
inputValue
;
if
(
min
Value
==
0
&&
maxValue
==
0
)
{
if
(
min
val
==
0
&&
maxval
==
0
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
!
valueElement
.
localDb
)
sts
=
dyn
.
en
.
gdh
.
setObjectInfo
(
attrName
,
inputValue
);
...
...
@@ -117,7 +154,7 @@ public class GeDynValueInput extends GeDynElem {
System
.
out
.
println
(
"setObjectInfoError "
+
sts
);
}
else
{
if
(
inputValue
>=
min
Value
&&
inputValue
<=
maxValue
)
{
if
(
inputValue
>=
min
val
&&
inputValue
<=
maxval
)
{
String
attrName
=
dyn
.
getAttrNameNoSuffix
(
valueElement
.
attribute
);
if
(
!
valueElement
.
localDb
)
sts
=
dyn
.
en
.
gdh
.
setObjectInfo
(
attrName
,
inputValue
);
...
...
src/jpwr/jop/src/JopBar.java
View file @
7cc405a5
/*
* Proview $Id: JopBar.java,v 1.
5 2005-09-01 14:57:5
0 claes Exp $
* Proview $Id: JopBar.java,v 1.
6 2005-11-02 14:00:1
0 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -242,12 +242,18 @@ public class JopBar extends JComponent implements GeComponentIfc,
public
void
setLowColor
(
int
lowColor
)
{
this
.
lowColor
=
lowColor
;}
public
int
getLowColor
()
{
return
lowColor
;}
String
pwrAttribute
=
new
String
();
String
minValueAttr
;
String
maxValueAttr
;
public
void
setPwrAttribute
(
String
pwrAttribute
)
{
this
.
pwrAttribute
=
pwrAttribute
;}
public
String
getPwrAttribute
()
{
return
pwrAttribute
;}
public
void
setMinValueAttr
(
String
minValueAttr
)
{
this
.
minValueAttr
=
minValueAttr
;}
public
void
setMaxValueAttr
(
String
maxValueAttr
)
{
this
.
maxValueAttr
=
maxValueAttr
;}
float
valueColor
;
float
valueColorOld
;
boolean
firstScan
=
true
;
GdhrRefObjectInfo
retColor
=
null
;
GdhrRefObjectInfo
retMinVal
=
null
;
GdhrRefObjectInfo
retMaxVal
=
null
;
boolean
colorAttrFound
=
false
;
float
minValue
=
0
;
float
maxValue
=
100
;
...
...
@@ -281,19 +287,44 @@ public class JopBar extends JComponent implements GeComponentIfc,
else
colorAttrFound
=
true
;
}
if
(
minValueAttr
!=
null
)
{
String
attrName
=
dd
.
getAttrName
(
minValueAttr
);
retMinVal
=
en
.
gdh
.
refObjectInfo
(
attrName
);
}
if
(
maxValueAttr
!=
null
)
{
String
attrName
=
dd
.
getAttrName
(
maxValueAttr
);
retMaxVal
=
en
.
gdh
.
refObjectInfo
(
attrName
);
}
}
public
void
dynamicClose
()
{
if
(
colorAttrFound
)
en
.
gdh
.
unrefObjectInfo
(
retColor
.
refid
);
if
(
retMinVal
!=
null
&&
retMinVal
.
oddSts
())
en
.
gdh
.
unrefObjectInfo
(
retMinVal
.
refid
);
if
(
retMaxVal
!=
null
&&
retMinVal
.
oddSts
())
en
.
gdh
.
unrefObjectInfo
(
retMaxVal
.
refid
);
}
public
void
dynamicUpdate
(
boolean
animationOnly
)
{
if
(
maxValue
==
minValue
)
if
(
maxValue
==
minValue
&&
minValueAttr
==
null
&&
maxValueAttr
==
null
)
return
;
if
(
animationOnly
)
return
;
if
(
colorAttrFound
)
{
if
(
shapes
[
0
]
==
null
)
return
;
if
(
retMinVal
!=
null
&&
retMaxVal
!=
null
&&
retMinVal
.
oddSts
()
&&
retMaxVal
.
oddSts
())
{
float
minVal
=
en
.
gdh
.
getObjectRefInfoFloat
(
retMinVal
.
id
);
float
maxVal
=
en
.
gdh
.
getObjectRefInfoFloat
(
retMaxVal
.
id
);
if
(
(
minVal
!=
minValue
||
maxVal
!=
maxValue
)
&&
maxVal
!=
minVal
)
{
minValue
=
minVal
;
maxValue
=
maxVal
;
firstScan
=
true
;
}
}
valueColor
=
en
.
gdh
.
getObjectRefInfoFloat
(
retColor
.
id
);
if
(
valueColorOld
!=
valueColor
||
firstScan
)
{
float
bar_height
;
...
...
src/jpwr/jop/src/JopTrend.java
View file @
7cc405a5
/*
* Proview $Id: JopTrend.java,v 1.
5 2005-09-01 14:57:5
0 claes Exp $
* Proview $Id: JopTrend.java,v 1.
6 2005-11-02 14:00:1
0 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -376,13 +376,21 @@ public class JopTrend extends JComponent implements GeComponentIfc,
public
Dimension
getPreferredSize
()
{
return
size
;}
public
Dimension
getMinimumSize
()
{
return
size
;}
String
[]
pwrAttribute
=
new
String
[
2
];
String
[]
minValueAttr
=
new
String
[
2
];
String
[]
maxValueAttr
=
new
String
[
2
];
public
void
setPwrAttribute1
(
String
pwrAttribute
)
{
this
.
pwrAttribute
[
0
]
=
pwrAttribute
;}
public
String
getPwrAttribute1
()
{
return
pwrAttribute
[
0
];}
public
void
setPwrAttribute2
(
String
pwrAttribute
)
{
this
.
pwrAttribute
[
1
]
=
pwrAttribute
;}
public
String
getPwrAttribute2
()
{
return
pwrAttribute
[
1
];}
public
void
setMinValueAttr1
(
String
minValueAttr1
)
{
this
.
minValueAttr
[
0
]
=
minValueAttr1
;}
public
void
setMaxValueAttr1
(
String
maxValueAttr1
)
{
this
.
maxValueAttr
[
0
]
=
maxValueAttr1
;}
public
void
setMinValueAttr2
(
String
minValueAttr2
)
{
this
.
minValueAttr
[
1
]
=
minValueAttr2
;}
public
void
setMaxValueAttr2
(
String
maxValueAttr2
)
{
this
.
maxValueAttr
[
1
]
=
maxValueAttr2
;}
float
[]
valueOld
=
new
float
[
2
];
boolean
firstScan
=
true
;
GdhrRefObjectInfo
[]
retColor
=
{
null
,
null
};
GdhrRefObjectInfo
[]
retMinVal
=
{
null
,
null
};
GdhrRefObjectInfo
[]
retMaxVal
=
{
null
,
null
};
boolean
[]
attrFound
=
{
false
,
false
};
float
[]
minValue
=
{
0
,
0
};
float
[]
maxValue
=
{
100
,
100
};
...
...
@@ -415,8 +423,10 @@ public class JopTrend extends JComponent implements GeComponentIfc,
}
public
void
reset
()
{
for
(
int
j
=
0
;
j
<
2
;
j
++)
{
for
(
int
i
=
0
;
i
<
noOfPoints
;
i
++)
y_values
[
j
][
i
]
=
original_height
;
if
(
y_values
[
j
]
!=
null
)
{
for
(
int
i
=
0
;
i
<
noOfPoints
;
i
++)
y_values
[
j
][
i
]
=
original_height
;
}
}
repaint
();
}
...
...
@@ -432,12 +442,28 @@ public class JopTrend extends JComponent implements GeComponentIfc,
else
attrFound
[
j
]
=
true
;
}
if
(
minValueAttr
[
j
]
!=
null
&&
minValueAttr
[
j
].
compareTo
(
""
)
!=
0
)
{
String
attrName
=
dd
.
getAttrName
(
minValueAttr
[
j
]);
retMinVal
[
j
]
=
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
retMinVal
[
j
].
evenSts
())
System
.
out
.
println
(
"refObjectInfoError "
+
minValueAttr
[
j
]);
}
if
(
maxValueAttr
[
j
]
!=
null
&&
maxValueAttr
[
j
].
compareTo
(
""
)
!=
0
)
{
String
attrName
=
dd
.
getAttrName
(
maxValueAttr
[
j
]);
retMaxVal
[
j
]
=
en
.
gdh
.
refObjectInfo
(
attrName
);
if
(
retMaxVal
[
j
].
evenSts
())
System
.
out
.
println
(
"refObjectInfoError "
+
maxValueAttr
[
j
]);
}
}
}
public
void
dynamicClose
()
{
for
(
int
j
=
0
;
j
<
2
;
j
++)
{
if
(
attrFound
[
j
])
en
.
gdh
.
unrefObjectInfo
(
retColor
[
j
].
refid
);
if
(
retMinVal
[
j
]
!=
null
&&
retMinVal
[
j
].
oddSts
())
en
.
gdh
.
unrefObjectInfo
(
retMinVal
[
j
].
refid
);
if
(
retMaxVal
[
j
]
!=
null
&&
retMaxVal
[
j
].
oddSts
())
en
.
gdh
.
unrefObjectInfo
(
retMaxVal
[
j
].
refid
);
}
}
public
void
dynamicUpdate
(
boolean
animationOnly
)
{
...
...
@@ -455,6 +481,18 @@ public class JopTrend extends JComponent implements GeComponentIfc,
for
(
j
=
0
;
j
<
2
;
j
++)
{
if
(
attrFound
[
j
])
{
if
(
retMinVal
[
j
]
!=
null
&&
retMaxVal
[
j
]
!=
null
&&
retMinVal
[
j
].
oddSts
()
&&
retMaxVal
[
j
].
oddSts
())
{
float
minVal
=
en
.
gdh
.
getObjectRefInfoFloat
(
retMinVal
[
j
].
id
);
float
maxVal
=
en
.
gdh
.
getObjectRefInfoFloat
(
retMaxVal
[
j
].
id
);
if
(
(
minVal
!=
minValue
[
j
]
||
maxVal
!=
maxValue
[
j
])
&&
maxVal
!=
minVal
)
{
minValue
[
j
]
=
minVal
;
maxValue
[
j
]
=
maxVal
;
reset
();
}
}
switch
(
retColor
[
j
].
typeId
)
{
case
Pwr
.
eType_Boolean
:
if
(
en
.
gdh
.
getObjectRefInfoBoolean
(
retColor
[
j
].
id
))
...
...
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