Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
BalaSwecha
Density
Commits
b4e541ef
Commit
b4e541ef
authored
Nov 08, 2014
by
vikram
Browse files
more improvements
parent
96e97cdb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Density.pro.user
View file @
b4e541ef
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.2, 2014-11-0
7T08:53:26
. -->
<!-- Written by QtCreator 3.1.2, 2014-11-0
8T13:20:07
. -->
<qtcreator>
<data>
<variable>
ProjectExplorer.Project.ActiveTarget
</variable>
...
...
qml/view/DensityWin.qml
View file @
b4e541ef
...
...
@@ -79,18 +79,19 @@ Item {
id
:
buttonMouseArea
anchors.fill
:
parent
onClicked
:
{
if
(
droppedObject
!==
null
&&
droppedObject
.
state
==
"
inBeaker
"
)
{
droppedObject
.
changePosition
(
droppedObject
.
x
,
droppedObject
.
y
+
getLiquidBottomToObjectTopHeight
(
liquidArea
.
density
)
-
getLiquidBottomToObjectTopHeight
(
liqDensity
))
if
(
liquidArea
.
type
.
toUpperCase
()
!==
liquidText
.
text
.
toUpperCase
())
{
if
(
droppedObject
!==
null
&&
droppedObject
.
state
==
"
inBeaker
"
)
{
droppedObject
.
changePosition
(
droppedObject
.
x
,
droppedObject
.
y
+
getLiquidBottomToObjectTopHeight
(
liquidArea
.
density
)
-
getLiquidBottomToObjectTopHeight
(
liqDensity
))
liquidArea
.
density
=
liqDensity
liquidArea
.
type
=
liquidText
.
text
if
(
liquidArea
.
color
!==
color
){
resultsGrid
.
addRow
(
droppedObject
.
imgName
,
liquidArea
.
type
,
liquidArea
.
density
,
droppedObject
.
getSinkStatus
(
liquidArea
.
density
))
}
}
liquidArea
.
density
=
liqDensity
liquidArea
.
type
=
liquidText
.
text
if
(
liquidArea
.
color
!==
color
){
resultsGrid
.
addRow
(
droppedObject
.
imgName
,
liquidArea
.
type
,
liquidArea
.
density
,
droppedObject
.
getSinkStatus
(
liquidArea
.
density
))
}
liquidArea
.
color
=
color
}
liquidArea
.
density
=
liqDensity
liquidArea
.
type
=
liquidText
.
text
liquidArea
.
color
=
color
}
}
}
...
...
@@ -114,7 +115,7 @@ Item {
height
:
densityWin
.
liquidLevel
width
:
densityExperimentArea
.
width
/
2
property
double
density
:
1
property
string
type
:
"
w
ater
"
property
string
type
:
"
W
ater
"
anchors
{
left
:
densityExperimentArea
.
left
...
...
qml/view/FormulaWin.qml
View file @
b4e541ef
...
...
@@ -27,8 +27,9 @@ Item {
width
:
getTextWidth
(
"
Density
"
)
text
:
"
Density
"
font.pixelSize
:
formulaArea
.
textHeight
font.bold
:
true
textFormat
:
TextEdit
.
AutoText
color
:
"
black
"
color
:
"
yellow
"
anchors.left
:
leftEmptyArea
.
right
anchors.top
:
topEmptyArea
.
bottom
}
...
...
@@ -38,8 +39,9 @@ Item {
width
:
getTextWidth
(
"
=
"
)
text
:
"
=
"
font.pixelSize
:
formulaArea
.
textHeight
font.bold
:
true
textFormat
:
TextEdit
.
AutoText
color
:
"
black
"
color
:
"
yellow
"
anchors
{
left
:
densityText
.
right
top
:
topEmptyArea
.
bottom
...
...
@@ -51,8 +53,9 @@ Item {
width
:
getTextWidth
(
"
Mass
"
)
text
:
"
Mass
"
font.pixelSize
:
formulaArea
.
textHeight
font.bold
:
true
textFormat
:
TextEdit
.
AutoText
color
:
"
black
"
color
:
"
yellow
"
anchors.left
:
equalText
.
right
anchors.top
:
topEmptyArea
.
bottom
...
...
@@ -63,8 +66,9 @@ Item {
width
:
getTextWidth
(
"
/
"
)
text
:
"
/
"
font.pixelSize
:
formulaArea
.
textHeight
font.bold
:
true
textFormat
:
TextEdit
.
AutoText
color
:
"
black
"
color
:
"
yellow
"
anchors.left
:
massText
.
right
anchors.top
:
topEmptyArea
.
bottom
}
...
...
@@ -74,8 +78,9 @@ Item {
width
:
getTextWidth
(
"
Volume
"
)
text
:
"
Volume
"
font.pixelSize
:
formulaArea
.
textHeight
font.bold
:
true
textFormat
:
TextEdit
.
AutoText
color
:
"
black
"
color
:
"
yellow
"
anchors.left
:
divideText
.
right
anchors.top
:
topEmptyArea
.
bottom
}
...
...
@@ -111,7 +116,7 @@ Item {
onTextChanged
:
{
if
(
densityMatching
())
{
showDensityExperiment
()
showDensityExperiment
(
true
)
readOnly
=
true
}
}
...
...
qml/view/Main.qml
View file @
b4e541ef
...
...
@@ -94,6 +94,7 @@ Item {
DensityWin
{
id
:
densityArea
property
int
cellIndex
:
-
1
height
:
thirdRowHeight
width
:
mainWin
.
width
visible
:
false
...
...
@@ -181,13 +182,13 @@ Item {
function
reset
(
force
)
{
if
(
densityArea
.
visible
==
true
)
{
showDensityExperiment
()
showDensityExperiment
(
force
)
}
else
{
showWeightVolumeExperiment
(
force
)
}
}
function
showDensityExperiment
()
{
function
showDensityExperiment
(
force
)
{
weightArea
.
visible
=
false
volArea
.
visible
=
false
densityArea
.
reset
()
...
...
@@ -196,8 +197,10 @@ Item {
nextText
.
text
=
"
next
"
if
(
activeImageObject
!==
null
)
{
reCreateGridObject
(
activeImageObject
.
getCellNumber
()
)
densityArea
.
cellIndex
=
activeImageObject
.
getCellNumber
()
}
if
(
force
===
true
)
reCreateGridObject
(
densityArea
.
cellIndex
)
activeImageObject
=
null
}
...
...
qml/view/ObjImage.qml
View file @
b4e541ef
...
...
@@ -47,13 +47,19 @@ Item {
onPressed
:
{
if
(
objImgId
.
state
==
"
inGrid
"
)
{
parentReset
()
parentReset
(
false
)
}
}
onReleased
:
{
imgText
.
textVisible
=
false
imageArea
.
Drag
.
drop
()
if
(
imageMouseArea
.
drag
.
active
==
true
)
{
objImgId
.
state
=
"
none
"
imageArea
.
Drag
.
drop
()
if
(
objImgId
.
state
==
"
none
"
)
{
parentReset
(
true
)
}
}
}
}
...
...
@@ -135,9 +141,9 @@ Item {
function
getSinkStatus
(
liquidDensity
)
{
if
(
getSubMergedHeight
(
liquidDensity
)
<
height
)
{
return
"
f
loat
"
return
"
F
loat
"
}
else
{
return
"
s
inks
"
return
"
S
inks
"
}
}
function
getCellNumber
()
{
...
...
@@ -169,8 +175,8 @@ Item {
}
function
parentReset
()
{
objImgId
.
parent
.
parentReset
()
function
parentReset
(
force
)
{
objImgId
.
parent
.
parentReset
(
force
)
}
function
reset
()
{
...
...
qml/view/ObjectCollectionWin.qml
View file @
b4e541ef
...
...
@@ -15,13 +15,6 @@ Item {
id
:
objList
}
Rectangle
{
border.color
:
"
yellow
"
border.width
:
3
color
:
"
#49BAB6
"
z
:
0
}
Grid
{
id
:
objGrid
rows
:
1
...
...
@@ -52,8 +45,8 @@ Item {
)
}
}
function
parentReset
()
{
objGrid
.
parent
.
parentReset
()
function
parentReset
(
force
)
{
objGrid
.
parent
.
parentReset
(
force
)
}
function
getNewObject
(
qmlDynamicObj
)
{
...
...
@@ -64,7 +57,7 @@ Item {
}
}
function
parentReset
()
{
reset
(
f
als
e
)
function
parentReset
(
force
)
{
reset
(
f
orc
e
)
}
}
qml/view/VolumeWin.qml
View file @
b4e541ef
...
...
@@ -87,7 +87,7 @@ Flickable {
DropArea
{
id
:
dropArea
width
:
cylinderArea
.
width
width
:
cylinderArea
.
width
*
0.6
height
:
cylinderArea
.
height
anchors
{
left
:
cylinderArea
.
left
...
...
@@ -130,6 +130,10 @@ Flickable {
}
}
function
getActiveObject
()
{
return
droppedObject
;
}
function
reset
()
{
volumeText
.
text
=
"
00.00
"
increasePointHt
=
0
...
...
qml/view/WeightWin.qml
View file @
b4e541ef
...
...
@@ -71,6 +71,10 @@ Item {
}
function
getActiveObject
()
{
return
droppedObject
;
}
function
reset
()
{
weightText
.
text
=
"
00.00
"
droppedObject
=
null
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment