Building a remote count down clock

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

Building a remote count down clock

Andy Burnett
Hello
I want to build a count down clock that will be used for presenters at an upcoming conference.  The important point is that the clock needs to be started and stopped by the 'admin' guy, but displayed on one or more screens for the speaker.

My initial thought was to do it in seaside. However, I then wondered whether it would be better to build it all in Squeak.  The benefit of the Squeak approach (I am guessing) is that I could somehow broadcast to the listening images that I wanted them to start/stop, rather than have them polling every second. Obviously, the app is tiny, so in practical terms it doesn't matter either way, but I am now curious about how I might communicate the start/stop messages over the network to the images.  Is this relatively easy in Squeak?

cheers
Andy

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Building a remote count down clock

Herbert König
Hi Andy,

AB> My initial thought was to do it in seaside. However, I then
AB> wondered whether it would be better to build it all in Squeak. 
AB> The benefit of the Squeak approach (I am guessing) is that I could
AB> somehow broadcast to the listening images that I wanted them to
AB> start/stop, rather than have them polling every second. Obviously,
AB> the app is tiny, so in practical terms it doesn't matter either
AB> way, but I am now curious about how I might communicate the
AB> start/stop messages over the network to the images.  Is this
AB> relatively easy in Squeak?

at the end of this message you'll find a copy of a workspace which I
used to test network communication. I can help out with more code.

I have no knowledge about Seaside but in AidaWeb a real time clock is
part of the demos. Basically the Browser updates parts of the page via
Ajax. Dunno how stable that is (Browser side), if it runs for hours.

In class Socket you'll also find TCP communication, I used UDP
because I controlled an Asteroids game at a frame rate of 50 per
second. TCP will make sure the packet is received or notify the
sender, with UDP you have to make sure yourself.

Can't help you with broadcasts (I guess it's a matter of the address
you send to) but there you definitely will have no knowledge if your
data was received.



--
Cheers,

Herbert

Some code:

Socket initializeNetwork  "Only once per image"
dst := Socket newUDP setPort: 1979.
src := Socket newUDP setPort: 2345.
buff := ByteArray new: 1026.
delay := Delay forMilliseconds: 10.
localhost := ByteArray withAll: { 192. 168. 42. 11 }.
received := nil.

rp := [[ received := dst receiveUDPDataInto: buff.
 received first  isZero ] whileTrue: [ delay wait ].
 WorldState addDeferredUIMessage: [ { buff. received } inspect ]] fork.

src sendUDPData: ( 'ctmame' , (String value: 10) , (String value: 162)) toHost: localhost port:  1979.

rp terminate.
src closeAndDestroy.
dst closeAndDestroy.

src := nil.
dst := nil.
buff := nil.
delay := nil.
rp := nil.

Smalltalk garbageCollect
Socket allInstances

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Building a remote count down clock

dcorking
In reply to this post by Andy Burnett
Andy Burnett  wrote:

> I want to build a count down clock that will be used for presenters at an
> upcoming conference.  The important point is that the clock needs to be
> started and stopped by the 'admin' guy, but displayed on one or more screens
> for the speaker.
>

Andy,

RFB (VNC) is quite popular in Squeak and may do what you want.

I haven't used Nebraksa, but as far as I can tell it solves the
distribution problem for you - if you want to build the UI in Morphic
or MVC.

http://wiki.squeak.org/squeak/1356

According to this ticket Nebraska is broken in recent Etoys releases
https://dev.laptop.org/ticket/7745 (I don't know about its state in
mainstream Squeak images, so you may prefer to go to an older Squeak,
or use Socket directly as Herbert suggested.)

Hope that helps, David
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Building a remote count down clock

dcorking
I wrote:

> RFB (VNC) is quite popular in Squeak and may do what you want.

I forgot to post the link:

http://www.squeaksource.com/RFB.html
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Aw: Building a remote count down clock

