Esempio n. 1
0
 public DetectorProperties(IDDK ddk, IDevice device, Config.Detector config)
 {
     if (ddk == null)
     {
         throw new ArgumentNullException("ddk");
     }
     if (device == null)
     {
         throw new ArgumentNullException("device");
     }
     if (config == null)
     {
         throw new ArgumentNullException("config");
     }
 }
Esempio n. 2
0
        public Detector(IDriverEx driver, IDDK ddk, Config.Detector config, string id)
            : base(driver, ddk, config, typeof(Detector).Name, id)
        {
            Log.TaskBegin(Id);
            try
            {
                m_Properties = new DetectorProperties(m_DDK, m_Device, config);

                m_Channels = new List <DetectorChannel>();
                for (int i = 0; i < config.ChannelsNumber; i++)
                {
                    int channelNumber = i + 1;

                    UnitConversion.PhysUnitEnum unit = UnitConversion.PhysUnitEnum.PhysUnit_MilliAU; // mAU - Milli-Absorbance
                    string channelPhysicalQuantity   = "Absorbance";                                 // What do we actually measure
                    bool   channelNeedsIntegration   = true;
                    if (channelNumber == 2)
                    {
                        unit = UnitConversion.PhysUnitEnum.PhysUnit_MilliVolt;
                        channelPhysicalQuantity = "Voltage";
                        channelNeedsIntegration = false;   // This channel doesn't have peaks and, we don't want to have it integrated
                    }

                    string          channelId   = "Channel_" + channelNumber.ToString(CultureInfo.InvariantCulture);
                    string          channelName = channelId + "_Name";
                    DetectorChannel channel     = new DetectorChannel(driver, ddk, m_Device, channelId, channelName, channelNumber, unit, channelNeedsIntegration, channelPhysicalQuantity);
                    m_Channels.Add(channel);
                }

                ICommand command = m_Device.CreateCommand("AutoZero", string.Empty);
                command.OnCommand += OnCommandAutoZero;
                // Enable the scenario below:
                // Detector.Autozero
                // Wait     Detector.Ready
                command.ImmediateNotReady = true;

                IsAutoZeroRunning = false;

                Log.TaskEnd(Id);
            }
            catch (Exception ex)
            {
                Log.TaskEnd(Id, ex);
                throw;
            }
        }
        public DetectorProperties(IDDK ddk, IDevice device, Config.Detector config)
        {
            if (ddk == null)
            {
                throw new ArgumentNullException("ddk");
            }
            if (device == null)
            {
                throw new ArgumentNullException("device");
            }
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            Ready = Property.CreateReady(ddk, device);

            IsAutoZeroRunning = Property.CreateBool(ddk, device, "IsAutoZeroRunning");
            IsAutoZeroRunning.Update(Property.GetBoolNumber(false));

            IIntProperty channelsNumber = Property.CreateInt(ddk, device, "ChannelsNumber");

            channelsNumber.Update(config.ChannelsNumber);
        }
Esempio n. 4
0
        //private readonly DetectorProperties m_Properties;

        //private readonly List<DetectorChannel> m_Channels;

        public Detector(IDriverEx driver, IDDK ddk, Config.Detector config, string id)
            : base(driver, ddk, config, typeof(Detector).Name, id)
        {
        }