Click here to Skip to main content
15,914,327 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to "inject" string Pin
Shameel3-Jul-11 8:34
professionalShameel3-Jul-11 8:34 
Questionms access afterupdate event in c# textbox Pin
Asif Rehman1-Jul-11 23:34
Asif Rehman1-Jul-11 23:34 
AnswerRe: ms access afterupdate event in c# textbox Pin
JOAT-MON2-Jul-11 3:12
JOAT-MON2-Jul-11 3:12 
AnswerRe: ms access afterupdate event in c# textbox Pin
JOAT-MON2-Jul-11 3:26
JOAT-MON2-Jul-11 3:26 
QuestionFile Type forensic identification Pin
devvvy1-Jul-11 14:20
devvvy1-Jul-11 14:20 
AnswerRe: File Type forensic identification Pin
Philippe Mori1-Jul-11 14:58
Philippe Mori1-Jul-11 14:58 
AnswerRe: File Type forensic identification Pin
PIEBALDconsult1-Jul-11 18:51
mvePIEBALDconsult1-Jul-11 18:51 
QuestionImplementing a list of abstract objects... Pin
faheemnadeem1-Jul-11 10:15
faheemnadeem1-Jul-11 10:15 
Hi. I have a problem which i am stuck in badly.

Scenario:
I have a abstract class named "VisaOscilloscope" defining some abstract methods and properties, which some driver utility classes inherit and implement the actual external hardware driver functionality.e.g. i am giving a shorter version of the class below.

public abstract class VisaOscilloscope : Oscilloscope
{
        [Category("IviScopeBase Capability Group")]
        [DefaultValueAttribute(0)]
        [DescriptionAttribute("Specifies the location of the center of the range that the Vertical Range attribute specifies. The value is with respect to ground and is in volts")]
        public abstract double VerticalOffset { get; set; }

        [Category("IviScopeBase Capability Group")]
        [DefaultValueAttribute(0)]
        [DescriptionAttribute("Specifies the absolute value of the full-scale input range for a channel. The units are volts")]
        public abstract double VerticalRange { get; set; }

        [Category("IviScopeProbeAutoSense Extension Group")]
        [DefaultValueAttribute(false)]
        [DescriptionAttribute("If this attribute is True, the driver configures the oscilloscope to sense the attenuation of the probe automatically. If this attribute is False, the driver disables the automatic probe sense and configures the oscilloscope to use the value of the Probe Attenuation attribute")]
        public abstract bool ProbeAttenuationAuto { get; set; }


        public abstract void init();
        
        public abstract void activate();
        
        public abstract void acquire();
        
        public abstract float[] collect();
        
        public abstract void close();


Now a utility class that has to inherit from this base class and implement the properties and methods by connecting to a pre-written driver. e.g.

    class TK_TDS1012B : VisaOscilloscope
    {

public override double VerticalOffset
        {
            get
            {
                return myTk.GetDouble(tktds1k2kProperties.VerticalOffset);
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public override double VerticalRange
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public override bool ProbeAttenuationAuto
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public override void init()
        {
            throw new NotImplementedException();
        }

        public override void activate()
        {
            throw new NotImplementedException();
        }

        public override void acquire()
        {
            throw new NotImplementedException();
        }

        public override float[] collect()
        {
            throw new NotImplementedException();
        }

        public override void close()
        {
            throw new NotImplementedException();
        }
}


So the problem is i want to group some properties into a list as they can duplicated. e.g. Oscilloscope have some base properties valid for all channels like waveform acquisition, but some are specific to each channel and there can be many number of channels. like each channel has vertical range, attenuation etc.
So what i want is list of abstract properties in the base class which can be implemented in the inherited classes. I can only access the driver in the inherited classes as there are many different drivers to connect to and all are of visa type.

So what i can't figure out is how to add a list of properties to the base class of which everything is to be implemented and populated in the inherited classes.

Any help please I would be really thankful.
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 
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 

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.