private void Awake()
    {
        tagLoaderGameObject = GameObject.FindGameObjectWithTag("TagLoader");
        tagLoader           = tagLoaderGameObject.GetComponent <TagLoader>();

        imageViewer = GameObject.FindGameObjectWithTag("ImageViewer").transform;
    }
Esempio n. 2
0
        public WindowsService()
        {
            _console    = new ServerConsole();
            ServiceName = Constants.ServiceName;

            //TODO: Inject before this point
            var configBusiness = new ConfigBusiness(new FileLoaderAgent());

            configBusiness.InvalidConfigEvent += InvalidConfigEvent;
            var influxDbAgentLoader = new InfluxDbAgentLoader();
            var counterBusiness     = new CounterBusiness();
            var publisherBusiness   = new PublisherBusiness();

            counterBusiness.GetPerformanceCounterEvent += GetPerformanceCounterEvent;
            CounterBusiness.ChangedCurrentCultureEvent += ChangedCurrentCultureEvent;
            var sendBusiness = new SendBusiness(configBusiness, new ConsoleQueueEvents(_console));
            var tagLoader    = new TagLoader(configBusiness);

            _processor = new Processor(configBusiness, counterBusiness, publisherBusiness, sendBusiness, tagLoader);
            _processor.EngineActionEvent += _processor_EngineActionEvent;

            // These Flags set whether or not to handle that specific
            //  type of event. Set to true if you need it, false otherwise.
            CanHandlePowerEvent         = true;
            CanHandleSessionChangeEvent = true;
            CanPauseAndContinue         = true;
            CanShutdown = true;
            CanStop     = true;

            _console.LineWrittenEvent += _console_LineWrittenEvent;
        }
Esempio n. 3
0
        public WindowsService()
        {
            _console = new ServerConsole();
            ServiceName = Constants.ServiceName;

            //TODO: This can be removed when the new version of Tharga.Toolkit.Console is used. One version after 1.5.13.0 will do this for you.
            if (!EventLog.SourceExists(ServiceName))
            {
                EventLog.CreateEventSource(ServiceName, "Application");
            }

            //TODO: Inject before this point
            var configBusiness = new ConfigBusiness(new FileLoaderAgent());
            configBusiness.InvalidConfigEvent += InvalidConfigEvent;
            var influxDbAgentLoader = new InfluxDbAgentLoader();
            var counterBusiness = new CounterBusiness();
            counterBusiness.GetPerformanceCounterEvent += GetPerformanceCounterEvent;
            var sendBusiness = new SendBusiness(configBusiness, influxDbAgentLoader);
            sendBusiness.SendBusinessEvent += SendBusinessEvent;
            var tagLoader = new TagLoader(configBusiness);
            _processor = new Processor(configBusiness, counterBusiness, sendBusiness, tagLoader);
            _processor.EngineActionEvent += _processor_EngineActionEvent;

            // These Flags set whether or not to handle that specific
            //  type of event. Set to true if you need it, false otherwise.
            CanHandlePowerEvent = true;
            CanHandleSessionChangeEvent = true;
            CanPauseAndContinue = true;
            CanShutdown = true;
            CanStop = true;
        }
Esempio n. 4
0
        public WindowsService()
        {
            _console = new ServerConsole();
            ServiceName = Constants.ServiceName;

            //TODO: Inject before this point
            var configBusiness = new ConfigBusiness(new FileLoaderAgent());
            configBusiness.InvalidConfigEvent += InvalidConfigEvent;
            var influxDbAgentLoader = new InfluxDbAgentLoader();
            var counterBusiness = new CounterBusiness();
            var publisherBusiness = new PublisherBusiness();
            counterBusiness.GetPerformanceCounterEvent += GetPerformanceCounterEvent;
            CounterBusiness.ChangedCurrentCultureEvent += ChangedCurrentCultureEvent;
            var sendBusiness = new SendBusiness(configBusiness, influxDbAgentLoader);
            sendBusiness.SendBusinessEvent += SendBusinessEvent;
            var tagLoader = new TagLoader(configBusiness);
            _processor = new Processor(configBusiness, counterBusiness, publisherBusiness, sendBusiness, tagLoader);
            _processor.EngineActionEvent += _processor_EngineActionEvent;
            _logger = new MyLogger();

            // These Flags set whether or not to handle that specific
            //  type of event. Set to true if you need it, false otherwise.
            CanHandlePowerEvent = true;
            CanHandleSessionChangeEvent = true;
            CanPauseAndContinue = true;
            CanShutdown = true;
            CanStop = true;

            _console.LineWrittenEvent += _console_LineWrittenEvent;
        }
Esempio n. 5
0
 public CompositeRoot()
 {
     ClientConsole = new ClientConsole();
     InfluxDbAgentLoader = new InfluxDbAgentLoader();
     FileLoaderAgent = new FileLoaderAgent();
     ConfigBusiness = new ConfigBusiness(FileLoaderAgent);
     ConfigBusiness.InvalidConfigEvent += InvalidConfigEvent;
     CounterBusiness = new CounterBusiness();
     SendBusiness = new SendBusiness(ConfigBusiness, InfluxDbAgentLoader);
     SendBusiness.SendBusinessEvent += SendBusinessEvent;
     TagLoader = new TagLoader(ConfigBusiness);
 }
Esempio n. 6
0
 public CompositeRoot()
 {
     ClientConsole       = new ClientConsole();
     InfluxDbAgentLoader = new InfluxDbAgentLoader();
     FileLoaderAgent     = new FileLoaderAgent();
     ConfigBusiness      = new ConfigBusiness(FileLoaderAgent);
     ConfigBusiness.InvalidConfigEvent += InvalidConfigEvent;
     CounterBusiness   = new CounterBusiness();
     PublisherBusiness = new PublisherBusiness();
     SendBusiness      = new SendBusiness(ConfigBusiness, InfluxDbAgentLoader);
     SendBusiness.SendBusinessEvent += SendBusinessEvent;
     TagLoader = new TagLoader(ConfigBusiness);
 }
Esempio n. 7
0
        static void Main(string[] args)
        {
            var pgm  = new Program();
            var tag1 = PopulateTag();

            Console.WriteLine("Validation: {0}", TagLoader.ValidateAll(tag1, pgm));
            TagLoader.LoadAll(tag1, pgm);
            Console.WriteLine("Loaded all tags");
            var tag2 = TagSaver.SaveAll(pgm);

            Console.WriteLine("Saved all tags");
            Console.WriteLine("Tags are same: {0}", TagCompound.Equals(tag1, tag2));
            Console.ReadKey();
        }
Esempio n. 8
0
 public CompositeRoot()
 {
     ClientConsole       = new ClientConsole();
     InfluxDbAgentLoader = new InfluxDbAgentLoader();
     FileLoaderAgent     = new FileLoaderAgent();
     ConfigBusiness      = new ConfigBusiness(FileLoaderAgent);
     ConfigBusiness.InvalidConfigEvent += InvalidConfigEvent;
     CounterBusiness   = new CounterBusiness();
     PublisherBusiness = new PublisherBusiness();
     MetaDataBusiness  = new MetaDataBusiness();
     SendBusiness      = new SendBusiness(ConfigBusiness, new ConsoleQueueEvents(ClientConsole));
     TagLoader         = new TagLoader(ConfigBusiness);
     SocketClient      = new SocketClient();
 }
Esempio n. 9
0
        public WindowsService()
        {
            _console    = new ServerConsole();
            ServiceName = Constants.ServiceName;

            //TODO: This can be removed when the new version of Tharga.Toolkit.Console is used. One version after 1.5.13.0 will do this for you.
            if (!EventLog.SourceExists(ServiceName))
            {
                EventLog.CreateEventSource(ServiceName, "Application");
            }

            //TODO: Inject before this point
            var configBusiness = new ConfigBusiness(new FileLoaderAgent());

            configBusiness.InvalidConfigEvent += InvalidConfigEvent;
            var influxDbAgentLoader = new InfluxDbAgentLoader();
            var counterBusiness     = new CounterBusiness();
            var publisherBusiness   = new PublisherBusiness();

            counterBusiness.GetPerformanceCounterEvent += GetPerformanceCounterEvent;
            var sendBusiness = new SendBusiness(configBusiness, influxDbAgentLoader);

            sendBusiness.SendBusinessEvent += SendBusinessEvent;
            var tagLoader = new TagLoader(configBusiness);

            _processor = new Processor(configBusiness, counterBusiness, publisherBusiness, sendBusiness, tagLoader);
            _processor.EngineActionEvent += _processor_EngineActionEvent;

            // These Flags set whether or not to handle that specific
            //  type of event. Set to true if you need it, false otherwise.
            CanHandlePowerEvent         = true;
            CanHandleSessionChangeEvent = true;
            CanPauseAndContinue         = true;
            CanShutdown = true;
            CanStop     = true;
        }