My problem is that after creating the header file in...
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Pallab_Bose
Posted On:   Friday, March 9, 2001 05:48 PM

My problem is that after creating the header file in jdk1.3 i could not create the .dll files in vc++. Where can i get information about the proper compiler switches?

L2CP project,complex data structures Implementation in Java/JNI/C++ dlls.

Posted By:   sdfsf_dsfsdf  
Posted On:   Thursday, March 19, 2009 02:24 AM

Dear All,

Please kindly help me reg Software development Project:-L2 Common Platform-France in Java.Technologies:-Java/JNI/C++ dlls.

BasicInfo.h,DefStruct.h,jni.h,Wrapper.h,WSSC_T_NEXTPASSREF.h

How to implement complex data structures in JNI.

extern "C" _declspec(dllexport)WORD sscAppAdapt(SSCAPP_T_CONN *pProject ,/* Input */
SSC_T_COIL *pCoil , /* Input */
SSC_T_STANDROLLS *pRolls , /* Input */
SSC_T_PRODENV *pEnv , /* Input */
SSC_T_INTERV *pOper , /* Input */
SSC_T_SETUP *pSetup , /* Input */
SSCAPP_T_MEASPACK *pMeas , /* Input */
SSC_T_NEXTPASSREF *pNextPassRef, // output
INT32 *pStatus); //output

SSCAPP_T_CONN, SSC_T_Coil etc...are Strctures calling another Structues....
--------------------------------------------------------------
JNI Code......



JNIEXPORT int JNICALL Java_sscdbutils_Main_sscAppAdapt
(JNIEnv *env, jobject obj, jobject pProject1,jobject pCoil1,jobject pRolls1,jobject pEnv1,jobject pOper1,jobject pSetup1,jobject pMeas1,jobject pNextPassRef1, jint pStatus1)


