public override void OnButtonPress() { Logging.Write("IsConnected: {0}", IsConnected); foreach (string name in HBRelogRemoteApi.GetProfileNames()) { Logging.Write("{1}: GetProfileStatus: {0}", HBRelogRemoteApi.GetProfileStatus(name), name); HBRelogRemoteApi.SetProfileStatusText(HbProcId, TreeRoot.StatusText); } }
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 int GetProfileStatus(string profileName) { return(HBRelogRemoteApi.GetProfileStatus(profileName)); }