Click here to Skip to main content
15,891,473 members
Home / Discussions / C#
   

C#

 
GeneralRe: When to use & when not to use ( Abstract Class & Interface ) Pin
Krishna Varadharajan8-Mar-13 3:04
Krishna Varadharajan8-Mar-13 3:04 
GeneralRe: When to use & when not to use ( Abstract Class & Interface ) Pin
GuyThiebaut8-Mar-13 3:28
professionalGuyThiebaut8-Mar-13 3:28 
GeneralRe: When to use & when not to use ( Abstract Class & Interface ) Pin
Krishna Varadharajan8-Mar-13 3:57
Krishna Varadharajan8-Mar-13 3:57 
GeneralRe: When to use & when not to use ( Abstract Class & Interface ) Pin
GuyThiebaut8-Mar-13 4:16
professionalGuyThiebaut8-Mar-13 4:16 
GeneralRe: When to use & when not to use ( Abstract Class & Interface ) Pin
Krishna Varadharajan8-Mar-13 4:57
Krishna Varadharajan8-Mar-13 4:57 
AnswerRe: When to use & when not to use ( Abstract Class & Interface ) Pin
PIEBALDconsult8-Mar-13 3:42
mvePIEBALDconsult8-Mar-13 3:42 
AnswerRe: When to use & when not to use ( Abstract Class & Interface ) Pin
Shameel8-Mar-13 4:08
professionalShameel8-Mar-13 4:08 
GeneralRe: When to use & when not to use ( Abstract Class & Interface ) Pin
Krishna Varadharajan8-Mar-13 4:33
Krishna Varadharajan8-Mar-13 4:33 
GeneralRe: When to use & when not to use ( Abstract Class & Interface ) Pin
Shameel8-Mar-13 5:01
professionalShameel8-Mar-13 5:01 
GeneralRe: When to use & when not to use ( Abstract Class & Interface ) Pin
Krishna Varadharajan8-Mar-13 5:53
Krishna Varadharajan8-Mar-13 5:53 
AnswerRe: When to use & when not to use ( Abstract Class & Interface ) Pin
jschell8-Mar-13 12:41
jschell8-Mar-13 12:41 
QuestionWhy SqlCommandBuilder Pin
Krishna Varadharajan8-Mar-13 1:50
Krishna Varadharajan8-Mar-13 1:50 
AnswerRe: Why SqlCommandBuilder Pin
Eddy Vluggen8-Mar-13 3:01
professionalEddy Vluggen8-Mar-13 3:01 
GeneralRe: Why SqlCommandBuilder Pin
Krishna Varadharajan8-Mar-13 3:22
Krishna Varadharajan8-Mar-13 3:22 
GeneralRe: Why SqlCommandBuilder Pin
Eddy Vluggen8-Mar-13 4:59
professionalEddy Vluggen8-Mar-13 4:59 
GeneralRe: Why SqlCommandBuilder Pin
Krishna Varadharajan8-Mar-13 5:55
Krishna Varadharajan8-Mar-13 5:55 
GeneralRe: Why SqlCommandBuilder Pin
Eddy Vluggen8-Mar-13 7:12
professionalEddy Vluggen8-Mar-13 7:12 
AnswerRe: Why SqlCommandBuilder Pin
PIEBALDconsult8-Mar-13 3:38
mvePIEBALDconsult8-Mar-13 3:38 
GeneralRe: Why SqlCommandBuilder Pin
Krishna Varadharajan8-Mar-13 3:59
Krishna Varadharajan8-Mar-13 3:59 
GeneralRe: Why SqlCommandBuilder Pin
PIEBALDconsult8-Mar-13 5:42
mvePIEBALDconsult8-Mar-13 5:42 
GeneralRe: Why SqlCommandBuilder Pin
Krishna Varadharajan8-Mar-13 5:56
Krishna Varadharajan8-Mar-13 5:56 
QuestionWireless Sensor Node Simulation Time in C# Pin
Nico Encarnacion7-Mar-13 14:45
Nico Encarnacion7-Mar-13 14:45 
AnswerRe: Wireless Sensor Node Simulation Time in C# Pin
Gerry Schmitz7-Mar-13 18:49
mveGerry Schmitz7-Mar-13 18:49 
Unless NODE has some sort of interrupt mechanism (Sleep; I/O; etc.), once one is “Run”, it will hog the (one) thread indefinitely.

I would suggest putting the “timing” code in a separate class (or in static methods of the NODE base class), and use a “Timer” instead of a “for” loop for invoking “sleep”, “awake”, etc. states.

Prior to creating and “running” a NODE, start the “timing” object / static methods.

As a NODE is created, it should subscribe to (state-change) events in the timing object that call the “Sleep”, “Awake”, etc. event handlers in a subscribing NODE.

In this way, the timing object will call the “Sleep”, “Awake”, etc. methods in each (subscribing) NODE with each “state” change (i.e. x number of ticks of the Timer).

This of course assumes you want all NODEs to be “asleep” or “awake”, etc. at the same time.

You will need some sort of (message) queuing mechanism to actually “communicate” between these NODEs; since if they are all “sending” at the same time (state-wise), they can also not be “receiving” at the same time.
GeneralRe: Wireless Sensor Node Simulation Time in C# Pin
Nico Encarnacion12-Mar-13 20:05
Nico Encarnacion12-Mar-13 20:05 
GeneralRe: Wireless Sensor Node Simulation Time in C# Pin
Gerry Schmitz13-Mar-13 12:10
mveGerry Schmitz13-Mar-13 12:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.