qpidctrl
0.7.1
|
#include <qpiddevice.h>
Public Types | |
enum | { NoDevice = 0, WatlowDevice = 1, PTC10Device = 2, LakeshoreDevice = 3, CryostreamDevice = 4, EurothermDevice = 5 } |
Public Slots | |
void | printMessage (QString msg, QDateTime ts=QDateTime::currentDateTime()) |
virtual void | readoutInitial ()=0 |
virtual void | readoutPolling ()=0 |
virtual void | readoutTimeout ()=0 |
virtual void | sendCommand (QString cmd)=0 |
virtual void | changeSetPoint (double setPoint)=0 |
virtual void | changeRampRate (double rate)=0 |
virtual void | changeProportional (double prop)=0 |
virtual void | changeIntegral (double integ)=0 |
virtual void | changeDerivative (double deriv)=0 |
virtual void | enable (bool on)=0 |
virtual void | loopEnable (bool on) |
virtual bool | canAutoTune ()=0 |
virtual void | autoTune ()=0 |
virtual void | readyRead () |
virtual void | onGraphingTimeout () |
virtual void | onLoggingTimeout () |
virtual void | start () |
virtual void | stop () |
virtual void | restart () |
virtual void | changeRunState (int state) |
virtual void | changePollingInterval (double interval) |
virtual void | changeTimeoutInterval (double interval) |
virtual void | changeGraphingInterval (double interval) |
virtual void | changeLoggingInterval (double interval) |
virtual void | write (QString cmd) |
virtual QString | readLine (int sz=0) |
virtual int | waitForReadyRead (int tmout=0) |
virtual int | bytesAvailable () |
virtual int | canReadLine () |
Signals | |
void | inputChannelChanged (QString name, QString units) |
void | outputChannelChanged (QString name, QString units) |
void | loggedChannelNames (QStringList names) |
void | loggedChannelValues (QcepDoubleList values) |
void | graphedChannelNames (QStringList names) |
void | graphedChannelValues (QcepDoubleList values) |
Public Member Functions | |
QPidDevice (QPidControllerWPtr ctrl, QcepSettingsSaverWPtr saver, int deviceType, QString deviceName, int pollIntervalMsec, int timeoutMsec) | |
virtual | ~QPidDevice () |
QPidControllerWPtr | controller () const |
virtual void | configurationDialog ()=0 |
virtual void | writeSettings (QSettings *set, QString section) |
virtual void | readSettings (QSettings *set, QString section) |
double | cK2K (double cK) |
double | K2cK (double K) |
double | K2degC (double K) |
double | degC2K (double degC) |
void | updateConnected (double newConnected) |
void | updateTemperature (double newTemperature) |
void | updateRampPoint (double newRampPoint) |
void | updateOutputLevel (double newOutputLevel) |
void | resetTimeout () |
void | pushCommand (QPidDeviceCommandPtr cmd) |
void | issueCommand () |
void | completeCommand (QByteArray response) |
void | flushCommandQueue () |
int | slowly (int msec) |
QPidCommPortPtr | commPort () |
Static Public Member Functions | |
static QString | deviceTypeName (int typ) |
static QString | deviceLongTypeName (int typ) |
static int | deviceTypeCount () |
Properties | |
int | deviceType |
QString | deviceTypeName |
QString | deviceLongTypeName |
QString | deviceName |
int | runState |
double | pollingInterval |
double | timeoutInterval |
Private Slots | |
void | onPollingTimeout () |
void | onTimeoutTimeout () |
Private Attributes | |
QPidControllerWPtr | m_Controller |
QPidCommPortPtr | m_CommPort |
QMutex | m_CommandMutex |
QPidDeviceCommandQueue | m_CommandQueue |
QTimer | m_PollingTimer |
QTimer | m_TimeoutTimer |
QTimer | m_LoggingTimer |
QTimer | m_GraphingTimer |
Definition at line 16 of file qpiddevice.h.
anonymous enum |
Enumerator | |
---|---|
NoDevice | |
WatlowDevice | |
PTC10Device | |
LakeshoreDevice | |
CryostreamDevice | |
EurothermDevice |
Definition at line 20 of file qpiddevice.h.
|
explicit |
Definition at line 9 of file qpiddevice.cpp.
References changeGraphingInterval(), changeLoggingInterval(), changePollingInterval(), changeRunState(), changeTimeoutInterval(), and m_Controller.
|
virtual |
Definition at line 43 of file qpiddevice.cpp.
|
pure virtualslot |
|
virtualslot |
Definition at line 540 of file qpiddevice.cpp.
References commPort().
Referenced by QWatlowDevice::onReadyRead().
|
pure virtualslot |
|
virtualslot |
Definition at line 545 of file qpiddevice.cpp.
References commPort().
Referenced by QPTC10Device::ptc10test(), and QPTC10Device::sendQuery().
|
pure virtualslot |
|
virtualslot |
Definition at line 263 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, m_GraphingTimer, and printMessage().
Referenced by QPidDevice().
|
pure virtualslot |
|
virtualslot |
Definition at line 282 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, m_LoggingTimer, and printMessage().
Referenced by QPidDevice().
|
virtualslot |
Definition at line 233 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, m_PollingTimer, and printMessage().
Referenced by QPidDevice().
|
pure virtualslot |
|
pure virtualslot |
|
virtualslot |
Definition at line 126 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, printMessage(), start(), and stop().
Referenced by QPidDevice().
|
pure virtualslot |
|
virtualslot |
Definition at line 252 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, m_TimeoutTimer, and printMessage().
Referenced by QPidDevice().
double QPidDevice::cK2K | ( | double | cK | ) |
Definition at line 384 of file qpiddevice.cpp.
Referenced by QCryostreamDevice::parseStatusPacket().
QPidCommPortPtr QPidDevice::commPort | ( | ) |
Definition at line 121 of file qpiddevice.cpp.
References m_CommPort.
Referenced by bytesAvailable(), canReadLine(), QWatlowDevice::issueCommand(), QWatlowDevice::onReadyRead(), QPTC10Device::ptc10test(), readLine(), QCryostreamDevice::readyRead(), QEurothermDevice::runTest1(), QPTC10Device::sendCommand(), QCryostreamDevice::sendCryoCommand(), QPTC10Device::sendQuery(), QEurothermDevice::test2Tick(), QPTC10Device::updateChannelList(), waitForReadyRead(), and write().
void QPidDevice::completeCommand | ( | QByteArray | response | ) |
Definition at line 483 of file qpiddevice.cpp.
References issueCommand(), m_CommandMutex, m_CommandQueue, QPidDeviceCommand::processReply(), and updateConnected().
|
pure virtual |
Implemented in QWatlowDevice, QPTC10Device, QEurothermDevice, QCryostreamDevice, and QLakeshoreDevice.
QPidControllerWPtr QPidDevice::controller | ( | ) | const |
Definition at line 316 of file qpiddevice.cpp.
References m_Controller.
Referenced by QCryostreamDevice::changeSetPoint(), QEurothermDevice::changeSetPoint(), QWatlowDevice::completeCommand(), QPTC10Device::onGraphingTimeout(), QWatlowDevice::onGraphingTimeout(), QPTC10Device::onLoggingTimeout(), QWatlowDevice::onLoggingTimeout(), QCryostreamDevice::parseStatusPacket(), printMessage(), QPTC10Device::readoutPolling(), updateConnected(), updateOutputLevel(), updateRampPoint(), and updateTemperature().
double QPidDevice::degC2K | ( | double | degC | ) |
Definition at line 399 of file qpiddevice.cpp.
Referenced by QCryostreamDevice::cryoTemperature().
|
static |
Definition at line 83 of file qpiddevice.cpp.
References CryostreamDevice, EurothermDevice, LakeshoreDevice, NoDevice, PTC10Device, and WatlowDevice.
|
static |
Definition at line 116 of file qpiddevice.cpp.
Referenced by QPidDeviceListWidget::doCreateNewDevice().
|
static |
Definition at line 50 of file qpiddevice.cpp.
References CryostreamDevice, EurothermDevice, LakeshoreDevice, NoDevice, PTC10Device, and WatlowDevice.
void QPidDevice::flushCommandQueue | ( | ) |
Definition at line 472 of file qpiddevice.cpp.
References m_CommandMutex, and m_CommandQueue.
Referenced by QPTC10Device::readoutTimeout().
|
signal |
Referenced by QPTC10Device::parseChannelList(), and QWatlowDevice::readoutInitial().
|
signal |
Referenced by QPTC10Device::onGraphingTimeout(), and QWatlowDevice::onGraphingTimeout().
|
signal |
Referenced by QPTC10Device::onInputChannelChanged().
void QPidDevice::issueCommand | ( | ) |
Definition at line 448 of file qpiddevice.cpp.
References QPidDeviceCommand::issueCommand(), m_CommandMutex, m_CommandQueue, QPidDeviceCommand::replyExpected(), and resetTimeout().
Referenced by completeCommand(), and pushCommand().
double QPidDevice::K2cK | ( | double | K | ) |
Definition at line 389 of file qpiddevice.cpp.
Referenced by QCryostreamDevice::cryoTemperature().
double QPidDevice::K2degC | ( | double | K | ) |
Definition at line 394 of file qpiddevice.cpp.
Referenced by QCryostreamDevice::parseStatusPacket().
|
signal |
Referenced by QPTC10Device::parseChannelList(), and QWatlowDevice::readoutInitial().
|
signal |
Referenced by QPTC10Device::onLoggingTimeout(), and QWatlowDevice::onLoggingTimeout().
|
virtualslot |
|
virtualslot |
Definition at line 503 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, and printMessage().
Referenced by start(), and stop().
|
virtualslot |
Definition at line 510 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, and printMessage().
Referenced by start(), and stop().
|
privateslot |
Definition at line 413 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, m_PollingTimer, printMessage(), readoutPolling(), and slowly().
Referenced by start(), and stop().
|
privateslot |
Definition at line 424 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, printMessage(), readoutTimeout(), resetTimeout(), and updateConnected().
Referenced by start(), and stop().
|
signal |
Referenced by QPTC10Device::onOutputChannelChanged().
|
slot |
Definition at line 321 of file qpiddevice.cpp.
References controller().
Referenced by changeGraphingInterval(), changeLoggingInterval(), changePollingInterval(), changeRunState(), changeTimeoutInterval(), QWatlowDevice::completeCommand(), QPTC10Device::enable(), QWatlowDevice::enable(), QWatlowDevice::issueCommand(), QPTC10Device::loopEnable(), QWatlowDevice::onDsrChanged(), onGraphingTimeout(), onLoggingTimeout(), onPollingTimeout(), QWatlowDevice::onReadyRead(), QWatlowDevice::onTimeout(), onTimeoutTimeout(), QPTC10Device::parseChannelList(), QPTC10Device::parseOutputValues(), QCryostreamDevice::parseStatusPacket(), QPTC10Device::parseUnitsList(), QPTC10Device::ptc10test(), QPTC10Device::queryProperty(), QPTC10Device::readoutInitial(), QPTC10Device::readoutPolling(), QPTC10Device::readoutTimeout(), resetTimeout(), QEurothermDevice::runTest1(), QEurothermDevice::runTest2(), QPTC10Device::sendCommand(), QCryostreamDevice::sendCryoCommand(), QPTC10Device::sendQuery(), QEurothermDevice::test2Tick(), and QWatlowDevice::timerEvent().
void QPidDevice::pushCommand | ( | QPidDeviceCommandPtr | cmd | ) |
Definition at line 437 of file qpiddevice.cpp.
References issueCommand(), m_CommandMutex, and m_CommandQueue.
|
virtualslot |
|
pure virtualslot |
Referenced by start().
|
pure virtualslot |
Referenced by onPollingTimeout().
|
pure virtualslot |
Referenced by onTimeoutTimeout().
|
virtual |
Reimplemented in QWatlowDevice, QEurothermDevice, QPTC10Device, QCryostreamDevice, and QLakeshoreDevice.
Definition at line 375 of file qpiddevice.cpp.
References m_CommPort.
Referenced by QCryostreamDevice::readSettings(), QLakeshoreDevice::readSettings(), QPTC10Device::readSettings(), QEurothermDevice::readSettings(), and QWatlowDevice::readSettings().
|
virtualslot |
void QPidDevice::resetTimeout | ( | ) |
Definition at line 404 of file qpiddevice.cpp.
References DEBUG_PIDDEVICE, m_TimeoutTimer, printMessage(), and slowly().
Referenced by issueCommand(), and onTimeoutTimeout().
|
virtualslot |
|
pure virtualslot |
int QPidDevice::slowly | ( | int | msec | ) |
Definition at line 307 of file qpiddevice.cpp.
References DEBUG_SLOWLY.
Referenced by onPollingTimeout(), and resetTimeout().
|
virtualslot |
Definition at line 139 of file qpiddevice.cpp.
References changeDerivative(), changeIntegral(), changeProportional(), changeRampRate(), changeSetPoint(), enable(), loopEnable(), m_CommPort, m_Controller, m_GraphingTimer, m_LoggingTimer, m_PollingTimer, m_TimeoutTimer, onGraphingTimeout(), onLoggingTimeout(), onPollingTimeout(), onTimeoutTimeout(), readoutInitial(), and readyRead().
Referenced by changeRunState(), restart(), QWatlowDevice::start(), and QPTC10Device::start().
|
virtualslot |
Definition at line 189 of file qpiddevice.cpp.
References changeDerivative(), changeIntegral(), changeProportional(), changeRampRate(), changeSetPoint(), enable(), loopEnable(), m_CommPort, m_Controller, m_GraphingTimer, m_LoggingTimer, m_PollingTimer, m_TimeoutTimer, onGraphingTimeout(), onLoggingTimeout(), onPollingTimeout(), onTimeoutTimeout(), and readyRead().
Referenced by changeRunState(), restart(), QWatlowDevice::stop(), and QPTC10Device::stop().
void QPidDevice::updateConnected | ( | double | newConnected | ) |
Definition at line 330 of file qpiddevice.cpp.
References controller().
Referenced by completeCommand(), and onTimeoutTimeout().
void QPidDevice::updateOutputLevel | ( | double | newOutputLevel | ) |
Definition at line 357 of file qpiddevice.cpp.
References controller().
void QPidDevice::updateRampPoint | ( | double | newRampPoint | ) |
Definition at line 348 of file qpiddevice.cpp.
References controller().
void QPidDevice::updateTemperature | ( | double | newTemperature | ) |
Definition at line 339 of file qpiddevice.cpp.
References controller().
|
virtualslot |
Definition at line 535 of file qpiddevice.cpp.
References commPort().
Referenced by QPTC10Device::ptc10test(), and QPTC10Device::sendQuery().
|
virtualslot |
Definition at line 525 of file qpiddevice.cpp.
References commPort().
Referenced by QWatlowDevice::issueCommand().
|
virtual |
Reimplemented in QWatlowDevice, QEurothermDevice, QPTC10Device, QCryostreamDevice, and QLakeshoreDevice.
Definition at line 366 of file qpiddevice.cpp.
References m_CommPort.
Referenced by QCryostreamDevice::writeSettings(), QLakeshoreDevice::writeSettings(), QPTC10Device::writeSettings(), QEurothermDevice::writeSettings(), and QWatlowDevice::writeSettings().
|
private |
Definition at line 148 of file qpiddevice.h.
Referenced by completeCommand(), flushCommandQueue(), issueCommand(), and pushCommand().
|
private |
Definition at line 149 of file qpiddevice.h.
Referenced by completeCommand(), flushCommandQueue(), issueCommand(), and pushCommand().
|
private |
Definition at line 147 of file qpiddevice.h.
Referenced by commPort(), readSettings(), start(), stop(), and writeSettings().
|
private |
Definition at line 146 of file qpiddevice.h.
Referenced by controller(), QPidDevice(), start(), and stop().
|
private |
Definition at line 153 of file qpiddevice.h.
Referenced by changeGraphingInterval(), start(), and stop().
|
private |
Definition at line 152 of file qpiddevice.h.
Referenced by changeLoggingInterval(), start(), and stop().
|
private |
Definition at line 150 of file qpiddevice.h.
Referenced by changePollingInterval(), onPollingTimeout(), start(), and stop().
|
private |
Definition at line 151 of file qpiddevice.h.
Referenced by changeTimeoutInterval(), resetTimeout(), start(), and stop().
|
readwrite |
Definition at line 130 of file qpiddevice.h.
Referenced by QPidDeviceListWidget::doCreateNewDevice().
|
readwrite |
Definition at line 133 of file qpiddevice.h.
|
readwrite |
Definition at line 124 of file qpiddevice.h.
|
readwrite |
Definition at line 127 of file qpiddevice.h.
|
readwrite |
Definition at line 139 of file qpiddevice.h.
|
readwrite |
Definition at line 136 of file qpiddevice.h.
|
readwrite |
Definition at line 142 of file qpiddevice.h.