Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
hekri-d committed Nov 14, 2015
1 parent 5602981 commit da1d701
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions js/CallCppEngineJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function callCpp() {
else if(tsRadioButton.checked){
fromMyClass.setState_TemperatureSpecificEntropy(input1, input2);

propertyDisplay1Text.text = fromMyClass.getPressure().toFixed(2);
propertyDisplay1Text.text = fromMyClass.getPressure(setBySwitch).toFixed(2);
propertyDisplay2Text.text = fromMyClass.getInternalEnergy(setBySwitch).toFixed(2);
propertyDisplay3Text.text = fromMyClass.getSpecificEnthalpy(setBySwitch).toFixed(2)

Expand Down Expand Up @@ -84,7 +84,7 @@ function callCpp() {
else if(txRadioButton.checked){
fromMyClass.setState_TemperatureQuality(input1, input2);

propertyDisplay1Text.text = fromMyClass.getPressure().toFixed(2);
propertyDisplay1Text.text = fromMyClass.getPressure(setBySwitch).toFixed(2);
propertyDisplay2Text.text = fromMyClass.getInternalEnergy(setBySwitch).toFixed(2);
propertyDisplay3Text.text = fromMyClass.getSpecificEnthalpy(setBySwitch).toFixed(2)

Expand Down
2 changes: 1 addition & 1 deletion js/CallCppEngineL.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function callCppL() {
if(txRadioButton.checked){
fromMyClass.setState_TemperatureQuality(input1, 0.0);

propertyDisplay1Text.text = fromMyClass.getPressure().toFixed(2);
propertyDisplay1Text.text = fromMyClass.getPressure(setBySwitch).toFixed(2);
propertyDisplay2Text.text = fromMyClass.getInternalEnergy(setBySwitch).toFixed(2);
propertyDisplay3Text.text = fromMyClass.getSpecificEnthalpy(setBySwitch).toFixed(2)

Expand Down
2 changes: 1 addition & 1 deletion js/CallCppEngineV.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function callCppV() {
if(txRadioButton.checked){
fromMyClass.setState_TemperatureQuality(input1, 1.0);

propertyDisplay1Text.text = fromMyClass.getPressure().toFixed(2);
propertyDisplay1Text.text = fromMyClass.getPressure(setBySwitch).toFixed(2);
propertyDisplay2Text.text = fromMyClass.getInternalEnergy(setBySwitch).toFixed(2);
propertyDisplay3Text.text = fromMyClass.getSpecificEnthalpy(setBySwitch).toFixed(2)

Expand Down
8 changes: 4 additions & 4 deletions js/DisplayUnitsUpdateJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ function displayUnitsUpdateJS() {
else if(txRadioButton.checked){

if (setBySwitch == true) {
unit1Text.text = "kJ/kgK"
unit1Text.text = "kPa"
unit2Text.text = "kJ/kg"
unit3Text.text = "kJ/kg"
unit9Text.text = "%"
unit9Text.text = "J/kg"

unit6Text.text = "kJ/kg"
unit7Text.text = "kJ/kg"
}

else {
unit1Text.text = "kPa"
unit1Text.text = "Pa"
unit2Text.text = "J/kg"
unit3Text.text = "J/kg"
unit9Text.text = "J/kgK"
Expand All @@ -150,7 +150,7 @@ function displayUnitsUpdateJS() {
unit1Text.text = "kJ/kgK" //fix it
unit2Text.text = "kJ/kg"
unit3Text.text = "kJ/kg"
unit9Text.text = "%"
unit9Text.text = "K"

unit6Text.text = "kJ/kg"
unit7Text.text = "kJ/kg"
Expand Down
5 changes: 3 additions & 2 deletions mysteamclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ double MySteamClass::getTemperature(){
return temperature;
}

double MySteamClass::getPressure(){
double MySteamClass::getPressure(bool addKilo){

if(addKilo == true){ return pressure/1000; }
else {return pressure; }

return pressure;
}
2 changes: 1 addition & 1 deletion mysteamclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class MySteamClass : public QObject
Q_INVOKABLE double getThermalConductivity();
Q_INVOKABLE double getViscosity();
Q_INVOKABLE double getTemperature();
Q_INVOKABLE double getPressure();
Q_INVOKABLE double getPressure(bool addKilo);


signals:
Expand Down

0 comments on commit da1d701

Please sign in to comment.