您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ FormatTime函数代码示例

51自学网 2021-06-01 20:48:05
  C++
这篇教程C++ FormatTime函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中FormatTime函数的典型用法代码示例。如果您正苦于以下问题:C++ FormatTime函数的具体用法?C++ FormatTime怎么用?C++ FormatTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了FormatTime函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: wxGetApp

void CViewTransfers::GetDocStatus(wxInt32 item, wxString& strBuffer) const {    FILE_TRANSFER* transfer = NULL;    CMainDocument* pDoc = wxGetApp().GetDocument();    int retval;    strBuffer = wxString("", wxConvUTF8);        transfer = pDoc->file_transfer(item);    if (!transfer) return;    CC_STATUS      status;    wxASSERT(pDoc);    wxASSERT(wxDynamicCast(pDoc, CMainDocument));    retval = pDoc->GetCoreClientStatus(status);    if (retval) return;    wxDateTime dtNextRequest((time_t)transfer->next_request_time);    wxDateTime dtNow(wxDateTime::Now());    strBuffer = transfer->is_upload?_("Upload"):_("Download");    strBuffer += wxString(": ", wxConvUTF8);    if (dtNextRequest > dtNow) {        wxTimeSpan tsNextRequest(dtNextRequest - dtNow);        strBuffer += _("retry in ") + tsNextRequest.Format();    } else if (transfer->status == ERR_GIVEUP_DOWNLOAD || transfer->status == ERR_GIVEUP_UPLOAD) {        strBuffer = _("failed");    } else {        if (status.network_suspend_reason) {            strBuffer += _("suspended");            strBuffer += wxString(" - ", wxConvUTF8);            strBuffer += suspend_reason_wxstring(status.network_suspend_reason);        } else {            if (transfer->xfer_active) {                strBuffer += _("active");            } else {                strBuffer += _("pending");            }        }    }    if (transfer->project_backoff) {        wxString x;        FormatTime(transfer->project_backoff, x);        strBuffer += _(" (project backoff: ") + x + _(")");    }}
开发者ID:Ocode,项目名称:boinc,代码行数:45,


示例2: FormatTime

void ParamEdit::SearchResultReceived(DatabaseQuery *q) {	if (q->search_data.response != -1) {		m_current_search_date = q->search_data.response;		m_draws_ctrl->Set(m_current_search_date);			m_found_date_label->SetLabel(wxString::Format(_("Found time: %s"), FormatTime(m_current_search_date, m_draws_ctrl->GetPeriod()).c_str()));	} else {		m_info_string = wxString::Format(_("%s"), _("No date found"));	}	DefinedParam* dp = dynamic_cast<DefinedParam*>(q->draw_info->GetParam());	std::vector<DefinedParam*> dpv(1, dp);	m_database_manager->RemoveParams(dpv);	m_cfg_mgr->GetDefinedDrawsSets()->RemoveParam(dp);	delete q->search_data.search_condition;	delete q->draw_info;	delete q;	m_search_direction = NOT_SEARCHING;}
开发者ID:cyclefusion,项目名称:szarp,代码行数:18,


示例3: GetFilteredIndex

wxString CViewMessages::OnListGetItemText(long item, long column) const {    wxString strBuffer = wxEmptyString;    size_t index = GetFilteredIndex(item);    switch(column) {    case COLUMN_PROJECT:        FormatProjectName(index, strBuffer);        break;    case COLUMN_TIME:        FormatTime(index, strBuffer);        break;    case COLUMN_MESSAGE:        FormatMessage(index, strBuffer);        break;    }    return strBuffer;}
开发者ID:phenix3443,项目名称:synecdoche,代码行数:18,


示例4: main

int main(int argc, char **argv){  Args args(argc, argv, "DRIVER FILE");  DebugReplay *replay = CreateDebugReplay(args);  if (replay == NULL)    return EXIT_FAILURE;  args.ExpectEnd();  printf("# time wind_bearing (deg) wind_speed (m/s) grndspeed (m/s) tas (m/s) bearing (deg)/n");  CirclingSettings circling_settings;  circling_settings.SetDefaults();  CirclingComputer circling_computer;  circling_computer.Reset();  WindEKFGlue wind_ekf;  wind_ekf.Reset();  while (replay->Next()) {    const MoreData &data = replay->Basic();    const DerivedInfo &calculated = replay->Calculated();    circling_computer.TurnRate(replay->SetCalculated(),                               data, calculated.flight);    WindEKFGlue::Result result =      wind_ekf.Update(data, replay->Calculated());    if (result.quality > 0) {      TCHAR time_buffer[32];      FormatTime(time_buffer, data.time);      _tprintf(_T("%s %d %g %g %g %d/n"), time_buffer,               (int)result.wind.bearing.Degrees(),               (double)result.wind.norm,               (double)data.ground_speed,               (double)data.true_airspeed,               (int)data.track.Degrees());    }  }  delete replay;}
开发者ID:Advi42,项目名称:XCSoar,代码行数:44,


示例5: timeStamp

