Пример #1
0
        private ObjectPath CreateEngine(string name, ObjectPath engineSettings)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            if (engineSettings == null)
            {
                throw new ArgumentNullException("engineSettings");
            }

            if (engines.ContainsKey(name))
            {
                return(engines[name].Path);
            }

            Console.WriteLine("Settings: {0}	-	{1}", engineSettings, engineSettings);
            IEngineSettings settings = this.engineSettings[engineSettings];

            ObjectPath    path    = new ObjectPath(string.Format(EnginePath, name));
            EngineAdapter adapter = new EngineAdapter(name, (EngineSettingsAdapter)settings, path);

            engines.Add(name, adapter);
            TorrentService.Bus.Register(path, adapter);

            return(path);
        }
        private void UpdateEngineSettingsInUiThread(Exception readInnerException, IEngineSettings settings)
        {
            _uiRoot.Notifier.Notify(() =>
            {
                if (readInnerException != null)
                {
                    //_logger.Log("Не удалось прочитать настройки АИН");
                    Parameter02Vm.CurrentValue = null;
                    Parameter04Vm.CurrentValue = null;
                    Parameter05Vm.CurrentValue = null;
                    Parameter06Vm.CurrentValue = null;
                    Parameter08Vm.CurrentValue = null;
                    Parameter09Vm.CurrentValue = null;
                    Parameter10Vm.CurrentValue = null;
                    Parameter11Vm.CurrentValue = null;
                    Parameter12Vm.CurrentValue = null;

                    return;
                }

                Parameter02Vm.CurrentValue = settings.Inom;
                Parameter04Vm.CurrentValue = settings.Nnom;
                Parameter05Vm.CurrentValue = settings.Nmax;
                Parameter06Vm.CurrentValue = settings.Pnom;
                Parameter08Vm.CurrentValue = settings.CosFi;
                Parameter09Vm.CurrentValue = settings.Eff;
                Parameter10Vm.CurrentValue = settings.Mass;
                Parameter11Vm.CurrentValue = settings.MmM;
                Parameter12Vm.CurrentValue = settings.Height;
            });
        }
Пример #3
0
        public void SetSettings(IEngineSettings settings)
        {
            lock (_engineSettingsSync)
            {
                _engineSettings = settings;
            }

            RaiseAinSettingsUpdated(settings);
        }
Пример #4
0
 public EngineSettingsWritable(IEngineSettings settings)
 {
     Inom        = settings.Inom;
     Nnom        = settings.Nnom;
     Nmax        = settings.Nmax;
     Pnom        = settings.Pnom;
     CosFi       = settings.CosFi;
     Eff         = settings.Eff;
     Mass        = settings.Mass;
     MmM         = settings.MmM;
     Height      = settings.Height;
     I2Tmax      = settings.I2Tmax;
     Icontinious = settings.Icontinious;
     ZeroF       = settings.ZeroF;
 }
        private void UpdateEngineSettingsInUiThread(Exception readInnerException, IEngineSettings settings)
        {
            _uiRoot.Notifier.Notify(() =>
            {
                if (readInnerException != null)
                {
                    //_logger.Log("Не удалось прочитать настройки АИН");
                    Parameter08Vm.CurrentValue = null;
                    Parameter09Vm.CurrentValue = null;
                    Parameter10Vm.CurrentValue = null;
                    return;
                }

                Parameter08Vm.CurrentValue = settings.I2Tmax;
                Parameter09Vm.CurrentValue = settings.Icontinious;
                Parameter10Vm.CurrentValue = settings.ZeroF;
            });
        }
Пример #6
0
        private void FireEventEngineSettingsReadComplete(Exception innerException, IEngineSettings settings)
        {
            var eve = EngineSettingsReadComplete;

            eve?.Invoke(innerException, settings);
        }
Пример #7
0
 public void RaiseEngineSettingsReadComplete(Exception innerException, IEngineSettings settings)
 {
     _notifyWorker.AddWork(() => FireEventEngineSettingsReadComplete(innerException, settings));
 }
 public WriteEngineSettingsCommand(IEngineSettings settings)
 {
     _settings = settings;
 }
 private void EngineSettingsReadNotifyOnEngineSettingsReadComplete(Exception readInnerException,
                                                                   IEngineSettings settings)
 {
     UpdateEngineSettingsInUiThread(readInnerException, settings);
 }
Пример #10
0
 public EngineSettingsStorageThreadSafe()
 {
     _engineSettingsSync = new object();
     _engineSettings     = null;
 }
Пример #11
0
        private void RaiseAinSettingsUpdated(IEngineSettings settings)
        {
            var eve = EngineSettingsUpdated;

            eve?.Invoke(settings);
        }
Пример #12
0
 public static void CompareSettingsAfterReReading(this IEngineSettings settings,
                                                  IEngineSettings settingsReReaded, int zeroBasedAinNumber)
 {
     if (settings.Inom != settingsReReaded.Inom)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр Inom)");
     }
     if (settings.Nnom != settingsReReaded.Nnom)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр Nnom)");
     }
     if (settings.Nmax != settingsReReaded.Nmax)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр Nmax)");
     }
     if (settings.Pnom != settingsReReaded.Pnom)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр Pnom)");
     }
     if (settings.CosFi != settingsReReaded.CosFi)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр CosFi)");
     }
     if (settings.Eff != settingsReReaded.Eff)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр Eff)");
     }
     if (settings.Mass != settingsReReaded.Mass)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр Mass)");
     }
     if (settings.MmM != settingsReReaded.MmM)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр MmM)");
     }
     if (settings.Height != settingsReReaded.Height)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр Height)");
     }
     if (settings.I2Tmax != settingsReReaded.I2Tmax)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр I2Tmax)");
     }
     if (settings.Icontinious != settingsReReaded.Icontinious)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр Icontinious)");
     }
     if (settings.ZeroF != settingsReReaded.ZeroF)
     {
         throw new Exception(
                   "При повторном чтении вычитанные настройки не совпали с записываемыми (параметр ZeroF)");
     }
 }
 internal PipelineBuilder(IPipelineCollection collection, IEngineSettings settings)
 {
     _collection = collection;
     Settings    = settings;
 }