Skip to content
Snippets Groups Projects
Commit 5097c960 authored by Sander de Snoo's avatar Sander de Snoo
Browse files

Data browser live plotting should only check for updates on selected project, setup and sample

parent 3cb9874c
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ All notable changes to core_tools will be documented in this file.
- Added get_idn to Instruments gates, hardware, M3102A.
- Fixed resetting histogram
- Added option to disable live plotting of data browser at startup
- Data browser live plotting now only checks for updates on selected project, setup and sample.
## \[1.4.6] - 2022-10-17
- Improved logfile format
......
......@@ -147,8 +147,18 @@ class query_for_measurement_results:
return query_for_measurement_results._to_measurement_results(res)
@staticmethod
def detect_new_meaurements(n_records=0, remote=False):
statement = "SELECT count(*) from global_measurement_overview;"
def detect_new_meaurements(n_records=0, remote=False,
project=None, set_up=None, sample=None):
statement = "SELECT count(*) from global_measurement_overview "
statement += "WHERE 1=1 "
if sample is not None:
statement += f" and sample = '{sample}' "
if set_up is not None:
statement += f" and set_up = '{set_up}' "
if project is not None:
statement += f" and project = '{project}' "
statement += " ;"
res = query_for_measurement_results._execute(statement, remote)
update = False
......
......@@ -116,8 +116,6 @@ class signale_handler(QtQuick.QQuickView):
self._data_filter.set_up_index,
self._data_filter.sample_index)
_, self.measurement_count = query_for_measurement_results.detect_new_meaurements(self.measurement_count)
self.updating = False
self.timer = QtCore.QTimer()
self.timer.setInterval(500)
......@@ -144,6 +142,11 @@ class signale_handler(QtQuick.QQuickView):
obj = self.win.findChild(QtCore.QObject, "combobox_sample")
obj.setProperty("currentIndex", self._data_filter.sample_index)
_, self.measurement_count = query_for_measurement_results.detect_new_meaurements(
self.measurement_count,
project=self._data_filter.project,
set_up=self._data_filter.set_up,
sample=self._data_filter.sample)
self.update_date_model()
self.update_date_selection(0)
......@@ -176,7 +179,11 @@ class signale_handler(QtQuick.QQuickView):
return
try:
self.updating = True
update, self.measurement_count = query_for_measurement_results.detect_new_meaurements(self.measurement_count)
update, self.measurement_count = query_for_measurement_results.detect_new_meaurements(
self.measurement_count,
project=self._data_filter.project,
set_up=self._data_filter.set_up,
sample=self._data_filter.sample)
if update==True:
self.update_date_model()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment