Files
giesCANne/connectionwindow.h
T
Collin Kidder e7ded7737a Preliminary pass at converting connection system to use a more generic
approach and support more devices and multiple devices at the same time.
2016-03-19 21:40:21 -04:00

69 lines
1.3 KiB
C++

#ifndef CONNECTIONWINDOW_H
#define CONNECTIONWINDOW_H
#include "canconnectionmodel.h"
#include <QSerialPortInfo>
#include <QDialog>
#include <QDebug>
#include <QSettings>
#include "canconnection.h"
#include "serialworker.h"
namespace Ui {
class ConnectionWindow;
}
namespace ConnectionType
{
enum ConnectionType
{
GVRET_SERIAL,
KVASER,
SOCKETCAN
};
}
class ConnectionWindow : public QDialog
{
Q_OBJECT
public:
explicit ConnectionWindow(CANFrameModel *canModel, QWidget *parent = 0);
~ConnectionWindow();
void showEvent(QShowEvent *);
int getSpeed();
QString getPortName(); //name of port to connect to
ConnectionType::ConnectionType getConnectionType();
bool getSWMode();
signals:
void updateConnectionSettings(QString connectionType, QString port, int speed);
public slots:
void setSpeed(int speed0);
void setSWMode(bool mode);
private slots:
void handleOKButton();
void handleConnTypeChanged();
void handleConnSelectionChanged();
void handleRemoveConn();
void handleRevert();
private:
Ui::ConnectionWindow *ui;
QList<QSerialPortInfo> ports;
QSettings *settings;
CANConnectionModel *connModel;
CANFrameModel *canModel;
void getSerialPorts();
void getKvaserPorts();
void getSocketcanPorts();
};
#endif // CONNECTIONWINDOW_H