apcupsd-ups: ignore generated files
[networkupstools/kirr.git] / drivers / solis.h
blob521d080566b5e7393d0f1733292dbf89281d9831
1 /* solis.h - Microsol Solis UPS hardware
3 Copyright (C) 2004 Silvino B. Magalhaes <sbm2yk@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
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.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 2004/10/10 - Version 0.10 - Initial release
20 2004/10/20 - Version 0.20 - add Battery information in driver
21 2004/10/26 - Version 0.30 - add commands and test shutdown
22 2004/10/30 - Version 0.40 - add model data structs
23 2004/11/22 - Version 0.50 - add internal e external shutdown programming
24 2005/06/16 - Version 0.60 - save external shutdown programming to ups,
25 support new cables and Solaris compilation
29 #ifndef INCLUDED_SOLIS_H
30 #define INCLUDED_SOLIS_H
32 typedef int bool_t;
34 /* autonomy constants */
36 int bext[5] = {14,18,28,18,1};
37 int nompow[4] = { 1000,1500,2000,3000 };
38 int inds[5] = { 0,0,1,2,3 };
39 double InVolt_offset = 30.;
41 struct {
42 int maxi; /* power internals */
43 int minc[21]; /* power minimal index */
44 int maxc[21]; /* power maximus index */
45 int mm[21][39]; /* autonomy time [minutes] */
46 } auton[5] =
47 {{ 7,
48 { 139,139,142,141,141,141,141,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ,
49 { 176,174,172,172,170,170,170,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ,
51 { 1,1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,7,8,10,11,12,15,17,19,22,25,28,31,35,40,43,47,52,59,64,68,75,75 },
52 { 1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,6,7,8,9,10,11,12,13,15,18,20,21,24,28,30,32,33,33,34,34,34,34 },
53 { 1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,4,5,5,6,7,8,9,10,11,12,13,15,17,19,21,22,23,23,23,23,23,23 },
54 { 1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,4,4,5,6,7,7,8,9,19,11,12,13,14,16,18,20,20,20,20,20,20 },
55 { 1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,4,5,5,6,6,6,7,7,8,8,10,11,12,13,14,14,14,14,14,14,14,14 },
56 { 1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,3,3,4,4,5,6,6,6,7,7,8,9,10,11,12,12,12,12,12,12,12,12,12,12 },
57 { 1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,4,4,5,5,6,6,6,7,7,8,9,10,10,10,10,10,10,10,10,10,10,10,10,10 },
58 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
59 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
60 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
61 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
62 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
63 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
64 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
65 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
66 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
67 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
68 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
69 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
70 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
71 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
72 },},
73 { 10,
74 { 141,141,141,141,141,141,141,141,141,141,0,0,0,0,0,0,0,0,0,0,0 } ,
75 { 177,177,177,172,173,172,172,172,172,172,0,0,0,0,0,0,0,0,0,0,0 } ,
77 { 1,1,1,1,1,1,1,1,1,2,2,3,3,5,6,7,9,10,12,15,16,18,22,25,27,30,36,42,45,48,55,60,64,70,78, 84,90,97,104 },
78 { 1,1,1,1,1,1,1,1,1,2,2,2,3,2,3,4,5,6,7,8,10,12,13,14,16,19,22,25,28,30,35,38,42,46,52,55, 58,60,62 },
79 { 1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,4,4,5,7,9,10,12,13,16,20,21,23,26,28,30,34,35,37,38,39,40 ,40,40 },
80 { 1,1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,4,4,5,6,7,8,9,10,11,13,14,16,18,21,22,24,27,27,27,27,27,27 },
81 { 1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,4,4,4,4,5,6,7,8,9,10,11,12,14,15,16,19,20,22,23,23,23,23,23 },
82 { 1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,3,3,4,4,4,4,5,6,7,8,9,10,11,12,13,14,16,17,18,18,18,18,18,18 },
83 { 1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,4,4,4,4,4,5,7,7,7,8,9,10,11,12,14,14,14,14,14,14,14 },
84 { 1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,3,4,4,4,4,4,5,6,7,7,8,8,9,10,11,12,13,13,13,13,13,13,13,13 },
85 { 1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,4,4,4,4,4,5,6,7,7,8,9,10,10,11,11,12,12,12,12,12,12 },
86 { 1,1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,3,4,4,4,4,5,6,6,7,7,8,8,8,9,9,10,10,10,10,10,10,10,10 },
87 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
88 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
89 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
90 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
91 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
92 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
93 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
94 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
95 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
96 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
97 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
98 },},
99 { 13,
100 { 141,141,141,141,141,141,141,141,141,141,141,141,141,0,0,0,0,0,0,0,0 } ,
101 { 177,177,177,172,173,172,172,172,172,172,172,172,172,0,0,0,0,0,0,0,0 } ,
103 { 1,1,1,1,1,1,2,2,2,3,4,5,5,8,10,11,13,15,18,22,24,28,34,40,43,48,56,65,70,76,85,93,100,110,122,132,141,152,162 },
104 { 1,1,1,1,1,1,1,2,2,2,3,3,3,4,5,6,8,9,10,12,15,18,20,22,25,30,35,40,44,48,54,60,65,73,80,85,92,94,95 },
105 { 1,1,1,1,1,1,1,2,2,3,3,3,4,4,4,5,5,6,8,10,14,16,18,20,24,30,32,36,40,44,48,52,54,58,59,60 ,62,62,62 },
106 { 1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,4,5,5,6,8,9,10,12,13,15,17,20,22,24,28,32,35,38,42,42,42,42,42,42 },
107 { 1,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,6,7,8,10,11,12,14,15,17,18,21,24,26,29,32,34,36,36,36,36,36 },
108 { 1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,7,8,9,10,12,13,15,16,18,20,22,24,26,28,28,28,28,28,28 },
109 { 1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,4,5,5,6,6,7,8,9,10,11,13,14,15,17,19,21,22,22,22,22,22,22 },
110 { 1,1,1,1,1,1,1,2,2,2,3,3,3,3,4,4,5,5,6,6,7,8,8,9,10,11,12,14,15,17,18,19,20,20,20,20,20,20,20 },
111 { 1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,4,4,5,6,6,7,7,8,9,10,11,12,13,15,15,16,16,16,16,16,16,16,16 },
112 { 1,1,1,1,1,1,1,1,2,2,2,3,3,3,4,4,4,5,5,6,7,8,9,9,10,11,12,12,12,13,13,14,14,14,14,14,14,14,14 },
113 { 1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,4,4,5,5,6,7,7,8,9,10,10,10,11,11,12,12,12,12,12,12,12,12 },
114 { 1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,4,4,5,5,6,6,7,7,8,8,8,9,9,10,10,10,10,10,10,10,10 },
115 { 1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8 },
116 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
117 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
118 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
119 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
120 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
121 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
122 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
123 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
124 },},
125 { 21,
126 { 141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141 } ,
127 { 177,175,173,171,169,169,168,168,167,167,166,165,164,162,160,160,160,160,159,158,157 } ,
129 { 1,1,1,1,2,2,3,4,5,6,7,8,9,10,11,12,13,14,16,19,22,24,27,30,33,37,42,44,50,55,60,65,70,75 ,80,88,93,95,100 },
130 { 1,1,1,1,2,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18,20,22,25,27,31,35,38,42,46,50,55,61,66,71 ,76,83,89,89,89 },
131 { 1,1,1,1,2,2,3,3,4,5,6,7,8,8,9,10,11,12,13,15,18,19,22,24,26,30,33,38,40,45,50,55,60,66,70,70,70,70,70 },
132 { 1,1,1,1,1,1,2,2,3,4,5,6,7,7,8,9,10,10,11,13,16,17,19,21,23,25,28,34,36,39,45,50,55,55,55,55,55,55,55 },
133 { 1,1,1,1,1,1,2,2,3,4,4,5,6,6,7,8,8,9,10,12,14,15,17,18,20,21,25,28,30,34,39,39,39,39,39,39,39,39,39 },
134 { 1,1,1,1,1,1,2,2,3,4,4,4,5,5,6,7,8,8,9,10,12,13,15,16,18,19,22,25,26,28,30,30,30,30,30,30,30,30,30 },
135 { 1,1,1,1,1,1,2,2,2,3,3,3,4,4,5,6,7,7,8,9,11,12,13,14,17,17,20,22,24,26,26,26,26,26,26,26,26,26,26 },
136 { 1,1,1,1,1,1,2,2,2,3,3,3,4,4,5,5,6,7,7,8,10,11,12,13,15,16,18,20,22,23,23,23,23,23,23,23,23,23,23 },
137 { 1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,4,5,6,7,7,9,10,11,13,14,15,16,18,19,19,19,19,19,19,19,19,19,19,19 },
138 { 1,1,1,1,1,1,1,1,1,2,2,2,2,3,4,4,5,6,7,7,8,10,11,13,14,15,15,16,17,17,17,17,17,17,17,17,17,17,17 },
139 { 1,1,1,1,1,1,1,1,1,2,2,2,2,3,4,4,5,6,7,7,8,9,10,11,13,14,13,14,14,14,14,14,14,14,14,14,14,14,14 },
140 { 1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,4,5,5,6,6,7,8,9,10,12,13,12,13,13,13,13,13,13,13,13,13,13,13,13 },
141 { 1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,4,5,5,6,6,7,8,8,9,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12 },
142 { 1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,5,6,6,7,7,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 },
143 { 1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,5,6,6,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 },
144 { 1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,5,6,6,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 },
145 { 1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,4,5,5,6,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 },
146 { 1,1,1,1,1,1,1,1,1,1,2,2,2,3,3,4,4,5,5,6,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 },
147 { 1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 },
148 { 1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6 },
149 { 1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5 },
150 },},
151 { 21,
152 { 141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141 } ,
153 { 177,175,173,171,169,169,168,168,167,167,166,165,164,162,160,160,160,160,159,158,157 } ,
155 { 1,1,1,2,5,5,8,11,14,16,19,22,36,40,44,48,52,56,64,76,88,96,145,162,
156 178,199,226,237,270,297,324,351,378,405,432,475,502,513,540 },
157 { 1,1,1,2,3,5,8,11,14,16,19,22,36,40,44,48,52,56,60,72,80,88,135,145,
158 167,189,205,226,248,270,297,329,356,383,410,448,480,480,480 },
159 { 1,1,1,2,3,5,6,8,11,14,16,19,32,32,36,40,44,48,52,60,72,76,118,129,
160 140,162,178,205,216,243,270,297,324,356,378,378,378,378,378 },
161 { 1,1,1,2,3,4,5,6,8,11,14,16,28,28,32,36,40,40,44,52,64,68,102,
162 113,124,135,151,183,194,210,243,270,297,297,297,297,297,297,297 },
163 { 1,1,1,2,3,4,5,6,8,11,11,14,24,24,28,32,32,36,40,48,56,60,91,
164 97,108,113,135,151,162,183,210,210,210,210,210,210,210,210,210 },
165 { 1,1,1,2,3,4,5,6,8,11,11,11,20,20,24,28,32,32,36,40,48,52,81,
166 86,97,102,118,135,140,151,162,162,162,162,162,162,162,162,162 },
167 { 1,1,1,2,3,4,5,6,7,8,8,8,16,16,20,24,28,28,32,36,44,48,70,75,
168 91,91,108,118,129,140,140,140,140,140,140,140,140,140,140 },
169 { 1,1,1,2,2,3,4,5,5,8,8,8,16,16,20,20,24,28,28,32,40,44,64,70,
170 81,86,97,108,118,124,124,124,124,124,124,124,124,124,124 },
171 { 1,1,1,2,2,3,3,4,4,5,5,6,12,12,16,16,20,24,28,28,36,40,59,
172 70,75,81,86,97,102,102,102,102,102,102,102,102,102,102,102 },
173 { 1,1,1,2,2,3,3,4,4,5,5,8,10,12,16,16,20,24,28,28,32,40,
174 59,70,75,81,81,86,91,91,91,91,91,91,91,91,91,91,91 },
175 { 1,1,1,2,2,3,3,4,4,5,6,8,10,12,16,16,20,24,28,28,32,36,54,
176 59,70,75,70,75,75,75,75,75,75,75,75,75,75,75,75 },
177 { 1,1,2,2,2,2,2,2,2,5,6,8,10,12,16,18,20,22,24,26,28,36,48,
178 54,60,65,70,70,70,70,70,70,70,70,70,70,70,70,70 },
179 { 1,1,1,2,2,3,3,4,4,5,6,8,10,12,15,16,18,20,22,24,28,32,43,
180 48,58,64,64,64,64,64,64,64,64,64,64,64,64,64,64 },
181 { 1,1,1,2,2,3,3,4,4,4,5,6,8,10,12,16,20,24,26,28,30,32,42,
182 48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48 },
183 { 1,1,1,2,2,3,3,4,4,4,5,6,8,10,12,15,18,20,24,28,30,32,32,
184 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32 },
185 { 1,1,1,2,2,3,3,4,4,4,5,6,8,10,12,16,18,22,24,28,30,32,32,
186 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32 },
187 { 1,1,1,2,2,3,3,4,4,4,5,6,8,10,12,16,18,20,22,24,28,32,32,
188 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32 },
189 { 1,1,1,2,2,3,3,4,4,4,5,6,8,10,12,16,18,20,22,24,28,32,32,
190 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32 },
191 { 1,1,1,2,2,3,3,4,5,5,6,8,10,12,14,16,18,20,22,24,28,28,28,
192 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28 },
193 { 1,1,1,2,2,3,3,4,4,5,5,6,8,10,12,16,18,20,22,24,24,24,24,
194 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24 },
195 { 1,1,1,2,2,3,3,3,4,5,5,6,8,10,12,15,16,18,20,20,20,20,20,
196 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20 }
197 },},
200 /* -----------------------------------------------------------
201 * Solis constants for data ajustment
202 * ----------------------------------------------------------- */
204 struct {
205 double m_infreq;
206 double m_appp_offset;
207 double m_involt193[2];
208 double m_involt194[2];
209 double m_incurr[2];
210 double m_battvolt[2];
211 double m_outvolt_s[2][2];
212 double m_outvolt_i[2][2];
213 double m_outcurr_s[2][2];
214 double m_outcurr_i[2][2];
215 double m_utilp_s[2][2];
216 double m_utilp_i[2][2];
217 double m_appp_s[2][2];
218 double m_appp_i[2][2];
219 } ctab[5] =
221 { 101620.0, 25.0,
222 { 1.141, 13.0 },
223 { 1.141, 13.0 },
224 { 22.2, 800.0 },
225 { 1.0/7.19, 0.0 },
226 { { 1.45, 13.0 },{ 1.4, 17.0 } },
227 { { 1.45, 13.0 },{ 1.4, 17.0 } },
228 { { 1.0/20.5, 0.15 }, { 1.0/20.5, 0.15 } },
229 { { 1.0/20.5, 0.15 }, { 1.0/20.5, 0.15 } },
230 { { 1.0/12.8, 16.0 }, { 1.0/12.3, 15.0 } },
231 { { 1.0/12.8, 16.0 }, { 1.0/12.3, 15.0 } },
232 { { 1.0/13.46, 16.7 }, { 1.0/12.9, 19.0 } },
233 { { 1.0/13.46, 16.7 }, { 1.0/12.9, 19.0 } }
235 { 101715.0, 28.0,
236 { 1.141, 12.0 },
237 { 2.5, -250.0 },
238 { 22.2, 800.0 },
239 { 1.0/7.19, 0.6},
240 { { 1.44, 13.0 }, { 1.4, 18.0 } },
241 { { 2.9, 13.0 }, { 3.15, 2.0 } },
242 { { 1.0/21.75, 0.15 }, { 1.0/21.75, 0.15 } },
243 { { 1.0/49.0, 0.1 }, { 1.0/49.0, 0.1 } },
244 { { 1.0/12.87, 15.6 }, { 1.0/12.2, 13.0 } },
245 { { 1.0/14.5, 20.0 }, { 1.0/14.0, 25.0 } },
246 { { 1.0/13.5, 16.0 }, { 1.0/12.9, 17.0 } },
247 { { 1.0/15.4, 22.0 }, { 1.0/14.5, 22.0 } }
249 { 101620.0, 35.0,
250 { 1.141, 13.0 },
251 { 2.5, -250.0 },
252 { 22.2, 800.0 },
253 { 1.0/7.0, 0.0 },
254 { { 1.375, 16.0 }, { 1.41, 16.0 } },
255 { { 2.8, 20.0 }, { 2.9, 18.0 } },
256 { { 1.0/16.5, 0.1 }, { 1.0/16.8, 0.0 } },
257 { { 1.0/32.5, 0.0 }, { 1.0/32.5, 0.0 } },
258 { { 1.0/10.2, 11.0 }, { 1.0/9.4, 15.0 } },
259 { { 1.0/10.1, 26.0 }, { 1.0/9.4, 30.0 } },
260 { { 1.0/10.2, 11.0 }, { 1.0/9.4, 15.0 } },
261 { { 1.0/10.6, 26.0 }, { 1.0/9.8, 30.0 } }
263 { 101700.0, 40.0,
264 { 1.141, 13.0 },
265 { 2.5, -250.0 },
266 { 35.0, 800.0 },
267 { 1.0/7.19, 1.1 },
268 { { 1.45, 11.8 }, { 1.65, 0.0 } },
269 { { 2.93, 13.0 }, { 3.0, 12.0 } },
270 { { 1.0/12.2, 0.32 }, { 1.0/12.2, 0.32 } },
271 { { 1.0/23.2, 0.2 }, { 1.0/23.2, 0.20 } },
272 { { 1.0/7.0, 16.5 }, { 1.0/6.85, 13.0 } },
273 { { 1.0/7.15, 30.0 }, { 1.0/6.87, 23.0 } },
274 { { 1.0/7.45, 28.0 }, { 1.0/7.25, 18.2 } },
275 { { 1.0/7.55, 37.0 }, { 1.0/7.25, 29.0 } }
277 { 101800.0, 56.0,
278 { 1.127, 12.0 },
279 { 2.5, -250.0 },
280 { 35.0, 1000.0 },
281 { 1.0/3.52, 0.0 },
282 { { 1.41, 13.0 }, { 1.4, 17.0 } },
283 { { 2.73, 25.0 }, { 2.73, 30.0 } },
284 { { 1.0/8.15, 0.25 }, { 1.0/8.15, 0.25 } },
285 { { 1.0/16.0, 0.4 }, { 1.0/15.0, 0.4 } },
286 { { 1.0/4.87, 19.0 }, { 1.0/4.55, 17.0 } },
287 { { 1.0/4.78, 52.0 }, { 1.0/4.55, 55.0 } },
288 { { 1.0/5.15, 29.0 }, { 1.0/4.8, 26.0 } },
289 { { 1.0/4.78, 52.0 }, { 1.0/4.55, 55.0 } }
293 /* Date, time and programming group */
294 static int const BASE_YEAR = 1998;
295 int Day, Month, Year;
296 int isprogram = 0, progshut = 0, prgups = 0;
297 int dian=0, mesn=0, anon=0, weekn=0;
298 int dhour, dmin, lhour, lmin, ihour,imin, isec, hourshut, minshut;
299 unsigned char DaysOnWeek=0, DaysOffWeek=0, DaysStd = 0;
300 char seman[4];
302 /* buffers */
303 unsigned char RecPack[25];
304 unsigned char ConfigPack[12];
307 unsigned char MibData[161];
308 unsigned char DumpPack[242];
311 /* Identification */
312 char Model[12];
313 int SolisModel, imodel;
314 int InputValue, Out220;
316 /* protocol */
317 int Waiting, NumByteRec = 0;
318 int pacsize;
320 /* Status group */
321 unsigned char InputStatus,OutputStatus, BattStatus, StatusGeral;
322 /* Events group */
323 unsigned char SourceEvents, OutputEvents, BattEvents, GeneralEvents;
325 /* logical */
326 bool_t detected = 0;
327 bool_t SourceFail, SourceLast, FailureFlag, SourceReturn, SuperHeat;
328 bool_t SuperHeatLast, OverCharge, OverChargeLast, LowBatt;
329 bool_t CriticBatt, CriticBattLast, Flag_inversor, InversorOn, InversorOnLast;
331 /* Input group */
332 double InVoltage, InCurrent, InFreq;
333 double InDownLim, InUpLim, NomInVolt;
334 /* Output group */
335 double OutVoltage, OutCurrent, OutFreq, OutDownLim, OutUpLim, NomOutVolt;
336 /* Battery group */
337 int Autonomy, BattExtension, maxauto;
338 double BattVoltage, BattCurrent, Temperature, batcharge;
339 double Bat_LimInfRede, Bat_LimSupRede, Bat_LimInfInv, Bat_LimSupInv, Bat_VoltNom;
340 /* Power group */
341 double AppPower, UtilPower, upscharge;
342 int ChargePowerFactor, NominalPower, UpsPowerFactor;
344 static void prnInfo(void);
345 static int IsToday( unsigned char, int );
346 static void AutonomyCalc( int );
347 static void ScanReceivePack(void);
348 static void CommReceive(const char*, int );
349 static void getbaseinfo(void);
350 static void getupdateinfo(void);
352 #endif /* INCLUDED_SOLIS_H */