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
8c563245
Commit
8c563245
authored
Sep 19, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetObjectInfoFloatArray and IntArray added
parent
5edb94e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
8 deletions
+99
-8
java/exe/jpwr_rt_gdh/src/jpwr_rt_gdh.c
java/exe/jpwr_rt_gdh/src/jpwr_rt_gdh.c
+83
-3
java/exe/jpwr_rt_gdh/src/jpwr_rt_gdh.h
java/exe/jpwr_rt_gdh/src/jpwr_rt_gdh.h
+16
-5
No files found.
java/exe/jpwr_rt_gdh/src/jpwr_rt_gdh.c
View file @
8c563245
/*
/*
* Proview $Id: jpwr_rt_gdh.c,v 1.1
4 2007-04-26 11:26:16
claes Exp $
* Proview $Id: jpwr_rt_gdh.c,v 1.1
5 2007-09-19 15:08:23
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -876,7 +876,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getParent
...
@@ -876,7 +876,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getParent
"<init>"
,
"(II)V"
);
"<init>"
,
"(II)V"
);
PwrtObjid_getOix
=
(
*
env
)
->
GetMethodID
(
env
,
PwrtObjid_id
,
"getOix"
,
"()I"
);
PwrtObjid_getOix
=
(
*
env
)
->
GetMethodID
(
env
,
PwrtObjid_id
,
"getOix"
,
"()I"
);
PwrtObjid_getVid
=
(
*
env
)
->
GetMethodID
(
env
,
PwrtObjid_id
,
"getVid"
,
"()I"
);
PwrtObjid_getVid
=
(
*
env
)
->
GetMethodID
(
env
,
PwrtObjid_id
,
"getVid"
,
"()I"
);
//printf("PwrtObjid_
xxx
initierade\n");
//printf("PwrtObjid_
yyy
initierade\n");
}
}
objid
.
oix
=
(
*
env
)
->
CallIntMethod
(
env
,
objid_obj
,
PwrtObjid_getOix
);
objid
.
oix
=
(
*
env
)
->
CallIntMethod
(
env
,
objid_obj
,
PwrtObjid_getOix
);
...
@@ -1019,7 +1019,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectClass
...
@@ -1019,7 +1019,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectClass
"<init>"
,
"(II)V"
);
"<init>"
,
"(II)V"
);
pwrtObjid_getOix
=
(
*
env
)
->
GetMethodID
(
env
,
pwrtObjid_id
,
"getOix"
,
"()I"
);
pwrtObjid_getOix
=
(
*
env
)
->
GetMethodID
(
env
,
pwrtObjid_id
,
"getOix"
,
"()I"
);
pwrtObjid_getVid
=
(
*
env
)
->
GetMethodID
(
env
,
pwrtObjid_id
,
"getVid"
,
"()I"
);
pwrtObjid_getVid
=
(
*
env
)
->
GetMethodID
(
env
,
pwrtObjid_id
,
"getVid"
,
"()I"
);
//printf("pwrtObjid_
xxx
initierade\n");
//printf("pwrtObjid_
yyy
initierade\n");
}
}
objid
.
oix
=
(
*
env
)
->
CallIntMethod
(
env
,
objid_obj
,
pwrtObjid_getOix
);
objid
.
oix
=
(
*
env
)
->
CallIntMethod
(
env
,
objid_obj
,
pwrtObjid_getOix
);
...
@@ -1239,6 +1239,46 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectInfoFloat
...
@@ -1239,6 +1239,46 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectInfoFloat
return
return_obj
;
return
return_obj
;
}
}
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoFloatArray
(
JNIEnv
*
env
,
jclass
obj
,
jstring
name
,
jint
size
)
{
int
sts
;
const
char
*
str
;
char
*
cstr
;
jclass
cdhrFloatArray_id
;
jmethodID
cdhrFloatArray_cid
;
jobject
return_obj
;
jint
jsts
;
jfloatArray
jvalue
=
0
;
pwr_tFloat32
*
value
;
char
*
s
;
cdhrFloatArray_id
=
(
*
env
)
->
FindClass
(
env
,
"jpwr/rt/CdhrFloatArray"
);
cdhrFloatArray_cid
=
(
*
env
)
->
GetMethodID
(
env
,
cdhrFloatArray_id
,
"<init>"
,
"([FI)V"
);
str
=
(
*
env
)
->
GetStringUTFChars
(
env
,
name
,
0
);
cstr
=
(
char
*
)
str
;
gdh_ConvertUTFstring
(
cstr
,
cstr
);
if
(
(
s
=
(
char
*
)
strchr
(
cstr
,
'#'
)))
*
s
=
0
;
value
=
(
pwr_tFloat32
*
)
calloc
(
size
,
sizeof
(
pwr_tFloat32
));
sts
=
gdh_GetObjectInfo
(
cstr
,
value
,
size
*
4
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
name
,
cstr
);
jsts
=
(
jint
)
sts
;
if
(
ODD
(
sts
))
{
jvalue
=
(
*
env
)
->
NewFloatArray
(
env
,
size
);
(
*
env
)
->
SetFloatArrayRegion
(
env
,
jvalue
,
0
,
(
int
)
size
,
value
);
}
free
(
value
);
return_obj
=
(
*
env
)
->
NewObject
(
env
,
cdhrFloatArray_id
,
cdhrFloatArray_cid
,
jvalue
,
jsts
);
return
return_obj
;
}
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoInt
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoInt
(
JNIEnv
*
env
,
jclass
obj
,
jstring
name
)
(
JNIEnv
*
env
,
jclass
obj
,
jstring
name
)
{
{
...
@@ -1272,6 +1312,46 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectInfoInt
...
@@ -1272,6 +1312,46 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectInfoInt
return
return_obj
;
return
return_obj
;
}
}
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoIntArray
(
JNIEnv
*
env
,
jclass
obj
,
jstring
name
,
jint
size
)
{
int
sts
;
const
char
*
str
;
char
*
cstr
;
jclass
cdhrIntArray_id
;
jmethodID
cdhrIntArray_cid
;
jobject
return_obj
;
jint
jsts
;
jintArray
jvalue
=
0
;
pwr_tInt32
*
value
;
char
*
s
;
cdhrIntArray_id
=
(
*
env
)
->
FindClass
(
env
,
"jpwr/rt/CdhrIntArray"
);
cdhrIntArray_cid
=
(
*
env
)
->
GetMethodID
(
env
,
cdhrIntArray_id
,
"<init>"
,
"([FI)V"
);
str
=
(
*
env
)
->
GetStringUTFChars
(
env
,
name
,
0
);
cstr
=
(
char
*
)
str
;
gdh_ConvertUTFstring
(
cstr
,
cstr
);
if
(
(
s
=
(
char
*
)
strchr
(
cstr
,
'#'
)))
*
s
=
0
;
value
=
(
pwr_tInt32
*
)
calloc
(
size
,
sizeof
(
pwr_tInt32
));
sts
=
gdh_GetObjectInfo
(
cstr
,
value
,
size
*
4
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
name
,
cstr
);
jsts
=
(
jint
)
sts
;
if
(
ODD
(
sts
))
{
jvalue
=
(
*
env
)
->
NewIntArray
(
env
,
size
);
(
*
env
)
->
SetIntArrayRegion
(
env
,
jvalue
,
0
,
(
int
)
size
,
value
);
}
free
(
value
);
return_obj
=
(
*
env
)
->
NewObject
(
env
,
cdhrIntArray_id
,
cdhrIntArray_cid
,
jvalue
,
jsts
);
return
return_obj
;
}
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoString
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoString
(
JNIEnv
*
env
,
jclass
obj
,
jstring
name
)
(
JNIEnv
*
env
,
jclass
obj
,
jstring
name
)
{
{
...
...
java/exe/jpwr_rt_gdh/src/jpwr_rt_gdh.h
View file @
8c563245
...
@@ -7,11 +7,6 @@
...
@@ -7,11 +7,6 @@
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
/* Inaccessible static: initDone */
/* Inaccessible static: currentSystemGroup */
/* Inaccessible static: currentUser */
/* Inaccessible static: currentPassword */
/* Inaccessible static: currentPrivilege */
/*
/*
* Class: jpwr_rt_Gdh
* Class: jpwr_rt_Gdh
* Method: init
* Method: init
...
@@ -92,6 +87,22 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectInfoString
...
@@ -92,6 +87,22 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectInfoString
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoObjid
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoObjid
(
JNIEnv
*
,
jobject
,
jstring
);
(
JNIEnv
*
,
jobject
,
jstring
);
/*
* Class: jpwr_rt_Gdh
* Method: getObjectInfoFloatArray
* Signature: (Ljava/lang/String;)Ljpwr/rt/CdhrFloatArray;
*/
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoFloatArray
(
JNIEnv
*
,
jobject
,
jstring
,
jint
);
/*
* Class: jpwr_rt_Gdh
* Method: getObjectInfoIntArray
* Signature: (Ljava/lang/String;)Ljpwr/rt/CdhrIntArray;
*/
JNIEXPORT
jobject
JNICALL
Java_jpwr_rt_Gdh_getObjectInfoIntArray
(
JNIEnv
*
,
jobject
,
jstring
,
jint
);
/*
/*
* Class: jpwr_rt_Gdh
* Class: jpwr_rt_Gdh
* Method: toggleObjectInfo
* Method: toggleObjectInfo
...
...
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