Ejemplo n.º 1
0
 void Uplink_OnConnectionStateChanged(Connection.CallbackConnectionState NewState)
 {
     if (NewState == Connection.CallbackConnectionState.Connected &&
         DataStorage == null)
     {
         DataStorage = new CDODataStorageEntity(Uplink, Orchestrator);
     }
 }
Ejemplo n.º 2
0
 void Uplink_OnConnectionStateChanged(Connection.CallbackConnectionState NewState)
 {
     if (NewState == Connection.CallbackConnectionState.Connected &&
         DataController == null)
     {
         DataController = new CDODataController(Uplink, Orchestrator, "ENTITYIDHERE");
     }
 }
Ejemplo n.º 3
0
            void Uplink_OnConnectionStateChanged(Connection.CallbackConnectionState NewState)
            {
                if (NewState != Connection.CallbackConnectionState.Connected)
                {
                    Console.WriteLine("Still not connected: {0}", NewState);
                    return;
                }

                Console.WriteLine("Connecting to CDO");
                CDOUplink = new CDOController(Uplink, new JID("cdo.sandbox.clayster.com"), null, null);
            }
Ejemplo n.º 4
0
            public void OnConnectionStateChanged(Connection.CallbackConnectionState State)
            {
                if (State != Connection.CallbackConnectionState.Connected)
                {
                    Console.WriteLine("Still waiting for being connected, new state: " + State.ToString());
                    return;
                }

                while (!SourceStarted && !Quit)
                {
                    Console.WriteLine("Waiting for source to be started");
                    Thread.Sleep(100);
                }
                Console.WriteLine("Connected. Starting controller test");
                Client = new LWTSD.DataController(Connection,
                                                  new JID("[email protected]/sourcetest"));
            }
Ejemplo n.º 5
0
            public void OnConnectionStateChanged(Connection.CallbackConnectionState State)
            {
                if (State != Connection.CallbackConnectionState.Connected)
                {
                    Console.WriteLine("Still waiting for being connected, new state: " + State.ToString());
                    return;
                }

                Console.WriteLine("Connected. Starting data source test.");
                DataHandler = new LWTSD.DataSource(Connection, false);

                // Some thermometers
                for (int i = 0; i < 3; i++)
                {
                    LWTSD.ResourceTypes.ResourceInteger Point = new LWTSD.ResourceTypes.ResourceInteger();
                    Point.Path          = "thermometers/temp" + i.ToString();
                    Point.Displayname   = "Temperature " + i.ToString();
                    Point.Description   = "A temperature";
                    Point.Unit          = "Celcius";
                    Point.SupportsRead  = true;
                    Point.SupportsWrite = false;
                    Point.Value         = 20 + i;
                    Point.MinExclusive  = 3;
                    DataHandler.AddResource(Point);
                }

                // Some writables
                for (int i = 0; i < 3; i++)
                {
                    LWTSD.ResourceTypes.ResourceInteger Point = new LWTSD.ResourceTypes.ResourceInteger();
                    Point.Path          = "writables/item" + i.ToString();
                    Point.Displayname   = "Writable " + i.ToString();
                    Point.Description   = "A writable thingy";
                    Point.Unit          = "Unknown";
                    Point.SupportsRead  = true;
                    Point.SupportsWrite = true;
                    Point.Value         = i + 1;
                    Point.MinExclusive  = 0;
                    Point.MaxExclusive  = 10;
                    DataHandler.AddResource(Point);
                }

                SourceStarted = true;
            }