Esempio n. 1
0
        public bool InteractiveReadByEndpoint(string key)
        {
            DateTime        date            = DateTime.Now;
            bool            r               = false;
            string          resultado       = "";
            TokenController tokenController = new TokenController();

            Ami_Data_Service.InteractiveReadByEndpointRequest interactiveReadByEndpointRequest = new Ami_Data_Service.InteractiveReadByEndpointRequest();
            Ami_Data_Service.InteractiveReadParameters        interactiveReadParameters        = new Ami_Data_Service.InteractiveReadParameters();

            interactiveReadParameters.ReadingStartTime          = Convert.ToDateTime("24/3/2020 10:25:35");
            interactiveReadParameters.ReadingEndTime            = Convert.ToDateTime("24/3/2020 13:25:35");
            interactiveReadParameters.RetrieveInstantaneousData = false;
            interactiveReadParameters.RetrievePriorSelfRead     = true;
            Ami_Data_Service.EndpointRequest endpointRequest = new Ami_Data_Service.EndpointRequest();
            endpointRequest.ElectronicSerialNumber = "2.16.840.1.114416.15.243." + key;

            interactiveReadByEndpointRequest.EndpointRequest = endpointRequest;
            interactiveReadByEndpointRequest.Parameters      = interactiveReadParameters;
            Ami_Data_Service.DataServiceClient dataServiceClient = new Ami_Data_Service.DataServiceClient();

            Ami_Data_Service.RequestToken requestToken = new Ami_Data_Service.RequestToken();

            try
            {
                requestToken = dataServiceClient.InteractiveReadByEndpoint(interactiveReadByEndpointRequest);
                r            = tokenController.insert(requestToken, key, "InteractiveReadByEndpoint");
            }
            catch (Exception e)
            {
            }
            return(r);
        }
Esempio n. 2
0
        public bool ReadDisconnectStateByMeters(string key)//string[] arrKey
        {
            bool            r               = true;
            string          resultado       = "";
            TokenController tokenController = new TokenController();

            Ami_Diagnostic_Service.DiagnosticServiceClient            diagnosticServiceClient            = new Ami_Diagnostic_Service.DiagnosticServiceClient();
            Ami_Diagnostic_Service.RequestToken                       requestToken                       = new Ami_Diagnostic_Service.RequestToken();
            Ami_Diagnostic_Service.ReadDisconnectStateByMetersRequest readDisconnectStateByMetersRequest = new Ami_Diagnostic_Service.ReadDisconnectStateByMetersRequest();
            Ami_Diagnostic_Service.ReadDisconnectStateByMetersResult  readDisconnectStateByMetersResult  = new Ami_Diagnostic_Service.ReadDisconnectStateByMetersResult();
            Ami_Diagnostic_Service.EndpointCollectionRequest          endpointCollectionRequest          = new Ami_Diagnostic_Service.EndpointCollectionRequest();

            Ami_Diagnostic_Service.EndpointCollectionRequestResult endpointCollectionResult = new Ami_Diagnostic_Service.EndpointCollectionRequestResult();
            string[] ElectronicSerialNumbersCollection = null;
            ElectronicSerialNumbersCollection    = new string[1];
            ElectronicSerialNumbersCollection[0] = "2.16.840.1.114416.15.243." + key;//arrKey[0];


            endpointCollectionRequest.ElectronicSerialNumbers            = ElectronicSerialNumbersCollection;
            readDisconnectStateByMetersRequest.EndpointCollectionRequest = endpointCollectionRequest;

            try
            {
                requestToken = diagnosticServiceClient.ReadDisconnectStateByMeters(readDisconnectStateByMetersRequest);
                r            = tokenController.insert(requestToken, key, "ReadDisconnectStateByMeters");
            }
            catch (Exception e)
            {
            }
            return(r);
        }
Esempio n. 3
0
        public bool PingByEndpoints(string key)//string[] arrKey
        {
            bool   r         = true;
            string resultado = "";

            string[] ElectronicSerialNumbersCollection = null;
            ElectronicSerialNumbersCollection = new string[1];
            TokenController tokenController = new TokenController();

            Ami_Control_Service.ControlServiceClient      controlServiceClient      = new Ami_Control_Service.ControlServiceClient();
            Ami_Control_Service.RequestToken              requestToken              = new Ami_Control_Service.RequestToken();
            Ami_Control_Service.PingByEndpointsRequest    pingByEndpointsRequest    = new Ami_Control_Service.PingByEndpointsRequest();
            Ami_Control_Service.EndpointCollectionRequest endpointCollectionRequest = new Ami_Control_Service.EndpointCollectionRequest();
            ElectronicSerialNumbersCollection[0] = "2.16.840.1.114416.15.243." + key;//arrKey[0];
            endpointCollectionRequest.ElectronicSerialNumbers = ElectronicSerialNumbersCollection;
            pingByEndpointsRequest.EndpointCollectionRequest  = endpointCollectionRequest;

            try
            {
                requestToken = controlServiceClient.PingByEndpoints(pingByEndpointsRequest);
                r            = tokenController.insert(requestToken, key, "PingByEndpoints");
            }
            catch (Exception e)
            {
            }
            return(r);
        }
Esempio n. 4
0
        public bool InterrogateByEndpoints(string key)
        {
            DateTime        date            = DateTime.Now;
            bool            r               = false;
            string          resultado       = "";
            TokenController tokenController = new TokenController();

            Ami_Data_Service.RequestToken                  requestToken                  = new Ami_Data_Service.RequestToken();
            Ami_Data_Service.DataServiceClient             dataServiceClient             = new Ami_Data_Service.DataServiceClient();
            Ami_Data_Service.InterrogateByEndpointsRequest interrogateByEndpointsRequest = new Ami_Data_Service.InterrogateByEndpointsRequest();
            Ami_Data_Service.InterrogationParameters       interrogationParameters       = new Ami_Data_Service.InterrogationParameters();

            interrogationParameters.ReadingStartTime          = Convert.ToDateTime("24/3/2020 10:25:35");
            interrogationParameters.ReadingEndTime            = Convert.ToDateTime("24/3/2020 13:25:35");
            interrogationParameters.RetrieveInstantaneousData = false;
            interrogationParameters.RetrievePriorSelfRead     = true;


            interrogationParameters.InterrogationWindowStartTime = Convert.ToDateTime("02/4/2020 10:25:35");
            interrogationParameters.InterrogationWindowEndTime   = Convert.ToDateTime("24/3/2021 13:25:35");

            Ami_Data_Service.EndpointCollectionRequest endpointCollectionRequest = new Ami_Data_Service.EndpointCollectionRequest();
            string[] electronicSerialNumbersCollection = new string[1];
            electronicSerialNumbersCollection[0] = "2.16.840.1.114416.15.243." + key;
            endpointCollectionRequest.ElectronicSerialNumbers = electronicSerialNumbersCollection;

            interrogateByEndpointsRequest.Parameters = interrogationParameters;
            interrogateByEndpointsRequest.EndpointCollectionRequest = endpointCollectionRequest;


            try
            {
                requestToken = dataServiceClient.InterrogateByEndpoints(interrogateByEndpointsRequest);
                r            = tokenController.insert(requestToken, "SEVERAL", "InterrogateByEndpoints");
            }
            catch (Exception e)
            {
            }
            return(r);
        }
Esempio n. 5
0
        public bool DisconnectMeter(string key)
        {
            bool            r               = true;
            string          resultado       = "";
            TokenController tokenController = new TokenController();

            Ami_Control_Service.ControlServiceClient   controlServiceClient   = new Ami_Control_Service.ControlServiceClient();
            Ami_Control_Service.DisconnectMeterRequest disconnectMeterRequest = new Ami_Control_Service.DisconnectMeterRequest();
            Ami_Control_Service.RequestToken           requestToken           = new Ami_Control_Service.RequestToken();
            Ami_Control_Service.EndpointRequest        endpointRequest        = new Ami_Control_Service.EndpointRequest();
            endpointRequest.ElectronicSerialNumber = "2.16.840.1.114416.15.243." + key;
            disconnectMeterRequest.MeterRequest    = endpointRequest;
            try
            {
                requestToken = controlServiceClient.DisconnectMeter(disconnectMeterRequest);
                r            = tokenController.insert(requestToken, key, "DisconnectMeter");
            }
            catch (Exception e)
            {
            }
            return(r);
        }