Rev 391 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
239 | Brean | 1 | /*************************************************************************** |
2 | * Copyright (C) 2009 by Manuel Schrape * |
||
3 | * manuel.schrape@gmx.de * |
||
4 | * and Andreas Bresser bresser@informatik.uni-bremen.de * |
||
5 | * * |
||
6 | * This program is free software; you can redistribute it and/or modify * |
||
7 | * it under the terms of the GNU General Public License as published by * |
||
8 | * the Free Software Foundation; either version 2 of the License. * |
||
9 | * * |
||
10 | * This program is distributed in the hope that it will be useful, * |
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
||
13 | * GNU General Public License for more details. * |
||
14 | * * |
||
15 | * You should have received a copy of the GNU General Public License * |
||
16 | * along with this program; if not, write to the * |
||
17 | * Free Software Foundation, Inc., * |
||
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
||
19 | ***************************************************************************/ |
||
20 | |||
21 | #include "Logger.h" |
||
22 | |||
440 | Brean | 23 | Logger::Logger(cSettings * settings, KopterData * data) |
239 | Brean | 24 | { |
440 | Brean | 25 | csv = new CSVLogger(settings, data); |
239 | Brean | 26 | logger << csv; |
27 | active = false; |
||
28 | } |
||
29 | |||
30 | Logger::~Logger() |
||
31 | { |
||
32 | close(); |
||
33 | } |
||
34 | |||
35 | //schreibe log |
||
36 | void Logger::write(int * analogData) |
||
37 | { |
||
38 | if (active == true) |
||
39 | foreach (DefaultLogger * log, logger) |
||
40 | if (log->ready()) |
||
41 | log->write(analogData); |
||
42 | } |
||
43 | |||
44 | //starte Logging |
||
45 | void Logger::start_Log() |
||
46 | { |
||
47 | active = true; |
||
240 | Brean | 48 | foreach (DefaultLogger * log, logger) |
49 | log->newLog(); |
||
239 | Brean | 50 | } |
51 | |||
52 | //soll geloggt werden? |
||
53 | bool Logger::is_active() |
||
54 | { |
||
55 | return active; |
||
56 | } |
||
57 | |||
58 | //alles schließen |
||
59 | void Logger::close() |
||
60 | { |
||
61 | active = false; |
||
62 | foreach (DefaultLogger * log, logger) |
||
63 | log->close(); |
||
247 | Brean | 64 | } |