mirror of
https://github.com/brmlab/edubrm.git
synced 2025-06-08 12:53:59 +02:00
added dummy modules B and C
This commit is contained in:
parent
1665de3ea7
commit
5401986edd
10 changed files with 130 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
all: edubrm mainUi.py resources_rc.py modules/ModuleAUi.py modules/ModuleDebugUi.py
|
all: edubrm mainUi.py resources_rc.py modules/ModuleAUi.py modules/ModuleBUi.py modules/ModuleCUi.py modules/ModuleDebugUi.py
|
||||||
|
|
||||||
mainUi.py: main.ui
|
mainUi.py: main.ui
|
||||||
pyuic4 $< -o $@
|
pyuic4 $< -o $@
|
||||||
|
|
|
@ -18,6 +18,8 @@ class ModuleButton(QPushButton):
|
||||||
self.clicked.connect(self.on_clicked)
|
self.clicked.connect(self.on_clicked)
|
||||||
|
|
||||||
def on_clicked(self):
|
def on_clicked(self):
|
||||||
|
# reinit because of the widget
|
||||||
|
self.mod.__init__()
|
||||||
self.form.ui.areaChoose.hide()
|
self.form.ui.areaChoose.hide()
|
||||||
self.form.ui.btnExit.hide()
|
self.form.ui.btnExit.hide()
|
||||||
self.form.ui.btnBack.show()
|
self.form.ui.btnBack.show()
|
||||||
|
@ -44,7 +46,6 @@ class Main(QMainWindow):
|
||||||
def on_btnBack_clicked(self):
|
def on_btnBack_clicked(self):
|
||||||
self.mod.stop()
|
self.mod.stop()
|
||||||
self.ui.lblTitle.setText('EduBRM')
|
self.ui.lblTitle.setText('EduBRM')
|
||||||
# TODO: erase everything from self.ui.areaModule
|
|
||||||
self.ui.areaChoose.show()
|
self.ui.areaChoose.show()
|
||||||
self.ui.areaModule.hide()
|
self.ui.areaModule.hide()
|
||||||
self.ui.btnExit.show()
|
self.ui.btnExit.show()
|
||||||
|
|
BIN
software/modules/ModuleB.png
Normal file
BIN
software/modules/ModuleB.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
37
software/modules/ModuleB.py
Normal file
37
software/modules/ModuleB.py
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
from PyQt4.QtGui import QWidget
|
||||||
|
from PyQt4.QtCore import pyqtSlot
|
||||||
|
from PyQt4.QtCore import SIGNAL
|
||||||
|
from PyQt4.QtCore import QObject
|
||||||
|
from PyQt4.QtCore import QTimer
|
||||||
|
from ModuleBUi import Ui_ModuleB
|
||||||
|
from device import Device
|
||||||
|
|
||||||
|
class ModuleBWidget(QWidget):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
QWidget.__init__(self)
|
||||||
|
self.ui = Ui_ModuleB()
|
||||||
|
self.ui.setupUi(self)
|
||||||
|
|
||||||
|
self.timer = QTimer()
|
||||||
|
QObject.connect(self.timer, SIGNAL("timeout()"), self.read_inputs)
|
||||||
|
|
||||||
|
def read_inputs(self):
|
||||||
|
pass
|
||||||
|
# r = self.dev.read()
|
||||||
|
# v = r[0]/1023.0 * 3.3
|
||||||
|
# self.ui.labelV.setText('{:0.3f} V'.format(v))
|
||||||
|
# self.ui.progressV.setValue(1000*v)
|
||||||
|
|
||||||
|
class ModuleB():
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.title = 'Simple DC circuit'
|
||||||
|
self.widget = ModuleBWidget()
|
||||||
|
|
||||||
|
def start(self):
|
||||||
|
self.widget.dev = Device()
|
||||||
|
self.widget.timer.start(50)
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
self.widget.timer.stop()
|
29
software/modules/ModuleB.ui
Normal file
29
software/modules/ModuleB.ui
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ModuleB</class>
|
||||||
|
<widget class="QWidget" name="ModuleB">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>781</width>
|
||||||
|
<height>531</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="widgetImg" native="true">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>761</width>
|
||||||
|
<height>511</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
BIN
software/modules/ModuleC.png
Normal file
BIN
software/modules/ModuleC.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 502 B |
37
software/modules/ModuleC.py
Normal file
37
software/modules/ModuleC.py
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
from PyQt4.QtGui import QWidget
|
||||||
|
from PyQt4.QtCore import pyqtSlot
|
||||||
|
from PyQt4.QtCore import SIGNAL
|
||||||
|
from PyQt4.QtCore import QObject
|
||||||
|
from PyQt4.QtCore import QTimer
|
||||||
|
from ModuleCUi import Ui_ModuleC
|
||||||
|
from device import Device
|
||||||
|
|
||||||
|
class ModuleCWidget(QWidget):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
QWidget.__init__(self)
|
||||||
|
self.ui = Ui_ModuleC()
|
||||||
|
self.ui.setupUi(self)
|
||||||
|
|
||||||
|
self.timer = QTimer()
|
||||||
|
QObject.connect(self.timer, SIGNAL("timeout()"), self.read_inputs)
|
||||||
|
|
||||||
|
def read_inputs(self):
|
||||||
|
pass
|
||||||
|
# r = self.dev.read()
|
||||||
|
# v = r[0]/1023.0 * 3.3
|
||||||
|
# self.ui.labelV.setText('{:0.3f} V'.format(v))
|
||||||
|
# self.ui.progressV.setValue(1000*v)
|
||||||
|
|
||||||
|
class ModuleC():
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.title = 'L/C/LC circuit'
|
||||||
|
self.widget = ModuleCWidget()
|
||||||
|
|
||||||
|
def start(self):
|
||||||
|
self.widget.dev = Device()
|
||||||
|
self.widget.timer.start(50)
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
self.widget.timer.stop()
|
19
software/modules/ModuleC.ui
Normal file
19
software/modules/ModuleC.ui
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ModuleC</class>
|
||||||
|
<widget class="QWidget" name="ModuleC">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>781</width>
|
||||||
|
<height>531</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -1,5 +1,7 @@
|
||||||
from ModuleA import ModuleA
|
from ModuleA import ModuleA
|
||||||
|
from ModuleB import ModuleB
|
||||||
|
from ModuleC import ModuleC
|
||||||
from ModuleDebug import ModuleDebug
|
from ModuleDebug import ModuleDebug
|
||||||
|
|
||||||
def list():
|
def list():
|
||||||
return [ModuleDebug(),ModuleA()]
|
return [ModuleA(),ModuleB(),ModuleC(),ModuleDebug()]
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
<file>about.png</file>
|
<file>about.png</file>
|
||||||
<file>icon.png</file>
|
<file>icon.png</file>
|
||||||
<file>modules/ModuleA.png</file>
|
<file>modules/ModuleA.png</file>
|
||||||
|
<file>modules/ModuleB.png</file>
|
||||||
|
<file>modules/ModuleC.png</file>
|
||||||
<file>modules/ModuleDebug.png</file>
|
<file>modules/ModuleDebug.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue