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
5f9ff3c5
Commit
5f9ff3c5
authored
Feb 03, 2014
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java android app work
parent
e01bb94c
Changes
33
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
704 additions
and
571 deletions
+704
-571
java/aapp/app/src/AGraphInfo.java
java/aapp/app/src/AGraphInfo.java
+2
-0
java/aapp/app/src/AXttItemAttrObject.java
java/aapp/app/src/AXttItemAttrObject.java
+21
-0
java/aapp/app/src/FlowCmn.java
java/aapp/app/src/FlowCmn.java
+9
-6
java/aapp/app/src/FlowCon.java
java/aapp/app/src/FlowCon.java
+2
-2
java/aapp/app/src/FlowNode.java
java/aapp/app/src/FlowNode.java
+2
-2
java/aapp/app/src/GraphCmn.java
java/aapp/app/src/GraphCmn.java
+7
-0
java/aapp/app/src/OpwinCmn.java
java/aapp/app/src/OpwinCmn.java
+32
-12
java/aapp/app/src/PlowCmn.java
java/aapp/app/src/PlowCmn.java
+8
-1
java/aapp/app/src/PlowCmnIfc.java
java/aapp/app/src/PlowCmnIfc.java
+5
-0
java/aapp/app/src/PlowDraw.java
java/aapp/app/src/PlowDraw.java
+33
-8
java/aapp/app/src/PlowDrawIfc.java
java/aapp/app/src/PlowDrawIfc.java
+1
-1
java/aapp/app/src/PlowEvent.java
java/aapp/app/src/PlowEvent.java
+1
-0
java/aapp/app/src/PlowNode.java
java/aapp/app/src/PlowNode.java
+1
-1
java/aapp/jopg/src/GlowDraw.java
java/aapp/jopg/src/GlowDraw.java
+0
-1
java/aapp/jopg/src/GrowFrame.java
java/aapp/jopg/src/GrowFrame.java
+6
-249
java/aapp/pwrxtt/src/MainActivity.java
java/aapp/pwrxtt/src/MainActivity.java
+427
-277
java/jpwr/jopg/src/Dyn.java
java/jpwr/jopg/src/Dyn.java
+52
-3
java/jpwr/jopg/src/Glow.java
java/jpwr/jopg/src/Glow.java
+6
-0
java/jpwr/jopg/src/Graph.java
java/jpwr/jopg/src/Graph.java
+10
-1
java/jpwr/jopg/src/GraphApplIfc.java
java/jpwr/jopg/src/GraphApplIfc.java
+1
-0
java/jpwr/jopg/src/GraphIfc.java
java/jpwr/jopg/src/GraphIfc.java
+1
-0
java/jpwr/jopg/src/GrowCmn.java
java/jpwr/jopg/src/GrowCmn.java
+5
-1
java/jpwr/jopg/src/GrowCtx.java
java/jpwr/jopg/src/GrowCtx.java
+11
-0
java/jpwr/jopg/src/GrowCtxIfc.java
java/jpwr/jopg/src/GrowCtxIfc.java
+1
-0
java/jpwr/jopg/src/GrowScrollBar.java
java/jpwr/jopg/src/GrowScrollBar.java
+3
-0
java/jpwr/jopg/src/GrowWindow.java
java/jpwr/jopg/src/GrowWindow.java
+12
-4
src/tools/pkg/deb/src/os_templ/hw_templ/makefile
src/tools/pkg/deb/src/os_templ/hw_templ/makefile
+6
-0
src/wbl/pwrb/src/pwrb_c_webhandler.wb_load
src/wbl/pwrb/src/pwrb_c_webhandler.wb_load
+9
-0
xtt/lib/ge/src/ge_attrnav.cpp
xtt/lib/ge/src/ge_attrnav.cpp
+10
-0
xtt/lib/glow/src/glow.h
xtt/lib/glow/src/glow.h
+10
-1
xtt/lib/glow/src/glow_ctx.cpp
xtt/lib/glow/src/glow_ctx.cpp
+4
-1
xtt/lib/glow/src/glow_ctx.h
xtt/lib/glow/src/glow_ctx.h
+1
-0
xtt/lib/glow/src/glow_growapi.cpp
xtt/lib/glow/src/glow_growapi.cpp
+5
-0
No files found.
java/aapp/app/src/AGraphInfo.java
View file @
5f9ff3c5
...
...
@@ -4,6 +4,7 @@ import android.graphics.Bitmap;
public
class
AGraphInfo
{
public
Bitmap
bpm
;
public
Bitmap
bpmInverted
;
public
String
graph
;
public
String
text
;
public
int
iconX
;
...
...
@@ -12,4 +13,5 @@ public class AGraphInfo {
public
int
iconHeight
;
public
int
textX
;
public
int
textY
;
public
boolean
inverted
=
false
;
}
java/aapp/app/src/AXttItemAttrObject.java
View file @
5f9ff3c5
...
...
@@ -11,6 +11,8 @@ public class AXttItemAttrObject extends AXttItemBase {
String
name
;
int
flags
;
int
type
;
PwrtAttrRef
aref
;
AXttItemAttrObject
(
AXtt
axtt
,
PwrtObjid
objid
,
String
name
,
String
fullName
,
int
flags
,
int
type
,
PlowNode
destination
,
int
destCode
)
{
...
...
@@ -20,9 +22,24 @@ public class AXttItemAttrObject extends AXttItemBase {
this
.
flags
=
flags
;
this
.
type
=
type
;
CdhrAttrRef
ar
=
axtt
.
gdh
.
nameToAttrRef
(
fullName
);
if
(
ar
.
evenSts
())
return
;
aref
=
ar
.
aref
;
CdhrTypeId
cr
=
axtt
.
gdh
.
getAttrRefTid
(
ar
.
aref
);
if
(
cr
.
evenSts
())
return
;
CdhrObjid
coidret
=
axtt
.
gdh
.
classIdToObjid
(
cr
.
typeId
);
if
(
coidret
.
evenSts
())
return
;
CdhrString
cnameret
=
axtt
.
gdh
.
objidToName
(
coidret
.
objid
,
Cdh
.
mName_object
);
if
(
cnameret
.
evenSts
())
return
;
node
=
new
PlowNode
(
axtt
.
cmn
,
0
,
0
,
axtt
.
ncObject
);
node
.
setAnnotPixmap
(
0
,
axtt
.
iconObject
);
node
.
setAnnotation
(
0
,
name
,
22
);
node
.
setAnnotation
(
1
,
cnameret
.
str
,
22
);
axtt
.
cmn
.
insertNode
(
node
,
destination
,
destCode
);
node
.
setUserData
(
this
);
...
...
@@ -89,4 +106,8 @@ public class AXttItemAttrObject extends AXttItemBase {
}
axtt
.
cmn
.
configure
();
}
public
PwrtAttrRef
getAttrRef
()
{
return
aref
;
}
}
java/aapp/app/src/FlowCmn.java
View file @
5f9ff3c5
...
...
@@ -126,14 +126,14 @@ public class FlowCmn implements PlowCmnIfc {
public
void
scroll
(
int
x
,
int
y
)
{
offset_y
+=
y
;
offset_x
+=
x
;
if
(
offset_x
<
x_left
*
zoom_factor
-
scrollOffset
)
offset_x
=
(
int
)(
x_left
*
zoom_factor
)
-
scrollOffset
;
if
(
offset_x
>
x_right
*
zoom_factor
-
canvasWidth
+
scrollOffset
)
offset_x
=
(
int
)(
x_right
*
zoom_factor
-
canvasWidth
)
+
scrollOffset
;
if
(
offset_
y
<
y_low
*
zoom_factor
-
scrollOffset
)
offset_
y
=
(
int
)(
y_low
*
zoom_factor
)
-
scrollOffset
;
if
(
offset_
x
<
x_left
*
zoom_factor
-
scrollOffset
)
offset_
x
=
(
int
)(
x_left
*
zoom_factor
)
-
scrollOffset
;
if
(
offset_y
>
y_high
*
zoom_factor
-
canvasHeight
+
80
+
scrollOffset
)
offset_y
=
(
int
)(
y_high
*
zoom_factor
-
canvasHeight
+
80
)
+
scrollOffset
;
if
(
offset_y
<
y_low
*
zoom_factor
-
scrollOffset
)
offset_y
=
(
int
)(
y_low
*
zoom_factor
)
-
scrollOffset
;
}
@Override
public
void
pageUp
()
{
...
...
@@ -155,9 +155,12 @@ public class FlowCmn implements PlowCmnIfc {
int
type
;
switch
(
action
)
{
case
MotionEvent
.
ACTION_UP
:
case
PlowCmnIfc
.
ACTION_CLICK
:
type
=
PlowEvent
.
TYPE_CLICK
;
break
;
case
PlowCmnIfc
.
ACTION_LONG_CLICK
:
type
=
PlowEvent
.
TYPE_LONG_CLICK
;
break
;
default
:
return
;
}
...
...
java/aapp/app/src/FlowCon.java
View file @
5f9ff3c5
...
...
@@ -227,8 +227,8 @@ public class FlowCon implements FlowArrayElem {
public
void
draw
(
FlowPoint
p0
,
String
[]
annotv
,
boolean
highlight
)
{
// Adjust pos to javabean koordinates
FlowPoint
p
=
new
FlowPoint
(
cmn
);
p
.
x
=
x_left
/
cmn
.
zoom_factor
;
p
.
y
=
y_low
/
cmn
.
zoom_factor
;
p
.
x
=
0
;
p
.
y
=
0
;
if
(
temporary_ref
!=
0
||
cc
.
con_type
==
Flow
.
eConType_Reference
)
ref_a
.
draw
(
p
,
null
,
highlight
);
else
{
...
...
java/aapp/app/src/FlowNode.java
View file @
5f9ff3c5
...
...
@@ -178,7 +178,7 @@ public class FlowNode implements FlowArrayElem {
else
break
;
}
buf
.
append
(
c
);
// TODO convert to UTF-8
buf
.
append
(
c
);
c_old
=
c
;
}
annotv
[
i
]
=
new
String
(
buf
);
...
...
java/aapp/app/src/GraphCmn.java
View file @
5f9ff3c5
...
...
@@ -139,4 +139,11 @@ public class GraphCmn implements PlowCmnIfc {
public
void
resetNodraw
()
{
graph
.
ctx
.
cmn
.
resetNodraw
();
}
public
int
getAppMotion
()
{
return
graph
.
cmn
.
getAppMotion
();
}
public
boolean
getSliderActive
()
{
return
graph
.
ctx
.
getSliderActive
();
}
}
java/aapp/app/src/OpwinCmn.java
View file @
5f9ff3c5
...
...
@@ -6,6 +6,7 @@ import jpwr.pwrxtt.MainActivity;
import
android.graphics.Canvas
;
import
android.graphics.Paint
;
import
android.view.MotionEvent
;
public
class
OpwinCmn
implements
PlowCmnIfc
{
Object
userData
;
...
...
@@ -17,10 +18,15 @@ public class OpwinCmn implements PlowCmnIfc {
int
canvasWidth
;
int
offsetY
=
0
;
int
borderY
=
0
;
AGraphInfo
currentGraph
=
null
;
double
downX
;
double
downY
;
float
density
;
public
OpwinCmn
(
MainActivity
appl
,
Vector
<
AGraphInfo
>
graphList
)
{
public
OpwinCmn
(
MainActivity
appl
,
Vector
<
AGraphInfo
>
graphList
,
float
density
)
{
this
.
graphList
=
graphList
;
this
.
appl
=
appl
;
this
.
density
=
density
;
}
public
int
type
()
{
return
TYPE_OPWIN
;
...
...
@@ -41,10 +47,10 @@ public class OpwinCmn implements PlowCmnIfc {
if
(
graph
.
iconHeight
>
iconHeightMax
)
iconHeightMax
=
graph
.
iconHeight
;
}
int
offsetX
=
100
;
int
offsetY
=
100
;
int
distX
=
iconWidthMax
+
50
;
int
distY
=
iconHeightMax
+
70
;
int
offsetX
=
(
int
)(
density
*
100
)
;
int
offsetY
=
(
int
)(
density
*
100
)
;
int
distX
=
iconWidthMax
+
(
int
)(
density
*
50
)
;
int
distY
=
iconHeightMax
+
(
int
)(
density
*
70
)
;
int
x
=
offsetX
;
int
y
=
offsetY
;
for
(
int
i
=
0
;
i
<
graphList
.
size
();
i
++)
{
...
...
@@ -52,7 +58,7 @@ public class OpwinCmn implements PlowCmnIfc {
graph
.
iconX
=
x
;
graph
.
iconY
=
y
;
graph
.
textX
=
graph
.
iconX
+
graph
.
iconWidth
/
2
;
graph
.
textY
=
graph
.
iconY
+
graph
.
iconHeight
+
15
;
graph
.
textY
=
graph
.
iconY
+
graph
.
iconHeight
+
(
int
)(
density
*
15
)
;
borderY
=
graph
.
textY
+
100
;
...
...
@@ -78,7 +84,12 @@ public class OpwinCmn implements PlowCmnIfc {
for
(
int
i
=
0
;
i
<
graphList
.
size
();
i
++)
{
AGraphInfo
graph
=
graphList
.
get
(
i
);
if
(
graph
.
inverted
)
canvas
.
drawBitmap
(
graph
.
bpmInverted
,
graph
.
iconX
,
graph
.
iconY
-
offsetY
,
p
);
else
canvas
.
drawBitmap
(
graph
.
bpm
,
graph
.
iconX
,
graph
.
iconY
-
offsetY
,
p
);
p
.
setTextSize
(
density
*
15
);
int
textWidth
=
(
int
)
p
.
measureText
(
graph
.
text
);
canvas
.
drawText
(
graph
.
text
,
graph
.
textX
-
textWidth
/
2
,
graph
.
textY
-
offsetY
,
p
);
}
...
...
@@ -100,14 +111,23 @@ public class OpwinCmn implements PlowCmnIfc {
public
void
pageDown
()
{}
public
void
eventHandler
(
int
action
,
double
fx
,
double
fy
)
{
switch
(
action
)
{
case
PlowEvent
.
TYPE_CLICK
:
System
.
out
.
println
(
"Opwin click "
+
fx
+
" "
+
fy
);
case
PlowCmnIfc
.
ACTION_UP
:
if
(
currentGraph
!=
null
)
{
String
cmd
=
"open graph "
+
currentGraph
.
graph
;
if
(
Math
.
abs
(
fx
-
downX
)
<
10
&&
Math
.
abs
(
fy
-
downY
)
<
10
)
appl
.
command
(
cmd
);
currentGraph
.
inverted
=
false
;
currentGraph
=
null
;
}
break
;
case
PlowCmnIfc
.
ACTION_DOWN
:
for
(
int
i
=
0
;
i
<
graphList
.
size
();
i
++)
{
if
(
fx
>
graphList
.
get
(
i
).
iconX
&&
fx
<=
graphList
.
get
(
i
).
iconX
+
graphList
.
get
(
i
).
iconWidth
&&
fy
>
graphList
.
get
(
i
).
iconY
-
offsetY
&&
fy
<=
graphList
.
get
(
i
).
iconY
+
graphList
.
get
(
i
).
iconHeight
-
offsetY
)
{
System
.
out
.
println
(
"Hit in icon"
);
String
cmd
=
"open graph "
+
graphList
.
get
(
i
).
graph
;
appl
.
command
(
cmd
);
currentGraph
=
graphList
.
get
(
i
);
currentGraph
.
inverted
=
true
;
downX
=
fx
;
downY
=
fy
;
}
}
break
;
...
...
java/aapp/app/src/PlowCmn.java
View file @
5f9ff3c5
...
...
@@ -77,11 +77,16 @@ public class PlowCmn implements PlowCmnIfc {
double
x
=
(
fx
+
offset_x
)
/
zoom_factor
;
double
y
=
(
fy
+
offset_y
)
/
zoom_factor
;
int
type
;
boolean
long_click
=
false
;
switch
(
action
)
{
case
MotionEvent
.
ACTION_UP
:
case
PlowCmnIfc
.
ACTION_CLICK
:
type
=
PlowEvent
.
TYPE_CLICK
;
break
;
case
PlowCmnIfc
.
ACTION_LONG_CLICK
:
type
=
PlowEvent
.
TYPE_CLICK
;
long_click
=
true
;
break
;
default
:
return
;
}
...
...
@@ -92,6 +97,8 @@ public class PlowCmn implements PlowCmnIfc {
currentNode
=
null
;
a
.
eventHandler
(
e
);
if
(
long_click
)
e
.
type
=
PlowEvent
.
TYPE_LONG_CLICK
;
appl
.
eventHandler
(
e
);
switch
(
e
.
type
)
{
...
...
java/aapp/app/src/PlowCmnIfc.java
View file @
5f9ff3c5
...
...
@@ -8,6 +8,11 @@ public interface PlowCmnIfc {
public
static
final
int
TYPE_GRAPH
=
3
;
public
static
final
int
TYPE_EV
=
4
;
public
static
final
int
TYPE_OPWIN
=
5
;
public
static
final
int
ACTION_CLICK
=
0
;
public
static
final
int
ACTION_LONG_CLICK
=
1
;
public
static
final
int
ACTION_DOWN
=
2
;
public
static
final
int
ACTION_UP
=
3
;
public
int
type
();
public
Object
getUserData
();
...
...
java/aapp/app/src/PlowDraw.java
View file @
5f9ff3c5
...
...
@@ -10,6 +10,7 @@ import android.graphics.ColorMatrixColorFilter;
import
android.graphics.Paint
;
import
android.graphics.Path
;
import
android.graphics.RectF
;
import
android.graphics.Rect
;
import
android.graphics.Typeface
;
public
class
PlowDraw
implements
PlowDrawIfc
{
...
...
@@ -26,6 +27,8 @@ public class PlowDraw implements PlowDrawIfc {
Typeface
[]
fonts
=
new
Typeface
[
6
];
int
canvasWidth
;
int
canvasHeight
;
float
textDensity
=
1
;
float
lineDensity
=
1
;
static
float
[]
inv
=
{
-
1
f
,
0
f
,
0
f
,
1
f
,
1
f
,
0
f
,-
1
f
,
0
f
,
1
f
,
1
f
,
0
f
,
0
f
,-
1
f
,
1
f
,
1
f
,
...
...
@@ -61,7 +64,7 @@ public class PlowDraw implements PlowDrawIfc {
if
(
border
)
{
paint
.
setColor
(
getColor
(
color
));
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setStrokeWidth
(
1
);
paint
.
setStrokeWidth
(
lineDensity
<
1
?
1
:
lineDensity
);
canvas
.
drawRect
(
x1
,
y1
,
x2
,
y2
,
paint
);
}
else
{
...
...
@@ -78,7 +81,7 @@ public class PlowDraw implements PlowDrawIfc {
if
(
border
)
{
paint
.
setColor
(
getColor
(
color
));
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setStrokeWidth
(
1
);
paint
.
setStrokeWidth
(
lineDensity
<
1
?
1
:
lineDensity
);
canvas
.
drawArc
(
new
RectF
(
x1
,
y1
,
x2
,
y2
),
360
-
angel1
,
-
angel2
,
false
,
paint
);
}
else
{
...
...
@@ -93,7 +96,7 @@ public class PlowDraw implements PlowDrawIfc {
paint
.
setColor
(
getColor
(
color
));
paint
.
setStyle
(
Paint
.
Style
.
STROKE
);
paint
.
setStrokeWidth
(
1
);
paint
.
setStrokeWidth
(
lineDensity
<
1
?
1
:
lineDensity
);
canvas
.
drawLine
(
x1
,
y1
,
x2
,
y2
,
paint
);
}
...
...
@@ -114,16 +117,33 @@ public class PlowDraw implements PlowDrawIfc {
@Override
public
void
drawText
(
String
text
,
int
textColor
,
int
textSize
,
int
font
,
float
x
,
float
y
)
{
paint
.
setTextSize
(
textSize
);
paint
.
setTextSize
(
text
Density
*
text
Size
);
paint
.
setTypeface
(
fonts
[
font
]);
paint
.
setColor
(
getColor
(
textColor
));
paint
.
setStyle
(
Paint
.
Style
.
FILL
);
int
idx
;
if
(
(
idx
=
text
.
indexOf
(
'\n'
))
!=
-
1
)
{
Rect
tsize
=
new
Rect
();
paint
.
getTextBounds
(
"A"
,
0
,
1
,
tsize
);
String
row
=
text
.
substring
(
0
,
idx
);
String
rest
=
text
.
substring
(
idx
+
1
);
canvas
.
drawText
(
row
,
x
,
y
,
paint
);
while
(
(
idx
=
rest
.
indexOf
(
'\n'
))
!=
-
1
)
{
row
=
rest
.
substring
(
0
,
idx
);
rest
=
rest
.
substring
(
idx
+
1
);
y
+=
tsize
.
height
()
*
1.65
;
canvas
.
drawText
(
row
,
x
,
y
,
paint
);
}
}
else
canvas
.
drawText
(
text
,
x
,
y
,
paint
);
}
@Override
public
float
measureText
(
String
text
,
int
textSize
,
int
font
)
{
paint
.
setTextSize
(
textSize
);
paint
.
setTextSize
(
text
Density
*
text
Size
);
paint
.
setTypeface
(
null
);
return
paint
.
measureText
(
text
);
...
...
@@ -170,4 +190,9 @@ public class PlowDraw implements PlowDrawIfc {
return
Color
.
BLACK
;
}
}
public
void
setDensity
(
float
textDensity
,
float
lineDensity
)
{
this
.
textDensity
=
textDensity
;
this
.
lineDensity
=
lineDensity
;
}
}
java/aapp/app/src/PlowDrawIfc.java
View file @
5f9ff3c5
...
...
@@ -13,5 +13,5 @@ public interface PlowDrawIfc {
public
int
getCanvasWidth
();
public
int
getCanvasHeight
();
public
void
setCanvas
(
Canvas
canvas
);
public
void
setDensity
(
float
textDensity
,
float
lineDensity
);
}
java/aapp/app/src/PlowEvent.java
View file @
5f9ff3c5
...
...
@@ -3,6 +3,7 @@ package jpwr.app;
public
class
PlowEvent
{
public
static
final
int
TYPE_CLICK
=
1
;
public
static
final
int
TYPE_OBJECT_DELETED
=
2
;
public
static
final
int
TYPE_LONG_CLICK
=
3
;
public
int
type
;
public
double
x
;
...
...
java/aapp/app/src/PlowNode.java
View file @
5f9ff3c5
...
...
@@ -126,7 +126,7 @@ public class PlowNode implements PlowComponent, PlowArrayElem, PlowNodeIfc {
if
(
invert
==
this
.
invert
)
return
;
this
.
invert
=
invert
;
draw
();
//
draw();
}
public
void
configure
(
PlowNode
previous
)
{
...
...
java/aapp/jopg/src/GlowDraw.java
View file @
5f9ff3c5
...
...
@@ -69,7 +69,6 @@ public class GlowDraw implements GlowDrawIfc {
public
GlowDraw
()
{
paint
=
new
Paint
();
}
public
void
setActivity
(
Activity
activity
)
{
...
...
java/aapp/jopg/src/GrowFrame.java
View file @
5f9ff3c5
...
...
@@ -38,174 +38,16 @@
package
jpwr.jopg
;
import
jpwr.rt.*
;
import
java.io.*
;
//import java.awt.*;
//import java.awt.font.*;
import
java.net.*
;
public
class
GrowFrame
implements
GraphApplIfc
{
/*
JScrollPane scrollPane;
JPanel contentPane;
BorderLayout borderLayout1 = new BorderLayout();
Dimension size;
Object root;
Graph graph;
Timer timer;
LocalPanel localPanel = new LocalPanel();
int scanTime = 1000;
int scanCount = 0;
JDialog confirmDia = null;
JLabel confirmLabel;
Object confirmDyn;
Object confirmObject;
*/
String
instance
;
GrowFrameApplIfc
appl
;
public
GrowFrame
(
String
file
,
Gdh
gdh
,
String
instance
,
GrowFrameApplIfc
appl
)
{
/*
root = (Object) this;
this.instance = instance;
this.appl = appl;
init( file, gdh);
*/
}
private
void
init
(
String
file
,
Gdh
gdh
)
{
/*
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(borderLayout1);
contentPane.add(localPanel, BorderLayout.CENTER);
contentPane.setOpaque(true);
localPanel.setLayout(null);
localPanel.setOpaque(true);
localPanel.setBackground( Color.white);
this.setTitle("GrowFrame");
size = new Dimension( 1100, 900);
setSize( size);
String filename;
BufferedReader reader = null;
String fname = file;
if ( root != null && root instanceof JApplet) {
try {
URL current = ((JApplet) root).getCodeBase();
String current_str = current.toString();
int idx1 = current_str.lastIndexOf('/');
int idx2 = current_str.lastIndexOf(':');
int idx = idx1;
if ( idx2 > idx)
idx = idx2;
String path = current_str.substring(0,idx + 1);
filename = path + fname;
System.out.println( "Opening file " + filename);
URL fileURL = new URL( filename);
InputStream in = fileURL.openStream();
// in = new BufferedInputStream(in);
InputStreamReader r2 = new InputStreamReader(in);
reader = new BufferedReader( r2);
}
catch ( Exception e) {
System.out.println( "Unable to open file");
}
}
else {
if ( fname.lastIndexOf('/') == -1)
filename = "$pwrp_exe/" + fname;
else
filename = fname;
filename = Gdh.translateFilename( filename);
System.out.println( "Fname: " + filename);
try {
reader = new BufferedReader(new FileReader(filename));
}
catch ( Exception e) {
System.out.println( "Unable to open file " + filename);
return;
}
// Read size info
String line;
int defaultWidth = 0;
int defaultHeight = 0;
try {
for ( int i = 0; i < 2; i++) {
line = reader.readLine();
if ( line == null || !line.startsWith("0! "))
break;
if ( line.substring(3, 15).equals("DefaultWidth"))
defaultWidth = new Integer(line.substring(16)).intValue();
else if ( line.substring(3, 16).equals("DefaultHeight"))
defaultHeight = new Integer(line.substring(17)).intValue();
}
} catch ( Exception e) {
System.out.println( "IOException GlowFrame");
}
System.out.println("GraphFrame size " + defaultWidth + " " + defaultHeight);
if ( defaultWidth != 0 && defaultHeight != 0) {
size = new Dimension( defaultWidth + 5, defaultHeight + 40);
setSize( size);
}
}
if ( gdh == null)
gdh = new Gdh(this);
graph = new Graph(this, gdh);
graph.open(reader);
setSize();
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
setDefaultCloseOperation( DISPOSE_ON_CLOSE);
MouseAdapter adapter = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
System.out.println("MouseListener");
GlowEvent event = new GlowEvent();
event.x = (e.getX() + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event.y = (e.getY() + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event.event = Glow.eEvent_MB1Click;
graph.ctx.eventHandler( event);
}
public void mousePressed(MouseEvent e) {
System.out.println("MouseListener");
GlowEvent event = new GlowEvent();
event.x = (e.getX() + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event.y = (e.getY() + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event.event = Glow.eEvent_MB1Down;
graph.ctx.eventHandler( event);
}
public void mouseReleased(MouseEvent e) {
System.out.println("MouseListener");
GlowEvent event = new GlowEvent();
event.x = (e.getX() + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event.y = (e.getY() + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event.event = Glow.eEvent_MB1Up;
graph.ctx.eventHandler( event);
}
public void mouseMoved(MouseEvent e) {
GlowEvent event = new GlowEvent();
event.x = (e.getX() + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event.y = (e.getY() + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event.event = Glow.eEvent_CursorMotion;
graph.ctx.eventHandler( event);
}
public void mouseDragged(MouseEvent e) {
GlowEvent event = new GlowEvent();
event.x = (e.getX() + graph.ctx.cmn.mw.offset_x) / graph.ctx.cmn.mw.zoom_factor_x;
event.y = (e.getY() + graph.ctx.cmn.mw.offset_y) / graph.ctx.cmn.mw.zoom_factor_y;
event.event = Glow.eEvent_ButtonMotion;
graph.ctx.eventHandler( event);
}
};
localPanel.addMouseListener(adapter);
localPanel.addMouseMotionListener(adapter);
timer = new Timer( scanTime, this);
timer.start();
*/
}
...
...
@@ -218,111 +60,23 @@ public class GrowFrame implements GraphApplIfc {
return
100
;
}
/*
public void actionPerformed( ActionEvent e) {
scanCount++;
if ( scanCount == 1)
graph.gdh.getObjectRefInfoAll();
graph.ctx.traceScan();
localPanel.repaint();
}
*/
void
setSize
()
{
/*
size = new Dimension( (int)((graph.ctx.cmn.x_right - graph.ctx.cmn.x_left) * graph.ctx.cmn.mw.zoom_factor_x) + Glow.DRAWOFFSET * 2,
(int)((graph.ctx.cmn.y_high - graph.ctx.cmn.y_low) * graph.ctx.cmn.mw.zoom_factor_y) + Glow.DRAWOFFSET * 2);
localPanel.setPreferredSize( size);
localPanel.revalidate();
*/
}
/*
class LocalPanel extends JPanel {
public LocalPanel() {}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.setPaint(graph.ctx.cmn.gdraw.getColor(graph.ctx.cmn.background_color));
g2.fill(new Rectangle2D.Double(0,0,getWidth(),getHeight()));
graph.gdraw.setGraphics(g2);
graph.ctx.draw();
}
}
*/
public
void
closeGrow
()
{
}
public
int
command
(
String
cmd
)
{
System
.
out
.
println
(
"Ge command : "
+
cmd
);
if
(
appl
!=
null
)
return
appl
.
command
(
cmd
);
return
0
;
}
public
void
confirmNo
()
{}
public
void
confirmYes
()
{
// ((Dyn)confirmDyn).confirmedAction( Glow.eEvent_MB1Click, confirmObject);
}
public
void
confirmYes
()
{}
public
void
openConfirmDialog
(
Object
dyn
,
String
text
,
Object
object
)
{}
public
void
openConfirmDialog
(
Object
dyn
,
String
text
,
Object
object
)
{
/*
JLabel label = null;
confirmDyn = dyn;
confirmObject = object;
if ( confirmDia == null) {
confirmDia = new JDialog();
confirmDia.setTitle("Confirm");
confirmDia.setResizable(false);
confirmDia.setDefaultCloseOperation( JDialog.DO_NOTHING_ON_CLOSE);
confirmDia.setSize( 400, 150);
confirmLabel = new JLabel( text, JLabel.CENTER);
confirmDia.getContentPane().setLayout( new BorderLayout());
confirmDia.getContentPane().add( confirmLabel, BorderLayout.CENTER);
JButton buttonYes = new JButton("Yes");
buttonYes.addActionListener( new ActionListener() {
public void actionPerformed( ActionEvent ev) {
confirmYes();
confirmDia.dispose();
}
});
JButton buttonNo = new JButton("No");
buttonNo.addActionListener( new ActionListener() {
public void actionPerformed( ActionEvent ev) {
confirmNo();
confirmDia.dispose();
}
});
JButton buttonCancel = new JButton("Cancel");
buttonCancel.addActionListener( new ActionListener() {
public void actionPerformed( ActionEvent ev) {
confirmNo();
confirmDia.dispose();
}
});
JPanel panel = new JPanel();
panel.add( buttonYes);
panel.add( buttonNo);
panel.add( buttonCancel);
confirmDia.getContentPane().add( panel, BorderLayout.SOUTH);
// confirmDia.setLocationRelativeTo( par);
confirmDia.setVisible( true);
}
else {
// confirmDia.setLocationRelativeTo( par);
confirmLabel.setText( text);
confirmDia.setVisible( true);
}
*/
}
public
void
openValueInputDialog
(
Object
dyn
,
String
text
,
Object
object
)
{
}
public
void
openValueInputDialog
(
Object
dyn
,
String
text
,
Object
object
)
{}
public
String
getObject
()
{
return
instance
;
}
...
...
@@ -330,6 +84,9 @@ public class GrowFrame implements GraphApplIfc {
return
null
;
}
public
void
closeGraph
()
{}
public
boolean
isAuthorized
(
int
access
)
{
return
false
;
}
}
...
...
java/aapp/pwrxtt/src/MainActivity.java
View file @
5f9ff3c5
...
...
@@ -22,6 +22,7 @@ import android.support.v4.app.FragmentManager;
import
android.support.v4.view.MotionEventCompat
;
import
android.text.Editable
;
import
android.text.InputType
;
import
android.util.DisplayMetrics
;
import
android.util.FloatMath
;
import
android.util.Log
;
import
android.util.TypedValue
;
...
...
@@ -37,6 +38,7 @@ import android.content.SharedPreferences;
import
android.content.res.AssetManager
;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
import
android.content.res.TypedArray
;
import
android.view.*
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
...
...
@@ -51,7 +53,9 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
static
final
int
MODE_SCROLL
=
1
;
static
final
int
MODE_ZOOM
=
2
;
String
dataFile
=
"pwrdata"
;
String
pwrp_exe
=
"pwrp_exe/"
;
String
pwrp_load
=
"pwrp_load/"
;
String
pwr_exe
=
"pwr_exe/"
;
Timer
timer
=
new
Timer
();
MainView
view
;
Gdh
gdh
=
null
;
...
...
@@ -107,6 +111,8 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
float
eventDistance
;
Vector
<
AGraphInfo
>
graphList
=
new
Vector
<
AGraphInfo
>();
Vector
<
PlowCmnIfc
>
cmnList
=
new
Vector
<
PlowCmnIfc
>();
Canvas
currentCanvas
=
null
;
float
density
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -119,8 +125,10 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
view
.
invalidate
();
timer
.
schedule
(
new
MyTask
(),
0
,
2000
);
DisplayMetrics
metrics
=
getResources
().
getDisplayMetrics
();
density
=
metrics
.
densityDpi
/
150
;
PlowCmn
cmn
=
new
PlowCmn
(
this
,
15
D
);
PlowCmn
cmn
=
new
PlowCmn
(
this
,
density
*
15
);
gdraw
=
new
PlowDraw
(
this
);
cmn
.
setGDraw
(
gdraw
);
currentCmn
=
cmn
;
...
...
@@ -197,6 +205,24 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
}
public
void
onBackPressed
()
{
if
(
(
opwinCmn
!=
null
&&
currentCmn
==
opwinCmn
)
||
(
opwinCmn
==
null
&&
currentCmn
==
cmnList
.
get
(
0
)))
{
super
.
onBackPressed
();
return
;
}
// Back to opwind
if
(
opwinCmn
!=
null
)
{
while
(
currentCmn
!=
opwinCmn
)
pushCmn
();
}
else
{
while
(
currentCmn
!=
cmnList
.
get
(
0
))
pushCmn
();
}
}
public
void
onConfigurationChanged
(
Configuration
newConfig
)
{
super
.
onConfigurationChanged
(
newConfig
);
...
...
@@ -230,10 +256,10 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
if
(
aev
!=
null
&&
currentCmn
==
aev
.
getCmnAla
())
{
// Alarm list
item_close
.
setVisible
(
true
);
item_zoomin
.
setVisible
(
tru
e
);
item_zoomout
.
setVisible
(
tru
e
);
item_pageup
.
setVisible
(
tru
e
);
item_pagedown
.
setVisible
(
tru
e
);
item_zoomin
.
setVisible
(
fals
e
);
item_zoomout
.
setVisible
(
fals
e
);
item_pageup
.
setVisible
(
fals
e
);
item_pagedown
.
setVisible
(
fals
e
);
item_openobject
.
setVisible
(
true
);
item_opengraph
.
setVisible
(
true
);
item_openclassgraph
.
setVisible
(
true
);
...
...
@@ -246,10 +272,10 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
else
if
(
aev
!=
null
&&
currentCmn
==
aev
.
getCmnEve
())
{
// Event list
item_close
.
setVisible
(
true
);
item_zoomin
.
setVisible
(
tru
e
);
item_zoomout
.
setVisible
(
tru
e
);
item_pageup
.
setVisible
(
tru
e
);
item_pagedown
.
setVisible
(
tru
e
);
item_zoomin
.
setVisible
(
fals
e
);
item_zoomout
.
setVisible
(
fals
e
);
item_pageup
.
setVisible
(
fals
e
);
item_pagedown
.
setVisible
(
fals
e
);
item_openobject
.
setVisible
(
true
);
item_opengraph
.
setVisible
(
true
);
item_openclassgraph
.
setVisible
(
true
);
...
...
@@ -262,10 +288,10 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
else
if
(
currentCmn
==
cmnList
.
get
(
0
))
{
// Navigator
item_close
.
setVisible
(
true
);
item_zoomin
.
setVisible
(
tru
e
);
item_zoomout
.
setVisible
(
tru
e
);
item_pageup
.
setVisible
(
tru
e
);
item_pagedown
.
setVisible
(
tru
e
);
item_zoomin
.
setVisible
(
fals
e
);
item_zoomout
.
setVisible
(
fals
e
);
item_pageup
.
setVisible
(
fals
e
);
item_pagedown
.
setVisible
(
fals
e
);
item_openobject
.
setVisible
(
true
);
item_opengraph
.
setVisible
(
true
);
item_openclassgraph
.
setVisible
(
true
);
...
...
@@ -278,10 +304,10 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
else
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_FLOW
)
{
// Plc
item_close
.
setVisible
(
true
);
item_zoomin
.
setVisible
(
tru
e
);
item_zoomout
.
setVisible
(
tru
e
);
item_pageup
.
setVisible
(
tru
e
);
item_pagedown
.
setVisible
(
tru
e
);
item_zoomin
.
setVisible
(
fals
e
);
item_zoomout
.
setVisible
(
fals
e
);
item_pageup
.
setVisible
(
fals
e
);
item_pagedown
.
setVisible
(
fals
e
);
item_openobject
.
setVisible
(
true
);
item_opengraph
.
setVisible
(
true
);
item_openclassgraph
.
setVisible
(
true
);
...
...
@@ -294,8 +320,8 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
else
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
)
{
// Graph
item_close
.
setVisible
(
true
);
item_zoomin
.
setVisible
(
tru
e
);
item_zoomout
.
setVisible
(
tru
e
);
item_zoomin
.
setVisible
(
fals
e
);
item_zoomout
.
setVisible
(
fals
e
);
item_pageup
.
setVisible
(
false
);
item_pagedown
.
setVisible
(
false
);
item_openobject
.
setVisible
(
false
);
...
...
@@ -310,8 +336,8 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
else
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_OPWIN
)
{
// Operator window
item_close
.
setVisible
(
true
);
item_zoomin
.
setVisible
(
tru
e
);
item_zoomout
.
setVisible
(
tru
e
);
item_zoomin
.
setVisible
(
fals
e
);
item_zoomout
.
setVisible
(
fals
e
);
item_pageup
.
setVisible
(
false
);
item_pagedown
.
setVisible
(
false
);
item_openobject
.
setVisible
(
false
);
...
...
@@ -325,10 +351,10 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
else
{
// Default
item_pageup
.
setVisible
(
tru
e
);
item_zoomin
.
setVisible
(
tru
e
);
item_zoomout
.
setVisible
(
tru
e
);
item_pagedown
.
setVisible
(
tru
e
);
item_pageup
.
setVisible
(
fals
e
);
item_zoomin
.
setVisible
(
fals
e
);
item_zoomout
.
setVisible
(
fals
e
);
item_pagedown
.
setVisible
(
fals
e
);
item_openobject
.
setVisible
(
true
);
item_opengraph
.
setVisible
(
true
);
item_openclassgraph
.
setVisible
(
true
);
...
...
@@ -364,60 +390,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
System
.
out
.
println
(
"Page down"
);
break
;
case
R
.
id
.
close_option
:
switch
(
currentCmn
.
type
())
{
case
PlowCmnIfc
.
TYPE_PLOW
:
{
if
(
cmnList
.
size
()
==
1
)
{
// Open opwin
if
(
opwinCmn
!=
null
)
{
currentCmn
=
opwinCmn
;
cmnList
.
add
(
opwinCmn
);
view
.
invalidate
();
}
break
;
}
PlowCmn
cmn
=
(
PlowCmn
)
currentCmn
;
AXtt
axtt
=
(
AXtt
)
currentCmn
.
getUserData
();
PlowNode
o
=
(
PlowNode
)
cmn
.
get
(
0
);
AXttItemObject
itemo
=
(
AXttItemObject
)
o
.
getUserData
();
itemo
.
close
(
axtt
);
currentCmn
=
cmnList
.
get
(
cmnList
.
size
()-
2
);
cmnList
.
removeElementAt
(
cmnList
.
size
()-
1
);
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
view
.
invalidate
();
break
;
}
case
PlowCmnIfc
.
TYPE_FLOW
:
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
DYNAMIC_CLOSE
,
currentCmn
));
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
currentCmn
=
cmnList
.
get
(
cmnList
.
size
()-
2
);
cmnList
.
removeElementAt
(
cmnList
.
size
()-
1
);
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
view
.
invalidate
();
System
.
out
.
println
(
"Close flow"
);
break
;
case
PlowCmnIfc
.
TYPE_EV
:
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
currentCmn
=
cmnList
.
get
(
cmnList
.
size
()-
1
);
aev
=
null
;
view
.
invalidate
();
System
.
out
.
println
(
"Close ev"
);
break
;
case
PlowCmnIfc
.
TYPE_GRAPH
:
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
DYNAMIC_CLOSE
,
currentCmn
));
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
if
(
graphObject
.
size
()
>
0
)
graphObject
.
removeElementAt
(
graphObject
.
size
()-
1
);
currentCmn
=
cmnList
.
get
(
cmnList
.
size
()-
2
);
cmnList
.
removeElementAt
(
cmnList
.
size
()-
1
);
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
view
.
invalidate
();
System
.
out
.
println
(
"Close graph"
);
break
;
case
PlowCmnIfc
.
TYPE_OPWIN
:
// Close app ?
break
;
}
pushCmn
();
break
;
case
R
.
id
.
openobject_option
:
{
System
.
out
.
println
(
"Open object"
);
...
...
@@ -546,6 +519,10 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
PwrtAttrRef
aref
=
new
PwrtAttrRef
(((
AXttItemObject
)
baseItem
).
getObjid
());
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
OPEN_CLASSGRAPH
,
aref
));
}
else
if
(
baseItem
instanceof
AXttItemAttrObject
)
{
PwrtAttrRef
aref
=
((
AXttItemAttrObject
)
baseItem
).
getAttrRef
();
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
OPEN_CLASSGRAPH
,
aref
));
}
}
break
;
}
...
...
@@ -637,9 +614,9 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
if
(
aev
==
null
)
{
PlowCmnEv
cmnAla
=
new
PlowCmnEv
(
appl
,
15
D
);
PlowCmnEv
cmnAla
=
new
PlowCmnEv
(
appl
,
density
*
15
);
cmnAla
.
setGDraw
(
gdraw
);
PlowCmnEv
cmnEve
=
new
PlowCmnEv
(
appl
,
15
D
);
PlowCmnEv
cmnEve
=
new
PlowCmnEv
(
appl
,
density
*
15
);
cmnEve
.
setGDraw
(
gdraw
);
currentCmn
=
cmnAla
;
aev
=
new
AEv
(
cmnAla
,
cmnEve
,
appl
);
...
...
@@ -661,9 +638,9 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
if
(
aev
==
null
)
{
PlowCmnEv
cmnAla
=
new
PlowCmnEv
(
appl
,
15
D
);
PlowCmnEv
cmnAla
=
new
PlowCmnEv
(
appl
,
density
*
15
);
cmnAla
.
setGDraw
(
gdraw
);
PlowCmnEv
cmnEve
=
new
PlowCmnEv
(
appl
,
15
D
);
PlowCmnEv
cmnEve
=
new
PlowCmnEv
(
appl
,
density
*
15
);
cmnEve
.
setGDraw
(
gdraw
);
currentCmn
=
cmnEve
;
aev
=
new
AEv
(
cmnAla
,
cmnEve
,
appl
);
...
...
@@ -769,6 +746,36 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
break
;
}
break
;
case
PlowEvent
.
TYPE_LONG_CLICK
:
if
(
e
.
object
==
null
)
return
;
switch
(
currentCmn
.
type
())
{
case
PlowCmnIfc
.
TYPE_PLOW
:
if
(
e
.
inIcon
)
{
// Open object
System
.
out
.
println
(
"Long click event"
);
AXttItemBase
item
=
(
AXttItemBase
)((
PlowNode
)
e
.
object
).
getUserData
();
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
OPEN_ATTRIBUTES
,
item
));
}
else
{
// Open plc
System
.
out
.
println
(
"Long click event"
);
AXttItemBase
item
=
(
AXttItemBase
)((
PlowNode
)
e
.
object
).
getUserData
();
if
(
item
instanceof
AXttItemObject
)
{
PwrtObjid
oid
=
((
AXttItemObject
)
item
).
getObjid
();
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
OPEN_FLOW
,
oid
));
}
}
break
;
case
PlowCmnIfc
.
TYPE_EV
:
break
;
case
PlowCmnIfc
.
TYPE_FLOW
:
break
;
case
PlowCmnIfc
.
TYPE_OPWIN
:
break
;
}
break
;
case
PlowEvent
.
TYPE_OBJECT_DELETED
:
{
AXtt
axtt
=
(
AXtt
)
currentCmn
.
getUserData
();
AXttItemBase
item
=
(
AXttItemBase
)((
PlowNode
)
e
.
object
).
getUserData
();
...
...
@@ -905,7 +912,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
String
oName
=
node
.
getTraceObject
();
CdhrObjid
oret
=
gdh
.
nameToObjid
(
oName
);
PlowCmn
cmn
=
new
PlowCmn
(
appl
,
15
D
);
PlowCmn
cmn
=
new
PlowCmn
(
appl
,
density
*
15
);
cmn
.
setGDraw
(
gdraw
);
currentCmn
=
cmn
;
cmnList
.
add
(
cmn
);
...
...
@@ -976,7 +983,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
String
oName
=
node
.
getTraceObject
();
CdhrObjid
oret
=
gdh
.
nameToObjid
(
oName
);
PlowCmn
cmn
=
new
PlowCmn
(
appl
,
15
D
);
PlowCmn
cmn
=
new
PlowCmn
(
appl
,
density
*
15
);
cmn
.
setGDraw
(
gdraw
);
currentCmn
=
cmn
;
cmnList
.
add
(
cmn
);
...
...
@@ -1173,10 +1180,21 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
break
;
}
case
OPWIN:
{
//
If plc window open flow for window, else for first child
//
Find AppGraph object under WebHandler, search on two hierarchy levels
CdhrObjid
oret
=
gdh
.
getClassList
(
Pwrb
.
cClass_WebHandler
);
if
(
oret
.
oddSts
())
{
CdhrString
sret
=
gdh
.
objidToName
(
oret
.
objid
,
Cdh
.
mName_volumeStrict
);
if
(
sret
.
evenSts
())
break
;
String
appUseWebDir
=
sret
.
str
+
".AppUseWebDir"
;
CdhrBoolean
bret
=
gdh
.
getObjectInfoBoolean
(
appUseWebDir
);
if
(
bret
.
oddSts
()
&&
bret
.
value
==
true
)
{
pwr_exe
=
"pwrp_web/"
;
pwrp_exe
=
"pwrp_web/"
;
pwrp_load
=
"pwrp_web/"
;
}
for
(
oret
=
gdh
.
getChild
(
oret
.
objid
);
oret
.
oddSts
();
oret
=
gdh
.
getNextSibling
(
oret
.
objid
))
{
CdhrClassId
cret
=
gdh
.
getObjectClass
(
oret
.
objid
);
if
(
cret
.
evenSts
())
...
...
@@ -1201,7 +1219,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
if
(
graphList
.
size
()
>
0
)
{
opwinCmn
=
new
OpwinCmn
(
appl
,
graphList
);
opwinCmn
=
new
OpwinCmn
(
appl
,
graphList
,
density
);
currentCmn
=
opwinCmn
;
cmnList
.
add
(
opwinCmn
);
}
...
...
@@ -1240,21 +1258,24 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
String
image
=
sret
.
str
;
if
(
image
.
equals
(
""
))
{
info
.
bpm
=
BitmapFactory
.
decodeResource
(
getResources
(),
R
.
drawable
.
graph_icon
);
info
.
bpmInverted
=
invertBitmap
(
info
.
bpm
);
}
else
{
URL
url
=
null
;
try
{
if
(
image
.
startsWith
(
"$pwr_exe/"
))
{
// url = new URL("http://10.0.2.2/data0/x4-8-6/rls/os_linux/hw_x86/exp/exe/" + filename.substring(9));
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
pwr_exe/"
+
image
.
substring
(
9
));
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
"
+
pwr_exe
+
image
.
substring
(
9
));
}
else
{
// url = new URL("http://10.0.2.2/data0/pwrp/opg7/bld/x86_linux/exe/" + filename);
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
pwrp_exe/"
+
image
);
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
"
+
pwrp_exe
+
image
);
}
info
.
bpm
=
BitmapFactory
.
decodeStream
(
url
.
openConnection
().
getInputStream
());
info
.
bpmInverted
=
invertBitmap
(
info
.
bpm
);
}
catch
(
IOException
e
)
{
info
.
bpm
=
BitmapFactory
.
decodeResource
(
getResources
(),
R
.
drawable
.
graph_icon
);
info
.
bpmInverted
=
invertBitmap
(
info
.
bpm
);
System
.
out
.
println
(
"Unable to open file "
+
image
+
" "
+
url
);
}
}
...
...
@@ -1326,6 +1347,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
float
x
=
MotionEventCompat
.
getX
(
me
,
0
);
float
y
=
MotionEventCompat
.
getY
(
me
,
0
);
boolean
isSustained
=
false
;
boolean
sliderActive
=
false
;
if
(
lastMotionEvent
==
me
&&
eventCnt
>
0
)
{
isSustained
=
true
;
...
...
@@ -1358,35 +1380,43 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
if
(
viewOffsetY
==
0
)
{
if
(
context
!=
null
)
{
TypedValue
tv
=
new
TypedValue
();
context
.
getTheme
().
resolveAttribute
(
android
.
R
.
attr
.
actionBarSize
,
tv
,
true
);
viewOffsetY
=
getResources
().
getDimensionPixelSize
(
tv
.
resourceId
);
int
id
=
getResources
().
getIdentifier
(
"status_bar_height"
,
"dimen"
,
"android"
);
if
(
id
>
0
)
viewOffsetY
+=
getResources
().
getDimensionPixelSize
(
id
);
viewOffsetY
=
60
;
Window
window
=
getWindow
();
viewOffsetY
=
window
.
findViewById
(
Window
.
ID_ANDROID_CONTENT
).
getTop
();
}
else
viewOffsetY
=
80
;
viewOffsetY
=
56
;
}
// System.out.println("offset : " + viewOffsetY);
switch
(
action
)
{
case
MotionEvent
.
ACTION_MOVE
:
if
(
isSustained
)
System
.
out
.
println
(
"Sustained scroll"
);
if
(
eventMode
==
MODE_SCROLL
)
{
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
&&
((
GraphCmn
)
currentCmn
).
graph
.
getClickActive
()
==
1
)
{
//eventMode = MODE_NO;
}
if
(
lastTouchId
!=
me
.
getPointerId
(
0
))
{
lastTouchX
=
x
;
lastTouchY
=
y
;
lastTouchId
=
me
.
getPointerId
(
0
);
break
;
}
if
(
false
/* currentCmn.type() == PlowCmnIfc.TYPE_GRAPH */
){
boolean
scroll
=
true
;
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
)
{
if
(
((
GraphCmn
)
currentCmn
).
getAppMotion
()
==
Glow
.
eAppMotion_Slider
||
(((
GraphCmn
)
currentCmn
).
getAppMotion
()
==
Glow
.
eAppMotion_Both
&&
((
GraphCmn
)
currentCmn
).
getSliderActive
()))
{
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
EVENTHANDLER
,
new
GdhEventArg
(
GraphCmn
.
ACTION_MOVE
,
x
,
y
-
viewOffsetY
)));
scroll
=
false
;
sliderActive
=
true
;
}
else
{
}
if
(
scroll
&&
!
sliderActive
)
{
System
.
out
.
println
(
"Scroll "
+
x
+
" "
+
y
);
if
(
(
int
)(
lastTouchY
-
y
)
!=
0
)
{
currentCmn
.
scroll
((
int
)(
lastTouchX
-
x
),
(
int
)(
lastTouchY
-
y
));
...
...
@@ -1396,7 +1426,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
lastTouchY
=
y
;
lastTouchId
=
me
.
getPointerId
(
0
);
}
if
(
!
isSustained
)
{
if
(
!
isSustained
&&
!
sliderActive
)
{
if
(
lastMotionEvent
!=
null
)
{
lastXSpeed
=
0.5
*
lastXSpeed
+
0.5
*
(
x
-
lastMotionEvent
.
getX
())
/
(
me
.
getEventTime
()
-
lastMotionEvent
.
getEventTime
());
lastYSpeed
=
0.5
*
lastYSpeed
+
0.5
*
(
y
-
lastMotionEvent
.
getY
())
/
(
me
.
getEventTime
()
-
lastMotionEvent
.
getEventTime
());
...
...
@@ -1410,17 +1440,23 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
else
if
(
eventMode
==
MODE_ZOOM
)
{
float
distance
=
eventDistance
(
me
);
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
&&
((
GraphCmn
)
currentCmn
).
getAppMotion
()
==
Glow
.
eAppMotion_Slider
)
currentCmn
.
zoom
(
distance
/
eventDistance
);
else
currentCmn
.
zoom
(
distance
/
eventDistance
,
(
MotionEventCompat
.
getX
(
me
,
0
)
+
MotionEventCompat
.
getX
(
me
,
1
))/
2
,
(
MotionEventCompat
.
getY
(
me
,
0
)
+
MotionEventCompat
.
getY
(
me
,
1
))/
2
+
viewOffsetY
);
eventDistance
=
distance
;
view
.
invalidate
();
}
break
;
case
MotionEvent
.
ACTION_UP
:
if
(
currentCmn
!=
null
&&
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
){
if
(
currentCmn
==
null
)
break
;
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
){
System
.
out
.
println
(
"Event Up "
+
action
+
" ("
+
x
+
","
+
y
+
") cmn "
+
currentCmn
.
type
());
if
(
Math
.
abs
(
x
-
downTouchX
)
<
10
&&
Math
.
abs
(
y
-
downTouchY
)
<
10
&&
me
.
getEventTime
()
-
me
.
getDownTime
()
<
700
)
{
...
...
@@ -1433,13 +1469,21 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
new
GdhEventArg
(
GraphCmn
.
ACTION_UP
,
x
,
y
-
viewOffsetY
)));
}
}
else
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_OPWIN
){
currentCmn
.
eventHandler
(
PlowCmnIfc
.
ACTION_UP
,
x
,
y
-
viewOffsetY
);
}
else
{
if
(
Math
.
abs
(
x
-
downTouchX
)
<
10
&&
Math
.
abs
(
y
-
downTouchY
)
<
10
&&
currentCmn
!=
null
)
{
currentCmn
.
eventHandler
(
action
,
x
,
y
-
viewOffsetY
);
if
(
Math
.
abs
(
x
-
downTouchX
)
<
10
&&
Math
.
abs
(
y
-
downTouchY
)
<
10
&&
currentCmn
!=
null
&&
me
.
getEventTime
()
-
me
.
getDownTime
()
>
500
)
{
currentCmn
.
eventHandler
(
PlowCmnIfc
.
ACTION_LONG_CLICK
,
x
,
y
-
viewOffsetY
);
}
else
if
(
Math
.
abs
(
x
-
downTouchX
)
<
10
&&
Math
.
abs
(
y
-
downTouchY
)
<
10
&&
currentCmn
!=
null
)
{
currentCmn
.
eventHandler
(
PlowCmnIfc
.
ACTION_CLICK
,
x
,
y
-
viewOffsetY
);
}
}
view
.
invalidate
();
eventMode
=
MODE_NO
;
sliderActive
=
false
;
if
(
lastMotionEvent
!=
null
)
{
System
.
out
.
println
(
"ACTION UP, sustained motion event scheduled"
);
...
...
@@ -1459,14 +1503,18 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
break
;
case
MotionEvent
.
ACTION_DOWN
:
System
.
out
.
println
(
"Event Down "
+
action
+
"
("
+
x
+
","
+
y
+
")"
);
System
.
out
.
println
(
"offset : "
+
viewOffsetY
+
" (x,y)
("
+
x
+
","
+
y
+
")"
);
lastMotionEvent
=
null
;
lastXSpeed
=
0
;
lastYSpeed
=
0
;
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
)
{
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
)
{
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
EVENTHANDLER
,
new
GdhEventArg
(
GraphCmn
.
ACTION_DOWN
,
x
,
y
-
viewOffsetY
)));
}
else
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_OPWIN
)
{
currentCmn
.
eventHandler
(
PlowCmnIfc
.
ACTION_DOWN
,
x
,
y
-
viewOffsetY
);
view
.
invalidate
();
}
lastTouchId
=
me
.
getPointerId
(
0
);
lastTouchX
=
x
;
lastTouchY
=
y
;
...
...
@@ -1546,23 +1594,39 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
drawCanvas
.
drawColor
(
graph
.
cmn
.
gdraw
.
getColor
(
graph
.
cmn
.
background_color
));
currentCmn
.
draw
();
canvas
.
drawBitmap
(
bitmap
,
0
F
,
0
F
,
null
);
}
else
{
Canvas
c
=
getHolder
().
lockCanvas
();
if
(
c
!=
null
)
{
Canvas
currentCanvas
=
getHolder
().
lockCanvas
();
//if ( currentCanvas == null)
// currentCanvas = getHolder().lockCanvas();
if
(
currentCanvas
!=
null
)
{
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
)
c
.
drawColor
(
graph
.
cmn
.
gdraw
.
getColor
(
graph
.
cmn
.
background_color
));
currentCanvas
.
drawColor
(
graph
.
cmn
.
gdraw
.
getColor
(
graph
.
cmn
.
background_color
));
else
c
.
drawColor
(
Color
.
WHITE
);
currentCanvas
.
drawColor
(
Color
.
WHITE
);
currentCmn
.
setCanvas
(
c
);
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_FLOW
)
gdraw
.
setDensity
(
1
,
density
);
else
gdraw
.
setDensity
(
density
,
density
);
currentCmn
.
setCanvas
(
currentCanvas
);
currentCmn
.
draw
();
getHolder
().
unlockCanvasAndPost
(
c
);
/* Test
Paint paint = new Paint();
currentCanvas.drawText( "Density " + density, 10, 100, paint);
*/
getHolder
().
unlockCanvasAndPost
(
currentCanvas
);
// currentCanvas = getHolder().lockCanvas();
}
}
}
}
}
...
...
@@ -1612,8 +1676,8 @@ System.out.println("MainActivity TimerTask " + currentCmn.type());
URL
url
=
null
;
try
{
// url = new URL("http://10.0.2.2/data0/pwrp/opg7/bld/common/load/" + filename);
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
pwrp_load/"
+
filename
);
reader
=
new
BufferedReader
(
new
InputStreamReader
(
url
.
openStream
()));
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
"
+
pwrp_load
+
filename
);
reader
=
new
BufferedReader
(
new
InputStreamReader
(
url
.
openStream
()
,
"ISO-8859-1"
));
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"Unable to open file "
+
filename
+
" "
+
url
);
return
;
...
...
@@ -1627,10 +1691,12 @@ System.out.println("MainActivity TimerTask " + currentCmn.type());
if
(
object
!=
null
)
{
FlowNode
node
=
(
FlowNode
)
ctx
.
getObject
(
object
);
if
(
node
!=
null
)
{
fcmn
.
select
(
node
);
node
.
setSelect
(
true
);
ctx
.
centerObject
(
node
);
}
}
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
DYNAMIC_OPEN
,
null
));
...
...
@@ -1655,13 +1721,13 @@ System.out.println("MainActivity TimerTask " + currentCmn.type());
try
{
if
(
filename
.
startsWith
(
"$pwr_exe/"
))
{
// url = new URL("http://10.0.2.2/data0/x4-8-6/rls/os_linux/hw_x86/exp/exe/" + filename.substring(9));
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
pwr_exe/"
+
filename
.
substring
(
9
));
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
"
+
pwr_exe
+
filename
.
substring
(
9
));
}
else
{
// url = new URL("http://10.0.2.2/data0/pwrp/opg7/bld/x86_linux/exe/" + filename);
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
pwrp_exe/"
+
filename
);
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
"
+
pwrp_exe
+
filename
);
}
reader
=
new
BufferedReader
(
new
InputStreamReader
(
url
.
openStream
()));
reader
=
new
BufferedReader
(
new
InputStreamReader
(
url
.
openStream
()
,
"ISO-8859-1"
));
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"Unable to open file "
+
filename
+
" "
+
url
);
return
;
...
...
@@ -1747,13 +1813,13 @@ System.out.println("MainActivity TimerTask " + currentCmn.type());
try
{
if
(
filename
.
startsWith
(
"$pwr_exe/"
))
{
// url = new URL("http://10.0.2.2/data0/x4-8-6/rls/os_linux/hw_x86/exp/exe/" + filename.substring(9));
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
pwr_exe/"
+
filename
.
substring
(
9
));
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
"
+
pwr_exe
+
filename
.
substring
(
9
));
}
else
{
// url = new URL("http://10.0.2.2/data0/pwrp/opg7/bld/x86_linux/exe/" + filename);
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
pwrp_exe/"
+
filename
);
url
=
new
URL
(
"http://"
+
pwrHost
+
"/
"
+
pwrp_exe
+
filename
);
}
reader
=
new
BufferedReader
(
new
InputStreamReader
(
url
.
openStream
()));
reader
=
new
BufferedReader
(
new
InputStreamReader
(
url
.
openStream
()
,
"ISO-8859-1"
));
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"Unable to open file "
+
filename
+
" "
+
url
);
return
null
;
...
...
@@ -2007,7 +2073,11 @@ System.out.println("MainActivity TimerTask " + currentCmn.type());
graphObject
.
removeElementAt
(
graphObject
.
size
()-
1
);
currentCmn
=
cmnList
.
get
(
cmnList
.
size
()-
2
);
cmnList
.
removeElementAt
(
cmnList
.
size
()-
1
);
view
.
invalidate
();
//view.invalidate();
}
public
boolean
isAuthorized
(
int
access
)
{
return
gdh
.
isAuthorized
(
access
);
}
public
void
invalidateView
()
{
...
...
@@ -2023,4 +2093,84 @@ System.out.println("MainActivity TimerTask " + currentCmn.type());
public
PlowCmnIfc
getCurrentCmn
()
{
return
currentCmn
;
}
public
Bitmap
invertBitmap
(
Bitmap
src
)
{
Bitmap
output
=
Bitmap
.
createBitmap
(
src
.
getWidth
(),
src
.
getHeight
(),
src
.
getConfig
());
int
A
,
R
,
G
,
B
;
int
pixelColor
;
int
height
=
src
.
getHeight
();
int
width
=
src
.
getWidth
();
for
(
int
y
=
0
;
y
<
height
;
y
++)
{
for
(
int
x
=
0
;
x
<
width
;
x
++)
{
pixelColor
=
src
.
getPixel
(
x
,
y
);
A
=
Color
.
alpha
(
pixelColor
);
R
=
Math
.
max
(
Color
.
red
(
pixelColor
)
-
50
,
0
);
G
=
Math
.
max
(
Color
.
green
(
pixelColor
)
-
50
,
0
);
B
=
Math
.
max
(
Color
.
blue
(
pixelColor
)
-
50
,
0
);
output
.
setPixel
(
x
,
y
,
Color
.
argb
(
A
,
R
,
G
,
B
));
}
}
return
output
;
}
public
void
pushCmn
()
{
switch
(
currentCmn
.
type
())
{
case
PlowCmnIfc
.
TYPE_PLOW
:
{
if
(
cmnList
.
size
()
==
1
)
{
// Open opwin
if
(
opwinCmn
!=
null
)
{
currentCmn
=
opwinCmn
;
cmnList
.
add
(
opwinCmn
);
view
.
invalidate
();
}
break
;
}
PlowCmn
cmn
=
(
PlowCmn
)
currentCmn
;
AXtt
axtt
=
(
AXtt
)
currentCmn
.
getUserData
();
PlowNode
o
=
(
PlowNode
)
cmn
.
get
(
0
);
AXttItemObject
itemo
=
(
AXttItemObject
)
o
.
getUserData
();
itemo
.
close
(
axtt
);
currentCmn
=
cmnList
.
get
(
cmnList
.
size
()-
2
);
cmnList
.
removeElementAt
(
cmnList
.
size
()-
1
);
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
view
.
invalidate
();
break
;
}
case
PlowCmnIfc
.
TYPE_FLOW
:
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
DYNAMIC_CLOSE
,
currentCmn
));
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
currentCmn
=
cmnList
.
get
(
cmnList
.
size
()-
2
);
cmnList
.
removeElementAt
(
cmnList
.
size
()-
1
);
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
view
.
invalidate
();
System
.
out
.
println
(
"Close flow"
);
break
;
case
PlowCmnIfc
.
TYPE_EV
:
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
currentCmn
=
cmnList
.
get
(
cmnList
.
size
()-
1
);
aev
=
null
;
view
.
invalidate
();
System
.
out
.
println
(
"Close ev"
);
break
;
case
PlowCmnIfc
.
TYPE_GRAPH
:
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
DYNAMIC_CLOSE
,
currentCmn
));
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
if
(
graphObject
.
size
()
>
0
)
graphObject
.
removeElementAt
(
graphObject
.
size
()-
1
);
currentCmn
=
cmnList
.
get
(
cmnList
.
size
()-
2
);
cmnList
.
removeElementAt
(
cmnList
.
size
()-
1
);
System
.
out
.
println
(
"cmnList.size() "
+
cmnList
.
size
());
view
.
invalidate
();
System
.
out
.
println
(
"Close graph"
);
break
;
case
PlowCmnIfc
.
TYPE_OPWIN
:
// Close app ?
break
;
}
}
}
java/jpwr/jopg/src/Dyn.java
View file @
5f9ff3c5
...
...
@@ -591,7 +591,7 @@ public class Dyn {
public
static
final
int
ePwrStatus_Error
=
3
;
public
static
final
int
ePwrStatus_Fatal
=
4
;
public
static
final
boolean
debug
=
fals
e
;
public
static
final
boolean
debug
=
tru
e
;
Vector
<
DynElem
>
elements
=
new
Vector
<
DynElem
>();
GraphIfc
graph
;
...
...
@@ -3174,6 +3174,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
object
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Click
:
dyn
.
object
=
object
;
...
...
@@ -6361,6 +6364,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
object
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
object
.
setColorInverse
(
1
);
...
...
@@ -6447,6 +6453,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
object
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
object
.
setColorInverse
(
1
);
...
...
@@ -6533,14 +6542,19 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
object
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
object
.
setColorInverse
(
1
);
dyn
.
repaintNow
=
true
;
dyn
.
graph
.
setClickActive
(
1
);
break
;
case
Glow
.
eEvent_MB1Up
:
object
.
setColorInverse
(
0
);
dyn
.
repaintNow
=
true
;
dyn
.
graph
.
setClickActive
(
0
);
break
;
case
Glow
.
eEvent_MB1Click
:
if
(
(
dyn
.
action_type1
&
Dyn
.
mActionType1_Confirm
)
!=
0
)
...
...
@@ -6613,6 +6627,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
object
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
{
object
.
setColorInverse
(
1
);
...
...
@@ -6632,7 +6649,7 @@ public class Dyn {
break
;
}
if
(
sts
.
evenSts
())
System
.
out
.
println
(
"S
et
Dig: "
+
pname
.
name
);
System
.
out
.
println
(
"S
to
Dig: "
+
pname
.
name
);
break
;
}
case
Glow
.
eEvent_MB1Up
:
{
...
...
@@ -6710,6 +6727,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
object
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
object
.
setColorInverse
(
1
);
...
...
@@ -6783,6 +6803,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
object
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
object
.
setColorInverse
(
1
);
...
...
@@ -6858,6 +6881,9 @@ public class Dyn {
if
(
(
dyn
.
action_type1
&
Dyn
.
mActionType1_Confirm
)
==
0
)
return
1
;
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
break
;
...
...
@@ -6926,6 +6952,10 @@ public class Dyn {
public
int
action
(
GlowArrayElem
o
,
GlowEvent
e
)
{
GrowNode
object
=
(
GrowNode
)
o
;
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
object
.
setColorInverse
(
1
);
...
...
@@ -7119,6 +7149,10 @@ public class Dyn {
public
int
action
(
GlowArrayElem
o
,
GlowEvent
e
)
{
GrowNode
object
=
(
GrowNode
)
o
;
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
object
.
setColorInverse
(
1
);
...
...
@@ -7374,6 +7408,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
o
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
o
.
setColorInverse
(
1
);
...
...
@@ -7466,6 +7503,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
o
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
GrowNode
object
=
(
GrowNode
)
o
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
...
...
@@ -7602,7 +7642,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
o
,
GlowEvent
e
)
{
GrowNode
object
=
(
GrowNode
)
o
;
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Down
:
object
.
setColorInverse
(
1
);
...
...
@@ -8223,6 +8265,9 @@ public class Dyn {
}
public
int
action
(
GlowArrayElem
o
,
GlowEvent
e
)
{
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
GrowNode
object
=
(
GrowNode
)
o
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Click
:
...
...
@@ -8859,6 +8904,10 @@ public class Dyn {
public
int
action
(
GlowArrayElem
o
,
GlowEvent
e
)
{
GrowNode
object
=
(
GrowNode
)
o
;
if
(
!
dyn
.
graph
.
isAuthorized
(
dyn
.
access
))
return
1
;
switch
(
e
.
event
)
{
case
Glow
.
eEvent_MB1Click
:
if
(
menu_object
!=
null
)
{
...
...
java/jpwr/jopg/src/Glow.java
View file @
5f9ff3c5
...
...
@@ -73,6 +73,7 @@ public class Glow {
public
static
final
int
eType_AnnotType
=
21
;
public
static
final
int
eType_DynType2
=
22
;
public
static
final
int
eType_ActionType2
=
23
;
public
static
final
int
eType_AppMotion
=
24
;
public
static
final
int
eCtxType_Glow
=
0
;
public
static
final
int
eCtxType_Brow
=
1
;
...
...
@@ -243,6 +244,10 @@ public class Glow {
public
static
final
int
eHotIndication_DarkColor
=
2
;
public
static
final
int
eHotIndication_LightColor
=
3
;
public
static
final
int
eAppMotion_Scroll
=
0
;
public
static
final
int
eAppMotion_Slider
=
1
;
public
static
final
int
eAppMotion_Both
=
2
;
public
static
final
int
eDrawType_Line
=
0
;
public
static
final
int
eDrawType_LineRed
=
1
;
public
static
final
int
eDrawType_LineGray
=
2
;
...
...
@@ -772,6 +777,7 @@ public class Glow {
public
static
final
int
eSave_Ctx_version
=
137
;
public
static
final
int
eSave_Ctx_hot_indication
=
138
;
public
static
final
int
eSave_Ctx_tiptext_size
=
139
;
public
static
final
int
eSave_Ctx_app_motion
=
140
;
public
static
final
int
eSave_Ctx_comment
=
199
;
public
static
final
int
eSave_Array_a
=
200
;
public
static
final
int
eSave_NodeClass_nc_name
=
300
;
...
...
java/jpwr/jopg/src/Graph.java
View file @
5f9ff3c5
...
...
@@ -53,6 +53,7 @@ public class Graph implements GraphIfc, GrowApplIfc {
public
double
scan_time
=
1
;
GrowCmn
[]
cmnStack
=
new
GrowCmn
[
10
];
int
cmnStackCnt
=
0
;
int
clickActive
=
0
;
public
Graph
(
GraphApplIfc
appl
,
Gdh
gdh
)
{
this
.
appl
=
appl
;
...
...
@@ -504,7 +505,7 @@ public class Graph implements GraphIfc, GrowApplIfc {
}
public
boolean
isAuthorized
(
int
access
)
{
return
true
;
return
appl
.
isAuthorized
(
access
)
;
}
public
double
getScanTime
()
{
...
...
@@ -538,4 +539,12 @@ public class Graph implements GraphIfc, GrowApplIfc {
ctx
=
(
GrowCtx
)
cmn
.
ctx
;
}
}
public
void
setClickActive
(
int
active
)
{
clickActive
=
active
;
}
public
int
getClickActive
()
{
return
clickActive
;
}
}
java/jpwr/jopg/src/GraphApplIfc.java
View file @
5f9ff3c5
...
...
@@ -45,4 +45,5 @@ public interface GraphApplIfc {
public
String
getObject
();
public
Object
loadGrowCtx
(
String
file
);
public
void
closeGraph
();
public
boolean
isAuthorized
(
int
access
);
}
java/jpwr/jopg/src/GraphIfc.java
View file @
5f9ff3c5
...
...
@@ -63,4 +63,5 @@ public interface GraphIfc {
public
boolean
isAuthorized
(
int
access
);
public
double
getScanTime
();
public
String
getCommand
(
String
cmd
);
public
void
setClickActive
(
int
active
);
}
java/jpwr/jopg/src/GrowCmn.java
View file @
5f9ff3c5
...
...
@@ -99,6 +99,7 @@ public class GrowCmn {
int
translate_on
;
int
input_focus_mark
;
int
hot_indication
;
int
app_motion
=
Glow
.
eAppMotion_Both
;
Object
userdata
;
GlowArrayElem
callback_object
;
int
callback_object_type
;
...
...
@@ -119,7 +120,7 @@ public class GrowCmn {
public
GrowCmn
(
GrowCtxIfc
ctx
,
GrowApplIfc
appl
)
{
this
.
ctx
=
ctx
;
this
.
appl
=
appl
;
this
.
debug
=
fals
e
;
this
.
debug
=
tru
e
;
this
.
antiAliasing
=
true
;
mw
.
window_width
=
getWidth
();
mw
.
window_height
=
getHeight
();
...
...
@@ -148,4 +149,7 @@ public class GrowCmn {
public
String
getOwner
()
{
return
owner
;
}
public
int
getAppMotion
()
{
return
app_motion
;
}
}
java/jpwr/jopg/src/GrowCtx.java
View file @
5f9ff3c5
...
...
@@ -140,6 +140,9 @@ public class GrowCtx implements GrowCtxIfc {
break
;
case
Glow
.
eSave_Ctx_tiptext_size
:
break
;
case
Glow
.
eSave_Ctx_app_motion
:
cmn
.
app_motion
=
Integer
.
valueOf
(
token
.
nextToken
());
break
;
case
Glow
.
eSave_Ctx_grow
:
open_grow
(
reader
);
grow_loaded
=
true
;
...
...
@@ -826,6 +829,14 @@ public class GrowCtx implements GrowCtxIfc {
e
.
setSource
(
source
,
owner
);
}
public
boolean
getSliderActive
()
{
return
sliderActive
;
}
public
void
setSliderActive
(
boolean
active
)
{
sliderActive
=
active
;
}
}
...
...
java/jpwr/jopg/src/GrowCtxIfc.java
View file @
5f9ff3c5
...
...
@@ -66,4 +66,5 @@ public interface GrowCtxIfc {
public
void
traceScan
();
public
boolean
traceStarted
();
public
void
setSubwindowSource
(
String
name
,
String
source
,
String
owner
);
public
void
setSliderActive
(
boolean
active
);
}
java/jpwr/jopg/src/GrowScrollBar.java
View file @
5f9ff3c5
...
...
@@ -198,6 +198,7 @@ public class GrowScrollBar extends GrowRect {
start_pos
=
fy
;
start_value
=
bar_value
;
movement_active
=
1
;
cmn
.
ctx
.
setSliderActive
(
true
);
}
break
;
case
Glow
.
eDir_Horizontal
:
...
...
@@ -206,12 +207,14 @@ public class GrowScrollBar extends GrowRect {
start_pos
=
fx
;
start_value
=
bar_value
;
movement_active
=
1
;
cmn
.
ctx
.
setSliderActive
(
true
);
}
break
;
}
break
;
case
Glow
.
eEvent_MB1Up
:
movement_active
=
0
;
cmn
.
ctx
.
setSliderActive
(
false
);
break
;
case
Glow
.
eEvent_ButtonMotion
:
if
(
movement_active
!=
0
)
{
...
...
java/jpwr/jopg/src/GrowWindow.java
View file @
5f9ff3c5
...
...
@@ -442,10 +442,14 @@ public class GrowWindow extends GrowRect implements GrowScrollBarIfc {
}
v_scrollbar
.
set_shadow
(
shadow
);
}
else
{
if
(
windowCmn
!=
null
)
else
if
(
v_scrollbar
!=
null
)
{
if
(
windowCmn
!=
null
)
{
v_scrollbar
.
set_range
(
wctx_y0
*
windowCmn
.
mw
.
subwindow_scale
,
wctx_y1
*
window_scale
);
v_scrollbar
.
set_value
(
wctx_y0
*
windowCmn
.
mw
.
subwindow_scale
,
y_high
-
(
y_low
+
y_low_offs
)
-
scrollbar_width
*
horizontal_scrollbar
);
v_value
=
wctx_y0
*
windowCmn
.
mw
.
subwindow_scale
;
}
}
if
(
horizontal_scrollbar
!=
0
&&
h_scrollbar
==
null
)
{
x0
=
x_left
;
...
...
@@ -467,11 +471,15 @@ public class GrowWindow extends GrowRect implements GrowScrollBarIfc {
}
h_scrollbar
.
set_shadow
(
shadow
);
}
else
{
if
(
windowCmn
!=
null
)
else
if
(
h_scrollbar
!=
null
)
{
if
(
windowCmn
!=
null
)
{
h_scrollbar
.
set_range
(
wctx_x0
*
windowCmn
.
mw
.
subwindow_scale
,
wctx_x1
*
windowCmn
.
mw
.
subwindow_scale
);
h_scrollbar
.
set_value
(
wctx_x0
*
windowCmn
.
mw
.
subwindow_scale
,
x_right
-
x_left
-
scrollbar_width
*
vertical_scrollbar
);
h_value
=
wctx_x0
*
windowCmn
.
mw
.
subwindow_scale
;
}
}
}
public
void
verticalScrollValueChanged
(
double
value
)
{
if
(
v_value
!=
value
)
{
...
...
src/tools/pkg/deb/src/os_templ/hw_templ/makefile
View file @
5f9ff3c5
...
...
@@ -30,6 +30,7 @@ copy :
lib
:
exe
:
$(bld_dir)/control_pwrrt $(bld_dir)/control_pwr $(bld_dir)/control_pwrdemo $(bld_dir)/control_pwrsev
rpi
:
$(bld_dir)/control_pwrrpi
clean
:
...
...
@@ -60,5 +61,10 @@ $(bld_dir)/control_pwrsev : ../../../pwrsev/control
@
../../../pwrsev/build.sh
@
cp
$(source)
$(target)
$(bld_dir)/control_pwrrpi
:
../../../pwrrpi/control
@
echo
"build
$(target)
"
@
../../../pwrrpi/build.sh
@
cp
$(source)
$(target)
src/wbl/pwrb/src/pwrb_c_webhandler.wb_load
View file @
5f9ff3c5
...
...
@@ -329,6 +329,15 @@ SObject pwrb:Class
Attr Flags = 0
EndBody
EndObject
!/**
! If AppUseWebDir is set all files used by the Android application is
! read from pwrp_web.
!*/
Object AppUseWebDir $Attribute 42
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
!
! Template for WebHandler
...
...
xtt/lib/ge/src/ge_attrnav.cpp
View file @
5f9ff3c5
...
...
@@ -862,6 +862,12 @@ static attrnav_sEnumElement elem_hot_indication[] = {
{
(
int
)
glow_eHotIndication_LightColor
,
"LightColor"
},
{
0
,
""
}};
static
attrnav_sEnumElement
elem_app_motion
[]
=
{
{
(
int
)
glow_eAppMotion_Scroll
,
"Scroll"
},
{
(
int
)
glow_eAppMotion_Slider
,
"Slider"
},
{
(
int
)
glow_eAppMotion_Both
,
"Both"
},
{
0
,
""
}};
static
attrnav_sEnumElement
elem_annot_type
[]
=
{
{
(
int
)
glow_eAnnotType_OneLine
,
"OneLine"
},
{
(
int
)
glow_eAnnotType_MultiLine
,
"MultiLine"
},
...
...
@@ -995,6 +1001,7 @@ static attrnav_sEnum enum_types[] = {
{
(
int
)
ge_eAttrType_CurveDataType
,
(
attrnav_sEnumElement
*
)
&
elem_curve_datatype
},
{
(
int
)
glow_eType_Gradient
,
(
attrnav_sEnumElement
*
)
&
elem_gradient
},
{
(
int
)
glow_eType_HotIndication
,
(
attrnav_sEnumElement
*
)
&
elem_hot_indication
},
{
(
int
)
glow_eType_AppMotion
,
(
attrnav_sEnumElement
*
)
&
elem_app_motion
},
{
(
int
)
glow_eType_AnnotType
,
(
attrnav_sEnumElement
*
)
&
elem_annot_type
},
{
(
int
)
ge_eAttrType_OptionMenuType
,
(
attrnav_sEnumElement
*
)
&
elem_optionmenu_type
},
{
0
,
NULL
}};
...
...
@@ -1063,6 +1070,7 @@ int attrnav_attr_string_to_value( int type_id, char *value_str,
case
glow_eType_TextSize
:
case
glow_eType_Gradient
:
case
glow_eType_HotIndication
:
case
glow_eType_AppMotion
:
case
ge_eAttrType_DynType1
:
case
ge_eAttrType_DynType2
:
case
ge_eAttrType_DynTypeTone
:
...
...
@@ -1150,6 +1158,7 @@ void attrnav_attrvalue_to_string( int type_id, void *value_ptr,
case
glow_eType_TextSize
:
case
glow_eType_Gradient
:
case
glow_eType_HotIndication
:
case
glow_eType_AppMotion
:
case
ge_eAttrType_AnimSequence
:
case
ge_eAttrType_LimitType
:
case
ge_eAttrType_ScaleType
:
...
...
@@ -2235,6 +2244,7 @@ ItemLocal::ItemLocal( AttrNav *attrnav, const char *item_name, const char *attr,
case
glow_eType_TextSize
:
case
glow_eType_Gradient
:
case
glow_eType_HotIndication
:
case
glow_eType_AppMotion
:
case
ge_eAttrType_DynType1
:
case
ge_eAttrType_DynType2
:
case
ge_eAttrType_DynTypeTone
:
...
...
xtt/lib/glow/src/glow.h
View file @
5f9ff3c5
...
...
@@ -101,7 +101,8 @@ typedef enum {
glow_eType_HotIndication
,
//!< Type is glow_eHotIndication
glow_eType_AnnotType
,
//!< Type is glow_eAnnotType
glow_eType_DynType2
,
//!< Type of dynamics mask 2
glow_eType_ActionType2
//!< Type of action mask 2
glow_eType_ActionType2
,
//!< Type of action mask 2
glow_eType_AppMotion
//!< Type is glow_eAppMotion
}
glow_eType
;
//! Type of Ctx class
...
...
@@ -409,6 +410,13 @@ typedef enum {
glow_eHotIndication_LightColor
//!< Lighter color for hot objects
}
glow_eHotIndication
;
//! Action for app motion event
typedef
enum
{
glow_eAppMotion_Scroll
,
//!< Scrolling
glow_eAppMotion_Slider
,
//!< Slider
glow_eAppMotion_Both
//!< Both slider and scrolling
}
glow_eAppMotion
;
//! Color index for a color
/*! The drawtype is index in an array that contains the gc for colors in the color palette.
...
...
@@ -1128,6 +1136,7 @@ typedef enum {
glow_eSave_Ctx_version
=
137
,
glow_eSave_Ctx_hot_indication
=
138
,
glow_eSave_Ctx_tiptext_size
=
139
,
glow_eSave_Ctx_app_motion
=
140
,
glow_eSave_Ctx_comment
=
199
,
glow_eSave_Array_a
=
200
,
glow_eSave_NodeClass_nc_name
=
300
,
...
...
xtt/lib/glow/src/glow_ctx.cpp
View file @
5f9ff3c5
...
...
@@ -98,7 +98,8 @@ GlowCtx::GlowCtx( const char *ctx_name, double zoom_fact, int offs_x, int offs_y
default_hot_mode
(
glow_eHotMode_SingleObject
),
hot_found
(
0
),
userdata_save_callback
(
0
),
userdata_open_callback
(
0
),
userdata_copy_callback
(
0
),
version
(
GLOW_VERSION
),
inputfocus_object
(
0
),
is_component
(
0
),
comment
(
0
),
hot_indication
(
glow_eHotIndication_LightColor
),
tiptext_size
(
2
),
eventlog_callback
(
0
)
hot_indication
(
glow_eHotIndication_LightColor
),
tiptext_size
(
2
),
app_motion
(
glow_eAppMotion_Both
),
eventlog_callback
(
0
)
{
strcpy
(
name
,
ctx_name
);
memset
(
(
void
*
)
event_callback
,
0
,
sizeof
(
event_callback
));
...
...
@@ -214,6 +215,7 @@ int GlowCtx::save( char *filename, glow_eSaveMode mode)
fp
<<
int
(
glow_eSave_Ctx_version
)
<<
FSPACE
<<
version
<<
endl
;
fp
<<
int
(
glow_eSave_Ctx_hot_indication
)
<<
FSPACE
<<
hot_indication
<<
endl
;
fp
<<
int
(
glow_eSave_Ctx_tiptext_size
)
<<
FSPACE
<<
tiptext_size
<<
endl
;
fp
<<
int
(
glow_eSave_Ctx_app_motion
)
<<
FSPACE
<<
app_motion
<<
endl
;
if
(
ctx_type
==
glow_eCtxType_Grow
)
{
fp
<<
int
(
glow_eSave_Ctx_grow
)
<<
endl
;
...
...
@@ -361,6 +363,7 @@ int GlowCtx::open( char *filename, glow_eSaveMode mode)
case
glow_eSave_Ctx_version
:
fp
>>
version
;
break
;
case
glow_eSave_Ctx_hot_indication
:
fp
>>
tmp
;
hot_indication
=
(
glow_eHotIndication
)
tmp
;
break
;
case
glow_eSave_Ctx_tiptext_size
:
fp
>>
tiptext_size
;
break
;
case
glow_eSave_Ctx_app_motion
:
fp
>>
tmp
;
app_motion
=
(
glow_eAppMotion
)
tmp
;
break
;
case
glow_eSave_Ctx_grow
:
((
GrowCtx
*
)
this
)
->
open_grow
(
fp
);
grow_loaded
=
1
;
...
...
xtt/lib/glow/src/glow_ctx.h
View file @
5f9ff3c5
...
...
@@ -847,6 +847,7 @@ class GlowCtx {
CtxComment
*
comment
;
glow_eHotIndication
hot_indication
;
//!< Specification of how hots object should be drawn.
int
tiptext_size
;
//!< Size of tooltip text
glow_eAppMotion
app_motion
;
//!< Action for app motion event.
glow_tEventLogCb
eventlog_callback
;
//!< Callback function to log events.
static
int
eventlog_enabled
;
//!< Event logging enabled.
...
...
xtt/lib/glow/src/glow_growapi.cpp
View file @
5f9ff3c5
...
...
@@ -3261,6 +3261,11 @@ int grow_GetGraphAttrInfo( grow_tCtx ctx, grow_sAttrInfo **info,
attrinfo
[
i
].
type
=
glow_eType_TextSize
;
attrinfo
[
i
++
].
size
=
sizeof
(
ctx
->
tiptext_size
);
strcpy
(
attrinfo
[
i
].
name
,
"AppMotion"
);
attrinfo
[
i
].
value_p
=
&
ctx
->
app_motion
;
attrinfo
[
i
].
type
=
glow_eType_AppMotion
;
attrinfo
[
i
++
].
size
=
sizeof
(
ctx
->
app_motion
);
attrinfo
[
i
].
info_type
=
grow_eInfoType_End
;
*
attr_cnt
=
i
;
*
info
=
attrinfo
;
...
...
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