[plot] fix loading of logs with strings that are not representing a float

This commit is contained in:
Gautier Hattenberger
2015-01-09 18:39:23 +01:00
parent 1d087175d9
commit ad6fe1d0f5
+2 -2
View File
@@ -512,8 +512,8 @@ let pprz_float = function
| Pprz.Float f -> f
| Pprz.Int32 i -> Int32.to_float i
| Pprz.Int64 i -> Int64.to_float i
| Pprz.String s -> float_of_string s
| Pprz.Char c -> float_of_string (String.make 1 c)
| Pprz.String s -> let v = try float_of_string s with _ -> 0. in v
| Pprz.Char c -> let v = try float_of_string (String.make 1 c) with _ -> 0. in v
| Pprz.Array _ -> 0.