KiCad PCB EDA Suite
Loading...
Searching...
No Matches
time_limit.cpp
Go to the documentation of this file.
1/*
2 * KiRouter - a push-and-(sometimes-)shove PCB router
3 *
4 * Copyright (C) 2013-2014 CERN
5 * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6 * Author: Tomasz Wlostowski <[email protected]>
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#include <wx/timer.h>
23
24#include "time_limit.h"
25
26namespace PNS {
27
28TIME_LIMIT::TIME_LIMIT( int aMilliseconds ) :
29 m_limitMs( aMilliseconds )
30{
31 Restart();
32}
33
34
36{}
37
38
40{
41 return ( wxGetLocalTimeMillis().GetValue() - m_startTics ) >= m_limitMs;
42}
43
44
46{
47 m_startTics = wxGetLocalTimeMillis().GetValue();
48}
49
50
51void TIME_LIMIT::Set( int aMilliseconds )
52{
53 m_limitMs = aMilliseconds;
54}
55
56}
void Set(int aMilliseconds)
Definition: time_limit.cpp:51
TIME_LIMIT(int aMilliseconds=0)
Definition: time_limit.cpp:28
int64_t m_startTics
Definition: time_limit.h:43
bool Expired() const
Definition: time_limit.cpp:39
Push and Shove diff pair dimensions (gap) settings dialog.