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
44814a41
Commit
44814a41
authored
Mar 07, 2014
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Android app, AppLink object handles, class help and URL's
parent
3481feb2
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
583 additions
and
72 deletions
+583
-72
java/aapp/app/src/AGraphInfo.java
java/aapp/app/src/AGraphInfo.java
+14
-11
java/aapp/app/src/AXttItemAttrObject.java
java/aapp/app/src/AXttItemAttrObject.java
+7
-0
java/aapp/app/src/AXttItemObject.java
java/aapp/app/src/AXttItemObject.java
+3
-0
java/aapp/app/src/OpwinCmn.java
java/aapp/app/src/OpwinCmn.java
+10
-3
java/aapp/jopg/src/GlowDraw.java
java/aapp/jopg/src/GlowDraw.java
+7
-0
java/aapp/jopg/src/GlowDrawIfc.java
java/aapp/jopg/src/GlowDrawIfc.java
+1
-1
java/aapp/jopg/src/GrowFrame.java
java/aapp/jopg/src/GrowFrame.java
+1
-0
java/aapp/pwrxtt/src/MainActivity.java
java/aapp/pwrxtt/src/MainActivity.java
+528
-57
java/aapp/res/menu/activity_main.xml
java/aapp/res/menu/activity_main.xml
+4
-0
java/jpwr/jopg/src/GrowCtx.java
java/jpwr/jopg/src/GrowCtx.java
+6
-0
java/jpwr/rt/src/Pwrb.java
java/jpwr/rt/src/Pwrb.java
+2
-0
No files found.
java/aapp/app/src/AGraphInfo.java
View file @
44814a41
...
...
@@ -3,6 +3,9 @@ package jpwr.app;
import
android.graphics.Bitmap
;
public
class
AGraphInfo
{
public
static
final
int
TYPE_GRAPH
=
0
;
public
static
final
int
TYPE_LINK
=
1
;
public
int
type
;
public
Bitmap
bpm
;
public
Bitmap
bpmInverted
;
public
String
graph
;
...
...
java/aapp/app/src/AXttItemAttrObject.java
View file @
44814a41
...
...
@@ -12,6 +12,8 @@ public class AXttItemAttrObject extends AXttItemBase {
int
flags
;
int
type
;
PwrtAttrRef
aref
;
int
classid
;
AXttItemAttrObject
(
AXtt
axtt
,
PwrtObjid
objid
,
String
name
,
String
fullName
,
int
flags
,
int
type
,
...
...
@@ -30,6 +32,8 @@ public class AXttItemAttrObject extends AXttItemBase {
CdhrTypeId
cr
=
axtt
.
gdh
.
getAttrRefTid
(
ar
.
aref
);
if
(
cr
.
evenSts
())
return
;
classid
=
cr
.
typeId
;
CdhrObjid
coidret
=
axtt
.
gdh
.
classIdToObjid
(
cr
.
typeId
);
if
(
coidret
.
evenSts
())
return
;
...
...
@@ -110,4 +114,7 @@ public class AXttItemAttrObject extends AXttItemBase {
public
PwrtAttrRef
getAttrRef
()
{
return
aref
;
}
public
int
getClassId
()
{
return
classid
;
}
}
java/aapp/app/src/AXttItemObject.java
View file @
44814a41
...
...
@@ -229,4 +229,7 @@ public class AXttItemObject extends AXttItemBase {
}
}
public
int
getClassId
()
{
return
classid
;
}
}
java/aapp/app/src/OpwinCmn.java
View file @
44814a41
...
...
@@ -116,9 +116,16 @@ public class OpwinCmn implements PlowCmnIfc {
switch
(
action
)
{
case
PlowCmnIfc
.
ACTION_UP
:
if
(
currentGraph
!=
null
)
{
if
(
currentGraph
.
type
==
AGraphInfo
.
TYPE_GRAPH
)
{
String
cmd
=
"open graph "
+
currentGraph
.
graph
;
if
(
Math
.
abs
(
fx
-
downX
)
<
10
&&
Math
.
abs
(
fy
-
downY
)
<
10
)
appl
.
command
(
cmd
);
}
else
if
(
currentGraph
.
type
==
AGraphInfo
.
TYPE_LINK
)
{
String
cmd
=
new
String
(
"open url \""
+
currentGraph
.
graph
+
"\""
);
if
(
Math
.
abs
(
fx
-
downX
)
<
10
&&
Math
.
abs
(
fy
-
downY
)
<
10
)
appl
.
command
(
cmd
);
}
currentGraph
.
inverted
=
false
;
currentGraph
=
null
;
}
...
...
java/aapp/jopg/src/GlowDraw.java
View file @
44814a41
...
...
@@ -536,6 +536,13 @@ public class GlowDraw implements GlowDrawIfc {
return
1
;
}
public
void
set_clip
()
{
if
(
clipCount
>
0
)
{
canvas
.
clipRect
(
clip_x1
[
clipCount
-
1
],
clip_y1
[
clipCount
-
1
],
clip_x2
[
clipCount
-
1
],
clip_y2
[
clipCount
-
1
],
Region
.
Op
.
REPLACE
);
}
}
public
void
reset_clip_rectangle
()
{
if
(
clipCount
==
0
)
{
System
.
out
.
println
(
"Clip mismatch"
);
...
...
java/aapp/jopg/src/GlowDrawIfc.java
View file @
44814a41
...
...
@@ -36,7 +36,6 @@
package
jpwr.jopg
;
import
java.awt.*
;
import
android.graphics.Canvas
;
...
...
@@ -63,4 +62,5 @@ public interface GlowDrawIfc {
public
int
getColor
(
int
gc_type
);
public
int
set_clip_rectangle
(
int
x1
,
int
y1
,
int
x2
,
int
y2
);
public
void
reset_clip_rectangle
();
public
void
set_clip
();
}
java/aapp/jopg/src/GrowFrame.java
View file @
44814a41
...
...
@@ -87,6 +87,7 @@ public class GrowFrame implements GraphApplIfc {
public
boolean
isAuthorized
(
int
access
)
{
return
false
;
}
public
void
openPopupMenu
(
String
object
,
double
x
,
double
y
)
{}
}
...
...
java/aapp/pwrxtt/src/MainActivity.java
View file @
44814a41
...
...
@@ -13,13 +13,12 @@ import java.util.StringTokenizer;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
java.util.Vector
;
import
java.util.concurrent.Semaphore
;
import
android.net.Uri
;
import
android.os.AsyncTask
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.support.v4.app.FragmentManager
;
import
android.support.v4.view.MotionEventCompat
;
import
android.text.Editable
;
import
android.text.InputType
;
import
android.util.DisplayMetrics
;
...
...
@@ -113,6 +112,9 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
Vector
<
PlowCmnIfc
>
cmnList
=
new
Vector
<
PlowCmnIfc
>();
Canvas
currentCanvas
=
null
;
float
density
;
final
Semaphore
semDraw
=
new
Semaphore
(
1
,
true
);
String
[]
urlSymbols
=
null
;
int
lang
=
45
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -252,6 +254,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
MenuItem
item_opencrr
=
menu
.
findItem
(
R
.
id
.
opencrr_option
);
MenuItem
item_alarmack
=
menu
.
findItem
(
R
.
id
.
alarmack_option
);
MenuItem
item_navigator
=
menu
.
findItem
(
R
.
id
.
navigator_option
);
MenuItem
item_helpclass
=
menu
.
findItem
(
R
.
id
.
helpclass_option
);
MenuItem
item_changevalue
=
menu
.
findItem
(
R
.
id
.
changevalue_option
);
if
(
aev
!=
null
&&
currentCmn
==
aev
.
getCmnAla
())
{
// Alarm list
...
...
@@ -267,6 +270,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
item_opencrr
.
setVisible
(
true
);
item_alarmack
.
setVisible
(
true
);
item_navigator
.
setVisible
(
true
);
item_helpclass
.
setVisible
(
true
);
item_changevalue
.
setVisible
(
false
);
}
else
if
(
aev
!=
null
&&
currentCmn
==
aev
.
getCmnEve
())
{
...
...
@@ -283,6 +287,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
item_opencrr
.
setVisible
(
true
);
item_alarmack
.
setVisible
(
false
);
item_navigator
.
setVisible
(
true
);
item_helpclass
.
setVisible
(
true
);
item_changevalue
.
setVisible
(
false
);
}
else
if
(
currentCmn
==
cmnList
.
get
(
0
))
{
...
...
@@ -299,6 +304,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
item_opencrr
.
setVisible
(
true
);
item_alarmack
.
setVisible
(
false
);
item_navigator
.
setVisible
(
true
);
item_helpclass
.
setVisible
(
true
);
item_changevalue
.
setVisible
(
true
);
}
else
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_FLOW
)
{
...
...
@@ -315,6 +321,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
item_opencrr
.
setVisible
(
true
);
item_alarmack
.
setVisible
(
false
);
item_navigator
.
setVisible
(
true
);
item_helpclass
.
setVisible
(
true
);
item_changevalue
.
setVisible
(
false
);
}
else
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_GRAPH
)
{
...
...
@@ -331,6 +338,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
item_opencrr
.
setVisible
(
false
);
item_alarmack
.
setVisible
(
false
);
item_navigator
.
setVisible
(
true
);
item_helpclass
.
setVisible
(
false
);
item_changevalue
.
setVisible
(
false
);
}
else
if
(
currentCmn
.
type
()
==
PlowCmnIfc
.
TYPE_OPWIN
)
{
...
...
@@ -347,6 +355,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
item_opencrr
.
setVisible
(
false
);
item_alarmack
.
setVisible
(
false
);
item_navigator
.
setVisible
(
true
);
item_helpclass
.
setVisible
(
false
);
item_changevalue
.
setVisible
(
false
);
}
else
{
...
...
@@ -362,6 +371,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
item_opencrr
.
setVisible
(
true
);
item_alarmack
.
setVisible
(
false
);
item_navigator
.
setVisible
(
true
);
item_helpclass
.
setVisible
(
false
);
item_changevalue
.
setVisible
(
false
);
}
}
...
...
@@ -670,6 +680,30 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
break
;
}
case
R
.
id
.
helpclass_option
:
{
System
.
out
.
println
(
"Help Class"
);
if
(
!
gdh
.
isAuthorized
(
Pwr
.
mAccess_AllRt
))
{
openMessageDialog
(
"Not authorized"
);
break
;
}
switch
(
currentCmn
.
type
())
{
case
PlowCmnIfc
.
TYPE_PLOW
:
{
PlowNode
selectedNode
=
(
PlowNode
)
currentCmn
.
getSelect
();
if
(
selectedNode
!=
null
)
{
AXttItemBase
baseItem
=
(
AXttItemBase
)
selectedNode
.
getUserData
();
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
CLASS_HELP
,
baseItem
));
}
break
;
}
case
PlowCmnIfc
.
TYPE_FLOW
:
{
// TODO
FlowNode
selectedNode
=
(
FlowNode
)
currentCmn
.
getSelect
();
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
FLOW_CLASSHELP
,
selectedNode
));
break
;
}
}
break
;
}
}
return
true
;
}
...
...
@@ -763,8 +797,32 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
System
.
out
.
println
(
"Long click event"
);
AXttItemBase
item
=
(
AXttItemBase
)((
PlowNode
)
e
.
object
).
getUserData
();
if
(
item
instanceof
AXttItemObject
)
{
switch
(((
AXttItemObject
)
item
).
getClassId
())
{
case
Pwrb
.
cClass_plc
:
case
Pwrb
.
cClass_windowplc
:
case
Pwrb
.
cClass_windowcond
:
case
Pwrb
.
cClass_windoworderact
:
case
Pwrb
.
cClass_windowsubstep
:
{
PwrtObjid
oid
=
((
AXttItemObject
)
item
).
getObjid
();
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
OPEN_FLOW
,
oid
));
break
;
}
case
Pwrb
.
cClass_AppGraph
:
case
Pwrb
.
cClass_WebGraph
:
case
Pwrb
.
cClass_XttGraph
:
{
PwrtObjid
oid
=
((
AXttItemObject
)
item
).
getObjid
();
new
GdhTask
().
execute
(
new
GdhTaskArg
(
GdhTask
.
OPEN_DEFGRAPH
,
oid
));
break
;
}
}
}
else
if
(
item
instanceof
AXttItemAttr
)
{
switch
(
((
AXttItemAttr
)
item
).
getType
())
{
case
Pwr
.
eType_String
:
{
System
.
out
.
println
(
"URL found"
);
break
;
}
}
}
}
break
;
...
...
@@ -833,6 +891,8 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
public
static
final
int
CONFIRM_ACTION
=
20
;
public
static
final
int
OPWIN
=
21
;
public
static
final
int
LOGIN
=
22
;
public
static
final
int
CLASS_HELP
=
23
;
public
static
final
int
FLOW_CLASSHELP
=
24
;
@Override
protected
Void
doInBackground
(
GdhTaskArg
...
arg
)
{
...
...
@@ -851,6 +911,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
System
.
out
.
println
(
"Open rootlist"
);
AXttItemObject
.
openRoot
(
axtt
);
currentCmn
.
configure
();
loadUrlSymbols
();
initDone
=
true
;
break
;
}
...
...
@@ -905,7 +966,14 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
break
;
case
DYNAMIC_UPDATE:
gdh
.
getObjectRefInfoAll
();
try
{
semDraw
.
acquire
();
}
catch
(
InterruptedException
e
)
{
System
.
out
.
println
(
"InterruptedException"
);
}
currentCmn
.
dynamicUpdate
();
semDraw
.
release
();
break
;
case
OPEN_FLOWNODE:
{
FlowNode
node
=
(
FlowNode
)
arg
[
0
].
item
;
...
...
@@ -1054,6 +1122,51 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
case
OPEN_DEFGRAPH:
{
PwrtObjid
oid
=
(
PwrtObjid
)
arg
[
0
].
item
;
String
action
=
null
;
String
instance
=
null
;
CdhrClassId
cret
=
gdh
.
getObjectClass
(
oid
);
if
(
cret
.
evenSts
())
break
;
switch
(
cret
.
getClassId
())
{
case
Pwrb
.
cClass_XttGraph
:
{
CdhrString
rName
=
gdh
.
objidToName
(
oid
,
Cdh
.
mName_pathStrict
);
if
(
rName
.
evenSts
())
break
;
String
oname
=
rName
.
str
;
String
name
=
oname
+
".Action"
;
rName
=
gdh
.
getObjectInfoString
(
name
);
if
(
rName
.
evenSts
())
break
;
action
=
rName
.
str
;
name
=
oname
+
".Object"
;
rName
=
gdh
.
getObjectInfoString
(
name
);
if
(
rName
.
evenSts
())
break
;
instance
=
rName
.
str
;
if
(
instance
.
equals
(
""
))
instance
=
null
;
break
;
}
case
Pwrb
.
cClass_AppGraph
:
case
Pwrb
.
cClass_WebGraph
:
{
CdhrString
rName
=
gdh
.
objidToName
(
oid
,
Cdh
.
mName_pathStrict
);
if
(
rName
.
evenSts
())
break
;
String
oname
=
rName
.
str
;
String
name
=
oname
+
".Name"
;
rName
=
gdh
.
getObjectInfoString
(
name
);
if
(
rName
.
evenSts
())
break
;
action
=
rName
.
str
;
if
(
!
action
.
contains
(
".pwg"
))
action
=
action
+
".pwg"
;
instance
=
null
;
break
;
}
default
:
{
CdhrString
rName
=
gdh
.
objidToName
(
oid
,
Cdh
.
mName_pathStrict
);
if
(
rName
.
evenSts
())
break
;
...
...
@@ -1067,17 +1180,21 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
rName
=
gdh
.
getObjectInfoString
(
name
);
if
(
rName
.
evenSts
())
break
;
String
action
=
rName
.
str
;
action
=
rName
.
str
;
name
=
oname
+
".Object"
;
rName
=
gdh
.
getObjectInfoString
(
name
);
if
(
rName
.
evenSts
())
break
;
String
instance
=
rName
.
str
;
instance
=
rName
.
str
;
if
(
instance
.
equals
(
""
))
instance
=
null
;
}
}
if
(
action
==
null
)
break
;
System
.
out
.
println
(
"Open "
+
rName
.
str
);
System
.
out
.
println
(
"Open "
+
action
);
new
ReaderTask
().
execute
(
new
ReaderTaskArg
(
ReaderTask
.
GROW_READ
,
action
,
instance
));
break
;
}
...
...
@@ -1138,7 +1255,14 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
case
EVENTHANDLER:
{
GdhEventArg
event
=
(
GdhEventArg
)
arg
[
0
].
item
;
try
{
semDraw
.
acquire
();
}
catch
(
InterruptedException
e
)
{
System
.
out
.
println
(
"InterruptedException"
);
}
currentCmn
.
eventHandler
(
event
.
action
,
event
.
x
,
event
.
y
);
semDraw
.
release
();
break
;
}
case
VALUEINPUT_ACTION:
{
...
...
@@ -1167,6 +1291,126 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
((
Dyn
)
confirmDyn
).
confirmedAction
(
Glow
.
eEvent_MB1Click
,
confirmObject
);
break
;
}
case
CLASS_HELP:
{
int
classid
=
0
;
AXttItemBase
item
=
(
AXttItemBase
)
arg
[
0
].
item
;
if
(
item
instanceof
AXttItemObject
)
classid
=
((
AXttItemObject
)
item
).
getClassId
();
else
if
(
item
instanceof
AXttItemAttrObject
)
classid
=
((
AXttItemAttrObject
)
item
).
getClassId
();
if
(
classid
!=
0
)
{
CdhrObjid
oret
=
gdh
.
classIdToObjid
(
classid
);
if
(
oret
.
evenSts
())
break
;
CdhrString
sret
=
gdh
.
objidToName
(
oret
.
objid
,
Cdh
.
mName_volumeStrict
);
if
(
sret
.
evenSts
())
break
;
int
idx
=
sret
.
str
.
lastIndexOf
(
":"
);
if
(
idx
==
-
1
)
break
;
String
volume
=
sret
.
str
.
substring
(
0
,
idx
);
idx
=
sret
.
str
.
lastIndexOf
(
"-"
);
if
(
idx
==
-
1
)
break
;
String
className
=
sret
.
str
.
substring
(
idx
+
1
);
String
url
;
if
(
isBaseClassVolume
(
volume
))
url
=
"$pwr_doc/"
+
getLang
()
+
"/orm/"
+
volume
.
toLowerCase
()
+
"_"
+
className
.
toLowerCase
()
+
".html"
;
else
url
=
"http://"
+
pwrHost
+
"/pwrp_web/"
+
volume
.
toLowerCase
()
+
"_"
+
className
.
toLowerCase
()
+
".html"
;
openURL
(
url
,
null
);
}
break
;
}
case
FLOW_CLASSHELP:
{
int
classid
=
0
;
FlowNode
node
=
(
FlowNode
)
arg
[
0
].
item
;
PwrtObjid
nodeObjid
=
node
.
getCmn
().
getObjid
();
CdhrString
rName
=
gdh
.
objidToName
(
nodeObjid
,
Cdh
.
mName_pathStrict
);
if
(
rName
.
evenSts
())
break
;
String
name
=
rName
.
str
+
"-"
+
node
.
getName
();
CdhrObjid
oret
=
gdh
.
nameToObjid
(
name
);
if
(
oret
.
evenSts
())
{
String
oName
=
node
.
getTraceObject
();
oret
=
gdh
.
nameToObjid
(
oName
);
if
(
oret
.
evenSts
())
break
;
}
CdhrClassId
cret
=
gdh
.
getObjectClass
(
oret
.
objid
);
if
(
cret
.
evenSts
())
break
;
switch
(
cret
.
getClassId
())
{
case
Pwrb
.
cClass_stodv
:
case
Pwrb
.
cClass_stodi
:
case
Pwrb
.
cClass_stodo
:
case
Pwrb
.
cClass_setdv
:
case
Pwrb
.
cClass_setdi
:
case
Pwrb
.
cClass_setdo
:
case
Pwrb
.
cClass_resdv
:
case
Pwrb
.
cClass_resdi
:
case
Pwrb
.
cClass_resdo
:
case
Pwrb
.
cClass_stoav
:
case
Pwrb
.
cClass_stoai
:
case
Pwrb
.
cClass_stoao
:
case
Pwrb
.
cClass_stodp
:
case
Pwrb
.
cClass_setdp
:
case
Pwrb
.
cClass_resdp
:
case
Pwrb
.
cClass_stoap
:
case
Pwrb
.
cClass_stoip
:
case
Pwrb
.
cClass_cstoav
:
case
Pwrb
.
cClass_cstoai
:
case
Pwrb
.
cClass_cstoao
:
case
Pwrb
.
cClass_cstoap
:
case
Pwrb
.
cClass_cstoip
:
case
Pwrb
.
cClass_GetData
:
String
oName
=
node
.
getTraceObject
();
oret
=
gdh
.
nameToObjid
(
oName
);
break
;
default
:
;
}
if
(
oret
.
evenSts
())
break
;
cret
=
gdh
.
getObjectClass
(
oret
.
objid
);
if
(
cret
.
evenSts
())
break
;
oret
=
gdh
.
classIdToObjid
(
cret
.
getClassId
());
if
(
oret
.
evenSts
())
break
;
CdhrString
sret
=
gdh
.
objidToName
(
oret
.
objid
,
Cdh
.
mName_volumeStrict
);
if
(
sret
.
evenSts
())
break
;
int
idx
=
sret
.
str
.
lastIndexOf
(
":"
);
if
(
idx
==
-
1
)
break
;
String
volume
=
sret
.
str
.
substring
(
0
,
idx
);
idx
=
sret
.
str
.
lastIndexOf
(
"-"
);
if
(
idx
==
-
1
)
break
;
String
className
=
sret
.
str
.
substring
(
idx
+
1
);
String
url
;
if
(
isBaseClassVolume
(
volume
))
url
=
"$pwr_doc/"
+
getLang
()
+
"/orm/"
+
volume
.
toLowerCase
()
+
"_"
+
className
.
toLowerCase
()
+
".html"
;
else
url
=
"http://"
+
pwrHost
+
"/pwrp_web/"
+
volume
.
toLowerCase
()
+
"_"
+
className
.
toLowerCase
()
+
".html"
;
openURL
(
url
,
null
);
break
;
}
case
LOGIN:
{
String
[]
item
=
(
String
[])
arg
[
0
].
item
;
int
sts
=
gdh
.
login
(
item
[
0
],
item
[
1
]);
...
...
@@ -1202,7 +1446,8 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
switch
(
cret
.
getClassId
())
{
case
Pwrb
.
cClass_AppGraph
:
addGraphList
(
oret
.
objid
);
case
Pwrb
.
cClass_AppLink
:
addGraphList
(
oret
.
objid
,
cret
.
getClassId
());
break
;
case
Pwrs
.
cClass_PlantHier
:
case
Pwrs
.
cClass_NodeHier
:
...
...
@@ -1210,8 +1455,10 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
oret2
.
oddSts
();
oret2
=
gdh
.
getNextSibling
(
oret2
.
objid
))
{
CdhrClassId
cret2
=
gdh
.
getObjectClass
(
oret2
.
objid
);
if
(
cret2
.
oddSts
()
&&
cret2
.
getClassId
()
==
Pwrb
.
cClass_AppGraph
)
addGraphList
(
oret2
.
objid
);
if
(
cret2
.
oddSts
()
&&
(
cret2
.
getClassId
()
==
Pwrb
.
cClass_AppGraph
||
cret2
.
getClassId
()
==
Pwrb
.
cClass_AppLink
))
addGraphList
(
oret2
.
objid
,
cret2
.
getClassId
());
}
break
;
default
:
;
...
...
@@ -1241,11 +1488,12 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
else
appl
.
setTitle
(
"PwrXtt on "
+
pwrHost
);
}
// if ( currentCmn.type() != PlowCmnIfc.TYPE_GRAPH )
view
.
invalidate
();
}
}
private
void
addGraphList
(
PwrtObjid
objid
)
{
private
void
addGraphList
(
PwrtObjid
objid
,
int
cid
)
{
CdhrString
sret
=
gdh
.
objidToName
(
objid
,
Cdh
.
mName_volumeStrict
);
String
name
=
sret
.
str
;
...
...
@@ -1279,12 +1527,22 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
System
.
out
.
println
(
"Unable to open file "
+
image
+
" "
+
url
);
}
}
if
(
cid
==
Pwrb
.
cClass_AppGraph
)
{
info
.
type
=
AGraphInfo
.
TYPE_GRAPH
;
aName
=
name
+
".Name"
;
sret
=
gdh
.
getObjectInfoString
(
aName
);
if
(
sret
.
evenSts
())
return
;
info
.
graph
=
sret
.
str
;
}
else
if
(
cid
==
Pwrb
.
cClass_AppLink
)
{
info
.
type
=
AGraphInfo
.
TYPE_LINK
;
aName
=
name
+
".URL"
;
sret
=
gdh
.
getObjectInfoString
(
aName
);
if
(
sret
.
evenSts
())
return
;
info
.
graph
=
sret
.
str
;
}
aName
=
name
+
".Text"
;
sret
=
gdh
.
getObjectInfoString
(
aName
);
...
...
@@ -1343,9 +1601,9 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
if
(
me
==
null
)
return
true
;
int
action
=
MotionEventCompat
.
getActionMasked
(
me
);
float
x
=
MotionEventCompat
.
getX
(
me
,
0
);
float
y
=
MotionEventCompat
.
getY
(
me
,
0
);
int
action
=
me
.
getActionMasked
(
);
float
x
=
me
.
getX
(
);
float
y
=
me
.
getY
(
);
boolean
isSustained
=
false
;
boolean
sliderActive
=
false
;
...
...
@@ -1445,8 +1703,8 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
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
);
(
me
.
getX
(
0
)
+
me
.
getX
(
1
))/
2
,
(
me
.
getY
(
0
)
+
me
.
getY
(
1
))/
2
+
viewOffsetY
);
eventDistance
=
distance
;
view
.
invalidate
();
}
...
...
@@ -1535,13 +1793,22 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
case
MotionEvent
.
ACTION_POINTER_UP
:
System
.
out
.
println
(
"Event Action Pointer Up"
);
eventMode
=
MODE_SCROLL
;
int
idx
=
me
.
getActionIndex
();
if
(
idx
==
0
)
{
lastTouchX
=
me
.
getX
(
1
);
lastTouchY
=
me
.
getY
(
1
);
}
else
{
lastTouchX
=
x
;
lastTouchY
=
y
;
}
break
;
}
return
true
;
}
private
float
eventDistance
(
MotionEvent
me
)
{
float
x
=
MotionEventCompat
.
getX
(
me
,
0
)
-
MotionEventCompat
.
getX
(
me
,
1
);
float
y
=
MotionEventCompat
.
getY
(
me
,
0
)
-
MotionEventCompat
.
getY
(
me
,
1
);
float
x
=
me
.
getX
(
0
)
-
me
.
getX
(
1
);
float
y
=
me
.
getY
(
0
)
-
me
.
getY
(
1
);
return
FloatMath
.
sqrt
(
x
*
x
+
y
*
y
);
}
...
...
@@ -1571,7 +1838,7 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
}
private
class
MainView
extends
SurfaceView
{
Bitmap
bitmap
=
null
;
Canvas
draw
Canvas
;
Canvas
drawCanvas
,
current
Canvas
;
public
MainView
(
Context
context
)
{
super
(
context
);
...
...
@@ -1589,15 +1856,20 @@ public class MainActivity extends Activity implements PlowAppl, GraphApplIfc, Gd
drawCanvas
=
new
Canvas
(
bitmap
);
drawCanvas
.
drawColor
(
graph
.
cmn
.
gdraw
.
getColor
(
graph
.
cmn
.
background_color
));
}
try
{
semDraw
.
acquire
();
}
catch
(
InterruptedException
e
)
{
System
.
out
.
println
(
"InterruptedException"
);
}
currentCmn
.
setCanvas
(
drawCanvas
);
graph
.
cmn
.
gdraw
.
set_clip
();
drawCanvas
.
drawColor
(
graph
.
cmn
.
gdraw
.
getColor
(
graph
.
cmn
.
background_color
));
// if ( currentCmn.getNodraw() > 0)
// currentCmn.resetNodraw();
currentCmn
.
draw
();
// currentCmn.setNodraw();
canvas
.
drawBitmap
(
bitmap
,
0
F
,
0
F
,
null
);
currentCanvas
=
getHolder
().
lockCanvas
();
currentCanvas
.
drawBitmap
(
bitmap
,
0
F
,
0
F
,
null
);
getHolder
().
unlockCanvasAndPost
(
currentCanvas
);
semDraw
.
release
();
}
else
{
...
...
@@ -1923,12 +2195,24 @@ System.out.println("MainActivity TimerTask " + currentCmn.type());
Boolean
newFrame
=
true
;
String
frameName
=
null
;
String
urlValue
=
cli
.
getQualValue
(
"cli_arg2"
);
if
(!
urlValue
.
startsWith
(
"http://"
)
&&
!
urlValue
.
startsWith
(
"https://"
))
urlValue
=
"http://"
+
urlValue
;
System
.
out
.
println
(
"open url "
+
urlValue
);
Intent
browserIntent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
urlValue
));
startActivity
(
browserIntent
);
if
(
urlValue
.
startsWith
(
"pwrb_"
)
||
urlValue
.
startsWith
(
"pwrs_"
)
||
urlValue
.
startsWith
(
"nmps_"
)
||
urlValue
.
startsWith
(
"profibus_"
)
||
urlValue
.
startsWith
(
"otherio_"
)
||
urlValue
.
startsWith
(
"opc_"
)
||
urlValue
.
startsWith
(
"basecomponent_"
)
||
urlValue
.
startsWith
(
"abb_"
)
||
urlValue
.
startsWith
(
"siemens_"
)
||
urlValue
.
startsWith
(
"ssabox_"
))
// Object reference manual
urlValue
=
"$pwr_doc/"
+
getLang
()
+
"/orm/"
+
urlValue
;
System
.
out
.
println
(
"open url "
+
urlValue
);
// Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlValue));
//startActivity(browserIntent);
openURL
(
urlValue
,
null
);
}
else
if
(
trend
.
length
()
>=
cli_arg1
.
length
()
&&
trend
.
substring
(
0
,
cli_arg1
.
length
()).
equals
(
cli_arg1
))
{
...
...
@@ -1990,6 +2274,51 @@ System.out.println("MainActivity TimerTask " + currentCmn.type());
}
}
}
else
if
(
command
.
equals
(
"HELP"
))
{
String
fileName
=
"xtt_help_"
;
String
bookmarkValue
=
null
;
if
(
cli
.
qualifierFound
(
"/VERSION"
))
{
fileName
=
pwrHost
+
"/pwr_doc/xtt_version_help_version.html"
;
openURL
(
fileName
,
null
);
}
else
{
if
(
cli
.
qualifierFound
(
"/BASE"
))
// Not language dependent !! TODO
fileName
=
pwrHost
+
"/pwr_doc/help/xtt_help_"
;
else
fileName
=
pwrHost
+
"/pwrp_web/xtt_help_"
;
if
(
cli
.
qualifierFound
(
"cli_arg1"
))
fileName
+=
cli
.
getQualValue
(
"cli_arg1"
).
toLowerCase
();
if
(
cli
.
qualifierFound
(
"cli_arg2"
))
fileName
+=
"_"
+
cli
.
getQualValue
(
"cli_arg2"
).
toLowerCase
();
if
(
cli
.
qualifierFound
(
"cli_arg3"
))
fileName
+=
"_"
+
cli
.
getQualValue
(
"cli_arg3"
).
toLowerCase
();
if
(
cli
.
qualifierFound
(
"cli_arg4"
))
fileName
+=
"_"
+
cli
.
getQualValue
(
"cli_arg4"
).
toLowerCase
();
if
(
fileName
.
startsWith
(
"pwrb_"
)
||
fileName
.
startsWith
(
"pwrs_"
)
||
fileName
.
startsWith
(
"nmps_"
)
||
fileName
.
startsWith
(
"profibus_"
)
||
fileName
.
startsWith
(
"otherio_"
)
||
fileName
.
startsWith
(
"opc_"
)
||
fileName
.
startsWith
(
"basecomponent_"
)
||
fileName
.
startsWith
(
"abb_"
)
||
fileName
.
startsWith
(
"siemens_"
)
||
fileName
.
startsWith
(
"ssabox_"
))
// Object reference manual
fileName
=
"$pwr_doc/orm/"
+
fileName
;
if
(
cli
.
qualifierFound
(
"/BOOKMARK"
))
bookmarkValue
=
cli
.
getQualValue
(
"/BOOKMARK"
);
System
.
out
.
println
(
"Loading helpfile \""
+
fileName
+
"\""
);
openURL
(
fileName
,
bookmarkValue
);
}
local_cmd
=
true
;
}
else
if
(
command
.
equals
(
"CHECK"
))
{
if
(
cli
.
qualifierFound
(
"cli_arg1"
))
{
...
...
@@ -2179,4 +2508,146 @@ System.out.println("MainActivity TimerTask " + currentCmn.type());
break
;
}
}
void
loadUrlSymbols
()
{
// Get language from webhandler object
CdhrObjid
webHandler
=
gdh
.
getClassList
(
Pwrb
.
cClass_WebHandler
);
if
(
webHandler
.
evenSts
())
return
;
CdhrString
webHandlerName
=
gdh
.
objidToName
(
webHandler
.
objid
,
Cdh
.
mName_volumeStrict
);
if
(
webHandlerName
.
evenSts
())
return
;
String
attr
=
webHandlerName
.
str
+
".Language"
;
CdhrInt
iAttrValue
=
gdh
.
getObjectInfoInt
(
attr
);
if
(
iAttrValue
.
evenSts
())
return
;
lang
=
iAttrValue
.
value
;
// Get URL Symbols
CdhrObjid
webConfig
=
gdh
.
getClassList
(
Pwrb
.
cClass_WebBrowserConfig
);
if
(
webConfig
.
evenSts
())
return
;
CdhrString
webName
=
gdh
.
objidToName
(
webConfig
.
objid
,
Cdh
.
mName_volumeStrict
);
if
(
webConfig
.
evenSts
())
return
;
urlSymbols
=
new
String
[
10
];
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
attr
=
webName
.
str
+
".URL_Symbols["
+
i
+
"]"
;
CdhrString
attrValue
=
gdh
.
getObjectInfoString
(
attr
);
if
(
attrValue
.
evenSts
())
return
;
urlSymbols
[
i
]
=
attrValue
.
str
;
}
}
String
replaceUrlSymbol
(
String
url
)
{
if
(
urlSymbols
==
null
)
return
url
;
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
if
(
urlSymbols
[
i
].
equals
(
""
))
continue
;
StringTokenizer
token
=
new
StringTokenizer
(
urlSymbols
[
i
]);
String
symbol
=
"$"
+
token
.
nextToken
();
if
(
!
token
.
hasMoreTokens
())
continue
;
String
value
=
token
.
nextToken
();
int
idx
=
url
.
lastIndexOf
(
symbol
);
while
(
idx
!=
-
1
)
{
url
=
url
.
substring
(
0
,
idx
)
+
value
+
url
.
substring
(
idx
+
symbol
.
length
());
idx
=
url
.
lastIndexOf
(
symbol
);
}
}
return
url
;
}
void
openURL
(
String
name
,
String
bookmark
)
{
System
.
out
.
println
(
"openURL "
+
name
);
// Replace any URL symbol
name
=
replaceUrlSymbol
(
name
);
String
url_str
=
null
;
if
(
name
.
startsWith
(
"http:"
)
||
name
.
startsWith
(
"https:"
))
{
url_str
=
name
;
if
(
url_str
.
lastIndexOf
(
".html"
)
==
-
1
&&
url_str
.
lastIndexOf
(
".shtml"
)
==
-
1
&&
url_str
.
lastIndexOf
(
".htm"
)
==
-
1
&&
url_str
.
lastIndexOf
(
".gif"
)
==
-
1
&&
url_str
.
lastIndexOf
(
".jpg"
)
==
-
1
&&
url_str
.
lastIndexOf
(
".png"
)
==
-
1
&&
url_str
.
lastIndexOf
(
".pdf"
)
==
-
1
)
url_str
=
url_str
+
".html"
;
}
else
if
(
name
.
startsWith
(
"$pwr_doc/"
))
{
url_str
=
"http://"
+
pwrHost
+
"/pwr_doc/"
+
name
.
substring
(
9
);
if
(
url_str
.
lastIndexOf
(
".html"
)
==
-
1
&&
url_str
.
lastIndexOf
(
".shtml"
)
==
-
1
&&
url_str
.
lastIndexOf
(
".htm"
)
==
-
1
&&
url_str
.
lastIndexOf
(
".pdf"
)
==
-
1
)
url_str
=
url_str
+
".html"
;
}
else
{
String
path
=
"http://"
;
if
(
name
.
lastIndexOf
(
".html"
)
==
-
1
&&
name
.
lastIndexOf
(
".shtml"
)
==
-
1
&&
name
.
lastIndexOf
(
".htm"
)
==
-
1
&&
name
.
lastIndexOf
(
".gif"
)
==
-
1
&&
name
.
lastIndexOf
(
".jpg"
)
==
-
1
&&
name
.
lastIndexOf
(
".png"
)
==
-
1
&&
name
.
lastIndexOf
(
".pdf"
)
==
-
1
)
url_str
=
new
String
(
path
+
name
+
".html"
);
else
url_str
=
new
String
(
path
+
name
);
if
(
bookmark
!=
null
)
url_str
+=
"#"
+
bookmark
;
}
System
.
out
.
println
(
"Opening URL: "
+
url_str
);
Intent
browserIntent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
url_str
));
startActivity
(
browserIntent
);
}
boolean
isBaseClassVolume
(
String
vname
)
{
String
v
=
vname
.
toLowerCase
();
if
(
v
.
equals
(
"pwrb"
)
||
v
.
equals
(
"pwrs"
)
||
v
.
equals
(
"nmps"
)
||
v
.
equals
(
"profibus"
)
||
v
.
equals
(
"otherio"
)
||
v
.
equals
(
"opc"
)
||
v
.
equals
(
"basecomponent"
)
||
v
.
equals
(
"abb"
)
||
v
.
equals
(
"siemens"
)
||
v
.
equals
(
"miscellaneous"
)
||
v
.
equals
(
"ssabox"
))
return
true
;
return
false
;
}
String
getLang
()
{
final
int
LANGUAGE_en_US
=
45
;
final
int
LANGUAGE_de_DE
=
31
;
final
int
LANGUAGE_fr_FR
=
76
;
final
int
LANGUAGE_sv_SE
=
119
;
switch
(
lang
)
{
case
LANGUAGE_en_US:
return
new
String
(
"en_us"
);
case
LANGUAGE_de_DE:
return
new
String
(
"de_de"
);
case
LANGUAGE_fr_FR:
return
new
String
(
"fr_fr"
);
case
LANGUAGE_sv_SE:
return
new
String
(
"sv_se"
);
default
:
return
new
String
(
"en_us"
);
}
}
}
java/aapp/res/menu/activity_main.xml
View file @
44814a41
...
...
@@ -70,6 +70,10 @@
android:id=
"@+id/alarmack_option"
android:title=
"Alarm Acknowledge"
android:icon=
"@drawable/xnav_openobject"
/>
<item
android:id=
"@+id/helpclass_option"
android:title=
"Help Class"
android:icon=
"@drawable/xnav_openobject"
/>
<item
android:id=
"@+id/changevalue_option"
android:title=
"Change Value"
/>
...
...
java/jpwr/jopg/src/GrowCtx.java
View file @
44814a41
...
...
@@ -50,6 +50,7 @@ public class GrowCtx implements GrowCtxIfc {
double
node_move_last_y
;
double
slider_cursor_offset
;
boolean
trace_started
=
false
;
boolean
drawing
=
false
;
public
GrowCtx
(
GrowApplIfc
appl
)
{
cmn
=
new
GrowCmn
(
this
,
appl
);
...
...
@@ -366,6 +367,7 @@ public class GrowCtx implements GrowCtxIfc {
}
public
void
draw
()
{
drawing
=
true
;
// Draw background color
// draw.fillRect(0, 0, cmn.mw.window_width, cmn.mw.window_height, background_color);
// Draw connections
...
...
@@ -378,10 +380,14 @@ public class GrowCtx implements GrowCtxIfc {
if
(
((
GlowArrayElem
)
cmn
.
a
.
get
(
i
)).
type
()
!=
Glow
.
eObjectType_Con
)
((
GlowArrayElem
)
cmn
.
a
.
get
(
i
)).
draw
();
}
drawing
=
false
;
}
public
void
draw
(
double
ll_x
,
double
ll_y
,
double
ur_x
,
double
ur_y
)
{
// TODO
if
(
drawing
)
return
;
for
(
int
i
=
0
;
i
<
cmn
.
a
.
size
();
i
++)
{
if
(
((
GlowArrayElem
)
cmn
.
a
.
get
(
i
)).
type
()
==
Glow
.
eObjectType_Con
)
((
GlowArrayElem
)
cmn
.
a
.
get
(
i
)).
draw
();
...
...
java/jpwr/rt/src/Pwrb.java
View file @
44814a41
...
...
@@ -70,6 +70,7 @@ public class Pwrb {
public
static
final
int
cClass_ApDistribute
=
133232
;
public
static
final
int
cClass_AppGraph
=
135960
;
public
static
final
int
cClass_ApplDistribute
=
131208
;
public
static
final
int
cClass_AppLink
=
136000
;
public
static
final
int
cClass_ASup
=
131216
;
public
static
final
int
cClass_Av
=
131224
;
public
static
final
int
cClass_AvArea
=
131232
;
...
...
@@ -318,4 +319,5 @@ public class Pwrb {
public
static
final
int
cClass_WebGraph
=
133472
;
public
static
final
int
cClass_WebLink
=
133480
;
public
static
final
int
cClass_xor
=
133136
;
public
static
final
int
cClass_XttGraph
=
133464
;
}
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