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 lasy 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 39 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 106 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 32 of file wx_html_report_panel.cpp.

36  :
37  WX_HTML_REPORT_PANEL_BASE( parent, id, pos, size, style ),
38  m_reporter( this ),
39  m_severities( -1 ),
40  m_lazyUpdate( false )
41 {
43  m_htmlView->SetPage( addHeader( "" ) );
44 
45  Connect( wxEVT_COMMAND_MENU_SELECTED,
46  wxMenuEventHandler( WX_HTML_REPORT_PANEL::onMenuEvent ), NULL, this );
47 }
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 50 of file wx_html_report_panel.cpp.

51 {
52 }

Member Function Documentation

◆ addHeader()

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

Definition at line 145 of file wx_html_report_panel.cpp.

146 {
147  wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
148  wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
149 
150  return wxString::Format( wxT( "<html><body bgcolor='%s' text='%s'>%s</body></html>" ),
151  bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
152  fgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
153  aBody );
154 }
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 368 of file wx_html_report_panel.cpp.

369 {
370  m_report.clear();
371  m_reportHead.clear();
372  m_reportTail.clear();
373 }
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 157 of file wx_html_report_panel.cpp.

158 {
159  int count = 0;
160 
161  for( const auto& reportLineArray : { m_report, m_reportHead, m_reportTail } )
162  {
163  for( const REPORT_LINE& reportLine : reportLineArray )
164  {
165  if( severityMask & reportLine.severity )
166  count++;
167  }
168  }
169 
170  return count;
171 }
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 96 of file wx_html_report_panel.cpp.

97 {
98  wxString html;
99 
100  if( aSort )
101  {
102  std::sort( m_report.begin(), m_report.end(),
103  []( const REPORT_LINE& a, const REPORT_LINE& b)
104  {
105  return a.severity < b.severity;
106  });
107  }
108 
109  for( const auto& line : m_reportHead )
110  html += generateHtml( line );
111 
112  for( const auto& line : m_report )
113  html += generateHtml( line );
114 
115  for( const auto& line : m_reportTail )
116  html += generateHtml( line );
117 
118  m_htmlView->SetPage( addHeader( html ) );
119  scrollToBottom();
120 }
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 174 of file wx_html_report_panel.cpp.

175 {
176  wxString retv;
177 
178  if( !( m_severities & aLine.severity ) )
179  return retv;
180 
181  switch( aLine.severity )
182  {
183  case RPT_SEVERITY_ERROR:
184  retv = "<font color=\"red\" size=3>" + _( "Error:" ) + " </font>"
185  "<font size=3>" + aLine.message + "</font><br>";
186  break;
188  retv = "<font size=3>" + _( "Warning:" ) + wxS( " " ) + aLine.message + "</font><br>";
189  break;
190  case RPT_SEVERITY_INFO:
191  retv = "<font color=\"dark gray\" size=3>" + aLine.message + "</font><br>";
192  break;
193  case RPT_SEVERITY_ACTION:
194  retv = "<font color=\"dark green\" size=3>" + aLine.message + "</font><br>";
195  break;
196  default:
197  retv = "<font size=3>" + aLine.message + "</font><br>";
198  }
199 
200  return retv;
201 }
#define _(s)
Definition: 3d_actions.cpp:33
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 204 of file wx_html_report_panel.cpp.

