diff --git a/V203/usb/scope/bin/index.js b/V203/usb/scope/bin/index.js index 795ddf8..b222e12 100644 --- a/V203/usb/scope/bin/index.js +++ b/V203/usb/scope/bin/index.js @@ -58,8 +58,8 @@ function initWebSocket() { return; } DrawTrig (); - DrawPolyLine (0, obj.a, '#FF0000'); - DrawPolyLine (1, obj.b, '#00FF00'); + DrawPolyLine (0, obj.a, '#00FF00'); + DrawPolyLine (1, obj.b, '#FF0000'); }; websocket.onerror = function (evt) { console.log ('ERROR: ' + evt.data); @@ -203,13 +203,6 @@ function Connect () { } else { initWebSocket (); } - /* - DrawTrig (); - const d1 = [10,20,30,40,50]; - const d2 = [3000]; - DrawPolyLine (0, d1, '#FF0000'); - DrawPolyLine (1, d2, '#00FF00'); - */ }; function Start () { SendEvent ({ type : 'start', value : 1 }); diff --git a/V203/usb/scope/server/wsclient.cpp b/V203/usb/scope/server/wsclient.cpp index f4f571c..b510277 100644 --- a/V203/usb/scope/server/wsclient.cpp +++ b/V203/usb/scope/server/wsclient.cpp @@ -14,18 +14,10 @@ using namespace std; using namespace seasocks; static string channels_to_json (const vector & a, const vector & b) { - string res ("{\"a\":["); - for (const int e: a) { - res += to_string(e) + ","; - } - res = res.substr(0, res.length() - 1); - res+= "],\"b\":["; - for (const int e: b) { - res += to_string(e) + ","; - } - res = res.substr(0, res.length() - 1); - res+= "]}"; - return res; + json msg; + msg["a"] = a; + msg["b"] = b; + return to_string(msg); } bool WsClient::start() { cout << "Client Start\n"; diff --git a/V203/usb/scope/software/datasource.cpp b/V203/usb/scope/software/datasource.cpp index 13d284e..3d10f70 100644 --- a/V203/usb/scope/software/datasource.cpp +++ b/V203/usb/scope/software/datasource.cpp @@ -103,7 +103,6 @@ void DataSource::parse_reply(const char * data, const int len) { trigerSettings.rising = as.part.trg.rising; trigerSettings.offset = as.part.trg.offset; trigerSettings.value = as.part.trg.value; - //trigerSettings. = as.part.trg.channel; emit SettingReceived (as); } diff --git a/V203/usb/scope/software/displaywidget.cpp b/V203/usb/scope/software/displaywidget.cpp index b4d3806..1ac0b80 100644 --- a/V203/usb/scope/software/displaywidget.cpp +++ b/V203/usb/scope/software/displaywidget.cpp @@ -182,10 +182,14 @@ void DisplayWidget::reloadMatrix(const QSize & sz) { m_forward = tm; m_inverse = m_forward.inverted(); } -void DisplayWidget::Refresh() { +/* +void DisplayWidget::Refresh(int n) { + m_timeBase = n; + reloadMatrix (size()); drawBackground(); update(); } +*/ void DisplayWidget::TimeBaseRange(int n) { m_timeBase = n; reloadMatrix (size()); diff --git a/V203/usb/scope/software/displaywidget.h b/V203/usb/scope/software/displaywidget.h index 82f03ad..821238b 100644 --- a/V203/usb/scope/software/displaywidget.h +++ b/V203/usb/scope/software/displaywidget.h @@ -39,7 +39,6 @@ class DisplayWidget : public QWidget { void MarkerChanged (bool); void saveSettings (QSettings & setting); void restSettings (QSettings & setting); - void Refresh (); void resizeEvent (QResizeEvent * event) override; void paintEvent (QPaintEvent * event) override; diff --git a/V203/usb/scope/software/mainwindow.cpp b/V203/usb/scope/software/mainwindow.cpp index c811bbf..b2bac4d 100644 --- a/V203/usb/scope/software/mainwindow.cpp +++ b/V203/usb/scope/software/mainwindow.cpp @@ -74,7 +74,7 @@ void MainWindow::SetSelections(AllSettings as) { ui->comboMode ->setCurrentIndex(as.part.trg.mode); ui->comboRissing ->setCurrentIndex(as.part.trg.rising ? 1 : 0); ui->comboTimeRange->setCurrentIndex(as.part.tim); - ui->Display->Refresh(); + ui->Display->TimeBaseRange(as.part.tim); } MainWindow::~MainWindow () {