View Javadoc
1   package net.sf.mbus4j.dataframes.datablocks.vif;
2   
3   /*
4    * #%L
5    * mbus4j-core
6    * %%
7    * Copyright (C) 2009 - 2014 MBus4J
8    * %%
9    * mbus4j - Drivers for the M-Bus protocol - http://mbus4j.sourceforge.net/
10   * Copyright (C) 2009-2014, mbus4j.sf.net, and individual contributors as indicated
11   * by the @authors tag. See the copyright.txt in the distribution for a
12   * full listing of individual contributors.
13   * 
14   * This is free software; you can redistribute it and/or modify it
15   * under the terms of the GNU General Public License as
16   * published by the Free Software Foundation; either version 3 of
17   * the License, or (at your option) any later version.
18   * 
19   * This software is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22   * Lesser General Public License for more details.
23   * 
24   * You should have received a copy of the GNU Lesser General Public
25   * License along with this software; if not, write to the Free
26   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
28   * #L%
29   */
30  /**
31   *
32   * @author arnep@users.sourceforge.net
33   * @version $Id: Vif.java 163 2016-10-07 18:53:55Z arnep $
34   */
35  public interface Vif {
36  
37      final static String FREQUENCY = "Frequency";
38      final static String PHASE_U_I = "Phase U/I";
39      final static String VOLUME = "Volume";
40      final static String ENERGY = "Energy";
41      final static String REACTIVE_ENERGY = "Reactive Energy";
42      final static String COMPLEX_ENERGY = "Complex Energy";
43      final static String MASS = "Mass";
44      final static String VOLUME_FLOW = "Volume Flow";
45      final static String POWER = "Power";
46      final static String REACTIVE_POWER = "Reactive Power";
47      final static String COMPLEX_POWER = "Complex Power";
48      final static String FLOW_TEMPERATURE = "Flow Temperature";
49      final static String RETURN_TEMPERATURE = "Return Temperature";
50      final static String TEMPERATURE_DIFFERENCE = "Temperature Difference";
51      final static String EXTERNAL_TEMPERATURE = "External Temperature";
52      final static String COLD_OR_WARM_TEMPERATURE_LIMIT = "Cold / Warm Temperature Limit";
53      final static String CUMUL_COUNT_MAX_POWER = "Cumul. count max power";
54      final static String CREDIT = "Credit of the nominal local legal currency units";
55      final static String DEBIT = "Debit of the nominal local legal currency units ";
56      final static String STORAGE_INTERVAL = "Storage interval";
57      final static String DURATION_SINCE_LAST_READOUT = "Duration since last readout";
58      final static String DURATION_OF_TARIFF = "Duration of tariff";
59      final static String PERIOD_OF_TARIFF = "Period of tariff";
60      final static String VOLTAGE = "Voltage";
61      final static String CURRENT = "Current";
62      final static String DURATION_SINCE_LAST_CUMULATION = "Duatation since last cumulation";
63      final static String OPERATING_TIME_BYTTERY = "Operating time battery";
64      final static String ON_TIME = "On Time";
65      final static String OPERATING_TIME = "Operating Time";
66      final static String MASS_FLOW = "Mass flow";
67      final static String PRESSURE = "Pressure";
68      final static String TIME_POINT = "Time Point";
69      final static String AVERAGING_DURATION = "Averaging Duration";
70      final static String ACTUALLY_DURATION = "Actually Duration";
71  
72      
73      Integer getExponent();
74      
75      /**
76       * User friendly name
77       *
78       * @return
79       */
80      String getLabel();
81  
82      SiPrefix getSiPrefix();
83  
84      UnitOfMeasurement getUnitOfMeasurement();
85  
86      /**
87       * Type of the vif i.e. ascii, primary extention FB, extention FD
88       *
89       * @return
90       */
91      VifTypes getVifType();
92  
93      final static class VifToString {
94  
95          final static String vifToString(Vif vif) {
96              StringBuilder sb = new StringBuilder();
97              sb.append(vif.getLabel());
98              if (vif.getExponent() != null) {
99                  sb.append(" * 10^").append(vif.getExponent());
100             }
101             if ((vif.getSiPrefix() != null) || (vif.getUnitOfMeasurement() != null)) {
102                 sb.append('[');
103                 if (vif.getSiPrefix() != null) {
104                     sb.append(vif.getSiPrefix());
105                 }
106                 if (vif.getUnitOfMeasurement() != null) {
107                     sb.append(vif.getUnitOfMeasurement());
108                 }
109                 sb.append(']');
110             }
111             return sb.toString();
112         }
113     }
114 
115 }