labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

LiveDataSource Class Reference

Represents data stored in a file. Reading and writing is done with the help of appropriate I/O-filters. More...

#include <LiveDataSource.h>

Inheritance diagram for LiveDataSource:
[legend]
Collaboration diagram for LiveDataSource:
[legend]

Public Types

enum class  SourceType {
  FileOrPipe = 0 , NetworkTcpSocket , NetworkUdpSocket , LocalSocket ,
  SerialPort , MQTT
}
 
enum class  UpdateType { TimeInterval = 0 , NewData }
 
enum class  ReadingType { ContinuousFixed = 0 , FromEnd , TillEnd , WholeFile }
 
- Public Types inherited from AbstractAspect
enum class  ChildIndexFlag { IncludeHidden = 0x01 , Recursive = 0x02 , Compress = 0x04 }
 Flags which control numbering scheme of children. More...
 

Public Slots

void read ()
 
void readOnUpdate ()
 
- Public Slots inherited from Spreadsheet
void appendRows (int)
 
void appendRow ()
 
void appendColumns (int)
 
void appendColumn ()
 
void prependColumns (int)
 
void setColumnCount (int)
 
void setRowCount (int)
 
void clear ()
 
void clearMasks ()
 
void moveColumn (int from, int to)
 
void sortColumns (Column *leading, const QVector< Column * > &, bool ascending)
 
- Public Slots inherited from AbstractAspect
bool setName (const QString &, bool autoUnique=true)
 AbstractAspect::setName sets the name of the abstract aspect. More...
 
void setComment (const QString &)
 
void remove ()
 Remove me from my parent's list of children. More...
 

Public Member Functions

 LiveDataSource (const QString &name, bool loading=false)
 
 ~LiveDataSource () override
 
void setFileType (const AbstractFileFilter::FileType)
 
AbstractFileFilter::FileType fileType () const
 
UpdateType updateType () const
 
void setUpdateType (UpdateType)
 Sets the source's update type to updatetype and handles this change. More...
 
SourceType sourceType () const
 
void setSourceType (SourceType)
 Sets the source's type to sourcetype. More...
 
ReadingType readingType () const
 
void setReadingType (ReadingType)
 Sets the source's reading type to readingType. More...
 
int sampleSize () const
 
void setSampleSize (int)
 Sets the sample size to size. More...
 
void setBytesRead (qint64 bytes)
 
int bytesRead () const
 
int port () const
 
void setPort (quint16)
 Sets the network socket's port to port. More...
 
bool isPaused () const
 
void setSerialPort (const QString &name)
 Sets the serial port's name to name. More...
 
QString serialPortName () const
 
QString host () const
 
void setHost (const QString &)
 Sets the network socket's host. More...
 
int baudRate () const
 
void setBaudRate (int)
 Sets the serial port's baud rate. More...
 
void setUpdateInterval (int)
 Sets the source's update interval to interval. More...
 
int updateInterval () const
 
void setKeepNValues (int)
 Sets how many values we should keep when keepLastValues is true. More...
 
int keepNValues () const
 
void setKeepLastValues (bool)
 
bool keepLastValues () const
 
void setFileLinked (bool)
 
bool isFileLinked () const
 
void setUseRelativePath (bool)
 
bool useRelativePath () const
 
void setFileName (const QString &)
 
QString fileName () const
 
void setLocalSocketName (const QString &)
 Sets the local socket's server name to name. More...
 
QString localSocketName () const
 
void updateNow ()
 Updates this data source at this moment. More...
 
void pauseReading ()
 Pause the reading of the live data source. More...
 
void continueReading ()
 Continue reading from the live data source after it was paused. More...
 
void setFilter (AbstractFileFilter *)
 
AbstractFileFilterfilter () const
 
QIcon icon () const override
 Return an icon to be used for decorating my views. More...
 
QMenu * createContextMenu () override
 Return AbstractAspect::createContextMenu() plus operations on the primary view. More...
 
QWidget * view () const override
 Construct a primary view on me. More...
 
void save (QXmlStreamWriter *) const override
 
bool load (XmlStreamReader *, bool preview) override
 
void finalizeLoad ()
 
- Public Member Functions inherited from Spreadsheet
 Spreadsheet (const QString &name, bool loading=false, AspectType type=AspectType::Spreadsheet)
 
QIcon icon () const override
 
QMenu * createContextMenu () override
 
QWidget * view () const override
 
bool exportView () const override
 
bool printView () override
 
bool printPreview () const override
 
void setModel (SpreadsheetModel *)
 
SpreadsheetModelmodel ()
 
void updateHorizontalHeader ()
 
void updateLocale ()
 
int columnCount () const
 
int columnCount (AbstractColumn::PlotDesignation) const
 
Columncolumn (int index) const
 
Columncolumn (const QString &) const
 
int rowCount () const
 
void removeRows (int first, int count)
 
void insertRows (int before, int count)
 
void removeColumns (int first, int count)
 
void insertColumns (int before, int count)
 
int colX (int col)
 
int colY (int col)
 
QString text (int row, int col) const
 
void copy (Spreadsheet *other)
 
void save (QXmlStreamWriter *) const override
 
bool load (XmlStreamReader *, bool preview) override
 
void setColumnSelectedInView (int index, bool selected)
 
void emitRowCountChanged ()
 
void emitColumnCountChanged ()
 
int prepareImport (std::vector< void * > &dataContainer, AbstractFileFilter::ImportMode, int rows, int cols, QStringList colNameList, QVector< AbstractColumn::ColumnMode >) override
 
void finalizeImport (int columnOffset, int startColumn, int endColumn, const QString &dateTimeFormat, AbstractFileFilter::ImportMode) override
 
int resize (AbstractFileFilter::ImportMode, QStringList colNameList, int cols)
 
- Public Member Functions inherited from AbstractDataSource
 AbstractDataSource (const QString &name, AspectType type)
 
 ~AbstractDataSource () override=default
 
void clear ()
 
- Public Member Functions inherited from AbstractPart
 AbstractPart (const QString &name, AspectType type)
 
 ~AbstractPart () override
 
void deleteView () const
 
PartMdiViewmdiSubWindow () const
 Wrap the view() into a PartMdiView. More...
 
bool hasMdiSubWindow () const
 
bool isDraggable () const override
 
QVector< AspectTypedropableOn () const override
 
virtual void registerShortcuts ()
 
virtual void unregisterShortcuts ()
 
- Public Member Functions inherited from AbstractAspect
 AbstractAspect (const QString &name, AspectType type)
 
 ~AbstractAspect () override
 
QString name () const
 
QString comment () const
 
void setCreationTime (const QDateTime &)
 
QDateTime creationTime () const
 
virtual Projectproject ()
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one. More...
 
virtual QString path () const
 Return the path that leads from the top-most Aspect (usually a Project) to me. More...
 
void setHidden (bool)
 Set "hidden" property, i.e. whether to exclude this aspect from being shown in the explorer. More...
 
bool hidden () const
 
void setIsLoading (bool)
 
bool isLoading () const
 
AspectType type () const
 
bool inherits (AspectType type) const
 
AbstractAspectparentAspect () const
 Return my parent Aspect or 0 if I currently don't have one. More...
 
AbstractAspectparent (AspectType type) const
 In the parent-child hierarchy, return the first parent of type. More...
 
void setParentAspect (AbstractAspect *)
 
Folderfolder ()
 Return the folder the Aspect is contained in or 0 if there is none. More...
 
bool isDescendantOf (AbstractAspect *other)
 Return whether the there is a path upwards to the given aspect. More...
 
void addChild (AbstractAspect *)
 Add the given Aspect to my list of children. More...
 
void addChildFast (AbstractAspect *)
 Add the given Aspect to my list of children without any checks and without putting this step onto the undo-stack. More...
 
virtual void finalizeAdd ()
 
QVector< AbstractAspect * > children (AspectType type, ChildIndexFlags flags={}) const
 
void insertChildBefore (AbstractAspect *child, AbstractAspect *before)
 Insert the given Aspect at a specific position in my list of children. More...
 
void insertChildBeforeFast (AbstractAspect *child, AbstractAspect *before)
 Insert the given Aspect at a specific position in my list of children.without any checks and without putting this step onto the undo-stack. More...
 
void reparent (AbstractAspect *newParent, int newIndex=-1)
 Move a child to another parent aspect and transfer ownership. More...
 
void removeChild (AbstractAspect *)
 Remove the given Aspect from my list of children. More...
 
void removeAllChildren ()
 Remove all child Aspects. More...
 
virtual QVector< AbstractAspect * > dependsOn () const
 
virtual void processDropEvent (const QVector< quintptr > &)
 
template<class T >
T * ancestor () const
 Return the closest ancestor of class T (or NULL if none found). More...
 
template<class T >
QVector< T * > children (ChildIndexFlags flags={}) const
 
template<class T >
T * child (int index, ChildIndexFlags flags={}) const
 
template<class T >
T * child (const QString &name) const
 Get child by name and class. More...
 
template<class T >
int childCount (ChildIndexFlags flags={}) const
 Return the number of child Aspects inheriting from given class. More...
 
template<class T >
int indexOfChild (const AbstractAspect *child, ChildIndexFlags flags={}) const
 Return (0 based) index of child in the list of children inheriting from class T. More...
 
void setSelected (bool)
 
void setUndoAware (bool)
 
virtual QUndoStack * undoStack () const
 Return the undo stack of the Project, or 0 if this Aspect is not part of a Project. More...
 
void exec (QUndoCommand *)
 Execute the given command, pushing it on the undoStack() if available. More...
 
void exec (QUndoCommand *command, const char *preChangeSignal, const char *postChangeSignal, QGenericArgument val0=QGenericArgument(), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument())
 Execute command and arrange for signals to be sent before/after it is redone or undone. More...
 
void beginMacro (const QString &text)
 Begin an undo stack macro (series of commands) More...
 
void endMacro ()
 End the current undo stack macro. More...
 

Static Public Member Functions

static QStringList supportedBaudRates ()
 Returns a list with the supported baud rates. More...
 
static QStringList availablePorts ()
 Returns a list with the names of the available ports. More...
 

Private Slots

void plotData ()
 
void readyRead ()
 
void localSocketError (QLocalSocket::LocalSocketError)
 
void tcpSocketError (QAbstractSocket::SocketError)
 

Private Member Functions

void initActions ()
 

Private Attributes

QString m_fileName
 
QString m_dirName
 
QString m_serialPortName
 
QString m_localSocketName
 
QString m_host
 
AbstractFileFilter::FileType m_fileType {AbstractFileFilter::FileType::Ascii}
 
UpdateType m_updateType
 
SourceType m_sourceType
 
ReadingType m_readingType
 
bool m_fileWatched {false}
 
bool m_fileLinked {false}
 
bool m_relativePath {false}
 
bool m_paused {false}
 
bool m_prepared {false}
 
bool m_reading {false}
 
bool m_pending {false}
 
int m_sampleSize {1}
 
int m_keepNValues {0}
 
int m_updateInterval {1000}
 
quint16 m_port {1027}
 
int m_baudRate {9600}
 
qint64 m_bytesRead {0}
 
AbstractFileFilterm_filter {nullptr}
 
QTimer * m_updateTimer
 
QTimer * m_watchTimer
 
QFileSystemWatcher * m_fileSystemWatcher {nullptr}
 
QLocalSocket * m_localSocket {nullptr}
 
QTcpSocket * m_tcpSocket {nullptr}
 
QUdpSocket * m_udpSocket {nullptr}
 
QIODevice * m_device {nullptr}
 
QAction * m_plotDataAction {nullptr}
 

Additional Inherited Members

- Signals inherited from Spreadsheet
void requestProjectContextMenu (QMenu *)
 
void columnSelected (int)
 
void columnDeselected (int)
 
void rowCountChanged (int)
 
void columnCountChanged (int)
 
- Signals inherited from AbstractPart
void showRequested ()
 
void importFromFileRequested ()
 
void importFromSQLDatabaseRequested ()
 
void exportRequested ()
 
void printRequested ()
 
void printPreviewRequested ()
 
- Signals inherited from AbstractAspect
void aspectDescriptionAboutToChange (const AbstractAspect *)
 Emitted before the name, comment or caption spec is changed. More...
 
void aspectDescriptionChanged (const AbstractAspect *)
 Emitted after the name, comment or caption spec have changed. More...
 
void aspectAboutToBeAdded (const AbstractAspect *parent, const AbstractAspect *before, const AbstractAspect *child)
 Emitted before a new child is inserted. More...
 
void aspectAdded (const AbstractAspect *)
 Emitted after a new Aspect has been added to the tree. More...
 
void aspectAboutToBeRemoved (const AbstractAspect *)
 Emitted before an aspect is removed from its parent. More...
 
void aspectRemoved (const AbstractAspect *parent, const AbstractAspect *before, const AbstractAspect *child)
 Emitted from the parent after removing a child. More...
 
void aspectHiddenAboutToChange (const AbstractAspect *)
 Emitted before the hidden attribute is changed. More...
 
void aspectHiddenChanged (const AbstractAspect *)
 Emitted after the hidden attribute has changed. More...
 
void statusInfo (const QString &)
 Emitted whenever some aspect in the tree wants to give status information to the user. More...
 
void renameRequested ()
 
void selected (const AbstractAspect *)
 
void deselected (const AbstractAspect *)
 
void childAspectSelectedInView (const AbstractAspect *)
 
void childAspectDeselectedInView (const AbstractAspect *)
 
- Protected Slots inherited from AbstractAspect
virtual void childSelected (const AbstractAspect *)
 
virtual void childDeselected (const AbstractAspect *)
 
- Protected Member Functions inherited from AbstractAspect
void info (const QString &text)
 Implementations should call this whenever status information should be given to the user. More...
 
bool readBasicAttributes (XmlStreamReader *)
 Load name and creation time from XML. More...
 
void writeBasicAttributes (QXmlStreamWriter *) const
 Save name and creation time to XML. More...
 
void writeCommentElement (QXmlStreamWriter *) const
 Save the comment to XML. More...
 
bool readCommentElement (XmlStreamReader *)
 Load comment from an XML element. More...
 
- Protected Attributes inherited from Spreadsheet
SpreadsheetViewm_view {nullptr}
 
- Protected Attributes inherited from AbstractPart
QWidget * m_partView {nullptr}
 
- Protected Attributes inherited from AbstractAspect
const AspectType m_type
 

Detailed Description

Represents data stored in a file. Reading and writing is done with the help of appropriate I/O-filters.

File : LiveDataSource.cpp Project : LabPlot

Description : Represents live data source

Copyright : (C) 2009-2019 Alexander Semke (alexa.nosp@m.nder.nosp@m..semk.nosp@m.e@we.nosp@m.b.de) Copyright : (C) 2017 Fabian Kristof (fkris.nosp@m.tofs.nosp@m.zabol.nosp@m.cs@g.nosp@m.mail..nosp@m.com) Copyright : (C) 2018 Stefan Gerlach (stefa.nosp@m.n.ge.nosp@m.rlach.nosp@m.@uni.nosp@m..kn)

  • This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *
  • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
  • You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA *

Definition at line 51 of file LiveDataSource.h.

Member Enumeration Documentation

◆ ReadingType

Enumerator
ContinuousFixed 
FromEnd 
TillEnd 
WholeFile 

Definition at line 72 of file LiveDataSource.h.

◆ SourceType

Enumerator
FileOrPipe 
NetworkTcpSocket 
NetworkUdpSocket 
LocalSocket 
SerialPort 
MQTT 

Definition at line 58 of file LiveDataSource.h.

◆ UpdateType

Enumerator
TimeInterval 
NewData 

Definition at line 67 of file LiveDataSource.h.

Constructor & Destructor Documentation

◆ LiveDataSource()

LiveDataSource::LiveDataSource ( const QString &  name,
bool  loading = false 
)
explicit

Definition at line 64 of file LiveDataSource.cpp.

References initActions(), m_updateTimer, m_watchTimer, read(), and readOnUpdate().

◆ ~LiveDataSource()

LiveDataSource::~LiveDataSource ( )
override

Member Function Documentation

◆ availablePorts()

QStringList LiveDataSource::availablePorts ( )
static

Returns a list with the names of the available ports.

Definition at line 104 of file LiveDataSource.cpp.

References DEBUG, and STDSTRING.

Referenced by ImportFileWidget::ImportFileWidget().

◆ baudRate()

int LiveDataSource::baudRate ( ) const

Definition at line 218 of file LiveDataSource.cpp.

References m_baudRate.

◆ bytesRead()

int LiveDataSource::bytesRead ( ) const

Definition at line 260 of file LiveDataSource.cpp.

References m_bytesRead.

◆ continueReading()

void LiveDataSource::continueReading ( )

Continue reading from the live data source after it was paused.

Definition at line 154 of file LiveDataSource.cpp.

References m_paused, m_pending, and updateNow().

Referenced by LiveDataDock::continueReading().

