public AutoSampler(IDriverEx driver, IDDK ddk, Config.AutoSampler config, string id) : base(driver, ddk, typeof(AutoSampler).Name, id, config.Name) { Log.TaskBegin(Id); try { m_Properties = new AutoSamplerProperties(m_DDK, m_Device); ITypeDouble volumeType = m_DDK.CreateDouble(0.1, 30, 3); volumeType.Unit = UnitConversionEx.PhysUnitName(UnitConversion.PhysUnitEnum.PhysUnit_MicroLiter); // µl int positionMax = m_RackInfos.Sum(item => item.TubeColumnsCount * item.TubeRowsCount); ITypeInt positionType = m_DDK.CreateInt(1, positionMax); positionType.NamedValuesOnly = false; int position = positionType.Minimum.GetValueOrDefault() - 1; foreach (RackInfo rack in m_RackInfos) { int tubeNumber = rack.TubeFirstNumber - 1; for (int row = 1; row <= rack.TubeRowsCount; row++) { for (int col = 1; col <= rack.TubeColumnsCount; col++) { position++; tubeNumber++; string positionName = rack.TubePositionNamePrefix + tubeNumber.ToString(); positionType.AddNamedValue(positionName, tubeNumber); } } } m_InjectHandler = m_Device.CreateInjectHandler(volumeType, positionType); m_RackDesciptionProperty = m_Device.CreateStandardProperty(StandardPropertyID.TrayDescription, m_DDK.CreateString(1000)); m_RackDesciptionProperty.AuditLevel = AuditLevel.Service; string rackDescription = GetRackDescription(); if (m_RackDesciptionProperty.DataType.Length < rackDescription.Length) { throw new InvalidOperationException("m_RackDesciptionProperty length " + m_RackDesciptionProperty.DataType.Length + " is less than the needed " + rackDescription.Length.ToString()); } m_RackDesciptionProperty.Update(rackDescription); m_Position = -1; m_VolumeUnitName = m_InjectHandler.VolumeProperty.DataType.Unit; // µl m_VolumeUnit = UnitConversionEx.PhysUnitFindName(m_VolumeUnitName); m_InjectHandler.PositionProperty.OnSetProperty += OnPropertyPositionSet; m_InjectHandler.VolumeProperty.OnSetProperty += OnPropertyVolumeSet; m_InjectHandler.InjectCommand.OnCommand += OnCommandInjectHandlerInject; m_Device.OnBatchPreflightBegin += OnDeviceBatchPreflightBegin; m_Device.OnPreflightEnd += OnDevicePreflightEnd; m_Device.OnTransferPreflightToRun += OnDeviceTransferPreflightToRun; m_Device.OnSequenceStart += OnDeviceSequenceStart; m_Device.OnSequenceChange += OnDeviceSequenceChange; m_Device.OnSequenceEnd += OnDeviceSequenceEnd; m_Device.OnBroadcast += OnDeviceBroadcast; m_Driver.OnConnected += OnDriverConnected; m_Driver.OnDisconnected += OnDriverDisconnected; Log.TaskEnd(Id); } catch (Exception ex) { Log.TaskEnd(Id, ex); throw; } }
public Pump(IDriverEx driver, IDDK ddk, Config.Pump config, string id) : base(driver, ddk, typeof(Pump).Name, id, config.Name) { Log.TaskBegin(Id); try { m_Properties = new PumpProperties(m_DDK, m_Device); m_Properties.PressureLowerLimit.OnSetProperty += OnPropertyPressureLowerLimitSet; m_Properties.PressureUpperLimit.OnSetProperty += OnPropertyPressureUpperLimitSet; // Properties of the flow handler: // m_FlowHandler.FlowNominalProperty - Flow.Nominal // m_FlowHandler.FlowValueProperty - Flow.Value // m_FlowHandler.ComponentProperties[i] (4 eluent component) - %A.Equate, %B.Equate, %C.Equate, %D.Equate // %A.Valuue, %B.Valuue; %C.Valuue; %D.Valuue ITypeDouble flowType = m_DDK.CreateDouble(0, 10, 3); flowType.Unit = UnitConversionEx.PhysUnitName(UnitConversion.PhysUnitEnum.PhysUnit_MilliLiterPerMin); // ml/min m_FlowHandler = m_Device.CreateFlowHandler(flowType, 4, 2); m_FlowHandler.FlowNominalProperty.OnPreflightSetProperty += OnPropertyFlowNominalSetPreflight; m_FlowHandler.FlowNominalProperty.OnSetProperty += OnPropertyFlowNominalSet; m_FlowHandler.FlowNominalProperty.OnSetRamp += OnPropertyFlowNominalSetRamp; //m_FlowHandler.FlowNominalProperty.RampSyntax = true; // m_FlowHandler.FlowNominalProperty.IsRampSyntax is already True m_FlowHandler.FlowNominalProperty.Update(0); //m_FlowHandler.FlowValueProperty.RampSyntax = true; // m_FlowHandler.FlowValueProperty.IsRampSyntax is already True m_FlowHandler.FlowValueProperty.Update(0); m_EluentPercentA = 100; m_FlowHandler.ComponentProperties[0].Update(m_EluentPercentA); // Partial flow of this component, expressed in percent of the total flow. m_FlowHandler.EquateProperties[i].HelpText = "User-selectable designation of this solvent component." m_FlowHandler.ComponentProperties[1].Update(m_EluentPercentB); m_FlowHandler.ComponentProperties[2].Update(m_EluentPercentC); m_FlowHandler.ComponentProperties[3].Update(m_EluentPercentD); m_FlowHandler.EquateProperties[0].Update("Water"); m_FlowHandler.ComponentProperties[1].OnSetProperty += OnPropertyFlowHandler_ComponentProperty_2_Set; m_FlowHandler.ComponentProperties[2].OnSetProperty += OnPropertyFlowHandler_ComponentProperty_3_Set; m_FlowHandler.ComponentProperties[3].OnSetProperty += OnPropertyFlowHandler_ComponentProperty_4_Set; double pressureSignalMin = m_Properties.PressureLowerLimit.Value.GetValueOrDefault(); double pressureSignalMax = m_Properties.PressureUpperLimit.Value.GetValueOrDefault(); int pressureSignalDigits = 3; string pressureUnitName = m_Properties.PressureValue.DataType.Unit; UnitConversion.PhysUnitEnum pressureUnit = UnitConversionEx.PhysUnitFindName(pressureUnitName); m_ChannelPressure = new PumpChannelPressure(driver, ddk, m_Device, "Channel_Pressure_Id", "Channel_Pressure_Name", pressureSignalMin, pressureSignalMax, pressureSignalDigits, pressureUnit); m_Device.OnBatchPreflightBegin += OnDeviceBatchPreflightBegin; m_Device.OnBatchPreflightSample += OnDeviceBatchPreflightSample; m_Device.OnBatchPreflightEnd += OnDeviceBatchPreflightEnd; m_Device.OnPreflightBegin += OnDevicePreflightBegin; m_Device.OnPreflightLatch += OnDevicePreflightLatch; m_Device.OnPreflightSync += OnDevicePreflightSync; m_Device.OnPreflightBroadcast += OnDevicePreflightBroadcast; m_Device.OnPreflightEnd += OnDevicePreflightEnd; m_Device.OnTransferPreflightToRun += OnDeviceTransferPreflightToRun; m_Device.OnLatch += OnDeviceLatch; m_Device.OnSync += OnDeviceSync; // See these in the AutoSampler m_Device.OnSequenceStart += OnDeviceSequenceStart; m_Device.OnSequenceChange += OnDeviceSequenceChange; m_Device.OnSequenceEnd += OnDeviceSequenceEnd; m_Device.OnBroadcast += OnDeviceBroadcast; Log.TaskEnd(Id); } catch (Exception ex) { Log.TaskEnd(Id, ex); throw; } }