public static void RefreshBaro() { string BaroGBText = "Baro Farmer ("; DateTime BaroTimeHolder = Module_Data.BaroStartsAt; if (DateTime.UtcNow < Module_Data.BaroStartsAt) { BaroGBText += "Arrives in "; } else { BaroGBText += "Leaves in "; BaroTimeHolder = BaroTimeHolder.AddDays(2); if (DateTime.UtcNow > BaroTimeHolder) { Module_Data.GetBaroData(); return; } } TimeSpan TimeSpanHolder = BaroTimeHolder - DateTime.UtcNow; string String_Days = TimeSpanHolder.TotalDays < 1 ? "" : (TimeSpanHolder.Days.ToString() + "d "); string String_Hours = TimeSpanHolder.TotalHours < 1 ? "" : (TimeSpanHolder.Hours.ToString() + "h "); string String_Minutes = TimeSpanHolder.TotalMinutes < 1 ? "" : (TimeSpanHolder.Minutes.ToString() + "m "); Form_Main._FormReference.Baro_GroupBox.Text = BaroGBText + string.Format("{0}{1}{2}{3})", String_Days, String_Hours, String_Minutes, TimeSpanHolder.TotalMinutes <= 1 ? TimeSpanHolder.Seconds.ToString() + "s" : ""); Form_Main._FormReference.BaroTimer_Timer.Stop(); Form_Main._FormReference.BaroTimer_Timer.Interval = 1000 * (TimeSpanHolder.TotalMinutes < 2 ? 1 : 60); Form_Main._FormReference.BaroTimer_Timer.Start(); }
private void Form_Main_Load(object sender, EventArgs e) { _FormReference = this; ServicePointManager.DefaultConnectionLimit = 4; Module_Data.DataModule_Initialize(); ListFissures(); Module_OCR.OCR_Initialize(); Module_Baro.RefreshBaro(); this.CenterToScreen(); Module_Hotkeys.Module_Hotkeys_Initialize(); CB_Mute.Checked = Settings.Default.MuteSounds; }
private void Fissure_BGW_DoWork(object sender, DoWorkEventArgs e) { Thread.Sleep(15000); //wait 15s Module_Data.GetFissureData(); }