Commit ca8ab7f5 authored by Swathi V's avatar Swathi V
Browse files

Defects 33,34,35,36

Defects 33,34,35,36
parent d744745c
......@@ -8,6 +8,7 @@ Item {
property ObjImage droppedObject
property double beakerPointHt : (densityExperimentArea.height / 1.20) / 50
property double liquidLevel : 30 * beakerPointHt
property alias formulaWin : formulaArea
FormulaWin {
id: formulaArea
......
......@@ -7,9 +7,9 @@ Item {
id: fullFormulaText1
width: formulaArea.width / 3
height: formulaArea.height / 2
text: "Density(d) = "
text: "Density(ρ) = "
horizontalAlignment: Text.AlignRight
font.pixelSize: formulaArea.height/2.5
font.pixelSize: formulaArea.height/4
textFormat: TextEdit.AutoText
color: "black"
}
......@@ -19,12 +19,13 @@ Item {
width: formulaArea.width / 3
height: formulaArea.height / 2
text: "Mass(m)/Volume(v)"
font.pixelSize: formulaArea.height/2.5
font.pixelSize: formulaArea.height/4
textFormat: TextEdit.AutoText
color: "black"
anchors.left: fullFormulaText1.right
}
Text {
id: resultInputText1
width: fullFormulaText1.width
......@@ -107,6 +108,11 @@ Item {
}
}
function addValuesToFormula()
{
fullFormulaText2.text = fullFormulaText2.text + " = "+ calculatedWeight + "(m)/" + calculatedVolume + "(v)"
}
function reset() {
resultInputText2.text = ""
}
......
......@@ -92,5 +92,9 @@ Item {
volArea.reset()
densityArea.reset()
}
function addValuesToFormula() {
densityArea.formulaWin.addValuesToFormula()
}
}
......@@ -112,7 +112,7 @@ Flickable {
}
function getCalculatedVolume() {
return weight / density;
return (weight / density).toFixed(2);
}
function getVolume() {
......
import QtQuick 2.0
Item {
Item {
property list<Rectangle> objPropertiesList: [
Rectangle { property string imgSource: "images/iron-ball.png";
......@@ -21,8 +20,8 @@ import QtQuick 2.0
},
Rectangle { property string imgSource: "images/pingpong-ball.png";
property string imgName: "Pingpong Ball";
property double weight: 2.413
property double density: 0.084
property double weight: 2.41
property double density: 0.1
},
Rectangle { property string imgSource: "images/gold-nugget.png";
property string imgName: "Gold Nugget";
......@@ -32,7 +31,7 @@ import QtQuick 2.0
Rectangle { property string imgSource: "images/egg.png";
property string imgName: "Egg";
property double weight: 58
property double density: 1.094
property double density: 1.1
},
Rectangle { property string imgSource: "images/wooden-block.png";
property string imgName: "Wooden Block";
......
......@@ -97,9 +97,10 @@ Flickable {
droppedObject.disableParentDragging()
updateWaterLevel(droppedObject.getCalculatedVolume()/10)
droppedObject.changePosition(droppedObject.x, droppedObject.y + (height - drag.y - getObjectBottomSinkLevel(1)))
volumeText.text = droppedObject.getCalculatedVolume().toPrecision(5)
volumeText.text = droppedObject.getCalculatedVolume()
setImageObject(droppedObject)
setVolume(droppedObject.getCalculatedVolume())
addValuesToFormula()
}
onExited: {
if(droppedObject !== null ) {
......
......@@ -10,7 +10,7 @@ Item {
Image {
id : weighingScaleArea
width: weightWin.width/1.2
width: weightWin.width/1.5
height: weightWin.height/3
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
......@@ -38,6 +38,12 @@ Item {
}
}
Text {
id : wightUnit
text: "Grams"
anchors.bottom: weightText.top
anchors.horizontalCenter: parent.horizontalCenter
}
TextEdit {
id : weightText
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment