439 lines
11 KiB
C++
439 lines
11 KiB
C++
// Version: 2015.8.8 15:13:13
|
|
|
|
// File: T_CYC_EXTSEG131.cpp
|
|
|
|
#include "T_CYC_EXTSEG131.h"
|
|
|
|
T_CYC_EXTSEG131::T_CYC_EXTSEG131(){
|
|
// initialise all membervariables
|
|
initial();
|
|
}
|
|
T_CYC_EXTSEG131::~T_CYC_EXTSEG131(){
|
|
}
|
|
void T_CYC_EXTSEG131::initial(){
|
|
// initialise all membervariables
|
|
set_SeqNo(0);
|
|
set_EnCoilId("");
|
|
set_EnCoilIdZi(-1);
|
|
set_ExCoilId("");
|
|
set_ExCoilIdZi(-1);
|
|
set_TRTension(0.0);
|
|
set_TRTensionZi(-1);
|
|
set_TC("");
|
|
set_TCZi(-1);
|
|
set_muId(0);
|
|
set_muCreator("");
|
|
set_musId(0);
|
|
// initialies Primary key members
|
|
set_k_muId(0);
|
|
set_k_muCreator("");
|
|
set_k_musId(0);
|
|
set_k_SeqNo(0);
|
|
}
|
|
T_CYC_EXTSEG131::T_CYC_EXTSEG131(MU_CODE muCode , long arg1)
|
|
{
|
|
initial();
|
|
setPrimKey (muCode , arg1);
|
|
//read DB record
|
|
dbAccess = true;
|
|
dbMessage = readDB();
|
|
if ( dbMessage != NULL ) {dbAccess = false;}
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131:: execute(const char* sql , long* count){
|
|
return( db.execute( sql , count ) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131:: dbCommit(){
|
|
return( db.dbCommit( ) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131:: dbRollback(){
|
|
return( db.dbRollback( ) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::readDB(){
|
|
// DB Trace is off
|
|
return( db.readDB(*this) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::updateDB(){
|
|
// DB Trace is off
|
|
return( db.updateDB(*this) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::insertDB(){
|
|
// DB Trace is off
|
|
return( db.insertDB(*this) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::deleteDB(){
|
|
// DB Trace is off
|
|
return( db.deleteDB(*this) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::deleteDB(const char * where, long* count){
|
|
// DB Trace is off
|
|
return( db.deleteDB( where , count ) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::openSetDB(const char * where,const char* order){
|
|
// DB Trace is off
|
|
return( db.openSetDB( where , order ) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::countDB(const char * where, long* count){
|
|
// DB Trace is off
|
|
return( db.countDB( where , count ) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::getSetDB(){
|
|
// DB Trace is off
|
|
return( db.getSetDB(*this) );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::closeSetDB(){
|
|
// DB Trace is off
|
|
return( db.closeSetDB() );
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::storeDB(){
|
|
char* ret = NULL;
|
|
setKeysFromRecord();
|
|
ret=db.updateDB(*this);
|
|
if(ret != NULL){
|
|
ret=db.insertDB(*this);
|
|
if(ret != NULL){
|
|
dbAccess = false;
|
|
return(ret);
|
|
}
|
|
}
|
|
return(ret);
|
|
}
|
|
|
|
// public methode setPrimKey T_CYC_EXTSEG131
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void T_CYC_EXTSEG131::setPrimKey( long arg1 , const char* arg2 , short arg3 , long arg4 ){
|
|
l_k_muId = arg1;
|
|
strncpy( (char*)c_k_muCreator , arg2 , sizeof(c_k_muCreator) );
|
|
c_k_muCreator[sizeof(c_k_muCreator)-1] = '\0';
|
|
s_k_musId = arg3;
|
|
l_k_SeqNo = arg4;
|
|
} // end of methode
|
|
void T_CYC_EXTSEG131::setPrimKey( MU_CODE muCode , long arg1 ){
|
|
setPrimKey ( muCode.actual.muId , muCode.actual.muCreator , muCode.actual.musId , arg1);
|
|
} // end of methode
|
|
|
|
void T_CYC_EXTSEG131::initInsertKeys( long arg1 , const char* arg2 , short arg3 , long arg4 ){
|
|
setPrimKey ( arg1 , arg2 , arg3 , arg4);
|
|
l_muId = arg1;
|
|
strncpy( (char*)c_muCreator , arg2 , sizeof(c_muCreator) );
|
|
c_muCreator[sizeof(c_muCreator)-1] = '\0';
|
|
s_musId = arg3;
|
|
l_SeqNo = arg4;
|
|
} // end of methode
|
|
void T_CYC_EXTSEG131::initInsertKeys( MU_CODE muCode , long arg1 ){
|
|
initInsertKeys ( muCode.actual.muId , muCode.actual.muCreator , muCode.actual.musId , arg1);
|
|
} // end of methode
|
|
void T_CYC_EXTSEG131::setKeysFromRecord(){
|
|
set_k_muId( muId() );
|
|
set_k_muCreator( muCreator() );
|
|
set_k_musId( musId() );
|
|
set_k_SeqNo( SeqNo() );
|
|
} // end of methode
|
|
//
|
|
//O P E R A T O R +
|
|
//===================
|
|
//
|
|
T_CYC_EXTSEG131 T_CYC_EXTSEG131::operator+(const T_CYC_EXTSEG131 &inst) const{
|
|
T_CYC_EXTSEG131 ptrT_CYC_EXTSEG131(*this);
|
|
//----------------------------------------------------------
|
|
ptrT_CYC_EXTSEG131.set_SeqNo(inst.SeqNo());
|
|
//----------------------------------------------------------
|
|
if(inst.EnCoilIdZi() != -1){
|
|
ptrT_CYC_EXTSEG131.set_EnCoilId(inst.EnCoilId());
|
|
ptrT_CYC_EXTSEG131.set_EnCoilIdZi(inst.EnCoilIdZi());
|
|
}
|
|
//----------------------------------------------------------
|
|
if(inst.ExCoilIdZi() != -1){
|
|
ptrT_CYC_EXTSEG131.set_ExCoilId(inst.ExCoilId());
|
|
ptrT_CYC_EXTSEG131.set_ExCoilIdZi(inst.ExCoilIdZi());
|
|
}
|
|
//----------------------------------------------------------
|
|
if(inst.TRTensionZi() != -1){
|
|
ptrT_CYC_EXTSEG131.set_TRTension(inst.TRTension());
|
|
ptrT_CYC_EXTSEG131.set_TRTensionZi(inst.TRTensionZi());
|
|
}
|
|
//----------------------------------------------------------
|
|
if(inst.TCZi() != -1){
|
|
ptrT_CYC_EXTSEG131.set_TC(inst.TC());
|
|
ptrT_CYC_EXTSEG131.set_TCZi(inst.TCZi());
|
|
}
|
|
//----------------------------------------------------------
|
|
ptrT_CYC_EXTSEG131.set_muId(inst.muId());
|
|
//----------------------------------------------------------
|
|
ptrT_CYC_EXTSEG131.set_muCreator(inst.muCreator());
|
|
//----------------------------------------------------------
|
|
ptrT_CYC_EXTSEG131.set_musId(inst.musId());
|
|
return (ptrT_CYC_EXTSEG131);
|
|
}
|
|
|
|
//
|
|
//O P E R A T O R =
|
|
//===================
|
|
//
|
|
const T_CYC_EXTSEG131& T_CYC_EXTSEG131::operator=(const T_CYC_EXTSEG131 &inst){
|
|
//----------------------------------------------------------
|
|
this->set_SeqNo(inst.SeqNo());
|
|
//----------------------------------------------------------
|
|
this->set_EnCoilId(inst.EnCoilId());
|
|
this->set_EnCoilIdZi(inst.EnCoilIdZi());
|
|
//----------------------------------------------------------
|
|
this->set_ExCoilId(inst.ExCoilId());
|
|
this->set_ExCoilIdZi(inst.ExCoilIdZi());
|
|
//----------------------------------------------------------
|
|
this->set_TRTension(inst.TRTension());
|
|
this->set_TRTensionZi(inst.TRTensionZi());
|
|
//----------------------------------------------------------
|
|
this->set_TC(inst.TC());
|
|
this->set_TCZi(inst.TCZi());
|
|
//----------------------------------------------------------
|
|
this->set_muId(inst.muId());
|
|
//----------------------------------------------------------
|
|
this->set_muCreator(inst.muCreator());
|
|
//----------------------------------------------------------
|
|
this->set_musId(inst.musId());
|
|
return (*this);
|
|
}
|
|
//
|
|
//C O P Y - C O N S T R U C T O R
|
|
//===================
|
|
//
|
|
T_CYC_EXTSEG131::T_CYC_EXTSEG131(const T_CYC_EXTSEG131 &inst){
|
|
//----------------------------------------------------------
|
|
this->set_SeqNo(inst.SeqNo());
|
|
//----------------------------------------------------------
|
|
this->set_EnCoilId(inst.EnCoilId());
|
|
this->set_EnCoilIdZi(inst.EnCoilIdZi());
|
|
//----------------------------------------------------------
|
|
this->set_ExCoilId(inst.ExCoilId());
|
|
this->set_ExCoilIdZi(inst.ExCoilIdZi());
|
|
//----------------------------------------------------------
|
|
this->set_TRTension(inst.TRTension());
|
|
this->set_TRTensionZi(inst.TRTensionZi());
|
|
//----------------------------------------------------------
|
|
this->set_TC(inst.TC());
|
|
this->set_TCZi(inst.TCZi());
|
|
//----------------------------------------------------------
|
|
this->set_muId(inst.muId());
|
|
//----------------------------------------------------------
|
|
this->set_muCreator(inst.muCreator());
|
|
//----------------------------------------------------------
|
|
this->set_musId(inst.musId());
|
|
}
|
|
long T_CYC_EXTSEG131::SeqNo() const{
|
|
return((long)l_SeqNo );
|
|
}
|
|
|
|
|
|
void T_CYC_EXTSEG131::set_SeqNo( long arg ){
|
|
l_SeqNo = arg;
|
|
return;
|
|
}
|
|
|
|
|
|
char* T_CYC_EXTSEG131::EnCoilId() const{
|
|
return((char*)c_EnCoilId );
|
|
}
|
|
|
|
short T_CYC_EXTSEG131::EnCoilIdZi() const{
|
|
return( s_EnCoilIdZi);
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_EnCoilId( const char* arg ){
|
|
strncpy((char*)c_EnCoilId , arg , sizeof(c_EnCoilId));
|
|
c_EnCoilId[sizeof(c_EnCoilId)-1] = '\0';
|
|
s_EnCoilIdZi= 0;
|
|
return;
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_EnCoilIdZi( short arg ) {
|
|
s_EnCoilIdZi = arg;
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::ExCoilId() const{
|
|
return((char*)c_ExCoilId );
|
|
}
|
|
|
|
short T_CYC_EXTSEG131::ExCoilIdZi() const{
|
|
return( s_ExCoilIdZi);
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_ExCoilId( const char* arg ){
|
|
strncpy((char*)c_ExCoilId , arg , sizeof(c_ExCoilId));
|
|
c_ExCoilId[sizeof(c_ExCoilId)-1] = '\0';
|
|
s_ExCoilIdZi= 0;
|
|
return;
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_ExCoilIdZi( short arg ) {
|
|
s_ExCoilIdZi = arg;
|
|
}
|
|
|
|
double T_CYC_EXTSEG131::TRTension() const{
|
|
return((double)d_TRTension );
|
|
}
|
|
|
|
short T_CYC_EXTSEG131::TRTensionZi() const{
|
|
return( s_TRTensionZi);
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_TRTension( double arg ){
|
|
d_TRTension = arg;
|
|
s_TRTensionZi= 0;
|
|
return;
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_TRTensionZi( short arg ) {
|
|
s_TRTensionZi = arg;
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::TC() const{
|
|
return((char*)c_TC );
|
|
}
|
|
|
|
short T_CYC_EXTSEG131::TCZi() const{
|
|
return( s_TCZi);
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_TC( char* arg ){
|
|
strncpy((char*)c_TC , arg , sizeof(c_TC));
|
|
c_TC[sizeof(c_TC)-1] = '\0';
|
|
s_TCZi= 0;
|
|
return;
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_TCZi( short arg ) {
|
|
s_TCZi = arg;
|
|
}
|
|
|
|
long T_CYC_EXTSEG131::muId() const{
|
|
return((long)l_muId );
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_muId( long arg ){
|
|
l_muId = arg;
|
|
return;
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::muCreator() const{
|
|
return((char*)c_muCreator );
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_muCreator( const char* arg ){
|
|
strncpy((char*)c_muCreator , arg , sizeof(c_muCreator));
|
|
c_muCreator[sizeof(c_muCreator)-1] = '\0';
|
|
return;
|
|
}
|
|
|
|
short T_CYC_EXTSEG131::musId() const{
|
|
return((short)s_musId );
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_musId( short arg ){
|
|
s_musId = arg;
|
|
return;
|
|
}
|
|
|
|
// methodes for Primary key
|
|
long T_CYC_EXTSEG131::k_muId(){
|
|
return((long)l_k_muId );
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_k_muId( long arg ){
|
|
l_k_muId = arg;
|
|
return;
|
|
}
|
|
|
|
char* T_CYC_EXTSEG131::k_muCreator(){
|
|
return((char*)c_k_muCreator );
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::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 T_CYC_EXTSEG131::k_musId(){
|
|
return((short)s_k_musId );
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_k_musId( short arg ){
|
|
s_k_musId = arg;
|
|
return;
|
|
}
|
|
|
|
long T_CYC_EXTSEG131::k_SeqNo(){
|
|
return((long)l_k_SeqNo );
|
|
}
|
|
|
|
void T_CYC_EXTSEG131::set_k_SeqNo( long arg ){
|
|
l_k_SeqNo = arg;
|
|
return;
|
|
}
|
|
|
|
//
|
|
// public methode fillStructure
|
|
//
|
|
// this methode filles the classstructue with the private attributes
|
|
//
|
|
void T_CYC_EXTSEG131::fillStructure(){
|
|
structTable.SeqNo = SeqNo();
|
|
strncpy ( structTable.EnCoilId , EnCoilId(),sizeof(structTable.EnCoilId));
|
|
strncpy ( structTable.ExCoilId , ExCoilId(),sizeof(structTable.ExCoilId));
|
|
structTable.TRTension = TRTension();
|
|
strncpy ( structTable.TC , TC(),sizeof(structTable.TC));
|
|
structTable.muId = muId();
|
|
strncpy ( structTable.muCreator , muCreator(),sizeof(structTable.muCreator));
|
|
structTable.musId = musId();
|
|
return;
|
|
}
|
|
///////////////////////////////////////////////////
|
|
void T_CYC_EXTSEG131::fillStructureZi(){
|
|
structTableZi.EnCoilIdZi = EnCoilIdZi();
|
|
structTableZi.ExCoilIdZi = ExCoilIdZi();
|
|
structTableZi.TRTensionZi = TRTensionZi();
|
|
structTableZi.TCZi = TCZi();
|
|
return;
|
|
}
|
|
///////////////////////////////////////////////////
|
|
void T_CYC_EXTSEG131::setStructure() {
|
|
set_EnCoilId( structTable.EnCoilId);
|
|
set_ExCoilId( structTable.ExCoilId);
|
|
set_TRTension( structTable.TRTension);
|
|
set_TC( structTable.TC);
|
|
return;
|
|
}
|
|
///////////////////////////////////////////////////
|
|
void T_CYC_EXTSEG131::setStructureZi() {
|
|
set_EnCoilIdZi( structTableZi.EnCoilIdZi);
|
|
set_ExCoilIdZi( structTableZi.ExCoilIdZi);
|
|
set_TRTensionZi( structTableZi.TRTensionZi);
|
|
set_TCZi( structTableZi.TCZi);
|
|
return;
|
|
}
|
|
///////////////////////////////////////////////////
|
|
char* T_CYC_EXTSEG131::getName(){
|
|
return("T_CYC_EXTSEG131");
|
|
}
|
|
///////////////////////////////////////////////////
|
|
long T_CYC_EXTSEG131::getSqlCode(){
|
|
return( db.dbSqlCode);
|
|
}
|
|
long T_CYC_EXTSEG131::getRowsProcessed(){
|
|
return( db.dbRowsProcessed);
|
|
}
|