685 lines
13 KiB
C++
685 lines
13 KiB
C++
// Version: 2018.7.12 9:12:50
|
|
|
|
#ifndef _T_PDI_LO_H
|
|
#define _T_PDI_LO_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_PDI_LODBAX.h"
|
|
class T_PDI_LO{
|
|
friend class T_PDI_LODBAX;
|
|
private:
|
|
//aggregation to DB Class
|
|
T_PDI_LODBAX 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
|
|
//===================
|
|
//
|
|
char c_source[2+1];
|
|
char c_ok[1+1];
|
|
short s_okZi;
|
|
long l_lengthLogical;
|
|
short s_lengthLogicalZi;
|
|
double d_hEntry;
|
|
short s_hEntryZi;
|
|
char c_alloyCode[30+1];
|
|
short s_alloyCodeZi;
|
|
double d_width;
|
|
short s_widthZi;
|
|
long l_trimmingSp;
|
|
short s_trimmingSpZi;
|
|
long l_weightSpecific;
|
|
short s_weightSpecificZi;
|
|
char c_HotCoilId[2][20+1];
|
|
short s_HotCoilIdZi[2];
|
|
char c_HeatCycle[6+1];
|
|
short s_HeatCycleZi;
|
|
short s_WeldNum;
|
|
short s_WeldNumZi;
|
|
char c_WeldType[2][5+1];
|
|
short s_WeldTypeZi[2];
|
|
long l_WeldPos[2];
|
|
short s_WeldPosZi[2];
|
|
char c_SteelCode[10+1];
|
|
short s_SteelCodeZi;
|
|
char c_SteelType[12+1];
|
|
short s_SteelTypeZi;
|
|
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;
|
|
char c_k_source[2+1];
|
|
public:
|
|
//
|
|
// LTA Structure
|
|
struct STR_T_PDI_LO{
|
|
char source[2+1];
|
|
char ok[1+1];
|
|
int lengthLogical;
|
|
double hEntry;
|
|
char alloyCode[30+1];
|
|
double width;
|
|
int trimmingSp;
|
|
int weightSpecific;
|
|
char HotCoilId[2][20+1];
|
|
char HeatCycle[6+1];
|
|
short WeldNum;
|
|
char WeldType[2][5+1];
|
|
int WeldPos[2];
|
|
char SteelCode[10+1];
|
|
char SteelType[12+1];
|
|
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_PDI_LOZi{
|
|
short okZi;
|
|
short lengthLogicalZi;
|
|
short hEntryZi;
|
|
short alloyCodeZi;
|
|
short widthZi;
|
|
short trimmingSpZi;
|
|
short weightSpecificZi;
|
|
short HotCoilIdZi[2];
|
|
short HeatCycleZi;
|
|
short WeldNumZi;
|
|
short WeldTypeZi[2];
|
|
short WeldPosZi[2];
|
|
short SteelCodeZi;
|
|
short SteelTypeZi;
|
|
short tocZi;
|
|
short tomZi;
|
|
short mopZi;
|
|
short mouZi;
|
|
}structTableZi;
|
|
//
|
|
//C O N S T R U C T O R S
|
|
//=======================
|
|
//
|
|
public:
|
|
T_PDI_LO();
|
|
//D E S T R U C T O R S
|
|
//=======================
|
|
//
|
|
virtual ~T_PDI_LO();
|
|
//
|
|
//C O P Y - C O N S T R U C T O R
|
|
//=======================
|
|
T_PDI_LO(const T_PDI_LO &inst);
|
|
// For Constructors with parameters the flag dbAccess
|
|
// informs you if the access was successfully or not
|
|
T_PDI_LO( MU_CODE muCode , const char* arg1);
|
|
|
|
//methods
|
|
public:
|
|
char* getCreationTime() {return (char*)"2018.7.12 9:12:50";};
|
|
//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 , const char* arg4 );
|
|
|
|
void setPrimKey( MU_CODE muCode , const char* arg1 );
|
|
|
|
// public methode initInsertKeys
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void initInsertKeys( long arg1 , const char* arg2 , short arg3 , const char* arg4 );
|
|
|
|
void initInsertKeys( MU_CODE muCode , const char* 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_PDI_LO operator+(const T_PDI_LO &inst) const;
|
|
|
|
//
|
|
//O P E R A T O R =
|
|
//===================
|
|
//
|
|
public:
|
|
const T_PDI_LO& operator=(const T_PDI_LO &inst);
|
|
char* source() const;//{
|
|
//return((char*)c_source );
|
|
//}
|
|
|
|
|
|
void set_source( const char* arg );//{
|
|
//strncpy((char*)c_source , arg , sizeof(c_source));
|
|
//c_source[sizeof(c_source)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* ok() const;//{
|
|
//return((char*)c_ok );
|
|
//}
|
|
|
|
short okZi() const;//{
|
|
//return( s_okZi);
|
|
//}
|
|
|
|
void set_ok( const char* arg );//{
|
|
//strncpy((char*)c_ok , arg , sizeof(c_ok));
|
|
//c_ok[sizeof(c_ok)-1] = '\0';
|
|
//s_okZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_okZi( short arg ) ;//{
|
|
//s_okZi = arg;
|
|
//}
|
|
|
|
long lengthLogical() const;//{
|
|
//return((long)l_lengthLogical );
|
|
//}
|
|
|
|
short lengthLogicalZi() const;//{
|
|
//return( s_lengthLogicalZi);
|
|
//}
|
|
|
|
void set_lengthLogical( long arg );//{
|
|
//l_lengthLogical = arg;
|
|
//s_lengthLogicalZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_lengthLogicalZi( short arg ) ;//{
|
|
//s_lengthLogicalZi = arg;
|
|
//}
|
|
|
|
double hEntry() const;//{
|
|
//return((double)d_hEntry );
|
|
//}
|
|
|
|
short hEntryZi() const;//{
|
|
//return( s_hEntryZi);
|
|
//}
|
|
|
|
void set_hEntry( double arg );//{
|
|
//d_hEntry = arg;
|
|
//s_hEntryZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_hEntryZi( short arg ) ;//{
|
|
//s_hEntryZi = arg;
|
|
//}
|
|
|
|
char* alloyCode() const;//{
|
|
//return((char*)c_alloyCode );
|
|
//}
|
|
|
|
short alloyCodeZi() const;//{
|
|
//return( s_alloyCodeZi);
|
|
//}
|
|
|
|
void set_alloyCode( const char* arg );//{
|
|
//strncpy((char*)c_alloyCode , arg , sizeof(c_alloyCode));
|
|
//c_alloyCode[sizeof(c_alloyCode)-1] = '\0';
|
|
//s_alloyCodeZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_alloyCodeZi( short arg ) ;//{
|
|
//s_alloyCodeZi = arg;
|
|
//}
|
|
|
|
double width() const;//{
|
|
//return((double)d_width );
|
|
//}
|
|
|
|
short widthZi() const;//{
|
|
//return( s_widthZi);
|
|
//}
|
|
|
|
void set_width( double arg );//{
|
|
//d_width = arg;
|
|
//s_widthZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_widthZi( short arg ) ;//{
|
|
//s_widthZi = arg;
|
|
//}
|
|
|
|
long trimmingSp() const;//{
|
|
//return((long)l_trimmingSp );
|
|
//}
|
|
|
|
short trimmingSpZi() const;//{
|
|
//return( s_trimmingSpZi);
|
|
//}
|
|
|
|
void set_trimmingSp( long arg );//{
|
|
//l_trimmingSp = arg;
|
|
//s_trimmingSpZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_trimmingSpZi( short arg ) ;//{
|
|
//s_trimmingSpZi = arg;
|
|
//}
|
|
|
|
long weightSpecific() const;//{
|
|
//return((long)l_weightSpecific );
|
|
//}
|
|
|
|
short weightSpecificZi() const;//{
|
|
//return( s_weightSpecificZi);
|
|
//}
|
|
|
|
void set_weightSpecific( long arg );//{
|
|
//l_weightSpecific = arg;
|
|
//s_weightSpecificZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_weightSpecificZi( short arg ) ;//{
|
|
//s_weightSpecificZi = arg;
|
|
//}
|
|
|
|
int HotCoilIdArraySize();//{
|
|
//return(2);
|
|
//}
|
|
|
|
char* HotCoilId(int colInd) const;//{
|
|
//return((char*)c_HotCoilId[colInd] );
|
|
//}
|
|
|
|
short HotCoilIdZi(int colInd) const;//{
|
|
//return( s_HotCoilIdZi[colInd]);
|
|
//}
|
|
|
|
void set_HotCoilId( int colInd, const char* arg );//{
|
|
//strncpy((char*)c_HotCoilId[colInd] , arg , sizeof(c_HotCoilId[colInd]));
|
|
//c_HotCoilId[colInd][sizeof(c_HotCoilId[colInd])-1] = '\0';
|
|
//s_HotCoilIdZi[colInd]= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_HotCoilIdZi( int colInd, short arg );// {
|
|
//s_HotCoilIdZi[colInd] = arg;
|
|
//}
|
|
|
|
char* HeatCycle() const;//{
|
|
//return((char*)c_HeatCycle );
|
|
//}
|
|
|
|
short HeatCycleZi() const;//{
|
|
//return( s_HeatCycleZi);
|
|
//}
|
|
|
|
void set_HeatCycle( const char* arg );//{
|
|
//strncpy((char*)c_HeatCycle , arg , sizeof(c_HeatCycle));
|
|
//c_HeatCycle[sizeof(c_HeatCycle)-1] = '\0';
|
|
//s_HeatCycleZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_HeatCycleZi( short arg ) ;//{
|
|
//s_HeatCycleZi = arg;
|
|
//}
|
|
|
|
short WeldNum() const;//{
|
|
//return((short)s_WeldNum );
|
|
//}
|
|
|
|
short WeldNumZi() const;//{
|
|
//return( s_WeldNumZi);
|
|
//}
|
|
|
|
void set_WeldNum( short arg );//{
|
|
//s_WeldNum = arg;
|
|
//s_WeldNumZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_WeldNumZi( short arg ) ;//{
|
|
//s_WeldNumZi = arg;
|
|
//}
|
|
|
|
int WeldTypeArraySize();//{
|
|
//return(2);
|
|
//}
|
|
|
|
char* WeldType(int colInd) const;//{
|
|
//return((char*)c_WeldType[colInd] );
|
|
//}
|
|
|
|
short WeldTypeZi(int colInd) const;//{
|
|
//return( s_WeldTypeZi[colInd]);
|
|
//}
|
|
|
|
void set_WeldType( int colInd, const char* arg );//{
|
|
//strncpy((char*)c_WeldType[colInd] , arg , sizeof(c_WeldType[colInd]));
|
|
//c_WeldType[colInd][sizeof(c_WeldType[colInd])-1] = '\0';
|
|
//s_WeldTypeZi[colInd]= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_WeldTypeZi( int colInd, short arg );// {
|
|
//s_WeldTypeZi[colInd] = arg;
|
|
//}
|
|
|
|
int WeldPosArraySize();//{
|
|
//return(2);
|
|
//}
|
|
|
|
long WeldPos(int colInd) const;//{
|
|
//return((int)l_WeldPos[colInd] );
|
|
//}
|
|
|
|
short WeldPosZi(int colInd) const;//{
|
|
//return( s_WeldPosZi[colInd]);
|
|
//}
|
|
|
|
void set_WeldPos( int colInd, long arg );//{
|
|
//l_WeldPos[colInd] = arg;
|
|
//s_WeldPosZi[colInd]= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_WeldPosZi( int colInd, short arg );// {
|
|
//s_WeldPosZi[colInd] = arg;
|
|
//}
|
|
|
|
char* SteelCode() const;//{
|
|
//return((char*)c_SteelCode );
|
|
//}
|
|
|
|
short SteelCodeZi() const;//{
|
|
//return( s_SteelCodeZi);
|
|
//}
|
|
|
|
void set_SteelCode( const char* arg );//{
|
|
//strncpy((char*)c_SteelCode , arg , sizeof(c_SteelCode));
|
|
//c_SteelCode[sizeof(c_SteelCode)-1] = '\0';
|
|
//s_SteelCodeZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_SteelCodeZi( short arg ) ;//{
|
|
//s_SteelCodeZi = arg;
|
|
//}
|
|
|
|
char* SteelType() const;//{
|
|
//return((char*)c_SteelType );
|
|
//}
|
|
|
|
short SteelTypeZi() const;//{
|
|
//return( s_SteelTypeZi);
|
|
//}
|
|
|
|
void set_SteelType( const char* arg );//{
|
|
//strncpy((char*)c_SteelType , arg , sizeof(c_SteelType));
|
|
//c_SteelType[sizeof(c_SteelType)-1] = '\0';
|
|
//s_SteelTypeZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_SteelTypeZi( short arg ) ;//{
|
|
//s_SteelTypeZi = 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;
|
|
//}
|
|
|
|
char* k_source();//{
|
|
//return((char*)c_k_source );
|
|
//}
|
|
|
|
void set_k_source( char* arg );//{
|
|
//strncpy((char*)c_k_source , arg , sizeof(c_k_source));
|
|
//c_k_source[sizeof(c_k_source)-1] = '\0';
|
|
//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((char*)"T_PDI_LO");
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getSqlCode();//{
|
|
//return( db.dbSqlCode);
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getRowsProcessed();//{
|
|
//return( db.dbRowsProcessed);
|
|
//}
|
|
};
|
|
#endif
|