// Version: 2018.7.20 13:7:35 #ifndef _T_SFT_DATA_H #define _T_SFT_DATA_H #include #include #include #ifdef _MSC_VER #pragma warning(disable:4996) #pragma warning(disable:4267) #endif #include "T_SFT_DATADBAX.h" class T_SFT_DATA{ friend class T_SFT_DATADBAX; private: //aggregation to DB Class T_SFT_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_ProdDay[27]; char c_Shift[2+1]; char c_Turn[2+1]; short s_TurnZi; char c_LogInTime[27]; short s_LogInTimeZi; char c_LogOutTime[27]; short s_LogOutTimeZi; short s_IsGenerated; short s_IsGeneratedZi; long l_CoilsIn; short s_CoilsInZi; long l_CoilsOut; short s_CoilsOutZi; long l_CoilWeightIn; short s_CoilWeightInZi; long l_CoilWeightOut; short s_CoilWeightOutZi; double d_AveLineSpeed; short s_AveLineSpeedZi; double d_GainRatio; short s_GainRatioZi; long l_OperatingTime; short s_OperatingTimeZi; long l_TotalTime; short s_TotalTimeZi; long l_TotalDownNumber; short s_TotalDownNumberZi; long l_TotalDownTime; short s_TotalDownTimeZi; double d_Lng; short s_LngZi; double d_N2; short s_N2Zi; double d_H2; short s_H2Zi; double d_Steam; short s_SteamZi; double d_Recirculation; short s_RecirculationZi; double d_Filtered; short s_FilteredZi; double d_Demineralized; short s_DemineralizedZi; double d_Electricity; short s_ElectricityZi; double d_Air; short s_AirZi; 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_ProdDay[27]; char c_k_Shift[2+1]; public: // // LTA Structure struct STR_T_SFT_DATA{ char ProdDay[27]; char Shift[2+1]; char Turn[2+1]; char LogInTime[27]; char LogOutTime[27]; short IsGenerated; int CoilsIn; int CoilsOut; int CoilWeightIn; int CoilWeightOut; double AveLineSpeed; double GainRatio; int OperatingTime; int TotalTime; int TotalDownNumber; int TotalDownTime; double Lng; double N2; double H2; double Steam; double Recirculation; double Filtered; double Demineralized; double Electricity; double Air; char toc[27]; char tom[27]; char mop[121]; char mou[31]; }structTable; // LTA Structure Zi struct STR_T_SFT_DATAZi{ short TurnZi; short LogInTimeZi; short LogOutTimeZi; short IsGeneratedZi; short CoilsInZi; short CoilsOutZi; short CoilWeightInZi; short CoilWeightOutZi; short AveLineSpeedZi; short GainRatioZi; short OperatingTimeZi; short TotalTimeZi; short TotalDownNumberZi; short TotalDownTimeZi; short LngZi; short N2Zi; short H2Zi; short SteamZi; short RecirculationZi; short FilteredZi; short DemineralizedZi; short ElectricityZi; short AirZi; short tocZi; short tomZi; short mopZi; short mouZi; }structTableZi; // //C O N S T R U C T O R S //======================= // public: T_SFT_DATA(); //D E S T R U C T O R S //======================= // virtual ~T_SFT_DATA(); // //C O P Y - C O N S T R U C T O R //======================= T_SFT_DATA(const T_SFT_DATA &inst); // For Constructors with parameters the flag dbAccess // informs you if the access was successfully or not T_SFT_DATA( char* arg1,const char* arg2); //methods public: char* getCreationTime() {return (char*)"2018.7.20 13:7:35";}; //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(char* arg1 , const char* arg2 ); // public methode initInsertKeys // // this methode stores the unique key attributes // void initInsertKeys( 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_SFT_DATA operator+(const T_SFT_DATA &inst) const; // //O P E R A T O R = //=================== // public: const T_SFT_DATA& operator=(const T_SFT_DATA &inst); char* ProdDay() const;//{ //return((char*)c_ProdDay ); //} void set_ProdDay( char* arg );//{ //strncpy((char*)c_ProdDay , arg , sizeof(c_ProdDay)); //c_ProdDay[sizeof(c_ProdDay)-1] = '\0'; //return; //} char* Shift() const;//{ //return((char*)c_Shift ); //} void set_Shift( const char* arg );//{ //strncpy((char*)c_Shift , arg , sizeof(c_Shift)); //c_Shift[sizeof(c_Shift)-1] = '\0'; //return; //} char* Turn() const;//{ //return((char*)c_Turn ); //} short TurnZi() const;//{ //return( s_TurnZi); //} void set_Turn( const char* arg );//{ //strncpy((char*)c_Turn , arg , sizeof(c_Turn)); //c_Turn[sizeof(c_Turn)-1] = '\0'; //s_TurnZi= 0; //return; //} void set_TurnZi( short arg ) ;//{ //s_TurnZi = arg; //} char* LogInTime() const;//{ //return((char*)c_LogInTime ); //} short LogInTimeZi() const;//{ //return( s_LogInTimeZi); //} void set_LogInTime( char* arg );//{ //strncpy((char*)c_LogInTime , arg , sizeof(c_LogInTime)); //c_LogInTime[sizeof(c_LogInTime)-1] = '\0'; //s_LogInTimeZi= 0; //return; //} void set_LogInTimeZi( short arg ) ;//{ //s_LogInTimeZi = arg; //} char* LogOutTime() const;//{ //return((char*)c_LogOutTime ); //} short LogOutTimeZi() const;//{ //return( s_LogOutTimeZi); //} void set_LogOutTime( char* arg );//{ //strncpy((char*)c_LogOutTime , arg , sizeof(c_LogOutTime)); //c_LogOutTime[sizeof(c_LogOutTime)-1] = '\0'; //s_LogOutTimeZi= 0; //return; //} void set_LogOutTimeZi( short arg ) ;//{ //s_LogOutTimeZi = arg; //} short IsGenerated() const;//{ //return((short)s_IsGenerated ); //} short IsGeneratedZi() const;//{ //return( s_IsGeneratedZi); //} void set_IsGenerated( short arg );//{ //s_IsGenerated = arg; //s_IsGeneratedZi= 0; //return; //} void set_IsGeneratedZi( short arg ) ;//{ //s_IsGeneratedZi = arg; //} long CoilsIn() const;//{ //return((long)l_CoilsIn ); //} short CoilsInZi() const;//{ //return( s_CoilsInZi); //} void set_CoilsIn( long arg );//{ //l_CoilsIn = arg; //s_CoilsInZi= 0; //return; //} void set_CoilsInZi( short arg ) ;//{ //s_CoilsInZi = arg; //} long CoilsOut() const;//{ //return((long)l_CoilsOut ); //} short CoilsOutZi() const;//{ //return( s_CoilsOutZi); //} void set_CoilsOut( long arg );//{ //l_CoilsOut = arg; //s_CoilsOutZi= 0; //return; //} void set_CoilsOutZi( short arg ) ;//{ //s_CoilsOutZi = arg; //} long CoilWeightIn() const;//{ //return((long)l_CoilWeightIn ); //} short CoilWeightInZi() const;//{ //return( s_CoilWeightInZi); //} void set_CoilWeightIn( long arg );//{ //l_CoilWeightIn = arg; //s_CoilWeightInZi= 0; //return; //} void set_CoilWeightInZi( short arg ) ;//{ //s_CoilWeightInZi = arg; //} long CoilWeightOut() const;//{ //return((long)l_CoilWeightOut ); //} short CoilWeightOutZi() const;//{ //return( s_CoilWeightOutZi); //} void set_CoilWeightOut( long arg );//{ //l_CoilWeightOut = arg; //s_CoilWeightOutZi= 0; //return; //} void set_CoilWeightOutZi( short arg ) ;//{ //s_CoilWeightOutZi = arg; //} double AveLineSpeed() const;//{ //return((double)d_AveLineSpeed ); //} short AveLineSpeedZi() const;//{ //return( s_AveLineSpeedZi); //} void set_AveLineSpeed( double arg );//{ //d_AveLineSpeed = arg; //s_AveLineSpeedZi= 0; //return; //} void set_AveLineSpeedZi( short arg ) ;//{ //s_AveLineSpeedZi = arg; //} double GainRatio() const;//{ //return((double)d_GainRatio ); //} short GainRatioZi() const;//{ //return( s_GainRatioZi); //} void set_GainRatio( double arg );//{ //d_GainRatio = arg; //s_GainRatioZi= 0; //return; //} void set_GainRatioZi( short arg ) ;//{ //s_GainRatioZi = arg; //} long OperatingTime() const;//{ //return((long)l_OperatingTime ); //} short OperatingTimeZi() const;//{ //return( s_OperatingTimeZi); //} void set_OperatingTime( long arg );//{ //l_OperatingTime = arg; //s_OperatingTimeZi= 0; //return; //} void set_OperatingTimeZi( short arg ) ;//{ //s_OperatingTimeZi = arg; //} long TotalTime() const;//{ //return((long)l_TotalTime ); //} short TotalTimeZi() const;//{ //return( s_TotalTimeZi); //} void set_TotalTime( long arg );//{ //l_TotalTime = arg; //s_TotalTimeZi= 0; //return; //} void set_TotalTimeZi( short arg ) ;//{ //s_TotalTimeZi = arg; //} long TotalDownNumber() const;//{ //return((long)l_TotalDownNumber ); //} short TotalDownNumberZi() const;//{ //return( s_TotalDownNumberZi); //} void set_TotalDownNumber( long arg );//{ //l_TotalDownNumber = arg; //s_TotalDownNumberZi= 0; //return; //} void set_TotalDownNumberZi( short arg ) ;//{ //s_TotalDownNumberZi = arg; //} long TotalDownTime() const;//{ //return((long)l_TotalDownTime ); //} short TotalDownTimeZi() const;//{ //return( s_TotalDownTimeZi); //} void set_TotalDownTime( long arg );//{ //l_TotalDownTime = arg; //s_TotalDownTimeZi= 0; //return; //} void set_TotalDownTimeZi( short arg ) ;//{ //s_TotalDownTimeZi = arg; //} double Lng() const;//{ //return((double)d_Lng ); //} short LngZi() const;//{ //return( s_LngZi); //} void set_Lng( double arg );//{ //d_Lng = arg; //s_LngZi= 0; //return; //} void set_LngZi( short arg ) ;//{ //s_LngZi = arg; //} double N2() const;//{ //return((double)d_N2 ); //} short N2Zi() const;//{ //return( s_N2Zi); //} void set_N2( double arg );//{ //d_N2 = arg; //s_N2Zi= 0; //return; //} void set_N2Zi( short arg ) ;//{ //s_N2Zi = arg; //} double H2() const;//{ //return((double)d_H2 ); //} short H2Zi() const;//{ //return( s_H2Zi); //} void set_H2( double arg );//{ //d_H2 = arg; //s_H2Zi= 0; //return; //} void set_H2Zi( short arg ) ;//{ //s_H2Zi = arg; //} double Steam() const;//{ //return((double)d_Steam ); //} short SteamZi() const;//{ //return( s_SteamZi); //} void set_Steam( double arg );//{ //d_Steam = arg; //s_SteamZi= 0; //return; //} void set_SteamZi( short arg ) ;//{ //s_SteamZi = arg; //} double Recirculation() const;//{ //return((double)d_Recirculation ); //} short RecirculationZi() const;//{ //return( s_RecirculationZi); //} void set_Recirculation( double arg );//{ //d_Recirculation = arg; //s_RecirculationZi= 0; //return; //} void set_RecirculationZi( short arg ) ;//{ //s_RecirculationZi = arg; //} double Filtered() const;//{ //return((double)d_Filtered ); //} short FilteredZi() const;//{ //return( s_FilteredZi); //} void set_Filtered( double arg );//{ //d_Filtered = arg; //s_FilteredZi= 0; //return; //} void set_FilteredZi( short arg ) ;//{ //s_FilteredZi = arg; //} double Demineralized() const;//{ //return((double)d_Demineralized ); //} short DemineralizedZi() const;//{ //return( s_DemineralizedZi); //} void set_Demineralized( double arg );//{ //d_Demineralized = arg; //s_DemineralizedZi= 0; //return; //} void set_DemineralizedZi( short arg ) ;//{ //s_DemineralizedZi = arg; //} double Electricity() const;//{ //return((double)d_Electricity ); //} short ElectricityZi() const;//{ //return( s_ElectricityZi); //} void set_Electricity( double arg );//{ //d_Electricity = arg; //s_ElectricityZi= 0; //return; //} void set_ElectricityZi( short arg ) ;//{ //s_ElectricityZi = arg; //} double Air() const;//{ //return((double)d_Air ); //} short AirZi() const;//{ //return( s_AirZi); //} void set_Air( double arg );//{ //d_Air = arg; //s_AirZi= 0; //return; //} void set_AirZi( short arg ) ;//{ //s_AirZi = 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_ProdDay();//{ //return((char*)c_k_ProdDay ); //} void set_k_ProdDay( char* arg );//{ //strncpy((char*)c_k_ProdDay , arg , sizeof(c_k_ProdDay)); //c_k_ProdDay[sizeof(c_k_ProdDay)-1] = '\0'; //return; //} char* k_Shift();//{ //return((char*)c_k_Shift ); //} void set_k_Shift( char* arg );//{ //strncpy((char*)c_k_Shift , arg , sizeof(c_k_Shift)); //c_k_Shift[sizeof(c_k_Shift)-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_SFT_DATA"); //} /////////////////////////////////////////////////// int getSqlCode();//{ //return( db.dbSqlCode); //} /////////////////////////////////////////////////// int getRowsProcessed();//{ //return( db.dbRowsProcessed); //} }; #endif