Exemplo n.º 1
0
        /// <summary>
        /// Attempts to connect to this <see cref="RemoteOutputAdapter"/>.
        /// </summary>
        protected override void AttemptConnection()
        {
            HistorianClientOptions clientOptions = new HistorianClientOptions();

            clientOptions.DefaultDatabase = DatabaseName;
            clientOptions.ServerNameOrIp  = Server;
            clientOptions.NetworkPort     = Port;
            clientOptions.IsReadOnly      = false;
            m_client     = new HistorianClient <HistorianKey, HistorianValue>(clientOptions);
            m_inputQueue = new HistorianInputQueue(() => m_client.GetDatabase());
        }
        public void TestRemoteAdapter()
        {
            HistorianKey   key   = new HistorianKey();
            HistorianValue value = new HistorianValue();

            HistorianServerDatabaseConfig settings = new HistorianServerDatabaseConfig("PPA", @"c:\temp\historian\", true);

            using (HistorianServer server = new HistorianServer(settings))
                using (SnapClient client = SnapClient.Connect(server.Host))
                {
                    using (HistorianInputQueue queue = new HistorianInputQueue(() => client.GetDatabase <HistorianKey, HistorianValue>(string.Empty)))
                    {
                        for (uint x = 0; x < 100000; x++)
                        {
                            key.PointID = x;
                            queue.Enqueue(key, value);
                        }
                        Thread.Sleep(100);
                    }
                    Thread.Sleep(100);
                }
            //Thread.Sleep(100);
        }
        public void TestRemoteAdapter()
        {
            HistorianKey key = new HistorianKey();
            HistorianValue value = new HistorianValue();

            var settings = new HistorianServerDatabaseConfig("PPA", @"c:\temp\historian\", true);

            using (HistorianServer server = new HistorianServer(settings))
            using (var client = SnapClient.Connect(server.Host))
            {
                using (HistorianInputQueue queue = new HistorianInputQueue(() => client.GetDatabase<HistorianKey, HistorianValue>(string.Empty)))
                {
                    for (uint x = 0; x < 100000; x++)
                    {
                        key.PointID = x;
                        queue.Enqueue(key, value);
                    }
                    Thread.Sleep(100);
                }
                Thread.Sleep(100);
            }
            //Thread.Sleep(100);
        }
 /// <summary>
 /// Attempts to connect to this <see cref="RemoteOutputAdapter"/>.
 /// </summary>
 protected override void AttemptConnection()
 {
     m_client = new HistorianClient(Server, Port);
     m_inputQueue = new HistorianInputQueue(() => m_client.GetDatabase<HistorianKey, HistorianValue>(InstanceName));
 }
 /// <summary>
 /// Attempts to connect to this <see cref="RemoteOutputAdapter"/>.
 /// </summary>
 protected override void AttemptConnection()
 {
     m_client     = new HistorianClient(Server, Port);
     m_inputQueue = new HistorianInputQueue(() => m_client.GetDatabase <HistorianKey, HistorianValue>(InstanceName));
 }