Add RFG UDP source to rph_radar
This commit is contained in:
@@ -9,7 +9,7 @@ from operator import xor
|
||||
import serial
|
||||
|
||||
from .constants import BAUDRATE, SERIAL_TIMEOUT_SEC
|
||||
from .conversions import current_ma_to_n, temp_c_to_n
|
||||
from .conversions import current_ma_to_n, temp_c_to_n, variation_codes
|
||||
from .validators import validate_manual, validate_variation
|
||||
from .exceptions import CommunicationError, PortBusyError, ProtocolError
|
||||
|
||||
@@ -116,9 +116,7 @@ class Protocol:
|
||||
raise ValueError("radar.laser_control.variation.variation_type must be CHANGE_CURRENT_LD1")
|
||||
validate_manual(static_temp1, static_temp2, static_current1, static_current2)
|
||||
validate_variation(min_value, max_value, step, time_step, delay_time)
|
||||
low, high, delta = (current_ma_to_n(value) for value in (min_value, max_value, step))
|
||||
if delta == 0 or low >= high:
|
||||
raise ValueError("Current variation range and step must be representable by the DAC")
|
||||
low, high, delta = variation_codes(min_value, max_value, step)
|
||||
return _command(
|
||||
0x7777, 0x37ff, 1, low, high, delta, int(time_step * 100),
|
||||
temp_c_to_n(static_temp1), current_ma_to_n(static_current2), temp_c_to_n(static_temp2),
|
||||
|
||||
Reference in New Issue
Block a user