// Version: 2019.5.13 12:9:21 #ifndef _T_EPDO_DATA_H #define _T_EPDO_DATA_H #include #include #include #ifdef _MSC_VER #pragma warning(disable:4996) #pragma warning(disable:4267) #endif #include "T_EPDO_DATADBAX.h" class T_EPDO_DATA{ friend class T_EPDO_DATADBAX; private: //aggregation to DB Class T_EPDO_DATADBAX 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_entId[20+1]; char c_extId[20+1]; short s_extIdZi; char c_sample_time[17+1]; short s_sample_timeZi; long l_entry_scrap_weight_t; short s_entry_scrap_weight_tZi; long l_entry_scrap_weight_b; short s_entry_scrap_weight_bZi; long l_exit_scrap_weight_t; short s_exit_scrap_weight_tZi; long l_exit_scrap_weight_b; short s_exit_scrap_weight_bZi; long l_exit_sample_weight_t; short s_exit_sample_weight_tZi; long l_exit_sample_weight_b; short s_exit_sample_weight_bZi; double d_exit_scrap_len_t; short s_exit_scrap_len_tZi; double d_exit_scrap_len_b; short s_exit_scrap_len_bZi; char c_c_Reserve[20+1]; short s_c_ReserveZi; char c_TC[27]; short s_TCZi; // arguments for Primary key char c_k_entId[20+1]; public: // // LTA Structure struct STR_T_EPDO_DATA{ char entId[20+1]; char extId[20+1]; char sample_time[17+1]; int entry_scrap_weight_t; int entry_scrap_weight_b; int exit_scrap_weight_t; int exit_scrap_weight_b; int exit_sample_weight_t; int exit_sample_weight_b; double exit_scrap_len_t; double exit_scrap_len_b; char c_Reserve[20+1]; char TC[27]; }structTable; // LTA Structure Zi struct STR_T_EPDO_DATAZi{ short extIdZi; short sample_timeZi; short entry_scrap_weight_tZi; short entry_scrap_weight_bZi; short exit_scrap_weight_tZi; short exit_scrap_weight_bZi; short exit_sample_weight_tZi; short exit_sample_weight_bZi; short exit_scrap_len_tZi; short exit_scrap_len_bZi; short c_ReserveZi; short TCZi; }structTableZi; // //C O N S T R U C T O R S //======================= // public: T_EPDO_DATA(); //D E S T R U C T O R S //======================= // virtual ~T_EPDO_DATA(); // //C O P Y - C O N S T R U C T O R //======================= T_EPDO_DATA(const T_EPDO_DATA &inst); // For Constructors with parameters the flag dbAccess // informs you if the access was successfully or not T_EPDO_DATA( const char* arg1); //methods public: char* getCreationTime() {return (char*)"2019.5.13 12:9:21";}; //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_EPDO_DATA operator+(const T_EPDO_DATA &inst) const; // //O P E R A T O R = //=================== // public: const T_EPDO_DATA& operator=(const T_EPDO_DATA &inst); char* entId() const;//{ //return((char*)c_entId ); //} void set_entId( const char* arg );//{ //strncpy((char*)c_entId , arg , sizeof(c_entId)); //c_entId[sizeof(c_entId)-1] = '\0'; //return; //} char* extId() const;//{ //return((char*)c_extId ); //} short extIdZi() const;//{ //return( s_extIdZi); //} void set_extId( const char* arg );//{ //strncpy((char*)c_extId , arg , sizeof(c_extId)); //c_extId[sizeof(c_extId)-1] = '\0'; //s_extIdZi= 0; //return; //} void set_extIdZi( short arg ) ;//{ //s_extIdZi = arg; //} char* sample_time() const;//{ //return((char*)c_sample_time ); //} short sample_timeZi() const;//{ //return( s_sample_timeZi); //} void set_sample_time( const char* arg );//{ //strncpy((char*)c_sample_time , arg , sizeof(c_sample_time)); //c_sample_time[sizeof(c_sample_time)-1] = '\0'; //s_sample_timeZi= 0; //return; //} void set_sample_timeZi( short arg ) ;//{ //s_sample_timeZi = arg; //} long entry_scrap_weight_t() const;//{ //return((long)l_entry_scrap_weight_t ); //} short entry_scrap_weight_tZi() const;//{ //return( s_entry_scrap_weight_tZi); //} void set_entry_scrap_weight_t( long arg );//{ //l_entry_scrap_weight_t = arg; //s_entry_scrap_weight_tZi= 0; //return; //} void set_entry_scrap_weight_tZi( short arg ) ;//{ //s_entry_scrap_weight_tZi = arg; //} long entry_scrap_weight_b() const;//{ //return((long)l_entry_scrap_weight_b ); //} short entry_scrap_weight_bZi() const;//{ //return( s_entry_scrap_weight_bZi); //} void set_entry_scrap_weight_b( long arg );//{ //l_entry_scrap_weight_b = arg; //s_entry_scrap_weight_bZi= 0; //return; //} void set_entry_scrap_weight_bZi( short arg ) ;//{ //s_entry_scrap_weight_bZi = arg; //} long exit_scrap_weight_t() const;//{ //return((long)l_exit_scrap_weight_t ); //} short exit_scrap_weight_tZi() const;//{ //return( s_exit_scrap_weight_tZi); //} void set_exit_scrap_weight_t( long arg );//{ //l_exit_scrap_weight_t = arg; //s_exit_scrap_weight_tZi= 0; //return; //} void set_exit_scrap_weight_tZi( short arg ) ;//{ //s_exit_scrap_weight_tZi = arg; //} long exit_scrap_weight_b() const;//{ //return((long)l_exit_scrap_weight_b ); //} short exit_scrap_weight_bZi() const;//{ //return( s_exit_scrap_weight_bZi); //} void set_exit_scrap_weight_b( long arg );//{ //l_exit_scrap_weight_b = arg; //s_exit_scrap_weight_bZi= 0; //return; //} void set_exit_scrap_weight_bZi( short arg ) ;//{ //s_exit_scrap_weight_bZi = arg; //} long exit_sample_weight_t() const;//{ //return((long)l_exit_sample_weight_t ); //} short exit_sample_weight_tZi() const;//{ //return( s_exit_sample_weight_tZi); //} void set_exit_sample_weight_t( long arg );//{ //l_exit_sample_weight_t = arg; //s_exit_sample_weight_tZi= 0; //return; //} void set_exit_sample_weight_tZi( short arg ) ;//{ //s_exit_sample_weight_tZi = arg; //} long exit_sample_weight_b() const;//{ //return((long)l_exit_sample_weight_b ); //} short exit_sample_weight_bZi() const;//{ //return( s_exit_sample_weight_bZi); //} void set_exit_sample_weight_b( long arg );//{ //l_exit_sample_weight_b = arg; //s_exit_sample_weight_bZi= 0; //return; //} void set_exit_sample_weight_bZi( short arg ) ;//{ //s_exit_sample_weight_bZi = arg; //} double exit_scrap_len_t() const;//{ //return((double)d_exit_scrap_len_t ); //} short exit_scrap_len_tZi() const;//{ //return( s_exit_scrap_len_tZi); //} void set_exit_scrap_len_t( double arg );//{ //d_exit_scrap_len_t = arg; //s_exit_scrap_len_tZi= 0; //return; //} void set_exit_scrap_len_tZi( short arg ) ;//{ //s_exit_scrap_len_tZi = arg; //} double exit_scrap_len_b() const;//{ //return((double)d_exit_scrap_len_b ); //} short exit_scrap_len_bZi() const;//{ //return( s_exit_scrap_len_bZi); //} void set_exit_scrap_len_b( double arg );//{ //d_exit_scrap_len_b = arg; //s_exit_scrap_len_bZi= 0; //return; //} void set_exit_scrap_len_bZi( short arg ) ;//{ //s_exit_scrap_len_bZi = arg; //} char* c_Reserve() const;//{ //return((char*)c_c_Reserve ); //} short c_ReserveZi() const;//{ //return( s_c_ReserveZi); //} void set_c_Reserve( const char* arg );//{ //strncpy((char*)c_c_Reserve , arg , sizeof(c_c_Reserve)); //c_c_Reserve[sizeof(c_c_Reserve)-1] = '\0'; //s_c_ReserveZi= 0; //return; //} void set_c_ReserveZi( short arg ) ;//{ //s_c_ReserveZi = arg; //} char* TC() const;//{ //return((char*)c_TC ); //} short TCZi() const;//{ //return( s_TCZi); //} void set_TC( char* arg );//{ //strncpy((char*)c_TC , arg , sizeof(c_TC)); //c_TC[sizeof(c_TC)-1] = '\0'; //s_TCZi= 0; //return; //} void set_TCZi( short arg ) ;//{ //s_TCZi = arg; //} public: // methodes for Primary key char* k_entId();//{ //return((char*)c_k_entId ); //} void set_k_entId( char* arg );//{ //strncpy((char*)c_k_entId , arg , sizeof(c_k_entId)); //c_k_entId[sizeof(c_k_entId)-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_EPDO_DATA"); //} /////////////////////////////////////////////////// int getSqlCode();//{ //return( db.dbSqlCode); //} /////////////////////////////////////////////////// int getRowsProcessed();//{ //return( db.dbRowsProcessed); //} }; #endif