Hi Marco,
 
why is it, that you would not like to use a WTimer to trigger updates in the 
browser?
 

Med venlig hilsen / Best regards
Michael Sørensen Loft, Mjølner Informatics A/S



 


________________________________

        From: Marco Faletra [mailto:[email protected]] 
        Sent: 21. januar 2009 11:36
        To: [email protected]
        Subject: Re: [Wt-interest] Realtime applications
        
        
        Thank's for your replay.
        
        Is there a very, very, very little example with Boost signal and Wt?
        Also schematic, does not have to be with source code.
        Because, sincerely, I don't like use WTimer for query the state of the 
application from time to time, but I could wrong. Which do you prefer?
        
        Bye.
        
        
        2009/1/19 Wim Dumon <[email protected]>
        

                Hello Marco,
                
                No, you cannot use a WTimer outside the context of a session.
                
                What you should probably do:
                - In main(), start a thread where you perform your CAN-bus 
related
                work. Everything that the system has to do regardless of who 
uses the
                user interface, is to be done in this thread. Feel free to use 
sleep()
                to make this thread wait for a while; this will not block the
                interactivity of Wt. I would recommend not to update the widget 
tree
                from this thread (in any case, lock the Wt threads if you plan 
to do
                so!), but query the application state from time to time from 
within
                the GUI threads.
                - Call WRun() to start the user interface
                - Let the Wt GUI query the state of the application from time 
to time
                (e.g. using WTimer objects), making sure that you lock your data
                structure (e.g. using mutexes) when appropriate.
                
                Wt uses boost's signal library, and you're free to use that too 
in
                your threads. Note that the boost signal library does not 
protect you
                from concurrency problems, that remains your responsibility. 
The Wt
                threads can be locked by calling WApplication::getUpdateLock().
                
                Regards,
                Wim.
                
                2009/1/19 Marco Faletra <[email protected]>:
                
                > Hi all, this is my first post.
                >
                > First of all "Well done WT's boys" for your work!
                >
                > Also I would want to make an application like this, with a 
part that
                > communicates via CAN-bus and front-end via web.
                > This application must work also without a connected browser.
                > I have read that I can do this with WTimer in the front-end 
side that read
                > the state of communication, but is it possible using 
"signal/event" in an
                > application like this, without the GUI uses the WTimer to 
refresh the
                > internal state?
                > I have tried to write a program with a thread before WRun, 
but when it send
                > the "emit" the program crash (I think because the sender of 
the emit is in
                > another thread)!
                > Is it impossible create a WTimer before WRun or without that 
a browser start
                > a comunication with http server?
                >
                > Regards,
                > Marco.
                >
                
                > 
------------------------------------------------------------------------------
                > This SF.net email is sponsored by:
                > SourcForge Community
                > SourceForge wants to tell your story.
                > http://p.sf.net/sfu/sf-spreadtheword
                > _______________________________________________
                > witty-interest mailing list
                > [email protected]
                > https://lists.sourceforge.net/lists/listinfo/witty-interest
                >
                >
                
                
------------------------------------------------------------------------------
                This SF.net email is sponsored by:
                SourcForge Community
                SourceForge wants to tell your story.
                http://p.sf.net/sfu/sf-spreadtheword
                _______________________________________________
                witty-interest mailing list
                [email protected]
                https://lists.sourceforge.net/lists/listinfo/witty-interest
                


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to