GNC::GUI::AcquisitionNode::AcquisitionNode(AcquisitionNode* parent, const GNC::GCS::Ptr<GIL::DICOM::DicomDataset> info): pData(info), pParent(parent) { if (IsSeriesNode()) { uid = pData->getTag(GKDCM_SeriesInstanceUID); SetDateTime(pData->getTag(GKDCM_SeriesDate),pData->getTag(GKDCM_SeriesTime)); } else { uid = pData->getTag(GKDCM_StudyInstanceUID); SetDateTime(pData->getTag(GKDCM_StudyDate),pData->getTag(GKDCM_StudyTime)); } if (uid.empty()) { LOG_ERROR(LOGGER, "trying to insert a node without uid"); } }
ErrorMessage :: ErrorMessage ( ) : sep00('('), sep01('/'), sep02('/'), sep1(' '), sep11(':'), sep12(':'), sep13(')'), sep2(' '), sep3('-'), sep4(' '), sep5(':'), sep7('('), sep8(')') { SetDateTime(); memset(component,' ',sizeof(component)); memset(error_type,' ',sizeof(error_type)); memset(error_code,' ',sizeof(error_code)); memset(object_class,' ',sizeof(object_class)); memcpy(sep6,":: ",3), memset(function,' ',sizeof(function)); memset(text,' ',sizeof(text)); memcpy(new_line,"\r\n",2); }
/**************************************** ** Author: Joe Li ** Purpose: Save whiteboard settings data ** Comments: ****************************************/ bool DOSaveAppData::SaveWhiteboardSettings(const CComBSTR& sourcePath, const CComBSTR& sourceFileName, const CComBSTR& targetPath) { DOPersistentFile sourceFile; // Open source file for reading if (sourceFile.OpenFile(sourcePath, sourceFileName, DOFile::DO_FILE_OPEN_EXISTING, DOFile::DO_FILE_READ) == true) { SetDateTime(); CComBSTR targetFileName = m_dateTime; targetFileName.Append(sourceFileName); DORemovableStorageFile targetFile; bool targetFileOpen = true; // Open existing target file if (targetFile.OpenFile(targetPath, targetFileName, DOFile::DO_FILE_TRUNCATE_EXISTING) == false) // Create target file if open existing file failed if (targetFile.OpenFile(targetPath, targetFileName) == false) targetFileOpen = false; if (targetFileOpen == true) { DOFileUtility fileUtility; return fileUtility.CopyFileContents(&sourceFile, &targetFile); } } return false; }
void SDateEdit::SetDateTime( CTime tm ) { TCHAR szBuf[256]; struct tm ttm; _tcsftime(szBuf,256,_T("%Y/%m/%d"),tm.GetLocalTm(&ttm)); SetDateTime(szBuf); }
void ErrorMessage :: SetData (Error *error_obj ) { SetDateTime(); SetError(error_obj); }
int STimeEdit::OnCreate(LPVOID) { int nRet = __super::OnCreate(NULL); if (nRet != 0) return nRet; SetDateTime(CTime::GetCurrentTime()); return 0; }
void Buddy::HandleMessage (const char *who, const char *body, PurpleMessageFlags flags, time_t time) { if (flags & PURPLE_MESSAGE_SEND) return; auto msg = new ConvIMMessage (QString::fromUtf8 (body), IMessage::Direction::In, this); if (time) msg->SetDateTime (QDateTime::fromTime_t (time)); Store (msg); }
OSErr Initialize( void ) { SetDateTime( OSI_GetTime() ); NewGestalt( MOL_GESTALT_SELECTOR, NewSelectorFunctionProc(mol_gestalt_selector)); mouse_init(); return noErr; }
int SDateEdit::OnCreate(LPVOID) { int nRet = __super::OnCreate(NULL); if (nRet != 0) return nRet; __time64_t tm=::_time64(NULL); SetDateTime(tm); return 0; }
void CMdbPara::SetNumber(register uint32 nFieldNo, register void* pVal, register uint32 nOperator) { switch(GetType(nFieldNo)) { case MDB_INT8_FIELD: SetInt8(nFieldNo, *(int8*)pVal, nOperator); break; case MDB_INT16_FIELD: SetInt16(nFieldNo, *(int16*)pVal, nOperator); break; case MDB_INT32_FIELD: SetInt32(nFieldNo, *(int32*)pVal, nOperator); break; case MDB_INT64_FIELD: SetInt64(nFieldNo, *(int64*)pVal, nOperator); break; case MDB_UINT8_FIELD: SetUInt8(nFieldNo, *(uint8*)pVal, nOperator); break; case MDB_UINT16_FIELD: SetUInt16(nFieldNo, *(uint16*)pVal, nOperator); break; case MDB_UINT32_FIELD: SetUInt32(nFieldNo, *(uint32*)pVal, nOperator); break; case MDB_UINT64_FIELD: SetUInt64(nFieldNo, *(uint64*)pVal, nOperator); break; case MDB_FLOAT_FIELD: SetFloat(nFieldNo, *(float*)pVal, nOperator); break; case MDB_DOUBLE_FIELD: SetDouble(nFieldNo, *(double*)pVal, nOperator); break; case MDB_DATE_FIELD: SetDate(nFieldNo, *(CDate*)pVal, nOperator); break; case MDB_TIME_FIELD: SetTime(nFieldNo, *(CTime*)pVal, nOperator); break; case MDB_DATETIME_FIELD: SetDateTime(nFieldNo, *(CDateTime*)pVal, nOperator); break; } }
void ErrorMessage :: SetData (char *display_name, char *message_type, char *string ) { SetDateTime(); gvtxstb(component,display_name,sizeof(component)); gvtxstb(error_type,message_type,sizeof(error_type)); memset(error_code,' ',sizeof(object_class)); memset(object_class,' ',sizeof(object_class)); memset(function,' ',sizeof(function)); gvtxstb(text,string,sizeof(text)); if ( strlen(string) > sizeof(text) ) memcpy(text+sizeof(text)-4," ...",4); }
int settimeofday (const struct timeval *tv, const struct timezone *tz) { TTime tt; TDate td; if (NULL != tv) { struct tm t; tt.sec = t.tm_sec; tt.min = t.tm_min; tt.hour = t.tm_hour; td.day = t.tm_mday; td.month = t.tm_mon+1; td.year = t.tm_year+1900; SetDateTime(&td, &tt); } if (NULL != tz) { /* а шо тут делать? */ } return 0; }
/**************************************** ** Author: Joe Li ** Purpose: Save log file ** Comments: ****************************************/ bool DOSaveAppData::SaveLog(const CComBSTR& targetPath, LOG_TYPE logToSave) { HRESULT hr = E_FAIL; DOLogMaintenanceBase logMaintenance(hr); if (SUCCEEDED(hr)) { SetDateTime(); CComBSTR targetLogFileName = m_dateTime; switch(logToSave) { case ALARM_LOG: targetLogFileName.Append(_T("AlarmLog.txt")); break; case ERROR_LOG: targetLogFileName.Append(_T("ErrorLog.txt")); break; case RND_LOG: targetLogFileName.Append(_T("RnDLog.txt")); break; case KEYPRESS_LOG: targetLogFileName.Append(_T("KeyPressLog.txt")); break; case EVENT_LOG: targetLogFileName.Append(_T("EventLog.txt")); break; default: return false; } return logMaintenance.WriteLogEntriesToRemovableStorage(logToSave, targetPath, targetLogFileName); } return false; }
inline CField& CField::operator=(time_t tValue) { SetDateTime(tValue); return *this; }
FX_BOOL CXFA_LocaleValue::ParsePatternValue(const CFX_WideString& wsValue, const CFX_WideString& wsPattern, IFX_Locale* pLocale) { IFX_Locale* locale = m_pLocaleMgr->GetDefLocale(); if (pLocale) { m_pLocaleMgr->SetDefLocale(pLocale); } CFX_FormatString* pFormat = nullptr; if (m_pLocaleMgr) pFormat = new CFX_FormatString(m_pLocaleMgr, FALSE); CFX_WideStringArray wsPatterns; pFormat->SplitFormatString(wsPattern, wsPatterns); FX_BOOL bRet = FALSE; int32_t iCount = wsPatterns.GetSize(); for (int32_t i = 0; i < iCount && !bRet; i++) { CFX_WideString wsFormat = wsPatterns[i]; FX_LOCALECATEGORY eCategory = pFormat->GetCategory(wsFormat); eCategory = XFA_ValugeCategory(eCategory, m_dwType); switch (eCategory) { case FX_LOCALECATEGORY_Null: bRet = pFormat->ParseNull(wsValue, wsFormat); if (bRet) { m_wsValue.clear(); } break; case FX_LOCALECATEGORY_Zero: bRet = pFormat->ParseZero(wsValue, wsFormat); if (bRet) { m_wsValue = FX_WSTRC(L"0"); } break; case FX_LOCALECATEGORY_Num: { CFX_WideString fNum; bRet = pFormat->ParseNum(wsValue, wsFormat, fNum); if (bRet) { m_wsValue = fNum; } break; } case FX_LOCALECATEGORY_Text: bRet = pFormat->ParseText(wsValue, wsFormat, m_wsValue); break; case FX_LOCALECATEGORY_Date: { CFX_Unitime dt; bRet = ValidateCanonicalDate(wsValue, dt); if (!bRet) { bRet = pFormat->ParseDateTime(wsValue, wsFormat, FX_DATETIMETYPE_Date, dt); } if (bRet) { SetDate(dt); } break; } case FX_LOCALECATEGORY_Time: { CFX_Unitime dt; bRet = pFormat->ParseDateTime(wsValue, wsFormat, FX_DATETIMETYPE_Time, dt); if (bRet) { SetTime(dt); } break; } case FX_LOCALECATEGORY_DateTime: { CFX_Unitime dt; bRet = pFormat->ParseDateTime(wsValue, wsFormat, FX_DATETIMETYPE_DateTime, dt); if (bRet) { SetDateTime(dt); } break; } default: m_wsValue = wsValue; bRet = TRUE; break; } } if (!bRet) { m_wsValue = wsValue; } pFormat->Release(); if (pLocale) { m_pLocaleMgr->SetDefLocale(locale); } return bRet; }
//------------------------------------------------------------------------ // Sample program to demonstrate the LCD and keypad //------------------------------------------------------------------------ void main ( void ) { auto int option; static int state; //------------------------------------------------------------------------ // Initialize the controller //------------------------------------------------------------------------ brdInit(); // Initialize the controller dispInit(); // Start-up the keypad driver, Initialize the graphic driver keypadDef(); // Use the default keypad ASCII return values glBackLight(1); // Turn-on the backlight glXFontInit(&fi6x8, 6, 8, 32, 127, Font6x8); // Initialize 6x8 font glXFontInit(&fi8x10, 8, 10, 32, 127, Font8x10); // Initialize 10x16 font glXFontInit(&fi12x16, 12, 16, 32, 127, Font12x16); // Initialize 12x16 font // Setup and center text window to be the entire display TextWindowFrame(&textWindow, &fi6x8, 1, 0, 121, 32); // Set variables to known states ledCntrl = LEDOFF; // Initially disable the LED's state = MENU_INIT; //------------------------------------------------------------------------ // Display Sign-on message and wait for keypress //------------------------------------------------------------------------ SignOnMessage(); //------------------------------------------------------------------------ // Main program loop for the MENU system //------------------------------------------------------------------------ for (;;) { costate { keyProcess (); waitfor(DelayMs(10)); } costate { leds(OPERATE); waitfor(DelayMs(50)); } costate { // Display the MAIN MENU waitfor((option = display_menu(main_menu, &state, LVL_MAINMENU, NUM_MAINMENU_OPTS)) > 0); // Get menu option from the user switch(option) { // Change Date/Time case 1: glBlankScreen(); SetDateTime(); state = MENU_INIT; break; // Display current Date/Time case 2: glBlankScreen(); waitfor(dispDate()); state = MENU_INIT; break; // Display backlight memu options case 3: waitfor(backlight_menu()); state = MENU_REFRESH; break; // Enable Toggle leds option case 4: leds(TOGGLE); state = MENU_NO_CHANGE; break; // Enable Increment leds option case 5: leds(INCREMENT); state = MENU_NO_CHANGE; break; // Disable LED's case 6: leds(LEDOFF); state = MENU_NO_CHANGE; break; // User made invalid selection default: break; } } } }
EXPORT_C THTTPHdrVal::THTTPHdrVal(TDateTime aDateVal) { SetDateTime(aDateVal); }
/**************************************** ** Author: Joe Li ** Purpose: Get date and time used for saving app data ** Comments: ****************************************/ void DOSaveAppData::GetDateTime(CComBSTR& dateTime) { SetDateTime(); dateTime = m_dateTime; }
//预授权完成 int CTradePreAuthCptReq::DoPack(SAConnection *saConn, void * pNode, unsigned char * pBuffer, unsigned & iBufLen) { if(saConn == NULL || pNode == NULL || pBuffer == NULL) { trace_log(ERR, "Paramter error!"); return RET_SYSEXP; } trace_log(DBG,"-----PreAuthCptReq-----"); TRADEDATA * pData = (TRADEDATA *)pNode; int nTlvLen=0; char cICCID[4]={0},cICData[256]={0},cLField60[18]={0}; CTLVTemplet tlvObj; if(1 != tlvObj.UnPackTLVData(pData->TransData.TlvDataLen, pData->TransData.TlvData)) { trace_log(ERR, "UnPackTLVData fail!"); return RET_SYSEXP; } bool bFlag = true; bool bHasPin = false, bHasTrack = false; BYTE bTmpData[FIELD_MAXLEN]={0}; //0消息类型 bFlag &= sndObj.SetValueByStr(0 , "0200"); //2账号 bFlag &= sndObj.SetValueByStr(2 , pData->TransData.HeadData.Account); //3处理码 bFlag &= sndObj.SetValueByStr(3 , "000000"); //4交易金额 bFlag &= sndObj.SetValueByStr(4 , pData->TransData.HeadData.ReqAmount); //11流水号 bFlag &= sndObj.SetValueByStr(11, pData->VouchNo); SetDateTime(); /**< 设置时间12域和日期13域 */ //F23 卡片序列号 /*nTlvLen= tlvObj.GetTLVItemByHex(TAG_ICCID, (BYTE *)cICCID, sizeof(cICCID)); if(nTlvLen>0) { char cICNO[5]={0}; BcdToAsc((BYTE *)cICNO,(BYTE *)cICCID,nTlvLen); bFlag &= sndObj.SetValueByStr(23, cICNO+1); }*/ //NII bFlag &= sndObj.SetValueByStr(24,"009"); //服务点条件码 bFlag &= sndObj.SetValueByStr(25,"14"); //32 受理机构代码 bFlag &= sndObj.SetValueByStr(32, pData->RcvBrchCode); //33 发送机构代码 bFlag &= sndObj.SetValueByStr(33, pData->SndBrchCode); /**< 磁道处理*/ /*if(SetTrack(pData,tlvObj,bHasTrack)!=0) { trace_log(ERR, "SetTrack faile"); return -1; }else{ trace_log(DBG, "SetTrack SUCCESS"); }*/ //38授权码 if(strlen(pData->TransData.HeadData.OrigAuthCode) > 0) { bFlag &= sndObj.SetValueByStr(38, pData->TransData.HeadData.OrigAuthCode); } sndObj.SetValueByStr(39, "00"); //终端号 bFlag &= sndObj.SetValueByStr(41, pData->TransData.HeadData.arrRTermNo); //42商户号 bFlag &= sndObj.SetValueByStr(42, pData->TransData.HeadData.arrRMerchNo); //49货币代码 bFlag &= sndObj.SetValueByStr(49, "156"); /**< 52密码*/ /*if(SetPinKey(pData, tlvObj,bHasPin)!=0) { trace_log(ERR, "SetPinKey faile"); return -1; }else{ trace_log(DBG, "SetPinKey SUCCESS"); }*/ /* //55 IC卡数据域 nTlvLen= tlvObj.GetTLVItemByHex(TAG_FIELD55_RSP, (BYTE *)cICData, sizeof(cICData)); if(nTlvLen>0) { // bFlag &= sndObj.SetValueByHex(55, (BYTE *)cICData,nTlvLen); }else{ char cTrace[128]={0}; tlvObj.GetTLVItemByHex(TAG_TRACK2,(unsigned char*) cTrace, sizeof(cTrace)); int i=0; for(i=0;i<strlen(cTrace);i++) { if(0==memcmp(cTrace+i,"D",1)) { if((0==memcmp(cTrace+i+5,"2",1)||0==memcmp(cTrace+i+5,"6",1))) { memcpy(pData->TransData.HeadData.RspCode,"45",2); strcpy(pData->TransData.HeadData.RspDecs,"不允许降级交易"); return RET_PACK; }else{ break; } } } } */ /**< 22服务点输入方式码*/ bFlag &= sndObj.SetValueByStr(22,"021");//(char*)pData->TransData.HeadData.SvrPointCode //61凭证号批次号 nTlvLen= tlvObj.GetTLVItemByHex(TAG_RESERVED1, (BYTE *)cLField60, sizeof(cLField60)); memset(bTmpData, 0, sizeof(bTmpData)); if(nTlvLen>=6) { char cF60[18]={0}; BcdToAsc((BYTE *)cF60,(BYTE *)cLField60,nTlvLen); sprintf((char *)bTmpData, "%s%s%s%s%s", pData->BatchNo, "001","000000","00","0000000000"); memcpy(bTmpData+27,cF60+11,2); }else{ sprintf((char *)bTmpData, "%s%s%s", pData->BatchNo, "001","000000"); } bFlag &= sndObj.SetValueByStr(61, (char *)bTmpData); //62原始交易信息(信息类型码,系统跟踪号,交易日期和时间) memset(bTmpData, 0, sizeof(bTmpData)); sprintf((char *)bTmpData, "%s%s%s","0200", pData->TransData.HeadData.OrigLPosSeq,pData->cOri_DateTime); bFlag &= sndObj.SetValueByStr(62, (char *)bTmpData); //64MAC bFlag &= sndObj.SetValueByHex(64, (unsigned char*)"00000000", 8); /**< 组包*/ iBufLen = PACK_MAXLEN; bFlag &= sndObj.Pack(pBuffer, iBufLen); if(!bFlag) { trace_log(ERR, "Pack right CUPS8583 fail!"); return RET_PACK; } /**< 计算Mac */ /*BYTE bMac[9] = {0}; int nMacLen = 8; GenMacData(pData,sndObj,bMac); memcpy(pBuffer + iBufLen -nMacLen, bMac, nMacLen); return RET_SUCCESS;*/ }
CDateTime::CDateTime(int year, int month, int day, int hour, int minute, int second) { SetDateTime(year, month, day, hour, minute, second); }