예제 #1
0
        public void generateSignalWEnergy()
        {
            eiEventSignalType signal = new eiEventSignalType();

            EnergyApparentType energy = new EnergyApparentType();

            energy.itemDescription = "Apparent Energy";
            energy.itemUnits       = "KWh";
            energy.siScaleCode     = SiScaleCodeType.none;

            signal.itemBase = energy;

            string xml = SerializeOadrObject.serializeOjbect(signal, signal.GetType());

            Console.Out.WriteLine(xml);
        }
예제 #2
0
        /******************************************************************************/

        public void testItemBase(ItemBaseType itemBase)
        {
            eiEventSignalType signal = new eiEventSignalType();

            signal.itemBase = itemBase;

            string xml = SerializeOadrObject.serializeOjbect(signal, signal.GetType());

            // by default, the itemBase substitution parameters are generated with a root element of 'itemBase'
            // hand made modifications to oadr20b.cs fix this problem
            Assert.IsFalse(xml.Contains("itemBase"));

            Console.Out.WriteLine(xml);

            signal = (eiEventSignalType)SerializeOadrObject.deserializeObject(xml, typeof(eiEventSignalType));

            Assert.IsNotNull(signal, xml);
            Assert.IsNotNull(signal.itemBase, xml);
        }