mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-04 14:07:30 +00:00
Working generator mode
This commit is contained in:
parent
b7033a029e
commit
aae01a602e
14 changed files with 172 additions and 39 deletions
|
|
@ -19,7 +19,9 @@ void Generator::updateDevice()
|
|||
// can't updat if not connected
|
||||
return;
|
||||
}
|
||||
auto status = central->getDeviceStatus();
|
||||
// TODO comment in once status is filled with valid values
|
||||
// window->getDevice()->SetManual(status);
|
||||
Protocol::PacketInfo p;
|
||||
p.type = Protocol::PacketType::Generator;
|
||||
p.generator = central->getDeviceStatus();
|
||||
window->getDevice()->SendPacket(p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,10 +42,18 @@ SignalgeneratorWidget::~SignalgeneratorWidget()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
Protocol::ManualControl SignalgeneratorWidget::getDeviceStatus()
|
||||
Protocol::GeneratorSettings SignalgeneratorWidget::getDeviceStatus()
|
||||
{
|
||||
// TODO
|
||||
Protocol::ManualControl s = {};
|
||||
Protocol::GeneratorSettings s = {};
|
||||
s.frequency = ui->frequency->value();
|
||||
s.cdbm_level = ui->levelSpin->value() * 100.0;
|
||||
if(ui->EnablePort1->isChecked()) {
|
||||
s.activePort = 1;
|
||||
} else if(ui->EnablePort2->isChecked()) {
|
||||
s.activePort = 2;
|
||||
} else {
|
||||
s.activePort = 0;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public:
|
|||
explicit SignalgeneratorWidget(QWidget *parent = nullptr);
|
||||
~SignalgeneratorWidget();
|
||||
|
||||
Protocol::ManualControl getDeviceStatus();
|
||||
Protocol::GeneratorSettings getDeviceStatus();
|
||||
|
||||
signals:
|
||||
void SettingsChanged();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue