Skip to content

Commit

Permalink
First Failing Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ol-Ba committed May 27, 2022
1 parent edfd3b2 commit 63ee3e9
Show file tree
Hide file tree
Showing 23 changed files with 144 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
as yet unclassified
step
|duration offset|
|duration offset endPositionX|
endPositionX := self timeline width - (self endMargin).
"duration := (self timeline endTime - self timeline startTime)/100. --> richtige Zeit"
((self position x) > (self convertFrameToPosition: (self timeline endTime))) ifTrue: [self abandon]
(self position x >= endPositionX) ifTrue: [self position: endPositionX @ (self position y)"self abandon"]
ifFalse:
[duration := (self timeline endTime - self timeline startTime)/100.
[

duration := (self timeline endTime - self timeline startTime)/100.
offset := (self timeline width - (self startMargin) - (self endMargin)) / duration.
self position: self position + (offset@0).]


Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"lineWidth" : "SG 5/23/2022 18:47",
"movingLine" : "SG 5/23/2022 18:48",
"movingLine:" : "SG 5/23/2022 18:48",
"step" : "SG 5/23/2022 19:28",
"step" : "ob 5/27/2022 15:41",
"stepTime" : "SG 5/23/2022 18:37" } }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
addedKeyframeMorph: anObject
addedKeyframeMorph := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
addedKeyframeMorph
^ addedKeyframeMorph
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
movingLine: anObject
movingLine := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
movingLine
^ movingLine
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
as yet unclassified
setUp

| morph |

super setUp.
self animationsEditorInstance: AnimationsEditor open.
morph := Morph new openInWorld.
self animationsEditorInstance addTargetMorph: morph.
self timeline: self animationsEditorInstance timeline.
self animationsEditorInstance selectedTreeNode: self propertyPosition.
self positionTrack: (self timeline submorphs at: 5).
self movingLine: self timeline movingLine.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
as yet unclassified
testMovingLineInRightPosition
| positionProperty |
positionProperty := (self animationsEditorInstance propertyList at: 2) subproperties at: 'position'.
self animationsEditorInstance selectedTreeNode: positionProperty.
positionProperty
positionX: 555;
positionY: 555;
frame: 1000;
addKeyframe.

self animationsEditorInstance playAnimations.
self wait: 500.
self movingLine stopStepping.

self assert: (self movingLine position x) = 90.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
timeEnd
^1000.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
timeline: anObject
timeline := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
timeline
^ timeline
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
as yet unclassified
wait: milliseconds
"Wait some time in terms of the main world cycle. Split up waiting time into slices of 5 virtual milliseconds to get close to the real behavior."

self waitNow: 0.
milliseconds // 5 timesRepeat: [self waitNow: 5].
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"class" : {
},
"instance" : {
"addedKeyframeMorph" : "ob 5/27/2022 16:53",
"addedKeyframeMorph:" : "ob 5/27/2022 16:53",
"movingLine" : "ob 5/27/2022 16:44",
"movingLine:" : "ob 5/27/2022 16:44",
"setUp" : "ob 5/27/2022 16:47",
"testMovingLineInRightPosition" : "ob 5/27/2022 16:52",
"timeEnd" : "ob 5/27/2022 16:28",
"timeline" : "ob 5/27/2022 16:53",
"timeline:" : "ob 5/27/2022 16:53",
"wait:" : "ob 5/27/2022 16:40" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"category" : "AnimationsEditor-Tests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"movingLine",
"animationsEditorInstance",
"timeline",
"positionTrack",
"addedKeyframeMorph" ],
"name" : "AnimationsEditorMovingLineTest",
"pools" : [
],
"super" : "TestCase",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
movingLine: anObject
movingLine := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
movingLine
^ movingLine
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
testing
setUp
| morph |
| morph referenceTime |

super setUp.
referenceTime := WorldState lastCycleTime.
self animationsEditorInstance: AnimationsEditor open.
morph := Morph new openInWorld.
self animationsEditorInstance addTargetMorph: morph.
self timeline: self animationsEditorInstance timeline.
self animationsEditorInstance selectedTreeNode: self propertyPosition.
self positionTrack: (self timeline submorphs at: 5).
self positionTrack: (self timeline submorphs at: 5).

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
testing
testMovingLineInRightPosition
| positionProperty delay|
positionProperty := (self animationsEditorInstance propertyList at: 2) subproperties at: 'position'.
self animationsEditorInstance selectedTreeNode: positionProperty.
positionProperty
positionX: 555;
positionY: 555;
frame: 1000;
addKeyframe.

self animationsEditorInstance playAnimations.
self movingLine: self timeline movingLine.
"delay := Delay forMilliseconds: 500."
Delay forMilliseconds: 500.
self movingLine: self timeline movingLine.
self movingLine stopStepping.

self assert: (self movingLine position x) = ((self timeline width - 150)/2+125).
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
calculation
wait: milliseconds
"Wait some time in terms of the main world cycle. Split up waiting time into slices of 5 virtual milliseconds to get close to the real behavior."

self waitNow: 0.
milliseconds // 5 timesRepeat: [self waitNow: 5].
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
calculation
waitNow: milliseconds
|referenceTime|
referenceTime := referenceTime + milliseconds.
AnimAnimationRegistry value updateAnimations: referenceTime.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@
"keyframeHeightOn:" : "NB 8/1/2021 14:07",
"keyframeWidthOn:" : "NB 8/1/2021 14:07",
"middleOfAnimationTime" : "NB 8/1/2021 16:09",
"movingLine" : "ob 5/27/2022 16:57",
"movingLine:" : "ob 5/27/2022 16:57",
"paddingDistance" : "NB 8/1/2021 16:04",
"positionTrack" : "MH 8/1/2021 18:42",
"positionTrack:" : "MH 8/1/2021 18:42",
"propertyPosition" : "MH 8/1/2021 18:42",
"secondLastOn:" : "NB 8/1/2021 12:16",
"setUp" : "NB 8/1/2021 15:20",
"setUp" : "ob 5/27/2022 17:02",
"startFrame" : "MH 8/1/2021 18:42",
"tearDown" : "NB 8/1/2021 12:38",
"testAddKeyframeToRightPosition" : "NB 8/1/2021 15:22",
"testDistanceBetweenKeyframes" : "mjs 8/1/2021 16:45",
"testMovingLineInRightPosition" : "ob 5/27/2022 17:16",
"timeline" : "MH 8/1/2021 18:43",
"timeline:" : "MH 8/1/2021 18:43" } }
"timeline:" : "MH 8/1/2021 18:43",
"wait:" : "ob 5/27/2022 16:59",
"waitNow:" : "ob 5/27/2022 17:00" } }
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"animationsEditorInstance",
"timeline",
"positionTrack",
"addedKeyframeMorph" ],
"addedKeyframeMorph",
"movingLine" ],
"name" : "AnimationsEditorTimelineTest",
"pools" : [
],
Expand Down

0 comments on commit 63ee3e9

Please sign in to comment.