void waitForHeartbeatStatus(SystemStatus status) { waitMatches(status, () => { gui.doAllWork(); return(gui.heartbeatStatus(system)); }); }
public async Task <SystemStatus> Get() { SystemStatus status = new SystemStatus(); await using (var connection = new MySqlConnection(OTHubSettings.Instance.MariaDB.ConnectionString)) { SystemStatusItem[] items = (await connection.QueryAsync <SystemStatusItem>(SystemSql.GetSql)).ToArray(); SystemStatusGroup[] groups = items.GroupBy(i => i.BlockchainDisplayName != null ? i.BlockchainDisplayName : i.ParentName ?? i.Name) .Select(g => new SystemStatusGroup() { Name = g.Key, Items = g.OrderBy(g => g.ID).ToList() }) .ToArray(); foreach (SystemStatusGroup group in groups) { SystemStatusItem[] itemsWhichNeedMoving = group.Items.Where(it => it.ParentName != null).ToArray(); foreach (SystemStatusItem systemStatusItem in itemsWhichNeedMoving) { SystemStatusItem foundItem = group.Items.FirstOrDefault(i => i.Name == systemStatusItem.ParentName); if (foundItem != null) { group.Items.Remove(systemStatusItem); foundItem.Children.Add(systemStatusItem); } } } status.Groups = groups; } return(status); }
private static bool Start() { if (_systemStatus == SystemStatus.IsSending) { return(true); } else if (_systemStatus == SystemStatus.NoCammand) { _startStep = 0; _sendData = true; sendData.Set(); _systemStatus = SystemStatus.IsSending; return(false); } else if (_systemStatus == SystemStatus.Stoped) { _startStep = 0; _sendData = true; sendData.Set(); return(true); } else if (_systemStatus == SystemStatus.Paused) { _sendData = true; sendData.Set(); return(true); } return(true); }
/// <summary> /// Initializes a new instance of the <see cref="SonarrClient"/> class. /// </summary> /// <param name="host">The host.</param> /// <param name="port">The port.</param> /// <param name="apiKey">The API key.</param> /// <param name="urlBase">The URL base.</param> /// <param name="useSsl">if set to <c>true</c> [use SSL].</param> public SonarrClient(string host, int port, string apiKey, [Optional] string urlBase, [Optional] bool useSsl) { // Initialize properties Host = host; Port = port; ApiKey = apiKey; UrlBase = urlBase; UseSsl = useSsl; // Set API URL ApiUrl = $"http{(UseSsl ? "s" : "")}://{Host}:{Port}{("/" + UrlBase ?? "")}/api"; // Initialize endpoints Calendar = new Calendar(this); Command = new Command(this); Diskspace = new Diskspace(this); Episode = new Episode(this); EpisodeFile = new EpisodeFile(this); History = new History(this); Wanted = new Wanted(this); Queue = new Queue(this); Parse = new Parse(this); Profile = new Profile(this); Release = new Release(this); ReleasePush = new ReleasePush(this); Rootfolder = new Rootfolder(this); Series = new Series(this); SeriesLookup = new SeriesLookup(this); SystemStatus = new SystemStatus(this); SystemBackup = new SystemBackup(this); Log = new Log(this); QualityDefinition = new QualityDefinition(this); }
public static DateTime RepopulateDatabase() { DatabaseService.PurgeData(); var yearsToScrape = new List <int>(); for (var i = 2009; i < DateTime.Now.AddYears(1).Year; i++) { yearsToScrape.Add(i); } SystemStatus systemStatus; DateTime updatedDateTime; if (NasgaScrape(yearsToScrape)) { systemStatus = new SystemStatus { Repopulate = false, CurrentYearLastUpdated = DateTime.Now }; updatedDateTime = DateTime.Now; } else { systemStatus = new SystemStatus { Repopulate = true }; updatedDateTime = new DateTime(); } DatabaseService.Insert(systemStatus); return(updatedDateTime); }
public void IncrementRatingCycle() { var status = SystemStatus.First(); status.RatingCheckTimesOpened = Min(RatingCycleSize, status.RatingCheckTimesOpened + 1); _db.Update(status); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var param = parameter.ToString(); SystemStatus status = (SystemStatus)value; if (param == "" || param == "normal") { if (status == SystemStatus.Idle) { return(true); } else { return(false); } } else if (param == "reverse") { if (status == SystemStatus.Idle) { return(false); } else { return(true); } } else { return(false); } }
public void ResetRatingCycle() { var status = SystemStatus.First(); status.RatingCheckTimesOpened = 0; _db.Update(status); }
public void SetMovementLocationsEnabled(bool isEnabled) { var status = SystemStatus.First(); status.IsMovementLocationsEnabled = isEnabled; _db.Update(status); }
public void PreventRatingCheck() { var status = SystemStatus.First(); status.AskForRating_DB_ONLY = false; _db.Update(status); }
public SystemStatus GetSystemStatus(bool runSelfTest) { SystemStatus status = new SystemStatus(); if (runSelfTest) { SetMode(OperationMode.OPERATION_MODE_CONFIG); byte sysTrigger = ReadRegister(BNO055_SYS_TRIGGER_ADDR); WriteRegister(BNO055_SYS_TRIGGER_ADDR, (byte)(sysTrigger | 0x01)); Task.Delay(1000).Wait(); status.SelfTestResult = ReadRegister(BNO055_SELFTEST_RESULT_ADDR); SetMode(OperatingMode); } else { status.SelfTestResult = 0; } status.StatusReg = ReadRegister(BNO055_SYS_STAT_ADDR); status.ErrorReg = ReadRegister(BNO055_SYS_ERR_ADDR); return(status); }
public static SystemStatusDTO createSystemStatusDTO(SystemStatus source) { if (null == source) { return(null); } SystemStatusDTO result = new SystemStatusDTO(); Utilities.CopySimilar.CopyAll(source, result); result.sensorsEnabled = new List <String>(); foreach (MAVLink.MAV_SYS_STATUS_SENSOR flag in source.sensorsEnabled) { result.sensorsEnabled.Add(flag.ToString()); } result.sensorsHealth = new List <String>(); foreach (MAVLink.MAV_SYS_STATUS_SENSOR flag in source.sensorsHealth) { result.sensorsHealth.Add(flag.ToString()); } result.sensorsPresent = new List <String>(); foreach (MAVLink.MAV_SYS_STATUS_SENSOR flag in source.sensorsPresent) { result.sensorsPresent.Add(flag.ToString()); } return(result); }
public void ProcessData(SystemStatus urineProcessor, SystemStatus waterProcessor) { if (urineProcessor == SystemStatus.Processing) { if (Level <= 96) { Level += 4; } else { Level = 0; } } if (waterProcessor == SystemStatus.Processing) { if (Level >= 6) { Level -= 6; } else { Level = 0; } } }
private async Task SyncDatabaseTablesAsync() { // UseDefaultBuildEngine=null should be considered false var organizations = await OrganizationRepository .Get() .Where(o => o.UseDefaultBuildEngine == null || o.UseDefaultBuildEngine.Value == false) .ToListAsync(); var defaultOrganization = GetOrganizationDefaultSettings(); if (defaultOrganization != null) { organizations.Add(defaultOrganization); } var statuses = await SystemStatusRepository.GetListAsync(); var removeList = statuses.Except(organizations, new BuildEngineReferenceComparer()).ToList(); var addList = organizations.Except(statuses, new BuildEngineReferenceComparer()).ToList(); foreach (SystemStatus removeEntry in removeList) { await SystemStatusRepository.DeleteAsync(removeEntry.Id); } foreach (Organization addEntry in addList) { var newEntry = new SystemStatus { BuildEngineApiAccessToken = addEntry.BuildEngineApiAccessToken, BuildEngineUrl = addEntry.BuildEngineUrl }; await SystemStatusRepository.CreateAsync(newEntry); } }
public void SaveProfitAndLoss(SystemStatus systemStatus, StocktakingLogHd hd, List <StocktakingLogDtl> dtlList, List <ProfitAndLoss> insertList, List <ProfitAndLoss> updateList) { using (WmsContext db = EDMXFty.Dc) { DALFty.Create <InventoryDAL>().SaveProfitAndLoss(db, systemStatus, hd, dtlList, insertList, updateList); } }
public async Task <IActionResult> PutSystemStatus(int id, SystemStatus systemStatus) { if (id != systemStatus.Id) { return(BadRequest()); } _context.Entry(systemStatus).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SystemStatusExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
/// <summary> /// Start traffic manager. /// </summary> public void Start() { OTCContext.Project.DigitalSystem.CommandReceived += DigitalSystem_OnCommandReceived; this.TrafficStatusChanged?.Invoke(this, new EventArgs()); this.Status = SystemStatus.Started; }
public void MarkFirstRun() { var status = SystemStatus.First(); status.IsFirstRun = false; _db.Update(status); }
void SetSystemStatus(SystemStatus status) { lock (LockSystemStatus) { mSystemStatus = status; } }
internal GenericActionResult HandleStatusUpdate(string workerName, SystemStatus status) { if (status == null) { return(new GenericActionResult(false, "Invalid status object: null")); } workers.AddOrUpdate(workerName, (key) => { logger.Info($"Registering new backtester worker {workerName}"); return(new BacktesterWorkerModel() { Attributes = status.Attributes.ToSystemStatusAttributeModels(), Datacenter = status.Datacenter, IsRunning = status.IsAlive, LastHeardFrom = status.LastHeardFrom, Name = workerName, OverallStatus = status.OverallStatus, StartTime = status.StartTime }); }, (key, oldValue) => { oldValue.Attributes = status.Attributes.ToSystemStatusAttributeModels(); oldValue.Datacenter = status.Datacenter; oldValue.IsRunning = status.IsAlive; oldValue.LastHeardFrom = status.LastHeardFrom; oldValue.OverallStatus = status.OverallStatus; oldValue.StartTime = status.StartTime; return(oldValue); }); return(new GenericActionResult(true, $"Updated status of worker {workerName}")); }
///----------------------------------------------------------------------------------------- /// Class: <BNO055> /// Method: <GetStatus> /// Description: 'This method gets the system status of the sensor.' /// /// Inputs: (bool) runSelfTest /// Output: SystemStatus /// /// Author: <Steven_Pugia> /// Notes: <None> ///----------------------------------------------------------------------------------------- public SystemStatus GetStatus(bool runSelfTest) { byte selfTest = new byte(); if (runSelfTest) { SetMode(OPERATION_MODE_CONFIG); Task.Delay(30).Wait(); byte sysTrigger = ReadBytes(BNO055_SYS_TRIGGER_ADDR, 1)[0]; WriteByte(BNO055_SYS_TRIGGER_ADDR, (byte)(sysTrigger | 0x01), true); Task.Delay(1000).Wait(); selfTest = ReadBytes(BNO055_SELFTEST_RESULT_ADDR, 1)[0]; SetMode(OPERATION_MODE_NDOF); Task.Delay(30).Wait(); } SystemStatus status = new SystemStatus(); status.SelfTestResult = selfTest; status.StatusReg = ReadBytes(BNO055_SYS_STAT_ADDR, 1)[0]; status.ErrorReg = ReadBytes(BNO055_SYS_ERR_ADDR, 1)[0]; return(status); }
public void ProcessData() { GenerateData(); if (Status == SystemStatus.Processing) { SimulateProcessing(); // if stores are almost empty, change to standby state if ((H2StoreLevel <= storeEmpty) || (Co2StoreLevel <= storeEmpty)) { Status = SystemStatus.Standby; lastStatus = Status; TurnOff(); } } else if (Status == SystemStatus.Standby) { SimulateStandby(); // if stores are getting full, change to processing state if ((H2StoreLevel > storeReadyToProcess) && (Co2StoreLevel > storeReadyToProcess)) { Status = SystemStatus.Processing; lastStatus = Status; TurnOn(); } } else { SimulateStandby(); } }
public void FinishCheck(SystemStatus systemStatus, StocktakingLogHd hd, List <ProfitAndLossLog> plLogList, List <InventoryLossLog> lossLogList, List <UnlistedGoodsLog> ugLogList, List <InventoryLog> stockLogList) { using (WmsContext db = EDMXFty.Dc) { DALFty.Create <InventoryDAL>().FinishCheck(db, systemStatus, hd, plLogList, lossLogList, ugLogList, stockLogList); } }
/// <summary> /// Set the service status in iOS. Should not be used on Android /// </summary> /// <param name="isRunning"></param> public void SetIosServiceRunningStatus(bool isRunning) { var status = SystemStatus.First(); status.IosServiceIsRunning = isRunning; _db.Update(status); }
public void UpdateConference(int id, string Call2Sid, SystemStatus systemStatus) { try { //SystemStatus sysStat = (SystemStatus)systemStatus; using (var _dbContext = new TwilloDbContext()) { var found = _dbContext.TwilioConferenceCalls.Find(id); if (found != null) { if (found.PhoneCall2SID == null) { found.PhoneCall2SID = Call2Sid; } if (found.SystemStatus != SystemStatus.CONFERENCE_COMPLETED) { found.SystemStatus = systemStatus; } } _dbContext.SaveChanges(); } } catch (Exception ex) { ErrorMessage(string.Format("|Error Message - {0}| 1.Source {1} | 2.Trace {2} |3.Inner Exception {3} |", ex.Message, ex.Source, ex.StackTrace, ex.InnerException)); throw; } }
public void ProcessData(SystemStatus urineProcessor, SystemStatus waterProcessor) { if (urineProcessor == SystemStatus.Processing) { if (Level <= (full - fillIncrement)) { Level += fillIncrement; } else { Level = full; } } if (waterProcessor == SystemStatus.Processing) { if (Level >= (empty + emptyIncrement)) { Level -= emptyIncrement; } else { Level = empty; } } }
/// <summary> /// Toggles a flag to change the staus to 'trouble' if there is some kind of trouble with the system /// </summary> private void Trouble() { if (!trouble) { lastWorkingStatus = Status; trouble = true; } }
public async Task UpdateSystemStatus() { SystemStatus st = new SystemStatus(); st.LastPingDate = DateTime.UtcNow; st.SystemName = Constants.PServiceLogger; await _database.GetCollection <SystemStatus>("SystemStatus").ReplaceOneAsync(s => s.SystemName == st.SystemName, st); }
public async Task <string> GetAsync(string id) { SystemStatus systemStatus = new SystemStatus(); SystemStatusType systemStatysType = (SystemStatusType)Enum.Parse(typeof(SystemStatusType), id); string statusValue = await systemStatus.GetCurrentSystemStatusAsync(systemStatysType); return(statusValue); }
public void EmptyTest(bool isPrivileged) { Assert.DoesNotThrow(() => _sut = new SystemStatus(new IHealthCheck[] { }, isPrivileged)); Assert.IsEmpty(_sut.Names); Assert.IsEmpty(_sut.RunAllChecks()); Assert.Throws <KeyNotFoundException>(() => _sut.RunCheck("NotFoundCheck")); Assert.Throws <KeyNotFoundException>(() => _sut.RunProbeCheck("NotFoundCheck", "Node1")); }
/// <summary> /// Login automatically using the settings from the auto login XML file. /// </summary> /// <returns></returns> private bool AutoLogin() { bool retVal = false; if (File.Exists(Globals.AutoLoginFile)) { UpdateStatus(0, 0, "Performing automatic login", "", false); this.Text = "EMMA - Logging in..."; XmlDocument autoLoginXML = new XmlDocument(); try { autoLoginXML.Load(Globals.AutoLoginFile); XmlNode usernameNode = autoLoginXML.SelectSingleNode("/Settings/Username"); string username = usernameNode.FirstChild.Value; XmlNode passwordNode = autoLoginXML.SelectSingleNode("/Settings/Password"); string password = ""; if (passwordNode.FirstChild != null) { password = passwordNode.FirstChild.Value; } try { Diagnostics.StartTimer("OpenAccount"); UserAccount.OpenAccount(username, password); Diagnostics.StopTimer("OpenAccount"); } catch (EMMALicensingException ex) { // If this occurs then it means that the account is logged in but the // default report group cannot be used. Just let the user know and then // continue as normal. splash.ShowMessage( "Licensing problem when opening default report group: " + ex.Message, "Licensing Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } retVal = true; _status = UserAccount.CurrentGroup == null ? SystemStatus.NoReportGroupSelected : SystemStatus.Complete; } catch(Exception ex) { //UpdateStatus(0, 0, "Done", "", true); splash.ShowMessage( "Problem during auto login: "******"Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } return retVal; }
/// <summary> /// Prompt the user to login. /// </summary> /// <returns>True if the user sucessfully logged in, false otherwise.</returns> private bool Login() { bool retVal = false; Login login = new Login(); DialogResult result = login.ShowDialog(this); if (result == DialogResult.Cancel && UserAccount.Name.Equals("")) { _status = SystemStatus.NoUserLoggedIn; RefreshDisplay(); } else if (result == DialogResult.Cancel) { _status = SystemStatus.NoReportGroupSelected; RefreshDisplay(); } else { _status = UserAccount.CurrentGroup == null ? SystemStatus.NoReportGroupSelected : SystemStatus.Complete; InitaliseUpdatesRunning(); RefreshDisplay(); retVal = true; } return retVal; }
private void SetupEnvironment() { if (!Directory.Exists(Globals.AppDataDir)) { Directory.CreateDirectory(Globals.AppDataDir); } // Make sure that required sub directories exist. if (!Directory.Exists(string.Format("{0}Logging", Globals.AppDataDir))) { Directory.CreateDirectory(string.Format("{0}Logging", Globals.AppDataDir)); } if (!Directory.Exists(string.Format("{0}Logging{1}API Call History", Globals.AppDataDir, Path.DirectorySeparatorChar))) { Directory.CreateDirectory(string.Format("{0}Logging{1}API Call History", Globals.AppDataDir, Path.DirectorySeparatorChar)); } if (!Directory.Exists(string.Format("{0}Logging{1}Eve Central History", Globals.AppDataDir, Path.DirectorySeparatorChar))) { Directory.CreateDirectory(string.Format("{0}Logging{1}Eve Central History", Globals.AppDataDir, Path.DirectorySeparatorChar)); } if (Directory.Exists(string.Format("{0}Temp", Globals.AppDataDir))) { Directory.Delete(string.Format("{0}Temp", Globals.AppDataDir), true); } Directory.CreateDirectory(string.Format("{0}Temp", Globals.AppDataDir)); if (!Directory.Exists(string.Format("{0}Logging", Globals.AppDataDir)) || !Directory.Exists(string.Format("{0}Logging{1}API Call History", Globals.AppDataDir, Path.DirectorySeparatorChar)) || !Directory.Exists(string.Format("{0}Logging{1}Eve Central History", Globals.AppDataDir, Path.DirectorySeparatorChar)) || !Directory.Exists(string.Format("{0}Temp", Globals.AppDataDir))) { //UpdateStatus(0, 0, "Done", "", true); //MessageBox.Show((splash != null ? (IWin32Window)splash : (IWin32Window)this), // "Unable to create required sub-directories.", "Error", // MessageBoxButtons.OK, MessageBoxIcon.Error); throw new EMMAException(ExceptionSeverity.Critical, "Unable to create required " + "sub-directories."); } // This directory is used by the auto updater to temporarilly store a copy of itself. // If it's present on the system then just remove it to keep things tidy. string tmpDir = Globals.AppDataDir + Path.DirectorySeparatorChar + "Update"; if (Directory.Exists(tmpDir)) { Directory.Delete(tmpDir, true); } if (!Directory.Exists(string.Format("{0}Data", Globals.AppDataDir))) { Directory.CreateDirectory(string.Format("{0}Data", Globals.AppDataDir)); } if (Properties.Settings.Default.EMMA_DatabaseConnectionString.Contains("EMMA Database.mdf")) { string emmaDataFile = string.Format("{0}Data{1}EMMA Database.mdf", Globals.AppDataDir, Path.DirectorySeparatorChar); string eveDataFile = string.Format("{0}Data{1}EveData.mdf", Globals.AppDataDir, Path.DirectorySeparatorChar); if (!File.Exists(emmaDataFile)) { File.Copy(string.Format("{0}Data{1}EMMA Database.mdf", AppDomain.CurrentDomain.BaseDirectory, Path.DirectorySeparatorChar), emmaDataFile); File.Copy(string.Format("{0}Data{1}EMMA Database_log.ldf", AppDomain.CurrentDomain.BaseDirectory, Path.DirectorySeparatorChar), string.Format("{0}Data{1}EMMA Database_log.ldf", Globals.AppDataDir, Path.DirectorySeparatorChar)); } if (!File.Exists(eveDataFile)) { File.Copy(string.Format("{0}Data{1}EveData.mdf", AppDomain.CurrentDomain.BaseDirectory, Path.DirectorySeparatorChar), eveDataFile); File.Copy(string.Format("{0}Data{1}EveData_log.ldf", AppDomain.CurrentDomain.BaseDirectory, Path.DirectorySeparatorChar), string.Format("{0}Data{1}EveData_log.ldf", Globals.AppDataDir, Path.DirectorySeparatorChar)); } } AppDomain.CurrentDomain.SetData("DataDirectory", Globals.AppDataDir); // Initalise the updates running structure. This keeps track of which database tables // are being updated and is used to enable/disable main menu items. InitaliseUpdatesRunning(); // Database connections are limited so make sure that we can never be running more than 8 // threads trying to access the database at once . // (tasks are queued in APICharacter.UpdateDataFromAPI) ThreadPool.SetMaxThreads(8, 8); // Set initial user status _status = SystemStatus.NoUserLoggedIn; }
private bool UserLoggedIn() { bool retVal = true; if (UserAccount.Name.Equals("")) { MessageBox.Show("Error, No user currently logged in"); retVal = false; _status = SystemStatus.NoUserLoggedIn; RefreshDisplay(); } return retVal; }
/// <summary> /// Prompt the user to select a report group. /// </summary> private void SelectReportGroup() { if (UserLoggedIn()) { ManageReportGroups rptGroup = new ManageReportGroups(); DialogResult result = rptGroup.ShowDialog(); if (result == DialogResult.Cancel && UserAccount.CurrentGroup == null) { _status = SystemStatus.NoReportGroupSelected; InitaliseUpdatesRunning(); RefreshDisplay(); } else if (result == DialogResult.Cancel && UserAccount.CurrentGroup != null) { _status = SystemStatus.Complete; RefreshDisplay(); } else if (result != DialogResult.Cancel) { try { UserAccount.CurrentGroup = rptGroup.SelectedGroup; UserAccount.Settings.FirstRun = false; _status = SystemStatus.Complete; InitaliseUpdatesRunning(); if (_updateStatus != null && _updateStatus.Visible) { _updateStatus.Close(); _updateStatus = null; } if (_unackOrders != null && _unackOrders.Visible) { _unackOrders.Close(); _unackOrders = null; } if (_unackAssets != null && _unackAssets.Visible) { _unackAssets.Close(); _unackAssets = null; } RefreshDisplay(); } catch (Exception ex) { if (!(ex is EMMAException)) { new EMMAException(ExceptionSeverity.Error, "Error while trying to change report group", ex); } MessageBox.Show("Error while trying to change report group: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private bool ReportGroupSelected() { bool retVal = true; if (UserAccount.CurrentGroup == null) { MessageBox.Show("Error, No report group currently selected"); retVal = false; _status = SystemStatus.NoReportGroupSelected; RefreshDisplay(); } return retVal; }
/// <summary> /// Logoff the current user /// </summary> private void Logout() { Cursor = Cursors.WaitCursor; try { if (_updateStatus != null && !_forceClose) { _updateStatus.BlockUntilUpdated(); } if (Globals.calculator != null) { Globals.calculator.StoreSizeAndPos(); } UserAccount.Logout(); _status = SystemStatus.NoUserLoggedIn; InitaliseUpdatesRunning(); RefreshDisplay(); } finally { Cursor = Cursors.Default; } }
/// <summary> /// Create Get Log state reply object /// </summary> /// <param name="reply">Raw 9 or 21-bit Get Log State reply</param> public LogState(byte[] reply) { if (!((9 == reply.Length) || (20 == reply.Length))) { throw new ArgumentOutOfRangeException("GetLogState replies must be 9 or 20 bytes in length"); } int offset = 0; _LimitCount = new LimitCounter(reply, offset); offset += 4; _SystemStat = new SystemStatus(reply, offset); offset += 4; if (20 == reply.Length) { _SetShelLifeBlock0 = new ShelfLifeBlock0(reply, offset); offset += 4; _SetShelLifeBlock1 = new ShelfLifeBlock1(reply, offset); offset += 4; _remainingShelfLife = GetRemainingShelfLife(reply, offset); offset += 3; } _StatFlags = new StatusFlags(reply[offset]); offset += 1; }
private void UpdateMPStatus() { this.MPStatus_old = this.MPStatus; MiniDisplayHelper.GetSystemStatus(ref this.MPStatus); if (this.MPStatus.Equals(this.MPStatus_old)) { this._StatusChanged = false; } else { this._StatusChanged = true; } }
public void Refresh(SystemStatus status) { switch (status) { case SystemStatus.NoUserLoggedIn: btnManageGroup.Enabled = false; btnChangeGroup.Enabled = false; btnSettings.Enabled = false; btnTutorial.Enabled = true; btnExport.Enabled = false; btnImport.Enabled = false; btnLicense.Enabled = true; btnVerifyDB.Enabled = true; btnAbout.Enabled = true; btnLogout.Text = "&Login"; btnLogout.Tag = ControlPanelOption.Login; break; case SystemStatus.NoReportGroupSelected: btnManageGroup.Enabled = false; btnChangeGroup.Enabled = true; btnSettings.Enabled = false; btnTutorial.Enabled = true; btnExport.Enabled = false; btnImport.Enabled = false; btnLicense.Enabled = true; btnVerifyDB.Enabled = true; btnAbout.Enabled = true; btnLogout.Text = "&Logout"; btnLogout.Tag = ControlPanelOption.Logout; break; case SystemStatus.Complete: btnManageGroup.Enabled = true; btnChangeGroup.Enabled = true; btnSettings.Enabled = true; btnTutorial.Enabled = true; btnExport.Enabled = true; btnLicense.Enabled = true; btnVerifyDB.Enabled = true; btnAbout.Enabled = true; btnImport.Enabled = UserAccount.CurrentGroup.AccessLevel == GroupAccess.Full; btnLogout.Text = "&Logout"; btnLogout.Tag = ControlPanelOption.Logout; break; default: break; } }
public void TellSystemStatus(string computerId, SystemStatus status) { Console.WriteLine(computerId); Console.WriteLine(status); }