LogMessage::LogMessage(LogLevel level, const IString& message, const std::string& identifier) : time(TimeStamp()), level(level), domain("---"), identifier(identifier), message(message) {}
void MaxLogStream::DoLogString(const wxChar *szString, time_t t) { wxString str; TimeStamp(&str); str << szString; _wx_wxlog_wxLogStream__DoLogString(maxHandle, bbStringFromWxString(str)); }
GestureEventListener::GestureEventListener(AsyncPanZoomController* aAsyncPanZoomController) : mAsyncPanZoomController(aAsyncPanZoomController), mState(GESTURE_NONE), mSpanChange(0.0f), mPreviousSpan(0.0f), mLastTouchInput(MultiTouchInput::MULTITOUCH_START, 0, TimeStamp(), 0) { }
/// @brief Implementation of logging function. void ListBoxLogger::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) { wxString msg; TimeStamp(&msg); msg += szString; m_lbox->Append(msg); m_lbox->SetFirstItem(m_lbox->GetCount() - 1); }
int EndRun(StreamReader* Reader) { CurrRun.StopTime = TimeStamp( Reader->TrigSec, Reader->TrigNano ); CurrRun.FullTime = CurrRun.StopTime - CurrRun.StartTime - CurrRun.SkipTime; //CurrRun.Dump(); CurrRun.DumpToFile( RunInfoOutput ); return 1; }
bool FvTimeStampTest::RunTest() { FvUInt64 uiTime = TimeStamp(); unsigned long uiTimeSec = StampsPerSecond(); std::cout << uiTime << std::endl; std::cout << uiTimeSec << std::endl; return true; }
void CNetworkFieldIntensitySensor::SignalLevelReceivedL(TInt aLevel) { JELOG2(ESensor); __ASSERT_DEBUG(iData != NULL, User::Invariant()); SensorData* data = iData[ KNISensorChannel ]; TTime currentTime; if ((data->iTimeStampsIncluded) || (iBufferingPeriod > 0)) { currentTime.UniversalTime(); if (iStartTime == KErrNotFound) { iStartTime = currentTime; } } // P&S sensors are assumed to have one channel only TInt interpretedValue = InterpretValue(aLevel); // Negative values are error codes and therefore marked // as invalid. Returned value for invalid values is zero. if (interpretedValue < 0) { data->iIntValues[ data->iNumOfValues ] = KNISensorInvalidValue; if (data->iValiditiesIncluded) { data->iValidities[ data->iNumOfValues ] = EFalse; } } else { data->iIntValues[ data->iNumOfValues ] = interpretedValue; if (data->iValiditiesIncluded) { data->iValidities[ data->iNumOfValues ] = ETrue; } } if (data->iTimeStampsIncluded) { data->iTimeStamps[ data->iNumOfValues ] = TimeStamp(currentTime); } data->iNumOfValues++; TInt64 intervalFromStart = -1; if (iBufferingPeriod > 0) { intervalFromStart = currentTime.MicroSecondsFrom(iStartTime).Int64(); } if ((data->iNumOfValues == iBufferSize) || (iBufferingPeriod > 0 && intervalFromStart > iBufferingPeriod)) { SendData(); } }
unsigned int get(RawHID::Device& device,IMU::RawSample rawSamples[2],PSMove::FeatureState& featureState,TimeStampSource& timeStampSource) // Reads next sensor data packet from given raw HID device directly into the given raw sample structures, updates given time stamp source; returns number of lost and received packets since last call { /* Read the next input report: */ memset(pktBuffer,0,sizeof(pktBuffer)); pktBuffer[0]=0x01U; device.readReport(pktBuffer,sizeof(pktBuffer)); /* Extract set of button states and valuator state: */ featureState.buttons[0]=(pktBuffer[1]&0x01U)!=0; featureState.buttons[1]=(pktBuffer[1]&0x08U)!=0; featureState.buttons[2]=(pktBuffer[2]&0x10U)!=0; featureState.buttons[3]=(pktBuffer[2]&0x20U)!=0; featureState.buttons[4]=(pktBuffer[2]&0x40U)!=0; featureState.buttons[5]=(pktBuffer[2]&0x80U)!=0; featureState.buttons[6]=(pktBuffer[3]&0x01U)!=0; featureState.buttons[7]=(pktBuffer[3]&0x08U)!=0; featureState.buttons[8]=(pktBuffer[3]&0x10U)!=0; featureState.valuators[0]=pktBuffer[6]; /* Unpack the report sequence number and time stamp: */ Misc::UInt16 newSequenceNumber=Misc::UInt16(pktBuffer[4]&0x0fU); Misc::UInt16 sequenceNumberDelta=(newSequenceNumber-sequenceNumber)&0x0f; sequenceNumber=newSequenceNumber; timeStamp=(Misc::UInt16(pktBuffer[11])<<8)|Misc::UInt16(pktBuffer[43]); /* Advance the time stamp source: */ timeStampSource.advance(TimeStamp(sequenceNumberDelta)*packetInterval); struct // Helper bitfield structure to sign-extend a 12-bit integer { signed int si:12; } s; /* Unpack the battery and temperature state: */ batteryState=int(pktBuffer[12]); temperature=s.si=((int(pktBuffer[37])<<4)|(int(pktBuffer[38])>>4))&0x0fff; /* Fill in the raw sample structure for the first half-sample: */ for(int i=0;i<3;++i) rawSamples[0].accelerometer[i]=((int(pktBuffer[14+i*2])<<8)|int(pktBuffer[13+i*2]))-0x8000; for(int i=0;i<3;++i) rawSamples[0].gyroscope[i]=((int(pktBuffer[26+i*2])<<8)|int(pktBuffer[25+i*2]))-0x8000; rawSamples[0].magnetometer[0]=s.si=((int(pktBuffer[38])<<8)|int(pktBuffer[39]))&0x0fff; rawSamples[0].magnetometer[1]=s.si=((int(pktBuffer[40])<<4)|(int(pktBuffer[41])>>4))&0x0fff; rawSamples[0].magnetometer[2]=s.si=((int(pktBuffer[41])<<8)|int(pktBuffer[42]))&0x0fff; /* Fill in the raw sample callback structure for the second half-sample: */ for(int i=0;i<3;++i) rawSamples[1].accelerometer[i]=((int(pktBuffer[20+i*2])<<8)|int(pktBuffer[19+i*2]))-0x8000; for(int i=0;i<3;++i) rawSamples[1].gyroscope[i]=((int(pktBuffer[32+i*2])<<8)|int(pktBuffer[31+i*2]))-0x8000; for(int i=0;i<3;++i) rawSamples[1].magnetometer[i]=rawSamples[0].magnetometer[i]; return sequenceNumberDelta; }
void LayerManager::PostPresent() { if (!mTabSwitchStart.IsNull()) { Telemetry::Accumulate(Telemetry::FX_TAB_SWITCH_TOTAL_MS, uint32_t((TimeStamp::Now() - mTabSwitchStart).ToMilliseconds())); mTabSwitchStart = TimeStamp(); } }
void GMPAudioSamplesImpl::RelinquishData(GMPAudioEncodedSampleData& aData) { aData.mData() = Move(mBuffer); aData.mTimeStamp() = TimeStamp(); if (mCrypto) { mCrypto->RelinquishData(aData.mDecryptionData()); } }
void BioSeq::SearchFull(std::fstream &myfile) { int count = 0; for(auto &m_a : m_motifs_a) { m_motif = m_a; m_motif.score = 0; m_motif.A_count = 0; m_motif.G_count = 0; m_motif.aQ.clear(); m_motif.bQ.clear(); m_motif.a_mis.clear(); m_motif.b_mis.clear(); if(IsMotif()) { // std::cout<<"motif found, score: "<<m_motif.score<<std::endl; // std::cout<<"motif found: "<<m_motif.bs.a+"."+m_motif.bs.b<<" "<<m_motif.bs.index<<std::endl; // std::cout<<"motif found A nd G counts: "<<m_motif.A_count<< " "<<m_motif.G_count<<std::endl; // std::cout<<"motif found aQ size: "<<m_motif.aQ.size()<<std::endl; // std::cout<<"motif found aQ: \n"; // PrintVectorToConsole(m_motif.aQ, 0, m_motif.aQ.size()-1); // std::cout<<"motif found bQ size: "<<m_motif.bQ.size()<<std::endl; // std::cout<<"motif found bQ: \n"; // PrintVectorToConsole(m_motif.bQ, 0, m_motif.bQ.size()-1); // std::cout<<"motif found a_mis size: "<<m_motif.a_mis.size()<<std::endl; // std::cout<<"motif found a_mis: \n"; // PrintVectorToConsole(m_motif.a_mis, 0, m_motif.a_mis.size()-1); // std::cout<<"motif found b_mis size: "<<m_motif.b_mis.size()<<std::endl; // std::cout<<"motif found b_mis: \n"; // PrintVectorToConsole(m_motif.b_mis, 0, m_motif.b_mis.size()-1); WriteSomethingToFile(myfile, "motif found: "+m_motif.bs.a+"."+m_motif.bs.b+ " score "+ std::to_string(m_motif.score)+"\n"); m_motifs.push_back(m_motif); } if(count%1000==0) WriteSomethingToFile(myfile, TimeStamp()+"...processed "+ std::to_string(count)+" front motifs.\n"); count++; } std::sort(m_motifs.begin(), m_motifs.end(), [](const Motif &m1, const Motif &m2){return m1.score>m2.score;}); WriteSomethingToFile(myfile, TimeStamp()+"...finished searching, found "+ std::to_string(m_motifs.size())+" unique motifs.\n"); }
RasterImage::GetImageContainer(LayerManager* aManager, uint32_t aFlags) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aManager); MOZ_ASSERT((aFlags & ~(FLAG_SYNC_DECODE | FLAG_SYNC_DECODE_IF_FAST | FLAG_ASYNC_NOTIFY)) == FLAG_NONE, "Unsupported flag passed to GetImageContainer"); int32_t maxTextureSize = aManager->GetMaxTextureSize(); if (!mHasSize || mSize.width > maxTextureSize || mSize.height > maxTextureSize) { return nullptr; } if (IsUnlocked() && mProgressTracker) { mProgressTracker->OnUnlockedDraw(); } RefPtr<layers::ImageContainer> container = mImageContainer.get(); bool mustRedecode = (aFlags & (FLAG_SYNC_DECODE | FLAG_SYNC_DECODE_IF_FAST)) && mLastImageContainerDrawResult != DrawResult::SUCCESS && mLastImageContainerDrawResult != DrawResult::BAD_IMAGE; if (container && !mustRedecode) { return container.forget(); } // We need a new ImageContainer, so create one. container = LayerManager::CreateImageContainer(); DrawResult drawResult; RefPtr<layers::Image> image; Tie(drawResult, image) = GetCurrentImage(container, aFlags); if (!image) { return nullptr; } // |image| holds a reference to a SourceSurface which in turn holds a lock on // the current frame's VolatileBuffer, ensuring that it doesn't get freed as // long as the layer system keeps this ImageContainer alive. AutoTArray<ImageContainer::NonOwningImage, 1> imageList; imageList.AppendElement(ImageContainer::NonOwningImage(image, TimeStamp(), mLastFrameID++, mImageProducerID)); container->SetCurrentImagesInTransaction(imageList); mLastImageContainerDrawResult = drawResult; mImageContainer = container; return container.forget(); }
BOOL CALLBACK OnErrorC(int iServerNum, SOCKET* sock, const char* szData, CActionError& error) { CString sText; sText+=TimeStamp()+"\r\n-------------- Error detected ------------\r\n"; sText+=Format("ERROR #%i %s (WSA:%s)\r\nData received:\r\n%s",error.getErrorCode(),error.getErrorDsc(),GetLastWSAError(),szData); sText+="\r\n"; mainwndC->m_Sended=sText+mainwndC->m_Sended; bNeedUpdateC=1; return FALSE; }
BOOL CALLBACK OnDataReceiveC(int iServerNum, const char* szData, int iDataLength) { CString sText; sText+=TimeStamp()+"\r\n-------------- Received data ------------\r\n"; sText+=szData; sText+="\r\n"; mainwndC->m_Sended=sText+mainwndC->m_Sended; bNeedUpdateC=1; return FALSE; }
void CheckerboardEvent::PropertyBuffer::Flush( std::vector<PropertyValue>& aOut, const MonitorAutoLock& aProofOfLock) { for (uint32_t i = 0; i < BUFFER_SIZE; i++) { uint32_t ix = (mIndex + i) % BUFFER_SIZE; if (!mValues[ix].mTimeStamp.IsNull()) { aOut.push_back(mValues[ix]); mValues[ix].mTimeStamp = TimeStamp(); } } }
int oscSrcPositionHandler( handlerArgs ) { if( argv[ 0 ]->i >= twonderConf->noSources || argv[ 0 ]->i < 0 ) return -1; // if source is not active, ignore the command if( ! sources->at( argv[ 0 ]->i )->active ) return 0; int sourceId = argv[ 0 ]->i; float newX = argv[ 1 ]->f; float newY = argv[ 2 ]->f; float time = 0.0; float duration = 0.0; // xxx legacy support for deprecated z coordinate xxxxxxxxxxxxxxxxxxx // // note that time and duration are also flipped in the newer versions // //NOTE: this is where the z-coordinate could be introduced again for multi-z-level arrays if( argc == 6 ) { time = argv[ 4 ]->f; duration = argv[ 5 ]->f; } // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // else if( argc == 5 ) { duration = argv[ 3 ]->f; time = argv[ 4 ]->f; } else if( argc == 4 ) { duration = argv[ 3 ]->f; } if( twonderConf->verbose ) { std::cout << "osc-position: src=" << sourceId << " x=" << newX << " y=" << newY << " ts=" << time << " dur=" << duration << std::endl; } Vector2D newPos( newX, newY ); MoveCommand* moveCmd = new MoveCommand( newPos, sourceId, TimeStamp( time ), // conversion to sampletime happens in TimeStamp( float ); ( int ) ( duration * twonderConf->sampleRate ) ); realtimeCommandEngine->put( moveCmd ); return 0; }
bool AddEvent(const std::string & sEvent, const std::string & sClient, const std::string & sDetails) { if(thread_.IsThreadRunning()) { return event_list_.Push(DBLogEvent(sEvent,sClient,sDetails,TimeStamp())); } else return false; }
TimeStamp TimeStamp::operator+(const TimeStamp & t) const { int32_t sumSeconds = m_seconds + t.getSeconds(); int32_t sumMicroseconds = m_microseconds + t.getFractionalMicroseconds(); while (sumMicroseconds > 1000000L) { sumSeconds++; sumMicroseconds -= 1000000L; } return TimeStamp(sumSeconds, sumMicroseconds); }
TimeStamp TimeStamp::operator-(const TimeStamp & t) const { int32_t deltaSeconds = m_seconds - t.getSeconds(); int32_t deltaMicroseconds = m_microseconds - t.getFractionalMicroseconds(); while (deltaMicroseconds < 0) { deltaSeconds--; deltaMicroseconds += 1000000L; } return TimeStamp(deltaSeconds, deltaMicroseconds); }
void Proxy::distribute(Container c) { // Store data to recorder. if (m_recorder != NULL) { // Time stamp data before storing. c.setReceivedTimeStamp(TimeStamp()); m_recorder->store(c); } // Share data. getConference().send(c); }
TimeStamp TimeStamp::Now(bool aHighResolution) { // sUseQPC is volatile bool useQPC = (aHighResolution && sUseQPC); // Both values are in [mt] units. ULONGLONG QPC = useQPC ? PerformanceCounter() : uint64_t(0); ULONGLONG GTC = ms2mt(sGetTickCount64()); return TimeStamp(TimeStampValue(GTC, QPC, useQPC)); }
void Reset() { MOZ_ASSERT(!NS_IsMainThread()); mDelaySoFar = STREAM_TIME_MAX; mLatency = 0.0f; { MutexAutoLock lock(mOutputQueue.Lock()); mOutputQueue.Clear(); } mLastEventTime = TimeStamp(); }
//------------------------------------------------------------------------------ // TimelineEventItem // TimelineEventItem::TimelineEventItem(TimelineEvent& te, QGraphicsItem* parent) : QGraphicsObject(parent), m_timelineEvent(te) { setToolTip(QString("%1 - %2").arg(Timer().ToStringMS(TimeStamp())).arg(Name())); setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); setCursor(Qt::PointingHandCursor); QPolygonF poly; poly << QPointF(0,40) << QPointF(0,0) << QPointF(30,0) << QPointF(0,15); m_path.addPolygon(poly); }
/// This is the principal constructor. CbirRandom::CbirRandom(DataBase *db, const string& args) : CbirAlgorithm(db, args) { string hdr = "CbirRandom::CbirRandom() : "; debug = false; if (debug_stages) cout << TimeStamp() << hdr << "we are using database \"" << database->Name() << "\" that contains " << database->Size() << " objects" << endl; }
void BioSeq::SearchFront(std::fstream &myfile) { int count = 0; for(auto &bsv : m_bSeqV) for(auto &bs : bsv) { count++; if(IsMotifFront(bs)) { Motif m; m.bs = bs; m_motifs_a.push_back(m); AddToSet(bs.a); } if(count%10000==0) WriteSomethingToFile(myfile, TimeStamp()+"...processed "+ std::to_string(count)+" sequences.\n"); } WriteSomethingToFile(myfile, TimeStamp()+"...finished searching front sequences, found "+ std::to_string(m_unique_motifs.size())+" unique motifs.\n"); }
void Log::Write(int msgLevel, const String& message) { assert(msgLevel >= LOG_DEBUG && msgLevel < LOG_NONE); Log* instance = Subsystem<Log>(); if (!instance) return; // If not in the main thread, store message for later processing if (!Thread::IsMainThread()) { MutexLock lock(instance->logMutex); instance->threadMessages.Push(StoredLogMessage(message, msgLevel, false)); return; } // Do not log if message level excluded or if currently sending a log event if (instance->level > msgLevel || instance->inWrite) return; String formattedMessage = logLevelPrefixes[msgLevel]; formattedMessage += ": " + message; instance->lastMessage = message; if (instance->timeStamp) formattedMessage = "[" + TimeStamp() + "] " + formattedMessage; if (instance->quiet) { // If in quiet mode, still print the error message to the standard error stream if (msgLevel == LOG_ERROR) PrintUnicodeLine(formattedMessage, true); } else PrintUnicodeLine(formattedMessage, msgLevel == LOG_ERROR); if (instance->logFile) { instance->logFile->WriteLine(formattedMessage); instance->logFile->Flush(); } instance->inWrite = true; LogMessageEvent& event = instance->logMessageEvent; event.message = formattedMessage; event.level = msgLevel; instance->SendEvent(event); instance->inWrite = false; }
/** * Constructor * \param[in] x vector * \param[in] Sx covariance * \param[in] t time */ RandomVec(const VecType x, const MatType Sx, const TimeStamp t = TimeStamp() ) : isValid_Sx_L_(false), isValid_Sx_inv_(false), isValid_Sx_det_(false), gen_(NULL) { if ( !dimCheck() ){ exit(-1); } set(x); setCov(Sx); t_ = t; }
//============================================================================================== // writeLine treats all input as QTF data, so escape values properly before calling. void LogWin::writeLine(String line, bool embellish/* = false */) { //http://www.ultimatepp.org/srcdoc$RichText$QTF$en-us.html if (!activated) return; UrpEdit &re = logText; // Bug: U++ editor not picking up RichEdit object for dev interface. Kludge. re.Select(INT_MAX, 0); // Take input that we know contains QTF codes and convert it to RichText. AsRichText treats incoming as escaped QTF (non-QTF) // @n = text color, \1 is the wrapper code for escaping text, & sign is new line, ` escapes a single character if (embellish) { re.PasteText(ParseQTF(CAT << "[@4 \1" << TimeStamp() << "\1] `- " << line << "&")); } else { re.PasteText(ParseQTF(CAT << line << "&")); } re.Select(INT_MAX, 0); }
//LogError takes a variable number of arguments, prints a timestamp //and then displays the message on the screen, and or a log file. void LogError(const char *fmt, ...) { #ifdef __POL_DEBUG_MODE__ va_list args; char buffer[256]; TimeStamp(); va_start(args, fmt); vsprintf(buffer, fmt, args); fprintf(stderr, ": %s\n", buffer); va_end(args); return; #endif }
//****************************************************************************** nsresult RasterImage::StopAnimation() { MOZ_ASSERT(mAnimating, "Should be animating!"); nsresult rv = NS_OK; if (mError) { rv = NS_ERROR_FAILURE; } else { mAnimationState->SetAnimationFrameTime(TimeStamp()); } mAnimating = false; return rv; }