2021-05-27 23:10:58 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2020 KiCad Developers.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// WARNING - this Tom's crappy PNS hack tool code. Please don't complain about its quality
|
|
|
|
// (unless you want to improve it).
|
|
|
|
|
|
|
|
#ifndef __PNS_LOG_VIEWER_FRAME_H
|
|
|
|
#define __PNS_LOG_VIEWER_FRAME_H
|
|
|
|
|
|
|
|
#include <pcb_painter.h>
|
|
|
|
#include <pcb_test_frame.h>
|
|
|
|
|
2022-02-26 01:47:14 +00:00
|
|
|
#include "pns_log_file.h"
|
|
|
|
#include "pns_log_player.h"
|
|
|
|
#include "pns_test_debug_decorator.h"
|
2021-05-27 23:10:58 +00:00
|
|
|
#include "pns_log_viewer_frame_base.h"
|
|
|
|
|
2022-02-26 01:47:14 +00:00
|
|
|
#include "label_manager.h"
|
|
|
|
|
2021-05-27 23:10:58 +00:00
|
|
|
#define ID_LIST_COPY 10001
|
|
|
|
#define ID_LIST_SHOW_ALL 10002
|
|
|
|
#define ID_LIST_SHOW_NONE 10003
|
|
|
|
|
2021-06-03 20:44:39 +00:00
|
|
|
class PNS_LOG_VIEWER_OVERLAY;
|
|
|
|
|
2021-05-27 23:10:58 +00:00
|
|
|
class PNS_LOG_VIEWER_FRAME : public PNS_LOG_VIEWER_FRAME_BASE, public PCB_TEST_FRAME_BASE
|
|
|
|
{
|
|
|
|
public:
|
2021-06-03 20:44:39 +00:00
|
|
|
PNS_LOG_VIEWER_FRAME( wxFrame* frame );
|
|
|
|
virtual ~PNS_LOG_VIEWER_FRAME();
|
2021-05-27 23:10:58 +00:00
|
|
|
|
|
|
|
void SetLogFile( PNS_LOG_FILE* aLog );
|
2021-11-28 20:52:42 +00:00
|
|
|
void SetBoard2( std::shared_ptr<BOARD> aBoard );
|
|
|
|
|
2021-06-03 20:44:39 +00:00
|
|
|
std::shared_ptr<PNS_LOG_VIEWER_OVERLAY> GetOverlay() const { return m_overlay; }
|
2021-05-27 23:10:58 +00:00
|
|
|
|
|
|
|
private:
|
2022-02-26 01:47:14 +00:00
|
|
|
void drawLoggedItems( int iter );
|
|
|
|
void updateDumpPanel( int iter );
|
|
|
|
virtual void createUserTools() override;
|
|
|
|
void buildListTree( wxTreeListItem item, PNS_DEBUG_SHAPE* ent, int depth = 0 );
|
|
|
|
void syncModel();
|
|
|
|
PNS_DEBUG_STAGE* getCurrentStage();
|
|
|
|
void updatePnsPreviewItems( int iter );
|
2022-06-03 21:24:59 +00:00
|
|
|
bool filterStringMatches( PNS_DEBUG_SHAPE* ent );
|
2021-05-27 23:10:58 +00:00
|
|
|
|
|
|
|
virtual void onReload( wxCommandEvent& event ) override;
|
|
|
|
virtual void onExit( wxCommandEvent& event ) override;
|
|
|
|
virtual void onRewindScroll( wxScrollEvent& event ) override;
|
|
|
|
virtual void onRewindCountText( wxCommandEvent& event ) override;
|
|
|
|
virtual void onListRightClick( wxMouseEvent& event );
|
|
|
|
virtual void onListSelect( wxCommandEvent& event );
|
|
|
|
virtual void onBtnRewindLeft( wxCommandEvent& event ) override;
|
|
|
|
virtual void onBtnRewindRight( wxCommandEvent& event ) override;
|
|
|
|
virtual void onListChecked( wxCommandEvent& event );
|
2022-02-26 01:47:14 +00:00
|
|
|
virtual void onShowThinLinesChecked( wxCommandEvent& event ) override;
|
|
|
|
virtual void onShowRPIsChecked( wxCommandEvent& event ) override;
|
2022-06-03 21:24:59 +00:00
|
|
|
virtual void onShowVerticesChecked( wxCommandEvent& event ) override;
|
|
|
|
virtual void onFilterText( wxCommandEvent& event ) override;
|
2022-11-18 14:10:08 +00:00
|
|
|
void drawSimpleShape( SHAPE* aShape, bool aIsSelected, const std::string& aName );
|
2022-02-26 01:47:14 +00:00
|
|
|
|
|
|
|
std::shared_ptr<PNS_LOG_VIEWER_OVERLAY> m_overlay;
|
|
|
|
std::shared_ptr<PNS_LOG_FILE> m_logFile;
|
|
|
|
std::shared_ptr<PNS_LOG_PLAYER> m_logPlayer;
|
|
|
|
int m_rewindIter;
|
|
|
|
wxMenu* m_listPopupMenu;
|
|
|
|
std::shared_ptr<KIGFX::VIEW_GROUP> m_previewItems;
|
|
|
|
|
|
|
|
bool m_showThinLines = true;
|
|
|
|
bool m_showRPIs = true;
|
2022-06-03 21:24:59 +00:00
|
|
|
bool m_showVertices = false;
|
|
|
|
wxString m_searchString;
|
2021-05-27 23:10:58 +00:00
|
|
|
};
|
|
|
|
|
2021-06-03 20:44:39 +00:00
|
|
|
class LABEL_MANAGER;
|
|
|
|
|
|
|
|
class PNS_LOG_VIEWER_OVERLAY : public KIGFX::VIEW_OVERLAY
|
|
|
|
{
|
2022-02-26 01:47:14 +00:00
|
|
|
public:
|
|
|
|
PNS_LOG_VIEWER_OVERLAY( KIGFX::GAL* aGal );
|
|
|
|
void AnnotatedPolyline( const SHAPE_LINE_CHAIN& aL, std::string name,
|
|
|
|
bool aShowVertexNumbers = false );
|
|
|
|
void AnnotatedPoint( const VECTOR2I p, int size, std::string name = "",
|
|
|
|
bool aShowVertexNumbers = false );
|
|
|
|
void Arc( const SHAPE_ARC& arc );
|
|
|
|
void DrawAnnotations();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2022-11-18 14:10:08 +00:00
|
|
|
|
2022-02-26 01:47:14 +00:00
|
|
|
std::unique_ptr<LABEL_MANAGER> m_labelMgr;
|
2021-06-03 20:44:39 +00:00
|
|
|
};
|
|
|
|
|
2021-05-27 23:10:58 +00:00
|
|
|
#endif
|