205 {
206  switch( aLine.severity )
207  {
208  case RPT_SEVERITY_ERROR:
209  return _( "Error:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
211  return _( "Warning:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
212  case RPT_SEVERITY_INFO:
213  return _( "Info:" ) + wxS( " " )+ aLine.message + wxT( "\n" );
214  default:
215  return aLine.message + wxT( "\n" );
216  }
217 }
#define _(s)
Definition: 3d_actions.cpp:33

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 405 of file wx_html_report_panel.cpp.

406 {
407  return ( m_reportFileName );
408 }
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 393 of file wx_html_report_panel.cpp.

394 {
395  return m_severities;
396 }
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 55 of file wx_html_report_panel.cpp.

56 {
57  m_fgSizer->SetMinSize( aMinSize );
58  GetSizer()->SetSizeHints( this );
59 }

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 320 of file wx_html_report_panel.cpp.

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

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 308 of file wx_html_report_panel.cpp.

309 {
310  if( event.IsChecked() )
312  else
314 
315  syncCheckboxes();
316  Flush( true );
317 }
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 250 of file wx_html_report_panel.cpp.

251 {
252  if( event.IsChecked() )
254  else
256 
257  syncCheckboxes();
258  Flush( true );
259 }
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 284 of file wx_html_report_panel.cpp.

285 {
286  if( event.IsChecked() )
288  else
290 
291  syncCheckboxes();
292  Flush( true );
293 }
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 296 of file wx_html_report_panel.cpp.

297 {
298  if( event.IsChecked() )
300  else
302 
303  syncCheckboxes();
304  Flush( true );
305 }
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 272 of file wx_html_report_panel.cpp.

273 {
274  if( event.IsChecked() )
276  else
278 
279  syncCheckboxes();
280  Flush( true );
281 }
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 228 of file wx_html_report_panel.cpp.

229 {
230  if( event.GetId() == wxID_COPY )
231  {
232  wxLogNull doNotLog; // disable logging of failed clipboard actions
233 
234  if( wxTheClipboard->Open() )
235  {
236  bool primarySelection = wxTheClipboard->IsUsingPrimarySelection();
237  wxTheClipboard->UsePrimarySelection( false ); // required to use the main clipboard
238  wxTheClipboard->SetData( new wxTextDataObject( m_htmlView->SelectionToText() ) );
239  wxTheClipboard->Close();
240  wxTheClipboard->UsePrimarySelection( primarySelection );
241  }
242  }
243 }

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 220 of file wx_html_report_panel.cpp.

221 {
222  wxMenu popup;
223  popup.Append( wxID_COPY, "Copy" );
224  PopupMenu( &popup );
225 }

◆ 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 68 of file wx_html_report_panel.cpp.

70 {
71  REPORT_LINE line;
72  line.message = aText;
73  line.severity = aSeverity;
74 
75  if( aLocation == REPORTER::LOC_HEAD )
76  m_reportHead.push_back( line );
77  else if( aLocation == REPORTER::LOC_TAIL )
78  m_reportTail.push_back( line );
79  else
80  m_report.push_back( line );
81 
82  if( !m_lazyUpdate )
83  {
84  m_htmlView->AppendToPage( generateHtml( line ) );
86  }
87 }
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 123 of file wx_html_report_panel.cpp.

124 {
125  int x, y, xUnit, yUnit;
126 
127  m_htmlView->GetVirtualSize( &x, &y );
128  m_htmlView->GetScrollPixelsPerUnit( &xUnit, &yUnit );
129  m_htmlView->Scroll( 0, y / yUnit );
130 
131  updateBadges();
132 }

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 lasy update.

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

Definition at line 376 of file wx_html_report_panel.cpp.

377 {
378  m_box->GetStaticBox()->SetLabel( aLabel );
379 }

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 411 of file wx_html_report_panel.cpp.

412 {
413  switch( aSeverity )
414  {
415  case RPT_SEVERITY_INFO:
416  m_checkBoxShowInfos->SetValue( aValue );
417  break;
418 
419  case RPT_SEVERITY_ACTION:
420  m_checkBoxShowActions->SetValue( aValue );
421  break;
422 
424  m_checkBoxShowWarnings->SetValue( aValue );
425  break;
426 
427  default:
428  m_checkBoxShowErrors->SetValue( aValue );
429  break;
430  }
431 }

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 382 of file wx_html_report_panel.cpp.

383 {
384  if( aSeverities < 0 )
386  else
387  m_severities = aSeverities;
388 
389  syncCheckboxes();
390 }
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 262 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 135 of file wx_html_report_panel.cpp.

136 {
137  int count = Count(RPT_SEVERITY_ERROR );
139 
140  count = Count(RPT_SEVERITY_WARNING );
142 }
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 134 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 129 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 127 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 136 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 131 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 130 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: