private void InitInternal(SubsystemConfig config) { _config = (FileSystemManagerConfig)config; _minDiskSpaceToFreeInBytes = _config.MinDiskSpaceToFreeMb.Value * FileUtils.BYTES_IN_MB; _dataDirectories = new Dictionary <FileType, DataDirectoryConfig>(); FileUtils.EnsureDirExists(_config.DataDirectoriesRoot.Value); foreach (DataDirectoryConfig dir in _config.DataDirectories) { if (_dataDirectories.ContainsKey(dir.FileType)) { throw new Exception("В конфигурации два или более элементов " + "DataDirectory с одинаковым типом файлов"); } _dataDirectories.Add(dir.FileType, dir); FileUtils.EnsureDirExists(Path.Combine(_config.DataDirectoriesRoot.Value, dir.Path)); } if (!_dataDirectories.ContainsKey(FileType.Log)) { var rootDir = new DirectoryInfo(_config.DataDirectoriesRoot.Value); var logDir = new DirectoryInfo(CoreApplication.Instance.LogFileFolder); if (!logDir.FullName.Contains(rootDir.FullName)) { throw new ApplicationException("Папка с логами не содержится в корне архивируемых данных"); } var logConfig = new DataDirectoryConfig { Archive = true, Path = logDir.FullName.Replace(rootDir.FullName, "").Trim('\\').Trim('/'), FileTypeStr = "Log" }; _dataDirectories.Add(FileType.Log, logConfig); } }
public override void Init(SubsystemConfig config) { _config = (VotingResultManagerConfig)config; _fileSystemManager = Application.GetSubsystemOrThrow <IFileSystemManager>(); _electionManager = Application.GetSubsystemOrThrow <IElectionManager>(); _scannersInfo = Application.FindSubsystemImplementsInterfaceOrThrow <IScannersInfo>(); }
public override void Init(SubsystemConfig config) { _config = (SoundManagerConfig)config; InitSoundPlayer(); InitSoundsPaths(); }
public override void Init(SubsystemConfig config) { _config = (ElectionManagerConfig)config; _votingResultManager = Application.GetSubsystemOrThrow <IVotingResultManager>(); _recognitionManager = Application.GetSubsystemOrThrow <IRecognitionManager>(); _fileSystemManager = Application.GetSubsystemOrThrow <IFileSystemManager>(); _syncManager = Application.GetSubsystemOrThrow <ISynchronizationManager>(); }
public override void Init(SubsystemConfig config) { _config = (KeyboardManagerConfig)config; _keys = new Dictionary <int, KeyConfig>(_config.Keys.Count); foreach (KeyConfig key in _config.Keys) { _keys[key.ScanCode] = key; } InitKeyboardDriver(_config.Driver); }
/// <summary> /// Get a string for this object. It will contain: /// [SSCONFIG] SSDesc /// /// NOTE /// If the subsystem is an old revision of firmware, /// the subsystem code will be an index /// instead of the code. Use the index and the /// serial number to determine the string. /// /// </summary> /// <returns>String of this object.</returns> public override string ToString() { // NOTE // If the subsystem is an old revision of firmware, // the subsystem code will be an index // instead of the code. Use the index and the // serial number to determine the string return(SubsystemConfig.DescString()); }
public override void Init(SubsystemConfig config) { _config = (WorkflowManagerConfig)config; _syncManager = Application.GetSubsystemOrThrow <ISynchronizationManager>(); _fileSystemManager = Application.GetSubsystemOrThrow <IFileSystemManager>(); _scannerManager = Application.GetSubsystemOrThrow <IScannerManager>(); StateChanged += (sender, e) => Logger.LogInfo(Message.WorkflowStateChanged, e.State); var keyboard = (IKeyboardManager)Application.GetSubsystemOrThrow <UnionKeyboard>(); keyboard.KeyPressed += LogUserKeyPressed; LoadErrorState(); InitWorkflow(); }
public override void Init(SubsystemConfig config) { _config = (SynchronizationManagerConfig)config; _scannerManager = Application.GetSubsystemOrThrow <IScannerManager>(); _fileSystemManager = Application.GetSubsystemOrThrow <IFileSystemManager>(); _electionManager = Application.GetSubsystemOrThrow <IElectionManager>(); _votingResultManager = Application.GetSubsystemOrThrow <IVotingResultManager>(); _printingManager = Application.GetSubsystemOrThrow <IPrintingManager>(); _printingManager.PrintReportStarting += (s, e) => SetPrintReportExecutingNow(true); _printingManager.PrintReportFinished += (s, e) => ResetPrintReportExecutingNow(true); InitRemoteScannerCommunication(); InitState(); }
public override void Init(SubsystemConfig config) { var keyboards = Application.GetSubsystems <IKeyboardManager>(); foreach (var item in keyboards) { var keyboard = item.Value; if (keyboard is UnionKeyboard) { continue; } keyboard.KeyPressed += KeyboardKeyPressed; } }
public override void Init(SubsystemConfig config) { _config = (ConfigurationManagerConfig)config; var keyAttributeNames = new Dictionary <string, string> { { "subsystem", "name" } }; _mergeUtil = new XmlMerge(_config.PrivateConfigElementXPaths.ToList(), keyAttributeNames); _currentConfig = CoreApplication.Instance.Config; _currentConfigXml = _currentConfig.ToXml(); _fileSystemManager = Application.GetSubsystemOrThrow <IFileSystemManager>(); _electionManager = Application.GetSubsystemOrThrow <IElectionManager>(); WorkingConfigLoaded = false; Application.ConfigUpdated += ApplicationConfigUpdated; }
public override void ApplyNewConfig(SubsystemConfig newConfig) { _config = (ElectionManagerConfig)newConfig; }
public override void ApplyNewConfig(SubsystemConfig newConfig) { _config = (VotingResultManagerConfig)newConfig; }
public override void ApplyNewConfig(SubsystemConfig newConfig) { InitInternal(newConfig); }
public override void Init(SubsystemConfig config) { DeleteTempFiles(); InitInternal(config); ReserveDiskSpace("./", _config.SystemReservedSpaceKb.Value); }
public override void Init(SubsystemConfig config) { _config = (PrintingManagerConfig)config; _electionManager = Application.GetSubsystemOrThrow <IElectionManager>(); _votingResultManager = Application.GetSubsystemOrThrow <IVotingResultManager>(); }
public virtual void ApplyNewConfig(SubsystemConfig newConfig) { }
public virtual void Init(SubsystemConfig config) { }
/// <summary> /// Hashcode for the object. /// This will return the hashcode for the /// serial number string. /// </summary> /// <returns>Hashcode for the object.</returns> public override int GetHashCode() { return(SubsystemConfig.SubSystem.GetHashCode() + SubsystemConfig.GetHashCode() + SubsystemConfig.CepoIndex); }
public override void ApplyNewConfig(SubsystemConfig newConfig) { }