From c274bbbac3a3383a05766a72e5b89ee169f13c7c Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Wed, 17 Apr 2019 20:38:54 +0200 Subject: [PATCH 01/21] GroundstationStation Rebuilt --- GUI/gui.py | 5 +++-- config.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ station.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 config.yaml create mode 100644 station.py diff --git a/GUI/gui.py b/GUI/gui.py index 48a3c13..be6bbf0 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -368,10 +368,11 @@ def draw_plot(self, typex, typey, dm): return PlotG(typex, typey, dm) def __del__(self): - + pass + ''' with open('log1a.yml', 'w') as outfile: yaml.dump(self.data, outfile, default_flow_style=False) - + ''' class PlotG: diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..c664fff --- /dev/null +++ b/config.yaml @@ -0,0 +1,40 @@ +baudrate: '115200' +elevation: '1' +file: '' +labels: +- id: elevation + num: 0 + text: 'Start elevation:' +- id: time + num: 9 + text: 'Time:' +- id: rssi + num: 1 + text: 'RSSI:' +- id: positionX + num: 2 + text: 'Pozycja X:' +- id: positionY + num: 3 + text: 'Pozycja Y:' +- id: altitude + num: 4 + text: "Wysoko\u015B\u0107:" +- id: pressure + num: 5 + text: "Ci\u015Bnienie:" +- id: temperature + num: 6 + text: 'Temperatura:' +- id: pm25 + num: 7 + text: 'PM-2,5:' +- id: pm10 + num: 8 + text: 'PM-10:' +port: COM11 +port_num: 3 +positionX: '1' +positionY: '1' +timeout: '1' +version: '1.1' diff --git a/station.py b/station.py new file mode 100644 index 0000000..de5efa2 --- /dev/null +++ b/station.py @@ -0,0 +1,48 @@ +from GUI.gui import * +from Modules.Communication import * +from Modules.EventManager import * +from Modules.Prediction import Predictor +import sys +from PyQt5.QtWidgets import QApplication +import threading +import time +import yaml + +class Configurator: + def __init__(self, file): + self.file = file + try: + with open(file, 'r') as stream: + self.data=yaml.load(stream) + except Exception as e: + print(e) + + def __setitem__(self, key, value): + self.data[key]=value + with open(self.file, 'w') as outfile: + yaml.dump(self.data, outfile, default_flow_style=False) + + def __getitem__(self, key): + return self.data[key] + + def get(self, key): + return self.__getitem__(key) + +structure = [ +{'id': 'elevation', 'text':'Start elevation:' , 'num': 0}, +{'id': 'time', 'text':'Time:' , 'num': 9}, +{'id': 'rssi', 'text':'RSSI:' , 'num': 1}, +{'id':'positionX' , 'text': 'Pozycja X:' , 'num': 2}, +{'id': 'positionY', 'text': 'Pozycja Y:' , 'num': 3}, +{'id':'altitude' , 'text':'Wysokość:' , 'num': 4}, +{'id': 'pressure', 'text':'Ciśnienie:' , 'num': 5}, +{'id': 'temperature', 'text':'Temperatura:' , 'num': 6}, +{'id': 'pm25', 'text':'PM-2,5:' , 'num': 7}, +{'id': 'pm10', 'text':'PM-10:' , 'num': 8} +] + +conf = Configurator('config.yaml') +conf['labels']=structure +app = QApplication(sys.argv) +win = MainWidgetWindow(conf) +app.exec_() From f3f15364521ee3fd765166aa13a253bda696c937 Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Wed, 17 Apr 2019 23:00:59 +0200 Subject: [PATCH 02/21] Add ConfigurationWindow --- GUI/gui.py | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++- station.py | 13 ------------- 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index be6bbf0..7e9d291 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -5,13 +5,62 @@ from PyQt5 import QtWebEngineWidgets, QtCore from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QFrame, QDialog, QApplication, QComboBox, QLabel, QCheckBox, QGridLayout, QFileDialog, -QHBoxLayout, QVBoxLayout, QSplitter, QRadioButton, QButtonGroup) +QHBoxLayout, QVBoxLayout, QSplitter, QRadioButton, QButtonGroup, QTabWidget) import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from random import randint#nie potrzebne +class ConfiguratorWindow(QWidget): + def __init__(self): + super().__init__() + self.initUI() + + def initUI(self): + self.main_grid = QGridLayout() + self.tabs = QTabWidget() + + self.radio_tab = QWidget() + self.parser_tab = QWidget() + self.tabs.addTab(self.radio_tab, 'Radio') + self.tabs.addTab(self.parser_tab, 'Parser') + + #### Radio tab + + self.radio_layout = QGridLayout() + self.r_port_label=QLabel('Port:') + self.r_baudrate_label=QLabel('Baudrate:') + self.r_timeout_label=QLabel('Timeout:') + self.r_baudrate_edit=QLineEdit() + self.r_port_edit=QLineEdit() + self.r_timeout_edit=QLineEdit() + + self.radio_layout.addWidget(self.r_port_label, 1, 0) + self.radio_layout.addWidget(self.r_port_edit, 1, 1) + self.radio_layout.addWidget(self.r_baudrate_label, 2, 0) + self.radio_layout.addWidget(self.r_baudrate_edit, 2, 1) + self.radio_layout.addWidget(self.r_timeout_label, 3, 0) + self.radio_layout.addWidget(self.r_timeout_edit, 3, 1) + + self.radio_tab.setLayout(self.radio_layout) + + + self.main_grid.addWidget(self.tabs, 0, 0) + + self.setLayout(self.main_grid) + + def save(self): + structure={ + 'baudrate':self.r_baudrate_edit.text(), + 'port':self.r_port_edit.text(), + 'timeout':self.r_baudrate_edit.text() + } + + + + + class OpenWindow(QWidget): def __init__(self): super().__init__() @@ -535,3 +584,8 @@ def get_last(self, length): print('ok') ''' + +app=QApplication(sys.argv) +win=ConfiguratorWindow() +win.show() +app.exec_() diff --git a/station.py b/station.py index de5efa2..7e2be1b 100644 --- a/station.py +++ b/station.py @@ -28,19 +28,6 @@ def __getitem__(self, key): def get(self, key): return self.__getitem__(key) -structure = [ -{'id': 'elevation', 'text':'Start elevation:' , 'num': 0}, -{'id': 'time', 'text':'Time:' , 'num': 9}, -{'id': 'rssi', 'text':'RSSI:' , 'num': 1}, -{'id':'positionX' , 'text': 'Pozycja X:' , 'num': 2}, -{'id': 'positionY', 'text': 'Pozycja Y:' , 'num': 3}, -{'id':'altitude' , 'text':'Wysokość:' , 'num': 4}, -{'id': 'pressure', 'text':'Ciśnienie:' , 'num': 5}, -{'id': 'temperature', 'text':'Temperatura:' , 'num': 6}, -{'id': 'pm25', 'text':'PM-2,5:' , 'num': 7}, -{'id': 'pm10', 'text':'PM-10:' , 'num': 8} -] - conf = Configurator('config.yaml') conf['labels']=structure app = QApplication(sys.argv) From 91d0bba30f2e395f9b2002d6db4d2875f595e3a0 Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Thu, 18 Apr 2019 18:12:29 +0200 Subject: [PATCH 03/21] Configuration Update --- GUI/gui.py | 141 +++++++++++++++++++++++++++++---------- Modules/Communication.py | 1 - config.yaml | 7 +- station.py | 34 +++++++++- 4 files changed, 143 insertions(+), 40 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index 7e9d291..7213c90 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -13,9 +13,15 @@ from random import randint#nie potrzebne class ConfiguratorWindow(QWidget): - def __init__(self): + def __init__(self, conf): super().__init__() self.initUI() + self.conf = conf + self.structure={ + 'baudrate':self.r_baudrate_edit, + 'port':self.r_port_edit, + 'timeout':self.r_baudrate_edit + } def initUI(self): self.main_grid = QGridLayout() @@ -30,33 +36,66 @@ def initUI(self): self.radio_layout = QGridLayout() self.r_port_label=QLabel('Port:') + self.r_autoport_label=QLabel('Automatic Port Finder:') self.r_baudrate_label=QLabel('Baudrate:') self.r_timeout_label=QLabel('Timeout:') self.r_baudrate_edit=QLineEdit() self.r_port_edit=QLineEdit() + self.r_autoport_edit=QCheckBox() self.r_timeout_edit=QLineEdit() self.radio_layout.addWidget(self.r_port_label, 1, 0) self.radio_layout.addWidget(self.r_port_edit, 1, 1) - self.radio_layout.addWidget(self.r_baudrate_label, 2, 0) - self.radio_layout.addWidget(self.r_baudrate_edit, 2, 1) - self.radio_layout.addWidget(self.r_timeout_label, 3, 0) - self.radio_layout.addWidget(self.r_timeout_edit, 3, 1) + self.radio_layout.addWidget(self.r_autoport_label, 2, 0) + self.radio_layout.addWidget(self.r_autoport_edit, 2, 1) + self.radio_layout.addWidget(self.r_baudrate_label, 3, 0) + self.radio_layout.addWidget(self.r_baudrate_edit, 3, 1) + self.radio_layout.addWidget(self.r_timeout_label, 4, 0) + self.radio_layout.addWidget(self.r_timeout_edit, 4, 1) self.radio_tab.setLayout(self.radio_layout) - self.main_grid.addWidget(self.tabs, 0, 0) + self.bottom_grid = QGridLayout() + self.save_button = QPushButton('Save') + self.save_button.clicked.connect(self.save) + + self.bottom_grid.addWidget(self.save_button, 0, 3) + self.main_grid.addLayout(self.bottom_grid, 1, 0) + + self.setLayout(self.main_grid) + #print(isinstance(self.r_port_edit, QLineEdit)) sprawdzanie typu def save(self): - structure={ - 'baudrate':self.r_baudrate_edit.text(), - 'port':self.r_port_edit.text(), - 'timeout':self.r_baudrate_edit.text() - } - + new={} + for k,v in self.structure.items(): + if isinstance(v, QLineEdit): + new[k] = v.text() + elif isinstance(v, QComboBox): + new[k] = v.currentText() + elif isinstance(v, QCheckBox): + new[k] = v.checkState() + ### Dodać Obsługę Pliki + + self.conf.update(new) + + def load(self): + for k,v in self.structure.items(): + if k in data: + try: + if isinstance(v, QLineEdit): + v.setText(str(data[k])) + elif isinstance(v, QCheckBox): + v.setChecked(data[k]) + elif isinstance(v, QComboBox): + v.setCurrentText(str(data[k]))#może nie działać + except Exception as e: + print(e) + + + @@ -195,18 +234,21 @@ def btn_load_event(self): class MainWidgetWindow(QWidget): - def __init__(self, conf): + def __init__(self, conf, reader): super().__init__() + self.reader = reader self.dm=DataManager(1000) self.initUI(conf) def initUI(self, conf): self.labels={} self.conf=conf + #### Do wyrzucenia labels=conf['labels'] - labels[0].update({'value': conf.get("elevation") }) #dodawanie value do "elevation" + #labels[0].update({'value': conf.get("elevation") }) #dodawanie value do "elevation" items=['time/rssi','time/positionX','time/positionY','time/temperature','time/pressure','time/altitude','time/pm25','time/pm10'] + ''' self.locationX_label=QLabel('Pozycja X:') self.locationY_label=QLabel('Pozycja Y:') @@ -243,7 +285,7 @@ def initUI(self, conf): self.vertical_splitter.addWidget(self.top_splitter) self.vertical_splitter.addWidget(self.bottom_widget) self.info_grid.setSpacing(10) - + ''' elements=len(labels) if elements%2==0: elements=elements/2 @@ -268,6 +310,7 @@ def initUI(self, conf): frame=QFrame() frame.setFrameShape(QFrame.VLine) self.info_grid.addWidget(frame, 1, 3, elements, 1) + ''' cwd = os.getcwd()+"/maps/map.html" self.webView = QtWebEngineWidgets.QWebEngineView() self.webView.setUrl(QtCore.QUrl(cwd)) #MAPS PATH @@ -290,6 +333,13 @@ def initUI(self, conf): self.option_grid.addWidget(self.new_flight_button, 1, 0) self.option_grid.addWidget(self.center_map_button, 1, 1) + self.load_button=QPushButton('Load Flight', self) + self.load_button.clicked.connect(self.load_flight) + self.configuration_button=QPushButton('Configuration', self) + self.configuration_button.clicked.connect(self.open_configuration) + self.option_grid.addWidget(self.load_button, 2, 0) + self.option_grid.addWidget(self.configuration_button, 2, 1) + self.left_plot_box = QComboBox(self) self.left_plot_box.addItems(items) #dodawanie listy wykresów @@ -304,10 +354,10 @@ def initUI(self, conf): self.left_plot_box_label = QLabel('Left Plot') self.right_plot_box_label = QLabel('Right Plot') - self.option_grid.addWidget(self.left_plot_box_label, 2, 0) - self.option_grid.addWidget(self.left_plot_box, 2, 1) - self.option_grid.addWidget(self.right_plot_box_label, 3, 0) - self.option_grid.addWidget(self.right_plot_box, 3, 1) + self.option_grid.addWidget(self.left_plot_box_label, 3, 0) + self.option_grid.addWidget(self.left_plot_box, 3, 1) + self.option_grid.addWidget(self.right_plot_box_label, 4, 0) + self.option_grid.addWidget(self.right_plot_box, 4, 1) self.time_control = TimeControlWidget(self) self.panel_grid.addWidget(self.time_control, 3, 0) @@ -329,8 +379,18 @@ def initUI(self, conf): self.show() def new_flight(self): + info = copy.deepcopy(self.conf.all()) + info['type'] = 'radio' + self.reader(info, self.update) self.conf['dm'].new_save() + def load_flight(self): + pass + + def open_configuration(self): + self.conf_win=ConfiguratorWindow(self.conf) + self.conf_win.show() + def change_plots(self): @@ -352,24 +412,36 @@ def center_map(self): except Exception as e: print(e) def update(self, datag): - #print('xd') + print('xd') posX=None posY=None rssi=None - data=copy.deepcopy(datag) + + + data=copy.deepcopy(datag)#copy data #print(data) self.dm.add(data) - for d in data: - for l_item, l_value in self.labels.items(): - if l_item == d['id']: - l_value['value'].setText(d['value']) - - if d['id']=='positionX': - posX=d['value'] - if d['id']=='positionY': - posY=d['value'] - if d['id']=='rssi': - rssi=d['value'] + elements=len(data) + if elements%2==0: + elements=elements/2 + else: + elements=(elements+1)/2 + for i in range(0,len(labels)): + if i Date: Thu, 18 Apr 2019 19:51:03 +0200 Subject: [PATCH 04/21] GUI Update --- GUI/gui.py | 19 ++++++++++--------- Modules/Communication.py | 18 ++++++++---------- config.yaml | 4 ++-- station.py | 25 +++++++++++-------------- 4 files changed, 31 insertions(+), 35 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index 7213c90..78f0e09 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -234,17 +234,18 @@ def btn_load_event(self): class MainWidgetWindow(QWidget): - def __init__(self, conf, reader): + def __init__(self, conf, obj): super().__init__() - self.reader = reader - self.dm=DataManager(1000) - self.initUI(conf) + self.reader = obj['reader'] + self.conf = conf + self.obj = obj + self.dm=DataManager(5000) + self.initUI() - def initUI(self, conf): + def initUI(self): self.labels={} - self.conf=conf #### Do wyrzucenia - labels=conf['labels'] + labels=self.conf['labels'] #labels[0].update({'value': conf.get("elevation") }) #dodawanie value do "elevation" items=['time/rssi','time/positionX','time/positionY','time/temperature','time/pressure','time/altitude','time/pm25','time/pm10'] @@ -381,8 +382,8 @@ def initUI(self, conf): def new_flight(self): info = copy.deepcopy(self.conf.all()) info['type'] = 'radio' - self.reader(info, self.update) - self.conf['dm'].new_save() + self.reader(info, self.obj, self.update) + self.obj['dm'].new_save() def load_flight(self): pass diff --git a/Modules/Communication.py b/Modules/Communication.py index 317a8fb..f817deb 100644 --- a/Modules/Communication.py +++ b/Modules/Communication.py @@ -55,17 +55,15 @@ def _raw_data_sever(self, data): def keepReading(self, condition, interval=1, **kwargs): lastLine='RUN' - if not ('second_condition' in kwargs): - second_condition=True while(condition): - if(second_condition): - line=self.radio.readline() - # line=b'80_50.4482155_21.7964096_100.0_28.02_1003.46_8.3_9.2\r\n' - if lastLine!=line and ('call' in kwargs) and line!=None: - self._raw_data_sever(line) - line = self.parser(line, self.structure) - kwargs['call'](line) - lastLine=line + print('xda') + line=self.radio.readline() + # line=b'80_50.4482155_21.7964096_100.0_28.02_1003.46_8.3_9.2\r\n' + if lastLine!=line and ('call' in kwargs) and line!=None: + self._raw_data_sever(line) + line = self.parser(line, self.structure) + kwargs['call'](line) + lastLine=line time.sleep(1) def parser(self, data, structure): diff --git a/config.yaml b/config.yaml index 8845d8e..2c5fab1 100644 --- a/config.yaml +++ b/config.yaml @@ -6,7 +6,7 @@ labels: num: 0 text: 'Start elevation:' value: '1' -- id: time +- id: times num: 9 text: 'Time:' - id: rssi @@ -37,5 +37,5 @@ port: 'COM11' port_num: 3 positionX: '1' positionY: '1' -timeout: '11520' +timeout: '1' version: '1.1' diff --git a/station.py b/station.py index 2227a1d..902abf2 100644 --- a/station.py +++ b/station.py @@ -23,6 +23,7 @@ def __setitem__(self, key, value): self.save() def save(self): + print(self.data) with open(self.file, 'w') as outfile: yaml.dump(self.data, outfile, default_flow_style=False) @@ -37,29 +38,25 @@ def update(self, new): self.save() def all(self): - return self.data + return copy.deepcopy(self.data) def __str__(self): return str(self.data) -def new_reader(info, call): - if info['type'] == 'radio': +def new_reader(conf, obj, call): + if conf['type'] == 'radio': radio={ - 'port':info['port'], - 'baudrate':info['baudrate'], - 'timeout':info['timeout'] + 'port':conf['port'], + 'baudrate':conf['baudrate'], + 'timeout':conf['timeout'] } - dr=DataReader(info['labels'], radio, event_manager = info['em'], rds=info['rds']) + dr=DataReader(conf['labels'], radio, event_manager = obj['em'], rds=obj['rds']) reader = threading.Thread(target=dr.keepReading, args=(True, ), kwargs={'call':call,}) + reader.start() conf = Configurator('config.yaml') dm=DataManager(None) -em=dm.em -rds=dm.ds -print(conf) -conf['dm'] = dm -conf['rds'] = rds -conf['em'] = em +obj={'dm':dm, 'em':dm.em, 'rds':dm.ds, 'reader':new_reader} app = QApplication(sys.argv) -win = MainWidgetWindow(conf, new_reader) +win = MainWidgetWindow(conf, obj) app.exec_() From bcfccb3b41f3e55a864e08f541e6fe5fdf57d92e Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Thu, 18 Apr 2019 21:28:04 +0200 Subject: [PATCH 05/21] Add Prediction Button --- GUI/gui.py | 54 +++++++++++++++++++++++++++++++++++------------------ config.yaml | 3 ++- station.py | 2 +- 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index 78f0e09..bfae03a 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -5,7 +5,7 @@ from PyQt5 import QtWebEngineWidgets, QtCore from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QFrame, QDialog, QApplication, QComboBox, QLabel, QCheckBox, QGridLayout, QFileDialog, -QHBoxLayout, QVBoxLayout, QSplitter, QRadioButton, QButtonGroup, QTabWidget) +QHBoxLayout, QVBoxLayout, QSplitter, QRadioButton, QButtonGroup, QTabWidget, QTableWidget,QTableWidgetItem) import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas @@ -55,6 +55,15 @@ def initUI(self): self.radio_tab.setLayout(self.radio_layout) + ### Parser tab + self.parser_layout = QGridLayout() + self.p_stu = QTableWidget() + + self.p_stu.setRowCount(5) + self.p_stu.setColumnCount(3) + + self.parser_tab.setLayout(self.parser_layout) + self.main_grid.addWidget(self.tabs, 0, 0) self.bottom_grid = QGridLayout() @@ -65,6 +74,7 @@ def initUI(self): self.main_grid.addLayout(self.bottom_grid, 1, 0) + self.setLayout(self.main_grid) #print(isinstance(self.r_port_edit, QLineEdit)) sprawdzanie typu @@ -341,6 +351,10 @@ def initUI(self): self.option_grid.addWidget(self.load_button, 2, 0) self.option_grid.addWidget(self.configuration_button, 2, 1) + self.prediction_button=QPushButton('Prediction', self) + self.prediction_button.clicked.connect(self.change_prediction_state) + self.option_grid.addWidget(self.prediction_button, 3, 1) + self.left_plot_box = QComboBox(self) self.left_plot_box.addItems(items) #dodawanie listy wykresów @@ -355,10 +369,10 @@ def initUI(self): self.left_plot_box_label = QLabel('Left Plot') self.right_plot_box_label = QLabel('Right Plot') - self.option_grid.addWidget(self.left_plot_box_label, 3, 0) - self.option_grid.addWidget(self.left_plot_box, 3, 1) - self.option_grid.addWidget(self.right_plot_box_label, 4, 0) - self.option_grid.addWidget(self.right_plot_box, 4, 1) + self.option_grid.addWidget(self.left_plot_box_label, 4, 0) + self.option_grid.addWidget(self.left_plot_box, 4, 1) + self.option_grid.addWidget(self.right_plot_box_label, 5, 0) + self.option_grid.addWidget(self.right_plot_box, 5, 1) self.time_control = TimeControlWidget(self) self.panel_grid.addWidget(self.time_control, 3, 0) @@ -388,6 +402,9 @@ def new_flight(self): def load_flight(self): pass + def change_prediction_state(self): + self.conf['prediction'] = not self.conf['prediction'] + def open_configuration(self): self.conf_win=ConfiguratorWindow(self.conf) self.conf_win.show() @@ -451,19 +468,20 @@ def update(self, datag): self.right_plot.update() except Exception as e: print('Graf nie działa!!!'+str(e)) - try: - predicts_num=50 - if(len(self.dm.get_by_id('positionX', predicts_num))==predicts_num): - pred=self.conf['predictor'].predict([ - self.dm.get_by_id('positionX', predicts_num), - self.dm.get_by_id('positionY', predicts_num), - self.dm.get_by_id('altitude', predicts_num)], float(self.conf.get("elevation"))) #nowe zmiana stałej 202 na stałą ustalaną podczas startu programu w gui.py - try: - self.webView.page().runJavaScript('drawPrediction('+str(pred['x'])+', '+str(pred['y'])+', '+str(pred['r'])+')') - except Exception as e: - print(e) - except Exception as e: - print(e) + if self.conf['prediction']==True: + try: + predicts_num=50 + if(len(self.dm.get_by_id('positionX', predicts_num))==predicts_num): + pred=self.conf['predictor'].predict([ + self.dm.get_by_id('positionX', predicts_num), + self.dm.get_by_id('positionY', predicts_num), + self.dm.get_by_id('altitude', predicts_num)], float(self.conf.get("elevation"))) #nowe zmiana stałej 202 na stałą ustalaną podczas startu programu w gui.py + try: + self.webView.page().runJavaScript('drawPrediction('+str(pred['x'])+', '+str(pred['y'])+', '+str(pred['r'])+')') + except Exception as e: + print(e) + except Exception as e: + print(e) def map_functions(self): #self.webView.page().runJavaScript('addPoint(50.05925, 19.92293, 13, "aaa")') diff --git a/config.yaml b/config.yaml index 2c5fab1..6b49b39 100644 --- a/config.yaml +++ b/config.yaml @@ -33,9 +33,10 @@ labels: - id: pm10 num: 8 text: 'PM-10:' -port: 'COM11' +port: COM11 port_num: 3 positionX: '1' positionY: '1' +prediction: false timeout: '1' version: '1.1' diff --git a/station.py b/station.py index 902abf2..f68c74a 100644 --- a/station.py +++ b/station.py @@ -23,7 +23,7 @@ def __setitem__(self, key, value): self.save() def save(self): - print(self.data) + #print(self.data) with open(self.file, 'w') as outfile: yaml.dump(self.data, outfile, default_flow_style=False) From cd0d33bfbd56f2bf600d75d5a6d31db638b45a9c Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Thu, 18 Apr 2019 23:25:38 +0200 Subject: [PATCH 06/21] Parser Configuration Update --- GUI/gui.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index bfae03a..18b3852 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -5,7 +5,8 @@ from PyQt5 import QtWebEngineWidgets, QtCore from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QFrame, QDialog, QApplication, QComboBox, QLabel, QCheckBox, QGridLayout, QFileDialog, -QHBoxLayout, QVBoxLayout, QSplitter, QRadioButton, QButtonGroup, QTabWidget, QTableWidget,QTableWidgetItem) +QHBoxLayout, QVBoxLayout, QSplitter, QRadioButton, QButtonGroup, QTabWidget, + QTableWidget, QTableWidgetItem, QAbstractScrollArea, QHeaderView) import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas @@ -20,7 +21,7 @@ def __init__(self, conf): self.structure={ 'baudrate':self.r_baudrate_edit, 'port':self.r_port_edit, - 'timeout':self.r_baudrate_edit + 'timeout':self.r_timeout_edit } def initUI(self): @@ -31,6 +32,7 @@ def initUI(self): self.parser_tab = QWidget() self.tabs.addTab(self.radio_tab, 'Radio') self.tabs.addTab(self.parser_tab, 'Parser') + self.setFixedSize(600, 400) #### Radio tab @@ -61,6 +63,10 @@ def initUI(self): self.p_stu.setRowCount(5) self.p_stu.setColumnCount(3) + self.p_stu.setHorizontalHeaderLabels(['ID', 'Name', 'Number']) + self.p_stu.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch) + + self.parser_layout.addWidget(self.p_stu, 1, 0) self.parser_tab.setLayout(self.parser_layout) @@ -76,6 +82,7 @@ def initUI(self): self.setLayout(self.main_grid) + #print(isinstance(self.r_port_edit, QLineEdit)) sprawdzanie typu def save(self): @@ -92,6 +99,7 @@ def save(self): self.conf.update(new) def load(self): + data = self.conf.all() for k,v in self.structure.items(): if k in data: try: @@ -103,9 +111,23 @@ def load(self): v.setCurrentText(str(data[k]))#może nie działać except Exception as e: print(e) + self.load_structure() + def load_structure(self): + labels = self.conf.all()['labels'] + self.p_stu.setRowCount(len(labels)) + counter=0 + for i in labels: + self.p_stu.setItem(counter, 0, QTableWidgetItem(i['id'])) + self.p_stu.setItem(counter, 1, QTableWidgetItem(i['text'])) + self.p_stu.setItem(counter, 2, QTableWidgetItem(str(i['num']))) + counter+=1 + def show(self): + self.load() + super().show() + @@ -404,6 +426,10 @@ def load_flight(self): def change_prediction_state(self): self.conf['prediction'] = not self.conf['prediction'] + if self.conf['prediction']: + self.prediction_button.setStyleSheet("background-color: green") + else: + self.prediction_button.setStyleSheet("background-color: red") def open_configuration(self): self.conf_win=ConfiguratorWindow(self.conf) From e9dcc5cd66ee88d3c11c3095997e37d64e0c27dd Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Fri, 19 Apr 2019 21:36:22 +0200 Subject: [PATCH 07/21] Comunication Update (new Threading) --- GUI/gui.py | 47 ++++++++++++++++----------- Modules/Communication.py | 70 ++++++++++++++++++++++++++++++++++------ config.yaml | 4 +-- station.py | 8 ++++- 4 files changed, 98 insertions(+), 31 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index 18b3852..df619f7 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -82,6 +82,7 @@ def initUI(self): self.setLayout(self.main_grid) + self.setWindowTitle('Configuration') #print(isinstance(self.r_port_edit, QLineEdit)) sprawdzanie typu @@ -268,7 +269,7 @@ def btn_load_event(self): class MainWidgetWindow(QWidget): def __init__(self, conf, obj): super().__init__() - self.reader = obj['reader'] + #self.reader = obj['reader'] self.conf = conf self.obj = obj self.dm=DataManager(5000) @@ -411,6 +412,11 @@ def initUI(self): self.top_splitter.splitterMoved.connect(self.resize_map) self.input_grid=QGridLayout() + self.qtimer = QtCore.QTimer() + self.qtimer.setInterval(5) + self.qtimer.timeout.connect(self.update) + + self.setGeometry(300, 300, 590, 350) self.setWindowTitle('SobieskiSat') self.show() @@ -418,8 +424,12 @@ def initUI(self): def new_flight(self): info = copy.deepcopy(self.conf.all()) info['type'] = 'radio' - self.reader(info, self.obj, self.update) - self.obj['dm'].new_save() + #self.reader(info, self.obj, self.update) + print(self.obj) + self.obj['type']='Radio' + #self.obj['dm'].new_save() + self.obj['dc'].new_radio() + self.qtimer.start() def load_flight(self): pass @@ -455,36 +465,35 @@ def center_map(self): self.webView.page().runJavaScript('centerMap('+posX+', '+posY+')') except Exception as e: print(e) - def update(self, datag): - print('xd') + def update(self): posX=None posY=None rssi=None - - - data=copy.deepcopy(datag)#copy data - #print(data) + data = self.obj['dc'].get() + data=copy.deepcopy(data)#copy data self.dm.add(data) elements=len(data) + if elements%2==0: elements=elements/2 else: elements=(elements+1)/2 - for i in range(0,len(labels)): + for i in range(0,len(data)): if i 0 is ignored by parser ) + + self._dataCounter+=1 + #print(st) + return st + + + def call(self, data): + print(data) + self.data = data + + def get(self): + print('ger') + return self.data + + class DataReader: @@ -56,7 +107,6 @@ def _raw_data_sever(self, data): def keepReading(self, condition, interval=1, **kwargs): lastLine='RUN' while(condition): - print('xda') line=self.radio.readline() # line=b'80_50.4482155_21.7964096_100.0_28.02_1003.46_8.3_9.2\r\n' if lastLine!=line and ('call' in kwargs) and line!=None: @@ -64,12 +114,12 @@ def keepReading(self, condition, interval=1, **kwargs): line = self.parser(line, self.structure) kwargs['call'](line) lastLine=line - time.sleep(1) + time.sleep(0.2) def parser(self, data, structure): st = self.structure data=str(data[:-2])[2:-1] - #print(data) + print(len(st)==data.count('_')) if(len(st)==data.count('_')+3): #check if data is OK, THERE MUST BE 2 data = data.split("_") data.append(str(self.dataCounter)) diff --git a/config.yaml b/config.yaml index 6b49b39..a142ba5 100644 --- a/config.yaml +++ b/config.yaml @@ -6,7 +6,7 @@ labels: num: 0 text: 'Start elevation:' value: '1' -- id: times +- id: time num: 9 text: 'Time:' - id: rssi @@ -37,6 +37,6 @@ port: COM11 port_num: 3 positionX: '1' positionY: '1' -prediction: false +prediction: FSalse timeout: '1' version: '1.1' diff --git a/station.py b/station.py index f68c74a..7909d9a 100644 --- a/station.py +++ b/station.py @@ -56,7 +56,13 @@ def new_reader(conf, obj, call): conf = Configurator('config.yaml') dm=DataManager(None) -obj={'dm':dm, 'em':dm.em, 'rds':dm.ds, 'reader':new_reader} +obj={'dm':dm, 'em':dm.em, 'rds':dm.ds, 'reader':new_reader, 'type':None} +dc = DataCreator(conf, obj) +obj['dc']=dc + +reader = threading.Thread(target=dc.loop) +reader.start() + app = QApplication(sys.argv) win = MainWidgetWindow(conf, obj) app.exec_() From cf7228456c9e653ca3c3ce21a79d62ada8848f99 Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Fri, 19 Apr 2019 22:53:12 +0200 Subject: [PATCH 08/21] GUI Live Data Fix --- GUI/gui.py | 47 +++++++++++++++++++++++++--------------- Modules/Communication.py | 28 ++++++++++++------------ config.yaml | 2 +- 3 files changed, 44 insertions(+), 33 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index df619f7..f5602c5 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -310,7 +310,7 @@ def initUI(self): self.panel_grid.addLayout(self.info_grid, 1, 0) self.panel_grid.addLayout(self.option_grid, 2, 0) self.info_widget.setLayout(self.panel_grid) - + self.info_grid_structure = {} self.top_splitter=QSplitter(QtCore.Qt.Horizontal) self.top_splitter.addWidget(self.info_widget) @@ -413,7 +413,7 @@ def initUI(self): self.input_grid=QGridLayout() self.qtimer = QtCore.QTimer() - self.qtimer.setInterval(5) + self.qtimer.setInterval(100) self.qtimer.timeout.connect(self.update) @@ -425,7 +425,6 @@ def new_flight(self): info = copy.deepcopy(self.conf.all()) info['type'] = 'radio' #self.reader(info, self.obj, self.update) - print(self.obj) self.obj['type']='Radio' #self.obj['dm'].new_save() self.obj['dc'].new_radio() @@ -465,6 +464,7 @@ def center_map(self): self.webView.page().runJavaScript('centerMap('+posX+', '+posY+')') except Exception as e: print(e) + def update(self): posX=None posY=None @@ -473,22 +473,33 @@ def update(self): data=copy.deepcopy(data)#copy data self.dm.add(data) elements=len(data) - - if elements%2==0: - elements=elements/2 - else: - elements=(elements+1)/2 - for i in range(0,len(data)): - if i 0 is ignored by parser ) self._dataCounter+=1 - #print(st) return st def call(self, data): - print(data) self.data = data def get(self): - print('ger') return self.data @@ -119,7 +119,7 @@ def keepReading(self, condition, interval=1, **kwargs): def parser(self, data, structure): st = self.structure data=str(data[:-2])[2:-1] - print(len(st)==data.count('_')) + #print(len(st)==data.count('_')) if(len(st)==data.count('_')+3): #check if data is OK, THERE MUST BE 2 data = data.split("_") data.append(str(self.dataCounter)) diff --git a/config.yaml b/config.yaml index a142ba5..5bdfb5c 100644 --- a/config.yaml +++ b/config.yaml @@ -37,6 +37,6 @@ port: COM11 port_num: 3 positionX: '1' positionY: '1' -prediction: FSalse +prediction: true timeout: '1' version: '1.1' From 8b38c63e924d58983c0ef719ccf50873b70f17d0 Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Fri, 19 Apr 2019 23:34:18 +0200 Subject: [PATCH 09/21] Map Fix --- GUI/gui.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index f5602c5..1a19b69 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -473,10 +473,12 @@ def update(self): data=copy.deepcopy(data)#copy data self.dm.add(data) elements=len(data) + self.parsed_data={} #print(data) for d in data: if d['id'] in self.info_grid_structure.keys(): self.info_grid_structure[ d['id']].setText(d['value']) + self.parsed_data[d['id']] = d['value'] else: self.info_grid_structure={} #print(self.info_grid_structure) @@ -505,10 +507,13 @@ def update(self): #frame=QFrame() #frame.setFrameShape(QFrame.VLine) #self.info_grid.addWidget(frame, 1, 3, elements, 1) - - if posX!=None and posY!=None: - self.map_add_point(posX, posY, rssi, str(data)) - #print(' try plot') + try: + self.map_add_point(self.parsed_data['positionX'], + self.parsed_data['positionY'], + self.parsed_data['rssi'], str(self.parsed_data)) + #print(' try plot') + except Exception as e: + print(e) try: self.left_plot.update() self.right_plot.update() From 396cc991a73e7e93752df024315c5cba693258e1 Mon Sep 17 00:00:00 2001 From: TheRootOf3 Date: Fri, 19 Apr 2019 23:58:59 +0200 Subject: [PATCH 10/21] minor fixes --- GUI/gui.py | 8 ++++---- config.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index 1a19b69..7d20581 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -98,7 +98,7 @@ def save(self): ### Dodać Obsługę Pliki self.conf.update(new) - + self.close() def load(self): data = self.conf.all() for k,v in self.structure.items(): @@ -353,8 +353,8 @@ def initUI(self): #self.webView.page.run #page().runJavaScript("[map.getBounds().getSouthWest().lat, map.getBounds().getSouthWest().lng, map.getBounds().getNorthEast().lat, map.getBounds().getNorthEast().lng]") self.top_grid.addWidget(self.webView, 1,1) - self.left_plot=self.draw_plot('time', 'altitude', self.dm) - self.right_plot=self.draw_plot('time', 'pressure', self.dm) + self.left_plot=self.draw_plot('time', 'rssi', self.dm) + self.right_plot=self.draw_plot('time', 'rssi', self.dm) self.bottom_grid.addWidget(self.left_plot.get_widget(), 1,0) self.bottom_grid.addWidget(self.right_plot.get_widget(), 1,1) self.webView.loadFinished.connect(self.webView_loaded_event) @@ -413,7 +413,7 @@ def initUI(self): self.input_grid=QGridLayout() self.qtimer = QtCore.QTimer() - self.qtimer.setInterval(100) + self.qtimer.setInterval(200) #IMPORTANT Update interval self.qtimer.timeout.connect(self.update) diff --git a/config.yaml b/config.yaml index 5bdfb5c..ed01ef3 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -baudrate: '11520' +baudrate: '115200' elevation: '1' file: '' labels: From e84542ad5d0bf468832de78cc468ba7edfc3979d Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Sat, 20 Apr 2019 00:00:13 +0200 Subject: [PATCH 11/21] Delete DataManager --- Modules/Communication.py | 86 ---------------------------------------- 1 file changed, 86 deletions(-) diff --git a/Modules/Communication.py b/Modules/Communication.py index cc8ae0b..b42eccd 100644 --- a/Modules/Communication.py +++ b/Modules/Communication.py @@ -68,83 +68,6 @@ def get(self): return self.data - - -class DataReader: - def __init__(self, structure, radio, **kwargs): - self.kwargs = kwargs - self.dataCounter=0 - self.structure = structure #structure of data received from satellite - for s in self.structure: #check if every stucture has all attributes - for p in ['id', 'text', 'num']: - if not(p in s): - raise Exception('Not found "'+p+'" in "'+str(s)+'" structures') - - for p in ['baudrate', 'port', 'timeout']:#check if radio has all attributes - if not( p in radio): - raise Exception('Not found "'+p+'" in "'+str(radio)+'" radio') - try: #open _log_manager - self._log_manager('open_DataReader:open_log_manager', structure=structure, radio=radio, kwargs=kwargs) - except Exception: - raise Exception('Failed opening _log_manager in DataReader') - try: #open radio - self._log_manager('open_radio', radio=radio) - self.radio = Radio(radio['baudrate'], radio['port'], radio['timeout'], event_manager = self._log_manager) - except Exception: - #self._log_manager('open_radio:exception', radio=radio) - pass - - self._log_manager('open_DataReader:done')# log everything is OK - - def _log_manager(self, action, **kwargs): - if('event_manager' in self.kwargs): - self.kwargs['event_manager'](self, action, kwargs=kwargs) - - def _raw_data_sever(self, data): - if('rds' in self.kwargs): - self.kwargs['rds'](data) - - def keepReading(self, condition, interval=1, **kwargs): - lastLine='RUN' - while(condition): - line=self.radio.readline() - # line=b'80_50.4482155_21.7964096_100.0_28.02_1003.46_8.3_9.2\r\n' - if lastLine!=line and ('call' in kwargs) and line!=None: - self._raw_data_sever(line) - line = self.parser(line, self.structure) - kwargs['call'](line) - lastLine=line - time.sleep(0.2) - - def parser(self, data, structure): - st = self.structure - data=str(data[:-2])[2:-1] - #print(len(st)==data.count('_')) - if(len(st)==data.count('_')+3): #check if data is OK, THERE MUST BE 2 - data = data.split("_") - data.append(str(self.dataCounter)) - for s in st: - if s['num']!=0: - s['value']=data[s['num']-1]#set value of every structure (plus 1 => 0 is ignored by parser ) - - self.dataCounter+=1 - #print(st) - return st - - #checksum --- to be added - ''' - def __del__(self): - with open('log.yml', 'w') as outfile: - yaml.dump(self., outfile, default_flow_style=False) - ''' - - - - - - - - class Radio: def __init__(self, baudrate = 115200, port='COM9', timeout=1, **kwargs): self.kwargs = kwargs @@ -171,15 +94,6 @@ def _log_manager(self, action, **kwargs): if('event_manager' in self.kwargs): self.kwargs['event_manager'](action, kwargs=kwargs) - def keepReading(self, condition, interval=1, **kwargs): - self.lines=[] - self.lines.append('Opening:') - while(condition): - time.sleep(interval) - if self.lines[-1]!=line and 'call' in kwargs and line!=None: - line = self.parser(line) - kwargs['call'](line) - self.lines.append(line) def _set_dict_argument(self, list, id_key, id_value, value_key, value): for d in list: From 19b62b5104920426e8cd0cc125d327624edbf265 Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Sat, 20 Apr 2019 00:49:58 +0200 Subject: [PATCH 12/21] Plot Update --- GUI/gui.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/GUI/gui.py b/GUI/gui.py index 7d20581..fe43f8d 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -2,6 +2,7 @@ import yaml import copy import os +import numpy as np from PyQt5 import QtWebEngineWidgets, QtCore from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QFrame, QDialog, QApplication, QComboBox, QLabel, QCheckBox, QGridLayout, QFileDialog, @@ -66,6 +67,11 @@ def initUI(self): self.p_stu.setHorizontalHeaderLabels(['ID', 'Name', 'Number']) self.p_stu.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch) + self.p_add_button = QPushButton('Add') + self.p_add_button.clicked.connect(self.p_add) + #self.p_add + + self.parser_layout.addWidget(self.p_stu, 1, 0) self.parser_tab.setLayout(self.parser_layout) @@ -85,6 +91,8 @@ def initUI(self): self.setWindowTitle('Configuration') #print(isinstance(self.r_port_edit, QLineEdit)) sprawdzanie typu + def p_add(self): + pass def save(self): new={} @@ -574,6 +582,8 @@ def __init__(self, lx, ly, dm): self.fig = plt.Figure()#main figure self.canvas=FigureCanvas(self.fig) self.sp=self.fig.add_subplot(1,1,1) + self.avsp =self.fig.add_subplot(1,1,1) + self.length=100 self.lx=lx#list of x param @@ -597,6 +607,7 @@ def update(self):#updates plot on call tab2=self.dm.get_by_id(self.lx, self.length) self.sp.plot(tab2, tab) #self.sp.plot(self.make_data(self.ly, data), self.make_data(self.lx, data)) + self.avsp.plot(tab2, [np.mean(tab) for i in tab]) self.canvas.draw() #print('xdddd') From aff8e1ed06b71630a4fd8bc284627ace4354216e Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Sat, 20 Apr 2019 22:09:59 +0200 Subject: [PATCH 13/21] Prediction Fix --- GUI/gui.py | 15 +++++++++------ station.py | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index fe43f8d..b729574 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -385,6 +385,7 @@ def initUI(self): self.prediction_button=QPushButton('Prediction', self) self.prediction_button.clicked.connect(self.change_prediction_state) self.option_grid.addWidget(self.prediction_button, 3, 1) + self.change_prediction_state() self.left_plot_box = QComboBox(self) self.left_plot_box.addItems(items) #dodawanie listy wykresów @@ -442,8 +443,10 @@ def load_flight(self): pass def change_prediction_state(self): - self.conf['prediction'] = not self.conf['prediction'] - if self.conf['prediction']: + if 'prediction' not in self.obj: + self.obj['prediction'] = True + self.obj['prediction'] = not self.obj['prediction'] + if self.obj['prediction']: self.prediction_button.setStyleSheet("background-color: green") else: self.prediction_button.setStyleSheet("background-color: red") @@ -527,12 +530,12 @@ def update(self): self.right_plot.update() except Exception as e: print('Graf nie działa!!!'+str(e)) - ''' - if self.conf['prediction']==True: + + if self.obj['prediction']==True: try: predicts_num=50 if(len(self.dm.get_by_id('positionX', predicts_num))==predicts_num): - pred=self.conf['predictor'].predict([ + pred=self.obj['predictor'].predict([ self.dm.get_by_id('positionX', predicts_num), self.dm.get_by_id('positionY', predicts_num), self.dm.get_by_id('altitude', predicts_num)], float(self.conf.get("elevation"))) #nowe zmiana stałej 202 na stałą ustalaną podczas startu programu w gui.py @@ -542,7 +545,7 @@ def update(self): print(e) except Exception as e: print(e) - ''' + super().update() def map_functions(self): #self.webView.page().runJavaScript('addPoint(50.05925, 19.92293, 13, "aaa")') diff --git a/station.py b/station.py index 7909d9a..3f64f76 100644 --- a/station.py +++ b/station.py @@ -59,6 +59,7 @@ def new_reader(conf, obj, call): obj={'dm':dm, 'em':dm.em, 'rds':dm.ds, 'reader':new_reader, 'type':None} dc = DataCreator(conf, obj) obj['dc']=dc +obj['predictor'] = Predictor() reader = threading.Thread(target=dc.loop) reader.start() From 4f01eb9fb50daf10d52eeea992f63df6222867fb Mon Sep 17 00:00:00 2001 From: TheRootOf3 Date: Sun, 21 Apr 2019 00:05:27 +0200 Subject: [PATCH 14/21] added plot points --- GUI/gui.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GUI/gui.py b/GUI/gui.py index b729574..3f9e686 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -42,6 +42,7 @@ def initUI(self): self.r_autoport_label=QLabel('Automatic Port Finder:') self.r_baudrate_label=QLabel('Baudrate:') self.r_timeout_label=QLabel('Timeout:') + self.r_baudrate_edit=QLineEdit() self.r_port_edit=QLineEdit() self.r_autoport_edit=QCheckBox() @@ -608,6 +609,7 @@ def update(self):#updates plot on call self.sp.clear() tab=self.dm.get_by_id(self.ly, self.length) tab2=self.dm.get_by_id(self.lx, self.length) + self.sp.scatter(tab2, tab) self.sp.plot(tab2, tab) #self.sp.plot(self.make_data(self.ly, data), self.make_data(self.lx, data)) self.avsp.plot(tab2, [np.mean(tab) for i in tab]) From 0f5b70f3988eded9add40ab290c582059fd0d41c Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Sun, 21 Apr 2019 00:31:56 +0200 Subject: [PATCH 15/21] Parser Structure Configuration Update --- GUI/gui.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index b729574..a3f5eb2 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -67,12 +67,18 @@ def initUI(self): self.p_stu.setHorizontalHeaderLabels(['ID', 'Name', 'Number']) self.p_stu.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch) + self.p_tab_control_grid = QGridLayout() self.p_add_button = QPushButton('Add') self.p_add_button.clicked.connect(self.p_add) - #self.p_add + self.p_tab_control_grid.addWidget(self.p_add_button, 0,0) + self.p_remove_button = QPushButton('Remove') + self.p_remove_button.clicked.connect(self.p_remove) + self.p_tab_control_grid.addWidget(self.p_remove_button, 0,1) self.parser_layout.addWidget(self.p_stu, 1, 0) + self.parser_layout.addLayout(self.p_tab_control_grid, 2, 0) + self.parser_tab.setLayout(self.parser_layout) @@ -92,7 +98,10 @@ def initUI(self): #print(isinstance(self.r_port_edit, QLineEdit)) sprawdzanie typu def p_add(self): - pass + self.p_stu.insertRow(self.p_stu.currentRow()+1) + + def p_remove(self): + self.p_stu.removeRow(self.p_stu.currentRow()) def save(self): new={} @@ -104,9 +113,11 @@ def save(self): elif isinstance(v, QCheckBox): new[k] = v.checkState() ### Dodać Obsługę Pliki + self.p_save_structure() self.conf.update(new) self.close() + def load(self): data = self.conf.all() for k,v in self.structure.items(): @@ -132,6 +143,15 @@ def load_structure(self): self.p_stu.setItem(counter, 2, QTableWidgetItem(str(i['num']))) counter+=1 + def p_save_structure(self): + stru = [] + for r in range(0, self.p_stu.rowCount()): + id = self.p_stu.item(r, 0).text() + name = self.p_stu.item(r, 1).text() + num = self.p_stu.item(r, 2).text() + stru.append({'id':id, 'num':int(num), 'text':name}) + self.conf['labels']=stru + def show(self): self.load() @@ -608,6 +628,7 @@ def update(self):#updates plot on call self.sp.clear() tab=self.dm.get_by_id(self.ly, self.length) tab2=self.dm.get_by_id(self.lx, self.length) + self.sp.scatter(tab2, tab) self.sp.plot(tab2, tab) #self.sp.plot(self.make_data(self.ly, data), self.make_data(self.lx, data)) self.avsp.plot(tab2, [np.mean(tab) for i in tab]) From ffcfd5c60e65e0be5fdb5e86ef45fc3b628050fa Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Sun, 21 Apr 2019 16:54:09 +0200 Subject: [PATCH 16/21] Elevation Structure Fix --- GUI/gui.py | 2 ++ Modules/Communication.py | 2 +- config.yaml | 7 ++----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index 52ae34e..9b4b17c 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -502,6 +502,8 @@ def update(self): posY=None rssi=None data = self.obj['dc'].get() + data.append({'id':'Elevation', 'num':0, + 'text':'Elevation: ', 'value':str(self.conf['elevation'])})#add elevation data=copy.deepcopy(data)#copy data self.dm.add(data) elements=len(data) diff --git a/Modules/Communication.py b/Modules/Communication.py index b42eccd..1354b21 100644 --- a/Modules/Communication.py +++ b/Modules/Communication.py @@ -50,7 +50,7 @@ def parser(self, data): st = copy.deepcopy(self.conf['labels']) data=str(data[:-2])[2:-1] #print(len(st)==data.count('_')) - if(len(st)==data.count('_')+3): #check if data is OK, THERE MUST BE 3 + if(len(st)==data.count('_')+2): #check if data is OK, THERE MUST BE 3 data = data.split("_") data.append(str(self._dataCounter)) for s in st: diff --git a/config.yaml b/config.yaml index ed01ef3..48d8b2c 100644 --- a/config.yaml +++ b/config.yaml @@ -1,11 +1,7 @@ -baudrate: '115200' +baudrate: '11520' elevation: '1' file: '' labels: -- id: elevation - num: 0 - text: 'Start elevation:' - value: '1' - id: time num: 9 text: 'Time:' @@ -34,6 +30,7 @@ labels: num: 8 text: 'PM-10:' port: COM11 +elevation: 1 port_num: 3 positionX: '1' positionY: '1' From e36d9b2963cc7f0163663f3785464bab5861d155 Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Sun, 21 Apr 2019 22:53:22 +0200 Subject: [PATCH 17/21] Port Config Update --- GUI/gui.py | 22 ++++++++++++++++++---- Modules/Communication.py | 2 +- station.py | 3 ++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index 9b4b17c..eacdecb 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -15,16 +15,18 @@ from random import randint#nie potrzebne class ConfiguratorWindow(QWidget): - def __init__(self, conf): + def __init__(self, conf, obj): super().__init__() - self.initUI() self.conf = conf + self.obj = obj + self.initUI() self.structure={ 'baudrate':self.r_baudrate_edit, 'port':self.r_port_edit, 'timeout':self.r_timeout_edit } + def initUI(self): self.main_grid = QGridLayout() self.tabs = QTabWidget() @@ -44,7 +46,8 @@ def initUI(self): self.r_timeout_label=QLabel('Timeout:') self.r_baudrate_edit=QLineEdit() - self.r_port_edit=QLineEdit() + self.r_port_edit=QComboBox() + self.r_load_ports() self.r_autoport_edit=QCheckBox() self.r_timeout_edit=QLineEdit() @@ -121,6 +124,7 @@ def save(self): def load(self): data = self.conf.all() + for k,v in self.structure.items(): if k in data: try: @@ -134,6 +138,16 @@ def load(self): print(e) self.load_structure() + def r_load_ports(self): + sl = self.obj['sl'] + dev = sl.all_serials() + names = [] + for d in dev: + names.append(d.device) + self.r_port_edit.addItems(names) + if self.conf['port'] in names: + self.r_port_edit.setCurrentText(self.conf['port']) + def load_structure(self): labels = self.conf.all()['labels'] self.p_stu.setRowCount(len(labels)) @@ -473,7 +487,7 @@ def change_prediction_state(self): self.prediction_button.setStyleSheet("background-color: red") def open_configuration(self): - self.conf_win=ConfiguratorWindow(self.conf) + self.conf_win=ConfiguratorWindow(self.conf, self.obj) self.conf_win.show() def change_plots(self): diff --git a/Modules/Communication.py b/Modules/Communication.py index 1354b21..5f630f3 100644 --- a/Modules/Communication.py +++ b/Modules/Communication.py @@ -50,7 +50,7 @@ def parser(self, data): st = copy.deepcopy(self.conf['labels']) data=str(data[:-2])[2:-1] #print(len(st)==data.count('_')) - if(len(st)==data.count('_')+2): #check if data is OK, THERE MUST BE 3 + if(len(st)==data.count('_')+2): #check if data is OK, THERE MUST BE 2 data = data.split("_") data.append(str(self._dataCounter)) for s in st: diff --git a/station.py b/station.py index 3f64f76..d317c05 100644 --- a/station.py +++ b/station.py @@ -56,7 +56,8 @@ def new_reader(conf, obj, call): conf = Configurator('config.yaml') dm=DataManager(None) -obj={'dm':dm, 'em':dm.em, 'rds':dm.ds, 'reader':new_reader, 'type':None} +obj={'dm':dm, 'em':dm.em, 'rds':dm.ds, 'reader':new_reader, + 'type':None, 'sl':SerialLoader()} dc = DataCreator(conf, obj) obj['dc']=dc obj['predictor'] = Predictor() From 6e31ad030cb3ef89abdeca5fc86e7cf48a2a7efb Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Sun, 21 Apr 2019 23:34:09 +0200 Subject: [PATCH 18/21] DataSaver Fix --- Modules/Communication.py | 1 + Modules/EventManager.py | 13 +++++++------ config.yaml | 4 ++-- station.py | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Modules/Communication.py b/Modules/Communication.py index 5f630f3..80cf03c 100644 --- a/Modules/Communication.py +++ b/Modules/Communication.py @@ -31,6 +31,7 @@ def run_radio(self): line=self.radio.readline() #self._raw_data_sever(line) if line!=None: + self.obj['rds'].write(line) line = self.parser(line) self.call(line) except Exception as e: diff --git a/Modules/EventManager.py b/Modules/EventManager.py index 5ec405b..ea79406 100644 --- a/Modules/EventManager.py +++ b/Modules/EventManager.py @@ -56,15 +56,16 @@ def __del__(self): pass class DataManager: - def __init__(self, path): - self.path='' - if path!=None: - self.path=path - self.prefix='/saves' - self.path+=self.prefix + def __init__(self, conf): + self.conf = conf self.new_save() def new_save(self): + self.path='' + if self.conf['save_path']!=None: + self.path=self.conf['save_path'] + self.prefix='/saves' + self.path+=self.prefix num=0 while(os.path.isdir(self.path+'/'+str(num))): num+=1 diff --git a/config.yaml b/config.yaml index 48d8b2c..bf80434 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,5 @@ baudrate: '11520' -elevation: '1' +elevation: 1 file: '' labels: - id: time @@ -30,10 +30,10 @@ labels: num: 8 text: 'PM-10:' port: COM11 -elevation: 1 port_num: 3 positionX: '1' positionY: '1' prediction: true +save_path: 'D:\Projekty\Programowanide\CanSat\Logi' timeout: '1' version: '1.1' diff --git a/station.py b/station.py index d317c05..02c8d21 100644 --- a/station.py +++ b/station.py @@ -55,7 +55,7 @@ def new_reader(conf, obj, call): reader.start() conf = Configurator('config.yaml') -dm=DataManager(None) +dm=DataManager(conf) obj={'dm':dm, 'em':dm.em, 'rds':dm.ds, 'reader':new_reader, 'type':None, 'sl':SerialLoader()} dc = DataCreator(conf, obj) From 07c56c10f62c549b6829f1a243b9bc6e6d1840b1 Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Mon, 22 Apr 2019 00:43:16 +0200 Subject: [PATCH 19/21] Altitude from Pressure --- GUI/gui.py | 47 +++++++++++++++++++++++++++++++++++++++++++++-- config.yaml | 11 ++++++++--- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index eacdecb..66bf908 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -23,7 +23,11 @@ def __init__(self, conf, obj): self.structure={ 'baudrate':self.r_baudrate_edit, 'port':self.r_port_edit, - 'timeout':self.r_timeout_edit + 'timeout':self.r_timeout_edit, + 'elevation':self.g_elevation_label, + 'pressure':self.g_pressure_label, + 'multi_prediction':self.g_multi_prediction_edit + } @@ -33,8 +37,10 @@ def initUI(self): self.radio_tab = QWidget() self.parser_tab = QWidget() + self.general_tab = QWidget() self.tabs.addTab(self.radio_tab, 'Radio') self.tabs.addTab(self.parser_tab, 'Parser') + self.tabs.addTab(self.general_tab, 'General') self.setFixedSize(600, 400) #### Radio tab @@ -86,6 +92,34 @@ def initUI(self): self.parser_tab.setLayout(self.parser_layout) + ### General tab + self.general_layout = QGridLayout() + self.g_elevation_label=QLabel('Elevation:') + self.g_pressure_label=QLabel('Pressure:') + self.g_multi_prediction_label=QLabel('Multipoint Prediction:') + self.g_save_path_label=QLabel('Set Save Path:') + self.g_current_path_label=QLabel('Current Path:') + self.g_current_path__label_label=QLabel('-') + + self.g_elevation_edit=QLineEdit() + self.g_pressure_edit=QLineEdit() + self.g_multi_prediction_edit=QCheckBox() + self.g_save_path_label=QPushButton() + + self.general_layout.addWidget(self.g_elevation_label, 1, 0) + self.general_layout.addWidget(self.g_elevation_edit, 1, 1) + self.general_layout.addWidget(self.g_pressure_label, 2, 0) + self.general_layout.addWidget(self.g_pressure_edit, 2, 1) + self.general_layout.addWidget(self.g_multi_prediction_label, 3, 0) + self.general_layout.addWidget(self.g_multi_prediction_edit, 3, 1) + self.general_layout.addWidget(self.g_save_path_label, 4, 0) + self.general_layout.addWidget(self.g_save_path_label, 4, 1) + self.general_layout.addWidget(self.g_save_path_label, 5, 0) + self.general_layout.addWidget(self.g_current_path__label_label, 5, 1) + + self.general_tab.setLayout(self.general_layout) + ### Finish + self.main_grid.addWidget(self.tabs, 0, 0) self.bottom_grid = QGridLayout() @@ -522,11 +556,20 @@ def update(self): self.dm.add(data) elements=len(data) self.parsed_data={} + #print(data) + + for d in data: + self.parsed_data[d['id']] = d['value'] + try: + altitude_p = 44330*(1 - np.power(float(self.parsed_data['pressure'])/float(self.conf['pressure']), 0.1903)) + data.append({'id':'altitude_p', 'num':0,'text':'Altitude f. Pressure: ', 'value':str(round(altitude_p,2))}) + except Exception as e: + pass + for d in data: if d['id'] in self.info_grid_structure.keys(): self.info_grid_structure[ d['id']].setText(d['value']) - self.parsed_data[d['id']] = d['value'] else: self.info_grid_structure={} #print(self.info_grid_structure) diff --git a/config.yaml b/config.yaml index bf80434..91beb98 100644 --- a/config.yaml +++ b/config.yaml @@ -18,10 +18,10 @@ labels: num: 4 text: "Wysoko\u015B\u0107:" - id: pressure - num: 5 + num: 6 text: "Ci\u015Bnienie:" - id: temperature - num: 6 + num: 5 text: 'Temperatura:' - id: pm25 num: 7 @@ -29,11 +29,16 @@ labels: - id: pm10 num: 8 text: 'PM-10:' +multi_prediction: !!python/object/apply:sip._unpickle_enum +- PyQt5.QtCore +- CheckState +- 0 port: COM11 port_num: 3 positionX: '1' positionY: '1' prediction: true -save_path: 'D:\Projekty\Programowanide\CanSat\Logi' +pressure: '1013' +save_path: D:\Projekty\Programowanide\CanSat\Logi timeout: '1' version: '1.1' From cff049a46dcbf6c1ea71ce1abc24a532f9d16e23 Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Mon, 22 Apr 2019 01:29:07 +0200 Subject: [PATCH 20/21] Configuration Fix --- GUI/gui.py | 21 +++++++++++++-------- config.yaml | 8 ++------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index 66bf908..40dd26e 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -24,9 +24,8 @@ def __init__(self, conf, obj): 'baudrate':self.r_baudrate_edit, 'port':self.r_port_edit, 'timeout':self.r_timeout_edit, - 'elevation':self.g_elevation_label, - 'pressure':self.g_pressure_label, - 'multi_prediction':self.g_multi_prediction_edit + 'elevation':self.g_elevation_edit, + 'pressure':self.g_pressure_edit } @@ -104,7 +103,8 @@ def initUI(self): self.g_elevation_edit=QLineEdit() self.g_pressure_edit=QLineEdit() self.g_multi_prediction_edit=QCheckBox() - self.g_save_path_label=QPushButton() + self.g_save_path_edit=QPushButton('Wybierz') + self.g_save_path_edit.clicked.connect(self.r_file_dialog) self.general_layout.addWidget(self.g_elevation_label, 1, 0) self.general_layout.addWidget(self.g_elevation_edit, 1, 1) @@ -113,8 +113,8 @@ def initUI(self): self.general_layout.addWidget(self.g_multi_prediction_label, 3, 0) self.general_layout.addWidget(self.g_multi_prediction_edit, 3, 1) self.general_layout.addWidget(self.g_save_path_label, 4, 0) - self.general_layout.addWidget(self.g_save_path_label, 4, 1) - self.general_layout.addWidget(self.g_save_path_label, 5, 0) + self.general_layout.addWidget(self.g_save_path_edit, 4, 1) + self.general_layout.addWidget(self.g_current_path_label, 5, 0) self.general_layout.addWidget(self.g_current_path__label_label, 5, 1) self.general_tab.setLayout(self.general_layout) @@ -129,8 +129,6 @@ def initUI(self): self.bottom_grid.addWidget(self.save_button, 0, 3) self.main_grid.addLayout(self.bottom_grid, 1, 0) - - self.setLayout(self.main_grid) self.setWindowTitle('Configuration') @@ -141,6 +139,12 @@ def p_add(self): def p_remove(self): self.p_stu.removeRow(self.p_stu.currentRow()) + def r_file_dialog(self): + file_name = QFileDialog.getExistingDirectory(self, 'Select', '/home') + if file_name: + self.conf['save_path']=file_name + + def save(self): new={} for k,v in self.structure.items(): @@ -164,6 +168,7 @@ def load(self): try: if isinstance(v, QLineEdit): v.setText(str(data[k])) + print(k) elif isinstance(v, QCheckBox): v.setChecked(data[k]) elif isinstance(v, QComboBox): diff --git a/config.yaml b/config.yaml index 91beb98..fd87c93 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,5 @@ baudrate: '11520' -elevation: 1 +elevation: '1' file: '' labels: - id: time @@ -29,16 +29,12 @@ labels: - id: pm10 num: 8 text: 'PM-10:' -multi_prediction: !!python/object/apply:sip._unpickle_enum -- PyQt5.QtCore -- CheckState -- 0 port: COM11 port_num: 3 positionX: '1' positionY: '1' prediction: true pressure: '1013' -save_path: D:\Projekty\Programowanide\CanSat\Logi +save_path: D:/inne timeout: '1' version: '1.1' From 4371c7cc69e7ca545fed861646fe728417926432 Mon Sep 17 00:00:00 2001 From: Maciej Gamrot Date: Mon, 22 Apr 2019 14:46:43 +0200 Subject: [PATCH 21/21] File Config Update --- GUI/gui.py | 25 +++++++++++++++---------- config.yaml | 6 +++--- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/GUI/gui.py b/GUI/gui.py index 40dd26e..e6b1dd3 100644 --- a/GUI/gui.py +++ b/GUI/gui.py @@ -7,7 +7,7 @@ from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QFrame, QDialog, QApplication, QComboBox, QLabel, QCheckBox, QGridLayout, QFileDialog, QHBoxLayout, QVBoxLayout, QSplitter, QRadioButton, QButtonGroup, QTabWidget, - QTableWidget, QTableWidgetItem, QAbstractScrollArea, QHeaderView) + QTableWidget, QTableWidgetItem, QAbstractScrollArea, QHeaderView, QMessageBox) import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas @@ -25,8 +25,8 @@ def __init__(self, conf, obj): 'port':self.r_port_edit, 'timeout':self.r_timeout_edit, 'elevation':self.g_elevation_edit, - 'pressure':self.g_pressure_edit - + 'pressure':self.g_pressure_edit, + 'save_path':self.g_current_path_label } @@ -97,8 +97,8 @@ def initUI(self): self.g_pressure_label=QLabel('Pressure:') self.g_multi_prediction_label=QLabel('Multipoint Prediction:') self.g_save_path_label=QLabel('Set Save Path:') - self.g_current_path_label=QLabel('Current Path:') - self.g_current_path__label_label=QLabel('-') + self.g_current_path_label_label=QLabel('Current Path:') + self.g_current_path_label=QLabel('-') self.g_elevation_edit=QLineEdit() self.g_pressure_edit=QLineEdit() @@ -114,8 +114,8 @@ def initUI(self): self.general_layout.addWidget(self.g_multi_prediction_edit, 3, 1) self.general_layout.addWidget(self.g_save_path_label, 4, 0) self.general_layout.addWidget(self.g_save_path_edit, 4, 1) - self.general_layout.addWidget(self.g_current_path_label, 5, 0) - self.general_layout.addWidget(self.g_current_path__label_label, 5, 1) + self.general_layout.addWidget(self.g_current_path_label_label, 5, 0) + self.general_layout.addWidget(self.g_current_path_label, 5, 1) self.general_tab.setLayout(self.general_layout) ### Finish @@ -137,12 +137,16 @@ def p_add(self): self.p_stu.insertRow(self.p_stu.currentRow()+1) def p_remove(self): - self.p_stu.removeRow(self.p_stu.currentRow()) + buttonReply = QMessageBox.question(self, 'Remove?', 'Do you want to remove '+str(self.p_stu.currentRow()+1)+' row?', + QMessageBox.Yes | QMessageBox.No, QMessageBox.No) + if buttonReply == QMessageBox.Yes: + self.p_stu.removeRow(self.p_stu.currentRow()) def r_file_dialog(self): file_name = QFileDialog.getExistingDirectory(self, 'Select', '/home') if file_name: self.conf['save_path']=file_name + self.load() def save(self): @@ -168,11 +172,12 @@ def load(self): try: if isinstance(v, QLineEdit): v.setText(str(data[k])) - print(k) elif isinstance(v, QCheckBox): v.setChecked(data[k]) elif isinstance(v, QComboBox): v.setCurrentText(str(data[k]))#może nie działać + elif isinstance(v, QLabel): + v.setText(str(data[k])) except Exception as e: print(e) self.load_structure() @@ -362,7 +367,7 @@ def initUI(self): #### Do wyrzucenia labels=self.conf['labels'] #labels[0].update({'value': conf.get("elevation") }) #dodawanie value do "elevation" - items=['time/rssi','time/positionX','time/positionY','time/temperature','time/pressure','time/altitude','time/pm25','time/pm10'] + items=['time/rssi','time/positionX','time/positionY','time/temperature','time/pressure','time/altitude','time/pm25','time/pm10','time/altitude_p'] ''' diff --git a/config.yaml b/config.yaml index fd87c93..2cbff2e 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -baudrate: '11520' +baudrate: '115200' elevation: '1' file: '' labels: @@ -34,7 +34,7 @@ port_num: 3 positionX: '1' positionY: '1' prediction: true -pressure: '1013' -save_path: D:/inne +pressure: '1013.25' +save_path: D:/saves timeout: '1' version: '1.1'