Commit 0fee4efd authored by claes's avatar claes

Node index in getNodeObject

parent 08e79f1a
...@@ -1183,7 +1183,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectInfoObjid ...@@ -1183,7 +1183,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectInfoObjid
} }
JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject
(JNIEnv *env, jclass obj) (JNIEnv *env, jclass obj, jint jnix)
{ {
int sts; int sts;
jclass PwrtObjid_id; jclass PwrtObjid_id;
...@@ -1195,6 +1195,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject ...@@ -1195,6 +1195,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject
jint oix, vid; jint oix, vid;
jobject return_obj; jobject return_obj;
jint jsts; jint jsts;
int nix;
cdhrObjid_id = (*env)->FindClass( env, "jpwr/rt/CdhrObjid"); cdhrObjid_id = (*env)->FindClass( env, "jpwr/rt/CdhrObjid");
cdhrObjid_cid = (*env)->GetMethodID( env, cdhrObjid_id, cdhrObjid_cid = (*env)->GetMethodID( env, cdhrObjid_id,
...@@ -1204,7 +1205,8 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject ...@@ -1204,7 +1205,8 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject
PwrtObjid_cid = (*env)->GetMethodID( env, PwrtObjid_id, PwrtObjid_cid = (*env)->GetMethodID( env, PwrtObjid_id,
"<init>", "(II)V"); "<init>", "(II)V");
sts = gdh_GetNodeObject( 0, &objid); nix = jnix;
sts = gdh_GetNodeObject( nix, &objid);
if ( ODD(sts)) if ( ODD(sts))
{ {
oix = (jint) objid.oix; oix = (jint) objid.oix;
......
...@@ -266,7 +266,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_classIdToObjid ...@@ -266,7 +266,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_classIdToObjid
* Signature: ()Ljpwr/rt/CdhrObjid; * Signature: ()Ljpwr/rt/CdhrObjid;
*/ */
JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject
(JNIEnv *, jobject); (JNIEnv *, jobject, jint);
/* /*
* Class: jpwr_rt_Gdh * Class: jpwr_rt_Gdh
......
...@@ -296,7 +296,7 @@ public class Gdh { ...@@ -296,7 +296,7 @@ public class Gdh {
public native CdhrClassId getObjectClass( PwrtObjid objid); public native CdhrClassId getObjectClass( PwrtObjid objid);
public native CdhrObjid getClassList( int classid); public native CdhrObjid getClassList( int classid);
public native CdhrObjid classIdToObjid( int classid); public native CdhrObjid classIdToObjid( int classid);
public native CdhrObjid getNodeObject(); public native CdhrObjid getNodeObject( int nodeIdx);
public native GdhrGetAttributeChar getAttributeChar( String attributeName); public native GdhrGetAttributeChar getAttributeChar( String attributeName);
public native CdhrObjAttr getClassAttribute( int classid, PwrtObjid objid_obj ); public native CdhrObjAttr getClassAttribute( int classid, PwrtObjid objid_obj );
public static native String translateFilename( String filename); public static native String translateFilename( String filename);
......
...@@ -1201,7 +1201,9 @@ public class GdhServer ...@@ -1201,7 +1201,9 @@ public class GdhServer
case GET_NODE_OBJECT: case GET_NODE_OBJECT:
try try
{ {
CdhrObjid ret = gdh.getNodeObject(); int nix = in.readInt();
CdhrObjid ret = gdh.getNodeObject( nix);
out.writeInt(ret.getSts()); out.writeInt(ret.getSts());
out.flush(); out.flush();
if(ret.oddSts()) if(ret.oddSts())
......
...@@ -1345,11 +1345,12 @@ public class Gdh ...@@ -1345,11 +1345,12 @@ public class Gdh
} }
public CdhrObjid getNodeObject() public CdhrObjid getNodeObject( int nodeIdx)
{ {
try try
{ {
out.writeInt(GET_NODE_OBJECT); out.writeInt(GET_NODE_OBJECT);
out.writeInt(nodeIdx);
out.flush(); out.flush();
int sts = in.readInt(); int sts = in.readInt();
if(sts % 2 == 0) if(sts % 2 == 0)
......
...@@ -296,7 +296,7 @@ public class Gdh { ...@@ -296,7 +296,7 @@ public class Gdh {
public native CdhrClassId getObjectClass( PwrtObjid objid); public native CdhrClassId getObjectClass( PwrtObjid objid);
public native CdhrObjid getClassList( int classid); public native CdhrObjid getClassList( int classid);
public native CdhrObjid classIdToObjid( int classid); public native CdhrObjid classIdToObjid( int classid);
public native CdhrObjid getNodeObject(); public native CdhrObjid getNodeObject( int nodeIdx);
public native GdhrGetAttributeChar getAttributeChar( String attributeName); public native GdhrGetAttributeChar getAttributeChar( String attributeName);
public native CdhrObjAttr getClassAttribute( int classid, PwrtObjid objid_obj ); public native CdhrObjAttr getClassAttribute( int classid, PwrtObjid objid_obj );
public static native String translateFilename( String filename); public static native String translateFilename( String filename);
......
...@@ -1201,7 +1201,9 @@ public class GdhServer ...@@ -1201,7 +1201,9 @@ public class GdhServer
case GET_NODE_OBJECT: case GET_NODE_OBJECT:
try try
{ {
CdhrObjid ret = gdh.getNodeObject(); int nix = in.readInt();
CdhrObjid ret = gdh.getNodeObject( nix);
out.writeInt(ret.getSts()); out.writeInt(ret.getSts());
out.flush(); out.flush();
if(ret.oddSts()) if(ret.oddSts())
......
...@@ -1345,11 +1345,12 @@ public class Gdh ...@@ -1345,11 +1345,12 @@ public class Gdh
} }
public CdhrObjid getNodeObject() public CdhrObjid getNodeObject( int nodeIdx)
{ {
try try
{ {
out.writeInt(GET_NODE_OBJECT); out.writeInt(GET_NODE_OBJECT);
out.writeInt(nodeIdx);
out.flush(); out.flush();
int sts = in.readInt(); int sts = in.readInt();
if(sts % 2 == 0) if(sts % 2 == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment