//Author: Timothy Pearson , (C) 2012 //Copyright: See COPYING file that comes with this distribution #ifndef REMOTELAB_SCOPEPART_H #define REMOTELAB_SCOPEPART_H #include #include #include #include #include #define MAXTRACES 255 class KAboutData; using KParts::StatusBarExtension; class TraceWidget; class TQSocket; class TQTimer; class TQMutex; class TQRectF; class ScopeBase; namespace RemoteLab { class ScopePart : public KParts::RemoteInstrumentPart { Q_OBJECT public: ScopePart( QWidget *, const char *, TQObject *, const char *, const TQStringList&); ~ScopePart(); virtual bool openFile() { return false; } // pure virtual in the base class virtual bool closeURL(); static KAboutData *createAboutData(); public slots: virtual bool openURL(const KURL &url); void updateZoomWidgetLimits(const TQRectF& zoomRect); private slots: void postInit(); void processLockouts(); void updateGraticule(); void connectionFinishedCallback(); void disconnectFromServerCallback(); void connectionStatusChangedCallback(); void setTickerMessage(TQString message); void mainEventLoop(); void startDAQ(); void stopDAQ(); virtual void postProcessTrace(); void saRefLevelChanged(double); private: TraceWidget* m_traceWidget; int m_commHandlerState; int m_commHandlerMode; int m_commHandlerCommandState; TQTimer* m_forcedUpdateTimer; TQTimer* m_updateTimeoutTimer; bool m_connectionActiveAndValid; unsigned char m_tickerState; TQ_INT16 m_maxNumberOfTraces; TQ_INT32 m_currentOpChannel; TQ_INT32 m_nextOpChannel; TQ_INT16 m_nextOpParameter16; TQ_INT16 m_hdivs; TQ_INT16 m_vdivs; TQ_INT32 m_samplesInTrace[MAXTRACES+1]; bool m_channelActive[MAXTRACES+1]; double m_voltsDiv[MAXTRACES+1]; double m_secsDiv[MAXTRACES+1]; ScopeBase* m_base; TQMutex* m_instrumentMutex; bool stopTraceUpdate; }; } #endif