2014-05-14 13:53:54 +00:00
|
|
|
/*
|
|
|
|
* KiRouter - a push-and-(sometimes-)shove PCB router
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013-2014 CERN
|
2023-03-02 14:04:37 +00:00
|
|
|
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-05-14 13:53:54 +00:00
|
|
|
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
|
|
|
*
|
|
|
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PNS_LOGGER_H
|
|
|
|
#define __PNS_LOGGER_H
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
#include <math/vector2d.h>
|
2022-02-03 18:34:14 +00:00
|
|
|
#include <kiid.h>
|
2014-05-14 13:53:54 +00:00
|
|
|
|
2022-10-23 22:34:42 +00:00
|
|
|
#include "pns_sizes_settings.h"
|
|
|
|
|
2014-05-14 13:53:54 +00:00
|
|
|
class SHAPE_LINE_CHAIN;
|
|
|
|
class SHAPE;
|
|
|
|
|
2016-08-29 14:38:11 +00:00
|
|
|
namespace PNS {
|
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
class ITEM;
|
2016-08-29 14:38:11 +00:00
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
class LOGGER
|
2014-05-16 11:37:31 +00:00
|
|
|
{
|
2014-05-14 13:53:54 +00:00
|
|
|
public:
|
2020-04-16 22:29:28 +00:00
|
|
|
|
|
|
|
enum EVENT_TYPE {
|
|
|
|
EVT_START_ROUTE = 0,
|
|
|
|
EVT_START_DRAG,
|
|
|
|
EVT_FIX,
|
|
|
|
EVT_MOVE,
|
2022-02-26 01:47:14 +00:00
|
|
|
EVT_ABORT,
|
2022-11-15 22:02:01 +00:00
|
|
|
EVT_TOGGLE_VIA,
|
|
|
|
EVT_UNFIX
|
2020-04-16 22:29:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct EVENT_ENTRY {
|
|
|
|
VECTOR2I p;
|
|
|
|
EVENT_TYPE type;
|
2022-02-03 18:34:14 +00:00
|
|
|
KIID uuid;
|
2022-10-23 22:34:42 +00:00
|
|
|
SIZES_SETTINGS sizes;
|
2020-04-16 22:29:28 +00:00
|
|
|
};
|
|
|
|
|
2016-08-29 17:31:13 +00:00
|
|
|
LOGGER();
|
|
|
|
~LOGGER();
|
2014-05-14 13:53:54 +00:00
|
|
|
|
2015-02-18 16:53:46 +00:00
|
|
|
void Save( const std::string& aFilename );
|
|
|
|
void Clear();
|
2023-03-02 14:04:37 +00:00
|
|
|
void Log( EVENT_TYPE evt, const VECTOR2I& pos = VECTOR2I(), const ITEM* item = nullptr,
|
|
|
|
const SIZES_SETTINGS* sizes = nullptr );
|
2014-05-16 11:37:31 +00:00
|
|
|
|
2020-04-16 22:29:28 +00:00
|
|
|
const std::vector<EVENT_ENTRY>& GetEvents()
|
|
|
|
{
|
|
|
|
return m_events;
|
|
|
|
}
|
2014-05-14 13:53:54 +00:00
|
|
|
|
|
|
|
private:
|
2020-04-16 22:29:28 +00:00
|
|
|
std::vector<EVENT_ENTRY> m_events;
|
2014-05-14 13:53:54 +00:00
|
|
|
};
|
|
|
|
|
2016-08-29 14:38:11 +00:00
|
|
|
}
|
|
|
|
|
2014-05-14 13:53:54 +00:00
|
|
|
#endif
|