Horizon
pns_logger.h
1 /*
2  * KiRouter - a push-and-(sometimes-)shove PCB router
3  *
4  * Copyright (C) 2013-2014 CERN
5  * Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
6  * Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef __PNS_LOGGER_H
23 #define __PNS_LOGGER_H
24 
25 #include <cstdio>
26 #include <vector>
27 #include <string>
28 #include <sstream>
29 
30 #include "wx_compat.h"
31 
32 #include <math/vector2d.h>
33 
34 class SHAPE_LINE_CHAIN;
35 class SHAPE;
36 
37 namespace PNS {
38 
39 class ITEM;
40 
41 class LOGGER
42 {
43 public:
44 
45  enum EVENT_TYPE {
46  EVT_START_ROUTE = 0,
47  EVT_START_DRAG,
48  EVT_FIX,
49  EVT_MOVE,
50  EVT_ABORT
51  };
52 
53  struct EVENT_ENTRY {
54  VECTOR2I p;
55  EVENT_TYPE type;
56  wxString uuid;
57  };
58 
59  LOGGER();
60  ~LOGGER();
61 
62  void Save( const std::string& aFilename );
63  void Clear();
64  void Log( EVENT_TYPE evt, const VECTOR2I& pos, const ITEM* item = nullptr );
65 
66  const std::vector<EVENT_ENTRY>& GetEvents()
67  {
68  return m_events;
69  }
70 
71 private:
72  std::vector<EVENT_ENTRY> m_events;
73 };
74 
75 }
76 
77 #endif
Base class for PNS router board items.
Definition: pns_item.h:57
Definition: pns_logger.h:42
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Definition: shape_line_chain.h:81
An abstract shape on 2D plane.
Definition: shape.h:117
Definition: wx_compat.h:13
Definition: pns_logger.h:53