VelocityWalkToCSV 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +3 -0
- data/README +3 -0
- data/Rakefile +45 -0
- data/lib/main.rb +55 -0
- data/lib/output.csv +237 -0
- metadata +60 -0
data/LICENSE
ADDED
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
#
|
2
|
+
# To change this template, choose Tools | Templates
|
3
|
+
# and open the template in the editor.
|
4
|
+
|
5
|
+
|
6
|
+
require 'rubygems'
|
7
|
+
require 'rake'
|
8
|
+
require 'rake/clean'
|
9
|
+
require 'rake/gempackagetask'
|
10
|
+
require 'rake/rdoctask'
|
11
|
+
require 'rake/testtask'
|
12
|
+
|
13
|
+
spec = Gem::Specification.new do |s|
|
14
|
+
s.name = 'VelocityWalkToCSV'
|
15
|
+
s.version = '0.0.1'
|
16
|
+
s.has_rdoc = true
|
17
|
+
s.extra_rdoc_files = ['README', 'LICENSE']
|
18
|
+
s.summary = 'Parses the xml output of Devicebrowser (savedDevice.xml) and outputs labels and values'
|
19
|
+
s.description = s.summary
|
20
|
+
s.author = 'Scott Shanks'
|
21
|
+
s.email = 'sshanks24@gmail.com'
|
22
|
+
# s.executables = ['your_executable_here']
|
23
|
+
s.files = %w(LICENSE README Rakefile) + Dir.glob("{bin,lib,spec}/**/*")
|
24
|
+
s.require_path = "lib"
|
25
|
+
s.bindir = "bin"
|
26
|
+
end
|
27
|
+
|
28
|
+
Rake::GemPackageTask.new(spec) do |p|
|
29
|
+
p.gem_spec = spec
|
30
|
+
p.need_tar = true
|
31
|
+
p.need_zip = true
|
32
|
+
end
|
33
|
+
|
34
|
+
Rake::RDocTask.new do |rdoc|
|
35
|
+
files =['README', 'LICENSE', 'lib/**/*.rb']
|
36
|
+
rdoc.rdoc_files.add(files)
|
37
|
+
rdoc.main = "README" # page to start on
|
38
|
+
rdoc.title = "VelocityWalkToCSV Docs"
|
39
|
+
rdoc.rdoc_dir = 'doc/rdoc' # rdoc output folder
|
40
|
+
rdoc.options << '--line-numbers'
|
41
|
+
end
|
42
|
+
|
43
|
+
Rake::TestTask.new do |t|
|
44
|
+
t.test_files = FileList['test/**/*.rb']
|
45
|
+
end
|
data/lib/main.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# == Synopsis
|
2
|
+
#
|
3
|
+
# V4walkToCSV: converts the savedDevice.xml produced by the Velocity Browser to a csv file consisting of two "columns".
|
4
|
+
#
|
5
|
+
# Column 1 is the Velocity 4 data label of the data point.
|
6
|
+
# Column 2 is the value of that data point.
|
7
|
+
#
|
8
|
+
# == Usage
|
9
|
+
#
|
10
|
+
# V4walkToCSV path_to_xml path_to_csv
|
11
|
+
#
|
12
|
+
|
13
|
+
require 'rexml/document'
|
14
|
+
require 'rdoc/usage'
|
15
|
+
|
16
|
+
include REXML
|
17
|
+
|
18
|
+
# Verify arguments
|
19
|
+
if ARGV.length != 2
|
20
|
+
RDoc::usage
|
21
|
+
end
|
22
|
+
|
23
|
+
# Handle arguments
|
24
|
+
path_to_xml = ARGV.shift
|
25
|
+
path_to_csv = ARGV.shift
|
26
|
+
|
27
|
+
|
28
|
+
out_file = File.new(path_to_csv, 'w')
|
29
|
+
|
30
|
+
if File.exists?(path_to_xml)
|
31
|
+
File.open(path_to_xml) do |config_file|
|
32
|
+
# Open the document
|
33
|
+
config = REXML::Document.new(config_file)
|
34
|
+
i = 1
|
35
|
+
multi_module_exists = FALSE
|
36
|
+
config.root.elements.each("Report") do |element|
|
37
|
+
puts element.attribute('mmidx').to_s
|
38
|
+
puts multi_module_exists
|
39
|
+
if element.next_element.attribute('name') == element.attribute('name')
|
40
|
+
multi_module_exists = TRUE
|
41
|
+
else multi_module_exists = FALSE
|
42
|
+
end unless element.next_element == nil
|
43
|
+
element.each_element_with_attribute('id') do |child|
|
44
|
+
value = child.text
|
45
|
+
value = '' if child.text == nil
|
46
|
+
multi_module_index = element.attribute('mmidx').to_s.to_i + 1
|
47
|
+
if element.attribute('mmidx').to_s == '0' and multi_module_exists == FALSE
|
48
|
+
out_file.puts child.attribute('name').to_s << "," << value
|
49
|
+
else out_file.puts child.attribute('name').to_s << " (#{multi_module_index.to_s})," << value
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
data/lib/output.csv
ADDED
@@ -0,0 +1,237 @@
|
|
1
|
+
Standard Version,15
|
2
|
+
Standard Compliance,1
|
3
|
+
Error Compliance,2
|
4
|
+
Server Class,2
|
5
|
+
Server Reset State,1
|
6
|
+
Server Timeout,100
|
7
|
+
Object Identifier 1,3
|
8
|
+
Object Identifier 2,11
|
9
|
+
Communication 2400 BAUD,0
|
10
|
+
Communication 4800 BAUD,0
|
11
|
+
Communication 9600 BAUD,0
|
12
|
+
Communication 19200 BAUD,0
|
13
|
+
Communication 38400 BAUD,0
|
14
|
+
End Session,0
|
15
|
+
Communications BAUD Rate,0
|
16
|
+
Communications Time Out,0
|
17
|
+
Supply Air Temperature,216
|
18
|
+
Return Air Temperature,214
|
19
|
+
Return Dew Point,89
|
20
|
+
Remote Sensor Minimum Temperature,-32768
|
21
|
+
Remote Sensor Maximum Temperature,-32768
|
22
|
+
Remote Sensor Average Temperature,-32768
|
23
|
+
Air Temperature Set Point,210
|
24
|
+
Cooling Proportional Band,50
|
25
|
+
Heating Proportional Band,50
|
26
|
+
Air Temperature Dead Band,11
|
27
|
+
Air Temperature Control Sensor,0
|
28
|
+
Remote Sensor Temperature Calculation,0
|
29
|
+
Supply Air Over Temp Threshold,300
|
30
|
+
Supply Air Over Temperature,12
|
31
|
+
Supply Air Under Temp Threshold,80
|
32
|
+
Supply Air Under Temperature,20
|
33
|
+
Return Air Over Temp Threshold,300
|
34
|
+
Return Air Over Temperature,12
|
35
|
+
Supply Air Sensor Issue,12
|
36
|
+
Return Air Sensor Issue,20
|
37
|
+
Supply Humidity,458
|
38
|
+
Return Humidity,450
|
39
|
+
Humidity Set Point,45
|
40
|
+
Humidification Proportional Band,5
|
41
|
+
Dehumidification Proportional Band,5
|
42
|
+
Humidity Dead Band,50
|
43
|
+
High Return Humidity Threshold,500
|
44
|
+
Low Return Humidity Threshold,200
|
45
|
+
High Return Humidity,12
|
46
|
+
Low Return Humidity,12
|
47
|
+
Humidifier Hours Exceeded,12
|
48
|
+
Dehumidifier Hours Exceeded,12
|
49
|
+
Humidifier Under Current,20
|
50
|
+
Humidifier Over Current,20
|
51
|
+
Humidifier Low Water,20
|
52
|
+
Humidifier Cylinder Worn,12
|
53
|
+
Humidifier Issue,20
|
54
|
+
Ext Humidifier Lockout,4
|
55
|
+
Humidifier Control Board Not Detected,20
|
56
|
+
Return Humidity Out Of Proportional Band,16384
|
57
|
+
Dehumidifier Disabled,16384
|
58
|
+
Dehumidifier 12 Hour Lock Out,16384
|
59
|
+
Dehumidifier Enabled,16384
|
60
|
+
Humidifier Disabled,16384
|
61
|
+
Humidifier Enabled,16384
|
62
|
+
Fan Control Mode,0
|
63
|
+
Fan Speed Proportional Band,0
|
64
|
+
Fan Speed Manual Set Point,0
|
65
|
+
Fan Speed Maximum Set Point,0
|
66
|
+
Fan Speed Minimum Set Point,0
|
67
|
+
Fan Control Sensor,0
|
68
|
+
Fan Temperature Set Point Delta,0
|
69
|
+
Control Coupled Mode,0
|
70
|
+
Loss of Air Flow,0
|
71
|
+
Fan Hours Exceeded,0
|
72
|
+
Top Fan Issue,0
|
73
|
+
Bottom Fan Issue,0
|
74
|
+
Remote Sensor Name,
|
75
|
+
Remote Sensor Function,0
|
76
|
+
Remote Sensor Temperature,0
|
77
|
+
Remote Sensor Issue,0
|
78
|
+
Remote Sensor Name,
|
79
|
+
Remote Sensor Function,0
|
80
|
+
Remote Sensor Temperature,-32768
|
81
|
+
Remote Sensor Issue,12
|
82
|
+
Remote Sensor Name,
|
83
|
+
Remote Sensor Function,0
|
84
|
+
Remote Sensor Temperature,-32768
|
85
|
+
Remote Sensor Issue,12
|
86
|
+
Remote Sensor Name,
|
87
|
+
Remote Sensor Function,0
|
88
|
+
Remote Sensor Temperature,-32768
|
89
|
+
Remote Sensor Issue,12
|
90
|
+
Remote Sensor Name,
|
91
|
+
Remote Sensor Function,0
|
92
|
+
Remote Sensor Temperature,-32768
|
93
|
+
Remote Sensor Issue,12
|
94
|
+
Remote Sensor Name,
|
95
|
+
Remote Sensor Function,0
|
96
|
+
Remote Sensor Temperature,-32768
|
97
|
+
Remote Sensor Issue,12
|
98
|
+
Remote Sensor Name,
|
99
|
+
Remote Sensor Function,0
|
100
|
+
Remote Sensor Temperature,-32768
|
101
|
+
Remote Sensor Issue,12
|
102
|
+
Remote Sensor Name,
|
103
|
+
Remote Sensor Function,0
|
104
|
+
Remote Sensor Temperature,-32768
|
105
|
+
Remote Sensor Issue,12
|
106
|
+
Remote Sensor Name,
|
107
|
+
Remote Sensor Function,0
|
108
|
+
Remote Sensor Temperature,-32768
|
109
|
+
Remote Sensor Issue,12
|
110
|
+
Remote Sensor Name,
|
111
|
+
Remote Sensor Function,0
|
112
|
+
Remote Sensor Temperature,-32768
|
113
|
+
Remote Sensor Issue,12
|
114
|
+
Compressor 1 High Head Pressure,20
|
115
|
+
Compressor 1 Low Suction Pressure,20
|
116
|
+
Compressor 1 Hours Exceeded,12
|
117
|
+
Dig Scroll Comp 1 Temp Sensor Issue,12
|
118
|
+
Dig Scroll Comp 1 Over Temp,20
|
119
|
+
Compressor 1 Low Pressure Transducer Issue,20
|
120
|
+
Compressor 1 High Pressure Transducer Issue,12
|
121
|
+
Ext Compressor Lockout,4
|
122
|
+
Compressor 1 Short Cycle,12
|
123
|
+
Compressor 1 Pump Down Issue,20
|
124
|
+
Compressor Capacity Reduced,12
|
125
|
+
Reheater Over Temperature,12
|
126
|
+
Electric Reheater Hours Exceeded,12
|
127
|
+
Ext Reheat Lockout,4
|
128
|
+
Condenser 1 Issue,12
|
129
|
+
Condenser VFD Issue,4
|
130
|
+
Condenser TVSS Issue,4
|
131
|
+
Supply Chilled Water Temperature,-32768
|
132
|
+
Supply Chilled Water Over Temp Threshold,250
|
133
|
+
Supply Chilled Water Over Temp,12
|
134
|
+
Chilled Water Control Valve Position,20
|
135
|
+
Supply Chilled Water Loss of Flow,12
|
136
|
+
System Status,1
|
137
|
+
System Model Number,Liebert CRV
|
138
|
+
System Name,UNIT
|
139
|
+
System Operating State,1
|
140
|
+
System Control Mode,0
|
141
|
+
System Operating State Reason,0
|
142
|
+
Unit Status,7
|
143
|
+
Teamwork Mode,0
|
144
|
+
Teamwork Mode 1 Basis,0
|
145
|
+
BMS Timeout Period,0
|
146
|
+
Auto Restart Delay,5
|
147
|
+
Operating Efficiency,76
|
148
|
+
Fan Speed,100
|
149
|
+
Compressor Utilization,0
|
150
|
+
Dehumidifier Utilization,0
|
151
|
+
Reheat Utilization,0
|
152
|
+
Humidifier Utilization,0
|
153
|
+
Calculated Next Maintenance Month,1
|
154
|
+
Calculated Next Maintenance Year,2001
|
155
|
+
Maintenance Ramp,100
|
156
|
+
System On/Off Control,1
|
157
|
+
System Event Acknowledge/Reset,0
|
158
|
+
Temperature/Humidity Events Control,1
|
159
|
+
Smoke Detected - Event Control,1
|
160
|
+
Smoke Detected - Event Type,2
|
161
|
+
Water Under Floor - Event Control,1
|
162
|
+
Water Under Floor - Event Type,2
|
163
|
+
Customer Input 1 - Event Control,1
|
164
|
+
Customer Input 1 - Event Type,2
|
165
|
+
Customer Input 2 - Event Control,1
|
166
|
+
Customer Input 2 - Event Type,2
|
167
|
+
Customer Input 3 - Event Control,1
|
168
|
+
Customer Input 3 - Event Type,2
|
169
|
+
Customer Input 4 - Event Control,1
|
170
|
+
Customer Input 4 - Event Type,2
|
171
|
+
Service Required - Event Control,1
|
172
|
+
Service Required - Event Type,2
|
173
|
+
Shutdown - Loss Of Power - Event Control,1
|
174
|
+
Shutdown - Loss Of Power - Event Type,1
|
175
|
+
Ext Loss of Flow - Event Control,1
|
176
|
+
Ext Loss of Flow - Event Type,2
|
177
|
+
Ext Reheat Lockout - Event Control,0
|
178
|
+
Ext Reheat Lockout - Event Type,0
|
179
|
+
Ext Humidifier Lockout - Event Control,0
|
180
|
+
Ext Humidifier Lockout - Event Type,0
|
181
|
+
Ext Compressor Lockout - Event Control,0
|
182
|
+
Ext Compressor Lockout - Event Type,0
|
183
|
+
Ext Over Temperature - Event Control,0
|
184
|
+
Ext Over Temperature - Event Type,0
|
185
|
+
Condenser VFD Issue - Event Control,0
|
186
|
+
Condenser VFD Issue - Event Type,0
|
187
|
+
Condenser TVSS Issue - Event Control,0
|
188
|
+
Condenser TVSS Issue - Event Type,0
|
189
|
+
Condenser 1 Issue - Event Control,1
|
190
|
+
Condenser 1 Issue - Event Type,1
|
191
|
+
Customer Input 1,0
|
192
|
+
Customer Input 2,0
|
193
|
+
Customer Input 3,0
|
194
|
+
Customer Input 4,0
|
195
|
+
Smoke Detected,0
|
196
|
+
Water Under Floor,0
|
197
|
+
Service Required,0
|
198
|
+
Shutdown - Loss Of Power,0
|
199
|
+
Ext Over Temperature,0
|
200
|
+
Ext Loss of Flow,0
|
201
|
+
Ext Condenser Pump High Water,0
|
202
|
+
Ext Standby Glycol Pump On,0
|
203
|
+
External Fire Detected,0
|
204
|
+
Unit On,0
|
205
|
+
Unit Off,0
|
206
|
+
Unit Standby,0
|
207
|
+
Unit Partial Shutdown,0
|
208
|
+
Unit Shutdown,0
|
209
|
+
Water Leakage Detector Sensor Issue,0
|
210
|
+
BMS Communications Timeout,0
|
211
|
+
Maintenance Due,0
|
212
|
+
Maintenance Completed,0
|
213
|
+
Clogged Air Filter,0
|
214
|
+
RAM Battery Issue,0
|
215
|
+
Low Memory,0
|
216
|
+
Master Unit Communication Lost,0
|
217
|
+
High Power Shutdown,0
|
218
|
+
Supply Fluid Temp Sensor Issue,0
|
219
|
+
Calculated Cooling Capacity,25
|
220
|
+
Current HP Pressure,-11
|
221
|
+
Calculated HP Temperature,2825
|
222
|
+
Current LP Pressure,-101
|
223
|
+
Calculated LP Temperature,-1995
|
224
|
+
Electric Reheater 1 Status,0
|
225
|
+
LP Value A (lowest of 3),65435
|
226
|
+
LP Value B (lowest of 1),65435
|
227
|
+
MBV Op Pressure,-32768
|
228
|
+
Dehumidification Status,0
|
229
|
+
Humidification Status,0
|
230
|
+
Software Application Version,
|
231
|
+
Hardware Platform,
|
232
|
+
Bootloader Version,
|
233
|
+
Kernel Version,
|
234
|
+
Root File System Version,
|
235
|
+
Root File System Version,iCOM/gcm RootFS V 1.06.011 -- Di 2. Feb 01:43:54 CET 2010
|
236
|
+
iCOM Software Framework Version,iCOM/gcm Framework V 1.06.011 -- Di 2. Feb 01:43:54 CET 2010
|
237
|
+
System Date and Time,4/26/2010 10:55:32 PM
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: VelocityWalkToCSV
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Scott Shanks
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-05-05 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Parses the xml output of Devicebrowser (savedDevice.xml) and outputs labels and values
|
17
|
+
email: sshanks24@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README
|
24
|
+
- LICENSE
|
25
|
+
files:
|
26
|
+
- LICENSE
|
27
|
+
- README
|
28
|
+
- Rakefile
|
29
|
+
- lib/main.rb
|
30
|
+
- lib/output.csv
|
31
|
+
has_rdoc: true
|
32
|
+
homepage:
|
33
|
+
licenses: []
|
34
|
+
|
35
|
+
post_install_message:
|
36
|
+
rdoc_options: []
|
37
|
+
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: "0"
|
45
|
+
version:
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: "0"
|
51
|
+
version:
|
52
|
+
requirements: []
|
53
|
+
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 1.3.5
|
56
|
+
signing_key:
|
57
|
+
specification_version: 3
|
58
|
+
summary: Parses the xml output of Devicebrowser (savedDevice.xml) and outputs labels and values
|
59
|
+
test_files: []
|
60
|
+
|