Пример #1
0
        internal static void CreatePrimaryHeader(this NCCFile.MCAFile file,
            QueryState527Response state527Response,
            QueryStateResponse stateResponse

        )
        {
            if (stateResponse == null) { stateResponse = new QueryStateResponse(); stateResponse.Init(CommandName.CMD_QUERY_STATE); } // dummy values
            if (state527Response == null) { state527Response = new QueryState527Response(); state527Response.Init(CommandName.CMD_QUERY_STATE_527); } // dummy values
            file.header = new NCCFile.MCAFile.MCAHeader
            {
                FileIdentification = "MCA527BIN_APP ",
                FirmwareVersion = state527Response.MCAFirmwareVersion,
                HardwareVersion = state527Response.MCAHardwareVersion,
                FirmwareModification = state527Response.MCAFirmwareModification,
                HardwareModification = state527Response.MCAHardwareModification,
                SerialNumber = stateResponse.MCASerialNumber,
                GeneralMode = (ushort)state527Response.GeneralMCAMode
            };
        }
Пример #2
0
        internal static void CreateModeHeader(this NCCFile.MCAFile file,
            QueryStateResponse stateResponse,
            QueryState527ExResponse state527ExResponse,
            QueryState527Response state527Response,
            QueryPowerResponse powerResponse,
            QueryState527Ex2Response state527Ex2Response
        )
        {
            if (stateResponse == null) { stateResponse = new QueryStateResponse(); stateResponse.Init(CommandName.CMD_QUERY_STATE); } // dummy values
            if (state527Response == null) { state527Response = new QueryState527Response(); state527Response.Init(CommandName.CMD_QUERY_STATE_527); } // dummy values
            if (state527ExResponse == null) { state527ExResponse = new QueryState527ExResponse(); state527ExResponse.Init(CommandName.CMD_QUERY_STATE_527EX); state527ExResponse.Bytes[105] = 1;} // dummy values
            if (state527Ex2Response == null) { state527Ex2Response = new QueryState527Ex2Response(); state527Ex2Response.Init(CommandName.CMD_QUERY_STATE_527EX2); } // dummy values
            if (powerResponse == null) { powerResponse = new QueryPowerResponse(); powerResponse.Init(CommandName.CMD_QUERY_POWER); } // dummy values

            file.rheader = new NCCFile.MCAFile.MCATimestampsRecorderModeHeader
            {
                // sampling rate: kHz : 1000
                // time unit length: ns : 1000000000
                // 1000000000 / (sampling_rate / 1000)
                // 1000000 / sampling_rate
                TimeUnitLengthNanoSec = (ushort)(1000000 / state527ExResponse.ADCSamplingRate),
                Preset = stateResponse.Preset,
                PresetValue = stateResponse.PresetValue,
                PresetMemorySize = state527ExResponse.CommonMemoryFillStop,
                UsedMemorySize = state527ExResponse.CommonMemoryFillLevel,
                HighVoltage = stateResponse.HighVoltage,
                HighVoltagePolarity = stateResponse.HighVoltagePolarity,
                HVInhibitMode = stateResponse.HVInhibitMode,
                PreamplifierPowerSwitches = stateResponse.PowerSwitches,
                TTLLowLevel = state527ExResponse.TTLLowLevel,
                TTLHighLevel = state527ExResponse.TTLHighLevel,
                AmplifierCoarseGain = stateResponse.AmplifierCourseGain,
                ADCInputPolarity = stateResponse.ADCInputPolarity,
                ShapingTimeChoice = stateResponse.ShapingTimeChoice,
                TriggerFilterForLowShapingTime = state527Response.TriggerFilterForLowShapingTime,
                TriggerFilterForHighShapingTime = state527Response.TriggerFilterForHighShapingTime,
                OffsetDAC = state527Response.OffsetDAC,
                TriggerLevelForAutomaticThresholdCalculation = state527Response.TriggerLevelForAutomaticThresholdCalculation,
                SetTriggerThreshold = state527Response.SetTriggerThreshold,
                ExtensionPortPartAConfiguration = state527ExResponse.ExtensionPortPartAConfiguration,
                ExtensionPortPartBConfiguration = state527ExResponse.ExtensionPortPartBConfiguration,
                ExtensionPortPartCConfiguration = state527ExResponse.ExtensionPortPartCConfiguration,
                ExtensionPortPartFConfiguration = state527ExResponse.ExtensionPortPartFConfiguration,
                ExtensionPortRS232BaudRate = state527ExResponse.ExtensionPortRS232BaudRate,
                ExtensionPortRS232Flags = state527ExResponse.ExtensionPortRS232Flags,
                StartFlag = stateResponse.StartFlag,
                StartTime = stateResponse.StartTime,
                RealTime = stateResponse.RealTime,
                BatteryCurrentAtStop = powerResponse.BatteryCurrentAtStop,
                ChargerCurrentAtStop = powerResponse.ChargerCurrentAtStop,
                HVPrimaryCurrentAtStop = powerResponse.HVPrimaryCurrentAtStop,
                Plus12VPrimaryCurrentAtStop = powerResponse.Plus12VPrimaryCurrentAtStop,
                Minus12VPrimaryCurrentAtStop = powerResponse.Minus12VPrimaryCurrentAtStop,
                Plus24VPrimaryCurrentAtStop = powerResponse.Plus24VPrimaryCurrentAtStop,
                Minus24VPrimaryCurrentAtStop = powerResponse.Minus24VPrimaryCurrentAtStop,
                BatteryVoltageAtStop = powerResponse.BatteryVoltageAtStop,
                HighVoltageAtStop = powerResponse.HVAtStop,
                Plus12VActualValueAtStop = powerResponse.Plus12VActualValueAtStop,
                Minus12VActualValueAtStop = powerResponse.Minus12VActualValueAtStop,
                Plus24VActualValueAtStop = powerResponse.Plus24VActualValueAtStop,
                Minus24VActualValueAtStop = powerResponse.Minus24VActualValueAtStop,
                VoltageOnSubD9Pin3AtStop = powerResponse.VoltageOnSubD9Pin3AtStop,
                VoltageOnSubD9Pin5AtStop = powerResponse.VoltageOnSubD9Pin5AtStop,
                CurrentSourceStateOnSubD9Pin5 = powerResponse.CurrentSourceStateOnSubD9Pin5,
                CurrentSourceValueOnSubD9Pin5 = powerResponse.CurrentSourceValueOnSubD9Pin5,
                InputResistanceOnSubD9Pin5 = powerResponse.InputResistanceOnSubD9Pin5,
                ADCCorrectionOffsetOnSubD9Pin5 = powerResponse.ADCCorrectionOffsetOnSubD9Pin5,
                GainCorrectionFactorOnSubD9Pin5 = powerResponse.GainCorrectionFactorOnSubD9Pin5,
                ADCCorrectionOffsetOnSubD9Pin3 = powerResponse.ADCCorrectionOffsetOnSubD9Pin3,
                GainCorrectionFactorOnSubD9Pin3 = powerResponse.GainCorrectionFactorOnSubD9Pin3,
                MCATemperatureAtStop = state527Response.MCATemperatureAtStop,
                DetectorTemperatureAtStop = state527Response.DetectorTemperatureAtStop,
                PowerModuleTemperatureAtStop = state527Response.PowerModuleTemperatureAtStop,
                RepeatMode = (sbyte)(StartFlag.SpectrumClearedNewStartTime),
                RepeatModeOptions = 0,
                RepeatValue = stateResponse.RepeatValue,
                AHRCGroup0Width = state527Ex2Response.AHRCGroup0Width,
                AHRCGroup1Width = state527Ex2Response.AHRCGroup1Width,
                AHRCGroup2Width = state527Ex2Response.AHRCGroup2Width,
                AHRCGroup3Width = state527Ex2Response.AHRCGroup3Width,
                AHRCGroup4Width = state527Ex2Response.AHRCGroup4Width,
                AHRCGroup5Width = state527Ex2Response.AHRCGroup5Width,
                AHRCGroup6Width = state527Ex2Response.AHRCGroup6Width,
                AHRCGroup7Width = state527Ex2Response.AHRCGroup7Width,
                AHRCGroup8Width = state527Ex2Response.AHRCGroup8Width,
                AHRCGroup9Width = state527Ex2Response.AHRCGroup9Width,
                AHRCTriggerThreshold = state527Ex2Response.AHRCTriggerThreshold,
            };
        }