MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
RampDCR Struct Reference
Inheritance diagram for RampDCR:
Collaboration diagram for RampDCR:

Public Member Functions

DriveCallerRead (const DataManager *pDM, MBDynParser &HP, bool bDeferred)
 
- Public Member Functions inherited from DriveCallerRead
virtual ~DriveCallerRead (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from DriveCallerRead
static void ReadOutput (DriveCaller *pDC, const DataManager *pDM, MBDynParser &HP)
 
- Protected Member Functions inherited from DriveCallerRead
void NeedDM (const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
 

Detailed Description

Definition at line 1810 of file drive_.cc.

Member Function Documentation

DriveCaller * RampDCR::Read ( const DataManager pDM,
MBDynParser HP,
bool  bDeferred 
)
virtual

Implements DriveCallerRead.

Definition at line 1816 of file drive_.cc.

References DEBUGCOUT, IncludeParser::GetLineData(), HighParser::GetReal(), HighParser::IsKeyWord(), DriveCallerRead::NeedDM(), DataManager::pGetDrvHdl(), and SAFENEWWITHCONSTRUCTOR.

1817 {
1818  NeedDM(pDM, HP, bDeferred, "ramp");
1819 
1820  const DriveHandler* pDrvHdl = 0;
1821  if (pDM != 0) {
1822  pDrvHdl = pDM->pGetDrvHdl();
1823  }
1824 
1825  DriveCaller *pDC = 0;
1826 
1827  /* Rampa saturata */
1828  doublereal dSlope = HP.GetReal(1.);
1829  DEBUGCOUT("Slope Value: " << dSlope << std::endl);
1830 
1831  doublereal dInitialTime = HP.GetReal();
1832  DEBUGCOUT("Initial time: " << dInitialTime << std::endl);
1833 
1834  doublereal dFinalTime = std::numeric_limits<double>::max();
1835  if (!HP.IsKeyWord("forever")) {
1836  dFinalTime = HP.GetReal();
1837  }
1838  DEBUGCOUT("Final time: " << dFinalTime << std::endl);
1839 
1840  if (dFinalTime <= dInitialTime) {
1841  silent_cerr("Warning at line "
1842  << HP.GetLineData()
1843  << ": final time " << dFinalTime
1844  << " is less than or equal to initial time " << dInitialTime
1845  << " in ramp func drive" << std::endl);
1846  }
1847 
1848  doublereal dInitialValue = HP.GetReal();
1849  DEBUGCOUT("InitialValue: " << dInitialValue << std::endl);
1850 
1853  RampDriveCaller(pDrvHdl, dSlope, dInitialTime,
1854  dFinalTime, dInitialValue));
1855 
1856  return pDC;
1857 }
const DriveHandler * pGetDrvHdl(void) const
Definition: dataman.h:340
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
#define DEBUGCOUT(msg)
Definition: myassert.h:232
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
void NeedDM(const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
Definition: drive_.cc:1354
double doublereal
Definition: colamd.c:52
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056

Here is the call graph for this function:


The documentation for this struct was generated from the following file: