Skip to content

Commit

Permalink
Display watches which are not reached and watches not open in world i…
Browse files Browse the repository at this point in the history
…n exploriants
  • Loading branch information
JoeAtHPI committed Jan 18, 2024
1 parent 8d83232 commit dfc3477
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ SBInactiveExampleWatch class >> registerWatch: aWatch [
"we do not want the inactive watches in the registry"
]

{ #category : #'event handling' }
SBInactiveExampleWatch class >> unregisterWatch: aWatch [

"we do not want the inactive watches in the registry"
]

{ #category : #callbacks }
SBInactiveExampleWatch >> artefactSaved: aBlock [

Expand Down
17 changes: 8 additions & 9 deletions packages/Sandblocks-Babylonian/SBMultiverse.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,6 @@ SBMultiverse >> allMethodBlocksContainingWatches [

]

{ #category : #collecting }
SBMultiverse >> copyWatches [

^ (self allMethodBlocksContainingWatches collect: [:aMethodBlock |
aMethodBlock containedExampleWatches collect: #asInactiveCopy]) flatten
]

{ #category : #converting }
SBMultiverse >> createUniverseFomPermutation: aSBPermutation [

Expand Down Expand Up @@ -136,17 +129,23 @@ SBMultiverse >> gatherElements [
{ #category : #'initialize-release' }
SBMultiverse >> initialize [

| permutations |
| permutations watches outOfWorldWatches |
super initialize.

self gatherElements.

permutations := SBPermutation allPermutationsOf: variants.
universes := OrderedCollection new.

watches := (self allMethodBlocksContainingWatches collect: #containedExampleWatches) flatten.
"Only open watches display values when examples are run. We want to show them too"
(outOfWorldWatches := watches reject: #isInEditor) do: [:aWatch | self sandblockEditor openMorph: aWatch].

[permutations do: [:aPermutation |
SBActiveVariantPermutation value: aPermutation.
activeExamples do: #runSynchronouslyIgnoreReturn.
universes add: (self createUniverseFomPermutation: aPermutation)].
universes add: (SBUniverse newActive: aPermutation watches: (watches collect: #asInactiveCopy))].
outOfWorldWatches copy do: #delete.
self resetWatchesToOriginalPermutationRunning: activeExamples.
self triggerEvent: #updated] forkAt: Processor userSchedulingPriority.

Expand Down
7 changes: 0 additions & 7 deletions packages/Sandblocks-Babylonian/SBResultsView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ SBResultsView >> initialize [
morphResizer := SBMorphResizer newThumbmail.
]

{ #category : #building }
SBResultsView >> resetWatchesToOriginalPermutationRunning: activeExamples [

SBActiveVariantPermutation value: nil.
activeExamples do: #runSynchronouslyIgnoreReturn
]

{ #category : #actions }
SBResultsView >> visualize [

Expand Down
6 changes: 5 additions & 1 deletion packages/Sandblocks-Watch/SBWatchView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ SBWatchView >> displayWatchValues [
{ #category : #accessing }
SBWatchView >> displayedMorphs [

^ self scroller submorphs first "container for scrolling" submorphs
^ self scroller submorphs
ifEmpty: [{}]
ifNotEmpty: [:valueContainer | valueContainer first "container for scrolling" submorphs ]


]

{ #category : #'event handling' }
Expand Down

0 comments on commit dfc3477

Please sign in to comment.