448 lines
8.4 KiB
C++
448 lines
8.4 KiB
C++
// Version: 2014.7.30 16:47:28
|
|
|
|
#ifndef _T_HMI_DISPSETUP_H
|
|
#define _T_HMI_DISPSETUP_H
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#ifdef _MSC_VER
|
|
#pragma warning(disable:4996)
|
|
#pragma warning(disable:4267)
|
|
#endif
|
|
#include "T_HMI_DISPSETUPDBAX.h"
|
|
class T_HMI_DISPSETUP{
|
|
friend class T_HMI_DISPSETUPDBAX;
|
|
private:
|
|
//aggregation to DB Class
|
|
T_HMI_DISPSETUPDBAX 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_TableName[20+1];
|
|
char c_ColumnName[20+1];
|
|
char c_DispName[4000+1];
|
|
short s_DispNameZi;
|
|
char c_GridName[20+1];
|
|
short s_GridNameZi;
|
|
char c_InsertName[100+1];
|
|
short s_InsertNameZi;
|
|
short s_Dispos;
|
|
short s_DisposZi;
|
|
double d_Ratio;
|
|
short s_RatioZi;
|
|
char c_DisposLR[1+1];
|
|
short s_DisposLRZi;
|
|
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
|
|
char c_k_TableName[20+1];
|
|
char c_k_ColumnName[20+1];
|
|
public:
|
|
//
|
|
// LTA Structure
|
|
struct STR_T_HMI_DISPSETUP{
|
|
char TableName[20+1];
|
|
char ColumnName[20+1];
|
|
char DispName[4000+1];
|
|
char GridName[20+1];
|
|
char InsertName[100+1];
|
|
short Dispos;
|
|
double Ratio;
|
|
char DisposLR[1+1];
|
|
char toc[27];
|
|
char tom[27];
|
|
char mop[121];
|
|
char mou[31];
|
|
}structTable;
|
|
// LTA Structure Zi
|
|
struct STR_T_HMI_DISPSETUPZi{
|
|
short DispNameZi;
|
|
short GridNameZi;
|
|
short InsertNameZi;
|
|
short DisposZi;
|
|
short RatioZi;
|
|
short DisposLRZi;
|
|
short tocZi;
|
|
short tomZi;
|
|
short mopZi;
|
|
short mouZi;
|
|
}structTableZi;
|
|
//
|
|
//C O N S T R U C T O R S
|
|
//=======================
|
|
//
|
|
public:
|
|
T_HMI_DISPSETUP();
|
|
//D E S T R U C T O R S
|
|
//=======================
|
|
//
|
|
virtual ~T_HMI_DISPSETUP();
|
|
//
|
|
//C O P Y - C O N S T R U C T O R
|
|
//=======================
|
|
T_HMI_DISPSETUP(const T_HMI_DISPSETUP &inst);
|
|
// For Constructors with parameters the flag dbAccess
|
|
// informs you if the access was successfully or not
|
|
T_HMI_DISPSETUP( const char* arg1,const char* arg2);
|
|
|
|
//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(const char* arg1 , const char* arg2 );
|
|
|
|
|
|
// public methode initInsertKeys
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void initInsertKeys( const char* arg1 , const char* arg2 );
|
|
|
|
|
|
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_HMI_DISPSETUP operator+(const T_HMI_DISPSETUP &inst) const;
|
|
|
|
//
|
|
//O P E R A T O R =
|
|
//===================
|
|
//
|
|
public:
|
|
const T_HMI_DISPSETUP& operator=(const T_HMI_DISPSETUP &inst);
|
|
char* TableName() const;//{
|
|
//return((char*)c_TableName );
|
|
//}
|
|
|
|
|
|
void set_TableName( const char* arg );//{
|
|
//strncpy((char*)c_TableName , arg , sizeof(c_TableName));
|
|
//c_TableName[sizeof(c_TableName)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* ColumnName() const;//{
|
|
//return((char*)c_ColumnName );
|
|
//}
|
|
|
|
|
|
void set_ColumnName( const char* arg );//{
|
|
//strncpy((char*)c_ColumnName , arg , sizeof(c_ColumnName));
|
|
//c_ColumnName[sizeof(c_ColumnName)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* DispName() const;//{
|
|
//return((char*)c_DispName );
|
|
//}
|
|
|
|
short DispNameZi() const;//{
|
|
//return( s_DispNameZi);
|
|
//}
|
|
|
|
void set_DispName( const char* arg );//{
|
|
//strncpy((char*)c_DispName , arg , sizeof(c_DispName));
|
|
//c_DispName[sizeof(c_DispName)-1] = '\0';
|
|
//s_DispNameZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_DispNameZi( short arg ) ;//{
|
|
//s_DispNameZi = arg;
|
|
//}
|
|
|
|
char* GridName() const;//{
|
|
//return((char*)c_GridName );
|
|
//}
|
|
|
|
short GridNameZi() const;//{
|
|
//return( s_GridNameZi);
|
|
//}
|
|
|
|
void set_GridName( const char* arg );//{
|
|
//strncpy((char*)c_GridName , arg , sizeof(c_GridName));
|
|
//c_GridName[sizeof(c_GridName)-1] = '\0';
|
|
//s_GridNameZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_GridNameZi( short arg ) ;//{
|
|
//s_GridNameZi = arg;
|
|
//}
|
|
|
|
char* InsertName() const;//{
|
|
//return((char*)c_InsertName );
|
|
//}
|
|
|
|
short InsertNameZi() const;//{
|
|
//return( s_InsertNameZi);
|
|
//}
|
|
|
|
void set_InsertName( const char* arg );//{
|
|
//strncpy((char*)c_InsertName , arg , sizeof(c_InsertName));
|
|
//c_InsertName[sizeof(c_InsertName)-1] = '\0';
|
|
//s_InsertNameZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_InsertNameZi( short arg ) ;//{
|
|
//s_InsertNameZi = arg;
|
|
//}
|
|
|
|
short Dispos() const;//{
|
|
//return((short)s_Dispos );
|
|
//}
|
|
|
|
short DisposZi() const;//{
|
|
//return( s_DisposZi);
|
|
//}
|
|
|
|
void set_Dispos( short arg );//{
|
|
//s_Dispos = arg;
|
|
//s_DisposZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_DisposZi( short arg ) ;//{
|
|
//s_DisposZi = arg;
|
|
//}
|
|
|
|
double Ratio() const;//{
|
|
//return((double)d_Ratio );
|
|
//}
|
|
|
|
short RatioZi() const;//{
|
|
//return( s_RatioZi);
|
|
//}
|
|
|
|
void set_Ratio( double arg );//{
|
|
//d_Ratio = arg;
|
|
//s_RatioZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_RatioZi( short arg ) ;//{
|
|
//s_RatioZi = arg;
|
|
//}
|
|
|
|
char* DisposLR() const;//{
|
|
//return((char*)c_DisposLR );
|
|
//}
|
|
|
|
short DisposLRZi() const;//{
|
|
//return( s_DisposLRZi);
|
|
//}
|
|
|
|
void set_DisposLR( const char* arg );//{
|
|
//strncpy((char*)c_DisposLR , arg , sizeof(c_DisposLR));
|
|
//c_DisposLR[sizeof(c_DisposLR)-1] = '\0';
|
|
//s_DisposLRZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_DisposLRZi( short arg ) ;//{
|
|
//s_DisposLRZi = arg;
|
|
//}
|
|
|
|
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
|
|
char* k_TableName();//{
|
|
//return((char*)c_k_TableName );
|
|
//}
|
|
|
|
void set_k_TableName( char* arg );//{
|
|
//strncpy((char*)c_k_TableName , arg , sizeof(c_k_TableName));
|
|
//c_k_TableName[sizeof(c_k_TableName)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
char* k_ColumnName();//{
|
|
//return((char*)c_k_ColumnName );
|
|
//}
|
|
|
|
void set_k_ColumnName( char* arg );//{
|
|
//strncpy((char*)c_k_ColumnName , arg , sizeof(c_k_ColumnName));
|
|
//c_k_ColumnName[sizeof(c_k_ColumnName)-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("T_HMI_DISPSETUP");
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getSqlCode();//{
|
|
//return( db.dbSqlCode);
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getRowsProcessed();//{
|
|
//return( db.dbRowsProcessed);
|
|
//}
|
|
};
|
|
#endif
|