ekm-omnimeter 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -7
- data/README.md +0 -1
- data/ekm-omnimeter.gemspec +0 -1
- data/lib/ekm-omnimeter/configuration.rb +23 -0
- data/lib/ekm-omnimeter/meter.rb +181 -50
- data/lib/ekm-omnimeter/version.rb +1 -1
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 758e496aeac9d9f1cf799c3beaee919f2f322060
|
4
|
+
data.tar.gz: f703b60257dd10c354d4777ce804908cca9ed7dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd0305137f9ec0e3f4bf6c2cb3da5286210ba4d267c93f89ca1a71500c952bf67c6821d6f40fd99bf33f576c50d99dffcbee2e7e2cd33bb23a520f38773fc59f
|
7
|
+
data.tar.gz: 6edc0ed3de4baefb7e57d72083aff3ea3b92cc0954480d9b39c4ff99d6c2be28a504a797c58e19bfe025ac1e7fb47903f48860f2bca14508e94d8a8227011c27
|
data/Gemfile.lock
CHANGED
@@ -2,17 +2,13 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
ekm-omnimeter (0.1.0)
|
5
|
-
bigdecimal
|
6
|
-
daemons
|
7
5
|
log4r (~> 1.1)
|
8
|
-
trollop
|
9
6
|
xively-rb-connector (~> 0.1)
|
10
7
|
|
11
8
|
GEM
|
12
9
|
remote: https://rubygems.org/
|
13
10
|
specs:
|
14
11
|
bigdecimal (1.2.5)
|
15
|
-
daemons (1.1.9)
|
16
12
|
diff-lcs (1.2.5)
|
17
13
|
httparty (0.13.0)
|
18
14
|
json (~> 1.8)
|
@@ -34,7 +30,6 @@ GEM
|
|
34
30
|
rspec-expectations (2.14.5)
|
35
31
|
diff-lcs (>= 1.1.3, < 2.0)
|
36
32
|
rspec-mocks (2.14.6)
|
37
|
-
trollop (2.0)
|
38
33
|
xively-rb (0.2.10)
|
39
34
|
httparty (>= 0.10.0)
|
40
35
|
multi_json (>= 1.3.6)
|
@@ -42,7 +37,7 @@ GEM
|
|
42
37
|
nokogiri (>= 1.5.6)
|
43
38
|
ox (>= 1.5.9)
|
44
39
|
yajl-ruby (>= 1.1.0)
|
45
|
-
xively-rb-connector (0.1.
|
40
|
+
xively-rb-connector (0.1.3)
|
46
41
|
bigdecimal (~> 1.2)
|
47
42
|
log4r (~> 1.1)
|
48
43
|
xively-rb (~> 0.2)
|
@@ -55,4 +50,4 @@ DEPENDENCIES
|
|
55
50
|
bundler (~> 1.3)
|
56
51
|
ekm-omnimeter!
|
57
52
|
rake (~> 10.2)
|
58
|
-
rspec
|
53
|
+
rspec (~> 2.14)
|
data/README.md
CHANGED
data/ekm-omnimeter.gemspec
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
module EkmOmnimeter
|
2
|
+
|
3
|
+
class << self
|
4
|
+
attr_writer :configuration
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.configuration
|
8
|
+
@configuration ||= Configuration.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.reset
|
12
|
+
@configuration = Configuration.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.configure
|
16
|
+
yield(configuration)
|
17
|
+
end
|
18
|
+
|
19
|
+
class Configuration
|
20
|
+
attr_accessor :sockets
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/lib/ekm-omnimeter/meter.rb
CHANGED
@@ -13,7 +13,7 @@ module EkmOmnimeter
|
|
13
13
|
VALID_POWER_CONFIGURATIONS = [:single_phase_2wire, :single_phase_3wire, :three_phase_3wire, :three_phase_4wire]
|
14
14
|
|
15
15
|
# Initialization attributes
|
16
|
-
attr_reader :meter_number, :remote_address, :remote_port, :power_configuration
|
16
|
+
attr_reader :meter_number, :remote_address, :remote_port, :power_configuration, :last_read_timestamp
|
17
17
|
|
18
18
|
# Request A
|
19
19
|
#attr_reader :meter_type, :meter_firmware, :address, :total_active_kwh, :total_kvarh, :total_rev_kwh, :three_phase_kwh, :three_phase_rev_kwh, :resettable_kwh, :resettable_reverse_kwh, :volts_l1, :volts_l2, :volts_l3, :amps_l1, :amps_l2, :amps_l3, :watts_l1, :watts_l2, :watts_l3, :watts_total, :cosϴ_l1, :cosϴ_l2, :cosϴ_l3, :var_l1, :var_l2, :var_l3, :var_total, :freq, :pulse_count_1, :pulse_count_2, :pulse_count_3, :pulse_input_hilo, :direction_of_current, :outputs_onoff, :kwh_data_decimal_places,
|
@@ -54,41 +54,43 @@ module EkmOmnimeter
|
|
54
54
|
#@pulse_input_3_device = options[:pulse_input_2_device] || nil
|
55
55
|
|
56
56
|
@values = {}
|
57
|
-
@
|
57
|
+
@last_read_timestamp = nil
|
58
58
|
|
59
59
|
# Get values
|
60
|
-
|
60
|
+
read()
|
61
61
|
|
62
62
|
end
|
63
63
|
|
64
|
-
#
|
64
|
+
# A complete read spans two protocol requests
|
65
65
|
def read
|
66
66
|
request_a()
|
67
|
+
request_b()
|
68
|
+
@values
|
67
69
|
end
|
68
70
|
|
69
71
|
# Formatted datetime reported by meter during last read
|
70
|
-
def
|
72
|
+
def meter_timestamp
|
71
73
|
"20#{current_time[0,2]}-#{current_time[2,2]}-#{current_time[4,2]} #{current_time[6,2]}:#{current_time[ 8,2]}:#{current_time[10,2]}"
|
72
74
|
end
|
73
75
|
|
74
76
|
# Attribute handler that delegates attribute reads to the values hash
|
75
77
|
def method_missing(method_sym, *arguments, &block)
|
76
78
|
|
77
|
-
|
79
|
+
#@logger.debug "method_missing #{method_sym.inspect}"
|
78
80
|
|
79
81
|
# Only refresh data if its more than 0.25 seconds old
|
80
|
-
et = @
|
81
|
-
|
82
|
+
et = @last_read_timestamp.nil? ? 0 : (Time.now - @last_read_timestamp)
|
83
|
+
#logger.debug "Elapsed time since last read #{et}"
|
82
84
|
if et > 250
|
83
85
|
@logger.info "More than 250 milliseconds have passed, updating data"
|
84
86
|
read()
|
85
87
|
end
|
86
88
|
|
87
89
|
if @values.include? method_sym
|
88
|
-
|
90
|
+
#logger.debug "Found #{method_sym}"
|
89
91
|
@values[method_sym]
|
90
92
|
else
|
91
|
-
|
93
|
+
#logger.debug "Didn't find #{method_sym}"
|
92
94
|
super
|
93
95
|
end
|
94
96
|
end
|
@@ -169,7 +171,100 @@ module EkmOmnimeter
|
|
169
171
|
end
|
170
172
|
end
|
171
173
|
|
172
|
-
|
174
|
+
def to_kwh_float(s)
|
175
|
+
to_f_with_decimal_places(s, @values[:kwh_data_decimal_places])
|
176
|
+
end
|
177
|
+
|
178
|
+
def to_f_with_decimal_places(s, p=1)
|
179
|
+
unless s.nil?
|
180
|
+
v = (s.to_f / (10 ** p))
|
181
|
+
logger.debug "Casting #{s.inspect} -> #{v.inspect}"
|
182
|
+
v
|
183
|
+
else
|
184
|
+
logger.error "Could not cast #{s} to #{p} decimal places"
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def cast_response_to_correct_types(d)
|
189
|
+
|
190
|
+
# Integers
|
191
|
+
[:kwh_data_decimal_places,
|
192
|
+
:watts_l1,
|
193
|
+
:watts_l2,
|
194
|
+
:watts_l3,
|
195
|
+
:watts_total,
|
196
|
+
:maximum_demand,
|
197
|
+
:ct_ratio,
|
198
|
+
:pulse_1_count,
|
199
|
+
:pulse_1_ratio,
|
200
|
+
:pulse_2_count,
|
201
|
+
:pulse_2_ratio,
|
202
|
+
:pulse_3_count,
|
203
|
+
:pulse_3_ratio,
|
204
|
+
:reactive_power_1,
|
205
|
+
:reactive_power_2,
|
206
|
+
:reactive_power_3,
|
207
|
+
:total_reactive_power,
|
208
|
+
:settable_pulse_per_kwh_ratio
|
209
|
+
].each do |k|
|
210
|
+
logger.debug "Casting #{k} = #{d[k].inspect} -> #{d[k].to_i}"
|
211
|
+
d[k] = d[k].to_i if d.has_key?(k)
|
212
|
+
end
|
213
|
+
|
214
|
+
# Floats with precision 1
|
215
|
+
[:volts_l1,
|
216
|
+
:volts_l2,
|
217
|
+
:volts_l3,
|
218
|
+
:amps_l1,
|
219
|
+
:amps_l2,
|
220
|
+
:amps_l3
|
221
|
+
].each do |k|
|
222
|
+
logger.debug "Casting #{k}"
|
223
|
+
d[k] = to_f_with_decimal_places(d[k], 1) if d.has_key?(k)
|
224
|
+
end
|
225
|
+
|
226
|
+
# Floats with precision 2
|
227
|
+
[:power_factor_1,
|
228
|
+
:power_factor_2,
|
229
|
+
:power_factor_3,
|
230
|
+
:frequency
|
231
|
+
].each do |k|
|
232
|
+
logger.debug "Casting #{k}"
|
233
|
+
d[k] = to_f_with_decimal_places(d[k], 2) if d.has_key?(k)
|
234
|
+
end
|
235
|
+
|
236
|
+
# Floats with precision set by kwh_data_decimal_places
|
237
|
+
[:total_kwh,
|
238
|
+
:reactive_kwh_kvarh,
|
239
|
+
:total_forward_kwh,
|
240
|
+
:total_reverse_kwh,
|
241
|
+
:net_kwh,
|
242
|
+
:total_kwh_l1,
|
243
|
+
:total_kwh_l2,
|
244
|
+
:total_kwh_l3,
|
245
|
+
:reverse_kwh_l1,
|
246
|
+
:reverse_kwh_l2,
|
247
|
+
:reverse_kwh_l3,
|
248
|
+
:resettable_total_kwh,
|
249
|
+
:resettable_reverse_kwh,
|
250
|
+
:total_kwh_t1,
|
251
|
+
:total_kwh_t2,
|
252
|
+
:total_kwh_t3,
|
253
|
+
:total_kwh_t4,
|
254
|
+
:reverse_kwh_t1,
|
255
|
+
:reverse_kwh_t2,
|
256
|
+
:reverse_kwh_t3,
|
257
|
+
:reverse_kwh_t4
|
258
|
+
].each do |k|
|
259
|
+
logger.debug "Casting #{k}"
|
260
|
+
d[k] = to_kwh_float(d[k]) if d.has_key?(k)
|
261
|
+
end
|
262
|
+
|
263
|
+
end
|
264
|
+
|
265
|
+
|
266
|
+
# Request A
|
267
|
+
# TODO: Instead of pre-parsing and casting everything, refactor this so that only the response string gets saved, and parse out values that are accessed.
|
173
268
|
def request_a
|
174
269
|
|
175
270
|
# 2F 3F 12 Bytes Address 30 30 21 0D 0A
|
@@ -178,7 +273,11 @@ module EkmOmnimeter
|
|
178
273
|
read_bytes = 255
|
179
274
|
logger.debug "Socket write #{request}" unless logger.nil?
|
180
275
|
response = get_remote_meter_data(request, read_bytes)
|
181
|
-
|
276
|
+
|
277
|
+
if response.nil?
|
278
|
+
log.error "No response to request_a from meter #{address}"
|
279
|
+
raise EkmOmnimeter, "No response from meter."
|
280
|
+
end
|
182
281
|
|
183
282
|
# Split the response string into an array and prepare a hash to store the values
|
184
283
|
a = response.split('')
|
@@ -189,12 +288,20 @@ module EkmOmnimeter
|
|
189
288
|
d[:meter_type] = a.shift(2) # 2 Byte Meter Type
|
190
289
|
d[:meter_firmware] = a.shift(1) # 1 Byte Meter Firmware
|
191
290
|
d[:address] = a.shift(12) # 12 Bytes Address
|
192
|
-
d[:
|
193
|
-
d[:
|
194
|
-
d[:
|
195
|
-
|
196
|
-
|
197
|
-
d[:
|
291
|
+
d[:total_kwh] = a.shift(8) # 8 Bytes total Active kWh
|
292
|
+
d[:reactive_kwh_kvarh] = a.shift(8) # 8 Bytes Total kVARh
|
293
|
+
d[:total_reverse_kwh] = a.shift(8) # 8 Bytes Total Rev.kWh
|
294
|
+
|
295
|
+
# 24 Bytes 3 phase kWh
|
296
|
+
d[:total_kwh_l1] = a.shift(8)
|
297
|
+
d[:total_kwh_l2] = a.shift(8)
|
298
|
+
d[:total_kwh_l3] = a.shift(8)
|
299
|
+
# 24 Bytes 3 phase Rev.kWh
|
300
|
+
d[:reverse_kwh_l1] = a.shift(8)
|
301
|
+
d[:reverse_kwh_l2] = a.shift(8)
|
302
|
+
d[:reverse_kwh_l3] = a.shift(8)
|
303
|
+
|
304
|
+
d[:resettable_total_kwh] = a.shift(8) # 8 Bytes Resettable kWh
|
198
305
|
d[:resettable_reverse_kwh] = a.shift(8) # 8 bytes Resettable Reverse kWh
|
199
306
|
d[:volts_l1] = a.shift(4) # 4 Bytes Volts L1
|
200
307
|
d[:volts_l2] = a.shift(4) # 4 Bytes Volts L2
|
@@ -206,17 +313,17 @@ module EkmOmnimeter
|
|
206
313
|
d[:watts_l2] = a.shift(7) # 7 Bytes Watts L2
|
207
314
|
d[:watts_l3] = a.shift(7) # 7 Bytes Watts L3
|
208
315
|
d[:watts_total] = a.shift(7) # 7 Bytes Watts Total
|
209
|
-
d[:
|
210
|
-
d[:
|
211
|
-
d[:
|
212
|
-
d[:
|
213
|
-
d[:
|
214
|
-
d[:
|
215
|
-
d[:
|
216
|
-
d[:
|
217
|
-
d[:
|
218
|
-
d[:
|
219
|
-
d[:
|
316
|
+
d[:power_factor_1] = a.shift(4) # 4 Bytes Cosϴ L1
|
317
|
+
d[:power_factor_2] = a.shift(4) # 4 Bytes Cosϴ L2
|
318
|
+
d[:power_factor_3] = a.shift(4) # 4 Bytes Cosϴ L3
|
319
|
+
d[:reactive_power_1] = a.shift(7) # 7 Bytes VAR L1
|
320
|
+
d[:reactive_power_2] = a.shift(7) # 7 Bytes VAR L2
|
321
|
+
d[:reactive_power_3] = a.shift(7) # 7 Bytes VAR L3
|
322
|
+
d[:total_reactive_power] = a.shift(7) # 7 Bytes VAR Total
|
323
|
+
d[:frequency] = a.shift(4) # 4 Bytes Freq
|
324
|
+
d[:pulse_1_count] = a.shift(8) # 8 Bytes Pulse Count 1
|
325
|
+
d[:pulse_2_count] = a.shift(8) # 8 Bytes Pulse Count 2
|
326
|
+
d[:pulse_3_count] = a.shift(8) # 8 Bytes Pulse Count 3
|
220
327
|
d[:pulse_input_hilo] = a.shift(1) # 1 Byte Pulse Input Hi/Lo
|
221
328
|
d[:direction_of_current] = a.shift(1) # 1 Bytes direction of current
|
222
329
|
d[:outputs_onoff] = a.shift(1) # 1 Byte Outputs On/Off
|
@@ -224,20 +331,26 @@ module EkmOmnimeter
|
|
224
331
|
a.shift(2) # 2 Bytes Reserved
|
225
332
|
d[:current_time] = a.shift(14) # 14 Bytes Current Time
|
226
333
|
a.shift(6) # 30 30 21 0D 0A 03
|
227
|
-
|
334
|
+
d[:CRC16] = a.shift(2) # 2 Bytes CRC16
|
228
335
|
|
229
336
|
# Smash arrays into strungs
|
230
337
|
d.each {|k,v| d[k] = v.join('')}
|
231
338
|
|
339
|
+
# Cast types
|
340
|
+
@values[:kwh_data_decimal_places] = d[:kwh_data_decimal_places].to_i
|
341
|
+
cast_response_to_correct_types(d)
|
342
|
+
|
232
343
|
# Merge to values and reset time
|
233
344
|
@values.merge!(d)
|
234
|
-
@
|
345
|
+
@last_read_timestamp = Time.now
|
235
346
|
|
236
347
|
# Calculate totals based on wiring configuration
|
237
|
-
@values[:
|
348
|
+
@values[:meter_timestamp] = meter_timestamp
|
238
349
|
@values[:volts] = calculate_measurement(d[:volts_l1], d[:volts_l2], d[:volts_l3])
|
239
350
|
@values[:amps] = calculate_measurement(d[:amps_l1], d[:amps_l2], d[:amps_l3])
|
240
351
|
@values[:watts] = calculate_measurement(d[:watts_l1], d[:watts_l2], d[:watts_l3])
|
352
|
+
@values[:total_forward_kwh] = total_kwh - total_reverse_kwh
|
353
|
+
@values[:net_kwh] = total_forward_kwh - total_reverse_kwh
|
241
354
|
|
242
355
|
# Return the hash as an open struct
|
243
356
|
return d
|
@@ -245,7 +358,8 @@ module EkmOmnimeter
|
|
245
358
|
end
|
246
359
|
|
247
360
|
|
248
|
-
# Request B
|
361
|
+
# Request B
|
362
|
+
# TODO: Instead of pre-parsing and casting everything, refactor this so that only the response string gets saved, and parse out values that are accessed.
|
249
363
|
def request_b
|
250
364
|
|
251
365
|
# 2F 3F 12 Bytes Address 30 31 21 0D 0A
|
@@ -254,10 +368,13 @@ module EkmOmnimeter
|
|
254
368
|
read_bytes = 255
|
255
369
|
logger.debug "Socket write #{request}" unless logger.nil?
|
256
370
|
response = get_remote_meter_data(request, read_bytes)
|
257
|
-
|
371
|
+
if response.nil?
|
372
|
+
log.error "No response to request_a from meter #{address}"
|
373
|
+
raise EkmOmnimeter, "No response from meter."
|
374
|
+
end
|
258
375
|
|
259
376
|
# Split the response string into an array and prepare a hash to store the values
|
260
|
-
a =
|
377
|
+
a = response.split('')
|
261
378
|
d = {}
|
262
379
|
|
263
380
|
# Return (255 Bytes total) :
|
@@ -265,9 +382,20 @@ module EkmOmnimeter
|
|
265
382
|
d[:meter_type] = a.shift(2) # 2 Byte Meter Type
|
266
383
|
d[:meter_firmware] = a.shift(1) # 1 Byte Meter Firmware
|
267
384
|
d[:address] = a.shift(12) # 12 Bytes Address
|
385
|
+
|
268
386
|
# Diff from request A start
|
269
|
-
d[:t1_t2_t3_t4_kwh] = a.shift(32)
|
270
|
-
d[:
|
387
|
+
#d[:t1_t2_t3_t4_kwh] = a.shift(32) # 32 Bytes T1, T2, T3, T4 kwh
|
388
|
+
d[:total_kwh_t1] = a.shift(8)
|
389
|
+
d[:total_kwh_t2] = a.shift(8)
|
390
|
+
d[:total_kwh_t3] = a.shift(8)
|
391
|
+
d[:total_kwh_t4] = a.shift(8)
|
392
|
+
|
393
|
+
#d[:t1_t2_t3_t4_rev_kwh] = a.shift(32) # 32 Bytes T1, T2, T3, T4 Rev kWh
|
394
|
+
d[:reverse_kwh_t1] = a.shift(8)
|
395
|
+
d[:reverse_kwh_t2] = a.shift(8)
|
396
|
+
d[:reverse_kwh_t3] = a.shift(8)
|
397
|
+
d[:reverse_kwh_t4] = a.shift(8)
|
398
|
+
|
271
399
|
# Diff from request A end
|
272
400
|
d[:volts_l1] = a.shift(4) # 4 Bytes Volts L1
|
273
401
|
d[:volts_l2] = a.shift(4) # 4 Bytes Volts L2
|
@@ -279,33 +407,36 @@ module EkmOmnimeter
|
|
279
407
|
d[:watts_l2] = a.shift(7) # 7 Bytes Watts L2
|
280
408
|
d[:watts_l3] = a.shift(7) # 7 Bytes Watts L3
|
281
409
|
d[:watts_total] = a.shift(7) # 7 Bytes Watts Total
|
282
|
-
d[:
|
283
|
-
d[:
|
284
|
-
d[:
|
410
|
+
d[:power_factor_1] = a.shift(4) # 4 Bytes Cosϴ L1
|
411
|
+
d[:power_factor_2] = a.shift(4) # 4 Bytes Cosϴ L2
|
412
|
+
d[:power_factor_3] = a.shift(4) # 4 Bytes Cosϴ L3
|
285
413
|
# Diff from request A start
|
286
414
|
d[:maximum_demand] = a.shift(8) # 8 Bytes Maximum Demand
|
287
|
-
d[:
|
288
|
-
d[:
|
289
|
-
d[:
|
290
|
-
d[:
|
415
|
+
d[:maximum_demand_period] = a.shift(1) # 1 Byte Maximum Demand Time
|
416
|
+
d[:pulse_1_ratio] = a.shift(4) # 4 Bytes Pulse Ratio 1
|
417
|
+
d[:pulse_2_ratio] = a.shift(4) # 4 Bytes Pulse Ratio 2
|
418
|
+
d[:pulse_3_ratio] = a.shift(4) # 4 Bytes Pulse Ratio 3
|
291
419
|
d[:ct_ratio] = a.shift(4) # 4 Bytes CT Ratio
|
292
|
-
d[:
|
293
|
-
d[:
|
420
|
+
d[:auto_reset_max_demand] = a.shift(1) # 1 Bytes Auto Reset MD
|
421
|
+
d[:settable_pulse_per_kwh_ratio] = a.shift(4) # 4 Bytes Settable Imp/kWh Constant
|
294
422
|
# Diff from request A end
|
295
|
-
a.shift(56)
|
423
|
+
a.shift(56) # 56 Bytes Reserved
|
296
424
|
d[:current_time] = a.shift(14) # 14 Bytes Current Time
|
297
425
|
a.shift(6) # 30 30 21 0D 0A 03
|
298
|
-
d[] = a.shift(2)
|
426
|
+
d[:checksum] = a.shift(2) # 2 Bytes CRC16
|
299
427
|
|
300
428
|
# Smash arrays into strungs
|
301
429
|
d.each {|k,v| d[k] = v.join('')}
|
302
430
|
|
431
|
+
# Cast types
|
432
|
+
cast_response_to_correct_types(d)
|
433
|
+
|
303
434
|
# Merge to values and reset time
|
304
435
|
@values.merge!(d)
|
305
|
-
@
|
436
|
+
@last_read_timestamp = Time.now
|
306
437
|
|
307
438
|
# Calculate totals based on wiring configuration
|
308
|
-
@values[:
|
439
|
+
@values[:meter_timestamp] = meter_timestamp
|
309
440
|
@values[:volts] = calculate_measurement(d[:volts_l1], d[:volts_l2], d[:volts_l3])
|
310
441
|
@values[:amps] = calculate_measurement(d[:amps_l1], d[:amps_l2], d[:amps_l3])
|
311
442
|
@values[:watts] = calculate_measurement(d[:watts_l1], d[:watts_l2], d[:watts_l3])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ekm-omnimeter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Duggan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.1'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: bigdecimal
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ~>
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.2'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ~>
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.2'
|
97
83
|
description: Ruby interface to the EKM Omnimeter Pulse
|
98
84
|
email:
|
99
85
|
- Jordan.Duggan@gmail.com
|
@@ -109,6 +95,7 @@ files:
|
|
109
95
|
- Rakefile
|
110
96
|
- ekm-omnimeter.gemspec
|
111
97
|
- lib/ekm-omnimeter.rb
|
98
|
+
- lib/ekm-omnimeter/configuration.rb
|
112
99
|
- lib/ekm-omnimeter/logging.rb
|
113
100
|
- lib/ekm-omnimeter/meter.rb
|
114
101
|
- lib/ekm-omnimeter/version.rb
|