Logger::Impl::Impl(LogLevel eLevel, int nOldErrno, const char* pStrFile, int nLine)	: timeStamp(TimeStamp::Now())	, stream()	, level(eLevel)	, nLine(nLine)	, pStrFullName(pStrFile)	, pStrBaseName(NULL){	const char* pStrPathSepPos = strrchr(pStrFullName, '/');	pStrBaseName = (NULL != pStrPathSepPos) ? pStrPathSepPos + 1 : pStrFullName;	FormatTime();// 	Fmt tid("%6d", CurrentThread::GetTid());// 	stream << tid.GetData();	stream << "[" << LogLevelName[level] << "]/t";	if (0 != nOldErrno) {		stream << StrError_tl(nOldErrno) << " (errno=" << nOldErrno << ") ";	}}
开发者ID:yewenhui,项目名称:linuxserver,代码行数:19,


示例6: switch

void CFileBrowserListCtrl::OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult) {	NMLVDISPINFO* pDispInfo = (NMLVDISPINFO*)pNMHDR;	LVITEM&	ListItem = pDispInfo->item;	int	ItemIdx = ListItem.iItem;	if (ItemIdx < m_DirList.GetCount()) {		const CDirItem&	DirItem = m_DirList.GetItem(ItemIdx);		if (ItemIdx != m_CachedItemIdx) {	// if item isn't cached			m_FileInfoCache.GetFileInfo(GetFolder(), DirItem, m_MRUFileInfo);			m_CachedItemIdx = ItemIdx;		}		if (ListItem.mask & LVIF_TEXT) {			switch (ListItem.iSubItem) {			case COL_NAME:				_tcscpy(ListItem.pszText, DirItem.GetName());				break;			case COL_SIZE:				if (!DirItem.IsDir()) {					CString	s;					if (FormatSize(DirItem.GetLength(), s))						_tcscpy(ListItem.pszText, s);				}				break;			case COL_TYPE:				_tcscpy(ListItem.pszText, m_MRUFileInfo.GetTypeName());				break;			case COL_MODIFIED:				if (DirItem.GetLastWrite() > 0) {					CString	s;					if (FormatTime(DirItem.GetLastWrite(), s))						_tcscpy(ListItem.pszText, s);				}				break;			default:				ASSERT(0);			}		}		if (ListItem.mask & LVIF_IMAGE) {			ListItem.iImage = m_MRUFileInfo.GetIconIdx();		}	}		*pResult = 0;}
开发者ID:victimofleisure,项目名称:Fractice,代码行数:43,


示例7: TraceLog

static void TraceLog(uint16 port,ArCanMsgType* pMsg){	static boolean is1stReceived=FALSE;	static gchar log_buffer[512];	int len = sprintf(log_buffer,"CANID=0x%-3x,DLC=%x, [",pMsg->Msg.Identifier,(guint)pMsg->Msg.DataLengthCode);	for(int i=0;i<8;i++)	{		len += sprintf(&log_buffer[len],"%-2x,",(guint)pMsg->Msg.Data[i]);	}	gdouble elapsed = g_timer_elapsed(pTimer,NULL);	if(FALSE == is1stReceived)	{		is1stReceived = TRUE;		g_timer_start(pTimer);		elapsed = 0;	}	len += sprintf(&log_buffer[len],"] %s from %-5d on bus %d/n",FormatTime(elapsed),port,pMsg->Msg.BusID);	Trace(log_buffer);}
开发者ID:uincore,项目名称:OpenSAR,代码行数:20,


示例8: FormatTime

wxStringwxLogFormatter::Format(wxLogLevel level,                       const wxString& msg,                       const wxLogRecordInfo& info) const{    wxString prefix;    // don't time stamp debug messages under MSW as debug viewers usually    // already have an option to do it#ifdef __WINDOWS__    if ( level != wxLOG_Debug && level != wxLOG_Trace )#endif // __WINDOWS__        prefix = FormatTime(info.timestamp);    switch ( level )    {    case wxLOG_Error:        prefix += _("Error: ");        break;    case wxLOG_Warning:        prefix += _("Warning: ");        break;        // don't prepend "debug/trace" prefix under MSW as it goes to the debug        // window anyhow and so can't be confused with something else#ifndef __WINDOWS__    case wxLOG_Debug:        // this prefix (as well as the one below) is intentionally not        // translated as nobody translates debug messages anyhow        prefix += "Debug: ";        break;    case wxLOG_Trace:        prefix += "Trace: ";        break;#endif // !__WINDOWS__    }    return prefix + msg;}
开发者ID:madhugowda24,项目名称:wxWidgets,代码行数:41,


示例9: GetGroupInfoPtr

void CGroupInfoDlg::UpdateCtrls(){	CString strText;	CGroupInfo * lpGroupInfo = GetGroupInfoPtr();	if (lpGroupInfo != NULL)	{		SetDlgItemText(ID_EDIT_NAME, lpGroupInfo->m_strName.c_str());		strText.Format(_T("%u"), lpGroupInfo->m_nGroupNumber);		SetDlgItemText(ID_EDIT_NUMBER, strText);		CBuddyInfo * lpBuddyInfo = lpGroupInfo->GetMemberByUin(lpGroupInfo->m_nOwnerUin);		if (lpBuddyInfo != NULL)			SetDlgItemText(ID_EDIT_CREATER, lpBuddyInfo->m_strNickName.c_str());		TCHAR cTime[32] = {0};		FormatTime(lpGroupInfo->m_nCreateTime, _T("%Y-%m-%d"), cTime, sizeof(cTime)/sizeof(TCHAR));		SetDlgItemText(ID_EDIT_CREATETIME, cTime);		strText.Format(_T("%u"), lpGroupInfo->m_nClass);		SetDlgItemText(ID_EDIT_CLASS, strText);		SetDlgItemText(ID_EDIT_REMARK, _T(""));		SetDlgItemText(ID_EDIT_MEMO, lpGroupInfo->m_strMemo.c_str());		SetDlgItemText(ID_EDIT_FINGERMEMO, lpGroupInfo->m_strFingerMemo.c_str());		lpBuddyInfo = m_lpQQClient->GetUserInfo();		if (lpBuddyInfo != NULL)		{			lpBuddyInfo = lpGroupInfo->GetMemberByUin(lpBuddyInfo->m_nQQUin);			if (lpBuddyInfo != NULL)			{				if (!lpBuddyInfo->m_strGroupCard.empty())					SetDlgItemText(ID_EDIT_CARDNAME, lpBuddyInfo->m_strGroupCard.c_str());				else					SetDlgItemText(ID_EDIT_CARDNAME, lpBuddyInfo->m_strNickName.c_str());				SetDlgItemText(ID_EDIT_GENDER, lpBuddyInfo->GetDisplayGender().c_str());				SetDlgItemText(ID_EDIT_PHONE, lpBuddyInfo->m_strPhone.c_str());				SetDlgItemText(ID_EDIT_EMAIL, lpBuddyInfo->m_strEmail.c_str());				SetDlgItemText(ID_EDIT_REMARK2, _T(""));			}		}	}}
开发者ID:03050903,项目名称:MingQQ,代码行数:40,


示例10: Replicas_GetColumnText

LPTSTR Replicas_GetColumnText (LPIDENT lpi, REPLICACOLUMN repcol){   static TCHAR aszBuffer[ nREPLICACOLUMNS ][ cchRESOURCE ];   static size_t iBufferNext = 0;   LPTSTR pszBuffer = aszBuffer[ iBufferNext++ ];   if (iBufferNext == nREPLICACOLUMNS)      iBufferNext = 0;   LPFILESETSTATUS lpfs = NULL;   LPFILESET_PREF lpfp;   if ((lpfp = (LPFILESET_PREF)lpi->GetUserParam()) != NULL)      {      lpfs = &lpfp->fsLast;      }   switch (repcol)      {      case repcolSERVER:         lpi->GetServerName (pszBuffer);         break;      case repcolAGGREGATE:         lpi->GetAggregateName (pszBuffer);         break;      case repcolDATE_UPDATE:         if (!lpfs)            *pszBuffer = TEXT('/0');         else if (!FormatTime (pszBuffer, TEXT("%s"), &lpfs->timeLastUpdate))            *pszBuffer = TEXT('/0');         break;      default:         pszBuffer = NULL;         break;      }   return pszBuffer;}
开发者ID:chanke,项目名称:openafs-osd,代码行数:39,


示例11: FormatTime

void CMainWindow::AddMsgToRecvEdit(LPCTSTR lpText){	if (NULL == lpText || NULL == *lpText)		return;	m_pRecvEdit->SetAutoURLDetect(true);	tstring strTime;	strTime = FormatTime(time(NULL), _T("%H:%M:%S"));	ITextServices * pTextServices = m_pRecvEdit->GetTextServices();	RichEdit_SetSel(pTextServices, -1, -1);	TCHAR cText[2048] = {0};	wsprintf(cText, _T("%s("), _T("倚天"));	RichEdit_ReplaceSel(pTextServices, cText, 		_T("宋体"), 9, RGB(0, 0, 255), FALSE, FALSE, FALSE, FALSE, 0);	wsprintf(cText, _T("%u"), 43156150);	RichEdit_ReplaceSel(pTextServices, cText, 		_T("宋体"), 9, RGB(0, 114, 193), FALSE, FALSE, TRUE, TRUE, 0);	wsprintf(cText, _T(")  %s/r/n"), strTime.c_str());	RichEdit_ReplaceSel(pTextServices, cText, 		_T("宋体"), 9, RGB(0, 0, 255), FALSE, FALSE, FALSE, FALSE, 0);	//m_pRecvEdit->SetAutoURLDetect(true);	AddMsg(m_pRecvEdit, lpText);	RichEdit_ReplaceSel(pTextServices, _T("/r/n"));	RichEdit_SetStartIndent(pTextServices, 0);	m_pRecvEdit->EndDown();	pTextServices->Release();}
开发者ID:longlinht,项目名称:DirectUI,代码行数:37,


示例12: wxDynamicCast

void XYDialog::OnDateChange(wxCommandEvent &event) {	wxButton *button;	DTime *time;	if (event.GetId() == XY_START_TIME) {		button = wxDynamicCast(FindWindow(XY_START_TIME), wxButton);		time = &m_start_time;	} else {		button = wxDynamicCast(FindWindow(XY_END_TIME), wxButton);		time = &m_end_time;	}	DateChooserWidget *dcw = 		new DateChooserWidget(				this,				_("Select date"),				1,				-1,				-1,				1		);	wxDateTime wxtime = time->GetTime();		bool ret = dcw->GetDate(wxtime);	dcw->Destroy();	if (ret == false)		return;	*time = DTime(m_period, wxtime);	time->AdjustToPeriod();	button->SetLabel(FormatTime(time->GetTime(), m_period));}
开发者ID:cyclefusion,项目名称:szarp,代码行数:36,


示例13: ToWxDateTime

void StatDialog::DatabaseResponse(DatabaseQuery *q) {    if (m_tofetch == 0) {        delete q;        return;    }    for (std::vector<DatabaseQuery::ValueData::V>::iterator i = q->value_data.vv->begin();            i != q->value_data.vv->end();            i++) {        if (std::isnan(i->response))            continue;        if (m_count++ == 0) {            m_max = i->response;            m_min = i->response;            m_sum = 0;            m_sum2 = 0;            m_hsum = 0;            m_min_time = m_max_time = ToWxDateTime(i->time_second, i->time_nanosecond);        } else {            if (m_max < i->response) {                m_max = i->response;                m_max_time = ToWxDateTime(i->time_second, i->time_nanosecond);            }            if (m_min > i->response) {                m_min = i->response;                m_min_time = ToWxDateTime(i->time_second, i->time_nanosecond);            }        }        m_sum += i->response;        m_sum2 += i->response * i->response;        m_hsum += i->sum;    }    m_pending -= q->value_data.vv->size();    m_totalfetched += q->value_data.vv->size();    delete q;    assert(m_pending >= 0);#if 0    bool canceled;    m_progress_dialog->Update(wxMin(99, int(float(m_totalfetched) / (m_tofetch + 1) * 100)), _T(""), &canceled);#endif    m_progress_frame->SetProgress(m_totalfetched * 100 / m_tofetch);    if (m_totalfetched == m_tofetch) {        assert(m_pending == 0);        if (m_count) {            wxString unit = m_draw->GetUnit();            double sdev = sqrt(m_sum2 / m_count - m_sum / m_count * m_sum / m_count);            m_min_value_text->SetLabel(wxString::Format(_T("%s %s (%s)"),                                       m_draw->GetValueStr(m_min, _T("- -")).c_str(),                                       unit.c_str(),                                       FormatTime(m_min_time, m_period).c_str()));            m_stddev_value_text->SetLabel(wxString::Format(_T("%s %s"),                                          m_draw->GetValueStr(sdev, _T("- -")).c_str(),                                          unit.c_str()));            m_avg_value_text->SetLabel(wxString::Format(_T("%s %s"),                                       m_draw->GetValueStr(m_sum / m_count, _T("- -")).c_str(),                                       unit.c_str()));            m_max_value_text->SetLabel(wxString::Format(_T("%s %s (%s)"),                                       m_draw->GetValueStr(m_max, _T("- -")).c_str(),                                       unit.c_str(),                                       FormatTime(m_max_time, m_period).c_str()));            if (m_draw->GetSpecial() == TDraw::HOURSUM) {                if (unit.Replace(_T("/h"), _T("")) == 0)                    unit += _T("h");                m_hsum_value_text->SetLabel(wxString::Format(_T("%s %s"), m_draw->GetValueStr(m_hsum / m_draw->GetSumDivisor()).c_str(), unit.c_str()));            }        } else {            m_min_value_text->SetLabel(_("no data"));            m_avg_value_text->SetLabel(_("no data"));            m_stddev_value_text->SetLabel(_("no data"));            m_max_value_text->SetLabel(_("no data"));            if (m_draw->GetSpecial() == TDraw::HOURSUM)                m_hsum_value_text->SetLabel(_("no data"));        }        m_progress_frame->Destroy();        m_tofetch = 0;    } else if (m_pending == 0)        ProgressFetch();}
开发者ID:wds315,项目名称:szarp,代码行数:95,


示例14: FormatTime

CString CTimeHelper::FormatTime(double dTime, int nDecPlaces) const{	return FormatTime(dTime, 0, nDecPlaces);}
开发者ID:Fox-Heracles,项目名称:TodoList,代码行数:4,


示例15: cmd_time

INT cmd_time (LPTSTR param){	LPTSTR *arg;	INT    argc;	INT    i;	INT    nTimeString = -1;	if (!_tcsncmp (param, _T("/?"), 2))	{		ConOutResPaging(TRUE,STRING_TIME_HELP1);		return 0;	}  nErrorLevel = 0;	/* build parameter array */	arg = split (param, &argc, FALSE, FALSE);	/* check for options */	for (i = 0; i < argc; i++)	{		if (_tcsicmp (arg[i], _T("/t")) == 0)		{			/* Display current time in short format */			SYSTEMTIME st;			TCHAR szTime[20];			GetLocalTime(&st);			FormatTime(szTime, &st);			ConOutPuts(szTime);			freep(arg);			return 0;		}		if ((*arg[i] != _T('/')) && (nTimeString == -1))			nTimeString = i;	}	if (nTimeString == -1)	{		ConOutResPrintf(STRING_LOCALE_HELP1);		ConOutPrintf(_T(": %s/n"), GetTimeString());	}	while (1)	{		if (nTimeString == -1)		{			TCHAR  s[40];			ConOutResPuts(STRING_TIME_HELP2);			ConInString (s, 40);			TRACE ("/'%s/'/n", debugstr_aw(s));			while (*s && s[_tcslen (s) - 1] < _T(' '))				s[_tcslen(s) - 1] = _T('/0');			if (ParseTime (s))			{				freep (arg);				return 0;			}		}		else		{			if (ParseTime (arg[nTimeString]))			{				freep (arg);				return 0;			}			/* force input the next time around. */			nTimeString = -1;		}		ConErrResPuts(STRING_TIME_ERROR1);    nErrorLevel = 1;	}	freep (arg);	return 0;}
开发者ID:RareHare,项目名称:reactos,代码行数:84,


示例16: ShowSocks

    void ShowSocks(bool bShowHosts) {        CSockManager& m = CZNC::Get().GetManager();        if (!m.size()) {            PutStatus("You have no open sockets.");            return;        }        std::priority_queue<CSocketSorter> socks;        for (unsigned int a = 0; a < m.size(); a++) {            socks.push(m[a]);        }        CTable Table;        Table.AddColumn("Name");        Table.AddColumn("Created");        Table.AddColumn("State");#ifdef HAVE_LIBSSL        Table.AddColumn("SSL");#endif        Table.AddColumn("Local");        Table.AddColumn("Remote");        while (!socks.empty()) {            Csock* pSocket = socks.top().GetSock();            socks.pop();            Table.AddRow();            switch (pSocket->GetType()) {            case Csock::LISTENER:                Table.SetCell("State", "Listen");                break;            case Csock::INBOUND:                Table.SetCell("State", "Inbound");                break;            case Csock::OUTBOUND:                if (pSocket->IsConnected())                    Table.SetCell("State", "Outbound");                else                    Table.SetCell("State", "Connecting");                break;            default:                Table.SetCell("State", "UNKNOWN");                break;            }            unsigned long long iStartTime = pSocket->GetStartTime();            time_t iTime = iStartTime / 1000;            Table.SetCell("Created", FormatTime("%Y-%m-%d %H:%M:%S", iTime));#ifdef HAVE_LIBSSL            if (pSocket->GetSSL()) {                Table.SetCell("SSL", "Yes");            } else {                Table.SetCell("SSL", "No");            }#endif            Table.SetCell("Name", pSocket->GetSockName());            CString sVHost;            if (bShowHosts) {                sVHost = pSocket->GetBindHost();            }            if (sVHost.empty()) {                sVHost = pSocket->GetLocalIP();            }            Table.SetCell("Local", sVHost + " " + CString(pSocket->GetLocalPort()));            CString sHost;            if (!bShowHosts) {                sHost = pSocket->GetRemoteIP();            }            // While connecting, there might be no ip available            if (sHost.empty()) {                sHost = pSocket->GetHostName();            }            u_short uPort;            // While connecting, GetRemotePort() would return 0            if (pSocket->GetType() == Csock::OUTBOUND) {                uPort = pSocket->GetPort();            } else {                uPort = pSocket->GetRemotePort();            }            if (uPort != 0) {                Table.SetCell("Remote", sHost + " " + CString(uPort));            } else {                Table.SetCell("Remote", sHost);            }        }        PutModule(Table);        return;    }
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:96,


示例17: RunTest

//.........这里部分代码省略.........				if (globalTestExpectedToFail)				{					if (globalTestExpectedToFail == 2)						LOGE("This test failed as expected. Caught an exception '%s', failure is due to reason '%s'.", e.what(), globalTestFailureDescription.c_str());					else						LOGI("This test failed as expected. Caught an exception '%s', failure is due to reason '%s'.", e.what(), globalTestFailureDescription.c_str());				}				else				{					if (failReason.empty())						failReason = e.what();					++t.numFails;				}			}			catch(...)			{				++t.numFails;				LOGE("Error: Received an unknown exception type that is _not_ derived from std::exception! This should not happen!");			}#endif		}		tick_t end = Clock::Tick();		times.push_back(end - start);	}	t.numPasses = numTimesToRun*numTrialsPerRun - t.numFails;	std::sort(times.begin(), times.end());	// Erase outliers. (x% slowest)	const float rateSlowestToDiscard = 0.05f;	int numSlowestToDiscard = (int)(times.size() * rateSlowestToDiscard);	times.erase(times.end() - numSlowestToDiscard, times.end());	tick_t total = 0;	for(size_t j = 0; j < times.size(); ++j)		total += times[j];	if (!t.isBenchmark)	{		if (!times.empty())		{			t.fastestTime = (double)times[0] / numTrialsPerRun;			t.averageTime = (double)total / times.size() / numTrialsPerRun;			t.worstTime = (double)times.back() / numTrialsPerRun;			t.numTimesRun = numTimesToRun;			t.numTrialsPerRun = numTrialsPerRun;		}		else		{			t.fastestTime = t.averageTime = t.worstTime = -1.0;			t.numTimesRun = t.numTrialsPerRun = 0;		}	}	float successRate = (t.numPasses + t.numFails > 0) ? (float)t.numPasses * 100.f / (t.numPasses + t.numFails) : 0.f;	jsonReport.Report(t);	if (t.isBenchmark && t.numFails == 0) // Benchmarks print themselves.		return 0; // 0: Success	int ret = 0; // 0: Success	if (t.numFails == 0)	{		if (t.isRandomized)			LOGI(" ok (%d passes, 100%%)", t.numPasses);		else			LOGI(" ok ");//		++numTestsPassed;		t.result = TestPassed;	}	else if (successRate >= 95.0f)	{		LOGI_NL(" ok ");		LOGW("Some failures with '%s' (%d passes, %.2f%% of all tries)", failReason.c_str(), t.numPasses, successRate);//		++numTestsPassed;//		++numWarnings;		ret = 1; // Success with warnings		t.result = TestPassedWithWarnings;	}	else	{		if (t.isRandomized)			LOGE("FAILED: '%s' (%d passes, %.2f%% of all tries)", failReason.c_str(), t.numPasses, successRate);		else			LOGE("FAILED: '%s'", failReason.c_str());		ret = -1; // Failed		t.result = TestFailed;	}	if (!times.empty())	{		if (t.runOnlyOnce)			LOGI("   Elapsed: %s", FormatTime((double)times[0]).c_str());		else			LOGI("   Fastest: %s, Average: %s, Slowest: %s", FormatTime(t.fastestTime).c_str(), FormatTime(t.averageTime).c_str(), FormatTime(t.worstTime).c_str());	}	return ret;}
开发者ID:HsiaTsing,项目名称:MathGeoLib,代码行数:101,


示例18: MemMgr_OnListAdd

void MemMgr_OnListAdd (PMEMCHUNK pCopy){   HWND hList = GetDlgItem (l.hManager, IDC_LIST);   TCHAR szTime[256];   FormatTime (szTime, pCopy->dwTick);   TCHAR szFlags[256];   LPTSTR pszFlags = szFlags;   *pszFlags++ = (pCopy->fCPP) ? TEXT('C') : TEXT(' ');   *pszFlags++ = TEXT(' ');   *pszFlags++ = (pCopy->fFreed) ? TEXT('F') : TEXT(' ');   *pszFlags++ = 0;   TCHAR szExpr[256];   lstrcpy (szExpr, (pCopy->pszExpr) ? pCopy->pszExpr : TEXT("unknown"));   LPTSTR pszFile = pCopy->pszFile;   for (LPTSTR psz = pCopy->pszFile; *psz; ++psz)      {      if ((*psz == TEXT(':')) || (*psz == TEXT('//')))         pszFile = &psz[1];      }   TCHAR szLocation[256];   if (!pszFile || !pCopy->dwLine)      lstrcpy (szLocation, TEXT("unknown"));   else      wsprintf (szLocation, TEXT("%s, %ld"), pszFile, pCopy->dwLine);   TCHAR szBytes[256];   FormatBytes (szBytes, (double)pCopy->cbData);   TCHAR szAddress[256];   wsprintf (szAddress, TEXT("0x%08p"), pCopy->pData);   LPTSTR pszKey = NULL;   switch (lr.iColSort)      {      case 0:  pszKey = (LPTSTR)UlongToPtr(pCopy->dwTick);  break;      case 1:  pszKey = (LPTSTR)szFlags;        break;      case 2:  pszKey = (LPTSTR)szExpr;         break;      case 3:  pszKey = (LPTSTR)szLocation;     break;      case 4:  pszKey = (LPTSTR)pCopy->cbData;  break;      case 5:  pszKey = (LPTSTR)pCopy->pData;   break;      }   LV_ITEM Item;   memset (&Item, 0x00, sizeof(Item));   Item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;   Item.iItem = MemMgr_PickListInsertionPoint (hList, pszKey);   Item.iSubItem = 0;   Item.cchTextMax = 256;   Item.lParam = (LPARAM)pCopy->pData;   Item.pszText = szTime;   DWORD iItem = ListView_InsertItem (hList, &Item);   ListView_SetItemText (hList, iItem, 1, szFlags);   ListView_SetItemText (hList, iItem, 2, szExpr);   ListView_SetItemText (hList, iItem, 3, szLocation);   ListView_SetItemText (hList, iItem, 4, szBytes);   ListView_SetItemText (hList, iItem, 5, szAddress);   delete pCopy;}
开发者ID:maxendpoint,项目名称:openafs_cvs,代码行数:64,


示例19: if

void ICPClass::ExecCNIMode() {	AircraftClass *playerAC = SimDriver.GetPlayerAircraft();	if (!playerAC) return;//me123 ctd fix	if(!g_bRealisticAvionics)	{		int							type;		static int					wpflags;		static	int					frame = 0;		char							timeStr[16]			= "";		char							band;		TacanList::StationSet	set;		int							channel;		VU_ID							vuId;				{													// Clear the update flag			mUpdateFlags				&= !CNI_UPDATE;			// Calculate Some Stuff			if (playerAC->curWaypoint)			{				wpflags = playerAC->curWaypoint->GetWPFlags();			}			else			{				wpflags = 0;			}			if (wpflags & WPF_TARGET) 			{				type	= Way_TGT;			}			else if (wpflags & WPF_IP) 			{				type	= Way_IP;			}			else 			{				type	= Way_STPT;			}			//Original code			// Format Line 1: Waypoint Num, Waypoint Type			if(playerAC->FCC->GetStptMode() == FireControlComputer::FCCWaypoint) 			{			 sprintf(mpLine1, "COMM1 : %-12s STPT %-3d", (VM ? RadioStrings[VM->GetRadioFreq(0)] : "XXXX"), mWPIndex + 1);			}			else if(playerAC->FCC->GetStptMode() == FireControlComputer::FCCDLinkpoint) 			{				sprintf(mpLine1, "COMM1 : %-12s LINK %-3d", (VM ? RadioStrings[VM->GetRadioFreq(0)] : "XXXX"), gNavigationSys->GetDLinkIndex() + 1);			}			else if(playerAC->FCC->GetStptMode() == FireControlComputer::FCCMarkpoint) 			{				sprintf(mpLine1, "COMM1 : %-12s MARK %-3d", (VM ? RadioStrings[VM->GetRadioFreq(0)] : "XXXX"), gNavigationSys->GetMarkIndex() + 1);			}			// Format Line 2: Current Time			FormatTime(vuxGameTime / 1000, timeStr);		// Get game time and convert to secs			sprintf(mpLine2, "COMM2 : %-12s %8s", (VM ? RadioStrings[VM->GetRadioFreq(1)] : "XXXX"), timeStr);			if(mICPTertiaryMode == COMM1_MODE) 			{				mpLine1[5] = '*';			}			else 			{				mpLine2[5] = '*';			}			// Format Line 3: Bogus IFF info, Tacan Channel			if(gNavigationSys) 			{				gNavigationSys->GetTacanVUID(NavigationSystem::ICP, &vuId);					if(vuId) {					gNavigationSys->GetTacanChannel(NavigationSystem::ICP, &channel, &set);					if(set == TacanList::X) 					{						band = 'X';					}					else 					{						band = 'Y';					}					sprintf(mpLine3, "                    T%3d%c", channel, band);				}				else 				{					sprintf(mpLine3, "");				}			}//.........这里部分代码省略.........
开发者ID:PlutoniumHeart,项目名称:VS2012FFalcon,代码行数:101,


示例20: Filesets_General_OnEndTask_InitDialog

void Filesets_General_OnEndTask_InitDialog (HWND hDlg, LPTASKPACKET ptp, LPIDENT lpi){   LPTSTR pszText;   TCHAR szUnknown[ cchRESOURCE ];   GetString (szUnknown, IDS_UNKNOWN);   if (!ptp->rc)      {      SetDlgItemText (hDlg, IDC_SET_CREATEDATE, szUnknown);      SetDlgItemText (hDlg, IDC_SET_UPDATEDATE, szUnknown);      SetDlgItemText (hDlg, IDC_SET_ACCESSDATE, szUnknown);      SetDlgItemText (hDlg, IDC_SET_BACKUPDATE, szUnknown);      SetDlgItemText (hDlg, IDC_SET_USAGE, szUnknown);      SetDlgItemText (hDlg, IDC_SET_STATUS, szUnknown);      SetDlgItemText (hDlg, IDC_SET_FILES, szUnknown);      TCHAR szSvrName[ cchNAME ];      TCHAR szAggName[ cchNAME ];      TCHAR szSetName[ cchNAME ];      lpi->GetServerName (szSvrName);      lpi->GetAggregateName (szAggName);      lpi->GetFilesetName (szSetName);      ErrorDialog (ptp->status, IDS_ERROR_REFRESH_FILESET_STATUS, TEXT("%s%s%s"), szSvrName, szAggName, szSetName);      }   else      {      TCHAR szText[ cchRESOURCE ];      EnableWindow (GetDlgItem (hDlg, IDC_SET_LOCK), TRUE);      EnableWindow (GetDlgItem (hDlg, IDC_SET_UNLOCK), TRUE);      EnableWindow (GetDlgItem (hDlg, IDC_SET_QUOTA), TRUE);      EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN), TRUE);      EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN_SETFULL_DEF), TRUE);      EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN_SETFULL), TRUE);      EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN_SETFULL_PERCENT), TRUE);      EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN_SETFULL_DESC), TRUE);      if (!FormatTime (szText, TEXT("%s"), &TASKDATA(ptp)->fs.timeCreation))         SetDlgItemText (hDlg, IDC_SET_CREATEDATE, szUnknown);      else         SetDlgItemText (hDlg, IDC_SET_CREATEDATE, szText);      if (!FormatTime (szText, TEXT("%s"), &TASKDATA(ptp)->fs.timeLastUpdate))         SetDlgItemText (hDlg, IDC_SET_UPDATEDATE, szUnknown);      else         SetDlgItemText (hDlg, IDC_SET_UPDATEDATE, szText);      if (!FormatTime (szText, TEXT("%s"), &TASKDATA(ptp)->fs.timeLastAccess))         SetDlgItemText (hDlg, IDC_SET_ACCESSDATE, szUnknown);      else         SetDlgItemText (hDlg, IDC_SET_ACCESSDATE, szText);      if (!FormatTime (szText, TEXT("%s"), &TASKDATA(ptp)->fs.timeLastBackup))         SetDlgItemText (hDlg, IDC_SET_BACKUPDATE, szUnknown);      else         SetDlgItemText (hDlg, IDC_SET_BACKUPDATE, szText);      wsprintf (szText, TEXT("%lu"), TASKDATA(ptp)->fs.nFiles);      SetDlgItemText (hDlg, IDC_SET_FILES, szText);      size_t nAlerts = Alert_GetCount (lpi);      if (nAlerts == 1)         {         GetString (szText, IDS_SETSTATUS_1ALERT);         SetDlgItemText (hDlg, IDC_SET_STATUS, szText);         }      else if (nAlerts > 1)         {         pszText = FormatString (IDS_SETSTATUS_2ALERT, TEXT("%lu"), nAlerts);         SetDlgItemText (hDlg, IDC_SET_STATUS, pszText);         FreeString (pszText);         }      else // (nAlerts == 0)         {         if (TASKDATA(ptp)->fs.State & fsBUSY)            GetString (szText, IDS_SETSTATUS_BUSY);         else if (TASKDATA(ptp)->fs.State & fsSALVAGE)            GetString (szText, IDS_SETSTATUS_SALVAGE);         else if (TASKDATA(ptp)->fs.State & fsMOVED)            GetString (szText, IDS_SETSTATUS_MOVED);         else if (TASKDATA(ptp)->fs.State & fsLOCKED)            GetString (szText, IDS_SETSTATUS_LOCKED);         else if (TASKDATA(ptp)->fs.State & fsNO_VOL)            GetString (szText, IDS_SETSTATUS_NO_VOL);         else            GetString (szText, IDS_STATUS_NOALERTS);         SetDlgItemText (hDlg, IDC_SET_STATUS, szText);         }      if (TASKDATA(ptp)->fs.Type == ftREADWRITE)         {         Filesets_DisplayQuota (hDlg, &TASKDATA(ptp)->fs);         }      else         {         if (TASKDATA(ptp)->fs.Type == ftREPLICA)            GetString (szText, IDS_USAGE_REPLICA);         else // (TASKDATA(ptp)->fs.Type == ftCLONE)            GetString (szText, IDS_USAGE_CLONE);//.........这里部分代码省略.........
开发者ID:bagdxk,项目名称:openafs,代码行数:101,


示例21: switch

bool CViewTransfers::SynchronizeCacheItem(wxInt32 iRowIndex, wxInt32 iColumnIndex) {    wxString    strDocumentText  = wxEmptyString;    wxString    strDocumentText2 = wxEmptyString;    float       fDocumentFloat = 0.0;    double      fDocumentDouble = 0.0, fDocumentDouble2 = 0.0;    CTransfer*  transfer;    bool        bNeedRefresh = false;    strDocumentText.Empty();    if (GetTransferCacheAtIndex(transfer, m_iSortedIndexes[iRowIndex])) {        return false;    }    switch(iColumnIndex) {        case COLUMN_PROJECT:            GetDocProjectName(m_iSortedIndexes[iRowIndex], strDocumentText);            GetDocProjectURL(m_iSortedIndexes[iRowIndex], strDocumentText2);            if (!strDocumentText.IsSameAs(transfer->m_strProjectName) || !strDocumentText2.IsSameAs(transfer->m_strProjectURL)) {                transfer->m_strProjectName = strDocumentText;                transfer->m_strProjectURL = strDocumentText2;                bNeedRefresh =  true;            }            break;        case COLUMN_FILE:            GetDocFileName(m_iSortedIndexes[iRowIndex], strDocumentText);            if (!strDocumentText.IsSameAs(transfer->m_strFileName)) {                transfer->m_strFileName = strDocumentText;                bNeedRefresh =  true;            }            break;        case COLUMN_PROGRESS:            GetDocProgress(m_iSortedIndexes[iRowIndex], fDocumentFloat);            if (fDocumentFloat != transfer->m_fProgress) {                transfer->m_fProgress = fDocumentFloat;                FormatProgress(fDocumentFloat, transfer->m_strProgress);                bNeedRefresh =  true;            }            break;        case COLUMN_SIZE:            GetDocBytesXferred(m_iSortedIndexes[iRowIndex], fDocumentDouble);            GetDocTotalBytes(m_iSortedIndexes[iRowIndex], fDocumentDouble2);            if (( fDocumentDouble != transfer->m_fBytesXferred) ||                 (fDocumentDouble2 != transfer->m_fTotalBytes)                ) {                transfer->m_fBytesXferred = fDocumentDouble;                transfer->m_fTotalBytes = fDocumentDouble2;                FormatSize(fDocumentDouble, fDocumentDouble2, transfer->m_strSize);                bNeedRefresh =  true;            }            break;        case COLUMN_TIME:            GetDocTime(m_iSortedIndexes[iRowIndex], fDocumentDouble);            if (fDocumentDouble != transfer->m_dTime) {                transfer->m_dTime = fDocumentDouble;                FormatTime(fDocumentDouble, transfer->m_strTime);                bNeedRefresh =  true;            }            break;        case COLUMN_SPEED:            GetDocSpeed(m_iSortedIndexes[iRowIndex], fDocumentDouble);            if (fDocumentDouble != transfer->m_dSpeed) {                transfer->m_dSpeed = fDocumentDouble;                FormatSpeed(fDocumentDouble, transfer->m_strSpeed);                bNeedRefresh =  true;            }            break;        case COLUMN_STATUS:            GetDocStatus(m_iSortedIndexes[iRowIndex], strDocumentText);            if (!strDocumentText.IsSameAs(transfer->m_strStatus)) {                transfer->m_strStatus = strDocumentText;                return true;            }            break;    }    return bNeedRefresh;}
开发者ID:niclaslockner,项目名称:boinc,代码行数:78,


示例22: GetDate

// 返回形如"yyyymmdd"的四位年份的八位日期字符串char*GetDate(char *buf) {    struct tm tm;    return FormatTime(buf, GetCurrentTime(&tm), TIME_FORMAT_DATE);}
开发者ID:hamburger20140810,项目名称:utils,代码行数:6,


示例23: FormatTime

voidPlayerDlg::ShowPlayer(){	Player* p = Player::GetCurrentPlayer();	if (p) {		if (txt_name)        txt_name->SetText(p->Name());		if (txt_password)    txt_password->SetText(p->Password());		if (txt_squadron)    txt_squadron->SetText(p->Squadron());		if (txt_signature)   txt_signature->SetText(p->Signature());		char flight_time[64], missions[16], kills[16], losses[16], points[16];		FormatTime(flight_time, p->FlightTime());		sprintf_s(missions, "%d", p->Missions());		sprintf_s(kills,    "%d", p->Kills());		sprintf_s(losses,   "%d", p->Losses());		sprintf_s(points,   "%d", p->Points());		if (lbl_createdate)  lbl_createdate->SetText(FormatTimeString(p->CreateDate()));		if (lbl_rank)        lbl_rank->SetText(Player::RankName(p->Rank()));		if (lbl_flighttime)  lbl_flighttime->SetText(flight_time);		if (lbl_missions)    lbl_missions->SetText(missions);		if (lbl_kills)       lbl_kills->SetText(kills);		if (lbl_losses)      lbl_losses->SetText(losses);		if (lbl_points)      lbl_points->SetText(points);		if (img_rank) {			img_rank->SetPicture(*Player::RankInsignia(p->Rank(), 0));			img_rank->Show();		}		for (int i = 0; i < 15; i++) {			if (img_medals[i]) {				int medal = p->Medal(i);				if (medal) {					medals[i] = medal;					img_medals[i]->SetPicture(*Player::MedalInsignia(medal, 0));					img_medals[i]->Show();				}				else {					medals[i] = -1;					img_medals[i]->Hide();				}			}		}		for (int i = 0; i < 10; i++) {			if (txt_chat[i])			txt_chat[i]->SetText(p->ChatMacro(i));		}	}	else {		if (txt_name)        txt_name->SetText("");		if (txt_password)    txt_password->SetText("");		if (txt_squadron)    txt_squadron->SetText("");		if (txt_signature)   txt_signature->SetText("");		if (lbl_createdate)  lbl_createdate->SetText("");		if (lbl_rank)        lbl_rank->SetText("");		if (lbl_flighttime)  lbl_flighttime->SetText("");		if (lbl_missions)    lbl_missions->SetText("");		if (lbl_kills)       lbl_kills->SetText("");		if (lbl_losses)      lbl_losses->SetText("");		if (lbl_points)      lbl_points->SetText("");		if (img_rank)        img_rank->Hide();		for (int i = 0; i < 15; i++) {			medals[i] = -1;			if (img_medals[i])			img_medals[i]->Hide();		}		for (int i = 0; i < 10; i++) {			if (txt_chat[i])			txt_chat[i]->SetText("");		}	}}
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:79,


示例24: szFrame

StatDialog::StatDialog(wxWindow *parent, wxString prefix, DatabaseManager *db, ConfigManager *cfg, RemarksHandler *rh, TimeInfo time, DrawInfoList user_draws) :    szFrame(parent,            wxID_ANY,            _("Statistics window"),            wxDefaultPosition,            wxDefaultSize,            wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL),    DBInquirer(db),    m_period(time.period),    m_start_time(time.begin_time),    m_current_time(time.begin_time),    m_end_time(time.end_time),    m_tofetch(0){    SetHelpText(_T("draw3-ext-meanvalues"));    cfg->RegisterConfigObserver(this);    wxPanel* panel = new wxPanel(this);    wxString period_choices[PERIOD_T_SEASON] =    { _("DECADE"), _("YEAR"), _("MONTH"), _("WEEK"), _("DAY"), _("30 MINUTES") };    wxStaticText *label;    wxStaticLine *line;    wxButton *button;    m_config_manager = cfg;    m_database_manager = db;    m_draw_search = new IncSearch(m_config_manager, rh, prefix, this, wxID_ANY, _("Choose draw"), false, true, true, m_database_manager);    wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);    label = new wxStaticText(panel, wxID_ANY, wxString(_T(" ")) + _("Choose graph parameters") + _T(": "));    sizer->Add(label, 0, wxALIGN_CENTER | wxALL, 5);    wxStaticBoxSizer *sizer_1 = new wxStaticBoxSizer(wxVERTICAL, panel, wxString(_T(" ")) + _("Draw") + _T(": "));    button = new wxButton(panel, STAT_DRAW_BUTTON, _("Change draw"));    sizer_1->Add(button, 1, wxEXPAND);    sizer->Add(sizer_1, 0, wxEXPAND | wxALL, 5);    wxStaticBoxSizer *sizer_2 = new wxStaticBoxSizer(wxVERTICAL, panel, wxString(_T(" ")) + _("Time range") + _T(": "));    wxFlexGridSizer* sizer_2_1 = new wxFlexGridSizer(2, 5, 5);    sizer_2_1->AddGrowableCol(1);    label = new wxStaticText(panel, wxID_ANY, _("Start time:"));    sizer_2_1->Add(label, 0, wxALIGN_CENTER | wxALL, 5);    button = new wxButton(panel, STAT_START_TIME, FormatTime(m_start_time.GetTime(), m_period));    button->SetFocus();    sizer_2_1->Add(button, 1, wxEXPAND);    label = new wxStaticText(panel, wxID_ANY, _("End time:"));    sizer_2_1->Add(label, 0, wxALIGN_CENTER | wxALL, 5);    button = new wxButton(panel, STAT_END_TIME, FormatTime(m_end_time.GetTime(), m_period));    sizer_2_1->Add(button, 1, wxEXPAND);    sizer_2->Add(sizer_2_1, 0, wxEXPAND | wxALL, 5);    sizer->Add(sizer_2, 0, wxEXPAND | wxALL, 5);    line = new wxStaticLine(panel);    sizer->Add(line, 0, wxEXPAND, 5);    wxStaticBoxSizer* sizer_3 = new wxStaticBoxSizer(wxVERTICAL, panel, wxString(_T(" ")) + _("Period") + _T(": "));    line = new wxStaticLine(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL);    m_period_choice = new wxChoice(panel, STAT_CHOICE_PERIOD, wxDefaultPosition, wxDefaultSize, PERIOD_T_SEASON, period_choices);    sizer_3->Add(m_period_choice, 0, wxALIGN_CENTER | wxALL, 5);    sizer->Add(sizer_3, 0, wxEXPAND | wxALL, 5);    wxStaticBoxSizer* sizer_4 = new wxStaticBoxSizer(wxVERTICAL, panel, wxString(_T(" ")) + _("Values") + _T(": "));    wxPanel *subpanel = new wxPanel(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS);    wxFlexGridSizer *subpanel_sizer = new wxFlexGridSizer(2, 5, 5);    subpanel_sizer->AddGrowableCol(2);    label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Minimum value")) + _T(":"));    subpanel_sizer->Add(label, wxALIGN_LEFT | wxALL, 10);    m_min_value_text = new wxStaticText(subpanel, wxID_ANY, _T(""));    subpanel_sizer->Add(m_min_value_text, wxEXPAND | wxALL, 10);    label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Average value")) + _T(":"));    subpanel_sizer->Add(label, wxALIGN_LEFT | wxLEFT | wxRIGHT, 20);    m_avg_value_text = new wxStaticText(subpanel, wxID_ANY, _T(""));    subpanel_sizer->Add(m_avg_value_text, wxEXPAND | wxLEFT | wxRIGHT, 20);    label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Standard deviation")) + _T(":"));    subpanel_sizer->Add(label, wxALIGN_LEFT | wxLEFT | wxRIGHT, 20);    m_stddev_value_text = new wxStaticText(subpanel, wxID_ANY, _T(""));    subpanel_sizer->Add(m_stddev_value_text, wxEXPAND | wxLEFT | wxRIGHT, 20);    label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Maximum value")) + _T(":"));    subpanel_sizer->Add(label, wxALIGN_LEFT | wxLEFT | wxRIGHT, 20);    m_max_value_text = new wxStaticText(subpanel, wxID_ANY, _T(""));    subpanel_sizer->Add(m_max_value_text, wxEXPAND | wxLEFT | wxRIGHT, 20);    label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Hour sum")) + _T(":"));    subpanel_sizer->Add(label, wxALIGN_LEFT | wxLEFT | wxRIGHT, 20);//.........这里部分代码省略.........
开发者ID:wds315,项目名称:szarp,代码行数:101,


示例25: wxGetApp

// show project properties//void CDlgItemProperties::renderInfos(PROJECT* project_in) {    std::string projectname;    //collecting infos    project_in->get_name(projectname);    //disk usage needs additional lookups    CMainDocument* pDoc = wxGetApp().GetDocument();    pDoc->CachedDiskUsageUpdate();        // CachedDiskUsageUpdate() may have invalidated our project     // pointer, so get an updated pointer to this project    PROJECT* project = pDoc->project(project_in->master_url);    if(!project) return;     // TODO: display some sort of error alert?    std::vector<PROJECT*> dp = pDoc->disk_usage.projects;    double diskusage=0.0;        for (unsigned int i=0; i< dp.size(); i++) {        PROJECT* tp = dp[i];                std::string tname;                tp->get_name(tname);        wxString t1(wxString(tname.c_str(),wxConvUTF8));        if(t1.IsSameAs(wxString(projectname.c_str(),wxConvUTF8)) || t1.IsSameAs(wxString(project->master_url, wxConvUTF8))) {            diskusage =tp->disk_usage;            break;        }    }    //set dialog title    wxString wxTitle = _("Properties of project ");    wxTitle.append(wxString(projectname.c_str(),wxConvUTF8));    SetTitle(wxTitle);    //layout controls    addSection(_("General"));    addProperty(_("Master URL"),wxString(project->master_url, wxConvUTF8));    addProperty(_("User name"),wxString(project->user_name.c_str(),wxConvUTF8));    addProperty(_("Team name"),wxString(project->team_name.c_str(),wxConvUTF8));    addProperty(_("Resource share"),wxString::Format(wxT("%0.0f"),project->resource_share));    if (project->min_rpc_time > dtime()) {        addProperty(_("Scheduler RPC deferred for"), FormatTime(project->min_rpc_time - dtime()));    }    if (project->download_backoff) {        addProperty(_("File downloads deferred for"), FormatTime(project->download_backoff));    }    if (project->upload_backoff) {        addProperty(_("File uploads deferred for"), FormatTime(project->upload_backoff));    }    addProperty(_("Disk usage"),FormatDiskSpace(diskusage));    addProperty(_("Computer ID"), wxString::Format(wxT("%d"), project->hostid));    if (project->non_cpu_intensive) {        addProperty(_("Non CPU intensive"), _("yes"));    }    addProperty(_("Suspended via GUI"),project->suspended_via_gui ? _("yes") : _("no"));    addProperty(_("Don't request more work"),project->dont_request_more_work ? _("yes") : _("no"));    if (project->scheduler_rpc_in_progress) {        addProperty(_("Scheduler call in progress"), _("yes"));    }    if (project->trickle_up_pending) {        addProperty(_("Trickle-up pending"), _("yes"));    }    if (strlen(project->venue)) {        addProperty(_("Host location"), wxString(project->venue, wxConvUTF8));    } else {        addProperty(_("Host location"), _("default"));    }    if (project->attached_via_acct_mgr) {        addProperty(_("Added via account manager"), _("yes"));    }    if (project->detach_when_done) {        addProperty(_("Remove when tasks done"), _("yes"));    }    if (project->ended) {        addProperty(_("Ended"), _("yes"));    }    addSection(_("Credit"));    addProperty(_("User"),        wxString::Format(            wxT("%0.2f total, %0.2f average"),            project->user_total_credit,            project->user_expavg_credit        )    );    addProperty(_("Host"),        wxString::Format(            wxT("%0.2f total, %0.2f average"),            project->host_total_credit,            project->host_expavg_credit        )    );        if (!project->non_cpu_intensive) {        addSection(_("Scheduling"));        addProperty(_("Scheduling priority"),wxString::Format(wxT("%0.2f"), project->sched_priority));        show_rsc(_("CPU"), project->rsc_desc_cpu);        if (pDoc->state.have_nvidia) {            show_rsc(_("NVIDIA GPU"), project->rsc_desc_nvidia);        }        if (pDoc->state.have_ati) {            show_rsc(_("ATI GPU"), project->rsc_desc_ati);        }//.........这里部分代码省略.........
开发者ID:abergstr,项目名称:BOINC,代码行数:101,


