Main Content

passesFilter

Class: mlreportgen.dom.ProgressMessage
Package: mlreportgen.dom

Determine if message passes filter

Description

example

tf = passesFilter(message,filter) determines whether the message passes the filter.

Examples

expand all

This example shows how to add a progress message to display when generating a report.

Add a dispatcher and listener to the report. Configure the dispatcher to include debug messages.

import mlreportgen.dom.*;
d = Document('test','html');
     
dispatcher = MessageDispatcher.getTheDispatcher;
     dispatcher.Filter.DebugMessagesPass = true;
l = addlistener(dispatcher,'Message', ...
      @(src, evtdata) disp(evtdata.Message.formatAsText));

Create a progress message.

open(d);
dispatch(dispatcher, ProgressMessage('starting chapter',d));
p = Paragraph('Chapter ');
p.Tag = 'chapter title';
p.Style = { CounterInc('chapter'),...
    CounterReset('table'),WhiteSpace('pre') };
append(p,AutoNumber('chapter'));
append(d,p);

Generate the report and delete the listener.

close(d);
rptview('test','html');

delete(l);

Check the progress messages in the MATLAB® Command Window. In addition to the predefined DOM progress messages, the starting chapter message added in this example appears. The output also includes debug messages.

Input Arguments

expand all

DOM progress message, specified as an mlreportgen.dom.ProgressMessage object.

Filter to use with the progress message, specified as an mlreportgen.dom.MessageFilter object.

Output Arguments

expand all

  • 1 — Messages passes the specified filter (the dispatcher handles the message)

  • 0 — Messages fails the specified filter (the dispatcher ignores the message)

Version History

Introduced in R2014b