Debian Codegraph @

src/monitor.cc

raw
1 /*
2 This file is part of Icecream.
3
4 Copyright (c) 2014 Kevin Funk <[email protected]>
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, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #include "monitor.h"
22
23 #include "statusview.h"
24
25 Monitor::Monitor(HostInfoManager *manager, QObject *parent)
26 : QObject(parent)
27 , m_hostInfoManager(manager)
28 , m_schedulerState(Offline)
29 , m_currentSchedport(0)
30 {
31 }
32
33 QByteArray Monitor::currentNetname() const
34 {
35 return m_currentNetname;
36 }
37
38 void Monitor::setCurrentNetname(const QByteArray &netname)
39 {
40 m_currentNetname = netname;
41 }
42
43 QByteArray Monitor::currentSchedname() const
44 {
45 return m_currentSchedname;
46 }
47
48 void Monitor::setCurrentSchedname(const QByteArray &schedname)
49 {
50 m_currentSchedname = schedname;
51 }
52
53 uint Monitor::currentSchedport() const
54 {
55 return m_currentSchedport;
56 }
57 void Monitor::setCurrentSchedport(uint port)
58 {
59 m_currentSchedport = port;
60 }
61
62 Monitor::SchedulerState Monitor::schedulerState() const
63 {
64 return m_schedulerState;
65 }
66
67 void Monitor::setSchedulerState(SchedulerState state)
68 {
69 if (m_schedulerState == state) {
70 return;
71 }
72
73 m_schedulerState = state;
74 emit schedulerStateChanged(state);
75 }
76
77 QList<Job> Monitor::jobHistory() const
78 {
79 return QList<Job>();
80 }