Ejemplo n.º 1
0
wxString DateToAnsiStr(const wxDateTime &datetime)
{
	if (!datetime.IsValid())
		return wxEmptyString;

	return datetime.FormatISODate() + wxT(" ") + datetime.FormatISOTime();
}
Ejemplo n.º 2
0
void HumanoidDataLogger::saveData()
{
	const wxDateTime now = wxDateTime::UNow();
	
	wxString dataDirectory(dataSaveDirectory.c_str(),wxConvUTF8);
	wxString curFilePath = dataDirectory + wxT("/recentData.dat");
	
	dataDirectory += now.FormatISODate();
	wxString dataFile =  now.FormatISODate() + wxT("_") + now.FormatISOTime() + wxT(".dat");
	dataFile.Replace(wxT(":"), wxT("-"));
	
	wxString dataPath = dataDirectory + wxT("/") + dataFile;
	
	if(! wxDirExists(dataDirectory))
	{
		wxMkdir(dataDirectory);	
	}
	
	stringstream ss;
	ss << dataPath.mb_str();
	setFile(ss.str());
	writeRecords();
	
	FILE * curFile = fopen(curFilePath.mb_str(),"w");
	fprintf(curFile, "%s",ss.str().c_str());
	fclose(curFile);
}
Ejemplo n.º 3
0
void TrackPoint::SetCreateTime( wxDateTime dt )
{
    wxString ts;
    if(dt.IsValid())
        ts = dt.FormatISODate().Append(_T("T")).Append(dt.FormatISOTime()).Append(_T("Z"));

    SetCreateTime(ts);
}
Ejemplo n.º 4
0
wxString DashboardInstrument_Clock::GetDisplayTime( wxDateTime UTCtime )
{
    wxString result( _T( "---" ) );
    if ( UTCtime.IsValid() ) {
        if ( getUTC() ) {
            result = UTCtime.FormatISOTime().Append( _T( " UTC" ) );
            return result;
        }
        wxDateTime displayTime;
        if ( g_iUTCOffset != 0 ) {
            wxTimeSpan offset( 0, g_iUTCOffset * 30, 0 );
            displayTime = UTCtime.Add( offset );
        }
        else {
            displayTime = UTCtime.FromTimezone( wxDateTime::UTC );
        }
        result = displayTime.FormatISOTime().Append( _T( " LCL" ) );
    }
    return result;
}