public override void Deserialize(GenericReader reader) { base.Deserialize(reader); m_version = reader.ReadInt(); switch (m_version) { case 1: { goto case 0; } case 0: { m_Focus = reader.ReadMobile(); if (m_Focus != null) { m_AttackTimer = new AttackTimer(this); m_AttackTimer.Start(); } else { m_IdleTimer = new IdleTimer(this, m_LastFocus, PoofingGuard); m_IdleTimer.Start(); } break; } } }
private async void btnSubmitError_Click(object sender, EventArgs e) { DowntimeTimer.Stop(); try { //await _connection.InvokeAsync("Send", "WinFormsApp", messageTextBox.Text); await _connection.InvokeAsync("SendMachineError", DateTime.Now.ToString(), cmbErrorReason.Text, txtErrorDescription.Text); Log(Color.Brown, "SendError to server " + ": " + cmbErrorReason.Text, messagesList); } catch (Exception ex) { Log(Color.Red, ex.ToString(), messagesList); serverRequestData = false; countSenddataToHubs = 0; } txtErrorDescription.Text = ""; //Send data Hubs tikerTime = DateTime.Now.TimeOfDay; countIdletimes = tikerTime - startTime - countRunningtimes - countDownTimetimes - countSettingtimes; bbcountIdletimes = countIdletimes; PanelAlertMessage.BackColor = Color.DarkOrange; IdleTimer.Start(); }
public override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (EditorID != null) { ele.TryPathTo("EditorID", true, out subEle); EditorID.WriteXML(subEle, master); } if (ObjectBounds != null) { ele.TryPathTo("ObjectBounds", true, out subEle); ObjectBounds.WriteXML(subEle, master); } if (IdleMarkerFlags != null) { ele.TryPathTo("IdleMarkerFlags", true, out subEle); IdleMarkerFlags.WriteXML(subEle, master); } if (AnimationCount != null) { ele.TryPathTo("AnimationCount", true, out subEle); AnimationCount.WriteXML(subEle, master); } if (IdleTimer != null) { ele.TryPathTo("IdleTimer", true, out subEle); IdleTimer.WriteXML(subEle, master); } if (Animations != null) { ele.TryPathTo("Animations", true, out subEle); Animations.WriteXML(subEle, master); } }
public override void Destroy() { // stops the timmer IdleTimer.Reset(); LifetimeTimer.Reset(); base.Destroy(); }
public override void WriteData(ESPWriter writer) { if (EditorID != null) { EditorID.WriteBinary(writer); } if (ObjectBounds != null) { ObjectBounds.WriteBinary(writer); } if (IdleMarkerFlags != null) { IdleMarkerFlags.WriteBinary(writer); } if (AnimationCount != null) { AnimationCount.WriteBinary(writer); } if (IdleTimer != null) { IdleTimer.WriteBinary(writer); } if (Animations != null) { Animations.WriteBinary(writer); } }
public void AddIdleTimer(Guid uniqueId, IdleTimer idleTimer) { var timer = GetTimer(uniqueId); timer.AddIdleTimer(idleTimer); SaveTimers(); }
public override void Shutdown() { lock (_list) { List <EntityIdle> list = new List <EntityIdle>(_list); foreach (EntityIdle idle in list) { idle.Remove(Owner); } Debug.Assert(Empty); } if (IdleTimer != null) { lock (IdleTimer) { IdleTimer.Dispose(); IdleTimer = null; } } base.Shutdown(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 0: { m_Focus = reader.ReadMobile(); if (m_Focus != null) { m_AttackTimer = new AttackTimer(this); m_AttackTimer.Start(); } else { m_IdleTimer = new IdleTimer(this); m_IdleTimer.Start(); } break; } } }
public override void ReadDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (ele.TryPathTo("EditorID", false, out subEle)) { if (EditorID == null) { EditorID = new SimpleSubrecord <String>(); } EditorID.ReadXML(subEle, master); } if (ele.TryPathTo("ObjectBounds", false, out subEle)) { if (ObjectBounds == null) { ObjectBounds = new ObjectBounds(); } ObjectBounds.ReadXML(subEle, master); } if (ele.TryPathTo("IdleMarkerFlags", false, out subEle)) { if (IdleMarkerFlags == null) { IdleMarkerFlags = new SimpleSubrecord <IdleMarkerFlags>(); } IdleMarkerFlags.ReadXML(subEle, master); } if (ele.TryPathTo("AnimationCount", false, out subEle)) { if (AnimationCount == null) { AnimationCount = new SimpleSubrecord <Byte>(); } AnimationCount.ReadXML(subEle, master); } if (ele.TryPathTo("IdleTimer", false, out subEle)) { if (IdleTimer == null) { IdleTimer = new SimpleSubrecord <Single>(); } IdleTimer.ReadXML(subEle, master); } if (ele.TryPathTo("Animations", false, out subEle)) { if (Animations == null) { Animations = new FormArray(); } Animations.ReadXML(subEle, master); } }
public override Task DestroyAsync() { // stops the timer IdleTimer.Reset(); LifetimeTimer.Reset(); return(base.DestroyAsync()); }
public override async Task DestroyAsync() { // stops the timer IdleTimer.Reset(); LifetimeTimer.Reset(); await base.DestroyAsync(); }
public void AddIdleTimer(IdleTimer idleTimer) { if (idleTimer.IsRunning) { throw new IdleTimerRunningException("Cannot add time from a running idle timer!"); } CurrentTime = CurrentTime.Add(idleTimer.CurrentTime); }
public LockedTimerModel(IdleTimer idleTimer) { DateAndTimeForTimer = idleTimer.DateStarted; Date = $"{idleTimer.DateStarted.ToString("ddd, dd MMM")} at {idleTimer.DateStarted.ToString("t")}"; UniqueId = idleTimer.UniqueId; IdleTimeValue = idleTimer.IdleTimeValue.FormatAsString(false); IdleTime = idleTimer.IdleTimeValue; IsSelected = false; }
public void AddIdleTimer(IdleTimer idleTimer) { if (idleTimer.IsRunning) { throw new IdleTimerRunningException("Cannot add time from a running idle timer!"); } CurrentTime = CurrentTime.Add(idleTimer.IdleTimeValue); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ExactCurrentTime")); }
public override void Update() { base.Update(); Updated = DateTime.Now; if (IdleTimer != null) { lock (IdleTimer) IdleTimer.Change(Period, Timeout.InfiniteTimeSpan); } }
public void AddIdleTimer(Guid uniqueId, IdleTimer idleTimer) { var timer = GetTimer(uniqueId); timer.AddIdleTimer(idleTimer); SaveTimers(); if (exportSettings.ExportPrompt != null && exportSettings.ExportPrompt.OnAddIdle && !timer.FullyExported) { exportPrompt.Invoke(this, new ExportPromptDetail(uniqueId, idleTimer.IdleTimeValue)); } }
public MeditechPage(PanaceaServices core) { _core = core; _logger = core.Logger; _loadingwindow = new LoadingWindow(); _timer = new IdleTimer(TimeSpan.FromSeconds(Timeout)); _timer.Tick += _timer_Elapsed; _checker = new DispatcherTimer(); _checker.Interval = TimeSpan.FromSeconds(3); _checker.Tick += _checker_Tick; }
private void btnResetConfig_Click(object sender, EventArgs e) { PanelAlertMessage.BackColor = Color.Gray; lbAlertMessage.Text = "RESET TIME"; lbAlertMessage.Left = (PanelAlertMessage.Width - lbAlertMessage.Width) / 2; //reset data and save to local IdleTimer.Stop(); RuningTimer.Stop(); SettingTimer.Stop(); DowntimeTimer.Stop(); countSettingtimes = new TimeSpan(0); countIdletimes = new TimeSpan(0); countDownTimetimes = new TimeSpan(0); countRunningtimes = new TimeSpan(0); txtRunningTimes.Text = "00h:00m:00s"; txtSettingTimes.Text = "00h:00m:00s"; txtDownTimes.Text = "00h:00m:00s"; txtIdleTimes.Text = "00h:00m:00s"; Properties.Settings.Default.RunningTimes = countRunningtimes; Properties.Settings.Default.DownTimes = countDownTimetimes; Properties.Settings.Default.SettingTimes = countSettingtimes; Properties.Settings.Default.Save(); planQty = 0; expectValue = 0; totalInputValue = 0; totalPassValue = 0; yieldValue = 0.0; OEEValue = 0.0; expectRatio = 0; qtyPerInput = 0; txtQtyPlan.Text = planQty.ToString(); txtQtyExpect.Text = expectValue.ToString(); txtQtyInput.Text = totalInputValue.ToString(); btnQtyPass.Text = totalPassValue.ToString(); txtQtyYield.Text = yieldValue.ToString("N2") + "%"; txtOEEvalue.Text = OEEValue.ToString("N3") + "%"; tikerTime = DateTime.Now.TimeOfDay; countIdletimes = tikerTime - startTime - countRunningtimes - countDownTimetimes - countSettingtimes; bbcountIdletimes = countIdletimes; PanelAlertMessage.BackColor = Color.DarkOrange; IdleTimer.Start(); }
private void btnMachineError_Click(object sender, EventArgs e) { txtMessage.Text = "Machine is error"; tikerTime = DateTime.Now.TimeOfDay; RuningTimer.Stop(); IdleTimer.Stop(); SettingTimer.Stop(); PanelAlertMessage.BackColor = Color.Crimson; bbcountDownTimetimes = countDownTimetimes; DowntimeTimer.Start(); }
private void btnTrial_Click(object sender, EventArgs e) { txtMessage.Text = "Machine is trial"; tikerTime = DateTime.Now.TimeOfDay; RuningTimer.Stop(); IdleTimer.Stop(); DowntimeTimer.Stop(); PanelAlertMessage.BackColor = Color.DeepSkyBlue; bbcountSettingtimes = countSettingtimes; SettingTimer.Start(); }
private async void CreateTimerFromInactive(object sender, MouseButtonEventArgs e) { var dummyIdleTimer = new IdleTimer(DateTime.Now, DateTime.Now, Model.TimeActivity, Guid.NewGuid()); var addFlyout = new AddTimer(ModelHelpers, idleTimers: new List <IdleTimer> { dummyIdleTimer }, enableDateChange: false); await ModelHelpers.OpenFlyout(addFlyout); if (addFlyout.AddedTimer) { ModelHelpers.SetSelectedTimer(addFlyout.NewTimerId); ModelHelpers.Gallifrey.ResetInactiveAlert(); } }
private void Start() { DontDestroyOnLoad(gameObject); if (!instance) { instance = this; } else { Destroy(gameObject); } currentTime = startingTime; }
protected override bool OnMove(Direction d) { if (!(Region is Regions.GuardedRegion)) { if (m_IdleTimer == null) { m_IdleTimer = new IdleTimer(this); } if (!m_IdleTimer.Running) { m_IdleTimer.Start(); } } return(base.OnMove(d)); }
public bool PreFilterMessage(ref Message m) { if (m.Msg == WM_MOUSEMOVE) // mouse move is high volume { return(false); } if (!IdleTimer.Enabled) // idling? { return(false); // No } if (Array.BinarySearch(Messages, m.Msg) >= 0) { IdleTimer.Stop(); } return(false); }
private void btnExit_Click(object sender, EventArgs e) { IdleTimer.Stop(); currentTimer.Stop(); RuningTimer.Stop(); SettingTimer.Stop(); DowntimeTimer.Stop(); updateChartTimer.Stop(); Properties.Settings.Default.RunningTimes = countRunningtimes; Properties.Settings.Default.DownTimes = countDownTimetimes; Properties.Settings.Default.SettingTimes = countSettingtimes; Properties.Settings.Default.Save(); Close(); }
private void btnStop_Click(object sender, EventArgs e) { getJobFromHubs = false; txtBarcode.Enabled = true; txtBarcode.Text = "SCAN BARCODE"; txtMessage.Text = "Machine is stop"; RuningTimer.Stop(); SettingTimer.Stop(); DowntimeTimer.Stop(); PanelAlertMessage.BackColor = Color.DarkOrange; tikerTime = DateTime.Now.TimeOfDay; countIdletimes = tikerTime - startTime - countRunningtimes - countDownTimetimes - countSettingtimes; bbcountIdletimes = countIdletimes; IdleTimer.Start(); }
public async Task ProcessStart(ActionButtonModel action) { if (_action != null) { throw new InvalidOperationException("Cannot start a new process if another one is running"); } _action = action; if (!string.IsNullOrEmpty(_action.Settings.PreRunScript)) { try { await ExecuteScriptAsync(_action.Settings.PreRunScript); } catch (Exception ex) { _core.Logger.Error(this, $"PreRun script failed with message: {ex.Message}"); OnProcessCompleted(); return; } } try { var mainProcess = new Process { StartInfo = new ProcessStartInfo(_action.Settings.Path) { Arguments = _action.Settings.ProgramParams ?? "" } }; mainProcess.Start(); mainProcess.WaitForInputIdle(); _processTimer = new IdleTimer(TimeSpan.FromSeconds(_action.Settings.IdleTime * 1000 * 60)); _processTimer.Start(); _processTimer.Tick += ProcessTimerCheck; } catch (Exception ex) { _core.Logger.Error(this, $"Main process failed with message: {ex.Message}"); OnProcessCompleted(); return; } }
public async Task BeginInit() { //todo _comm.RegisterUri("meditech", OnUri); try { var response = await _core.HttpClient.GetObjectAsync <GetMeditechSettingsResponse>("meditech/get_settings/"); if (response.Success) { _settings = response.Result; Timeout = response.Result.Timeout; _timer?.Stop(); _timer = new IdleTimer(TimeSpan.FromSeconds(Timeout)); _timer.Tick += _timer_Elapsed; } } catch { } }
private void btnStart_Click(object sender, EventArgs e) { // job detail from server if (txtJobNo.Text != "") { txtBarcode.Enabled = false; txtMessage.Text = "Machine is running"; tikerTime = DateTime.Now.TimeOfDay; IdleTimer.Stop(); SettingTimer.Stop(); DowntimeTimer.Stop(); PanelAlertMessage.BackColor = Color.LimeGreen; bbcountRunningtimes = countRunningtimes; RuningTimer.Start(); } else { MessageBox.Show("Please scan barcode or key job number before start"); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: { m_IsAutoGuard = reader.ReadBool(); goto case 0; } case 0: { if (version < 1) { m_IsAutoGuard = true; } m_Focus = reader.ReadMobile(); if (m_Focus != null) { m_AttackTimer = new AttackTimer(this); m_AttackTimer.Start(); } else if (m_IsAutoGuard) { m_IdleTimer = new IdleTimer(this); m_IdleTimer.Start(); } break; } } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 1: { m_IsAutoGuard = reader.ReadBool(); goto case 0; } case 0: { if ( version < 1 ) m_IsAutoGuard = true; m_Focus = reader.ReadMobile(); if ( m_Focus != null ) { m_AttackTimer = new AttackTimer( this ); m_AttackTimer.Start(); } else if ( m_IsAutoGuard ) { m_IdleTimer = new IdleTimer( this ); m_IdleTimer.Start(); } break; } } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 0: { m_Focus = reader.ReadMobile(); if ( m_Focus != null ) { m_AttackTimer = new AttackTimer( this ); m_AttackTimer.Start(); } else { m_IdleTimer = new IdleTimer( this ); m_IdleTimer.Start(); } break; } } }
protected override bool OnMove( Direction d ) { if ( !(Region is Regions.GuardedRegion) ) { if ( m_IdleTimer == null ) m_IdleTimer = new IdleTimer( this ); if ( !m_IdleTimer.Running ) m_IdleTimer.Start(); } return base.OnMove (d); }