@@ -23,7 +23,7 @@ def parse_prm_file(path: Path) -> dict[str, Any]:
2323 try :
2424 text = path .read_text (encoding = "utf-8" ).strip ()
2525 except Exception as e :
26- logger .error (f"Failed to read PRM file { path } : { e } " )
26+ logger .exception (f"Failed to read PRM file { path } : { e } " )
2727 raise
2828
2929 # Try parsing as JSON first
@@ -78,7 +78,7 @@ def parse_prm_file(path: Path) -> dict[str, Any]:
7878 "superframe" : superframe ,
7979 }
8080
81- # Parse optional trailing key-value tokens (e.g., TYPE=BNR SCALE=0.1)
81+ # Parse optional trailing key-value tokens (e.g., TYPE=BNR SCALE=0.1 SIGNED=True )
8282 line_has_error = False
8383 for part in parts [start_idx :]:
8484 if "=" in part :
@@ -88,6 +88,8 @@ def parse_prm_file(path: Path) -> dict[str, Any]:
8888
8989 if key == "type" :
9090 param_meta ["type" ] = val
91+ elif key == "signed" :
92+ param_meta ["signed" ] = val .lower () in ("true" , "1" , "yes" , "on" )
9193 elif key == "scale" :
9294 try :
9395 param_meta ["scale" ] = float (val )
@@ -130,10 +132,11 @@ def prm_to_parameters(mapping: dict[str, Any]) -> dict[str, Parameter]:
130132 bit_offset = int (md .get ("bit_offset" , 0 ))
131133 length = int (md .get ("length" , 8 ))
132134 rate = float (md .get ("rate" , 1.0 ))
133- superframe = md .get ("superframe" )
135+ superframe = int ( md [ "superframe" ]) if md .get ("superframe" ) is not None else None
134136 scale = md .get ("scale" )
135137 offset = md .get ("offset" )
136138 dtype = md .get ("type" , "DISCRETE" )
139+ signed = md .get ("signed" )
137140
138141 p = Parameter .from_717 (
139142 name = name ,
@@ -150,6 +153,8 @@ def prm_to_parameters(mapping: dict[str, Any]) -> dict[str, Parameter]:
150153 p .scale = float (scale )
151154 if offset is not None :
152155 p .offset = float (offset )
156+ if signed is not None and hasattr (p , "signed" ):
157+ p .signed = bool (signed )
153158
154159 out [name ] = p
155160
0 commit comments