Announcements

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Announcements

Jim Harsh
Hi,

We have 2 objects in our application that need to communicate. We
have a"Canvas" that is a "nodemanager" that has as a dependent, a
"glyphmanager". The "glyphmanager" contains connectors and
"glyphviews". one of the glyphviews's model is an optimizer. When the
optimizer has performed x number of iterations we'd like the
nodemanager to save the canvas.; the Nodemanager knows how to save
the canvas but there isn't a clear path for the optimizer to tell the
nodemanager to do the save.

I read the AppDev guide and announcements seam like to way to go so I
tried to implement them. But I'm doing something wrong.

I have a class

Smalltalk.Core defineClass: #SaveCanvas
        superclass: #{Core.Announcement}
        indexedType: #none
        private: false
        instanceVariableNames: ''
        classInstanceVariableNames: ''
        imports: ''
        category: ''


In the Nodemanager I have a method where I think I subscirbe to the
announcement

saveCanvasAnnouncement


        OptimizerVmmInitMetricLEPWithErrorBar
        when:SaveCanvas
        do:[ Transcript show:'announcement recieved';cr. self halt.].



In the Optimizer I have the 2 subscription methods

subscriptionRegistry:aSubscriptionRegistry
        subscriptionRegistry:= aSubscriptionRegistry

and

subscriptionRegistryOrNil
        ^subscriptionRegistry

and in the optimization loop, when the count is "right"

        ((self globalStepSoFar value \\  numberOfIterationsPerSave value)
=  0) ifTrue:[self announce:SaveCanvas. Transcript show:'save canvas  '; cr.]].


When I run an optimization I see the "save canvas" message but not the
"announcement recieved" message and it doesn't halt.

What am I missing?

What I really want to do is to stop the optimization until the save
is complete,
is there a better way to do this?


Thanks,
Jim

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc