コード例 #1
0
        static void Main2()
        {
            //Initialise
            ScutaConfig.load();
            HelperFunctions.configure(3, 1, false, true, "", "Application", "Scuta");
            HelperFunctions.debugMessage(0, ("Scuta v" + Assembly.GetExecutingAssembly().GetName().Version + " is starting..."), 0, 100, HelperFunctions.MessageType.Information);

            FWCtrl.Setup();

            if (ScutaConfig.enableIOT)
            {
                IOTCtrl.Initialise(ScutaConfig.iotHubConnectionString, ScutaConfig.iotHubDeviceName, ScutaConfig.iotHubUri);
            }

            if (ScutaConfig.enableMessageForwarding)
            {
                MsgForwarding.Setup(ScutaConfig.messageForwardingIP, ScutaConfig.messageForwardingPort);
            }

            if (ScutaConfig.watchEventLog)
            {
                EventLogWorker newWorker = new EventLogWorker();
                ThreadManager.LaunchWorker(newWorker);
            }

            if (ScutaConfig.watchLogFile)
            {
                LogFileWorker logFileWorker = new LogFileWorker(ScutaConfig.watchLogFilePath, ScutaConfig.watchLogFileName);
                ThreadManager.LaunchWorker(logFileWorker);
            }
        }
コード例 #2
0
        public ScutaService()
        {
            this.ServiceName  = "Scuta Service";
            this.EventLog.Log = "Application";

            this.CanHandlePowerEvent         = false;
            this.CanHandleSessionChangeEvent = true;
            this.CanPauseAndContinue         = false;
            this.CanShutdown = true;
            this.CanStop     = true;

            ScutaConfig.load();
        }
コード例 #3
0
        protected override void OnStart(string[] args)
        {
            base.OnStart(args);
            //Initialise
            ScutaConfig.load();
            HelperFunctions.configure(3, 3, false, true, "", "Scuta", "Scuta Service");
            HelperFunctions.debugMessage(0, ("Scuta v" + Assembly.GetExecutingAssembly().GetName().Version + " is starting..."), 0, 100, HelperFunctions.MessageType.Information);

            FWCtrl.Setup();

            httpClient = new HttpClient();

            if (ScutaConfig.enableIOT)
            {
                IOTCtrl.Initialise(ScutaConfig.iotHubConnectionString, ScutaConfig.iotHubDeviceName, ScutaConfig.iotHubUri);
            }

            if (ScutaConfig.enablePBI)
            {
                PowerBICtrl.serviceURI = ScutaConfig.pbiServiceUri; PowerBICtrl.enableDebugToLog = true;
            }
            ;

            if (ScutaConfig.enableMessageForwarding)
            {
                MsgForwarding.Setup(ScutaConfig.messageForwardingIP, ScutaConfig.messageForwardingPort);
            }

            if (ScutaConfig.watchEventLog)
            {
                EventLogWorker newWorker = new EventLogWorker();
                rootThread = ThreadManager.LaunchWorker(newWorker);
            }

            if (ScutaConfig.watchLogFile)
            {
                LogFileWorker logFileWorker = new LogFileWorker(ScutaConfig.watchLogFilePath, ScutaConfig.watchLogFileName);
                ThreadManager.LaunchWorker(logFileWorker);
            }
        }