1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

0029451: Information Message Alert to debug an algorithm or object functionality

- Added possibility to send stream information and transient object into Message_Messenger. Message_Printer will process it if needed.
- Add Message_PrinterToReport to send messenger information into Message_Report.
- Extended Message_Report to collect hierarchical alerts, to be able to collect some metrics during alerts processing.
- Added Message_AlertExtended to prepare hierarchical alerts with custom attributes. One attribute for one alert.
- Added Message_CompositeAlerts class to handle a container of alerts.
- Added Message_Level to start a new hierarchical level by creating an instance, stop by destricting.
- Added Message_Attribute and inheritors to store custom information about alert like object, stream, shape, some metrics.
- Implement Message_AttributeAlert to collect start/stop information about active metrics of Message_Report. This kind of attribute is created if at least one metric is active in the report.
- Add Message_MetricType enumeration with possible kinds of metrics in report.
- Implement DumpJson for Message_Report to store all collected alerts into stream.
- Added draw commands for Message_Report, Message_Messenger.
This commit is contained in:
nds
2020-10-02 14:17:59 +03:00
committed by bugmaster
parent dba9887351
commit 6522304c17
37 changed files with 2734 additions and 81 deletions

View File

@@ -18,6 +18,14 @@
#define _Message_HeaderFile
#include <Message_Messenger.hxx>
#include <Message_Gravity.hxx>
#include <Message_MetricType.hxx>
#include <NCollection_Vector.hxx>
#include <OSD_MemInfo.hxx>
#include <TCollection_AsciiString.hxx>
class Message_Report;
//! Defines
//! - tools to work with messages
@@ -76,6 +84,45 @@ public:
//! 3. (0, 0, 4.5 ) returns "4.50s"
Standard_EXPORT static TCollection_AsciiString FillTime (const Standard_Integer Hour, const Standard_Integer Minute, const Standard_Real Second);
public:
//! returns the only one instance of Report
//! When theToCreate is true - automatically creates message report when not exist.
Standard_EXPORT static const Handle(Message_Report)& DefaultReport (const Standard_Boolean theToCreate = Standard_False);
//! Determines the metric from the given string identifier.
//! @param theString string identifier
//! @param theType detected type of metric
//! @return TRUE if string identifier is known
Standard_EXPORT static Standard_Boolean MetricFromString (const Standard_CString theString,
Message_MetricType& theType);
//! Returns the string name for a given metric type.
//! @param theType metric type
//! @return string identifier from the list of Message_MetricType
Standard_EXPORT static Standard_CString MetricToString (const Message_MetricType theType);
//! Returns the metric type from the given string identifier.
//! @param theString string identifier
//! @return metric type or Message_MetricType_None if string identifier is invalid
static Message_MetricType MetricFromString (const Standard_CString theString)
{
Message_MetricType aMetric = Message_MetricType_None;
MetricFromString (theString, aMetric);
return aMetric;
}
//! Converts message metric to OSD memory info type.
//! @param theMetric [in] message metric
//! @param theMemInfo [out] filled memory info type
//! @return true if converted
static Standard_EXPORT Standard_Boolean ToOSDMetric (const Message_MetricType theMetric, OSD_MemInfo::Counter& theMemInfo);
//! Converts OSD memory info type to message metric.
//! @param theMemInfo [int] memory info type
//! @param theMetric [out] filled message metric
//! @return true if converted
static Standard_EXPORT Standard_Boolean ToMessageMetric (const OSD_MemInfo::Counter theMemInfo, Message_MetricType& theMetric);
};
#endif // _Message_HeaderFile