Some additional work on new connection window.
This commit is contained in:
+18
-2
@@ -58,6 +58,9 @@ ConnectionWindow::ConnectionWindow(CANFrameModel *cModel, QWidget *parent) :
|
||||
connect(ui->btnRevert, &QPushButton::clicked, this, &ConnectionWindow::handleRevert);
|
||||
connect(ui->tableConnections->selectionModel(), &QItemSelectionModel::selectionChanged, this, &ConnectionWindow::handleConnSelectionChanged);
|
||||
connect(ui->btnNewConn, &QPushButton::clicked, this, &ConnectionWindow::handleNewConn);
|
||||
connect(ui->btnActivateAll, &QPushButton::clicked, this, &ConnectionWindow::handleEnableAll);
|
||||
connect(ui->btnDeactivateAll, &QPushButton::clicked, this, &ConnectionWindow::handleDisableAll);
|
||||
connect(ui->btnRemoveBus, &QPushButton::clicked, this, &ConnectionWindow::handleRemoveConn);
|
||||
}
|
||||
|
||||
ConnectionWindow::~ConnectionWindow()
|
||||
@@ -101,6 +104,7 @@ void ConnectionWindow::handleOKButton()
|
||||
CAN_Bus *bus = connModel->getBus(whichRow);
|
||||
bus->setListenOnly(ui->ckListenOnly->isChecked());
|
||||
bus->setSingleWire(ui->ckSingleWire->isChecked());
|
||||
bus->setEnabled(ui->ckEnabled->isChecked());
|
||||
if (ui->cbSpeed->currentIndex() == 1)
|
||||
{
|
||||
bus->speed = 0;
|
||||
@@ -126,7 +130,7 @@ void ConnectionWindow::handleOKButton()
|
||||
qDebug() << "Setup initial connection object";
|
||||
|
||||
CAN_Bus bus;
|
||||
bus.active = true;
|
||||
bus.active = ui->ckEnabled->isChecked();
|
||||
bus.busNum = serial->getBusBase();
|
||||
bus.connection = serial;
|
||||
bus.listenOnly = ui->ckListenOnly->isChecked();
|
||||
@@ -204,6 +208,7 @@ void ConnectionWindow::handleConnSelectionChanged()
|
||||
ui->cbPort->setCurrentIndex(0);
|
||||
ui->ckListenOnly->setChecked(false);
|
||||
ui->ckSingleWire->setChecked(false);
|
||||
ui->ckEnabled->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -211,13 +216,14 @@ void ConnectionWindow::handleConnSelectionChanged()
|
||||
ui->cbPort->setEnabled(false);
|
||||
ui->rbGVRET->setEnabled(false);
|
||||
ui->rbKvaser->setEnabled(false);
|
||||
ui->rbSocketCAN->setEnabled(false);
|
||||
ui->rbSocketCAN->setEnabled(false);
|
||||
CAN_Bus *bus = connModel->getBus(selIdx);
|
||||
if (bus->connection->getConnTypeName() == "GVRET") ui->rbGVRET->setChecked(true);
|
||||
if (bus->connection->getConnTypeName() == "KVASER") ui->rbKvaser->setChecked(true);
|
||||
if (bus->connection->getConnTypeName() == "SOCKETCAN") ui->rbSocketCAN->setChecked(true);
|
||||
ui->ckListenOnly->setChecked(bus->isListenOnly());
|
||||
ui->ckSingleWire->setChecked(bus->isSingleWire());
|
||||
ui->ckEnabled->setChecked(bus->isActive());
|
||||
int speed = bus->getSpeed();
|
||||
setSpeed(speed);
|
||||
//connModel->refreshView();
|
||||
@@ -337,6 +343,16 @@ void ConnectionWindow::handleRevert()
|
||||
|
||||
}
|
||||
|
||||
void ConnectionWindow::handleEnableAll()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ConnectionWindow::handleDisableAll()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ConnectionWindow::sendFrame(const CANFrame *frame)
|
||||
{
|
||||
CAN_Bus *bus = connModel->getBus(frame->bus);
|
||||
|
||||
@@ -54,6 +54,8 @@ private slots:
|
||||
void handleConnTypeChanged();
|
||||
void handleConnSelectionChanged();
|
||||
void handleRemoveConn();
|
||||
void handleEnableAll();
|
||||
void handleDisableAll();
|
||||
void handleRevert();
|
||||
void handleNewConn();
|
||||
void receiveBusStatus(int bus, int speed, int status);
|
||||
|
||||
+9
-9
@@ -33,19 +33,12 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnNewConn">
|
||||
<property name="text">
|
||||
<string>New Connection</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnBusActivate">
|
||||
<widget class="QPushButton" name="btnNewConn">
|
||||
<property name="text">
|
||||
<string>Activate Selected Connection</string>
|
||||
<string>New Connection</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -152,6 +145,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ckEnabled">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="1,2">
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user