Пример #1
0
        /// <summary>
        /// Returns a list containing the available signals in the specified record.
        /// </summary>
        /// <param name="record">Record to be read.</param>
        /// <returns>List of available signals in the specified record.</returns>
        internal static IEnumerable <Signal> GetSignals(Record record)
        {
            var signalsCount = GetSignalsCount(record);

            if (signalsCount == -1)// no input file
            {
                throw new ArgumentNullException("record", "The specified input file does not exist");
            }
            else if (signalsCount == -2)
            {
                throw new ArgumentException("Invalid header file.", "record");
            }
            else
            {
                var signals = new Signal[signalsCount];
                PInvoke.isigopen(record, signals, signals.Length);

                foreach (var signal in signals)
                {
                    if (!RecordCache.ContainsKey(signal))
                    {
                        RecordCache.Add(signal, record);
                    }
                }

                return(new List <Signal>(signals));
            }
        }
Пример #2
0
        /// <summary>
        /// Gets the available signals in the specified record.
        /// </summary>
        /// <param name="record">The record name.</param>
        /// <returns>A list containing the signals of the specified record.</returns>
        public static List <Signal> GetSignals(string record)
        {
            var signalsCount = GetSignalsCount(record);

            if (signalsCount == -1)// no input file
            {
                throw new ArgumentNullException("record", "The specified input file does not exist.");
            }
            else if (signalsCount == -2)
            {
                throw new ArgumentException("Invalid header file.", "record");
            }
            else
            {
                var signals = new Signal[signalsCount];
                PInvoke.isigopen(record, signals, signals.Length);

                var objRecord = new Record(record);
                foreach (var signal in signals)
                {
                    objRecord.Signals.Add(signal);
                    if (!RecordCache.ContainsKey(signal))
                    {
                        RecordCache.Add(signal, objRecord);
                    }
                }
                return(new List <Signal>(signals));
            }
        }