KiCad PCB EDA Suite
WX_HTML_REPORT_PANEL Class Reference

A widget for browsing a rich text error/status report. More...

#include <wx_html_report_panel.h>

Inheritance diagram for WX_HTML_REPORT_PANEL:
WX_HTML_REPORT_PANEL_BASE

Classes

struct  REPORT_LINE
 

Public Member Functions

 WX_HTML_REPORT_PANEL (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(500, 300), long style=wxTAB_TRAVERSAL)
 
 ~WX_HTML_REPORT_PANEL ()
 Set the min size of the area which displays html messages: More...
 
void MsgPanelSetMinSize (const wxSize &aMinSize)
 returns the reporter object that reports to this panel More...
 
REPORTERReporter ()
 
void Report (const wxString &aText, SEVERITY aSeverity, REPORTER::LOCATION aLocation=REPORTER::LOC_BODY)
 Reports the string. More...
 
void Clear ()
 return the number of messages matching the given severity mask. More...
 
int Count (int severityMask)
 sets the frame label More...
 
void SetLabel (const wxString &aLabel) override
 Sets the lazy update. More...
 
void SetLazyUpdate (bool aLazyUpdate)
 Forces updating the HTML page, after the report is built in lazy mode If aSort = true, the body messages will be ordered by severity. More...
 
void Flush (bool aSort=false)
 Set the visible severity filter. More...
 
void SetVisibleSeverities (int aSeverities)
 
int GetVisibleSeverities () const
 
void SetShowSeverity (SEVERITY aSeverity, bool aValue)
 Set the report full file name to the string. More...
 
void SetFileName (const wxString &aReportFileName)
 
wxString & GetFileName (void)
 

Protected Attributes

wxStaticBoxSizer * m_box
 
wxFlexGridSizer * m_fgSizer
 
wxHtmlWindow * m_htmlView
 
wxStaticText * m_staticTextShow
 
wxCheckBox * m_checkBoxShowAll
 
wxCheckBox * m_checkBoxShowErrors
 
NUMBER_BADGEm_errorsBadge
 
wxCheckBox * m_checkBoxShowWarnings
 
NUMBER_BADGEm_warningsBadge
 
wxCheckBox * m_checkBoxShowActions
 
wxCheckBox * m_checkBoxShowInfos
 
wxButton * m_btnSaveReportToFile
 

Private Types

typedef std::vector< REPORT_LINEREPORT_LINES
 

Private Member Functions

wxString addHeader (const wxString &aBody)
 
wxString generateHtml (const REPORT_LINE &aLine)
 
wxString generatePlainText (const REPORT_LINE &aLine)
 
void updateBadges ()
 
void scrollToBottom ()
 
void syncCheckboxes ()
 
void onRightClick (wxMouseEvent &event) override
 
void onMenuEvent (wxMenuEvent &event)
 
void onCheckBoxShowAll (wxCommandEvent &event) override
 
void onCheckBoxShowWarnings (wxCommandEvent &event) override
 
void onCheckBoxShowErrors (wxCommandEvent &event) override
 
void onCheckBoxShowInfos (wxCommandEvent &event) override
 
void onCheckBoxShowActions (wxCommandEvent &event) override
 
void onBtnSaveToFile (wxCommandEvent &event) override
 

Private Attributes

WX_HTML_PANEL_REPORTER m_reporter
 
REPORT_LINES m_report
 copy of the report, stored for filtering More...
 
REPORT_LINES m_reportTail
 Lines to print at the end, regardless of sorting. More...
 
REPORT_LINES m_reportHead
 ... and at the beginning, regardless of sorting More...
 
int m_severities
 message severities to display (mask) More...
 
bool m_lazyUpdate
 
wxString m_reportFileName
 defaults to the not very useful /bin/report.txt More...
 

Detailed Description

A widget for browsing a rich text error/status report.

Used in numerous dialogs in eeschema and pcbnew. Provides error filtering functionality and saving report files.

The messages are reported through a REPORTER object

Definition at line 37 of file wx_html_report_panel.h.

Member Typedef Documentation

◆ REPORT_LINES

typedef std::vector<REPORT_LINE> WX_HTML_REPORT_PANEL::REPORT_LINES
private

Definition at line 104 of file wx_html_report_panel.h.

Constructor & Destructor Documentation

◆ WX_HTML_REPORT_PANEL()

WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxSize( 500,300 ),
long  style = wxTAB_TRAVERSAL 
)

Definition at line 36 of file wx_html_report_panel.cpp.

40  :
41  WX_HTML_REPORT_PANEL_BASE( parent, id, pos, size, style ),
42  m_reporter( this ),
43  m_severities( -1 ),
44  m_lazyUpdate( false )
45 {
47  m_htmlView->SetPage( addHeader( "" ) );
48 
49  Connect( wxEVT_COMMAND_MENU_SELECTED,
50  wxMenuEventHandler( WX_HTML_REPORT_PANEL::onMenuEvent ), NULL, this );
51 }
wxString addHeader(const wxString &aBody)
#define NULL
WX_HTML_PANEL_REPORTER m_reporter
WX_HTML_REPORT_PANEL_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(567, 228), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
void onMenuEvent(wxMenuEvent &event)
int m_severities
message severities to display (mask)

References addHeader(), WX_HTML_REPORT_PANEL_BASE::m_htmlView, NULL, onMenuEvent(), and syncCheckboxes().

◆ ~WX_HTML_REPORT_PANEL()

WX_HTML_REPORT_PANEL::~WX_HTML_REPORT_PANEL ( )

Set the min size of the area which displays html messages:

Definition at line 54 of file wx_html_report_panel.cpp.

55 {
56 }

Member Function Documentation

◆ addHeader()

wxString WX_HTML_REPORT_PANEL::addHeader ( const wxString &  aBody)
private

Definition at line 149 of file wx_html_report_panel.cpp.

150 {
151  wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
152  wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
153 
154  return wxString::Format( wxT( "<html><body bgcolor='%s' text='%s'>%s</body></html>" ),
155  bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
156  fgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
157  aBody );
158 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References Format().

Referenced by Flush(), and WX_HTML_REPORT_PANEL().

◆ Clear()

void WX_HTML_REPORT_PANEL::Clear ( )

return the number of messages matching the given severity mask.

Definition at line 373 of file wx_html_report_panel.cpp.

374 {
375  m_report.clear();
376  m_reportHead.clear();
377  m_reportTail.clear();
378 }
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
REPORT_LINES m_report
copy of the report, stored for filtering

References m_report, m_reportHead, and m_reportTail.

Referenced by DIALOG_NETLIST::loadNetlist(), DIALOG_ANNOTATE::OnApplyClick(), DIALOG_NETLIST::onFilenameChanged(), DIALOG_CHANGE_SYMBOLS::onOkButtonClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked(), DIALOG_UPDATE_FROM_PCB::OnUpdateClick(), DIALOG_UPDATE_PCB::PerformUpdate(), and DIALOG_UPDATE_FROM_PCB::updateData().

◆ Count()

int WX_HTML_REPORT_PANEL::Count ( int  severityMask)

sets the frame label

Definition at line 161 of file wx_html_report_panel.cpp.

162 {
163  int count = 0;
164 
165  for( const auto& reportLineArray : { m_report, m_reportHead, m_reportTail } )
166  {
167  for( const REPORT_LINE& reportLine : reportLineArray )
168  {
169  if( severityMask & reportLine.severity )
170  count++;
171  }
172  }
173 
174  return count;
175 }
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
REPORT_LINES m_report
copy of the report, stored for filtering

References m_report, m_reportHead, and m_reportTail.

Referenced by WX_HTML_PANEL_REPORTER::HasMessage(), and updateBadges().

◆ Flush()

void WX_HTML_REPORT_PANEL::Flush ( bool  aSort = false)

Set the visible severity filter.

if aSeverities < 0 the m_showAll option is set

Definition at line 100 of file wx_html_report_panel.cpp.

101 {
102  wxString html;
103 
104  if( aSort )
105  {
106  std::sort( m_report.begin(), m_report.end(),
107  []( const REPORT_LINE& a, const REPORT_LINE& b)
108  {
109  return a.severity < b.severity;
110  });
111  }
112 
113  for( const auto& line : m_reportHead )
114  html += generateHtml( line );
115 
116  for( const auto& line : m_report )
117  html += generateHtml( line );
118 
119  for( const auto& line : m_reportTail )
120  html += generateHtml( line );
121 
122  m_htmlView->SetPage( addHeader( html ) );
123  scrollToBottom();
124 }
wxString addHeader(const wxString &aBody)
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
REPORT_LINES m_report
copy of the report, stored for filtering
wxString generateHtml(const REPORT_LINE &aLine)

References addHeader(), generateHtml(), WX_HTML_REPORT_PANEL_BASE::m_htmlView, m_report, m_reportHead, m_reportTail, scrollToBottom(), and WX_HTML_REPORT_PANEL::REPORT_LINE::severity.

Referenced by DIALOG_NETLIST::loadNetlist(), DIALOG_ANNOTATE::OnApplyClick(), DIALOG_BOARD_REANNOTATE::OnApplyClick(), onCheckBoxShowActions(), onCheckBoxShowAll(), onCheckBoxShowErrors(), onCheckBoxShowInfos(), onCheckBoxShowWarnings(), DIALOG_CHANGE_SYMBOLS::onOkButtonClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked(), DIALOG_UPDATE_FROM_PCB::OnUpdateClick(), DIALOG_UPDATE_PCB::PerformUpdate(), and DIALOG_UPDATE_FROM_PCB::updateData().

◆ generateHtml()

wxString WX_HTML_REPORT_PANEL::generateHtml ( const REPORT_LINE aLine)
private

Definition at line 178 of file wx_html_report_panel.cpp.

179 {
180  wxString retv;
181 
182  if( !( m_severities & aLine.severity ) )
183  return retv;
184 
185  switch( aLine.severity )
186  {
187  case RPT_SEVERITY_ERROR:
188  retv = "<font color=\"red\" size=3>" + _( "Error:" ) + " </font>"
189  "<font size=3>" + aLine.message + "</font><br>";
190  break;
192  retv = "<font size=3>" + _( "Warning:" ) + wxS( " " ) + aLine.message + "</font><br>";
193  break;
194  case RPT_SEVERITY_INFO:
195  retv = "<font color=\"dark gray\" size=3>" + aLine.message + "</font><br>";
196  break;
197  case RPT_SEVERITY_ACTION:
198  retv = "<font color=\"dark green\" size=3>" + aLine.message + "</font><br>";
199  break;
200  default:
201  retv = "<font size=3>" + aLine.message + "</font><br>";
202  }
203 
204  return retv;
205 }
#define _(s)
int m_severities
message severities to display (mask)

References _, m_severities, WX_HTML_REPORT_PANEL::REPORT_LINE::message, RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, and WX_HTML_REPORT_PANEL::REPORT_LINE::severity.

Referenced by Flush(), and Report().

◆ generatePlainText()

wxString WX_HTML_REPORT_PANEL::generatePlainText ( const REPORT_LINE aLine)
private

Definition at line 208 of file wx_html_report_panel.cpp.

209 {
210  switch( aLine.severity )
211  {
212  case RPT_SEVERITY_ERROR:
213  return _( "Error:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
215  return _( "Warning:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
216  case RPT_SEVERITY_INFO:
217  return _( "Info:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
218  default:
219  return aLine.message + wxT( "\n" );
220  }
221 }
#define _(s)

References _, WX_HTML_REPORT_PANEL::REPORT_LINE::message, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, and WX_HTML_REPORT_PANEL::REPORT_LINE::severity.

Referenced by onBtnSaveToFile().

◆ GetFileName()

wxString & WX_HTML_REPORT_PANEL::GetFileName ( void  )

Definition at line 410 of file wx_html_report_panel.cpp.

411 {
412  return ( m_reportFileName );
413 }
wxString m_reportFileName
defaults to the not very useful /bin/report.txt

References m_reportFileName.

Referenced by DIALOG_BOARD_REANNOTATE::~DIALOG_BOARD_REANNOTATE().

◆ GetVisibleSeverities()

int WX_HTML_REPORT_PANEL::GetVisibleSeverities ( ) const
Returns
the visible severity filter. If the m_showAll option is set, the mask is < 0

Definition at line 398 of file wx_html_report_panel.cpp.

399 {
400  return m_severities;
401 }
int m_severities
message severities to display (mask)

References m_severities.

Referenced by DIALOG_ANNOTATE::~DIALOG_ANNOTATE(), DIALOG_NETLIST::~DIALOG_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().

◆ MsgPanelSetMinSize()

void WX_HTML_REPORT_PANEL::MsgPanelSetMinSize ( const wxSize &  aMinSize)

returns the reporter object that reports to this panel

Definition at line 59 of file wx_html_report_panel.cpp.

60 {
61  m_fgSizer->SetMinSize( aMinSize );
62  GetSizer()->SetSizeHints( this );
63 }

References WX_HTML_REPORT_PANEL_BASE::m_fgSizer.

Referenced by DIALOG_GEN_FOOTPRINT_POSITION::initDialog(), and DIALOG_ANNOTATE::InitValues().

◆ onBtnSaveToFile()

void WX_HTML_REPORT_PANEL::onBtnSaveToFile ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 325 of file wx_html_report_panel.cpp.

326 {
327  wxFileName fn;
328 
329  if( m_reportFileName.empty() )
330  fn = wxT( "./report.txt" );
331  else
332  fn = m_reportFileName;
333 
334  wxFileDialog dlg( this, _( "Save Report to File" ), fn.GetPath(), fn.GetFullName(),
335  TextFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
336 
337  if( dlg.ShowModal() != wxID_OK )
338  return;
339 
340  fn = dlg.GetPath();
341 
342  if( fn.GetExt().IsEmpty() )
343  fn.SetExt( "txt" );
344 
345  wxFFile f( fn.GetFullPath(), "wb" );
346 
347  if( !f.IsOpened() )
348  {
349  wxString msg;
350 
351  msg.Printf( _( "Cannot write report to file '%s'." ),
352  fn.GetFullPath().GetData() );
353  wxMessageBox( msg, _( "File save error" ), wxOK | wxICON_ERROR, this );
354  return;
355  }
356 
357  for( REPORT_LINES section : { m_reportHead, m_report, m_reportTail } )
358  {
359  for( const REPORT_LINE& l : section )
360  {
361  wxString s = generatePlainText( l );
362 
364  f.Write( s );
365  }
366  }
367 
368  m_reportFileName = fn.GetFullPath();
369  f.Close();
370 }
wxString generatePlainText(const REPORT_LINE &aLine)
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
#define _(s)
wxString m_reportFileName
defaults to the not very useful /bin/report.txt
REPORT_LINES m_report
copy of the report, stored for filtering
std::vector< REPORT_LINE > REPORT_LINES
wxString TextFileWildcard()
bool ConvertSmartQuotesAndDashes(wxString *aString)
Convert curly quotes and em/en dashes to straight quotes and dashes.
Definition: string.cpp:108

References _, ConvertSmartQuotesAndDashes(), generatePlainText(), m_report, m_reportFileName, m_reportHead, m_reportTail, and TextFileWildcard().

◆ onCheckBoxShowActions()

void WX_HTML_REPORT_PANEL::onCheckBoxShowActions ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 313 of file wx_html_report_panel.cpp.

314 {
315  if( event.IsChecked() )
317  else
319 
320  syncCheckboxes();
321  Flush( true );
322 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)

References Flush(), m_severities, RPT_SEVERITY_ACTION, and syncCheckboxes().

◆ onCheckBoxShowAll()

void WX_HTML_REPORT_PANEL::onCheckBoxShowAll ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 255 of file wx_html_report_panel.cpp.

256 {
257  if( event.IsChecked() )
259  else
261 
262  syncCheckboxes();
263  Flush( true );
264 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)
static int RPT_SEVERITY_ALL

References Flush(), m_severities, RPT_SEVERITY_ALL, RPT_SEVERITY_ERROR, and syncCheckboxes().

◆ onCheckBoxShowErrors()

void WX_HTML_REPORT_PANEL::onCheckBoxShowErrors ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 289 of file wx_html_report_panel.cpp.

290 {
291  if( event.IsChecked() )
293  else
295 
296  syncCheckboxes();
297  Flush( true );
298 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)

References Flush(), m_severities, RPT_SEVERITY_ERROR, and syncCheckboxes().

◆ onCheckBoxShowInfos()

void WX_HTML_REPORT_PANEL::onCheckBoxShowInfos ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 301 of file wx_html_report_panel.cpp.

302 {
303  if( event.IsChecked() )
305  else
307 
308  syncCheckboxes();
309  Flush( true );
310 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)

References Flush(), m_severities, RPT_SEVERITY_INFO, and syncCheckboxes().

◆ onCheckBoxShowWarnings()

void WX_HTML_REPORT_PANEL::onCheckBoxShowWarnings ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 277 of file wx_html_report_panel.cpp.

278 {
279  if( event.IsChecked() )
281  else
283 
284  syncCheckboxes();
285  Flush( true );
286 }
void Flush(bool aSort=false)
Set the visible severity filter.
int m_severities
message severities to display (mask)

References Flush(), m_severities, RPT_SEVERITY_WARNING, and syncCheckboxes().

◆ onMenuEvent()

void WX_HTML_REPORT_PANEL::onMenuEvent ( wxMenuEvent &  event)
private

Definition at line 232 of file wx_html_report_panel.cpp.

233 {
234  if( event.GetId() == wxID_COPY )
235  {
236  wxLogNull doNotLog; // disable logging of failed clipboard actions
237 
238  if( wxTheClipboard->Open() )
239  {
240  bool primarySelection = wxTheClipboard->IsUsingPrimarySelection();
241  wxTheClipboard->UsePrimarySelection( false ); // required to use the main clipboard
242  wxTheClipboard->SetData( new wxTextDataObject( m_htmlView->SelectionToText() ) );
243  wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
244  wxTheClipboard->Close();
245  wxTheClipboard->UsePrimarySelection( primarySelection );
246  }
247  }
248 }

References WX_HTML_REPORT_PANEL_BASE::m_htmlView.

Referenced by WX_HTML_REPORT_PANEL().

◆ onRightClick()

void WX_HTML_REPORT_PANEL::onRightClick ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from WX_HTML_REPORT_PANEL_BASE.

Definition at line 224 of file wx_html_report_panel.cpp.

225 {
226  wxMenu popup;
227  popup.Append( wxID_COPY, "Copy" );
228  PopupMenu( &popup );
229 }

◆ Report()

void WX_HTML_REPORT_PANEL::Report ( const wxString &  aText,
SEVERITY  aSeverity,
REPORTER::LOCATION  aLocation = REPORTER::LOC_BODY 
)

Reports the string.

Parameters
aTextstring message to report
aSeveritystring classification level bitfield
aLocationREPORTER::LOCATION enum for placement of messageclears the report panel

Definition at line 72 of file wx_html_report_panel.cpp.

74 {
75  REPORT_LINE line;
76  line.message = aText;
77  line.severity = aSeverity;
78 
79  if( aLocation == REPORTER::LOC_HEAD )
80  m_reportHead.push_back( line );
81  else if( aLocation == REPORTER::LOC_TAIL )
82  m_reportTail.push_back( line );
83  else
84  m_report.push_back( line );
85 
86  if( !m_lazyUpdate )
87  {
88  m_htmlView->AppendToPage( generateHtml( line ) );
90  }
91 }
REPORT_LINES m_reportHead
... and at the beginning, regardless of sorting
REPORT_LINES m_reportTail
Lines to print at the end, regardless of sorting.
REPORT_LINES m_report
copy of the report, stored for filtering
wxString generateHtml(const REPORT_LINE &aLine)

References generateHtml(), REPORTER::LOC_HEAD, REPORTER::LOC_TAIL, WX_HTML_REPORT_PANEL_BASE::m_htmlView, m_lazyUpdate, m_report, m_reportHead, m_reportTail, WX_HTML_REPORT_PANEL::REPORT_LINE::message, scrollToBottom(), and WX_HTML_REPORT_PANEL::REPORT_LINE::severity.

Referenced by DIALOG_EXCHANGE_FOOTPRINTS::processFootprint(), DIALOG_CHANGE_SYMBOLS::processSymbol(), WX_HTML_PANEL_REPORTER::Report(), WX_HTML_PANEL_REPORTER::ReportHead(), WX_HTML_PANEL_REPORTER::ReportTail(), and DIALOG_BOARD_REANNOTATE::ShowReport().

◆ Reporter()

◆ scrollToBottom()

void WX_HTML_REPORT_PANEL::scrollToBottom ( )
private

Definition at line 127 of file wx_html_report_panel.cpp.

128 {
129  int x, y, xUnit, yUnit;
130 
131  m_htmlView->GetVirtualSize( &x, &y );
132  m_htmlView->GetScrollPixelsPerUnit( &xUnit, &yUnit );
133  m_htmlView->Scroll( 0, y / yUnit );
134 
135  updateBadges();
136 }

References WX_HTML_REPORT_PANEL_BASE::m_htmlView, and updateBadges().

Referenced by Flush(), and Report().

◆ SetFileName()

◆ SetLabel()

void WX_HTML_REPORT_PANEL::SetLabel ( const wxString &  aLabel)
override

Sets the lazy update.

If this mode is on, messages are stored but the display is not updated (Updating display can be very time consuming if there are many messages) A call to Flush() will be needed after build the report

Definition at line 381 of file wx_html_report_panel.cpp.

382 {
383  m_box->GetStaticBox()->SetLabel( aLabel );
384 }

References WX_HTML_REPORT_PANEL_BASE::m_box.

Referenced by DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), DIALOG_UPDATE_PCB::OnUpdateClick(), and DIALOG_NETLIST::OnUpdatePCB().

◆ SetLazyUpdate()

void WX_HTML_REPORT_PANEL::SetLazyUpdate ( bool  aLazyUpdate)

◆ SetShowSeverity()

void WX_HTML_REPORT_PANEL::SetShowSeverity ( SEVERITY  aSeverity,
bool  aValue 
)

Set the report full file name to the string.

Definition at line 416 of file wx_html_report_panel.cpp.

417 {
418  switch( aSeverity )
419  {
420  case RPT_SEVERITY_INFO:
421  m_checkBoxShowInfos->SetValue( aValue );
422  break;
423 
424  case RPT_SEVERITY_ACTION:
425  m_checkBoxShowActions->SetValue( aValue );
426  break;
427 
429  m_checkBoxShowWarnings->SetValue( aValue );
430  break;
431 
432  default:
433  m_checkBoxShowErrors->SetValue( aValue );
434  break;
435  }
436 }

References WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowActions, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowErrors, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowInfos, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowWarnings, RPT_SEVERITY_ACTION, RPT_SEVERITY_INFO, and RPT_SEVERITY_WARNING.

◆ SetVisibleSeverities()

void WX_HTML_REPORT_PANEL::SetVisibleSeverities ( int  aSeverities)
Returns
the visible severity filter. If the m_showAll option is set, the mask is < 0

Definition at line 387 of file wx_html_report_panel.cpp.

388 {
389  if( aSeverities < 0 )
391  else
392  m_severities = aSeverities;
393 
394  syncCheckboxes();
395 }
int m_severities
message severities to display (mask)
static int RPT_SEVERITY_ALL

References m_severities, RPT_SEVERITY_ALL, and syncCheckboxes().

Referenced by DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), and DIALOG_ANNOTATE::InitValues().

◆ syncCheckboxes()

void WX_HTML_REPORT_PANEL::syncCheckboxes ( )
private

Definition at line 267 of file wx_html_report_panel.cpp.

References WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowActions, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowAll, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowErrors, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowInfos, WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowWarnings, m_severities, RPT_SEVERITY_ACTION, RPT_SEVERITY_ALL, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, and RPT_SEVERITY_WARNING.

Referenced by onCheckBoxShowActions(), onCheckBoxShowAll(), onCheckBoxShowErrors(), onCheckBoxShowInfos(), onCheckBoxShowWarnings(), SetVisibleSeverities(), and WX_HTML_REPORT_PANEL().

◆ updateBadges()

void WX_HTML_REPORT_PANEL::updateBadges ( )
private

Definition at line 139 of file wx_html_report_panel.cpp.

140 {
141  int count = Count(RPT_SEVERITY_ERROR );
143 
144  count = Count(RPT_SEVERITY_WARNING );
146 }
void UpdateNumber(int aNumber, SEVERITY aSeverity)
Update the number displayed on the badge.
int Count(int severityMask)
sets the frame label

References Count(), WX_HTML_REPORT_PANEL_BASE::m_errorsBadge, WX_HTML_REPORT_PANEL_BASE::m_warningsBadge, RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, and NUMBER_BADGE::UpdateNumber().

Referenced by scrollToBottom().

Member Data Documentation

◆ m_box

wxStaticBoxSizer* WX_HTML_REPORT_PANEL_BASE::m_box
protectedinherited

◆ m_btnSaveReportToFile

wxButton* WX_HTML_REPORT_PANEL_BASE::m_btnSaveReportToFile
protectedinherited

◆ m_checkBoxShowActions

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowActions
protectedinherited

◆ m_checkBoxShowAll

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowAll
protectedinherited

◆ m_checkBoxShowErrors

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowErrors
protectedinherited

◆ m_checkBoxShowInfos

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowInfos
protectedinherited

◆ m_checkBoxShowWarnings

wxCheckBox* WX_HTML_REPORT_PANEL_BASE::m_checkBoxShowWarnings
protectedinherited

◆ m_errorsBadge

NUMBER_BADGE* WX_HTML_REPORT_PANEL_BASE::m_errorsBadge
protectedinherited

◆ m_fgSizer

wxFlexGridSizer* WX_HTML_REPORT_PANEL_BASE::m_fgSizer
protectedinherited

◆ m_htmlView

◆ m_lazyUpdate

bool WX_HTML_REPORT_PANEL::m_lazyUpdate
private

Definition at line 132 of file wx_html_report_panel.h.

Referenced by Report(), and SetLazyUpdate().

◆ m_report

REPORT_LINES WX_HTML_REPORT_PANEL::m_report
private

copy of the report, stored for filtering

Definition at line 127 of file wx_html_report_panel.h.

Referenced by Clear(), Count(), Flush(), onBtnSaveToFile(), and Report().

◆ m_reporter

WX_HTML_PANEL_REPORTER WX_HTML_REPORT_PANEL::m_reporter
private

Definition at line 125 of file wx_html_report_panel.h.

Referenced by Reporter().

◆ m_reportFileName

wxString WX_HTML_REPORT_PANEL::m_reportFileName
private

defaults to the not very useful /bin/report.txt

Definition at line 134 of file wx_html_report_panel.h.

Referenced by GetFileName(), onBtnSaveToFile(), and SetFileName().

◆ m_reportHead

REPORT_LINES WX_HTML_REPORT_PANEL::m_reportHead
private

... and at the beginning, regardless of sorting

Definition at line 129 of file wx_html_report_panel.h.

Referenced by Clear(), Count(), Flush(), onBtnSaveToFile(), and Report().

◆ m_reportTail

REPORT_LINES WX_HTML_REPORT_PANEL::m_reportTail
private

Lines to print at the end, regardless of sorting.

Definition at line 128 of file wx_html_report_panel.h.

Referenced by Clear(), Count(), Flush(), onBtnSaveToFile(), and Report().

◆ m_severities

int WX_HTML_REPORT_PANEL::m_severities
private

◆ m_staticTextShow

wxStaticText* WX_HTML_REPORT_PANEL_BASE::m_staticTextShow
protectedinherited

◆ m_warningsBadge

NUMBER_BADGE* WX_HTML_REPORT_PANEL_BASE::m_warningsBadge
protectedinherited

The documentation for this class was generated from the following files: