示例#1
0
        public FiresecManager(bool mustMonitorStates)
        {
            MustMonitorStates = mustMonitorStates;
            FiresecServices = new List<Service.FiresecService>();
            FiresecSerializedClient = new FiresecSerializedClient();
            ConfigurationConverter = new ConfigurationConverter()
            {
                FiresecSerializedClient = FiresecSerializedClient
            };

            ConnectFiresecCOMServer();
        }
示例#2
0
        public OperationResult<DeviceConfiguration> DeviceAutoDetectChildren(DeviceConfiguration deviceConfiguration, Guid deviceUID, bool fastSearch)
        {
            var firesecConfiguration = FiresecManager.ConvertBack(deviceConfiguration, false);
            var device = deviceConfiguration.Devices.FirstOrDefault(x => x.UID == deviceUID);
            var result = FiresecSerializedClient.DeviceAutoDetectChildren(firesecConfiguration, device.GetPlaceInTree(), fastSearch);

            var operationResult = new OperationResult<DeviceConfiguration>()
            {
                HasError = result.HasError,
                Error = result.ErrorString
            };
            if (operationResult.HasError)
                return operationResult;

            if (result.Result == null)
                return new OperationResult<DeviceConfiguration>("Ошибка. Получена пустая конфигурация");

            var configurationManager = new ConfigurationConverter();
            operationResult.Result = configurationManager.ConvertOnlyDevices(result.Result);
            return operationResult;
        }