Compare commits
2 commits
2b0f2ae36e
...
8027708b3e
Author | SHA1 | Date | |
---|---|---|---|
|
8027708b3e | ||
|
59a78498e2 |
3 changed files with 165 additions and 6 deletions
|
@ -13,13 +13,21 @@ Omezení zde je poměrně malá RAM.
|
||||||
|
|
||||||
Ovládací program je napsán v Qt5. Je třeba modul QSerialPort, jinak na tom není nic extra.
|
Ovládací program je napsán v Qt5. Je třeba modul QSerialPort, jinak na tom není nic extra.
|
||||||
Asi by to šlo naportovat i na Windows, ale chce to minimálně změnit název sériového portu.
|
Asi by to šlo naportovat i na Windows, ale chce to minimálně změnit název sériového portu.
|
||||||
|
Ovládání je nepodobné obvyklému GUI osciloskopu, ale pokusy s kulatými knoflíky mě přesvědčili
|
||||||
|
o tom, že je to blbost. Na PC, kde je možné použít myš, je lépe jí fakt použít a GUI se
|
||||||
|
může smrsknout na pár položek (Item to move), kterými se vybere čím se má hýbat a kliknutí
|
||||||
|
myši provede kam. Jemně se to dá dostavit kolečkem myši.
|
||||||
|
|
||||||
|
Rozsahy se vybírají rovněž z Combo Boxu. Počáteční nastavení je fakticky uloženo v hardware,
|
||||||
|
kromě Markerů a ofsetu zobrazení kanálů, to se dá uložit v programu. V zásadě by šlo uložit
|
||||||
|
i ostatní v programu a při startu to zpět zapsat do hardware, ale zatím to tak není.
|
||||||
|
|
||||||
## server
|
## server
|
||||||
|
|
||||||
Zkusil jsem doplnit ovládání přímo z browseru. Použil jsem balíček v Ubuntu (nebo Debian - např. Malina)
|
Zkusil jsem doplnit ovládání přímo z browseru. Použil jsem balíček v Ubuntu (nebo Debian - např. Malina)
|
||||||
nlohmann-json3-dev plus https://github.com/mattgodbolt/seasocks, takže lze komunikovat s klientem
|
nlohmann-json3-dev plus https://github.com/mattgodbolt/seasocks, takže lze komunikovat s klientem
|
||||||
tímto mechanizmem. Vypadá to, že webové sokety by to mohly zvládnout, zatím to není
|
tímto mechanizmem. Vypadá to, že webové sokety by to mohly zvládnout, zatím to není
|
||||||
úplně doděláno, ale zobrazení chodí. Funguje to jen na Linuxu.
|
úplně doděláno, ale zobrazení chodí. Funguje to jen na Linuxu, není to úplné a ani nebude, je to jen pokus.
|
||||||
|
|
||||||
## bin
|
## bin
|
||||||
|
|
||||||
|
|
|
@ -72,10 +72,11 @@ static constexpr double IMULT = 1.0 / FMULT;
|
||||||
void DisplayWidget::wheelEvent(QWheelEvent * event) {
|
void DisplayWidget::wheelEvent(QWheelEvent * event) {
|
||||||
if (m_ts == nullptr) return;
|
if (m_ts == nullptr) return;
|
||||||
const QPoint d = event->angleDelta();
|
const QPoint d = event->angleDelta();
|
||||||
const int increment = d.y() > 0 ? +1 : -1;
|
const double increment = d.y() > 0 ? +1 : -1;
|
||||||
|
const double zy = -m_inverse.m22();
|
||||||
switch (m_items) {
|
switch (m_items) {
|
||||||
case MOVE_VALUE: {
|
case MOVE_VALUE: {
|
||||||
m_ts->value += increment * 4;
|
m_ts->value += uint16_t (increment * zy);
|
||||||
emit SettingsChanged (m_items);
|
emit SettingsChanged (m_items);
|
||||||
} break;
|
} break;
|
||||||
case MOVE_OFSET: {
|
case MOVE_OFSET: {
|
||||||
|
@ -84,11 +85,11 @@ void DisplayWidget::wheelEvent(QWheelEvent * event) {
|
||||||
} break;
|
} break;
|
||||||
case MOVE_MARKERA: {
|
case MOVE_MARKERA: {
|
||||||
if (marker_type == MARKER_TIME) m_time.a += increment;
|
if (marker_type == MARKER_TIME) m_time.a += increment;
|
||||||
else m_volt.a += increment;
|
else m_volt.a += increment * zy;
|
||||||
} break;
|
} break;
|
||||||
case MOVE_MARKERB: {
|
case MOVE_MARKERB: {
|
||||||
if (marker_type == MARKER_TIME) m_time.b += increment;
|
if (marker_type == MARKER_TIME) m_time.b += increment;
|
||||||
else m_volt.b += increment;
|
else m_volt.b += increment * zy;
|
||||||
} break;
|
} break;
|
||||||
case TIME_ZOOM: {
|
case TIME_ZOOM: {
|
||||||
const double mx = FMULT * double (size().width()) / x_lenght;
|
const double mx = FMULT * double (size().width()) / x_lenght;
|
||||||
|
@ -99,8 +100,10 @@ void DisplayWidget::wheelEvent(QWheelEvent * event) {
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case OFSET_A: {
|
case OFSET_A: {
|
||||||
|
m_offset.a += increment * zy;
|
||||||
} break;
|
} break;
|
||||||
case OFSET_B: {
|
case OFSET_B: {
|
||||||
|
m_offset.b += increment * zy;
|
||||||
} break;
|
} break;
|
||||||
default : {
|
default : {
|
||||||
qDebug ("wheelEvent : %d", int (m_items));
|
qDebug ("wheelEvent : %d", int (m_items));
|
||||||
|
|
|
@ -46,6 +46,43 @@
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="ChannelA">
|
<widget class="QGroupBox" name="ChannelA">
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>78</red>
|
||||||
|
<green>154</green>
|
||||||
|
<blue>6</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>78</red>
|
||||||
|
<green>154</green>
|
||||||
|
<blue>6</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>190</red>
|
||||||
|
<green>190</green>
|
||||||
|
<blue>190</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Channel A</string>
|
<string>Channel A</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -76,6 +113,43 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="ChannelB">
|
<widget class="QGroupBox" name="ChannelB">
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>204</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>204</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>190</red>
|
||||||
|
<green>190</green>
|
||||||
|
<blue>190</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Channel B</string>
|
<string>Channel B</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -106,6 +180,43 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupTriger">
|
<widget class="QGroupBox" name="groupTriger">
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>32</red>
|
||||||
|
<green>74</green>
|
||||||
|
<blue>135</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>32</red>
|
||||||
|
<green>74</green>
|
||||||
|
<blue>135</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>190</red>
|
||||||
|
<green>190</green>
|
||||||
|
<blue>190</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Trigger</string>
|
<string>Trigger</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -142,6 +253,43 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBase">
|
<widget class="QGroupBox" name="groupBase">
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="Button">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>252</red>
|
||||||
|
<green>233</green>
|
||||||
|
<blue>79</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="Button">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>252</red>
|
||||||
|
<green>233</green>
|
||||||
|
<blue>79</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="Button">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>252</red>
|
||||||
|
<green>233</green>
|
||||||
|
<blue>79</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Time Base</string>
|
<string>Time Base</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -203,7 +351,7 @@
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>12</x>
|
<x>12</x>
|
||||||
|
|
Loading…
Reference in a new issue