Skip to content

Instantly share code, notes, and snippets.

@scytacki
Created June 16, 2011 19:23
Show Gist options
  • Save scytacki/1030022 to your computer and use it in GitHub Desktop.
Save scytacki/1030022 to your computer and use it in GitHub Desktop.
- ot_sensor_data_proxy = capture_haml do
- probe_type = data_collector.probe_type
%OTSensorDataProxy{ :local_id => ot_local_id_for(data_collector, :data_proxy) }
%request
%OTExperimentRequest{ :period => probe_type.period.to_s }
%sensorRequests
%OTSensorRequest{ :stepSize => probe_type.step_size.to_s,
:type => probe_type.ptype.to_s,
:unit => probe_type.unit,
:port => probe_type.port.to_s,
:requiredMax => probe_type.max.to_s,
:requiredMin => probe_type.min.to_s,
:displayPrecision => "#{data_collector.probe_type.display_precision}" }
- if data_collector.show_tare
%zeroSensor
%OTZeroSensor{:sensorIndex => '0', :local_id=> ot_local_id_for(data_collector, :zero_action) }
def ot_sensor_data_proxy(data_collector)
probe_type = data_collector.probe_type
capture_haml do
haml_tag :OTSensorDataProxy, :local_id => ot_local_id_for(data_collector, :data_proxy) do
haml_tag :request do
haml_tag :OTExperimentRequest, :period => probe_type.period.to_s do
haml_tag :sensorRequests do
haml_tag :OTSensorRequest, :stepSize => probe_type.step_size.to_s,
:type => probe_type.ptype.to_s, :unit => probe_type.unit, :port => probe_type.port.to_s,
:requiredMax => probe_type.max.to_s, :requiredMin => probe_type.min.to_s,
:displayPrecision => "#{data_collector.probe_type.display_precision}"
end
end
end
if data_collector.show_tare
haml_tag :zeroSensor do
haml_tag :OTZeroSensor, :sensorIndex => '0', :local_id=> ot_local_id_for(data_collector, :zero_action)
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment