Example #1
0
        public void Update(Dictionary <string, ushort> pairs)
        {
            var    storage = ScadaProxyFactory.Instance().ScadaStorageProxy();
            var    model   = storage.GetModel();
            ushort aiCount = (ushort)(model.Values.Where(x => x.RegisterType == SCADA.Common.DataModel.RegisterType.ANALOG_INPUT).Count());
            ushort aoCount = (ushort)(model.Values.Where(x => x.RegisterType == SCADA.Common.DataModel.RegisterType.ANALOG_OUTPUT).Count());
            ushort biCount = (ushort)(model.Values.Where(x => x.RegisterType == SCADA.Common.DataModel.RegisterType.BINARY_INPUT).Count());
            ushort boCount = (ushort)(model.Values.Where(x => x.RegisterType == SCADA.Common.DataModel.RegisterType.BINARY_OUTPUT).Count());

            proxy.UpdateConfig(Tuple.Create <ushort, ushort, ushort, ushort>(biCount, boCount, aiCount, aoCount), pairs);
        }