{
//WSSC_T_NEXTPASSREF* ssctnextconn;
////TO DO...jobject pProject1 object Jni to Java mapping...jobject pProject1
char *pszDsnName = (char*)env->GetStringUTFChars(pszDsnName1, 0);
//SSCAPP_T_CONN *pProject = env->GetObjectClass(pProject1,0);
jclass clazz1;
clazz1 = env->GetObjectClass(pProject1);

// jfieldID fid1, fid2;
//jfloat scale;
//jstring name;
jint henv;
jint hdbc;
jint UserID;
jint ProjectID;
jint MillType;
jint BandType;
jint AutoAlloy;
jobject Units;
//public SSCDB_T_UNITS Units;
jint NbCharClass;

jfieldID henvId;
jfieldID hdbcId;
jfieldID UserId;
jfieldID ProjectId;
jfieldID MillTypeId;
jfieldID BandTypeId;
jfieldID AutoAlloyId;
//public SSCDB_T_UNITS Units;
jfieldID NbCharClassId;

henvId = env->GetFieldID(class1, "henv", "I");
hdbcId = env->GetFieldID(class1, "hdbc", "I");
UserId = env->GetFieldID(class1, "UserID", "I");
ProjectId = env->GetFieldID(class1, "ProjectID", "I");
MillTypeId = env->GetFieldID(class1, "MillType", "I");
BandTypeId = env->GetFieldID(class1, "BandType", "I");
AutoAlloyId = env->GetFieldID(class1, "AutoAlloy", "I");
//public SSCDB_T_UNITS Units;
NbCharClassId = env->GetFieldID(class1, "NbCharClass", "I");


//2nd argument SSC_T_COIL structure.....
jclass clazz2;
clazz2 = env->GetObjectClass(pCoil1);

jstring CoilName;
jstring MetalGrade;
jfloat AnnealedGauge;
jfloat InputGauge;
jfloat StripWidth;
jint NbOfExitCoils;
jfloatArray OutputGauge;
jfloatArray OutputWeight;
jint RollingStrat;
jint NbOfPasses;
jint LoadingPlace;
jfloat StripTemp;
jfloat StripCrown;
jfloat EdgeDepression;
jfloat TargetCrown;
jfloat TargetFlatnessAmp;
jint TargetFlatnessNum;
jint SleeveUsed;
jfloat SleeveDiam;
jfloatArray YSCoef;
jint IndicSpBandLR;
jfloatArray Spares;

jfieldID CoilNameId;
jfieldID MetalGradeId;
jfieldID AnnealedGaugeId;
jfieldID InputGaugeId;
jfieldID StripWidthId;
jfieldID NbOfExitCoilsId;
jfieldID OutputGaugeId;
jfieldID OutputWeightId;
jfieldID RollingStratId;
jfieldID NbOfPassesId;
jfieldID LoadingPlaceId;
jfieldID StripTempId;
jfieldID StripCrownId;
jfieldID EdgeDepressionId;
jfieldID TargetCrownId;
jfieldID TargetFlatnessAmpId;
jfieldID TargetFlatnessNumId;
jfieldID SleeveUsedId;
jfieldID SleeveDiamId;
jfieldID YSCoefId;
jfieldID IndicSpBandLRId;
jfieldID Spares;

CoilNameId = env->GetFieldID(class1, "CoilName", "Ljava/lang/String;");
MetalGradeId = env->GetFieldID(class1, "MetalGrade", "Ljava/lang/String;");
AnnealedGaugeId = env->GetFieldID(class1, "AnnealedGauge", "F");
InputGaugeId = env->GetFieldID(class1, "InputGauge", "F");
StripWidthId = env->GetFieldID(class1, "StripWidth", "F");
NbOfExitCoilsId = env->GetFieldID(class1, "NbOfExitCoils", "I");
//OutputGaugeId = env->GetFieldID(class1, "OutputGauge", "I");
//OutputWeightId = env->GetFieldID(class1, "OutputWeight", "I");
RollingStratId = env->GetFieldID(class1, "RollingStrat", "I");
NbOfPassesId = env->GetFieldID(class1, "NbOfPasses", "I");
LoadingPlaceId = env->GetFieldID(class1, "LoadingPlace", "I");
StripTempId = env->GetFieldID(class1, "StripTemp", "F");
StripCrownId = env->GetFieldID(class1, "StripCrown", "F");
EdgeDepressionId = env->GetFieldID(class1, "EdgeDepression", "F");
TargetCrownId = env->GetFieldID(class1, "TargetCrown", "F");
TargetFlatnessAmpId = env->GetFieldID(class1, "TargetFlatnessAmp", "I");
TargetFlatnessNumId = env->GetFieldID(class1, "TargetFlatnessNum", "I");
SleeveUsedId = env->GetFieldID(class1, "SleeveUsed", "I");
SleeveDiamId = env->GetFieldID(class1, "SleeveDiam", "F");
YSCoefId = env->GetFieldID(class1, "YSCoef", "I");
IndicSpBandLRId = env->GetFieldID(class1, "IndicSpBandLR", "I");
SparesId = env->GetFieldID(class1, "Spares", "I");



//jobject pProject1,jobject pCoil1,jobject pRolls1,jobject pEnv1,jobject pOper1,jobject pSetup1,jobject pMeas1
//SSC_T_COIL *pCoil = env->GetObjectClass();


//SSC_T_STANDROLLS *pRolls = env->GetObjectClass();
jclass clazz3;
clazz3 = env->GetObjectClass(pRolls1);

//SSC_T_PRODENV *pEnv = env->GetObjectClass();
jclass clazz4;
clazz4 = env->GetObjectClass(pEnv1);

//SSC_T_INTERV *pOper = env->GetObjectClass();
jclass clazz5;
clazz5 = env->GetObjectClass(pOper1);

//SSC_T_SETUP pSetup1,
//jobject pSetup1
jclass clazz6;
clazz6 = env->GetObjectClass(pSetup1);

//SSCAPP_T_MEASPACK pMeas1
//jobject pMeas1
jclass clazz7;
clazz7 = env->GetObjectClass(pMeas1);


//SSC_T_STANDROLLS *pRolls = env->
//SSC_T_PRODENV *pEnv
//SSC_T_INTERV *pOper
//SSC_T_SETUP *pSetup
//SSCAPP_T_MEASPACK *pMeas

//public struct SSCAPP_T_CONN
// {
// public int henv;
// public int hdbc;
// public int UserID;
// public int ProjectID;
// public int MillType;
// public int BandType;
// public int AutoAlloy;
// public SSCDB_T_UNITS Units;
// public int NbCharClass;

// };
//TO DO jobject pCoil1 ....
//SSC_T_COIL *ssctcoil

// TO DO pRolls1...

//jfieldID fid1, fid2,fid3,fid4,fid5,fid6,fid7,fid8,fid9

/*pProject = env->
pCoil = env->
pRolls = env->
pEnv = env->
pOper = env->
pSetup = env->
pMeas = env->

jclass class1;
class1 = env->GetObjectClass(gssctworkroll);



char *pszDsnName = (char*)env->GetStringUTFChars(pszDsnName1, 0);
char *pszUserName = (char*)env->GetStringUTFChars(pszUserName1, 0);
char *pszPassword = (char*)env->GetStringUTFChars(pszPassword1, 0);
char *pszProjectName = (char*)env->GetStringUTFChars(pszProjectName1, 0);*/

//SSCAPP_T_CONN sscap; //output.
SSC_T_NEXTPASSREF ssctn; //output.

SSCAPP_T_CONN conn; //input
WSSCAPP_T_CONN con; //wrapper file..
con.setInfo(&ts1, env, &conn);
con.SetDefaultValuesFromObject();

SSC_T_COIL ssctcoil; //input.
WSSC_T_COIL ssctcoill;
ssctcoill.setInfo(&pCoil1, env, &ssctcoil);
ssctcoill.SetDefaultValuesFromObject();

//SSC_T_STANDROLLS rolls.... //input

SSC_T_PRODENV ssctprodenv; //input
WSSC_T_PRODENV ssctprodenvv; //
ssctprodenvv.setInfo(&pEnv1, env, &ssctprodenv);
ssctprodenvv.SetDefaultValuesFromObject();

SSC_T_INTERV unitStr1; //input
WSSC_T_INTERV unitStrr1;

SSC_T_SETUP ssctsetup; //input
WSSC_T_SETUP ssctsetupp;

SSCAPP_T_MEASPACK sscapptmeaspack; //input
WSSCAPP_T_MEASPACK sscapptmeaspackk;

//jint 100 //output...

//SSCAPP_T_CONN sscap; //output.

//SSCAPP_T_CONN //input SSCAPP_T_CONN* conn;
//SSC_T_COIL //input
//SSC_T_STANDROLLS //input
//SSC_T_PRODENV //input
//SSC_T_INTERV //input
//SSC_T_SETUP //input
//SSCAPP_T_MEASPACK //input

//SSC_T_NEXTPASSREF //output file.
//int pStatus1 //output
//SSC_T_NEXTPASSREF *ssctnextpassref;

WSSC_T_NEXTPASSREF ssctnextpassreff; //1st
SSC_T_NEXTPASSREF ssctnextpassref;
ssctnextpassreff.setInfo(&pNextPassRef1, env, &ssctnextpassref);
ssctnextpassreff.SetDefaultValuesFromObject();
//pStatus1 2nd output.

//printf("
check inputs %s", conn.Units.density.name);
//strcat_s(conn.Units.density.name, " Lady of Health");
HINSTANCE hGetProcIDDLL = LoadLibrary("C:\Demo\deepan\sscDbUtils\Debug\sscDbUtils.dll") ;
FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),"sscAppAdapt");
typedef WORD (__stdcall * pICFUNC)(SSCAPP_T_CONN *pProject,SSC_T_COIL *pCoil,SSC_T_STANDROLLS *pRolls,SSC_T_PRODENV *pEnv,SSC_T_INTERV *pOper,SSC_T_SETUP *pSetup,SSCAPP_T_MEASPACK *pMeas,SSC_T_NEXTPASSREF *pNextPassRef,int *pStatus);//CHAR *pszDsnName, CHAR *pszUserName, CHAR *pszPassword, CHAR *pszProjectName, SSCAPP_T_CONN *pProject);
pICFUNC sscAppAdapt;
sscAppAdapt = pICFUNC(lpfnGetProcessID);
DWORD ret = sscAppAdapt(pProject,pCoil,pRolls,pEnv,pOper,pSetup,pMeas,pNextPassRef,&ssctnextpassref,pStatus);
ssctnextpassreff.SetDefaultValuesToObject(); //1 output.
//pStatus 2 output.
return 1;
}
-------------------

