public void InitProcessManager()
        {
            TDConfiguration testConfiguration = CreateTestConfiguration();

            Assert.IsNotNull(testConfiguration);
            Assert.IsNotNull(testConfiguration.GetDataSources);
            Assert.IsNotNull(testConfiguration.GetDataSources[0]);
            Assert.IsTrue(testConfiguration.GetDataSources[0] is TDOpcDataSource);

            TDOpcDataSource opcDataSource = testConfiguration.GetDataSources[0] as TDOpcDataSource;
            Assert.IsNotNull(opcDataSource.OpcServer);
            Assert.AreEqual("localhost", opcDataSource.OpcServer.HostName);
            Assert.AreEqual("Advosol.SimDAServer.1", opcDataSource.OpcServer.ServerName);
            Assert.IsNotNull(opcDataSource.OpcServer.Groups);
            Assert.IsNotNull(opcDataSource.OpcServer.Groups[0]);
            Assert.IsNotNull(opcDataSource.OpcServer.Groups[0].Items);
            Assert.AreEqual("SimulatedData.Random", opcDataSource.OpcServer.Groups[0].Items[0].FullName);

            TDProcessManager processManager = new TDProcessManager(testConfiguration);
            Assert.IsNotNull(processManager.CurrentDataManager);

            processManager.StartAllProcesses();
            int i = 0;
            while (i < 100) {
                System.Threading.Thread.Sleep(100);
                i++;
            }

            PollItemValue pollItemValue = processManager.CurrentDataManager.GetLastPollItemValue("SimulatedData.Random");
            Assert.IsNotNull(pollItemValue);
            Assert.AreEqual("SimulatedData.Random", pollItemValue.ItemID);
            Assert.IsNotNull(pollItemValue.Value);
        }
        private static void UpdateMonitor()
        {
            TDConfiguration configuration;
            _monitorPollItems = new List<PollItem>();
            if (xmlConfigurationFileName == null) {
                configuration = CreateTestConfiguration();
            }
            else {
                configuration = TDConfiguration.CreateConfigurationByXML(xmlConfigurationFileName);
            }

            FillMonitorItems(configuration);

            TDProcessManager processManager = new TDProcessManager(configuration);
            processManager.StartAllProcesses();
            DateTime lastUpdateStamp;
            lastUpdateStamp = DateTime.Now;
            string itemID;
            string itemValue;
            System.Threading.Thread.Sleep(1000);
            while (!isStop) {
                if (lastUpdateStamp != processManager.CurrentDataManager.GetLastUpdatedTimestamp) {
                    foreach (PollItem item in _monitorPollItems) {
                        try {
                            itemValue = item.GetLastValue().Value.ToString();
                            itemID = item.ItemName;
                            Console.WriteLine("{0} = {1}", itemID, itemValue);
                        }
                        catch{
                        }
                    }
                    lastUpdateStamp = processManager.CurrentDataManager.GetLastUpdatedTimestamp;
                    System.Threading.Thread.Sleep(500);
                }
            }
            processManager.StopAllProcesses();
            autoResetEvent.Set();
        }
        private static void UpdateMonitor()
        {
            TDConfiguration configuration;
            _monitorPollItems = new List<PollItem>();
            ShowConsoleMessage("Init configuration");
            if (xmlConfigurationFileName == null) {
                configuration = CreateTestConfiguration();
            }
            else {
                configuration = TDConfiguration.CreateConfigurationByXML(xmlConfigurationFileName);
            }

            FillMonitorItems(configuration);

            IDataStore dataStore = new SQLDataStore(Properties.Settings.Default.ConnectingString);
            TDProcessManager processManager = null;
            ShowConsoleMessage("Init process manager");
            processManager = new TDProcessManager(configuration, dataStore);
            ShowConsoleMessage("Start poll process");
            processManager.StartAllProcesses();
            DateTime lastUpdateStamp;
            lastUpdateStamp = DateTime.Now;
            string itemID;
            string itemValue;
            System.Threading.Thread.Sleep(1000);
            while (!isStop) {
                /*if (lastUpdateStamp != processManager.CurrentDataManager.GetLastUpdatedTimestamp) {
                    foreach (PollItem item in _monitorPollItems) {
                        try {
                            itemValue = item.GetLastValue().Value.ToString();
                            itemID = item.ItemName;
                            Console.WriteLine("{0} = {1}", itemID, itemValue);
                        }
                        catch{
                        }
                    }
                    lastUpdateStamp = processManager.CurrentDataManager.GetLastUpdatedTimestamp;
                }*/

                // delay 10 min
                System.Threading.Thread.Sleep(6000);
            }
            if (processManager != null) {
                processManager.StopAllProcesses();
                ShowConsoleMessage("Stop poll process");
                autoResetEvent.Set();
            }
        }