Exemple #1
0
        /// <summary>
        /// Runs State Machine demo. This is the main function.
        /// For each demo case defined in xml file function calls PerformDemoCase.
        /// </summary>
        /// <param name="log">Into this interface demo writes output to be displayed</param>
        /// <param name="demoSettingsXmlFile">Xml file containing definitions of demo cases to be prformed</param>
        public static void RunDemo(IOutputLog log, string demoSettingsXmlFile)
        {
            log.Write("State Machine demo started", false);
            //Instantiate demo settings from the xml file
            DemoSettings demoSettings = new DemoSettings(demoSettingsXmlFile);

            //Loop through all demo cases
            foreach (DemoSettings.CaseSettings demoCaseParams in demoSettings.CaseCfgCollection)
            {
                //Execute the demo case
                PerformDemoCase(log, demoCaseParams);
            }
            log.Write("State Machine demo finished", false);
            log.Write(string.Empty);
            return;
        }
Exemple #2
0
        /// <summary>
        /// Runs State Machine demo. This is the main function.
        /// For each demo case defined in xml file function calls PerformDemoCase.
        /// </summary>
        /// <param name="log">Into this interface demo writes output to be displayed</param>
        /// <param name="demoSettingsXmlFile">Xml file containing definitions of demo cases to be prformed</param>
        public static void RunDemo(IOutputLog log, string demoSettingsXmlFile)
        {
            log.Write("State Machine demo started");
            //Instantiate demo settings from the xml file
            DemoSettings demoSettings = new DemoSettings(demoSettingsXmlFile);
            //Loop through all demo cases
            Stopwatch sw = new Stopwatch();

            foreach (DemoSettings.CaseSettings demoCaseParams in demoSettings.CaseCfgCollection)
            {
                sw.Reset();
                sw.Start();
                //Execute the demo case
                PerformDemoCase(log, demoCaseParams);
                sw.Stop();
                TimeSpan ts = sw.Elapsed;
                log.Write("Run time of demo case: " + String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10));
                log.Write(string.Empty);
                log.Write(string.Empty);
            }
            log.Write("State Machine demo finished");
            log.Write(string.Empty);
            return;
        }