[Pikloops-svn] SF.net SVN: pikloops: [137] prog/trunk/src/mainwidgetpl.cpp
Brought to you by:
dionysos-sf
|
From: <dio...@us...> - 2007-10-11 14:37:27
|
Revision: 137
http://pikloops.svn.sourceforge.net/pikloops/?rev=137&view=rev
Author: dionysos-sf
Date: 2007-10-11 07:37:31 -0700 (Thu, 11 Oct 2007)
Log Message:
-----------
Some cleanup
Modified Paths:
--------------
prog/trunk/src/mainwidgetpl.cpp
Modified: prog/trunk/src/mainwidgetpl.cpp
===================================================================
--- prog/trunk/src/mainwidgetpl.cpp 2007-10-11 14:30:14 UTC (rev 136)
+++ prog/trunk/src/mainwidgetpl.cpp 2007-10-11 14:37:31 UTC (rev 137)
@@ -53,8 +53,9 @@
QHGroupBox *grinput = new QHGroupBox(i18n("Input data") , this) ;
new QLabel(i18n("Frequency (MHz)"), grinput) ;
clock = new QComboBox(grinput) ;
- static const char* items[] = { "1.000000", "2.000000", "4.000000","8.000000", "10.000000", "16.000000",
- "20.000000", "24.000000", "32.000000","40.000000",0};
+ static const char* items[] = { "1.000000", "2.000000", "4.000000", "8.000000",
+ "10.000000", "16.000000", "20.000000", "24.000000",
+ "32.000000", "40.000000", 0};
clock->insertStrList( items );
clock->setEditable(true) ;
clock->setCurrentItem(6) ;
@@ -73,7 +74,7 @@
CodeText->setReadOnly(true);
cycles = new QLabel(statusMessage
- .arg(loopValues->getTimeDelay(),0,'f',8)
+ .arg(loopValues->getTimeDelay(),0,'f',8)
.arg((loopValues->getMachineCycles()),0,'f',0) , groutput ) ;
connect(clock, SIGNAL(activated(const QString &)), this, SLOT(ClockChanged(const QString &)));
@@ -96,7 +97,6 @@
*/
void MainWidgetPL::refreshWidget()
{
-
// set label names
QString routineName = i18n("delay_") ;
routineName += delay->text() ;
@@ -114,15 +114,15 @@
tmpCode += routineName ;
tmpCode += "\n" ;
- if (loopValues->getCounterD()!=-1) {
+ if ( loopValues->getCounterD() != -1 ) {
tmpCode += QString("\tmovlw \tD'%1'\n").arg(loopValues->getCounterD(),0,10);
tmpCode += QString(i18n("\tmovwf \tCounterD\n"));
}
- if (loopValues->getCounterC()!=-1) {
+ if ( loopValues->getCounterC() != -1 ) {
tmpCode += QString("\tmovlw \tD'%1'\n").arg(loopValues->getCounterC(),0,10);
tmpCode += QString(i18n("\tmovwf \tCounterC\n"));
}
- if (loopValues->getCounterB()!=-1) {
+ if ( loopValues->getCounterB() !=-1 ) {
tmpCode += QString("\tmovlw \tD'%1'\n").arg(loopValues->getCounterB(),0,10);
tmpCode += QString(i18n("\tmovwf \tCounterB\n"));
}
@@ -133,17 +133,18 @@
tmpCode += "\n" ;
tmpCode += QString(i18n("\tdecfsz \tCounterA,1\n\tgoto \t%1\n")).arg(loopName);
- if (loopValues->getCounterB()!=-1) {
+ if ( loopValues->getCounterB() != -1 ) {
tmpCode += QString(i18n("\tdecfsz \tCounterB,1\n\tgoto \t%1\n")).arg(loopName);
}
- if (loopValues->getCounterC()!=-1) {
+ if ( loopValues->getCounterC() !=-1 ) {
tmpCode += QString(i18n("\tdecfsz \tCounterC,1\n\tgoto \t%1\n")).arg(loopName);
}
- if (loopValues->getCounterD()!=-1) {
+ if ( loopValues->getCounterD() !=-1 ) {
tmpCode += QString(i18n("\tdecfsz \tCounterD,1\n\tgoto \t%1\n")).arg(loopName);
}
tmpCode += QString("\treturn");
+ tmpCode += "\n" ;
// update status line
cycles->setText(statusMessage.arg(loopValues->getTimeDelay(),0,'f',8)
@@ -160,9 +161,7 @@
void MainWidgetPL::setValues()
{
loopValues->setClockFrequency(clock->currentText().toDouble());
-
loopValues->setTimeDelay(delay->text().toDouble());
-
loopValues->Refresh();
refreshWidget();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|