629 lines
12 KiB
C++
629 lines
12 KiB
C++
// Version: 2014.7.30 16:47:28
|
|
|
|
#ifndef _T_DEF_LINE_H
|
|
#define _T_DEF_LINE_H
|
|
#include <common/BasicStruct.h>
|
|
|
|
using namespace baosight;
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#ifdef _MSC_VER
|
|
#pragma warning(disable:4996)
|
|
#pragma warning(disable:4267)
|
|
#endif
|
|
#include "T_DEF_LINEDBAX.h"
|
|
class T_DEF_LINE{
|
|
friend class T_DEF_LINEDBAX;
|
|
private:
|
|
//aggregation to DB Class
|
|
T_DEF_LINEDBAX db;
|
|
public:
|
|
//
|
|
//A T T R I B U T E S
|
|
//===================
|
|
//
|
|
bool dbAccess;
|
|
char* dbMessage;// pointer for the return values of DBAX methodes
|
|
char messageBuffer[200];// temporary message buffer
|
|
friend class PapLib;
|
|
protected:
|
|
//
|
|
//A T T R I B U T E S
|
|
//===================
|
|
//
|
|
long l_SID;
|
|
long l_defEnd;
|
|
short s_defEndZi;
|
|
char c_defType[3+1];
|
|
short s_defTypeZi;
|
|
char c_defSide[3+1];
|
|
short s_defSideZi;
|
|
char c_lengthPos[1+1];
|
|
short s_lengthPosZi;
|
|
char c_inputUnit[4+1];
|
|
short s_inputUnitZi;
|
|
char c_controlType[2+1];
|
|
short s_controlTypeZi;
|
|
char c_defectText[20+1];
|
|
short s_defectTextZi;
|
|
char c_defClass[2+1];
|
|
short s_defClassZi;
|
|
long l_defLateralDis;
|
|
short s_defLateralDisZi;
|
|
char c_defWidthPos[1+1];
|
|
short s_defWidthPosZi;
|
|
char c_defCreator[4+1];
|
|
short s_defCreatorZi;
|
|
long l_defStart;
|
|
short s_defStartZi;
|
|
long l_muId;
|
|
char c_muCreator[3];
|
|
short s_musId;
|
|
char c_toc[27];
|
|
short s_tocZi;
|
|
char c_tom[27];
|
|
short s_tomZi;
|
|
char c_mop[121];
|
|
short s_mopZi;
|
|
char c_mou[31];
|
|
short s_mouZi;
|
|
// arguments for Primary key
|
|
long l_k_muId;
|
|
char c_k_muCreator[3];
|
|
short s_k_musId;
|
|
long l_k_SID;
|
|
public:
|
|
//
|
|
// LTA Structure
|
|
struct STR_T_DEF_LINE{
|
|
int SID;
|
|
int defEnd;
|
|
char defType[3+1];
|
|
char defSide[3+1];
|
|
char lengthPos[1+1];
|
|
char inputUnit[4+1];
|
|
char controlType[2+1];
|
|
char defectText[20+1];
|
|
char defClass[2+1];
|
|
int defLateralDis;
|
|
char defWidthPos[1+1];
|
|
char defCreator[4+1];
|
|
int defStart;
|
|
int muId;
|
|
char muCreator[3];
|
|
short musId;
|
|
char toc[27];
|
|
char tom[27];
|
|
char mop[121];
|
|
char mou[31];
|
|
}structTable;
|
|
// LTA Structure Zi
|
|
struct STR_T_DEF_LINEZi{
|
|
short defEndZi;
|
|
short defTypeZi;
|
|
short defSideZi;
|
|
short lengthPosZi;
|
|
short inputUnitZi;
|
|
short controlTypeZi;
|
|
short defectTextZi;
|
|
short defClassZi;
|
|
short defLateralDisZi;
|
|
short defWidthPosZi;
|
|
short defCreatorZi;
|
|
short defStartZi;
|
|
short tocZi;
|
|
short tomZi;
|
|
short mopZi;
|
|
short mouZi;
|
|
}structTableZi;
|
|
//
|
|
//C O N S T R U C T O R S
|
|
//=======================
|
|
//
|
|
public:
|
|
T_DEF_LINE();
|
|
//D E S T R U C T O R S
|
|
//=======================
|
|
//
|
|
virtual ~T_DEF_LINE();
|
|
//
|
|
//C O P Y - C O N S T R U C T O R
|
|
//=======================
|
|
T_DEF_LINE(const T_DEF_LINE &inst);
|
|
// For Constructors with parameters the flag dbAccess
|
|
// informs you if the access was successfully or not
|
|
T_DEF_LINE( MU_CODE muCode , long arg1);
|
|
|
|
//methods
|
|
public:
|
|
char* getCreationTime() {return "2014.7.30 16:47:28";};
|
|
//initial data
|
|
void initial();
|
|
//read data
|
|
char* readDB();
|
|
//update data
|
|
char* updateDB();
|
|
//insert data
|
|
char* insertDB();
|
|
//this methode tries to update a DB record , when the update fails , the methode
|
|
//tries an insert of the failed record
|
|
char* storeDB();
|
|
//delete data
|
|
char* deleteDB();
|
|
//delete data
|
|
char* deleteDB(const char* where , long* count );
|
|
//openSetDB data
|
|
char* openSetDB(const char* where ,const char* order );
|
|
//getSetDB data
|
|
char* getSetDB();
|
|
//closeSetDB data
|
|
char* closeSetDB();
|
|
//countDB data
|
|
char* countDB(const char* where , long* count );
|
|
|
|
char* execute(const char* sql , long* count );
|
|
|
|
char* dbCommit();
|
|
|
|
char* dbRollback();
|
|
public:
|
|
//
|
|
// public methode setPrimKey
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void setPrimKey(long arg1 , const char* arg2 , short arg3 , long arg4 );
|
|
|
|
void setPrimKey( MU_CODE muCode , long arg1 );
|
|
|
|
// public methode initInsertKeys
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void initInsertKeys( long arg1 , const char* arg2 , short arg3 , long arg4 );
|
|
|
|
void initInsertKeys( MU_CODE muCode , long arg1 );
|
|
|
|
public:
|
|
//
|
|
// public methode setKeysFromRecord
|
|
//
|
|
// this methode set the unique key attributes from the DB Record Attributes
|
|
//
|
|
void setKeysFromRecord();
|
|
|
|
//
|
|
//O P E R A T O R +
|
|
//===================
|
|
//
|
|
public:
|
|
T_DEF_LINE operator+(const T_DEF_LINE &inst) const;
|
|
|
|
//
|
|
//O P E R A T O R =
|
|
//===================
|
|
//
|
|
public:
|
|
const T_DEF_LINE& operator=(const T_DEF_LINE &inst);
|
|
long SID() const;//{
|
|
//return((long)l_SID );
|
|
//}
|
|
|
|
|
|
void set_SID( long arg );//{
|
|
//l_SID = arg;
|
|
//return;
|
|
//}
|
|
|
|
|
|
long defEnd() const;//{
|
|
//return((long)l_defEnd );
|
|
//}
|
|
|
|
short defEndZi() const;//{
|
|
//return( s_defEndZi);
|
|
//}
|
|
|
|
void set_defEnd( long arg );//{
|
|
//l_defEnd = arg;
|
|
//s_defEndZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_defEndZi( short arg ) ;//{
|
|
//s_defEndZi = arg;
|
|
//}
|
|
|
|
char* defType() const;//{
|
|
//return((char*)c_defType );
|
|
//}
|
|
|
|
short defTypeZi() const;//{
|
|
//return( s_defTypeZi);
|
|
//}
|
|
|
|
void set_defType( const char* arg );//{
|
|
//strncpy((char*)c_defType , arg , sizeof(c_defType));
|
|
//c_defType[sizeof(c_defType)-1] = '\0';
|
|
//s_defTypeZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_defTypeZi( short arg ) ;//{
|
|
//s_defTypeZi = arg;
|
|
//}
|
|
|
|
char* defSide() const;//{
|
|
//return((char*)c_defSide );
|
|
//}
|
|
|
|
short defSideZi() const;//{
|
|
//return( s_defSideZi);
|
|
//}
|
|
|
|
void set_defSide( const char* arg );//{
|
|
//strncpy((char*)c_defSide , arg , sizeof(c_defSide));
|
|
//c_defSide[sizeof(c_defSide)-1] = '\0';
|
|
//s_defSideZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_defSideZi( short arg ) ;//{
|
|
//s_defSideZi = arg;
|
|
//}
|
|
|
|
char* lengthPos() const;//{
|
|
//return((char*)c_lengthPos );
|
|
//}
|
|
|
|
short lengthPosZi() const;//{
|
|
//return( s_lengthPosZi);
|
|
//}
|
|
|
|
void set_lengthPos( const char* arg );//{
|
|
//strncpy((char*)c_lengthPos , arg , sizeof(c_lengthPos));
|
|
//c_lengthPos[sizeof(c_lengthPos)-1] = '\0';
|
|
//s_lengthPosZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_lengthPosZi( short arg ) ;//{
|
|
//s_lengthPosZi = arg;
|
|
//}
|
|
|
|
char* inputUnit() const;//{
|
|
//return((char*)c_inputUnit );
|
|
//}
|
|
|
|
short inputUnitZi() const;//{
|
|
//return( s_inputUnitZi);
|
|
//}
|
|
|
|
void set_inputUnit( const char* arg );//{
|
|
//strncpy((char*)c_inputUnit , arg , sizeof(c_inputUnit));
|
|
//c_inputUnit[sizeof(c_inputUnit)-1] = '\0';
|
|
//s_inputUnitZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_inputUnitZi( short arg ) ;//{
|
|
//s_inputUnitZi = arg;
|
|
//}
|
|
|
|
char* controlType() const;//{
|
|
//return((char*)c_controlType );
|
|
//}
|
|
|
|
short controlTypeZi() const;//{
|
|
//return( s_controlTypeZi);
|
|
//}
|
|
|
|
void set_controlType( const char* arg );//{
|
|
//strncpy((char*)c_controlType , arg , sizeof(c_controlType));
|
|
//c_controlType[sizeof(c_controlType)-1] = '\0';
|
|
//s_controlTypeZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_controlTypeZi( short arg ) ;//{
|
|
//s_controlTypeZi = arg;
|
|
//}
|
|
|
|
char* defectText() const;//{
|
|
//return((char*)c_defectText );
|
|
//}
|
|
|
|
short defectTextZi() const;//{
|
|
//return( s_defectTextZi);
|
|
//}
|
|
|
|
void set_defectText( const char* arg );//{
|
|
//strncpy((char*)c_defectText , arg , sizeof(c_defectText));
|
|
//c_defectText[sizeof(c_defectText)-1] = '\0';
|
|
//s_defectTextZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_defectTextZi( short arg ) ;//{
|
|
//s_defectTextZi = arg;
|
|
//}
|
|
|
|
char* defClass() const;//{
|
|
//return((char*)c_defClass );
|
|
//}
|
|
|
|
short defClassZi() const;//{
|
|
//return( s_defClassZi);
|
|
//}
|
|
|
|
void set_defClass( const char* arg );//{
|
|
//strncpy((char*)c_defClass , arg , sizeof(c_defClass));
|
|
//c_defClass[sizeof(c_defClass)-1] = '\0';
|
|
//s_defClassZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_defClassZi( short arg ) ;//{
|
|
//s_defClassZi = arg;
|
|
//}
|
|
|
|
long defLateralDis() const;//{
|
|
//return((long)l_defLateralDis );
|
|
//}
|
|
|
|
short defLateralDisZi() const;//{
|
|
//return( s_defLateralDisZi);
|
|
//}
|
|
|
|
void set_defLateralDis( long arg );//{
|
|
//l_defLateralDis = arg;
|
|
//s_defLateralDisZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_defLateralDisZi( short arg ) ;//{
|
|
//s_defLateralDisZi = arg;
|
|
//}
|
|
|
|
char* defWidthPos() const;//{
|
|
//return((char*)c_defWidthPos );
|
|
//}
|
|
|
|
short defWidthPosZi() const;//{
|
|
//return( s_defWidthPosZi);
|
|
//}
|
|
|
|
void set_defWidthPos( const char* arg );//{
|
|
//strncpy((char*)c_defWidthPos , arg , sizeof(c_defWidthPos));
|
|
//c_defWidthPos[sizeof(c_defWidthPos)-1] = '\0';
|
|
//s_defWidthPosZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_defWidthPosZi( short arg ) ;//{
|
|
//s_defWidthPosZi = arg;
|
|
//}
|
|
|
|
char* defCreator() const;//{
|
|
//return((char*)c_defCreator );
|
|
//}
|
|
|
|
short defCreatorZi() const;//{
|
|
//return( s_defCreatorZi);
|
|
//}
|
|
|
|
void set_defCreator( const char* arg );//{
|
|
//strncpy((char*)c_defCreator , arg , sizeof(c_defCreator));
|
|
//c_defCreator[sizeof(c_defCreator)-1] = '\0';
|
|
//s_defCreatorZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_defCreatorZi( short arg ) ;//{
|
|
//s_defCreatorZi = arg;
|
|
//}
|
|
|
|
long defStart() const;//{
|
|
//return((long)l_defStart );
|
|
//}
|
|
|
|
short defStartZi() const;//{
|
|
//return( s_defStartZi);
|
|
//}
|
|
|
|
void set_defStart( long arg );//{
|
|
//l_defStart = arg;
|
|
//s_defStartZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_defStartZi( short arg ) ;//{
|
|
//s_defStartZi = arg;
|
|
//}
|
|
|
|
long muId() const;//{
|
|
//return((long)l_muId );
|
|
//}
|
|
|
|
void set_muId( long arg );//{
|
|
//l_muId = arg;
|
|
//return;
|
|
//}
|
|
|
|
char* muCreator() const;//{
|
|
//return((char*)c_muCreator );
|
|
//}
|
|
|
|
void set_muCreator( const char* arg );//{
|
|
//strncpy((char*)c_muCreator , arg , sizeof(c_muCreator));
|
|
//c_muCreator[sizeof(c_muCreator)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
short musId() const;//{
|
|
//return((short)s_musId );
|
|
//}
|
|
|
|
void set_musId( short arg );//{
|
|
//s_musId = arg;
|
|
//return;
|
|
//}
|
|
|
|
public:
|
|
char* toc() const;//{
|
|
//return((char*)c_toc );
|
|
//}
|
|
|
|
short tocZi() const;//{
|
|
//return( s_tocZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_toc( char* arg );//{
|
|
//strncpy((char*)c_toc , arg , sizeof(c_toc));
|
|
//c_toc[sizeof(c_toc)-1] = '\0';
|
|
//s_tocZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_tocZi( short arg );//{
|
|
//s_tocZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* tom() const;//{
|
|
//return((char*)c_tom );
|
|
//}
|
|
|
|
short tomZi() const;//{
|
|
//return( s_tomZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_tom( char* arg );//{
|
|
//strncpy((char*)c_tom , arg , sizeof(c_tom));
|
|
//c_tom[sizeof(c_tom)-1] = '\0';
|
|
//s_tomZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_tomZi( short arg );//{
|
|
//s_tomZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* mop() const;//{
|
|
//return((char*)c_mop );
|
|
//}
|
|
|
|
short mopZi() const;//{
|
|
//return( s_mopZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_mop( char* arg );//{
|
|
//strncpy((char*)c_mop , arg , sizeof(c_mop));
|
|
//c_mop[sizeof(c_mop)-1] = '\0';
|
|
//s_mopZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_mopZi( short arg );//{
|
|
//s_mopZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* mou() const;//{
|
|
//return((char*)c_mou );
|
|
//}
|
|
|
|
short mouZi() const;//{
|
|
//return( s_mouZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_mou( char* arg );//{
|
|
//strncpy((char*)c_mou , arg , sizeof(c_mou));
|
|
//c_mou[sizeof(c_mou)-1] = '\0';
|
|
//s_mouZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_mouZi( short arg );//{
|
|
//s_mouZi = arg;
|
|
//}
|
|
|
|
public:
|
|
// methodes for Primary key
|
|
long k_muId();//{
|
|
//return((long)l_k_muId );
|
|
//}
|
|
|
|
void set_k_muId( long arg );//{
|
|
//l_k_muId = arg;
|
|
//return;
|
|
//}
|
|
|
|
char* k_muCreator();//{
|
|
//return((char*)c_k_muCreator );
|
|
//}
|
|
|
|
void set_k_muCreator( char* arg );//{
|
|
//strncpy((char*)c_k_muCreator , arg , sizeof(c_k_muCreator));
|
|
//c_k_muCreator[sizeof(c_k_muCreator)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
short k_musId();//{
|
|
//return((short)s_k_musId );
|
|
//}
|
|
|
|
void set_k_musId( short arg );//{
|
|
//s_k_musId = arg;
|
|
//return;
|
|
//}
|
|
|
|
long k_SID();//{
|
|
//return((long)l_k_SID );
|
|
//}
|
|
|
|
void set_k_SID( long arg );//{
|
|
//l_k_SID = arg;
|
|
//return;
|
|
//}
|
|
|
|
public:
|
|
//
|
|
// public methode fillStructure
|
|
//
|
|
// this methode filles the classstructue with the private attributes
|
|
//
|
|
void fillStructure();//{
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
void fillStructureZi();//{
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
void setStructure();// {
|
|
//return;
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
void setStructureZi() ;//{
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
char* getName();//{
|
|
//return("T_DEF_LINE");
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getSqlCode();//{
|
|
//return( db.dbSqlCode);
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getRowsProcessed();//{
|
|
//return( db.dbRowsProcessed);
|
|
//}
|
|
};
|
|
#endif
|