Exemple #1
0
        public static T GetServiceReference <T>(string serviceName, string nsHost = DefaultHostname, int nsPort = DefaultPort) where T : IToyOrbService
        {
            var lookupRequest  = new NameLookupMessage(serviceName);
            var lookupResponse = new Requestor <NameLookupMessage, NameResponseMessage>(nsHost, nsPort).MakeRequest(lookupRequest);
            var remoteProxy    = new ClientSideProxy(lookupResponse.TypeName, lookupResponse.Host, lookupResponse.Port);

            return(DynamicProxy.NewProxyInstance <T>(remoteProxy));
        }
Exemple #2
0
        public MenuViewModel()
        {
            Mediator.Register("SCADADataPoint", GetSCADAData);
            Mediator.Register("NMSNetworkModelData", GetNetworkModelFromProxy);
            Mediator.Register("NetworkModelTreeClass", NetworkModelTreeClassChangedMenu);
            Mediator.Register("Flexibility", DERDashboardFlexibility);
            Mediator.Register("DerForecastDayAhead", DERDashboardDerForecastDayAhead);

            _clientSideProxy = ClientSideProxy.Instance;

            _clientSideProxy.Subscribe((int)Enums.Topics.DerForecastDayAhead);
            _clientSideProxy.Subscribe((int)Enums.Topics.NetworkModelTreeClass);
            _clientSideProxy.Subscribe((int)Enums.Topics.Flexibility);

            _clientSideProxy.Subscribe((int)Enums.Topics.DataPoints);
            _clientSideProxy.Subscribe((int)Enums.Topics.NetworkModelTreeClass_NodeData);
            //_proxy = new CommunicationProxy();
            //_proxy.Open();

            Logger.Log("UI is started.", Enums.Component.UI, Enums.LogLevel.Info);
        }