Files
giesCANne/connectionwindow.h
T
Collin Kidder a3cd14e495 Additional implementation of the new connection scheme. It is now possible to send frames to CANConnection objects indirectly based on registered bus number.
This further abstracts the interface. Things are reasonably stable now for frame reception. Initial work has been done to support frame transmission as well. This is currently less stable but mostly working.
2016-03-27 22:37:02 -04:00

75 lines
1.5 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"
class CANConnectionModel;
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 updateBusSettings(CAN_Bus *bus);
void updatePortName(QString port);
public slots:
void setSpeed(int speed0);
void setSWMode(bool mode);
void sendFrame(const CANFrame *);
void sendFrameBatch(const QList<CANFrame> *);
private slots:
void handleOKButton();
void handleConnTypeChanged();
void handleConnSelectionChanged();
void handleRemoveConn();
void handleRevert();
void handleNewConn();
void receiveBusStatus(int bus, int speed, int status);
private:
Ui::ConnectionWindow *ui;
QList<QSerialPortInfo> ports;
QSettings *settings;
CANConnectionModel *connModel;
CANFrameModel *canModel;
void getSerialPorts();
void getKvaserPorts();
void getSocketcanPorts();
};
#endif // CONNECTIONWINDOW_H