KiCad PCB EDA Suite
pns_log_viewer_frame.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2020 KiCad Developers.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 
25 // WARNING - this Tom's crappy PNS hack tool code. Please don't complain about its quality
26 // (unless you want to improve it).
27 
28 #ifndef __PNS_LOG_VIEWER_FRAME_H
29 #define __PNS_LOG_VIEWER_FRAME_H
30 
31 #include <pcb_painter.h>
32 #include <pcb_test_frame.h>
33 
34 #include "pns_log.h"
36 
37 #define ID_LIST_COPY 10001
38 #define ID_LIST_SHOW_ALL 10002
39 #define ID_LIST_SHOW_NONE 10003
40 
42 
44 {
45 public:
46  PNS_LOG_VIEWER_FRAME( wxFrame* frame );
47  virtual ~PNS_LOG_VIEWER_FRAME();
48 
49  void SetLogFile( PNS_LOG_FILE* aLog );
50  void SetBoard2( std::shared_ptr<BOARD> aBoard );
51 
52  std::shared_ptr<PNS_LOG_VIEWER_OVERLAY> GetOverlay() const { return m_overlay; }
53 
54 private:
55  void drawLoggedItems( int iter );
56  void updateDumpPanel( int iter );
57  virtual void createUserTools() override;
58  void buildListTree( wxTreeListItem item, PNS_TEST_DEBUG_DECORATOR::DEBUG_ENT* ent,
59  int depth = 0 );
60  void syncModel();
62 
63  virtual void onReload( wxCommandEvent& event ) override;
64  virtual void onExit( wxCommandEvent& event ) override;
65  virtual void onRewindScroll( wxScrollEvent& event ) override;
66  virtual void onRewindCountText( wxCommandEvent& event ) override;
67  virtual void onListRightClick( wxMouseEvent& event );
68  virtual void onListSelect( wxCommandEvent& event );
69  virtual void onBtnRewindLeft( wxCommandEvent& event ) override;
70  virtual void onBtnRewindRight( wxCommandEvent& event ) override;
71  virtual void onListChecked( wxCommandEvent& event );
72 
73  std::shared_ptr<PNS_LOG_VIEWER_OVERLAY> m_overlay;
74  std::shared_ptr<PNS_LOG_FILE> m_logFile;
75  std::shared_ptr<PNS_TEST_ENVIRONMENT> m_env;
77  wxMenu* m_listPopupMenu;
78 };
79 
80 class LABEL_MANAGER;
81 
83 {
84  public:
86  void AnnotatedPolyline( const SHAPE_LINE_CHAIN& aL, std::string name, bool aShowVertexNumbers = false );
87  void AnnotatedPoint( const VECTOR2I p, int size, std::string name = "", bool aShowVertexNumbers = false );
88  void Arc( const SHAPE_ARC& arc );
89  void DrawAnnotations();
90 
91  private:
92  std::unique_ptr<LABEL_MANAGER> m_labelMgr;
93 };
94 
95 #endif
std::shared_ptr< PNS_LOG_FILE > m_logFile
Class PNS_LOG_VIEWER_FRAME_BASE.
void buildListTree(wxTreeListItem item, PNS_TEST_DEBUG_DECORATOR::DEBUG_ENT *ent, int depth=0)
void SetBoard2(std::shared_ptr< BOARD > aBoard)
virtual void onBtnRewindRight(wxCommandEvent &event) override
virtual void onExit(wxCommandEvent &event) override
PNS_TEST_DEBUG_DECORATOR::STAGE * getCurrentStage()
virtual void onRewindCountText(wxCommandEvent &event) override
void updateDumpPanel(int iter)
virtual void onBtnRewindLeft(wxCommandEvent &event) override
virtual void createUserTools() override
PNS_LOG_VIEWER_OVERLAY(KIGFX::GAL *aGal)
void Arc(const SHAPE_ARC &arc)
PNS_LOG_VIEWER_FRAME(wxFrame *frame)
virtual void onReload(wxCommandEvent &event) override
std::unique_ptr< LABEL_MANAGER > m_labelMgr
std::shared_ptr< PNS_LOG_VIEWER_OVERLAY > m_overlay
const char * name
Definition: DXF_plotter.cpp:56
void AnnotatedPoint(const VECTOR2I p, int size, std::string name="", bool aShowVertexNumbers=false)
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
virtual void onListRightClick(wxMouseEvent &event)
std::shared_ptr< PNS_TEST_ENVIRONMENT > m_env
virtual void onListSelect(wxCommandEvent &event)
void drawLoggedItems(int iter)
virtual void onRewindScroll(wxScrollEvent &event) override
void AnnotatedPolyline(const SHAPE_LINE_CHAIN &aL, std::string name, bool aShowVertexNumbers=false)
virtual void onListChecked(wxCommandEvent &event)
std::shared_ptr< PNS_LOG_VIEWER_OVERLAY > GetOverlay() const
void SetLogFile(PNS_LOG_FILE *aLog)
Abstract interface for drawing on a 2D-surface.