Java side code:---

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package SscAppAdapt;

/**
*
* @author mg.rajendraprasad
*/
public class Main {


static {

System.load("C:\Demo\deepan\CPP\JNIsscDbUtils\debug\JNIsscDbUtils.dll");
//C:DemodeepanCPPJNIsscDbUtilsdebug....
//TO DO need dll existing dll or new one created....//"C:\Demo\deepan\CPP\JNIsscDbUtils\debug\JNIsscDbUtils.dll"

}


/**
* @param args the command line arguments
*/
public static void main(String[] args) {
//System.out.println("SSCAppAdapt");
callsscAppAdapt();
}

//private native int sscAppAdapt(String pszDsnName1, String pszUserName1, String pszPassword1, String pszProjectName1, SSCAPP_T_CONN ts1);
private native int sscAppAdapt(SSCAPP_T_CONN pProject1,SSC_T_COIL pCoil1,SSC_T_STANDROLLS pRolls1,SSC_T_PRODENV pEnv1,SSC_T_INTERV pOper1,SSC_T_SETUP pSetup1,SSCAPP_T_MEASPACK pMeas1,SSC_T_NEXTPASSREF pNextPassRef1,int pStatus1);//INT32(int)last argument...
//private native void sscAppAdapt(SSCAPP_T_CONN pProject1,SSC_T_COIL pCoil1,SSC_T_STANDROLLS pRolls1,SSC_T_PRODENV pEnv1,SSC_T_INTERV pOper1,SSC_T_SETUP pSetup1,SSCAPP_T_MEASPACK pMeas1,SSC_T_NEXTPASSREF pNextPassRef1,int pStatus1);//INT32(int)last argument...
//SSCAPP_T_CONN *pProject,SSC_T_COIL *pCoil,SSC_T_STANDROLLS *pRolls,SSC_T_PRODENV *pEnv,SSC_T_INTERV *pOper,SSC_T_SETUP *pSetup,SSCAPP_T_MEASPACK *pMeas,SSC_T_NEXTPASSREF *pNextPassRef,INT32 *pStatus
public static void callsscAppAdapt()
{
//String pszDsnName1 = "from application1"; /* Input */
//String pszUserName1 = "from application2"; /* Input */
//String pszPassword1 = "from application3"; /* Input */
//String pszProjectName1 = "from application4"; /* Input */
//long ssinit;


SSCAPP_T_CONN pProject1 = new SSCAPP_T_CONN(); //1st Argument...
pProject1.henv = 1;
pProject1.hdbc = 2;
pProject1.UserID = 3;
pProject1.ProjectID = 4;
pProject1.MillType = 5;
pProject1.BandType = 6;
pProject1.AutoAlloy = 7;
pProject1.Units.length.scale = 5.6f;
pProject1.Units.length.name = "St.";
pProject1.Units.width.scale = 5.6f;
pProject1.Units.roll_diameter.scale = 5.6f;
pProject1.Units.gauge.scale = 5.6f;
pProject1.Units.strip_speed.scale = 5.6f;
pProject1.Units.roll_speed.scale = 5.6f;
pProject1.Units.tension_stress.scale = 5.6f;
pProject1.Units.tension.scale = 5.6f;
pProject1.Units.bite_stress.scale = 5.6f;
pProject1.Units.force.scale = 5.6f;
pProject1.Units.crown.scale = 5.6f;
pProject1.Units.power.scale = 5.6f;
pProject1.Units.torque.scale = 5.6f;
pProject1.Units.lub_flow.scale = 5.6f;
pProject1.Units.temp_zero.scale = 5.6f;
pProject1.Units.time.scale = 5.6f;
pProject1.Units.angle.scale = 5.6f;
pProject1.Units.weight.scale = 5.6f;
pProject1.Units.flatness.scale = 5.6f;
pProject1.Units.density.scale = 5.6f;
pProject1.Units.density.name = "Velamkanni Matha";
pProject1.NbCharClass = 8;

SSC_T_COIL pCoil1 = new SSC_T_COIL(); //2nd Argument....
pCoil1.CoilName ="metal gage";
pCoil1.AnnealedGauge = 4.6f;
pCoil1.InputGauge = 4.6f;
pCoil1.StripWidth = 4.6f;
pCoil1.NbOfExitCoils = 1;
pCoil1.OutputGauge[0] = 4.6f;
pCoil1.OutputWeight[0] = 4.6f;
pCoil1.RollingStrat = 10;
pCoil1.NbOfPasses = 10;
pCoil1.LoadingPlace = 10;
pCoil1.StripTemp = 4.6f;
pCoil1.StripCrown = 4.6f;
pCoil1.EdgeDepression = 4.6f;
pCoil1.TargetCrown = 4.6f;
pCoil1.TargetFlatnessAmp = 4.6f;
pCoil1.TargetFlatnessNum = 10;
pCoil1.SleeveUsed = 10;
pCoil1.SleeveDiam = 4.6f;
pCoil1.YSCoef[0] = 4.6f;
pCoil1.YSCoef[1] = 2.0f;
pCoil1.YSCoef[2] = 3.0f;
pCoil1.YSCoef[3] = 4.0f;

SSC_T_STANDROLLS pRolls1 = new SSC_T_STANDROLLS(); //3rd Argument....
//TO DO from several structures....i.e from application..
//pRolls1.

SSC_T_PRODENV pEnv1 = new SSC_T_PRODENV(); //SSC_T_PRODENV pEnv1 4th Argument...
pEnv1.AmbientTemp = 1.0f;
pEnv1.LubricantTemp = 1.0f;
pEnv1.NbOfContinuousCoils = 450;
pEnv1.FlagWinding = 600;
pEnv1.FlagCoilHandling = 700;
pEnv1.FlagOppositeSide = 800;
pEnv1.FlagSameSide = 900;
pEnv1.FlagAscendingOrder = 1000;
pEnv1.FlagDescendingOrder = 1001;

SSC_T_INTERV pOper1 = new SSC_T_INTERV(); //5th Argument....
//TO DO from Application....
//pOper1.NbOfPasses = 100;


SSC_T_SETUP pSetup1 = new SSC_T_SETUP();//6th Arguement...
//TO DO from Application....
//pSetup1.

SSCAPP_T_MEASPACK pMeas1 = new SSCAPP_T_MEASPACK(); //7th Argument...
pMeas1.CoilName = "from application";
pMeas1.PassNum = 100;
pMeas1.StartNewCoilFlag = 100;
pMeas1.NextPassRefFlag = 100;
pMeas1.EndOfCoilFlag = 100;
pMeas1.ShiftOKFlag = 100;
pMeas1.RollForce = 10.0f;
pMeas1.RollTorque = 10.0f;
pMeas1.TensionIn = 10.0f;
pMeas1.TensionOut = 10.0f;
pMeas1.GaugeIn = 10.0f;
pMeas1.GaugeOut = 10.0f;
pMeas1.StripSpeed = 10.0f;
pMeas1.Bending = 10.0f;
pMeas1.BendingTrim = 10.0f;
pMeas1.UppTRPosition = 10.0f;
pMeas1.LowTRPosition = 10.0f;
pMeas1.UnCoilerTemp = 10.0f;
pMeas1.StripTemp = 10.0f;
pMeas1.LubricantTemp = 10.0f;
pMeas1.DirtyLubricantTemp = 10.0f;
pMeas1.EELubFlow = 10.0f;
pMeas1.EILubFlow = 10.0f;
pMeas1.XILubFlow = 10.0f;
pMeas1.XELubFlow = 10.0f;
pMeas1.ScrewDown = 10.0f;
pMeas1.Slip = 10.0f;

SSC_T_NEXTPASSREF pNextPassRef1 = new SSC_T_NEXTPASSREF(); //8th Argument...
pNextPassRef1.CoilName = "from application";
pNextPassRef1.NextPassNum = 1;
pNextPassRef1.ErrCode = 2;
pNextPassRef1.WrnCode = 3;
pNextPassRef1.GaugeIn = 6.6f;
pNextPassRef1.GaugeOut = 6.2f;
pNextPassRef1.Red = 7.12f;
pNextPassRef1.RollForce = 8.80f;
pNextPassRef1.AdpRollForce = 9.80f;
pNextPassRef1.MaxForce = 10.0f;
pNextPassRef1.RollTorque = 12.0f;
pNextPassRef1.RollPower = 13.0f;
pNextPassRef1.TensionIn = 14.2f;
pNextPassRef1.TensionOut = 15.4f;
pNextPassRef1.StressIn = 16.79f;
pNextPassRef1.StressOut = 17.91f;
pNextPassRef1.StripSpeed = 18.00f;
pNextPassRef1.RollWeight = 19.00f;
pNextPassRef1.StripTemp = 20.50f;
pNextPassRef1.Bending = 21.00f;
pNextPassRef1.UppTRPosition = 22.79f;
pNextPassRef1.LowTRPosition = 23.79f;
pNextPassRef1.EELubFlow = 25.00f; //= 26.00
pNextPassRef1.EILubFlow = 26.00f;
pNextPassRef1.XILubFlow = 27.00f;
pNextPassRef1.XELubFlow = 28.00f;

int pStatus1 = 100;

long ssinit;
//pStatus1
ssinit = new Main().sscAppAdapt(pProject1,pCoil1, pRolls1, pEnv1, pOper1,pSetup1,pMeas1,pNextPassRef1,pStatus1);

System.out.println(pProject1.Units.density.name);
}
}
class SSCDB_T_UDEF
{
float scale; /* Conversion factor .............. */
String name;
SSCDB_T_UDEF()
{
scale = 13.13f;
name = "St.";
}
/* Units label .................... */
} ;

class SSCDB_T_UNITS
{
SSCDB_T_UDEF length; /* Distance along mill ...... mm */
SSCDB_T_UDEF width; /* Across the mill .......... mm */
SSCDB_T_UDEF roll_diameter; /* Roll diameters ........... mm */
SSCDB_T_UDEF gauge; /* Strip thickness .......... mm */
SSCDB_T_UDEF strip_speed; /* Linear strip speed ....... m/mn */
SSCDB_T_UDEF roll_speed; /* Angular roll speed ....... tr/mn */
SSCDB_T_UDEF tension_stress; /* Tension stress ........... kg/mm²*/
SSCDB_T_UDEF tension; /* Tension .................. T */
SSCDB_T_UDEF bite_stress; /* Yield stress ............. kg/mm²*/
SSCDB_T_UDEF force; /* Force .................... T */
SSCDB_T_UDEF crown; /* Roll, strip crown ........ µm */
SSCDB_T_UDEF power; /* Roll or motor power ...... kW */
SSCDB_T_UDEF torque; /* Torque ................... kNm */
SSCDB_T_UDEF lub_flow; /* Lubricant flows .......... l/mn */
SSCDB_T_UDEF temp_zero; /* Zero temperature scale ... °C */
SSCDB_T_UDEF time; /* Rolling times ............ s */
SSCDB_T_UDEF angle; /* Angles ................... rad */
SSCDB_T_UDEF weight; /* Weight ................... T */
SSCDB_T_UDEF flatness; /* Flatness ................. IU */
SSCDB_T_UDEF density; /* Density of steel ......... kg/m^3 */

SSCDB_T_UNITS()
{
length = new SSCDB_T_UDEF();
width = new SSCDB_T_UDEF();
roll_diameter = new SSCDB_T_UDEF();
gauge = new SSCDB_T_UDEF();
strip_speed = new SSCDB_T_UDEF();
roll_speed = new SSCDB_T_UDEF();
tension_stress = new SSCDB_T_UDEF();
tension = new SSCDB_T_UDEF();
bite_stress = new SSCDB_T_UDEF();
force = new SSCDB_T_UDEF();
crown = new SSCDB_T_UDEF();
power = new SSCDB_T_UDEF();
torque = new SSCDB_T_UDEF();
lub_flow = new SSCDB_T_UDEF();
temp_zero = new SSCDB_T_UDEF();
time = new SSCDB_T_UDEF();
angle = new SSCDB_T_UDEF();
weight = new SSCDB_T_UDEF();
flatness = new SSCDB_T_UDEF();
density = new SSCDB_T_UDEF();
}
};

class SSCAPP_T_CONN
{
int henv ;
int hdbc ;
int UserID;
int ProjectID;
int MillType;
int BandType;
int AutoAlloy;
SSCDB_T_UNITS Units;
int NbCharClass;
SSCAPP_T_CONN()
{
Units = new SSCDB_T_UNITS();
}
} ;

class SSC_T_COIL{

//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)] //SSC_K_MAXCHAR
String CoilName; /* Coil name - */
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String MetalGrade; /* Metal grade - */

float AnnealedGauge; /* Annealing exit gauge mm */
float InputGauge; /* Input band gauge mm */
float StripWidth; /* Strip width mm */
int NbOfExitCoils; /* Number of exit coils - */

//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXCOIL)]
float[] OutputGauge; /* Coils exit gauges mm */

//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXCOIL)]
float[] OutputWeight; /* Coils exit weight t */
int RollingStrat; /* Rollin strategy: - */

/* = 2: Force pattern */
int NbOfPasses; /* Number of passes (Option) */
int LoadingPlace; /* Loading place: - */
/* = 0: 1st pass uncoiler */
/* = 1: Left hand uncoiler */
/* = 2: Rigth hand uncoiler */
float StripTemp; /* Strip temperature °C */
float StripCrown; /* Entry strip crown µm */
float EdgeDepression; /* Edge depression µm */
float TargetCrown; /* Target strip crown µm */
float TargetFlatnessAmp; /* Exit target flatness IU */
/* < 0: edge wave */
/* > 0: full center */
int TargetFlatnessNum; /* Target curve number - */
int SleeveUsed; /* Sleeve used flag - */
float SleeveDiam; /* Sleeve diameter mm */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXYSCOEF)]//SSC_K_MAXYSCOEF
float[] YSCoef; /* Customer yield stress curve */
int IndicSpBandLR; /* Indicate the splitted band side is on operator side (0) or motor side (1) - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]*/
float[] Spares;
};
//3rd argument....
class SSC_T_STANDROLLS {

SSC_T_WORKROLLS Work; /* Work rolls */
SSC_T_TAPERROLLS Taper; /* Taper rolls */
SSC_T_SINTERROLLS Inter; /* 2nd inter rolls */
SSC_T_BACKUPROLLS Backup; /* Backup rolls */

class SSC_T_WORKROLLS{
float Diam; /* Roll diameter mm */
float Crown; /* Roll crown µm */
float YoungMod; /* Roll young modulus kg/mm² */
float PoissonR; /* Roll Poisson ratio - */
float LenRoll; /* Length rolled with work roll km */
int SurfType; /* Work roll surface type 0 Bright */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
float[] Spares;
}
class SSC_T_TAPERROLLS{
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String TRSetName;
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_TR)]
SSC_T_TAPERROLL[] roll;
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
float[] Spares;

