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

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 1859 of file drive_.cc.

Member Function Documentation

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

Implements DriveCallerRead.

Definition at line 1865 of file drive_.cc.

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

1866 {
1867  NeedDM(pDM, HP, bDeferred, "double ramp");
1868 
1869  const DriveHandler* pDrvHdl = 0;
1870  if (pDM != 0) {
1871  pDrvHdl = pDM->pGetDrvHdl();
1872  }
1873 
1874  DriveCaller *pDC = 0;
1875 
1876  /* Rampa doppia */
1877  doublereal dAscendingSlope = HP.GetReal(1.);
1878  DEBUGCOUT("Ascending Slope Value: " << dAscendingSlope << std::endl);
1879 
1880  doublereal dAscendingInitialTime = HP.GetReal();
1881  DEBUGCOUT("Ascending Initial time: " << dAscendingInitialTime << std::endl);
1882 
1883  doublereal dAscendingFinalTime = HP.GetReal();
1884  DEBUGCOUT("Ascending Final time: " << dAscendingFinalTime << std::endl);
1885 
1886  if (dAscendingFinalTime <= dAscendingInitialTime) {
1887  silent_cerr("Warning at line "
1888  << HP.GetLineData() << ": ascending final time "
1889  << dAscendingFinalTime
1890  << " is less than or equal to ascending initial time "
1891  << dAscendingInitialTime
1892  << " in double ramp func drive" << std::endl);
1894  }
1895 
1896  doublereal dDescendingSlope = HP.GetReal(-1.);
1897  DEBUGCOUT("Descending Slope Value: " << dDescendingSlope << std::endl);
1898 
1899  doublereal dDescendingInitialTime = std::numeric_limits<doublereal>::max();
1900  if (!HP.IsKeyWord("forever")) {
1901  dDescendingInitialTime = HP.GetReal();
1902  }
1903  DEBUGCOUT("Descending Initial time: " << dDescendingInitialTime << std::endl);
1904 
1905  if (dDescendingInitialTime < dAscendingFinalTime) {
1906  silent_cerr("Warning at line "
1907  << HP.GetLineData() << ": descending initial time "
1908  << dDescendingInitialTime
1909  << " is less than ascending final time "
1910  << dAscendingFinalTime
1911  << " in double ramp func drive" << std::endl);
1913  }
1914 
1915  doublereal dDescendingFinalTime;
1916  if (HP.IsKeyWord("forever")) {
1917  dDescendingFinalTime = std::numeric_limits<doublereal>::max();
1918 
1919  } else {
1920  dDescendingFinalTime = HP.GetReal();
1921  }
1922 
1923  DEBUGCOUT("Descending Final time: " << dDescendingFinalTime << std::endl);
1924 
1925  if (dDescendingFinalTime <= dDescendingInitialTime) {
1926  silent_cerr("Warning at line "
1927  << HP.GetLineData() << ": descending final time "
1928  << dDescendingFinalTime
1929  << " is less than descending initial time "
1930  << dDescendingInitialTime
1931  << " in double ramp func drive" << std::endl);
1933  }
1934 
1935  doublereal dInitialValue = HP.GetReal();
1936  DEBUGCOUT("InitialValue: " << dInitialValue << std::endl);
1937 
1940  DoubleRampDriveCaller(pDrvHdl,
1941  dAscendingSlope, dAscendingInitialTime, dAscendingFinalTime,
1942  dDescendingSlope, dDescendingInitialTime, dDescendingFinalTime,
1943  dInitialValue));
1944 
1945  return pDC;
1946 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
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: