DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExp::QSerialCommunicationHardwareAdapterWorker Class Referenceabstract

Qt worker which performs actual serial communication hardware operations in a separate thread in order not to interfer with processor time used to update the user interface. All functions are inherently thead-safe since they are only called by the worker thread the respective instance of this class lives in. More...

+ Inheritance diagram for DynExp::QSerialCommunicationHardwareAdapterWorker:

Public Slots

void Open ()
 Opens the communication connection. More...
 
void Close ()
 Closes the communication connection. More...
 
void Reset ()
 Resets the worker and the communication connection. More...
 
void Clear ()
 Clears the communication connection's buffers and state. More...
 
void Flush ()
 Flushes the communication connection's buffers. More...
 
void Read ()
 Reads from the communication connection's hardware interface. More...
 
void Write (const QString String)
 Writes String to the communication connection's hardware interface. More...
 
void Write_endl ()
 Writes end of the line character(s) to the communication connection's hardware interface. More...
 

Public Member Functions

 QSerialCommunicationHardwareAdapterWorker ()=default
 
virtual ~QSerialCommunicationHardwareAdapterWorker ()=0
 
- Public Member Functions inherited from Util::QWorker
void MoveToWorkerThread (DynExp::ItemIDType ID)
 Moves the instance to DynExpCore's worker thread. Do not call from constructor since derived classes have not been instantiated yet in that case. This would prevent QObjects contained in derived classes to be also moved to the worker thread. More...
 
auto GetOwner () const noexcept
 Returns this worker instance's owner. More...
 

Protected Member Functions

void SetCommunicationChannelOpened () const noexcept
 Calls QSerialCommunicationHardwareAdapter::SetCommunicationChannelOpened on QWorker::Owner. Does nothing if QWorker::Owner is nullptr. More...
 
void SetCommunicationChannelClosed () const noexcept
 Calls QSerialCommunicationHardwareAdapter::SetCommunicationChannelClosed on QWorker::Owner. Does nothing if QWorker::Owner is nullptr. More...
 
void DataRead (const std::string &String) const
 Calls QSerialCommunicationHardwareAdapter::DataRead on QWorker::Owner. Does nothing if QWorker::Owner is nullptr. More...
 
template<typename ExceptionType >
void SetException (const ExceptionType &Exception) const
 Calls QSerialCommunicationHardwareAdapter::SetException on QWorker::Owner. Does nothing if QWorker::Owner is nullptr. More...
 
- Protected Member Functions inherited from Util::QWorker
 QWorker ()=default
 
 ~QWorker ()=default
 

Private Member Functions

virtual void OpenChild ()=0
 Opens the communication connection. More...
 
virtual void CloseChild ()=0
 Closes the communication connection. More...
 
virtual void ResetChild ()=0
 Resets the worker and the communication connection. More...
 
virtual void ClearChild ()=0
 Clears the communication connection's buffers and state. More...
 
virtual void FlushChild ()=0
 Flushes the communication connection's buffers. More...
 
virtual void ReadChild ()=0
 Reads from the communication connection's hardware interface. More...
 
virtual void WriteChild (const QString &String)=0
 Writes String to the communication connection's hardware interface. More...
 
virtual void Write_endl_Child ()=0
 Writes end of the line character(s) to the communication connection's hardware interface. More...
 

Detailed Description

Qt worker which performs actual serial communication hardware operations in a separate thread in order not to interfer with processor time used to update the user interface. All functions are inherently thead-safe since they are only called by the worker thread the respective instance of this class lives in.

Definition at line 563 of file HardwareAdapter.h.

Constructor & Destructor Documentation

◆ QSerialCommunicationHardwareAdapterWorker()

DynExp::QSerialCommunicationHardwareAdapterWorker::QSerialCommunicationHardwareAdapterWorker ( )
default

◆ ~QSerialCommunicationHardwareAdapterWorker()

DynExp::QSerialCommunicationHardwareAdapterWorker::~QSerialCommunicationHardwareAdapterWorker ( )
pure virtual

Definition at line 353 of file HardwareAdapter.cpp.

Member Function Documentation

◆ Clear

void DynExp::QSerialCommunicationHardwareAdapterWorker::Clear ( )
inlineslot

Clears the communication connection's buffers and state.

Definition at line 575 of file HardwareAdapter.h.

◆ ClearChild()

virtual void DynExp::QSerialCommunicationHardwareAdapterWorker::ClearChild ( )
privatepure virtual

Clears the communication connection's buffers and state.

Implemented in DynExp::HardwareAdapterSerialPortWorker, and DynExp::HardwareAdapterTcpSocketWorker.

◆ Close

void DynExp::QSerialCommunicationHardwareAdapterWorker::Close ( )
inlineslot

Closes the communication connection.

Definition at line 573 of file HardwareAdapter.h.

◆ CloseChild()

virtual void DynExp::QSerialCommunicationHardwareAdapterWorker::CloseChild ( )
privatepure virtual

Closes the communication connection.

