WEKIT-ECS / MIRAGE-XR

MirageXR is a reference implementation of an XR training system. MirageXR enables experts and learners to share experience via XR and wearables using ghost tracks, realtime feedback, and anchored instruction.
Other
27 stars 4 forks source link

Label: input string not in correct format #1936

Closed fwild closed 3 weeks ago

fwild commented 1 month ago

(2.5) There may be an issue with the label augmentation, most likely depending on the locale of the user:

ExceptionManager: [Exception] FormatException: Input string was not in a correct format., trace: System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey) (at <00000000000000000000000000000000>:0)
System.Number.ParseSingle (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info) (at <00000000000000000000000000000000>:0)
MirageXR.Label.GetColorFromString (System.String rgb) (at <00000000000000000000000000000000>:0)
MirageXR.Label.Init (MirageXR.ToggleObject obj) (at <00000000000000000000000000000000>:0)
MirageXR.ObjectFactory.ActivatePrefab (System.String prefab, MirageXR.ToggleObject obj) (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
MirageXR.ObjectFactory.ActivatePrefab (System.String prefab, MirageXR.ToggleObject obj) (at <00000000000000000000000000000000>:0)
MirageXR.ActivityManager.ActivateAction (MirageXR.Action step) (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
MirageXR.ActivityManager.ActivateAction (MirageXR.Action step) (at <00000000000000000000000000000000>:0)
MirageXR.ActivityManager.ActivateAction (System.String id) (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) (at <00000000000000000000000000000000>:0)
MirageXR.ActivityManager.ActivateAction (System.String id) (at <00000000000000000000000000000000>:0)
MirageXR.ActivityManager.ActivateActionByID (System.String id) (at <00000000000000000000000000000000>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.Task.FinishContinuations () (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult result) (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetResult (TResult result) (at <00000000000000000000000000000000>:0)
MirageXR.ActivityManager.DeactivateAction (System.String id, System.Boolean doNotActivateNextStep) (at <00000000000000000000000000000000>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.Task.FinishContinuations () (at <00000000000000000000000000000000>:0)
System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult result) (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetResult (TResult result) (at <00000000000000000000000000000000>:0)
MirageXR.ActivityManager.ActivityDeactivator (System.String id, System.Boolean doNotActivateNextStep) (at <00000000000000000000000000000000>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at <00000000000000000000000000000000>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <00000000000000000000000000000000>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <00000000000000000000000000000000>:0)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <00000000000000000000000000000000>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <00000000000000000000000000000000>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <00000000000000000000000000000000>:0)
fwild commented 3 weeks ago

This is the issue: floating comma vs floating point: https://stackoverflow.com/questions/27722032/c-sharp-float-parse-string

fwild commented 3 weeks ago

This may reappear with other data stored into strings, and generally, the recommendation would be to put that into the data storage manager, so that the locale is overwritten with invariantCulture or converted from the storage locale to the user's locale. See also https://stackoverflow.com/questions/27722032/c-sharp-float-parse-string

fwild commented 3 weeks ago

Implemented.