Exemple #1
0
        private void HandleReceivedBytes(byte[] message, bool unsolicited)
        {
            Dictionary <Tuple <RegisterType, int>, BasePoint> pointsToUpdate;

            if (!unsolicited)
            {
                pointsToUpdate = currentCommand?.PareseResponse(message);
            }
            else
            {
                pointsToUpdate = unsolicitedCommand.PareseResponse(message);
            }

            if (pointsToUpdate != null)
            {
                var processedPoints = ScadaProxyFactory.Instance().AlarmKruncingProxy().Check(pointsToUpdate);
                ScadaProxyFactory.Instance().ScadaStorageProxy().UpdateModelValue(processedPoints);
            }
        }
        private void HandleReceivedBytes(byte[] message, bool unsolicited)
        {
            Dictionary <Tuple <RegisterType, int>, BasePoint> pointsToUpdate;

            if (!unsolicited)
            {
                pointsToUpdate = currentCommand?.PareseResponse(message);
            }
            else
            {
                pointsToUpdate = unsolicitedCommand.PareseResponse(message);
            }

            if (pointsToUpdate != null)
            {
                var alarming        = new AlarmingProxy(ConfigurationManager.AppSettings["Alarming"]);
                var processedPoints = alarming.Check(pointsToUpdate).GetAwaiter().GetResult();
                var storage         = new SF.Common.Proxies.ScadaStorageProxy(ConfigurationManager.AppSettings["Storage"]);
                storage.UpdateModelValue(processedPoints).GetAwaiter().GetResult();
            }
        }