/// <summary> /// Display a warning string if the settings are incorrect. /// </summary> /// <param name="cei">CEI Time. Sample time.</param> /// <returns>String if a warning needs to be displayed.</returns> public string CBI_WarningStr(TimeValue cei) { // Calculate the time to do all the samples in the burst int burstLength = (int)(cei.ToSecondsD() * CBI_NumEnsembles); var ts = new TimeSpan(0, 0, burstLength); // Check to ensure the values do not exceed string warningString = ""; if (burstLength > CBI_BurstInterval.ToSecondsD()) { warningString = "\r\nTHESE SETTINGS WILL EXCEED BURST INTERVAL"; } return warningString; }
/// <summary> /// Time string for the CBI command. This will give a description of the timing /// for the data output. /// </summary> /// <param name="cei">CEI time.</param> /// <param name="showWarning">Show the warning message with the string.</param> /// <returns>String description of the CBI command.</returns> public string CBI_DescStr(TimeValue cei, bool showWarning = false) { // Calculate the time to do all the samples in the burst int burstLength = (int)(cei.ToSecondsD() * CBI_NumEnsembles); var ts = new TimeSpan(0, 0, burstLength); // Check to ensure the values do not exceed string warningString = ""; if(showWarning) { warningString = CBI_WarningStr(cei); } return string.Format("{0} samples in {1}.\r\n{2} between each sample.\r\nBurst Length: {3}{4}", CBI_NumEnsembles.ToString(CultureInfo.CreateSpecificCulture("en-US")), MathHelper.TimeValuePrettyFormat(CBI_BurstInterval), MathHelper.TimeValuePrettyFormat(cei), MathHelper.TimeSpanPrettyFormat(ts), warningString); }