◆ createContextMenu()

QMenu * LiveDataSource::createContextMenu ( )
overridevirtual

Return AbstractAspect::createContextMenu() plus operations on the primary view.

Reimplemented from AbstractPart.

Definition at line 426 of file LiveDataSource.cpp.

References AbstractPart::createContextMenu(), and m_plotDataAction.

◆ fileName()

QString LiveDataSource::fileName ( ) const

Definition at line 177 of file LiveDataSource.cpp.

References m_fileName.

Referenced by finalizeLoad(), and LiveDataDock::setLiveDataSource().

◆ fileType()

AbstractFileFilter::FileType LiveDataSource::fileType ( ) const

Definition at line 197 of file LiveDataSource.cpp.

References m_fileType.

Referenced by LiveDataDock::setLiveDataSource().

◆ filter()

AbstractFileFilter * LiveDataSource::filter ( ) const

Definition at line 206 of file LiveDataSource.cpp.

References m_filter.

Referenced by ImportFileDialog::importToLiveDataSource().

◆ finalizeLoad()

void LiveDataSource::finalizeLoad ( )

◆ host()

QString LiveDataSource::host ( ) const

Definition at line 366 of file LiveDataSource.cpp.

References m_host.

Referenced by setHost(), and LiveDataDock::setLiveDataSource().

◆ icon()

◆ initActions()

void LiveDataSource::initActions ( )
private

Definition at line 86 of file LiveDataSource.cpp.

References i18n, m_plotDataAction, m_watchTimer, and plotData().

Referenced by LiveDataSource().

◆ isFileLinked()

bool LiveDataSource::isFileLinked ( ) const

returns true if only a link to the file is saved in the project file. false otherwise.

Definition at line 382 of file LiveDataSource.cpp.

References m_fileLinked.

◆ isPaused()

bool LiveDataSource::isPaused ( ) const

Definition at line 280 of file LiveDataSource.cpp.

References m_paused.

Referenced by LiveDataDock::setLiveDataSource().

◆ keepLastValues()

bool LiveDataSource::keepLastValues ( ) const

◆ keepNValues()

int LiveDataSource::keepNValues ( ) const

Definition at line 244 of file LiveDataSource.cpp.

References m_keepNValues.

Referenced by LiveDataDock::setLiveDataSource().

◆ load()

◆ localSocketError

void LiveDataSource::localSocketError ( QLocalSocket::LocalSocketError  socketError)
privateslot

Definition at line 634 of file LiveDataSource.cpp.

Referenced by read().

◆ localSocketName()

QString LiveDataSource::localSocketName ( ) const

Definition at line 189 of file LiveDataSource.cpp.

References m_localSocketName.

Referenced by LiveDataDock::setLiveDataSource().

◆ pauseReading()

void LiveDataSource::pauseReading ( )

Pause the reading of the live data source.

Definition at line 165 of file LiveDataSource.cpp.

References m_paused, m_pending, m_updateTimer, m_updateType, and TimeInterval.

Referenced by LiveDataDock::pauseReading(), and ~LiveDataSource().

◆ plotData

void LiveDataSource::plotData ( )
privateslot

Definition at line 722 of file LiveDataSource.cpp.

Referenced by initActions().

◆ port()

int LiveDataSource::port ( ) const

Definition at line 264 of file LiveDataSource.cpp.

References m_port.

Referenced by LiveDataDock::setLiveDataSource(), and setPort().

◆ read

◆ readingType()

LiveDataSource::ReadingType LiveDataSource::readingType ( ) const

◆ readOnUpdate

void LiveDataSource::readOnUpdate ( )
slot

Definition at line 450 of file LiveDataSource.cpp.

References m_fileName, m_fileSystemWatcher, m_paused, m_pending, and read().

Referenced by LiveDataSource().

◆ readyRead

void LiveDataSource::readyRead ( )
privateslot

Slot for the signal that is emitted once every time new data is available for reading from the device (not UDP or Serial). It will only be emitted again once new data is available, such as when a new payload of network data has arrived on the network socket, or when a new block of data has been appended to your device.

Definition at line 617 of file LiveDataSource.cpp.

References AbstractFileFilter::Ascii, DEBUG, ENUM_TO_STRING, m_device, m_fileType, m_filter, m_updateTimer, m_updateType, NewData, and read().

Referenced by read().

◆ sampleSize()

int LiveDataSource::sampleSize ( ) const

Definition at line 292 of file LiveDataSource.cpp.

References m_sampleSize.

Referenced by LiveDataDock::setLiveDataSource().

◆ save()

◆ serialPortName()

QString LiveDataSource::serialPortName ( ) const

Definition at line 276 of file LiveDataSource.cpp.

References m_serialPortName.

Referenced by LiveDataDock::setLiveDataSource().

◆ setBaudRate()

void LiveDataSource::setBaudRate ( int  baudrate)

Sets the serial port's baud rate.

Parameters
baudrate

Definition at line 214 of file LiveDataSource.cpp.

References m_baudRate.

Referenced by ImportFileWidget::saveSettings().

◆ setBytesRead()

void LiveDataSource::setBytesRead ( qint64  bytes)

Definition at line 256 of file LiveDataSource.cpp.

References m_bytesRead.

◆ setFileLinked()

void LiveDataSource::setFileLinked ( bool  b)

sets whether only a link to the file is saved in the project file (b=true) or the whole content of the file (b=false).

Definition at line 374 of file LiveDataSource.cpp.

References m_fileLinked.

Referenced by ImportFileWidget::saveSettings().

◆ setFileName()

void LiveDataSource::setFileName ( const QString &  name)

Definition at line 173 of file LiveDataSource.cpp.

References m_fileName, and AbstractAspect::name().

Referenced by ImportFileWidget::saveSettings().

◆ setFileType()

void LiveDataSource::setFileType ( const AbstractFileFilter::FileType  type)

Definition at line 193 of file LiveDataSource.cpp.

References m_fileType, and AbstractAspect::type().

Referenced by ImportFileWidget::saveSettings().

◆ setFilter()

void LiveDataSource::setFilter ( AbstractFileFilter f)

Definition at line 201 of file LiveDataSource.cpp.

References m_filter.

Referenced by load(), and ImportFileWidget::saveSettings().

◆ setHost()

void LiveDataSource::setHost ( const QString &  host)

Sets the network socket's host.

Parameters
host

Definition at line 362 of file LiveDataSource.cpp.

References host(), and m_host.

Referenced by ImportFileWidget::saveSettings().

◆ setKeepLastValues()

void LiveDataSource::setKeepLastValues ( bool  )

◆ setKeepNValues()

void LiveDataSource::setKeepNValues ( int  keepnvalues)

Sets how many values we should keep when keepLastValues is true.

Parameters
keepnvalues

Definition at line 240 of file LiveDataSource.cpp.

References m_keepNValues.

Referenced by LiveDataDock::keepNValuesChanged(), and ImportFileWidget::saveSettings().

◆ setLocalSocketName()

void LiveDataSource::setLocalSocketName ( const QString &  name)

Sets the local socket's server name to name.

Parameters
name

Definition at line 185 of file LiveDataSource.cpp.

References m_localSocketName, and AbstractAspect::name().

Referenced by ImportFileWidget::saveSettings().

◆ setPort()

void LiveDataSource::setPort ( quint16  port)

Sets the network socket's port to port.

Parameters
port

Definition at line 252 of file LiveDataSource.cpp.

References m_port, and port().

Referenced by ImportFileWidget::saveSettings().

◆ setReadingType()

void LiveDataSource::setReadingType ( ReadingType  readingType)

Sets the source's reading type to readingType.

Parameters
readingType

Definition at line 312 of file LiveDataSource.cpp.

References m_readingType, and readingType().

Referenced by LiveDataDock::readingTypeChanged(), and ImportFileWidget::saveSettings().

◆ setSampleSize()

void LiveDataSource::setSampleSize ( int  size)

Sets the sample size to size.

Parameters
size

Definition at line 288 of file LiveDataSource.cpp.

References m_sampleSize.

Referenced by LiveDataDock::sampleSizeChanged(), and ImportFileWidget::saveSettings().

◆ setSerialPort()

void LiveDataSource::setSerialPort ( const QString &  name)

Sets the serial port's name to name.

Parameters
name

Definition at line 272 of file LiveDataSource.cpp.

References m_serialPortName, and AbstractAspect::name().

Referenced by ImportFileWidget::saveSettings().

◆ setSourceType()

void LiveDataSource::setSourceType ( SourceType  sourcetype)

Sets the source's type to sourcetype.

Parameters
sourcetype

Definition at line 300 of file LiveDataSource.cpp.

References m_sourceType.

Referenced by ImportFileWidget::saveSettings().

◆ setUpdateInterval()

void LiveDataSource::setUpdateInterval ( int  interval)

Sets the source's update interval to interval.

Parameters
interval

Definition at line 226 of file LiveDataSource.cpp.

References m_paused, m_updateInterval, and m_updateTimer.

Referenced by ImportFileWidget::saveSettings(), LiveDataDock::updateIntervalChanged(), and LiveDataDock::updateTypeChanged().

◆ setUpdateType()

void LiveDataSource::setUpdateType ( UpdateType  updatetype)

Sets the source's update type to updatetype and handles this change.

Parameters
updatetype

Definition at line 324 of file LiveDataSource.cpp.

References m_fileName, m_fileSystemWatcher, m_updateTimer, m_updateType, m_watchTimer, NewData, and TimeInterval.

Referenced by finalizeLoad(), ImportFileWidget::saveSettings(), and LiveDataDock::updateTypeChanged().

◆ setUseRelativePath()

void LiveDataSource::setUseRelativePath ( bool  b)

Definition at line 386 of file LiveDataSource.cpp.

References m_relativePath.

Referenced by ImportFileWidget::saveSettings().

◆ sourceType()

◆ supportedBaudRates()

QStringList LiveDataSource::supportedBaudRates ( )
static

Returns a list with the supported baud rates.

Definition at line 125 of file LiveDataSource.cpp.

Referenced by ImportFileWidget::ImportFileWidget().

◆ tcpSocketError

void LiveDataSource::tcpSocketError ( QAbstractSocket::SocketError  socketError)
privateslot

Definition at line 658 of file LiveDataSource.cpp.

Referenced by read().

◆ updateInterval()

int LiveDataSource::updateInterval ( ) const

Definition at line 232 of file LiveDataSource.cpp.

References m_updateInterval.

Referenced by LiveDataDock::setLiveDataSource().

◆ updateNow()

void LiveDataSource::updateNow ( )

Updates this data source at this moment.

Definition at line 138 of file LiveDataSource.cpp.

References DEBUG, m_paused, m_pending, m_updateInterval, m_updateTimer, m_updateType, read(), and TimeInterval.

Referenced by continueReading(), and LiveDataDock::updateNow().

◆ updateType()

LiveDataSource::UpdateType LiveDataSource::updateType ( ) const

◆ useRelativePath()

bool LiveDataSource::useRelativePath ( ) const

Definition at line 390 of file LiveDataSource.cpp.

References m_relativePath.

◆ view()

QWidget * LiveDataSource::view ( ) const
overridevirtual

Construct a primary view on me.

The caller receives ownership of the view.

This method may be called multiple times during the life time of a Part, or it might not get called at all. Parts must not depend on the existence of a view for their operation.

Implements AbstractPart.

Definition at line 93 of file LiveDataSource.cpp.

References AbstractPart::m_partView, and Spreadsheet::m_view.

Member Data Documentation

◆ m_baudRate

int LiveDataSource::m_baudRate {9600}
private

Definition at line 179 of file LiveDataSource.h.

Referenced by baudRate(), load(), read(), save(), and setBaudRate().

◆ m_bytesRead

qint64 LiveDataSource::m_bytesRead {0}
private

Definition at line 181 of file LiveDataSource.h.

Referenced by bytesRead(), read(), and setBytesRead().

◆ m_device

QIODevice* LiveDataSource::m_device {nullptr}
private

Definition at line 195 of file LiveDataSource.h.

Referenced by read(), and readyRead().

◆ m_dirName

QString LiveDataSource::m_dirName
private

Definition at line 157 of file LiveDataSource.h.

◆ m_fileLinked

bool LiveDataSource::m_fileLinked {false}
private

Definition at line 168 of file LiveDataSource.h.

Referenced by finalizeLoad(), isFileLinked(), load(), save(), and setFileLinked().

◆ m_fileName

QString LiveDataSource::m_fileName
private

◆ m_fileSystemWatcher

QFileSystemWatcher* LiveDataSource::m_fileSystemWatcher {nullptr}
private

Definition at line 187 of file LiveDataSource.h.

Referenced by readOnUpdate(), setUpdateType(), and ~LiveDataSource().

◆ m_fileType

