|
NorMIT-nav
2023.01.05-dev+develop.0da12
An IGT application
|
Go to the documentation of this file.
16 #include "boost/shared_ptr.hpp"
21 #include <QTextStream>
32 boost::weak_ptr<Reporter> Reporter::mWeakInstance;
33 boost::shared_ptr<Reporter> Reporter::mPersistentInstance;
55 mWeakInstance = retval;
64 mPersistentInstance = object;
65 object->initializeObject();
75 mPersistentInstance.reset();
78 void Reporter::onEmittedMessage(
Message message)
86 mAudioSource = audioSource;
89 bool Reporter::hasAudioSource()
const
91 return mAudioSource ? true :
false;
131 Message message(text, messageLevel, timeout);
148 void Reporter::playSound(MESSAGE_LEVEL messageLevel)
150 switch (messageLevel)
168 if(this->hasAudioSource())
169 mAudioSource->playStartSound();
174 if(this->hasAudioSource())
175 mAudioSource->playStopSound();
180 if(this->hasAudioSource())
181 mAudioSource->playCancelSound();
186 if(this->hasAudioSource())
187 mAudioSource->playSuccessSound();
192 if(this->hasAudioSource())
193 mAudioSource->playWarningSound();
198 if(this->hasAudioSource())
199 mAudioSource->playErrorSound();
204 if(this->hasAudioSource())
205 mAudioSource->playScreenShotSound();
210 if(this->hasAudioSource())
211 mAudioSource->playSampleSound();
void sendDebug(QString debug)
Used to output debug info, no sound associated.
boost::shared_ptr< class LogThread > LogThreadPtr
void playErrorSound()
automatically called by sendError if not muted
static void shutdown()
shutdown service, destroy static object if none holds a reference.
void playSuccessSound()
automatically called by sendSuccess if not muted
Namespace for all CustusX production code.
MESSAGE_LEVEL getMessageLevel() const
The category of the message.
void setAudioSource(AudioPtr audioSource)
define sounds to go with the messages.
void sendVolatile(QString volatile_msg)
Used to output volatile info that changes rapidly, not suited for logging.
void sendSuccess(QString success)
Used to report larger successful operations, default not muted.
void playStopSound()
plays a sound signaling that something has stopped
void sendWarning(QString warning)
The program does not need to terminate, but the user might need to do something, default not muted.
boost::shared_ptr< class Reporter > ReporterPtr
void playSampleSound()
plays a sound signaling that something has been sampled
QString getPrintableMessage() const
Text containing information appropriate to display.
void playCancelSound()
plays a sound signaling that something has been canceled
void playScreenShotSound()
plays a sound signaling that a screen shot has been taken
void sendError(QString error)
The program (might) need to terminate, default not muted.
boost::shared_ptr< class QThread > mThread
void sendInfo(QString info)
Used to report normal interesting activity, no sound associated.
void playStartSound()
plays a sound signaling that something has started
static ReporterPtr getInstance()
Returns a reference to the only Reporter that exists.
boost::shared_ptr< Audio > AudioPtr
void sendMessage(QString text, MESSAGE_LEVEL messageLevel=mlDEBUG, int timeout=-1, bool mute=false)
void playWarningSound()
automatically called by sendWarning if not muted
void sendRaw(QString raw)
Used to output messages without adding anything to them, can be used as cout when mangling needs to b...
virtual LogThreadPtr createWorker()
static void initialize()
Initialize logging, static object is guaranteed to exist at least until shutdown.