Skip to content

Commit

Permalink
General engine variable config and actual decoder offset config now i…
Browse files Browse the repository at this point in the history
…n QML wizards
  • Loading branch information
malcom2073 committed Jan 2, 2014
1 parent c3706b2 commit 9792239
Show file tree
Hide file tree
Showing 6 changed files with 684 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/core.pro
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,6 @@ OTHER_FILES += \
README.md \
wizards/BenchTest.qml \
wizards/DecoderOffset.qml \
wizards/wizard.qml
wizards/wizard.qml \
wizards/EngineConfig.qml \
wizards/ActualDecoderOffset.qml
54 changes: 54 additions & 0 deletions core/menuconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,60 @@
"offset" : "99",
"calc" : [ ],
"locationid" : "0xC003"
},
{
"name" : "perCylinderVolume",
"type" : "value",
"sizeofelement":"2",
"size" : "1",
"offset" : "0",
"calc" : [ { "type":"div","value":"65536.0"},{"type":"mult","value":"2000.0"} ],
"locationid" : "0xC000"
},
{
"name" : "injectorFlow",
"type" : "value",
"sizeofelement":"2",
"size" : "1",
"offset" : "2",
"calc" : [ { "type":"div","value":"65536.0"},{"type":"mult","value":"3840"} ],
"locationid" : "0xC000"
},
{
"name" : "InjectionRPMDisableThreshold",
"type" : "value",
"sizeofelement":"2",
"size" : "1",
"offset" : "0",
"calc" : [ { "type":"div","value":"2.0"} ],
"locationid" : "0xC004"
},
{
"name" : "InjectionRPMEnableThreshold",
"type" : "value",
"sizeofelement":"2",
"size" : "1",
"offset" : "2",
"calc" : [ { "type":"div","value":"2.0"} ],
"locationid" : "0xC004"
},
{
"name" : "IgnitionRPMDisableThreshold",
"type" : "value",
"sizeofelement":"2",
"size" : "1",
"offset" : "4",
"calc" : [ { "type":"div","value":"2.0"} ],
"locationid" : "0xC004"
},
{
"name" : "IgnitionRPMEnableThreshold",
"type" : "value",
"sizeofelement":"2",
"size" : "1",
"offset" : "6",
"calc" : [ { "type":"div","value":"2.0"} ],
"locationid" : "0xC004"
}
]
}
2 changes: 1 addition & 1 deletion core/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ void MainWindow::loadWizards(QString dir)
}
view->setFile(emsComms,wizards.absoluteFilePath(file));
view->passConfig(m_memoryMetaData->configMetaData());
view->setGeometry(0,0,800,600);
//view->setGeometry(0,0,800,600);
QAction *action = new QAction(this);
action->setText(file.mid(0,file.lastIndexOf(".")));
action->setCheckable(true);
Expand Down
220 changes: 220 additions & 0 deletions core/wizards/ActualDecoderOffset.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Rectangle {
width: 840
height: 800
color: "#D4D0C8"
Component.onCompleted: {
decoder.payloadDecoded.connect(decode);
decoderEngineOffset.update.connect(offsetupdate);
}
function decode(map) {
//advancetext.text = map["Advance"].toFixed(2);
advancetext.text = "62.21";
}
function offsetupdate() {
offsettext.text = decoderEngineOffset.value().toFixed(2);
}
Rectangle {
x:200
y:0
width:440
height:200
color:"black"
Text {
id: advancetext
anchors.fill: parent
clip: true
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignTop
color:"white"
font.pixelSize: 150
text: ""
}
Text {
x:0
y:180
width:400
height:20
horizontalAlignment: Text.AlignHCenter
color:"white"
text: "Ignition Advance (degrees)"
}
}


Rectangle {
x:200
y:205
width:440
height:200
color:"black"
Text {
id: offsettext
anchors.fill: parent
clip: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignTop
color:"white"
font.pixelSize: 100
text: ""
}
Text {
x:0
y:180
width:440
height:20
horizontalAlignment: Text.AlignHCenter
color:"white"
text: "Current Offset (degrees)"
}
}
Rectangle {
x:0
y:205
width:100
height:200
color:"black"
Rectangle {
x:2
y:2
width:96
height:196
color:"Red"
Text {
color:"black"
anchors.fill: parent
font.pixelSize: 50
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "-10"
MouseArea {
anchors.fill: parent
onClicked: {
decoderEngineOffset.setValue((parseFloat(offsettext.text) - 10.0));
}
}
}
}
}
Rectangle {
x:100
y:205
width:100
height:200
color:"black"
Rectangle {
x:2
y:2
width:96
height:196
color:"Red"
Text {
color:"black"
anchors.fill: parent
font.pixelSize: 50
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "-1"
MouseArea {
anchors.fill: parent
onClicked: {
decoderEngineOffset.setValue((parseFloat(offsettext.text) - 1.0));
}
}
}
}
}


Rectangle {
x:740
y:205
width:100
height:200
color:"black"
Rectangle {
x:2
y:2
width:96
height:196
color:"green"
Text {
color:"black"
anchors.fill: parent
font.pixelSize: 50
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "+10"
MouseArea {
anchors.fill: parent
onClicked: {
decoderEngineOffset.setValue((parseFloat(offsettext.text) + 10.0));
}
}
}
}
}
Rectangle {
x:640
y:205
width:100
height:200
color:"black"
Rectangle {
x:2
y:2
width:96
height:196
color:"green"
Text {
color:"black"
anchors.fill: parent
font.pixelSize: 50
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "+1"
MouseArea {
anchors.fill: parent
onClicked: {
decoderEngineOffset.setValue((parseFloat(offsettext.text) + 1.0));
}
}
}
}
}
Rectangle {
x:0
y:400
width:840
height:400
color:"black"
Rectangle {
x:1
y:1
width: 838
height:398
color: "#D4D0C8"
Text {
color:"black"
anchors.fill: parent
font.pixelSize: 20
wrapMode: Text.Wrap

text: "With FreeEMS to make the timing more advanced you increase the offset and to make it more retarded you decrease it.\n\
The offset must be less than the decoder total angle (360 for a crank mounted missing tooth setup), you will get no outputs if it is larger.\n\
If the position that you know is really zero is 60 degrees away from the position of the first tooth post the gap, then your offset is one of two\
values:\n\
60 or 300 (360 - 60)\n\
This depends upon whether it is before or after.\n\
Make the offset number larger to advance the base timing, make it smaller to retard the base timing. For example, if you have 10* BTDC in your\
table, flat, and a timing light shows 5btdc on the engine, then increase this number by 5 degrees. The same applies statically, except you have\
to think more.This is where some descriptive text goes, on how to configure this screen."
}

}

}
}
Loading

0 comments on commit 9792239

Please sign in to comment.