Skip to content
Snippets Groups Projects
XbeeConfigurationWindow.h 1.37 KiB
Newer Older
  • Learn to ignore specific revisions
  • Franz's avatar
    Franz committed
    #ifndef _XBEECONFIGURATIONWINDOW_H_
    #define _XBEECONFIGURATIONWINDOW_H_
    
    #include <QObject>
    #include <QWidget>
    #include <QAction>
    #include <QTimer>
    #include <QShowEvent>
    #include <QHideEvent>
    
    #include <QComboBox>
    #include <QLabel>
    #include <QLayout>
    
    Franz's avatar
    Franz committed
    #include <LinkInterface.h>
    #include"XbeeLinkInterface.h"
    
    Don Gagne's avatar
    Don Gagne committed
    #include "HexSpinBox.h"
    
    Franz's avatar
    Franz committed
    
    
    class XbeeConfigurationWindow : public QWidget
    {
    	Q_OBJECT
    
    public:
    	XbeeConfigurationWindow(LinkInterface* link, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Sheet);
    	~XbeeConfigurationWindow();
    
    public slots:
    	void configureCommunication();
    	void setPortName(QString port);
    	void setBaudRateString(QString baud);
    	void setupPortList();
    
    
    oberion's avatar
    oberion committed
    private slots:
    	void addrChangedHigh(int addr);
    	void addrChangedLow(int addr);
    
    
    Franz's avatar
    Franz committed
    protected:
        void showEvent(QShowEvent* event);
        void hideEvent(QHideEvent* event);
        bool userConfigured; ///< Switch to detect if current values are user-selected and shouldn't be overriden
    
    private:
    	QLabel *portLabel;
    	QLabel *baudLabel;
    	QComboBox *portBox;
    	QComboBox *baudBox;
    	QGridLayout *actionLayout;
    	QHBoxLayout *xbeeLayout;
    	QVBoxLayout *tmpLayout;
    	XbeeLinkInterface* link;
        QTimer* portCheckTimer;
    
    oberion's avatar
    oberion committed
    	HexSpinBox* highAddr;
    	HexSpinBox* lowAddr;
    	QLabel* highAddrLabel;
    	QLabel* lowAddrLabel;
    
    signals:
    	void addrHighChanged(quint32 addrHigh);
    	void addrLowChanged(quint32 addrLow);
    
    #endif //_XBEECONFIGURATIONWINDOW_H_