예제 #1
0
        public ObservableComponent(DataFlowComponent comp)
        {
            _component = comp;

            var observer = new ComponentObserverImpl();

            var conf = _component.GetConfiguration();

            _profile = new ServiceProfile();
            _profile.Id = Guid.NewGuid().ToString();
            _profile.InterfaceType = "IDL:OpenRTM/ComponentObserver:1.0";
            _profile.Properties = new Dictionary<string, object>();

            _profile.Properties["observed_status"] = "ALL";
            _profile.Properties["heartbeat.enable"] = "YES";
            _profile.Properties["heartbeat.interval"] = "1";

            _profile.Service = observer;

            if (conf.AddServiceProfile(_profile))
            {
                observer.Subscribe(Notify);
            }

            ExecutionContextScheduler = new EventLoopScheduler();
        }
예제 #2
0
        public bool AddServiceProfile(ServiceProfile sProfile)
        {
            if (sProfile.InterfaceType == "IDL:OpenRTM/ComponentObserver:1.0")
            {
                _owner.AddComponentObserver(sProfile);
                return true;
            }

            return false;
        }