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

C#

 
QuestionImplementing a list of abstract objects... Pin
faheemnadeem1-Jul-11 10:15
faheemnadeem1-Jul-11 10:15 
AnswerRe: Implementing a list of abstract objects... Pin
Philippe Mori1-Jul-11 11:37
Philippe Mori1-Jul-11 11:37 
GeneralRe: Implementing a list of abstract objects... Pin
faheemnadeem1-Jul-11 13:52
faheemnadeem1-Jul-11 13:52 
GeneralRe: Implementing a list of abstract objects... Pin
Philippe Mori1-Jul-11 15:16
Philippe Mori1-Jul-11 15:16 
GeneralRe: Implementing a list of abstract objects... Pin
faheemnadeem1-Jul-11 15:41
faheemnadeem1-Jul-11 15:41 
GeneralRe: Implementing a list of abstract objects... Pin
Philippe Mori1-Jul-11 16:30
Philippe Mori1-Jul-11 16:30 
GeneralRe: Implementing a list of abstract objects... Pin
faheemnadeem1-Jul-11 18:09
faheemnadeem1-Jul-11 18:09 
GeneralRe: Implementing a list of abstract objects... Pin
Philippe Mori2-Jul-11 3:30
Philippe Mori2-Jul-11 3:30 
I haven't look at your code. I don't even think I have a program to open RAR file...

Typically, I would think that you would also have:

IChannel <----- Channel <---- VisaChannel <---- ....

If the creation of the channel is done by the concrete oscilloscope, you can provide the concrete oscilloscope to the channel and from there you can do whatever you want. Handle it there, handle in parent channel class or handle it in the oscilloscope class (ideally through IOscilloscope but if you need you can also uses concrete oscilloscope classes).

The exact implementation depedds a lot on how much the implementation of channels are similar between oscilloscopes and also how existing code is implemented. Assuming that there is one driver class object for one oscilloscope that give access to channel and scope functions, then it would probably make sense that each concrete channel class would simple call the appropriate function in the corresponding scope.

Assuming that your channel do have an ID, you might have an interface IOscilloscopeForChannels that would be implemented by the oscilloscope for use by channels.

interface IOscilloscopeForChannels 
{
  bool IsChannelEnabled(string channelId);
  //...
}


Then a property from the channel simply call that method in the oscilloscope providing any passed argument and adding its owns ID.

You would then be able to use a channel like this:
var oscilloscope1 = GetTheOscilloscope();

/// Get a reference to the channel we want to uses
var channel3 = oscilloscope1.Channels["ch3"]; // Channels could be a dictionary

// Uses that channel in code.
// The channel might forward the call to the oscilloscope class.
channel3.IsEnabled = true;
AddToView(channel3.CurrentValue);
channel3.IsEnable = false;

Philippe Mori

GeneralRe: Implementing a list of abstract objects... Pin
faheemnadeem2-Jul-11 4:08
faheemnadeem2-Jul-11 4:08 
QuestionC# to MATLAB connectivity in windows 7 Pin
Sa na1-Jul-11 9:03
Sa na1-Jul-11 9:03 
AnswerRe: C# to MATLAB connectivity in windows 7 Pin
Dave Kreskowiak1-Jul-11 11:10
mveDave Kreskowiak1-Jul-11 11:10 
GeneralRe: C# to MATLAB connectivity in windows 7 Pin
Sa na2-Jul-11 1:13
Sa na2-Jul-11 1:13 
GeneralRe: C# to MATLAB connectivity in windows 7 Pin
Sa na2-Jul-11 2:52
Sa na2-Jul-11 2:52 
QuestionIs file mapping supported in microsoft .net framework Pin
Danzy831-Jul-11 5:26
Danzy831-Jul-11 5:26 
AnswerRe: Is file mapping supported in microsoft .net framework Pin
Ennis Ray Lynch, Jr.1-Jul-11 6:06
Ennis Ray Lynch, Jr.1-Jul-11 6:06 
QuestionHow do I monitor bytes per second written or read from a directory (and sub-directories)? Pin
bbranded1-Jul-11 5:16
bbranded1-Jul-11 5:16 
AnswerRe: How do I monitor bytes per second written or read from a directory (and sub-directories)? Pin
Dave Kreskowiak1-Jul-11 7:14
mveDave Kreskowiak1-Jul-11 7:14 
GeneralRe: How do I monitor bytes per second written or read from a directory (and sub-directories)? Pin
bbranded1-Jul-11 9:10
bbranded1-Jul-11 9:10 
GeneralRe: How do I monitor bytes per second written or read from a directory (and sub-directories)? Pin
Dave Kreskowiak1-Jul-11 11:07
mveDave Kreskowiak1-Jul-11 11:07 
Questionquestion Pin
ivan_go1-Jul-11 1:57
ivan_go1-Jul-11 1:57 
AnswerRe: question PinPopular
Pete O'Hanlon1-Jul-11 2:19
mvePete O'Hanlon1-Jul-11 2:19 
QuestionConvert SQL Data Type To C# Pin
Kevin Marois30-Jun-11 15:49
professionalKevin Marois30-Jun-11 15:49 
AnswerRe: Convert SQL Data Type To C# Pin
Not Active30-Jun-11 16:01
mentorNot Active30-Jun-11 16:01 
AnswerRe: Convert SQL Data Type To C# Pin
OriginalGriff30-Jun-11 22:08
mveOriginalGriff30-Jun-11 22:08 
AnswerRe: Convert SQL Data Type To C# Pin
Shameel30-Jun-11 22:30
professionalShameel30-Jun-11 22:30 

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.