dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Notification plugin

A plugin to provide notifications of events in GCS. More...

Namespaces

 Core
 The Core namespace contains all classes that make up the Core plugin which constitute the basic functionality of the GCS.
 
 Ui
 

Classes

class  NotificationItem
 
class  NotifyItemDelegate
 
struct  PhononObject
 
class  SoundNotifyPlugin
 
class  NotifyPluginFactory
 
class  NotifyPluginGadget
 
class  NotifyPluginOptionsPage
 
class  NotifyTableModel
 

Typedefs

typedef struct PhononObjectpPhononObject
 

Enumerations

enum  { NotificationItem::eDefaultTimeout = 15 }
 
enum  { NotificationItem::never, NotificationItem::beforeFirst, NotificationItem::beforeSecond, NotificationItem::afterSecond }
 
enum  {
  NotificationItem::repeatOncePerUpdate, NotificationItem::repeatOnce, NotificationItem::repeatInstantly, NotificationItem::repeat10seconds,
  NotificationItem::repeat30seconds, NotificationItem::repeat1minute
}
 
enum  { NotifyPluginOptionsPage::equal, NotifyPluginOptionsPage::bigger, NotifyPluginOptionsPage::smaller, NotifyPluginOptionsPage::inrange }
 
enum  ColumnNames { eMessageName, eRepeatValue, eExpireTimer, eTurnOn }
 

Functions

int getValuePosition (QString sayOrder)
 
QStringList valueToSoundList (QString value)
 
QString stringFromValue (QVariant value, UAVObjectField *field)
 
 NotificationItem::NotificationItem (QObject *parent=nullptr)
 
void NotificationItem::copyTo (NotificationItem *) const
 
 NotificationItem::DECLARE_SOUND (1) DECLARE_SOUND(2) DECLARE_SOUND(3) bool getCurrentUpdatePlayed() const
 
void NotificationItem::setCurrentUpdatePlayed (bool value)
 
int NotificationItem::getCondition () const
 
void NotificationItem::setCondition (int value)
 
int NotificationItem::getSayOrder () const
 
void NotificationItem::setSayOrder (int text)
 
QVariant NotificationItem::singleValue () const
 
void NotificationItem::setSingleValue (QVariant value)
 
double NotificationItem::valueRange2 () const
 
void NotificationItem::setValueRange2 (double value)
 
QString NotificationItem::getDataObject () const
 
void NotificationItem::setDataObject (QString text)
 
QString NotificationItem::getObjectField () const
 
void NotificationItem::setObjectField (QString text)
 
QString NotificationItem::getSoundCollectionPath () const
 
void NotificationItem::setSoundCollectionPath (QString path)
 
QString NotificationItem::getCurrentLanguage () const
 
void NotificationItem::setCurrentLanguage (QString text)
 
QStringList NotificationItem::getMessageSequence () const
 
void NotificationItem::setMessageSequence (QStringList sequence)
 
int NotificationItem::retryValue () const
 
void NotificationItem::setRetryValue (int value)
 
int NotificationItem::lifetime () const
 
void NotificationItem::setLifetime (int value)
 
bool NotificationItem::mute () const
 
void NotificationItem::setMute (bool value)
 
void NotificationItem::saveState (QSettings *settings) const
 
void NotificationItem::restoreState (QSettings *settings)
 
UAVDataObjectNotificationItem::getUAVObject (void)
 
UAVObjectFieldNotificationItem::getUAVObjectField (void)
 
void NotificationItem::serialize (QDataStream &stream)
 
void NotificationItem::deserialize (QDataStream &stream)
 
QString NotificationItem::toString ()
 
QStringList & NotificationItem::toSoundList ()
 
QString NotificationItem::getSoundCaption (QString fileName)
 
QTimer * NotificationItem::getTimer () const
 
void NotificationItem::startTimer (int value)
 
void NotificationItem::restartTimer ()
 
void NotificationItem::stopTimer ()
 
void NotificationItem::disposeTimer ()
 
QTimer * NotificationItem::getExpireTimer () const
 
void NotificationItem::startExpireTimer ()
 
void NotificationItem::stopExpireTimer ()
 
void NotificationItem::disposeExpireTimer ()
 
 NotifyItemDelegate::NotifyItemDelegate (QObject *parent=nullptr)
 
