Exemplo n.º 1
0
string Logger::getCurrentTime()
{
    ostringstream strStream;
    time_t now;
    time(&now);
    struct tm *current = localtime(&now);
    
    strStream << current->tm_year + 1900 << "-"
              << setw(2) << fillZeros(current->tm_mon + 1, 2) << "-"
              << setw(2) << fillZeros(current->tm_mday, 2) << " "
              << setw(2) << fillZeros(current->tm_hour, 2) << "."
              << setw(2) << fillZeros(current->tm_min, 2) << "."
              << setw(2) << fillZeros(current->tm_sec, 2);
    
    return strStream.str();
}
Exemplo n.º 2
0
string Logger::fillZeros(int num, int len)
{
    ostringstream strStream;
    
    strStream << num;
    
    return fillZeros(strStream.str(), len);
}
Exemplo n.º 3
0
RobotState::RobotState() {
	model = new Jimmy();
	model->sdinit();
	fillZeros();
	for(int i = 0; i < 20; i++)	joints[i] = standPrepPose[i];
	computeSDFvars();
	root[Z] = -(foot[LEFT][Z]+foot[RIGHT][Z])/2.0;
	computeSDFvars();
}
Exemplo n.º 4
0
/**********************************************************************\
 * Input:  None                                                         *
 * Output: None                                                         *
 * Function: Initialize all DeviceEventInfo structs within global array *
 \**********************************************************************/
void InitializeDeviceEventsInfo()
{
    int i = 0;
    for(i; i < MAX_NUMBER_DEVICES; i++)
    {
       DeviceEventsInfo eventInfo;
       eventInfo.responseTimes[MAX_EVENTS_PER_DEVICE];
       eventInfo.turnAroundTimes[MAX_EVENTS_PER_DEVICE];
       eventInfo.averageTurnAroundTime = 0;
       eventInfo.averageResponseTime = 0;
       eventInfo.missedEvents = 0;
       eventInfo.seenEvents = 0;

       fillZeros(eventInfo.responseTimes);
       fillZeros(eventInfo.turnAroundTimes);
       fillZeros(eventInfo.processedEventID);

       eventInfoArray[i] = eventInfo;
    }
}
Exemplo n.º 5
0
void initMEM() {
    int i;
    MEM = MEM_DEFAULT;
    MBC1 = MBC1_DEFAULT;
    fillZeros(VIDEO_RAM, VIDEO_RAM_SIZE);
    fillZeros(EXT_RAM, MAX_EXT_RAM_SIZE);
    fillZeros(INT_RAM, INT_RAM_SIZE);
    fillZeros(SPRITE_OAM, SPRITE_OAM_SIZE);
    fillZeros(IO, IO_SIZE);
    fillZeros(ZERO_RAM, ZERO_RAM_SIZE);
    // Do anything else that needs doing...
}