pascal.vollmer
In reply to this post by Andy Burnett
 Hi Andy,

if I can help for the presentation part (not for the networking part), let me know. I've built an analog clock with some additional features (see www.squeaksource.com/AnalogClock). One feature is to show a specific duration (with start and stop time) as a morph embedded in the clock's dial. When the event has started I shrink its morph each minute. When stop time is reached the morph disappears. Right now this behavior is triggered by dropping an iCal-information on the clock.

Kind regards,
Pascal


----- Original Nachricht ----
Von:     Andy Burnett <[hidden email]>
An:      Squeak list <[hidden email]>
Datum:   06.11.2009 00:11
Betreff: [Newbies] Building a remote count down clock

> Hello
> I want to build a count down clock that will be used for presenters at an
> upcoming conference.  The important point is that the clock needs to be
> started and stopped by the 'admin' guy, but displayed on one or more
> screens
> for the speaker.
>
> My initial thought was to do it in seaside. However, I then wondered
> whether
> it would be better to build it all in Squeak.  The benefit of the Squeak
> approach (I am guessing) is that I could somehow broadcast to the listening
> images that I wanted them to start/stop, rather than have them polling
> every
> second. Obviously, the app is tiny, so in practical terms it doesn't matter
> either way, but I am now curious about how I might communicate the
> start/stop messages over the network to the images.  Is this relatively
> easy
> in Squeak?
>
> cheers
> Andy
>
>
> --------------------------------
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>

Pascal Vollmer
Email: [hidden email]

Jetzt NEU: Do it youself E-Cards bei Arcor.de!
Stellen Sie Ihr eigenes Unikat zusammen und machen Sie dem Empfänger eine ganz persönliche Freude!
E-Card Marke Eigenbau: HIER KLICKEN: http://www.arcor.de/rd/footer.ecard
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Building a remote count down clock

Andy Burnett
Hey Pascal

Thanks very much for your offer. I am going to work on the networking part first - that seems trickiest - and then come back to the actual clock.  In the meantime, I will download your clock and see what I can learn from you regarding morphs.

Cheers
Andy

On Sat, Nov 7, 2009 at 06:34, <[hidden email]> wrote:
 Hi Andy,

if I can help for the presentation part (not for the networking part), let me know. I've built an analog clock with some additional features (see www.squeaksource.com/AnalogClock). One feature is to show a specific duration (with start and stop time) as a morph embedded in the clock's dial. When the event has started I shrink its morph each minute. When stop time is reached the morph disappears. Right now this behavior is triggered by dropping an iCal-information on the clock.

Kind regards,
Pascal


----- Original Nachricht ----
Von:     Andy Burnett <[hidden email]>
An:      Squeak list <[hidden email]>
Datum:   06.11.2009 00:11
Betreff: [Newbies] Building a remote count down clock

> Hello
> I want to build a count down clock that will be used for presenters at an
> upcoming conference.  The important point is that the clock needs to be
> started and stopped by the 'admin' guy, but displayed on one or more
> screens
> for the speaker.
>
> My initial thought was to do it in seaside. However, I then wondered
> whether
> it would be better to build it all in Squeak.  The benefit of the Squeak
> approach (I am guessing) is that I could somehow broadcast to the listening
> images that I wanted them to start/stop, rather than have them polling
> every
> second. Obviously, the app is tiny, so in practical terms it doesn't matter
> either way, but I am now curious about how I might communicate the
> start/stop messages over the network to the images.  Is this relatively
> easy
> in Squeak?
>
> cheers
> Andy
>
>
> --------------------------------
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>

Pascal Vollmer
Email: [hidden email]

Jetzt NEU: Do it youself E-Cards bei Arcor.de!
Stellen Sie Ihr eigenes Unikat zusammen und machen Sie dem Empfänger eine ganz persönliche Freude!
E-Card Marke Eigenbau: HIER KLICKEN: http://www.arcor.de/rd/footer.ecard


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners