~ubuntu-branches/ubuntu/wily/knutclient/wily

« back to all changes in this revision

Viewing changes to src/knutvardata.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-12-15 01:56:29 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20131215015629-kbtxdi17e1gmxb5e
Tags: 1.0.5-1
Re-packaged and re-introduced to Debian (Closes: #695840).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#define KNUTVARDATA_H
20
20
 
21
21
 
22
 
/*******************************/
23
 
/*    GLOBAL DEFINE            */
24
 
/*******************************/
25
 
 
26
 
#define DEFAULT_BG_COLOR Qt::lightGray
27
 
#define DEFAULT_FINGER_COLOR Qt::black
28
 
#define DEFAULT_OK_COLOR Qt::green
29
 
#define DEFAULT_WARNNING_COLOR Qt::yellow
30
 
#define DEFAULT_ERROR_COLOR Qt::red
31
 
#define DEFAULT_SCALE_COLOR Qt::black
32
 
#define DEFAULT_FONT_COLOR Qt::black
33
 
#define DEFAULT_KICON_COLOR Qt::white
34
 
 
35
 
#include <klocale.h>
36
 
 
37
22
#include "knutnet.h"
38
23
#include "knutupsdata.h"
39
24
#include "knutconst.h"
40
25
 
41
 
#include <qcolor.h>
42
 
#include <qfont.h>
43
 
#include <qstring.h>
44
 
 
45
 
 
46
 
//  const char *nameUpsVars1[] = {
47
 
//    "NONE", "UTILITY", "BATTPCT", "UPSTEMP", "ACFREQ", "LOADPCT", "AMBTEMP", "AMBHUMID","BATTVOLT","OUTVOLT","CURRENT","BATT_TEMP","BATT_CURRENT"};
48
 
 
49
 
//  const char *nameUpsVars2[] = {
50
 
//    "none", "input.voltage", "battery.charge", "ups.temperature", "input.frequency", "ups.load", "ambient.temperature", "ambient.humidity","battery.voltage","output.voltage","output.current","battery.temperature","battery.current"};
 
26
#include <QtGui/QColor>
 
27
#include <QtGui/QFont>
 
28
 
 
29
#include <KDE/KLocale>
 
30
 
51
31
 
52
32
 
53
33
/**
56
36
 
57
37
 
58
38
 /**
59
 
  * Class contain data about analog panels,
60
 
  * name, ..
 
39
  * Class contains data about analog panels,
 
40
  * name, ...
61
41
  * Describes view of panel.
62
42
  * Trida obsahuje data o analogovych panelech,
63
43
  * nazev, atd.
69
49
  **/
70
50
 
71
51
class QString;
72
 
class QColor;
73
 
class QFont;
74
52
 
75
53
class KNutVarData {
76
54
 
77
55
public:
78
56
 
79
 
  enum mainWindowStartVariant{
80
 
      mw_yes=0,
81
 
      mw_no,
82
 
      mw_auto
83
 
      };
84
 
 
85
57
struct ScaleStructDef {
86
58
  int start;
87
59
  int end;
90
62
 
91
63
struct SettingDataDef {
92
64
  int countCols;
93
 
  int x;
94
 
  int y;
95
 
  int width;
96
 
  int height;
97
65
  QColor mainBackgroundColor;
98
66
  QColor mPanelBackgroundColor;
99
67
  QColor aPanelBackgroundColor;
108
76
  int inputFrequency;
109
77
  bool lowHighXfer;
110
78
  bool areYouSure;
111
 
  mainWindowStartVariant useMainWindow;
 
79
  knc::mainWindowStartVariant useMainWindow;
112
80
  int useMessageWindow;
113
81
  bool customBColor;
114
82
  bool customBPanelColor;
119
87
  QFont systemFont; // system font
120
88
  bool customFont; // use custom font
121
89
  bool useDescription;
122
 
  unsigned int toolTipFlags;
 
90
  unsigned int toolTipDockFlags;
123
91
  bool customKIconColor;
124
92
  QColor kIconBackgroundColor;
125
93
  int typeOfKIcon;
128
96
  };
129
97
 
130
98
struct upsInfoDef{  //include generally informations about active (selected) UPS
131
 
  KNutNet *upsNet;  // pointer to instance of KNutNet
 
99
  KNutNet* upsNet;  // pointer to instance of KNutNet
132
100
  KNutUpsData::upsRecordDef record; // include information about information of ups (name, address, login, password ...)
133
 
  int netError; // kod chyby pri spojeni // kode if error of conection
 
101
  int netError; // kod chyby pri spojeni // kode if error of connection
134
102
  bool errorUpsData;
135
103
  // state of connection to usbd, this isn't state of knutnet
136
104
  knc::upsDriverConnection upsDriverState; // defined in knutconst.h
137
105
  int oldState; // code of lost state of UPS  kod posledniho stavu UPS
138
106
  QString name;
139
107
  QString password;
140
 
  int nutVariables;
 
108
  KNutNet::nutVarVersion nutVariables;
141
109
  int nutProtocol;
142
110
  QString runtimeVar;
143
111
  QString lowxferVar;
227
195
 
228
196
 
229
197
/**
 
198
 * Translates code of ups variable to its text value
 
199
 *
 
200
 * @since  0.2
 
201
 **/
 
202
static const QString nameUpsVar (const int i, const KNutNet::nutVarVersion varVersion );
 
203
 
 
204
/**
230
205
 * Prevede kod chyby na jeho textovou reprezentaci
231
206
 *
232
207
 * @since  0.2
233
208
 **/
234
209
  static const QString errorToText (const int error);
235
210
 
236
 
 
237
 
/**
238
 
 * Zobrazi jmeno chyby na zaklade jeho cisla.
239
 
 *
240
 
 * @since  0.1.2
241
 
 **/
242
 
  static void showError (const int error);
243
 
 
244
 
 
245
211
private:
246
212
 
247
213
  enum {aRegWhite,aRegGreen,aRegYellow,aRegRed,aRegBlue,aRegCyan,aRegMagenta,aRegBlack};
255
221
  static const int F50HZ = 0;
256
222
  static const int F60HZ = 1;
257
223
 
 
224
 
258
225
  QString m_upsVarNameAnalog[ knc::NumberOfTypes ];//array of strings - includes name of analog meters
259
226
};
260
227
 
 
228
 
261
229
#endif