566 lines
10 KiB
C++
566 lines
10 KiB
C++
// Version: 2020.7.15 20:54:34
|
|
|
|
#ifndef _T_STA_PARAM_H
|
|
#define _T_STA_PARAM_H
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#ifdef _MSC_VER
|
|
#pragma warning(disable:4996)
|
|
#pragma warning(disable:4267)
|
|
#endif
|
|
#include "T_STA_PARAMDBAX.h"
|
|
class T_STA_PARAM{
|
|
friend class T_STA_PARAMDBAX;
|
|
private:
|
|
//aggregation to DB Class
|
|
T_STA_PARAMDBAX 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_tagName[50+1];
|
|
char c_tagNameChinese[100+1];
|
|
short s_tagNameChineseZi;
|
|
short s_useOnline;
|
|
short s_useOnlineZi;
|
|
short s_useOffline;
|
|
short s_useOfflineZi;
|
|
long l_count;
|
|
short s_countZi;
|
|
char c_dataFromDate[27];
|
|
short s_dataFromDateZi;
|
|
char c_dataToDate[27];
|
|
short s_dataToDateZi;
|
|
double d_sectionLeft;
|
|
short s_sectionLeftZi;
|
|
double d_sectionRight;
|
|
short s_sectionRightZi;
|
|
short s_precision;
|
|
short s_precisionZi;
|
|
short s_capacity;
|
|
short s_capacityZi;
|
|
short s_notUseHistory;
|
|
short s_notUseHistoryZi;
|
|
short s_isDone;
|
|
short s_isDoneZi;
|
|
short s_useAutoconfigRule;
|
|
short s_useAutoconfigRuleZi;
|
|
char c_algId[36+1];
|
|
short s_algIdZi;
|
|
char c_ruleId[36+1];
|
|
short s_ruleIdZi;
|
|
short s_ruleMin;
|
|
short s_ruleMinZi;
|
|
short s_ruleMax;
|
|
short s_ruleMaxZi;
|
|
// arguments for Primary key
|
|
char c_k_tagName[50+1];
|
|
public:
|
|
//
|
|
// LTA Structure
|
|
struct STR_T_STA_PARAM{
|
|
char tagName[50+1];
|
|
char tagNameChinese[100+1];
|
|
short useOnline;
|
|
short useOffline;
|
|
long count;
|
|
char dataFromDate[27];
|
|
char dataToDate[27];
|
|
double sectionLeft;
|
|
double sectionRight;
|
|
short precision;
|
|
short capacity;
|
|
short notUseHistory;
|
|
short isDone;
|
|
short useAutoconfigRule;
|
|
char algId[36+1];
|
|
char ruleId[36+1];
|
|
short ruleMin;
|
|
short ruleMax;
|
|
}structTable;
|
|
// LTA Structure Zi
|
|
struct STR_T_STA_PARAMZi{
|
|
short tagNameChineseZi;
|
|
short useOnlineZi;
|
|
short useOfflineZi;
|
|
short countZi;
|
|
short dataFromDateZi;
|
|
short dataToDateZi;
|
|
short sectionLeftZi;
|
|
short sectionRightZi;
|
|
short precisionZi;
|
|
short capacityZi;
|
|
short notUseHistoryZi;
|
|
short isDoneZi;
|
|
short useAutoconfigRuleZi;
|
|
short algIdZi;
|
|
short ruleIdZi;
|
|
short ruleMinZi;
|
|
short ruleMaxZi;
|
|
}structTableZi;
|
|
//
|
|
//C O N S T R U C T O R S
|
|
//=======================
|
|
//
|
|
public:
|
|
T_STA_PARAM();
|
|
//D E S T R U C T O R S
|
|
//=======================
|
|
//
|
|
virtual ~T_STA_PARAM();
|
|
//
|
|
//C O P Y - C O N S T R U C T O R
|
|
//=======================
|
|
T_STA_PARAM(const T_STA_PARAM &inst);
|
|
// For Constructors with parameters the flag dbAccess
|
|
// informs you if the access was successfully or not
|
|
T_STA_PARAM( const char* arg1);
|
|
|
|
//methods
|
|
public:
|
|
char* getCreationTime() {return (char*)"2020.7.15 20:54:34";};
|
|
//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 );
|
|
|
|
|
|
// public methode initInsertKeys
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void initInsertKeys( 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_STA_PARAM operator+(const T_STA_PARAM &inst) const;
|
|
|
|
//
|
|
//O P E R A T O R =
|
|
//===================
|
|
//
|
|
public:
|
|
const T_STA_PARAM& operator=(const T_STA_PARAM &inst);
|
|
char* tagName() const;//{
|
|
//return((char*)c_tagName );
|
|
//}
|
|
|
|
|
|
void set_tagName( const char* arg );//{
|
|
//strncpy((char*)c_tagName , arg , sizeof(c_tagName));
|
|
//c_tagName[sizeof(c_tagName)-1] = '\0';
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* tagNameChinese() const;//{
|
|
//return((char*)c_tagNameChinese );
|
|
//}
|
|
|
|
short tagNameChineseZi() const;//{
|
|
//return( s_tagNameChineseZi);
|
|
//}
|
|
|
|
void set_tagNameChinese( const char* arg );//{
|
|
//strncpy((char*)c_tagNameChinese , arg , sizeof(c_tagNameChinese));
|
|
//c_tagNameChinese[sizeof(c_tagNameChinese)-1] = '\0';
|
|
//s_tagNameChineseZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_tagNameChineseZi( short arg ) ;//{
|
|
//s_tagNameChineseZi = arg;
|
|
//}
|
|
|
|
short useOnline() const;//{
|
|
//return((short)s_useOnline );
|
|
//}
|
|
|
|
short useOnlineZi() const;//{
|
|
//return( s_useOnlineZi);
|
|
//}
|
|
|
|
void set_useOnline( short arg );//{
|
|
//s_useOnline = arg;
|
|
//s_useOnlineZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_useOnlineZi( short arg ) ;//{
|
|
//s_useOnlineZi = arg;
|
|
//}
|
|
|
|
short useOffline() const;//{
|
|
//return((short)s_useOffline );
|
|
//}
|
|
|
|
short useOfflineZi() const;//{
|
|
//return( s_useOfflineZi);
|
|
//}
|
|
|
|
void set_useOffline( short arg );//{
|
|
//s_useOffline = arg;
|
|
//s_useOfflineZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_useOfflineZi( short arg ) ;//{
|
|
//s_useOfflineZi = arg;
|
|
//}
|
|
|
|
long count() const;//{
|
|
//return((long)l_count );
|
|
//}
|
|
|
|
short countZi() const;//{
|
|
//return( s_countZi);
|
|
//}
|
|
|
|
void set_count( long arg );//{
|
|
//l_count = arg;
|
|
//s_countZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_countZi( short arg ) ;//{
|
|
//s_countZi = arg;
|
|
//}
|
|
|
|
char* dataFromDate() const;//{
|
|
//return((char*)c_dataFromDate );
|
|
//}
|
|
|
|
short dataFromDateZi() const;//{
|
|
//return( s_dataFromDateZi);
|
|
//}
|
|
|
|
void set_dataFromDate( char* arg );//{
|
|
//strncpy((char*)c_dataFromDate , arg , sizeof(c_dataFromDate));
|
|
//c_dataFromDate[sizeof(c_dataFromDate)-1] = '\0';
|
|
//s_dataFromDateZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_dataFromDateZi( short arg ) ;//{
|
|
//s_dataFromDateZi = arg;
|
|
//}
|
|
|
|
char* dataToDate() const;//{
|
|
//return((char*)c_dataToDate );
|
|
//}
|
|
|
|
short dataToDateZi() const;//{
|
|
//return( s_dataToDateZi);
|
|
//}
|
|
|
|
void set_dataToDate( char* arg );//{
|
|
//strncpy((char*)c_dataToDate , arg , sizeof(c_dataToDate));
|
|
//c_dataToDate[sizeof(c_dataToDate)-1] = '\0';
|
|
//s_dataToDateZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_dataToDateZi( short arg ) ;//{
|
|
//s_dataToDateZi = arg;
|
|
//}
|
|
|
|
double sectionLeft() const;//{
|
|
//return((double)d_sectionLeft );
|
|
//}
|
|
|
|
short sectionLeftZi() const;//{
|
|
//return( s_sectionLeftZi);
|
|
//}
|
|
|
|
void set_sectionLeft( double arg );//{
|
|
//d_sectionLeft = arg;
|
|
//s_sectionLeftZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_sectionLeftZi( short arg ) ;//{
|
|
//s_sectionLeftZi = arg;
|
|
//}
|
|
|
|
double sectionRight() const;//{
|
|
//return((double)d_sectionRight );
|
|
//}
|
|
|
|
short sectionRightZi() const;//{
|
|
//return( s_sectionRightZi);
|
|
//}
|
|
|
|
void set_sectionRight( double arg );//{
|
|
//d_sectionRight = arg;
|
|
//s_sectionRightZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_sectionRightZi( short arg ) ;//{
|
|
//s_sectionRightZi = arg;
|
|
//}
|
|
|
|
short precision() const;//{
|
|
//return((short)s_precision );
|
|
//}
|
|
|
|
short precisionZi() const;//{
|
|
//return( s_precisionZi);
|
|
//}
|
|
|
|
void set_precision( short arg );//{
|
|
//s_precision = arg;
|
|
//s_precisionZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_precisionZi( short arg ) ;//{
|
|
//s_precisionZi = arg;
|
|
//}
|
|
|
|
short capacity() const;//{
|
|
//return((short)s_capacity );
|
|
//}
|
|
|
|
short capacityZi() const;//{
|
|
//return( s_capacityZi);
|
|
//}
|
|
|
|
void set_capacity( short arg );//{
|
|
//s_capacity = arg;
|
|
//s_capacityZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_capacityZi( short arg ) ;//{
|
|
//s_capacityZi = arg;
|
|
//}
|
|
|
|
short notUseHistory() const;//{
|
|
//return((short)s_notUseHistory );
|
|
//}
|
|
|
|
short notUseHistoryZi() const;//{
|
|
//return( s_notUseHistoryZi);
|
|
//}
|
|
|
|
void set_notUseHistory( short arg );//{
|
|
//s_notUseHistory = arg;
|
|
//s_notUseHistoryZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_notUseHistoryZi( short arg ) ;//{
|
|
//s_notUseHistoryZi = arg;
|
|
//}
|
|
|
|
short isDone() const;//{
|
|
//return((short)s_isDone );
|
|
//}
|
|
|
|
short isDoneZi() const;//{
|
|
//return( s_isDoneZi);
|
|
//}
|
|
|
|
void set_isDone( short arg );//{
|
|
//s_isDone = arg;
|
|
//s_isDoneZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_isDoneZi( short arg ) ;//{
|
|
//s_isDoneZi = arg;
|
|
//}
|
|
|
|
short useAutoconfigRule() const;//{
|
|
//return((short)s_useAutoconfigRule );
|
|
//}
|
|
|
|
short useAutoconfigRuleZi() const;//{
|
|
//return( s_useAutoconfigRuleZi);
|
|
//}
|
|
|
|
void set_useAutoconfigRule( short arg );//{
|
|
//s_useAutoconfigRule = arg;
|
|
//s_useAutoconfigRuleZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_useAutoconfigRuleZi( short arg ) ;//{
|
|
//s_useAutoconfigRuleZi = arg;
|
|
//}
|
|
|
|
char* algId() const;//{
|
|
//return((char*)c_algId );
|
|
//}
|
|
|
|
short algIdZi() const;//{
|
|
//return( s_algIdZi);
|
|
//}
|
|
|
|
void set_algId( const char* arg );//{
|
|
//strncpy((char*)c_algId , arg , sizeof(c_algId));
|
|
//c_algId[sizeof(c_algId)-1] = '\0';
|
|
//s_algIdZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_algIdZi( short arg ) ;//{
|
|
//s_algIdZi = arg;
|
|
//}
|
|
|
|
char* ruleId() const;//{
|
|
//return((char*)c_ruleId );
|
|
//}
|
|
|
|
short ruleIdZi() const;//{
|
|
//return( s_ruleIdZi);
|
|
//}
|
|
|
|
void set_ruleId( const char* arg );//{
|
|
//strncpy((char*)c_ruleId , arg , sizeof(c_ruleId));
|
|
//c_ruleId[sizeof(c_ruleId)-1] = '\0';
|
|
//s_ruleIdZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_ruleIdZi( short arg ) ;//{
|
|
//s_ruleIdZi = arg;
|
|
//}
|
|
|
|
short ruleMin() const;//{
|
|
//return((short)s_ruleMin );
|
|
//}
|
|
|
|
short ruleMinZi() const;//{
|
|
//return( s_ruleMinZi);
|
|
//}
|
|
|
|
void set_ruleMin( short arg );//{
|
|
//s_ruleMin = arg;
|
|
//s_ruleMinZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_ruleMinZi( short arg ) ;//{
|
|
//s_ruleMinZi = arg;
|
|
//}
|
|
|
|
short ruleMax() const;//{
|
|
//return((short)s_ruleMax );
|
|
//}
|
|
|
|
short ruleMaxZi() const;//{
|
|
//return( s_ruleMaxZi);
|
|
//}
|
|
|
|
void set_ruleMax( short arg );//{
|
|
//s_ruleMax = arg;
|
|
//s_ruleMaxZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_ruleMaxZi( short arg ) ;//{
|
|
//s_ruleMaxZi = arg;
|
|
//}
|
|
|
|
public:
|
|
// methodes for Primary key
|
|
char* k_tagName();//{
|
|
//return((char*)c_k_tagName );
|
|
//}
|
|
|
|
void set_k_tagName( char* arg );//{
|
|
//strncpy((char*)c_k_tagName , arg , sizeof(c_k_tagName));
|
|
//c_k_tagName[sizeof(c_k_tagName)-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_STA_PARAM");
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getSqlCode();//{
|
|
//return( db.dbSqlCode);
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getRowsProcessed();//{
|
|
//return( db.dbRowsProcessed);
|
|
//}
|
|
};
|
|
#endif
|