Exemple #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);
            }
        }
Exemple #2
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);
            }
        }