38 #include <QApplication>
40 #include <QInputDialog>
41 #include <QMessageBox>
42 #include <QtConcurrentRun>
52 : _activateBeedo ( activateBeedo ),
55 _alarmActive ( false )
78 if (
_asc ==
nullptr )
93 boost::lock_guard<boost::mutex> concurrency_lock (
_ascmutex );
94 if (
_asc ==
nullptr )
110 const int rawanswer = QInputDialog::getInteger (
112 QString::fromUtf8 (
"Configure notification timeout" ),
113 QString::fromUtf8 (
"Plese enter the time in seconds that should pass between\nthe reception of an alarm from the CSS Alarm Server\nand the display of a desktop notification:" ),
116 std::numeric_limits<int>::max(),
124 const unsigned int answer = (
unsigned int ) rawanswer;
133 QString messagetitle = QString::fromUtf8 (
"Alarm notifications desktop widget" );
134 unsigned short messagetype;
136 boost::lock_guard<boost::mutex> concurrency_lock (
_ascmutex );
137 if (
_asc ==
nullptr )
140 messagetext = QString::fromUtf8 (
"The Alarm notifications desktop widget is currently disabled, so informations about alarms are not recevied from the alarm server!" );
147 messagetext = QString::fromUtf8 (
"No alarms are known to the Alarm notifications desktop widget.\n\nPlease note that alarms triggered before the start or re-activation of this widget have not been received, so if you want to be sure that nothing is wrong, look at the alarm display in CSS." );
152 messagetext = QString::fromUtf8 (
"ATTENTION!\n\nThere are %1 alarm(s) active in the Detector Control System! For detailed information look at the alarm display in CSS!" ).arg (
_asc->
getNumberOfAlarms() );
156 switch ( messagetype )
159 QMessageBox::critical (
166 QMessageBox::warning (
174 QMessageBox::information (
184 QApplication::exit ( 0 );
192 boost::lock_guard<boost::mutex> concurrency_lock (
_ascmutex );
193 if (
_asc !=
nullptr )
213 #include "desktopalarmwidget.moc"
void destroy()
Destroy all media objects.
#define nullptr
Allow using the nullptr keyword with GCC < 4.6.
void ReReadConfiguration()
Read configuration again from disk.
Compatibility macros for older versions of the GCC.
static Beedo & instance()
Get singleton instance.
void WriteConfiguration()
Write configuration to disk.
Provide an opto-acoustic alarm notification on a control room PC.
Namespace for Alarm Notifications application.
Provides connectivity to the CSS Alarm Server.
size_t getNumberOfAlarms() const noexcept
Query number of active alarms.
#define noexcept
Allow using the noexcept keyword with GCC < 4.6.
void setDesktopNotificationTimeout(const unsigned int newSetting)
Change the timeout for sending a desktop notification.
Singleton to read and change the configuration of this application.
static AlarmConfiguration & instance() noexcept
Get singleton instance.
Connect to a CSS Alarm Server.