public static void MonitorTimerCb(object sender, EventArgs args) { try { if (!IsConnected) { return; } if (!TreeRoot.IsRunning) { int profileStatus = HBRelogRemoteApi.GetProfileStatus(CurrentProfileName); // if HB isn't running after 30 seconds // and the HBRelog profile isn't paused then restart hb if (profileStatus != 1 && DateTime.Now - _runningTimeStamp >= TimeSpan.FromSeconds(50)) { HBRelogRemoteApi.RestartHB(HbProcId); } } else { _runningTimeStamp = DateTime.Now; } if (TreeRoot.StatusText != _lastStatus && !string.IsNullOrEmpty(TreeRoot.StatusText)) { HBRelogRemoteApi.SetProfileStatusText(HbProcId, TreeRoot.StatusText); _lastStatus = TreeRoot.StatusText; } if (InfoPanel.IsMeasuring) { UpdateTooltip(); } } catch (Exception ex) { Logging.WriteException(ex); } }
public static void RestartHB() { HBRelogRemoteApi.RestartHB(HbProcID); }