public ManageSubscription(GenThreadManager genThreadManager, SystemServices systemServices, 
     Subscriber.MyTransientSubscriber subscriber, IUpdateDials updateDials)
     : base(genThreadManager, systemServices)
 {
     Subscriber = subscriber;
     UpdateDials = updateDials;
 }
 public EventManager(GenThreadManager genThreadManager, IEvents energyEvents)
     : base(genThreadManager, GlobalSettings.SystemServices)
 {
     EnergyEvents = energyEvents;
     LastEventTypeList = DateTime.MinValue;
     InitialEventRun = true;
 }
 public DeviceStream(SystemServices systemServices)
 {
     Stream = null;
     ByteBuffer = null;
     SystemServices = systemServices;
     DeviceError = false;
     // use new synchronous byte buffer
     GenThreadManager = null;
 }
 public DeviceStream(GenThreadManagement.GenThreadManager genThreadManager, SystemServices systemServices)
 {
     Stream = null;
     ByteBuffer = null;
     SystemServices = systemServices;
     DeviceError = false;
     // use original threaded byte buffer
     GenThreadManager = genThreadManager;
 }
        public MainWindow()
        {
            InitializeComponent();
            Subscriber = null;
            BrushSelected = comboBoxLocalMachines.Background;
            BrushAvailable = comboBoxLocalMachines2.Background;

            visibleDispatcherTimer = new DispatcherTimer();
            visibleDispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            visibleDispatcherTimer.Interval = new TimeSpan(0, 0, 5);

            try
            {
                ApplicationSettings = new ApplicationSettings();
                LocateOrCreateDirectory(ApplicationSettings.DefaultDirectory);
                SystemServices = new MackayFisher.Utilities.SystemServices(ApplicationSettings.BuildFileName("PVMonitor.log"));
                ApplicationSettings.SetSystemServices(SystemServices);
                LoadLogSettings();

                Subscriber = new Subscriber.MyTransientSubscriber(SystemServices, this);
                expanderSettings.DataContext = Subscriber;
                stackPanelMain.DataContext = Subscriber;
                stackPanelGauges.DataContext = Subscriber;
                //listViewActiveEvents.ItemsSource = Subscriber.ActiveEvents;

                GenThreadManager = new GenThreadManager(SystemServices);
                ManageSubscription manageSubscription = new ManageSubscription(GenThreadManager, SystemServices, Subscriber, this);
                int threadId = GenThreadManager.AddThread(manageSubscription);
                GenThreadManager.StartThread(threadId);

                Rect bounds = Properties.Settings.Default.WindowPosition;
                this.Top = bounds.Top;
                this.Left = bounds.Left;
            }
            catch (Exception)
            {
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            Services = new SystemServices();
            GenThreadManager = new GenThreadManagement.GenThreadManager(Services);
            Services.LogMessageContent = true;
            Services.LogDetailTrace = true;
            Services.LogTrace = true;
            Converse = null;
            liveElement = null;
            histElements = null;
            rootElement = null;
            EmulatorThread = null;
            butSendHist.Visibility = System.Windows.Visibility.Hidden;
            buttonStop.IsEnabled = false;

            Emulators = new List<String>(EmulatorMatrix.GetLength(0));

            for (int i = 0; i < EmulatorMatrix.GetLength(0); i++)
            {
                Emulators.Add(EmulatorMatrix[i, 0]);
            }

            MainGrid.DataContext = this;
        }
        public ExecutionManager()
        {
            ThisExecutionManager = this;
            GlobalSettings.ApplicationSettings = new ApplicationSettings();
            GlobalSettings.SystemServices = new MackayFisher.Utilities.SystemServices(GlobalSettings.ApplicationSettings.BuildFileName(GlobalSettings.ApplicationSettings.LogFile));
            LastLogChange = DateTime.Today;
            GlobalSettings.ApplicationSettings.SetSystemServices(GlobalSettings.SystemServices);
            LoadLogSettings();

            ExecutionState = ExecutionState.Startup;
            SuspendRequested = false;

            GenThreadManager = new GenThreadManagement.GenThreadManager(GlobalSettings.SystemServices);
            ExecutionTimeLine = new ExecutionTimeLine();

            ManagerManager = new ManagerManager(this);
        }
示例#8
0
 public GenThread(GenThreadManager genThreadManager, SystemServices systemServices)
 {
     SystemServices = systemServices;
     ConstructorCommon(systemServices);
     GenThreadManager = genThreadManager;
     IsRunning = false;
 }
        public PVOutputManager(GenThreadManager genThreadManager, IOutputManagerManager managerManager, PvOutputSiteSettings settings)
            : base(genThreadManager, GlobalSettings.SystemServices)
        {
            ManagerManager = managerManager;
            Settings = settings;
            SystemId = settings.SystemId;
            APIKey = settings.APIKey;
            if (settings.LiveDays == null)
                PVLiveDays = PVLiveDaysDefault;
            else
                PVLiveDays = settings.LiveDays.Value;

            if (Settings.HaveSubscription)
                PVOutputHourLimit = 100;
            else
                PVOutputHourLimit = 60;

            RequestCount = 0;
            RequestHour = (int)DateTime.Now.TimeOfDay.TotalHours;
            PVOutputLimitReported = false;
            PVOutputCurrentDayLimitReported = false;
            InitialOutputCycle = true;

            OutputReadyEvent = new ManualResetEvent(true);
            LastYieldReady = DateTime.MinValue;
            LastConsumeReady = DateTime.MinValue;
            PVInterval = settings.DataInterval == "" ? 10 : Convert.ToInt32(settings.DataInterval);
            // Common lock object for all OutputManagers
            if (OutputProcessLock == null)
                OutputProcessLock = new Object();
            ConsolidationDevice = ManagerManager.FindPVOutputConsolidationDevice(SystemId);
        }