Overload of the QWizardPage isComplete method.
"""
if self.pageContent.cpuList.currentRow() != -1:
+ self.pageContent.frequencyLabel.setVisible(True)
+ self.pageContent.frequencySpinBox.setVisible(True)
infos = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))
for key, value in infos.items():
if type(CPU_DEF[key]) == list:
infos[key] = qvariant_converter.getString(value)
self.setProjectInfo("CPU_INFOS", infos)
self.setProjectInfo("CPU_NAME", unicode(self.pageContent.cpuList.currentItem().text()))
+ self.setProjectInfo("SELECTED_FREQ", unicode(long(self.pageContent.frequencySpinBox.value())))
return True
else:
return False
self.pageContent.cpuList.setSortingEnabled(True)
self.pageContent.descriptionLabel.setVisible(False)
self.pageContent.descriptionLabel.setText("")
+ self.pageContent.frequencyLabel.setVisible(False)
+ self.pageContent.frequencySpinBox.setVisible(False)
def connectSignals(self):
"""
Overload of the BWizardPage connectSignals method.
"""
self.connect(self.pageContent.cpuList, SIGNAL("itemSelectionChanged()"), self.rowChanged)
+ self.connect(self.pageContent.frequencySpinBox, SIGNAL("valueChanged(double)"), self.freqChanged)
def reloadData(self):
"""
"""
description = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))["CPU_DESC"]
description = qvariant_converter.getStringList(description)
+ frequency = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))["CPU_DEFAULT_FREQ"]
+ frequency = qvariant_converter.getString(frequency)
+ frequency = frequency.replace("U", "").replace("L", "")
self.pageContent.descriptionLabel.setText("<br>".join(description))
self.pageContent.descriptionLabel.setVisible(True)
+ self.pageContent.frequencySpinBox.setValue(long(frequency))
+ self.emit(SIGNAL("completeChanged()"))
+
+ def freqChanged(self):
self.emit(SIGNAL("completeChanged()"))
####
mk_data["$pname"] = os.path.basename(project_info.info("PROJECT_PATH"))
mk_data["$cpuflag"] = project_info.info("CPU_INFOS")["CPU_FLAG_NAME"]
mk_data["$cpuname"] = project_info.info("CPU_INFOS")["CORE_CPU"]
+ mk_data["$cpuclockfreq"] = project_info.info("SELECTED_FREQ")
mk_data["$cflags"] = " ".join(project_info.info("CPU_INFOS")["C_FLAGS"])
mk_data["$ldflags"] = " ".join(project_info.info("CPU_INFOS")["LD_FLAGS"])
mk_data["$cppflags"] = " ".join(project_info.info("CPU_INFOS")["CPP_FLAGS"])
"C_SRC": [],
"SUPPORTED_DRV" : [],
"PC_SRC" : [],
- "CPU_DESC" : []
+ "CPU_DESC" : [],
+ "CPU_DEFAULT_FREQ": "1"
}
TOOLCHAIN_ITEMS = ("ld", "as")
$pname_CFLAGS = $cflags
$pname_LDFLAGS = $ldflags
-$pname_CPPFLAGS = -D'CPU_FREQ=($cpuclockfreq)' $cppflags
+$pname_CPPFLAGS = -D'CPU_FREQ=($cpuclockfreqUL)' $cppflags
$pname_CPPAFLAGS = $cppaflags
$pname_CXXFLAGS = $cxxflags
$pname_ASFLAGS = $asflags
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>Form</class>
- <widget class="QWidget" name="Form" >
- <property name="geometry" >
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>406</width>
- <height>243</height>
+ <width>460</width>
+ <height>378</height>
</rect>
</property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QListWidget" name="cpuList" />
+ <widget class="QListWidget" name="cpuList"/>
</item>
<item>
- <widget class="QLabel" name="descriptionLabel" >
- <property name="text" >
+ <widget class="QLabel" name="descriptionLabel">
+ <property name="text">
<string/>
</property>
</widget>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="frequencyLabel">
+ <property name="text">
+ <string>CPU frequency</string>
+ </property>
+ <property name="buddy">
+ <cstring>frequencySpinBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDoubleSpinBox" name="frequencySpinBox">
+ <property name="suffix">
+ <string>Hz</string>
+ </property>
+ <property name="decimals">
+ <number>0</number>
+ </property>
+ <property name="minimum">
+ <double>1.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>1000000000.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>1000.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<resources/>