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
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 ModuleB import ModuleB
|
||||
from ModuleC import ModuleC
|
||||
from ModuleDebug import ModuleDebug
|
||||
|
||||
def list():
|
||||
return [ModuleDebug(),ModuleA()]
|
||||
return [ModuleA(),ModuleB(),ModuleC(),ModuleDebug()]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue