Exemplo n.º 1
0
        public WayneKerr4300Emulator(string name) : base(name)
        {
#if DEBUG
            Debug = new StreamWriter(@"D:\Steve\Projects\Microfab\C-V\C_V_App\wkDebug.dat");
#else
            var memStream = new MemoryStream(100);
            Debug = new StreamWriter(memStream);
#endif

            _commandResponses = new Dictionary <string, CommandResponse>()
            {
                { "*IDN?", DeviceName },
                { ":READ?", DataPoint },
                { ":TRIG", DataPoint },
                { ":MEAS:LEV?", ReturnLevel },
                { ":MEAS:FREQ?", ReturnFreq },
                { ":MEAS:FUNC1?", ReturnFunc1 },
                { ":MEAS:FUNC2?", ReturnFunc2 }
            };

            _readLineResponse = null;
            _state            = SerialPortStates.Closed;

            _openDelegates       = new VoidZero[] { AlreadyOpen, Closed2Open };
            _closeDelegates      = new VoidZero[] { Open2Closed, NotOpen };
            _nullActionDelegates = new VoidZero[] { NullAction, NotOpen };

            _writeLineDelegates = new VoidString[] { WriteLineDelegate, NotOpen };

            _readLineDelegates = new StringZero[] { OpenReadLine, NotOpenReadLine };
        }
Exemplo n.º 2
0
        public Keithley2400Emulator(string name) : base(name)
        {
            _commandResponses = new Dictionary <string, CommandResponse>()
            {
                { "*IDN?", DeviceName },
                { "READ?", DataPoint },
                { "SYSTem:RSENse?", Sensors },
                { ":FORM:ELEM?", Headers }
            };
#if DEBUG
            Debug = new StreamWriter(@"D:\Steve\Projects\Microfab\C-V\C_V_App\kt_DEBUG.dat");
#else
            var memStream = new MemoryStream(100);
            Debug = new StreamWriter(memStream);
#endif

            _readLineResponse = null;
            _state            = SerialPortStates.Closed;

            _openDelegates       = new VoidZero[] { AlreadyOpen, Closed2Open };
            _closeDelegates      = new VoidZero[] { Open2Closed, NotOpen };
            _nullActionDelegates = new VoidZero[] { NullAction, NotOpen };

            _writeLineDelegates = new VoidString[] { WriteLineDelegate, NotOpen };

            _readLineDelegates = new StringZero[] { OpenReadLine, NotOpenReadLine };
        }