예제 #1
0
        private static bool internalStart()
        {
            Logger.Trace("start InternalStart");
            var ret = false;


            ret  = ConfigDispetcherClass.Start();
            ret &= PluginDispetcherClass.Start();
            ret &= DataDispetcherClass.Start();
            ret &= ActionDispetcherClass.Start();

            Logger.Debug("end InternalStart", ret);
            return(ret);
        }
예제 #2
0
        internal CoreLoader(ILogger logger)
        {
            Logger = logger;
            Logger.Trace("Start constructor CoreLoader");
            Logger.Info("Path of execution", _path);
            _fileconfig = Path.Combine(_path, pathconfig, baseconfigname);

            if (File.Exists(_fileconfig))
            {
                _coreConfig = (File.ReadAllText(_fileconfig)).FromJson <CoreConfig>();

                Logger.Info("File with config", _fileconfig);
            }

            if (_coreConfig == null)
            {
                Logger.Warning("File not load with base path", _fileconfig);
                _fileconfig = Path.Combine(_path, defaultpathconfig, baseconfigname);


                if (File.Exists(_fileconfig))
                {
                    _coreConfig = (File.ReadAllText(_fileconfig)).FromJson <CoreConfig>();
                    Logger.Info("File with config", _fileconfig);
                }
            }

            if (_coreConfig == null)
            {
                Logger.Fatal("File not load with base path", _fileconfig);
            }
            else
            {
                Logger.Debug(_coreConfig.ToJson());
                PluginDispetcherClass.Init(_coreConfig.Plugins, _coreConfig.PluginsPath, pathconfig);
                DataDispetcherClass.Init(_coreConfig.StoreSyncroPlugin, _coreConfig.PluginsPath, pathconfig);
                ActionDispetcherClass.ActionConnections = _coreConfig.ActionConnections;
            }
            ConfigDispetcherClass.OnChangeSettings += configDispetcherClass_OnChangeSettings;


            Logger.Debug("End constructor CoreLoader");
        }
예제 #3
0
        static bool plugin_onNeedRestart()
        {
            Logger.Trace("Start Plugin_onNeedRestart");

            var ret = PluginDispetcherClass.IsRestart();

            ret &= DataDispetcherClass.IsRestart();
            if (ret)
            {
                Logger.Info("Reset by 1 second");
                (new Timer(onResetTimer)).Change(1000, 0);
            }
            else
            {
                Logger.Warning("Wait info reset by 3 second");
                (new Timer(onResetNeedTimer)).Change(3000, 0);
            }

            Logger.Trace("End Plugin_onNeedRestart", ret);
            return(ret);
        }
예제 #4
0
 private static void actionDispetcherClass_OnAction(SandboxDataValue ssd)
 {
     Logger.Trace("Start actionDispetcherClass_OnAction(SandboxDataValue ", ssd, ")");
     PluginDispetcherClass.Action(ssd);
     Logger.Trace("End actionDispetcherClass_OnAction(SandboxDataValue ssd)");
 }