Implemented in DynExp::HardwareAdapterSerialPortWorker, and DynExp::HardwareAdapterTcpSocketWorker.

◆ DataRead()

void DynExp::QSerialCommunicationHardwareAdapterWorker::DataRead ( const std::string &  String) const
protected

Calls QSerialCommunicationHardwareAdapter::DataRead on QWorker::Owner. Does nothing if QWorker::Owner is nullptr.

Definition at line 375 of file HardwareAdapter.cpp.

◆ Flush

void DynExp::QSerialCommunicationHardwareAdapterWorker::Flush ( )
inlineslot

Flushes the communication connection's buffers.

Definition at line 576 of file HardwareAdapter.h.

◆ FlushChild()

virtual void DynExp::QSerialCommunicationHardwareAdapterWorker::FlushChild ( )
privatepure virtual

Flushes the communication connection's buffers.

Implemented in DynExp::HardwareAdapterSerialPortWorker, and DynExp::HardwareAdapterTcpSocketWorker.

◆ Open

void DynExp::QSerialCommunicationHardwareAdapterWorker::Open ( )
inlineslot

Opens the communication connection.

Definition at line 572 of file HardwareAdapter.h.

◆ OpenChild()

virtual void DynExp::QSerialCommunicationHardwareAdapterWorker::OpenChild ( )
privatepure virtual

Opens the communication connection.

Implemented in DynExp::HardwareAdapterSerialPortWorker, and DynExp::HardwareAdapterTcpSocketWorker.

◆ Read

void DynExp::QSerialCommunicationHardwareAdapterWorker::Read ( )
inlineslot

Reads from the communication connection's hardware interface.

Definition at line 577 of file HardwareAdapter.h.

◆ ReadChild()

virtual void DynExp::QSerialCommunicationHardwareAdapterWorker::ReadChild ( )
privatepure virtual

Reads from the communication connection's hardware interface.

Implemented in DynExp::HardwareAdapterSerialPortWorker, and DynExp::HardwareAdapterTcpSocketWorker.

◆ Reset

void DynExp::QSerialCommunicationHardwareAdapterWorker::Reset ( )
inlineslot

Resets the worker and the communication connection.

Definition at line 574 of file HardwareAdapter.h.

◆ ResetChild()

virtual void DynExp::QSerialCommunicationHardwareAdapterWorker::ResetChild ( )
privatepure virtual

Resets the worker and the communication connection.

Implemented in DynExp::HardwareAdapterSerialPortWorker, and DynExp::HardwareAdapterTcpSocketWorker.

◆ SetCommunicationChannelClosed()

void DynExp::QSerialCommunicationHardwareAdapterWorker::SetCommunicationChannelClosed ( ) const
protectednoexcept

Calls QSerialCommunicationHardwareAdapter::SetCommunicationChannelClosed on QWorker::Owner. Does nothing if QWorker::Owner is nullptr.

Definition at line 366 of file HardwareAdapter.cpp.

◆ SetCommunicationChannelOpened()

void DynExp::QSerialCommunicationHardwareAdapterWorker::SetCommunicationChannelOpened ( ) const
protectednoexcept

Calls QSerialCommunicationHardwareAdapter::SetCommunicationChannelOpened on QWorker::Owner. Does nothing if QWorker::Owner is nullptr.

Definition at line 357 of file HardwareAdapter.cpp.

◆ SetException()

template<typename ExceptionType >
void DynExp::QSerialCommunicationHardwareAdapterWorker::SetException ( const ExceptionType &  Exception) const
protected

Calls QSerialCommunicationHardwareAdapter::SetException on QWorker::Owner. Does nothing if QWorker::Owner is nullptr.

Template Parameters
ExceptionTypeType of the exception to be stored
Parameters
ExceptionException to be stores

Definition at line 786 of file HardwareAdapter.h.

◆ Write

void DynExp::QSerialCommunicationHardwareAdapterWorker::Write ( const QString  String)
inlineslot

Writes String to the communication connection's hardware interface.

Definition at line 578 of file HardwareAdapter.h.

◆ Write_endl

void DynExp::QSerialCommunicationHardwareAdapterWorker::Write_endl ( )
inlineslot

Writes end of the line character(s) to the communication connection's hardware interface.

Definition at line 579 of file HardwareAdapter.h.

◆ Write_endl_Child()

virtual void DynExp::QSerialCommunicationHardwareAdapterWorker::Write_endl_Child ( )
privatepure virtual

Writes end of the line character(s) to the communication connection's hardware interface.

Implemented in DynExp::HardwareAdapterSerialPortWorker, and DynExp::HardwareAdapterTcpSocketWorker.

◆ WriteChild()

virtual void DynExp::QSerialCommunicationHardwareAdapterWorker::WriteChild ( const QString &  String)
privatepure virtual

Writes String to the communication connection's hardware interface.

Implemented in DynExp::HardwareAdapterSerialPortWorker, and DynExp::HardwareAdapterTcpSocketWorker.


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