Definition at line 162 of file LiveDataSource.h.

Referenced by fileType(), icon(), load(), read(), readyRead(), save(), and setFileType().

◆ m_fileWatched

bool LiveDataSource::m_fileWatched {false}
private

Definition at line 167 of file LiveDataSource.h.

◆ m_filter

AbstractFileFilter* LiveDataSource::m_filter {nullptr}
private

Definition at line 183 of file LiveDataSource.h.

Referenced by filter(), load(), read(), readyRead(), save(), setFilter(), and ~LiveDataSource().

◆ m_host

QString LiveDataSource::m_host
private

Definition at line 160 of file LiveDataSource.h.

Referenced by host(), load(), read(), save(), and setHost().

◆ m_keepNValues

int LiveDataSource::m_keepNValues {0}
private

Definition at line 176 of file LiveDataSource.h.

Referenced by keepNValues(), save(), and setKeepNValues().

◆ m_localSocket

QLocalSocket* LiveDataSource::m_localSocket {nullptr}
private

Definition at line 189 of file LiveDataSource.h.

Referenced by read(), and ~LiveDataSource().

◆ m_localSocketName

QString LiveDataSource::m_localSocketName
private

Definition at line 159 of file LiveDataSource.h.

Referenced by localSocketName(), read(), and setLocalSocketName().

◆ m_paused

bool LiveDataSource::m_paused {false}
private

◆ m_pending

bool LiveDataSource::m_pending {false}
private

Definition at line 173 of file LiveDataSource.h.

Referenced by continueReading(), pauseReading(), readOnUpdate(), and updateNow().

◆ m_plotDataAction

QAction* LiveDataSource::m_plotDataAction {nullptr}
private

Definition at line 196 of file LiveDataSource.h.

Referenced by createContextMenu(), and initActions().

◆ m_port

quint16 LiveDataSource::m_port {1027}
private

Definition at line 178 of file LiveDataSource.h.

Referenced by port(), read(), save(), and setPort().

◆ m_prepared

bool LiveDataSource::m_prepared {false}
private

Definition at line 171 of file LiveDataSource.h.

Referenced by read().

◆ m_reading

bool LiveDataSource::m_reading {false}
private

Definition at line 172 of file LiveDataSource.h.

Referenced by read().

◆ m_readingType

ReadingType LiveDataSource::m_readingType
private

Definition at line 165 of file LiveDataSource.h.

Referenced by load(), read(), readingType(), save(), and setReadingType().

◆ m_relativePath

bool LiveDataSource::m_relativePath {false}
private

Definition at line 169 of file LiveDataSource.h.

Referenced by finalizeLoad(), load(), save(), setUseRelativePath(), and useRelativePath().

◆ m_sampleSize

int LiveDataSource::m_sampleSize {1}
private

Definition at line 175 of file LiveDataSource.h.

Referenced by load(), sampleSize(), save(), and setSampleSize().

◆ m_serialPortName

QString LiveDataSource::m_serialPortName
private

Definition at line 158 of file LiveDataSource.h.

Referenced by load(), read(), save(), serialPortName(), and setSerialPort().

◆ m_sourceType

SourceType LiveDataSource::m_sourceType
private

Definition at line 164 of file LiveDataSource.h.

Referenced by load(), read(), save(), setSourceType(), and sourceType().

◆ m_tcpSocket

QTcpSocket* LiveDataSource::m_tcpSocket {nullptr}
private

Definition at line 190 of file LiveDataSource.h.

Referenced by read(), and ~LiveDataSource().

◆ m_udpSocket

QUdpSocket* LiveDataSource::m_udpSocket {nullptr}
private

Definition at line 191 of file LiveDataSource.h.

Referenced by read().

◆ m_updateInterval

int LiveDataSource::m_updateInterval {1000}
private

Definition at line 177 of file LiveDataSource.h.

Referenced by load(), save(), setUpdateInterval(), updateInterval(), and updateNow().

◆ m_updateTimer

QTimer* LiveDataSource::m_updateTimer
private

◆ m_updateType

UpdateType LiveDataSource::m_updateType
private

◆ m_watchTimer

QTimer* LiveDataSource::m_watchTimer
private

Definition at line 186 of file LiveDataSource.h.

Referenced by initActions(), LiveDataSource(), and setUpdateType().


The documentation for this class was generated from the following files: