示例#1
0
 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);
     }
 }
示例#2
0
 public override void Init(SubsystemConfig config)
 {
     _config            = (VotingResultManagerConfig)config;
     _fileSystemManager = Application.GetSubsystemOrThrow <IFileSystemManager>();
     _electionManager   = Application.GetSubsystemOrThrow <IElectionManager>();
     _scannersInfo      = Application.FindSubsystemImplementsInterfaceOrThrow <IScannersInfo>();
 }
示例#3
0
        public override void Init(SubsystemConfig config)
        {
            _config = (SoundManagerConfig)config;


            InitSoundPlayer();
            InitSoundsPaths();
        }
示例#4
0
 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>();
 }
示例#5
0
 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);
 }
示例#6
0
        /// <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());
        }
示例#7
0
        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();
        }
示例#8
0
 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();
 }
示例#9
0
        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;
            }
        }
示例#10
0
        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;
        }
示例#11
0
 public override void ApplyNewConfig(SubsystemConfig newConfig)
 {
     _config = (ElectionManagerConfig)newConfig;
 }
示例#12
0
 public override void ApplyNewConfig(SubsystemConfig newConfig)
 {
     _config = (VotingResultManagerConfig)newConfig;
 }
示例#13
0
 public override void ApplyNewConfig(SubsystemConfig newConfig)
 {
     InitInternal(newConfig);
 }
示例#14
0
 public override void Init(SubsystemConfig config)
 {
     DeleteTempFiles();
     InitInternal(config);
     ReserveDiskSpace("./", _config.SystemReservedSpaceKb.Value);
 }
示例#15
0
 public override void Init(SubsystemConfig config)
 {
     _config              = (PrintingManagerConfig)config;
     _electionManager     = Application.GetSubsystemOrThrow <IElectionManager>();
     _votingResultManager = Application.GetSubsystemOrThrow <IVotingResultManager>();
 }
示例#16
0
 public virtual void ApplyNewConfig(SubsystemConfig newConfig)
 {
 }
示例#17
0
 public virtual void Init(SubsystemConfig config)
 {
 }
示例#18
0
 /// <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);
 }
示例#19
0
 public override void ApplyNewConfig(SubsystemConfig newConfig)
 {
 }