Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
start_timestamp,
end_timestamp)
try:
rms_windowed_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RMS_WINDOWED,
vrms_waveform(waveform_calibrated,
int(constants.SAMPLES_PER_CYCLE)),
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got rms windowed voltage")
except Exception as exception:
makai_event_plugin.logger.error("Error getting VOLTAGE_RMS_WINDOWED: %s", str(exception))
rms_windowed_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RMS_WINDOWED,
[],
start_timestamp,
end_timestamp)
try:
frequency_windowed = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.FREQUENCY_WINDOWED,
analysis.frequency_per_cycle(waveform_calibrated),
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got windowed frequency")
[],
start_timestamp,
end_timestamp)
try:
raw_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RAW,
waveform_calibrated,
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got raw voltage")
except Exception as exception:
makai_event_plugin.logger.error("Error getting VOLTAGE_RAW: %s", str(exception))
raw_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RAW,
[],
start_timestamp,
end_timestamp)
try:
rms_windowed_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RMS_WINDOWED,
vrms_waveform(waveform_calibrated,
int(constants.SAMPLES_PER_CYCLE)),
start_timestamp,
end_timestamp)
protobuf.mauka_pb2.VOLTAGE_RMS_WINDOWED,
[],
start_timestamp,
end_timestamp)
try:
frequency_windowed = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.FREQUENCY_WINDOWED,
analysis.frequency_per_cycle(waveform_calibrated),
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got windowed frequency")
except Exception as exception:
frequency_windowed = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.FREQUENCY_WINDOWED,
[],
start_timestamp,
end_timestamp)
makai_event_plugin.logger.error("Error getting FREQUENCY_WINDOWED: %s", str(exception))
return adc_samples, raw_voltage, rms_windowed_voltage, frequency_windowed
waveform_calibrated,
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got raw voltage")
except Exception as exception:
makai_event_plugin.logger.error("Error getting VOLTAGE_RAW: %s", str(exception))
raw_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RAW,
[],
start_timestamp,
end_timestamp)
try:
rms_windowed_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RMS_WINDOWED,
vrms_waveform(waveform_calibrated,
int(constants.SAMPLES_PER_CYCLE)),
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got rms windowed voltage")
except Exception as exception:
makai_event_plugin.logger.error("Error getting VOLTAGE_RMS_WINDOWED: %s", str(exception))
rms_windowed_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RMS_WINDOWED,
[],
start_timestamp,
waveform,
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got ADC samples")
except Exception as exception:
makai_event_plugin.logger.error("Error getting ADC_SAMPLES %s", str(exception))
adc_samples = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.ADC_SAMPLES,
[],
start_timestamp,
end_timestamp)
try:
raw_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RAW,
waveform_calibrated,
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got raw voltage")
except Exception as exception:
makai_event_plugin.logger.error("Error getting VOLTAGE_RAW: %s", str(exception))
raw_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RAW,
[],
start_timestamp,
end_timestamp)
int(constants.SAMPLES_PER_CYCLE)),
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got rms windowed voltage")
except Exception as exception:
makai_event_plugin.logger.error("Error getting VOLTAGE_RMS_WINDOWED: %s", str(exception))
rms_windowed_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RMS_WINDOWED,
[],
start_timestamp,
end_timestamp)
try:
frequency_windowed = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.FREQUENCY_WINDOWED,
analysis.frequency_per_cycle(waveform_calibrated),
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got windowed frequency")
except Exception as exception:
frequency_windowed = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.FREQUENCY_WINDOWED,
[],
start_timestamp,
end_timestamp)
makai_event_plugin.logger.error("Error getting FREQUENCY_WINDOWED: %s", str(exception))
end_timestamp = box_event["event_end_timestamp_ms"]
makai_event_plugin.debug("Extracted timestamps %d-%d" % (start_timestamp, end_timestamp))
try:
adc_samples = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.ADC_SAMPLES,
waveform,
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got ADC samples")
except Exception as exception:
makai_event_plugin.logger.error("Error getting ADC_SAMPLES %s", str(exception))
adc_samples = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.ADC_SAMPLES,
[],
start_timestamp,
end_timestamp)
try:
raw_voltage = protobuf.pb_util.build_payload(name,
event_id,
box_id,
protobuf.mauka_pb2.VOLTAGE_RAW,
waveform_calibrated,
start_timestamp,
end_timestamp)
makai_event_plugin.debug("Got raw voltage")