Пример #1
0
 public ProcessingManager(IFunctionExecutor functionExecutor)
 {
     this.functionExecutor = functionExecutor;
     applicationSequence   = 0;
     transportSequence     = 0;
     dom     = new DomServiceProxy(ConfigurationManager.AppSettings["Dom"]);
     log     = new LogServiceProxy(ConfigurationManager.AppSettings["Log"]);
     storage = new SF.Common.Proxies.ScadaStorageProxy(ConfigurationManager.AppSettings["Storage"]);
 }
Пример #2
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 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();
            }
        }