Added settings for flow control
This commit is contained in:
parent
a5a74d5581
commit
c94afa3986
@ -20,6 +20,7 @@ Sender::Sender(QObject *parent) : QObject(parent)
|
||||
sendTimer->setInterval(settings.value("core/senderinterval", 2).toInt());
|
||||
sendingChecksum = settings.value("core/checksums", 0).toBool();
|
||||
dtr = settings.value("core/dtr", 1).toBool();
|
||||
flowcontrol = settings.value("core/flowcontrol", 0).toInt();
|
||||
|
||||
sendTimer->start();
|
||||
|
||||
@ -125,7 +126,7 @@ void Sender::openPort(QSerialPortInfo i)
|
||||
printer->setDataTerminalReady(dtr);
|
||||
if(!printer->setBaudRate(baudrate))
|
||||
emit baudrateSetFailed(baudrate);
|
||||
//printer->setFlowControl(QSerialPort::HardwareControl);
|
||||
printer->setFlowControl(flowcontrol);
|
||||
}
|
||||
|
||||
readyReceive = true;
|
||||
|
||||
1
sender.h
1
sender.h
@ -27,6 +27,7 @@ protected:
|
||||
unsigned int totalLineNum;
|
||||
unsigned int resendNum;
|
||||
unsigned int baudrate;
|
||||
int flowcontrol;
|
||||
bool paused;
|
||||
bool sending;
|
||||
bool dtr;
|
||||
|
||||
@ -6,9 +6,13 @@ SettingsWindow::SettingsWindow(QWidget *parent) :
|
||||
ui(new Ui::SettingsWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->flowcontrolbox->addItem("No control");
|
||||
ui->flowcontrolbox->addItem("Hardware control");
|
||||
ui->flowcontrolbox->addItem("Software control");
|
||||
|
||||
//bool firstrun = !settings.value("core/firstrun").toBool(); //firstrun is inverted!
|
||||
|
||||
ui->flowcontrolbox->setCurrentIndex(settings.value("core/flowcontrol", 0).toInt());
|
||||
ui->senderbox->setValue(settings.value("core/senderinterval", 2).toInt());
|
||||
ui->echobox->setChecked(settings.value("core/echo", 0).toBool());
|
||||
ui->statusbox->setValue(settings.value("core/statusinterval", 2000).toInt());
|
||||
@ -42,6 +46,7 @@ SettingsWindow::~SettingsWindow()
|
||||
|
||||
void SettingsWindow::on_buttonBox_accepted()
|
||||
{
|
||||
settings.setValue("core/flowcontrol", ui->flowcontrolbox->currentIndex());
|
||||
settings.setValue("core/senderinterval", ui->senderbox->value());
|
||||
settings.setValue("core/statusinterval", ui->statusbox->value());
|
||||
settings.setValue("printer/bedy", ui->bedybox->value());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user