QWidget * NotifyItemDelegate::createEditor (QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const
 
void NotifyItemDelegate::setEditorData (QWidget *editor, const QModelIndex &index) const
 
void NotifyItemDelegate::setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 
QSize NotifyItemDelegate::sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 
QDebug qNotifyDebug ()
 
bool checkRange (QString fieldValue, QString enumValue, QStringList, int direction)
 
bool checkRange (double fieldValue, double min, double max, int direction)
 
 NotifyPluginFactory::NotifyPluginFactory (QObject *parent=0)
 
 NotifyPluginFactory::~NotifyPluginFactory ()
 
Core::IUAVGadgetNotifyPluginFactory::createGadget (QWidget *parent)
 
IUAVGadgetConfiguration * NotifyPluginFactory::createConfiguration (const QByteArray &state)
 
IOptionsPage * NotifyPluginFactory::createOptionsPage (IUAVGadgetConfiguration *config)
 
 NotifyPluginGadget::NotifyPluginGadget (QString classId, NotifyPluginGadgetWidget *widget, QWidget *parent=0)
 
 NotifyPluginGadget::~NotifyPluginGadget ()
 
void NotifyPluginGadget::loadConfiguration (IUAVGadgetConfiguration *config)
 
 NotifyPluginOptionsPage::NotifyPluginOptionsPage (QObject *parent=nullptr)
 
 NotifyPluginOptionsPage::~NotifyPluginOptionsPage ()
 
QString NotifyPluginOptionsPage::id () const
 
QString NotifyPluginOptionsPage::trName () const
 
QString NotifyPluginOptionsPage::category () const
 
QString NotifyPluginOptionsPage::trCategory () const
 
QWidget * NotifyPluginOptionsPage::createPage (QWidget *parent)
 
void NotifyPluginOptionsPage::apply ()
 
void NotifyPluginOptionsPage::finish ()
 
void NotifyPluginOptionsPage::restoreFromSettings ()
 
 NotifyTableModel::NotifyTableModel (QList< NotificationItem * > &parentList, QObject *parent=nullptr)
 
int NotifyTableModel::rowCount (const QModelIndex &parent=QModelIndex()) const
 
int NotifyTableModel::columnCount (const QModelIndex &) const
 
Qt::ItemFlags NotifyTableModel::flags (const QModelIndex &index) const
 
QStringList NotifyTableModel::mimeTypes () const
 
Qt::DropActions NotifyTableModel::supportedDropActions () const
 
bool NotifyTableModel::dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
QMimeData * NotifyTableModel::mimeData (const QModelIndexList &indexes) const
 
bool NotifyTableModel::setData (const QModelIndex &index, const QVariant &value, int role)
 
QVariant NotifyTableModel::data (const QModelIndex &index, int role) const
 
QVariant NotifyTableModel::headerData (int section, Qt::Orientation orientation, int role) const
 
bool NotifyTableModel::insertRows (int position, int rows, const QModelIndex &index)
 
bool NotifyTableModel::removeRows (int position, int rows, const QModelIndex &index)
 
void NotifyTableModel::entryAdded (NotificationItem *item)
 

Variables

bool NotificationItem::isNowPlaying
 
bool NotificationItem::_isPlayed
 
static QStringList NotificationItem::sayOrderValues
 
static QStringList NotificationItem::retryValues
 
QMediaPlayer * PhononObject::mo
 
NotificationItemPhononObject::notify
 
bool PhononObject::firstPlay
 
static QStringList NotifyPluginOptionsPage::conditionValues
 
const char * mime_type_notify_table = "openpilot/notify_plugin_table"
 

Signals

void NotifyPluginOptionsPage::updateNotifications (QList< NotificationItem * > list)
 
void NotifyPluginOptionsPage::entryUpdated (int index)
 
void NotifyTableModel::dragRows (int position, int count)
 

Public Slots

void SoundNotifyPlugin::updateNotificationList (QList< NotificationItem * > list)
 
void NotifyTableModel::entryUpdated (int offset)
 

Detailed Description

A plugin to provide notifications of events in GCS.

Typedef Documentation

typedef struct PhononObject * pPhononObject

Enumeration Type Documentation

anonymous enum
Enumerator
never 
beforeFirst 
beforeSecond 
afterSecond 

Definition at line 53 of file notificationitem.h.

anonymous enum
Enumerator
repeatOncePerUpdate 
repeatOnce 
repeatInstantly 
repeat10seconds 
repeat30seconds 
repeat1minute 

Definition at line 54 of file notificationitem.h.

anonymous enum
Enumerator
equal 
bigger 
smaller 
inrange 

Definition at line 62 of file notifypluginoptionspage.h.

anonymous enum
Enumerator
eDefaultTimeout 

Definition at line 51 of file notificationitem.h.

Enumerator
eMessageName 
eRepeatValue 
eExpireTimer 
eTurnOn 

Definition at line 37 of file notifytablemodel.h.

Function Documentation

void NotifyPluginOptionsPage::apply ( )
virtual

Implements Core::IOptionsPage.

Definition at line 122 of file notifypluginoptionspage.cpp.

QString NotifyPluginOptionsPage::category ( ) const
inlinevirtual

Reimplemented from Core::IOptionsPage.

Definition at line 67 of file notifypluginoptionspage.h.

bool checkRange ( QString  fieldValue,
QString  enumValue,
QStringList  ,
int  direction 
)

Definition at line 339 of file notifyplugin.cpp.

bool checkRange ( double  fieldValue,
double  min,
double  max,
int  direction 
)

Definition at line 355 of file notifyplugin.cpp.

int NotifyTableModel::columnCount ( const QModelIndex &  ) const
inline

Definition at line 53 of file notifytablemodel.h.

void NotificationItem::copyTo ( NotificationItem that) const

Definition at line 86 of file notificationitem.cpp.

IUAVGadgetConfiguration * NotifyPluginFactory::createConfiguration ( const QByteArray &  state)

Definition at line 50 of file notifypluginfactory.cpp.

QWidget * NotifyItemDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  ,
const QModelIndex &  index 
) const
Todo:
Signal does not exist... this config page needs MAJOR help in general :/

