The [JSup tag|JSup tags] keep a quality status that can be used to detected some communication problems and statuses. This quality status can affect the quality of some calculated tag, if the calculation is based on tag with bad quality. These the possible tag quality status: * %red%UNKNOWN%red%: should never occur, maybe for an incompatible (older) JSup version. * %red%NOT_FOUND%red%: a tag proxy not correctly linked to a tag. * %red%CONFIG_ERROR%red%: the value read from the device could not be assigned to the tag. * %red%BAD_ITEM%red%: a tag [IOHook|I/O hook] is invalid and was not accepted by the driver or the remote device. * %red%BAD_SENSOR%red%: the sensor associated to the measure has some problem (used by [JSup OPC client|OPC client driver]) only. * %red%DEVICE_FAILURE%red%: the remote device is not available or it failed to respond. * %red%COMM_FAILURE%red%: communication error (the remote device is not connected or available) * %red%CONVERSION_ERROR%red%: the raw value read from the remote device cannot be converted/assigned to the tag. * %red%OUT_OF_RANGE_RAW%red%: the raw value read from the remote device is out of the defined min/max range. * %red%TIMEOUT%red%: if a timeout occurred while reading the value from the remote device. * %red%EVALUATION_ERROR%red%: if the expression to be calculated to assign a value to a tag produced an evaluation exception. * %red%BASED_ON_BAD_VALUES%red%: if some value ([JSup tag|tag]) used to calculate a value has, in turn, a bad quality status. * %green%CANT_WRITE%green%: the value is valid, but could not be written to the remote device. * %green%WRITE_PENDING%green%: the value is valid and it's about to be written to the remote device. A [JSup tag|tag] has this quality if it has an [IOHook|I/O hook] in a ''Write on change'' [JSup Channels|channel] only between the change of the tag value and the acknowledge of the successful write to the remote device. * %green%GOOD%green%: the status of the tag is good, its value is valid and correctly synced with the remote device, if any. Red indicates %red%bad quality%red% status, while green indicates %green%good quality%green% status. = Graphical representation of quality = The quality of the tag (or the tags) associated with an automation graphical object can be showed with the standard JSup library class QualityPainter. [img:///img/JSup/QualityPainter-usage.png|right|margin=10|]This class is to be used in quality dedicated [JSup Binders|rigid binder] that must be the topmost in the graphical object [JSup Binders|binder] (see ''quality overlay'' in the right graphic navigator example), the content of this binder should be: * ''tooltip'' [JSup Java Paint|Java paint] (see [JSup Animations#Special]), positioned in the corner where the quality icon is to be displayed (see below), with the following [JSup Animations|animations]: * Visible: when the following [JavaCode|Java code] returns true:
return getBoolVar( "visible", false ); * Tooltip: base of the following [JavaCode|Java code]:
return getStringVar( "overlayTooltip", "" ); * 'overlay'' [JSup Java Paint|Java paint] that have to cover all the automation graphical object, with the following [JSup Animations|animations]: * Visible: when the following [JavaCode|Java code] returns true:
return QualityPainter.processIfIsVisible( thisGraphObj, QualityPainter.LEFT, QualityPainter.TOP, _StatoUtenzaA.ref() );
The call of the processIfIsVisible evaluates the quality to be shown, based on the tag ref (or tags refs: more than a tag ref can be passed, separated with commas).
The position of the quality icon is determined, in this example, by the constants LEFT and TOP; it must be chosen to avoid to cover important information. * [img:///img/JSup/QualityPainter-result.png|right|margin=10|]Java paint: with the following [JavaCode|Java code]:
QualityPainter.processPaintOverlay( g2, thisGraphObj ); The quality layer is normally invisible (when the quality of tag is good) and it's only shown when tag quality become bad, showing that status of the automation object/measure is not reliable (see the picture on the right). This QualityPainter class allows to show the communication status of every single object in a graphical page ([JSup Window property dialog|window]).