refactor(master : nicsensor) 调整部分传感器执行时的显示样式

This commit is contained in:
leimingsheng 2025-06-26 14:35:31 +08:00
parent 5f4c3ea8ac
commit b17104dc2f

@ -709,7 +709,8 @@ convert_emc1413_data(){
# print result to consol
format_temp=$(echo "$temp" | awk '{ if ($0 ~ /^\./) print "0" $0; else print $0 }')
echo "$3 : $format_temp C, hex value : $hex_value1 $hex_value2"
format_log_print $INFO "$3 - Hex data : $hex_value1 $hex_value2"
echo "$3 : $format_temp C"
}
@ -797,7 +798,8 @@ convert_adc128_data(){
volt=$(echo "scale=4; $dec_val / 16 / 4096 * 2.65 / $4" | bc)
format_volt=$(echo "$volt" | awk '{ if ($0 ~ /^\./) print "0" $0; else print $0 }')
echo "$3 : $format_volt v, hex value: $upper_hex_value"
format_log_print $INFO "$3 - Hex data: $upper_hex_value"
echo "$3 : $format_volt V"
}
# Get the sensor data, then parse raw data
@ -881,7 +883,8 @@ convert_ina3221_data(){
if [ $4 -eq $INA3221_BUS_VOLT ];then
volt=$(echo "scale=4; $dec_val / 8 * 40 / 10000 * 2" | bc)
format_volt=$(echo "$volt" | awk '{ if ($0 ~ /^\./) print "0" $0; else print $0 }')
echo "$6 : $format_volt V, hex value: $upper_hex_value"
format_log_print $INFO "Channel $3 - bus volt - hex value: $upper_hex_value"
echo "$6 : $format_volt V"
if [ $3 -eq 0 ];then
ina3221_ch0_volt=$format_volt
@ -897,8 +900,8 @@ convert_ina3221_data(){
format_current=$(echo "$current" | awk '{ if ($0 ~ /^\./) print "0" $0; else print $0 }')
format_current_mv=$(echo "$current_mv" | awk '{ if ($0 ~ /^\./) print "0" $0; else print $0 }')
echo "$6 : $format_current A, shunt volt: $format_current_mv mV, shunt resistor: $5 mOhm, hex value: $upper_hex_value"
format_log_print $INFO "Channel $3 - shunt volt - hex value: $upper_hex_value"
echo "$6 : $format_current A, shunt volt: $format_current_mv mV, shunt resistor: $5 mOhm"
if [ $3 -eq 0 ];then
ina3221_ch0_current=$format_current