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