Definition at line 47 of file notifyitemdelegate.cpp.

Core::IUAVGadget * NotifyPluginFactory::createGadget ( QWidget *  parent)
virtual

Implements Core::IUAVGadgetFactory.

Definition at line 43 of file notifypluginfactory.cpp.

IOptionsPage * NotifyPluginFactory::createOptionsPage ( IUAVGadgetConfiguration *  config)
virtual

Reimplemented from Core::IUAVGadgetFactory.

Definition at line 55 of file notifypluginfactory.cpp.

QWidget * NotifyPluginOptionsPage::createPage ( QWidget *  parent)
virtual

Implements Core::IOptionsPage.

Definition at line 76 of file notifypluginoptionspage.cpp.

QVariant NotifyTableModel::data ( const QModelIndex &  index,
int  role 
) const

Definition at line 76 of file notifytablemodel.cpp.

NotificationItem::DECLARE_SOUND ( ) const
inline

Definition at line 67 of file notificationitem.h.

void NotificationItem::deserialize ( QDataStream &  stream)

Definition at line 166 of file notificationitem.cpp.

void NotificationItem::disposeExpireTimer ( )

Definition at line 235 of file notificationitem.cpp.

void NotificationItem::disposeTimer ( )

Definition at line 210 of file notificationitem.cpp.

bool NotifyTableModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)

Definition at line 185 of file notifytablemodel.cpp.

void NotifyTableModel::entryAdded ( NotificationItem item)

Definition at line 164 of file notifytablemodel.cpp.

void NotifyPluginOptionsPage::finish ( )
virtual

Implements Core::IOptionsPage.

Definition at line 129 of file notifypluginoptionspage.cpp.

Qt::ItemFlags NotifyTableModel::flags ( const QModelIndex &  index) const
inline

Definition at line 55 of file notifytablemodel.h.

int NotificationItem::getCondition ( ) const
inline

Definition at line 74 of file notificationitem.h.

QString NotificationItem::getCurrentLanguage ( ) const
inline

Definition at line 95 of file notificationitem.h.

QString NotificationItem::getDataObject ( ) const
inline

Definition at line 86 of file notificationitem.h.

QTimer* NotificationItem::getExpireTimer ( ) const
inline

Definition at line 150 of file notificationitem.h.

QStringList NotificationItem::getMessageSequence ( ) const
inline

Definition at line 98 of file notificationitem.h.

QString NotificationItem::getObjectField ( ) const
inline

Definition at line 89 of file notificationitem.h.

int NotificationItem::getSayOrder ( ) const
inline

Definition at line 77 of file notificationitem.h.

QString NotificationItem::getSoundCaption ( QString  fileName)

Returns sound caption name, needed to create string representation of notification.

Returns
success - string == <sound filename>="">, if sound file exists error - string == [missind]<sound filename>="">, if sound file doesn't exist

Definition at line 410 of file notificationitem.cpp.

QString NotificationItem::getSoundCollectionPath ( ) const
inline

Definition at line 92 of file notificationitem.h.

QTimer* NotificationItem::getTimer ( ) const
inline

Definition at line 144 of file notificationitem.h.

UAVDataObject * NotificationItem::getUAVObject ( void  )

Definition at line 425 of file notificationitem.cpp.

UAVObjectField * NotificationItem::getUAVObjectField ( void  )

Definition at line 420 of file notificationitem.cpp.

int getValuePosition ( QString  sayOrder)

Definition at line 244 of file notificationitem.cpp.

QVariant NotifyTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const

Definition at line 111 of file notifytablemodel.cpp.

QString NotifyPluginOptionsPage::id ( ) const
inlinevirtual

Reimplemented from Core::IOptionsPage.

Definition at line 65 of file notifypluginoptionspage.h.

bool NotifyTableModel::insertRows ( int  position,
int  rows,
const QModelIndex &  index 
)

Definition at line 124 of file notifytablemodel.cpp.

int NotificationItem::lifetime ( ) const
inline

Definition at line 104 of file notificationitem.h.

void NotifyPluginGadget::loadConfiguration ( IUAVGadgetConfiguration config)
virtual

Reimplemented from Core::IUAVGadget.

QMimeData * NotifyTableModel::mimeData ( const QModelIndexList &  indexes) const

Definition at line 245 of file notifytablemodel.cpp.

QStringList NotifyTableModel::mimeTypes ( ) const

Definition at line 178 of file notifytablemodel.cpp.

bool NotificationItem::mute ( ) const
inline

Definition at line 107 of file notificationitem.h.

NotificationItem::NotificationItem ( QObject *  parent = nullptr)
explicit

Definition at line 47 of file notificationitem.cpp.

NotifyItemDelegate::NotifyItemDelegate ( QObject *  parent = nullptr)

Definition at line 41 of file notifyitemdelegate.cpp.

NotifyPluginFactory::NotifyPluginFactory ( QObject *  parent = 0)

Definition at line 36 of file notifypluginfactory.cpp.

NotifyPluginGadget::NotifyPluginGadget ( QString  classId,
NotifyPluginGadgetWidget *  widget,
QWidget *  parent = 0 
)
NotifyPluginOptionsPage::NotifyPluginOptionsPage ( QObject *  parent = nullptr)
explicit

Definition at line 55 of file notifypluginoptionspage.cpp.

NotifyTableModel::NotifyTableModel ( QList< NotificationItem * > &  parentList,
QObject *  parent = nullptr 
)

Definition at line 39 of file notifytablemodel.cpp.

QNoDebug qNotifyDebug ( )

Definition at line 34 of file notifylogging.cpp.

bool NotifyTableModel::removeRows ( int  position,
int  rows,
const QModelIndex &  index 
)

Definition at line 141 of file notifytablemodel.cpp.

void NotificationItem::restartTimer ( )

Definition at line 194 of file notificationitem.cpp.

void NotifyPluginOptionsPage::restoreFromSettings ( )
void NotificationItem::restoreState ( QSettings *  settings)

Definition at line 126 of file notificationitem.cpp.

int NotificationItem::retryValue ( ) const
inline

Definition at line 101 of file notificationitem.h.

int NotifyTableModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
inline

Definition at line 47 of file notifytablemodel.h.

void NotificationItem::saveState ( QSettings *  settings) const

Definition at line 107 of file notificationitem.cpp.

void NotificationItem::serialize ( QDataStream &  stream)

Definition at line 147 of file notificationitem.cpp.

void NotificationItem::setCondition ( int  value)
inline

Definition at line 75 of file notificationitem.h.

void NotificationItem::setCurrentLanguage ( QString  text)
inline

Definition at line 96 of file notificationitem.h.

void NotificationItem::setCurrentUpdatePlayed ( bool  value)
inline

Definition at line 72 of file notificationitem.h.

bool NotifyTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)

Definition at line 50 of file notifytablemodel.cpp.

void NotificationItem::setDataObject ( QString  text)
inline

Definition at line 87 of file notificationitem.h.

void NotifyItemDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const

Definition at line 103 of file notifyitemdelegate.cpp.

void NotificationItem::setLifetime ( int  value)
inline

Definition at line 105 of file notificationitem.h.

void NotificationItem::setMessageSequence ( QStringList  sequence)
inline

Definition at line 99 of file notificationitem.h.

void NotifyItemDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const

Definition at line 126 of file notifyitemdelegate.cpp.

void NotificationItem::setMute ( bool  value)
inline