class SSC_T_TAPERROLL{

float Diam; /* Roll diameter mm */
float Crown; /* Roll crown µm */
float YoungMod; /* Roll young modulus kg/mm² */
float PoissonR; /* Roll Poisson ratio - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXSLOPES)]
float[] Slope; /* Taper roll slope %% */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXSLOPES)]
float[] SlopeLength; /* Taper roll slope length mm */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
float[] Spares;
}
}

class SSC_T_SINTERROLLS{

//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String SRSetName;
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_2IR)]
SSC_T_ROLL[] roll;
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
float[] Spares;
class SSC_T_ROLL{
float Diam; /* Roll diameter mm */
float Crown; /* Roll crown µm */
float YoungMod; /* Roll young modulus kg/mm² */
float PoissonR; /* Roll Poisson ratio - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
float[] Spares; /* Units label .................... */

}

}
class SSC_T_BACKUPROLLS{
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String BRSetName;
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_BR)]
SSC_T_ROLL[] roll;
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
float[] Spares;
class SSC_T_ROLL{
float Diam; /* Roll diameter mm */
float Crown; /* Roll crown µm */
float YoungMod; /* Roll young modulus kg/mm² */
float PoissonR; /* Roll Poisson ratio - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
float[] Spares;

}
}
};// 3rd argument...completed.//}

//4th Argument....SSC_T_PRODENV pEnv1.
class SSC_T_PRODENV{

//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String EnvDataName; /* Environment name - */
float AmbientTemp; /* Ambient temperature °C */
float LubricantTemp; /* Lubricant temperature °C */
int NbOfContinuousCoils; /* Flag: continuous exit coils */
int FlagMotors; /* Nb of stand motors - */
int FlagWinding; /* Flag: authorised winding */
int FlagCoilHandling; /* Flag: authorised coil handling */
int FlagOppositeSide; /* Flag: exit on opposite side of */
/* coil loading */
int FlagSameSide; /* Flag: exit on same side */
int FlagAscendingOrder; /* Flag: ascending gauge order */
int FlagDescendingOrder; /* Flag: descending gauge order */
// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
float[] Spares;
};

//5th Argument SSC_T_INTERV
class SSC_T_INTERV{
//[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String OpIntervName; /* Intervention name*/
int NbOfPasses; /* Number of passes */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXPASS)]//SSC_K_MAXPASS
//public SSC_T_PASSINTERV[] Pass; /* Pass intervention*/

}
//6th Argument SSC_T_SETUP....
class SSC_T_SETUP{
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String SetupName; /* Coil number + date - */
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String CoilName; /* Coil number - */
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String WRName; /* Work rolls set - */
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String TRName; /* Taper rolls set - */
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String SRName; /* Inter rolls set - */
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String BRName; /* Backup rolls set - */
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String EnvName; /* Environment set - */
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String IntervName; /* Intervention set - */
//[MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String MetalGrade; /* Metal grade - */

float StripWidth; /* Strip width mm */
SSC_T_REF Refs; /* Setup references - */
SSC_T_INFO Info; /* Setup information - */
SSC_T_SENSIT Sensit; /* Flatness densitivities */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
float[] Spares;

class SSC_T_REF{
int nbOfPasses; /* Total number of passes - */
int errCode; /* Error code - */
int WrnCode; /* Warning code - */
float RollTime; /* Total rolling time s */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXCOIL)]//SSC_K_MAXCOIL
int[] CoilPasses; /* Number of passes per coil - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXPASS)]//SSC_K_MAXPASS
SSC_T_PASSREF[] Pass;
class SSC_T_PASSREF{
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXCOIL)]//SSC_K_MAXCOIL
int[] PassNum; /* Pass number in the coil - */
float GaugeIn; /* Pass input gauge mm */
float GaugeOut; /* Pass output gauge mm */
float Red; /* Pass reduction % */
float RollForce; /* Roll force T */
float MaxForce; /* Maximum roll force T */
float RollTorque; /* Roll torque kNm */
float RollPower; /* Stand roll power kW */
float TensionIn; /* Pass input tension T */
float TensionOut; /* Pass output tension T */
float StressIn; /* Input tension stress kg/mm² */
float StressOut; /* Output tension stress kg/mm² */
float StripSpeed; /* Strip speed m/mn */
float RollWeight; /* Rolled weight T */
float CoilerTemp; /* Coiler temperature °C */
float Bending; /* Bending T */
float BendGain; /* Bending gain - */
float UppTRPosition; /* Upper taper roll position mm */
float LowTRPosition; /* Lower taper roll position mm */
float UppTROverlap; /* Upper taper roll overlap (tabulation) mm */
float LowTROverlap; /* Lower taper roll overlap (tabulation) mm */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXSADDLES)]//SSC_K_MAXCOIL
float[] AsURPosition; /* As-U-Rolls positions - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXSADDLES)]//SSC_K_MAXCOIL
float[] AsURPosTabDN; /* As-U-Rolls positions (tabulation) % */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXSADDLES)]//SSC_K_MAXCOIL
float[] AsURPosTabUP; /* As-U-Rolls positions (tabulation) % */
float Slip; /* Slip - */
float Gap; /* Gap mm */
float EELubFlow; /* Entry external lub. flow l/mn */
float EILubFlow; /* Entry internal lub. flow l/mn */
float XILubFlow; /* Exit internal lub. flow l/mn */
float XELubFlow; /* Exit external lub. flow l/mn */
int ChgRollDirection; /* Change rolling direction - */
int StopOnWeight; /* Stop en weight - */
int EndPassCut; /* Cut at the end of pass - */
int CoilLastPass; /* Last pass of a coil - */
int CoilExit; /* Exit finished coil - */
int InputCoilExit; /* Input coil exit - */
int InputCoilLoading; /* Input coil loading - */
int WindingPass; /* Winding pass - */
float LSRForce; /* roll force at stick speed T */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
float[] Spares;
}//SSC_T_PASSREF
}//SSC_T_REF

class SSC_T_INFO{
float ProdTime; /* Total production time s */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXCOIL)]//SSC_K_MAXCOIL
int[] SharPasses; /* Number of shared passes - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXYSCOEF)]//SSC_K_MAXYSCOEF
float[] YSCurve; /* YS curve coefficients - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXYSPOL)]//SSC_K_MAXYSPOL
float[] YSPol; /* YS curve polynome - */
String Date;
int FixedNbOfPasses; /* Indicate if the number of passes is fixed - */
int ManualShifting; /* Indicate if TR shifting is calculated (1) or tabulated (0) -*/
int AURPosSaddle; /* Indicate if magnitude is for saddle (1) or for jack (0) -*/
int ManualAUR; /* Indicate if AUR are calculated (1) or tabulated (0) -*/
float SlowSpeed; /* speed used to calculate flow lub at start of pass (m/mn) */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXPASS)]//SSC_K_MAXYSPOL
SSC_T_PASSINFO[] Pass;

class SSC_T_PASSINFO{
float PassRollTime; /* Pass rolling time s */
float UncoilerTemp; /* Uncoiler temperature °C */
float GapEntTemp; /* Gap entry temperature °C */
float GapExitTemp; /* Gap exit temperature °C */
float DeformRadius; /* Deformed radius mm */
float NeutralAng; /* Neutral angle rad */
float ContactAng; /* Contact angle rad */
float NeutralPos; /* Neutral point position - */
float BackSlip; /* Backward slip - */
float PlasticArcLength; /* Reserved to bending mm */
float FlatteningLength; /* Reserved to shifting mm */
float Friction; /* Friction coefficient - */
float RolledLength; /* Rolled length km */
float InputStripCrown; /* Input strip crown µm */
float OutputStripCrown; /* Output strip crown µm */
float NormalStripCrown; /* Normal strip crown µm */
float FlatnessDefault; /* Flatness default IU */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXFLATCOEF)]//SSC_K_MAXFLATCOEF
float[] FlatnessControl; /* Flatness control shape - */
float AdpYldOff; /* Yield stress offset kg/mm² */
float AdpForceMof; /* Force multiplying offset - */
float AdpTorqOff; /* Torque offset kNm/mm */
float AdpBendOff; /* Bending offset T */
float AdpTempMof; /* Temperature multiplyer - */
float AdpShiftMof; /* Shifting multiplying off - */
// [MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXSADDLES)]//SSC_K_MAXSADDLES
float[] AdpStretchMof; /* Stretching multiplying off - */
float EELubFlowSS; /* Entry external lub. flow at slow speed l/mn */
float EILubFlowSS; /* Entry internal lub. flow at slow speed l/mn */
float XILubFlowSS; /* Exit internal lub. flow at slow speed l/mn */
float XELubFlowSS; /* Exit external lub. flow at slow speed l/mn */
float AdpSlipOf; /* Slip forward offset - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
float[] Spares;
LCM_STAND_MODEL_GUESS ModelGuess;
class LCM_STAND_MODEL_GUESS{
float def_rollrad_guess; /* Initial guess of def roll radius. m */
float sp_force_guess; /* Initial guess of specific force.. N/m */
float px_press_guess; /* Initial guess of px.............. N/m^2 */
float stand_ys_strain_off; /* Initial guess of ys strain offset N/m^2 */
float stand_ys_temp_off; /* Initial guess of ys temp offset.. N/m^2 */
float temp_change_guess; /* Initial guess of temp change off. deg C */
}//LCM_STAND_MODEL_GUESS
}//SSC_T_PASSINFO
}//SSC_T_INFO
class SSC_T_SENSIT{
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXPASS)]//SSC_K_MAXYSPOL
SSC_T_PASSSENSIT[] Pass;
class SSC_T_PASSSENSIT{

float SPForceToEntGauge; /* Specific force to entry gauge */
float SPForceToExitGauge; /* Specific force to exit gauge */
float SPForceToEntStress; /* Specific force to entry stress */
float SPForceToExitStress; /* Specific force to exit stress */
float FlatToRollForce; /* Exit flatness to roll force */
float FlatToRollBending; /* Exit flatness to roll bending s */
float FlatToRollTilt; /* Exit flatness to roll tilt */

}//SSC_T_PASSSENSIT
}//SSC_T_SENSIT
};//SSC_T_SETUP

//7th Argument....SSCAPP_T_MEASPACK
class SSCAPP_T_MEASPACK{
//[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = SSC_K_MAXCHAR)]//SSC_K_MAXCHAR
String CoilName;
int PassNum; /* Current pass number (1 based index)*/
int StartNewCoilFlag; /* New coil flag - */
int NextPassRefFlag; /* Request next pass ref. - */
/* => pass to pass adaption */
int EndOfCoilFlag; /* End of coil flag - */
/* => coil adaption */
int ShiftOKFlag; /* Shifting flag : measures can be into account for adaption (good speed) - */
float RollForce; /* Roll force T */
float RollTorque; /* Roll torque kNm */
float TensionIn; /* Pass input tension T */
float TensionOut; /* Pass output tension T */
float GaugeIn; /* Pass input gauge mm */
float GaugeOut; /* Pass output gauge mm */
float StripSpeed; /* Strip speed m/mn */
float Bending; /* Bending T */
float BendingTrim; /* Operator bending trim T */
float UppTRPosition; /* Upper taper roll position mm */
float LowTRPosition;
//SSC_T_INTERV /* Lower taper roll position mm */
float UnCoilerTemp; /* Strip entry temperature °C */
float StripTemp; /* Strip exit temperature °C */
float LubricantTemp; /* Lubricant entry temperature °C */
float DirtyLubricantTemp; /* Lubricant exit temperature °C */
float EELubFlow; /* Entry external lub. flow l/mn */
float EILubFlow; /* Entry internal lub. flow l/mn */
float XILubFlow; /* Exit internal lub. flow l/mn */
float XELubFlow; /* Exit external lub. flow l/mn */
float ScrewDown; /* usage to be defined */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXSADDLES)]//SSC_K_MAXSADDLES
float[] AsURPositionDN; /* Bottom As-U-Rolls positions - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXSADDLES)]//SSC_K_MAXSADDLES
float[] AsURPositionUP; /* Top As-U-Rolls positions - */
float Slip; /* Slip forward - */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
float[] Spares;
}//SSCAPP_T_MEASPACK

//8th Output...SSC_T_NEXTPASSREF
class SSC_T_NEXTPASSREF{
String CoilName; /* Coil number - */
int NextPassNum; /* Next pass number - */
int ErrCode; /* Error code - */
int WrnCode; /* Warning code - */
float GaugeIn; /* Pass input gauge mm */
float GaugeOut; /* Pass output gauge mm */
float Red; /* Pass reduction % */
float RollForce; /* Roll force T */
float AdpRollForce; /* Adapted roll force T */
float MaxForce; /* Maximum roll force T */
float RollTorque; /* Roll torque kNm */
float RollPower; /* Stand roll power kW */
float TensionIn; /* Pass input tension T */
float TensionOut; /* Pass output tension T */
float StressIn; /* Input tension stress kg/mm² */
float StressOut; /* Output tension stress kg/mm² */
float StripSpeed; /* Strip speed m/mn */
float RollWeight; /* Rolled weight T */
float StripTemp; /* Strip exit temperature °C */
float Bending; /* Bending T */
float UppTRPosition; /* Upper taper roll position mm */
float LowTRPosition; /* Lower taper roll position mm */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = SSC_K_MAXSADDLES)]//SSC_K_MAXSADDLES
float[] AsURPosition; /* As-U-Rolls positions - */
float EELubFlow; /* Entry external lub. flow l/mn */
float EILubFlow; /* Entry internal lub. flow l/mn */
float XILubFlow; /* Exit internal lub. flow l/mn */
float XELubFlow; /* Exit external lub. flow l/mn */
//[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
float[] Spares;
}//8th Output completed....

//9th Arguemnt....INT32.

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

pl advice/guide me how to communicate java to c++ using jni native.
I have review on 24-03-2009. ASAP help plz.....

Regards,
M.G.Rajendra Prasad. cell:-9884378086,india
mgrprasad90@gmail.com

Re: My problem is that after creating the header file in...

Posted By:   Paul_Wooten  
Posted On:   Tuesday, September 16, 2008 09:31 AM

I don't know how to compile the dll in Visual Studio, however, I was able to successfully compile a JNI dll using gcc (from mingw) on a Windows XP machine.

gcc -D_JNI_IMPLEMENTATION_ -Wl,--kill-at -I C:SunSDKjdkinclude -I C:SunSDKjdkincludewin32 -shared cSourceFile.c cLibraryFile.lib -o outputDll.dll

The -I switch indicates an include directory. C:SunSDKjdk is the path to the jdk I'm using on my machine (jni.h as well as machine specific files are required, hence the win32 include that follows). You can have additional includes for header files specific to your project, but those two jdk headers are the only ones required. Also, my source, lib, and output (as well as my header file generated by javah) were all in the current directory. This is not necessary, so long as the compiler finds the necessary files, but I ran into issues getting the compiler to find my library when it wasn't in the current directory.

Don't forget the -shared switch either. It won't error at compilation, your dll will just throw an UnsatisfiedLinkException or whatever its called when Java can't load a dll for native methods.

Hope that helps...

Re: My problem is that after creating the header file in...

Posted By:   Samrat_Mazumdar  
Posted On:   Tuesday, March 27, 2001 05:48 AM

Chec out VC++. after creating the file go to the options where there is an optiuon of creating a project. then you have to specify that you will generate .dll files which is also an option. rest is simple instructions that i am sure you can follow!!!!

Re: My problem is that after creating the header file...

Posted By:   Alexander_Krapf  
Posted On:   Friday, March 16, 2001 03:00 PM

Hi Pallab,


there is any number of online resources that deal with JNI. I don't want to recommend one over the other, just search in Google for JNI && Java and you will find a lot of listings with quite detailed build instructions.

One other thing you might want to consider is giving our JunC++ion product a try. It not only generates C++ proxy classes for Java classes but also a VisualStudio project file to build these classes, native method implementations etc. into an executable or a DLL. You can find out more about JunC++ion at http://www.codemesh.com. I am a principal here at Codemesh, so of course I am biased towards the product, but it really saves you a lot of time and pain.


Good luck,


Alex

About | Sitemap | Contact