Exemplo n.º 1
0
        private SerializableRangeTestCollection ReadOutOfRangeMeasurementsFromDevice(string device)
        {
            SerializableRangeTestCollection serializableCollection = new SerializableRangeTestCollection();
            List <SerializableRangeTest>    serializableTests      = new List <SerializableRangeTest>();

            // Convert RangeTests to SerializableRangeTests and add them to the list of serializable tests.
            foreach (RangeTest test in m_tests.Values)
            {
                SerializableRangeTest serializableTest = new SerializableRangeTest(test.Name);
                List <SerializableOutOfRangeMeasurement> serializableMeasurements = new List <SerializableOutOfRangeMeasurement>();
                ICollection <IMeasurement> outOfRangeMeasurements = test.GetOutOfRangeMeasurements();

                // Convert IMeasurements to SerializableOutOfRangeMeasurements and add them to the list of serializable measurements.
                foreach (IMeasurement measurement in outOfRangeMeasurements)
                {
                    SerializableOutOfRangeMeasurement serializableMeasurement = CreateSerializableOutOfRangeMeasurement(test, measurement);

                    if (serializableMeasurement.Device == device)
                    {
                        serializableMeasurements.Add(serializableMeasurement);
                    }
                }

                serializableTest.OutOfRangeMeasurements = serializableMeasurements.ToArray();
                serializableTests.Add(serializableTest);
            }

            serializableCollection.RangeTests = serializableTests.ToArray();
            return(serializableCollection);
        }
Exemplo n.º 2
0
        private SerializableRangeTestCollection ReadOutOfRangeMeasurementsFromTest(string acronym)
        {
            SerializableRangeTestCollection serializableCollection = new SerializableRangeTestCollection();
            List <SerializableRangeTest>    serializableTests      = new List <SerializableRangeTest>();
            RangeTest test = m_tests[acronym];

            // Convert RangeTest to SerializableRangeTest and add it to the list of serializable tests.
            SerializableRangeTest serializableTest = new SerializableRangeTest(test.Name);
            List <SerializableOutOfRangeMeasurement> serializableMeasurements = new List <SerializableOutOfRangeMeasurement>();
            ICollection <IMeasurement> outOfRangeMeasurements = test.GetOutOfRangeMeasurements();

            // Convert IMeasurements to SerializableOutOfRangeMeasurements and add them to the list of serializable measurements.
            foreach (IMeasurement measurement in outOfRangeMeasurements)
            {
                SerializableOutOfRangeMeasurement serializableMeasurement = CreateSerializableOutOfRangeMeasurement(test, measurement);
                serializableMeasurements.Add(serializableMeasurement);
            }

            serializableTest.OutOfRangeMeasurements = serializableMeasurements.ToArray();
            serializableTests.Add(serializableTest);

            serializableCollection.RangeTests = serializableTests.ToArray();
            return(serializableCollection);
        }
Exemplo n.º 3
0
        private SerializableRangeTestCollection ReadOutOfRangeMeasurementsFromTest(string acronym)
        {
            SerializableRangeTestCollection serializableCollection = new SerializableRangeTestCollection();
            List<SerializableRangeTest> serializableTests = new List<SerializableRangeTest>();
            RangeTest test = m_tests[acronym];

            // Convert RangeTest to SerializableRangeTest and add it to the list of serializable tests.
            SerializableRangeTest serializableTest = new SerializableRangeTest(test.Name);
            List<SerializableOutOfRangeMeasurement> serializableMeasurements = new List<SerializableOutOfRangeMeasurement>();
            ICollection<IMeasurement> outOfRangeMeasurements = test.GetOutOfRangeMeasurements();

            // Convert IMeasurements to SerializableOutOfRangeMeasurements and add them to the list of serializable measurements.
            foreach (IMeasurement measurement in outOfRangeMeasurements)
            {
                SerializableOutOfRangeMeasurement serializableMeasurement = CreateSerializableOutOfRangeMeasurement(test, measurement);
                serializableMeasurements.Add(serializableMeasurement);
            }

            serializableTest.OutOfRangeMeasurements = serializableMeasurements.ToArray();
            serializableTests.Add(serializableTest);

            serializableCollection.RangeTests = serializableTests.ToArray();
            return serializableCollection;
        }
Exemplo n.º 4
0
        private SerializableRangeTestCollection ReadOutOfRangeMeasurementsFromDevice(string device)
        {
            SerializableRangeTestCollection serializableCollection = new SerializableRangeTestCollection();
            List<SerializableRangeTest> serializableTests = new List<SerializableRangeTest>();

            // Convert RangeTests to SerializableRangeTests and add them to the list of serializable tests.
            foreach (RangeTest test in m_tests.Values)
            {
                SerializableRangeTest serializableTest = new SerializableRangeTest(test.Name);
                List<SerializableOutOfRangeMeasurement> serializableMeasurements = new List<SerializableOutOfRangeMeasurement>();
                ICollection<IMeasurement> outOfRangeMeasurements = test.GetOutOfRangeMeasurements();

                // Convert IMeasurements to SerializableOutOfRangeMeasurements and add them to the list of serializable measurements.
                foreach (IMeasurement measurement in outOfRangeMeasurements)
                {
                    SerializableOutOfRangeMeasurement serializableMeasurement = CreateSerializableOutOfRangeMeasurement(test, measurement);

                    if(serializableMeasurement.Device == device)
                        serializableMeasurements.Add(serializableMeasurement);
                }

                serializableTest.OutOfRangeMeasurements = serializableMeasurements.ToArray();
                serializableTests.Add(serializableTest);
            }

            serializableCollection.RangeTests = serializableTests.ToArray();
            return serializableCollection;
        }