Beispiel #1
0
        public void AddThing(IThing a_Thing, string a_Path = "")
        {
            Dictionary <string, object> add_object = new Dictionary <string, object>();

            add_object["event"] = "add_object";
            add_object["type"]  = string.IsNullOrEmpty(a_Thing.DataType) ? a_Thing.Type : a_Thing.DataType;
            add_object["thing"] = a_Thing.Serialize();
            if (!string.IsNullOrEmpty(a_Thing.ParentGUID))
            {
                add_object["parent"] = a_Thing.ParentGUID;
            }

            TopicClient.Instance.Publish(a_Path + "blackboard", Json.Serialize(add_object));
        }
Beispiel #2
0
 public void SetImportance(IThing a_Thing, double a_Importance, string a_Path = "")
 {
     a_Thing.Importance = a_Importance;
     SetImportance(a_Thing.GUID, a_Importance, a_Path);
 }
Beispiel #3
0
 public void SetState(IThing a_Thing, string a_State, string a_Path = "")
 {
     a_Thing.State = a_State;
     SetState(a_Thing.GUID, a_State, a_Path);
 }
Beispiel #4
0
 public void RemoveThing(IThing a_Thing, string a_Path = "")
 {
     RemoveThing(a_Thing.GUID, a_Path);
 }