From f5e244a7b28f5f3b3dcc1d385099ef0658198a98 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 16 Apr 2011 13:41:47 +0200 Subject: [PATCH] start working on debug module --- software/main.py | 3 +- software/modules/ModuleA.py | 11 +-- software/modules/ModuleDebug.py | 19 ++-- software/modules/ModuleDebug.ui | 151 +++++++++++++++++++++++++++++++- software/modules/module.py | 9 -- 5 files changed, 166 insertions(+), 27 deletions(-) delete mode 100644 software/modules/module.py diff --git a/software/main.py b/software/main.py index bbea483..7dfd0a8 100644 --- a/software/main.py +++ b/software/main.py @@ -22,7 +22,8 @@ class ModuleButton(QPushButton): self.form.ui.btnExit.hide() self.form.ui.btnBack.show() self.form.ui.lblTitle.setText(self.mod.title) - self.mod.setup(self.form.ui.areaModuleContents) + self.form.ui.areaModule.setWidget(self.mod.widget) + self.form.ui.areaModule.show() class Main(QMainWindow): def __init__(self): diff --git a/software/modules/ModuleA.py b/software/modules/ModuleA.py index 7c0a871..da31c89 100644 --- a/software/modules/ModuleA.py +++ b/software/modules/ModuleA.py @@ -1,11 +1,8 @@ -from module import Module +class ModuleA(): -class ModuleA(Module): - - title = 'Acko' - - def setup(self, area): - print 'setup A' + def __init__(self): + self.title = 'A' + self.widget = None def run(self): print 'run A' diff --git a/software/modules/ModuleDebug.py b/software/modules/ModuleDebug.py index 2c817be..638ae8f 100644 --- a/software/modules/ModuleDebug.py +++ b/software/modules/ModuleDebug.py @@ -1,14 +1,19 @@ -from module import Module +from PyQt4.QtGui import QWidget +from PyQt4.QtCore import pyqtSlot from ModuleDebugUi import Ui_ModuleDebug -class ModuleDebug(Module): +class ModuleDebugWidget(QWidget): - title = 'Debug' - - def setup(self, area): - print 'setup Debug' + def __init__(self): + QWidget.__init__(self) self.ui = Ui_ModuleDebug() - self.ui.setupUi(area) + self.ui.setupUi(self) + +class ModuleDebug(): + + def __init__(self): + self.title = 'Debug' + self.widget = ModuleDebugWidget() def run(self): print 'run Debug' diff --git a/software/modules/ModuleDebug.ui b/software/modules/ModuleDebug.ui index 75fc5a9..0ae5516 100644 --- a/software/modules/ModuleDebug.ui +++ b/software/modules/ModuleDebug.ui @@ -13,15 +13,160 @@ Form - + 10 10 - 761 - 511 + 151 + 21 + + PWM + + + Qt::AlignCenter + + + + + + 10 + 30 + 71 + 71 + + + + 65535 + + + 256 + + + + + + 90 + 30 + 71 + 71 + + + + 65535 + + + 256 + + + + + + 10 + 100 + 71 + 31 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 65535 + + + 0 + + + 5 + + + + + + 90 + 100 + 71 + 31 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 65535 + + + 0 + + + 5 + + + + + + 160 + 10 + 151 + 21 + + + + DDS + + + Qt::AlignCenter + + + + + + 250 + 30 + 71 + 71 + + + + 16777216 + + + 100 + + + + + + 220 + 100 + 101 + 31 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 16777216 + + + 0 + + + 8 + diff --git a/software/modules/module.py b/software/modules/module.py deleted file mode 100644 index 0855a82..0000000 --- a/software/modules/module.py +++ /dev/null @@ -1,9 +0,0 @@ -class Module(): - - title = '' - - def start(self, area): - raise Exception('not implemented') - - def run(self): - raise Exception('not implemented')