示例26: FormatTime

void InfoWidget::SetOtherTime(const wxDateTime &time) {	wxString str;	str = FormatTime(time, m_period);	other_date->SetLabel(str);}
开发者ID:firebitsbr,项目名称:szarp,代码行数:5,


示例27: FillDEDMatrix

void ICPClass::ExecDESTMode(void){	//Line1	FillDEDMatrix(0,4,"DEST  DIR");	AddSTPT(0,22);			//Get the current waypoint location	xCurr = yCurr = zCurr = 0;	AircraftClass *playerAC = SimDriver.GetPlayerAircraft();	if (playerAC && playerAC->curWaypoint)		playerAC->curWaypoint->GetLocation(&xCurr, &yCurr, &zCurr);			latitude	= (FALCON_ORIGIN_LAT * FT_PER_DEGREE + xCurr) / EARTH_RADIUS_FT;	cosLatitude = (float)cos(latitude);	longitude	= ((FALCON_ORIGIN_LONG * DTR * EARTH_RADIUS_FT * cosLatitude) + yCurr) / (EARTH_RADIUS_FT * cosLatitude);			latitude	*= RTD;	longitude	*= RTD;		longDeg		= FloatToInt32(longitude);	longMin		= (float)fabs(longitude - longDeg) * DEG_TO_MIN;	latDeg		= FloatToInt32(latitude);	latMin		= (float)fabs(latitude - latDeg) * DEG_TO_MIN;	// format lat/long here	if(latMin < 10.0F) 		sprintf(latStr, "%3d*0%2.2f/'", latDeg, latMin);	else 		sprintf(latStr, "%3d*%2.2f/'", latDeg, latMin);	if(longMin < 10.0F) 		sprintf(longStr, "%3d*0%2.2f/'", longDeg, longMin);	else 		sprintf(longStr, "%3d*%2.2f/'", longDeg, longMin);	//Line2	if(IsICPSet(ICPClass::EDIT_LAT) && Manual_Input)	{		FillDEDMatrix(1,5,"LAT  N");		PossibleInputs = 6;		ScratchPad(1,13,24);	}	else	{		if(IsICPSet(ICPClass::EDIT_LAT))		{			FillDEDMatrix(1,13,"/x02",2);			FillDEDMatrix(1,24,"/x02",2);		}		else		{			FillDEDMatrix(1,13," ");			FillDEDMatrix(1,24," ");		}		FillDEDMatrix(1,5,"LAT  N");		sprintf(tempstr,"%s", latStr);		FillDEDMatrix(1,14,tempstr);			}	//Line3	if(IsICPSet(ICPClass::EDIT_LONG) && Manual_Input)	{		FillDEDMatrix(2,5,"LNG  E");		PossibleInputs = 7;		ScratchPad(2,13,24);	}	else	{			if(IsICPSet(ICPClass::EDIT_LONG))		{			FillDEDMatrix(2,13,"/x02",2);			FillDEDMatrix(2,24,"/x02",2);		}		else		{			FillDEDMatrix(2,13," ");			FillDEDMatrix(2,24," ");		}		FillDEDMatrix(2,5,"LNG  E");		sprintf(tempstr, "%s", longStr);		FillDEDMatrix(2,14,tempstr);	}	//Line4	FillDEDMatrix(3,4,"ELEV");	sprintf(tempstr,"%4.0fFT",-zCurr);	FillDEDMatrix(3,13,tempstr);	//Line5	if(playerAC)	{		VU_TIME ETA = SimLibElapsedTime / SEC_TO_MSEC + FloatToInt32(Distance(		playerAC->XPos(), playerAC->YPos(), xCurr, yCurr) 		/ playerAC->af->vt);		FormatTime(ETA, tempstr);	}	FillDEDMatrix(4,5,"TOS");	FillDEDMatrix(4,13,tempstr);}
开发者ID:JagHond,项目名称:freefalcon-central,代码行数:97,


示例28: GetTimestamp

// 返回形如"yyyymmddhhmmss"的十四位时间戳字符串char*GetTimestamp(char *buf) {    struct tm tm;    return FormatTime(buf, GetCurrentTime(&tm), TIME_FORMAT_TIMESTAMP);}
开发者ID:hamburger20140810,项目名称:utils,代码行数:6,



注:本文中的FormatTime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ FormatTxStatus函数代码示例
C++ FormatString函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。