Definition at line 108 of file notificationitem.h.

void NotificationItem::setObjectField ( QString  text)
inline

Definition at line 90 of file notificationitem.h.

void NotificationItem::setRetryValue ( int  value)
inline

Definition at line 102 of file notificationitem.h.

void NotificationItem::setSayOrder ( int  text)
inline

Definition at line 78 of file notificationitem.h.

void NotificationItem::setSingleValue ( QVariant  value)
inline

Definition at line 81 of file notificationitem.h.

void NotificationItem::setSoundCollectionPath ( QString  path)
inline

Definition at line 93 of file notificationitem.h.

void NotificationItem::setValueRange2 ( double  value)
inline

Definition at line 84 of file notificationitem.h.

QVariant NotificationItem::singleValue ( ) const
inline

Definition at line 80 of file notificationitem.h.

QSize NotifyItemDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const

Definition at line 163 of file notifyitemdelegate.cpp.

void NotificationItem::startExpireTimer ( )

Definition at line 219 of file notificationitem.cpp.

void NotificationItem::startTimer ( int  value)

Definition at line 184 of file notificationitem.cpp.

void NotificationItem::stopExpireTimer ( )

Definition at line 227 of file notificationitem.cpp.

void NotificationItem::stopTimer ( )

Definition at line 202 of file notificationitem.cpp.

QString stringFromValue ( QVariant  value,
UAVObjectField field 
)

Definition at line 324 of file notificationitem.cpp.

Qt::DropActions NotifyTableModel::supportedDropActions ( ) const

Definition at line 173 of file notifytablemodel.cpp.

QStringList & NotificationItem::toSoundList ( )

Generate list of sound files needed to play notification

Returns
success - reference to non-empty _messageSequence; error - if one of sounds doesn't exist returns reference to empty _messageSequence;

Definition at line 372 of file notificationitem.cpp.

QString NotificationItem::toString ( )

Convert notification item fields in single string, to show in table for example

Returns
string which describe notification

Definition at line 341 of file notificationitem.cpp.

QString NotifyPluginOptionsPage::trCategory ( ) const
inlinevirtual

Reimplemented from Core::IOptionsPage.

Definition at line 68 of file notifypluginoptionspage.h.

QString NotifyPluginOptionsPage::trName ( ) const
inlinevirtual

Reimplemented from Core::IOptionsPage.

Definition at line 66 of file notifypluginoptionspage.h.

double NotificationItem::valueRange2 ( ) const
inline

Definition at line 83 of file notificationitem.h.

QStringList valueToSoundList ( QString  value)

Definition at line 264 of file notificationitem.cpp.

NotifyPluginFactory::~NotifyPluginFactory ( )

Definition at line 41 of file notifypluginfactory.cpp.

NotifyPluginGadget::~NotifyPluginGadget ( )
NotifyPluginOptionsPage::~NotifyPluginOptionsPage ( )

Definition at line 72 of file notifypluginoptionspage.cpp.

Variable Documentation

bool NotificationItem::_isPlayed

Definition at line 157 of file notificationitem.h.

QStringList NotifyPluginOptionsPage::conditionValues
static

Definition at line 74 of file notifypluginoptionspage.h.

bool PhononObject::firstPlay

Definition at line 49 of file notifyplugin.h.

bool NotificationItem::isNowPlaying

Definition at line 156 of file notificationitem.h.

const char* mime_type_notify_table = "openpilot/notify_plugin_table"

Definition at line 37 of file notifytablemodel.cpp.

QMediaPlayer* PhononObject::mo

Definition at line 47 of file notifyplugin.h.

NotificationItem* PhononObject::notify

Definition at line 48 of file notifyplugin.h.

QStringList NotificationItem::retryValues
static

Definition at line 160 of file notificationitem.h.

QStringList NotificationItem::sayOrderValues
static

Definition at line 159 of file notificationitem.h.

Signals

void NotifyTableModel::dragRows ( int  position,
int  count 
)
signal
void NotifyPluginOptionsPage::entryUpdated ( int  index)
signal
void NotifyPluginOptionsPage::updateNotifications ( QList< NotificationItem * >  list)
signal

Public Slots

void NotifyTableModel::entryUpdated ( int  offset)
slot

Definition at line 158 of file notifytablemodel.cpp.

void SoundNotifyPlugin::updateNotificationList ( QList< NotificationItem * >  list)
slot

update list of notifies; will be perform on OK or APPLY press of option page

Definition at line 165 of file notifyplugin.cpp.