/// <summary> /// Converts a quality to a string with the format: 'quality[limit]:vendor'. /// </summary> public override string ToString() { string text = QualityBits.ToString(); if (LimitBits != limitBits.none) { text += String.Format("[{0}]", LimitBits.ToString()); } if (VendorBits != 0) { text += String.Format(":{0,0:X}", VendorBits); } return(text); }
/////////////////////////////////////////////////////////////////////// #region Object Member Overrides /// <summary> /// Converts a quality to a string with the format: 'quality[limit]:vendor'. /// </summary> public override string ToString() { string text = null; switch (QualityBits) { case TsDaQualityBits.Good: text += "(Good"; break; case TsDaQualityBits.GoodLocalOverride: text += "(Good:Local Override"; break; case TsDaQualityBits.Bad: text += "(Bad"; break; case TsDaQualityBits.BadConfigurationError: text += "(Bad:Configuration Error"; break; case TsDaQualityBits.BadNotConnected: text += "(Bad:Not Connected"; break; case TsDaQualityBits.BadDeviceFailure: text += "(Bad:Device Failure"; break; case TsDaQualityBits.BadSensorFailure: text += "(Bad:Sensor Failure"; break; case TsDaQualityBits.BadLastKnownValue: text += "(Bad:Last Known Value"; break; case TsDaQualityBits.BadCommFailure: text += "(Bad:Communication Failure"; break; case TsDaQualityBits.BadOutOfService: text += "(Bad:Out of Service"; break; case TsDaQualityBits.BadWaitingForInitialData: text += "(Bad:Waiting for Initial Data"; break; case TsDaQualityBits.Uncertain: text += "(Uncertain"; break; case TsDaQualityBits.UncertainLastUsableValue: text += "(Uncertain:Last Usable Value"; break; case TsDaQualityBits.UncertainSensorNotAccurate: text += "(Uncertain:Sensor not Accurate"; break; case TsDaQualityBits.UncertainEUExceeded: text += "(Uncertain:Engineering Unit exceeded"; break; case TsDaQualityBits.UncertainSubNormal: text += "(Uncertain:Sub Normal"; break; } if (LimitBits != TsDaLimitBits.None) { text += String.Format(":[{0}]", LimitBits.ToString()); } else { text += ":Not Limited"; } if (VendorBits != 0) { text += String.Format(":{0,0:X})", VendorBits); } else { text += ")"; } return(text); }