View Javadoc

1   /*
2    * Copyright 2009, openv4j.sf.net, and individual contributors as indicated
3    * by the @authors tag. See the copyright.txt in the distribution for a
4    * full listing of individual contributors.
5    *
6    * This is free software; you can redistribute it and/or modify it
7    * under the terms of the GNU General Public License as
8    * published by the Free Software Foundation; either version 3 of
9    * the License, or (at your option) any later version.
10   *
11   * This software 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 GNU
14   * Lesser General Public License for more details.
15   *
16   * You should have received a copy of the GNU Lesser General Public
17   * License along with this software; if not, write to the Free
18   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
20   *
21   * $Id: $
22   *
23   * @author arnep
24   */
25  package net.sf.openv4j;
26  
27  import java.io.Serializable;
28  
29  /**
30   * 
31   */
32  public enum Devices implements Serializable {GWG_BT2(0x2054, Protocol.GWG),
33      GWG_VBEM(0x2053, Protocol.GWG),
34      GWG_VBT(0x2053, Protocol.GWG),
35      GWG_VWMS(0x2053, Protocol.GWG),
36      HV_GWG(0x2000, Protocol.GWG),
37      HV_V050(0x2000, Protocol.GWG),
38      HV_V300KW3(0x2000, Protocol.GWG),
39      V050HK1M(0x20b4, Protocol.KW),
40      V050HK1S(0x20ac, Protocol.KW),
41      V050HK1W(0x20aa, Protocol.KW),
42      V050HK3S(0x20ad, Protocol.KW),
43      V050HK3W(0x20ab, Protocol.KW),
44      V100GC1(0x20a0, Protocol.KW),
45      V100KC2(0x2091, Protocol.KW),
46      V150KB1(0x2092, Protocol.KW),
47      V200GW1(0x20a4, Protocol.KW),
48      V200KW1(0x2094, Protocol.KW),
49      V200KW2(0x2098, Protocol.KW),
50      V300GW2(0x20a5, Protocol.KW),
51      V300KW3(0x209c, Protocol.KW),
52      V333MW1(0x20b8, Protocol._300, Protocol.KW),
53      V333MW1S(0x20b9, Protocol._300, Protocol.KW),
54      V333MW2(0x20ba, Protocol._300, Protocol.KW),
55      VDensHC1(0x20c0, Protocol._300, Protocol.KW),
56      VDensHC2(0x20c1, Protocol._300, Protocol.KW),
57      VDensHO1(0x20c2, Protocol._300, Protocol.KW),
58      Vitocom300(0x208a, Protocol._300, Protocol.KW),
59      VPendHC1(0x20c3, Protocol._300, Protocol.KW),
60      VPendHC2(0x20c4, Protocol._300, Protocol.KW),
61      VPendHO1(0x20c5, Protocol._300, Protocol.KW),
62      VPlusHC1(0x20c6, Protocol._300, Protocol.KW),
63      VPlusHC2(0x20c7, Protocol._300, Protocol.KW),
64      VPlusHO1(0x20c8, Protocol._300, Protocol.KW),
65      VScotHC1(0x20c9, Protocol._300, Protocol.KW),
66      VScotHC2(0x20ca, Protocol._300, Protocol.KW),
67      VScotHO1(0x20cb, Protocol._300, Protocol.KW);
68  
69      final int id;
70      final Protocol[] protocols;
71  
72      private Devices(int id, Protocol... protocols) {
73          this.id = id;
74          this.protocols = protocols;
75      }
76  
77      public int getId() {
78          return id;
79      }
80  
81      public String getName() {
82          return name();
83      }
84  
85      public String getLabel() {
86          return name();
87      }
88  
89      public static Devices getDeviceById(int devId) {
90          for (Devices dev : Devices.values()) {
91              if (dev.id == devId) {
92                  return dev;
93              }
94          }
95  
96          return null;
97      }
98  
99      public Protocol[] getProtocols() {
100         return new Protocol[] { Protocol.KW };
101     }
102 }