6
6
using System . IO ;
7
7
using System . Threading ;
8
8
using System . Linq ;
9
-
9
+ using System . Globalization ;
10
10
11
11
namespace UXF
12
12
{
@@ -19,6 +19,13 @@ public class FileSaver : LocalFileDataHander
19
19
[ Tooltip ( "Enable to sort session files into folders. The trial_results CSV is never put into a folder." ) ]
20
20
public bool sortDataIntoFolders = true ;
21
21
22
+ /// <summary>
23
+ /// Enable to force the data to save with an english-US format (i.e. `,` to serapate values,
24
+ /// and `.` to separate decimal points).
25
+ /// </summary>
26
+ [ Tooltip ( "Enable to force the data to save with an english-US format (i.e. `,` to serapate values, and `.` to separate decimal points)." ) ]
27
+ public bool forceENUSLocale = true ;
28
+
22
29
/// <summary>
23
30
/// Enable to print debug messages to the console.
24
31
/// </summary>
@@ -45,12 +52,21 @@ public class FileSaver : LocalFileDataHander
45
52
/// </summary>
46
53
public override void SetUp ( )
47
54
{
55
+ if ( forceENUSLocale )
56
+ {
57
+ Thread . CurrentThread . CurrentCulture = new CultureInfo ( "en-US" ) ;
58
+ }
59
+
48
60
quitting = false ;
49
61
Directory . CreateDirectory ( base . StoragePath ) ;
50
62
51
63
if ( ! IsActive )
52
64
{
53
65
parallelThread = new Thread ( Worker ) ;
66
+ if ( forceENUSLocale )
67
+ {
68
+ parallelThread . CurrentCulture = new CultureInfo ( "en-US" ) ;
69
+ }
54
70
parallelThread . Start ( ) ;
55
71
}
56
72
else
@@ -150,7 +166,7 @@ public override string HandleDataTable(UXFDataTable table, string experiment, st
150
166
if ( verboseDebug ) Utilities . UXFDebugLogFormat ( "Queuing save of file: {0}" , savePath ) ;
151
167
152
168
ManageInWorker ( ( ) => { File . WriteAllLines ( savePath , lines ) ; } ) ;
153
- return GetRelativePath ( StoragePath , savePath ) ; ;
169
+ return GetRelativePath ( StoragePath , savePath ) ;
154
170
}
155
171
156
172
public override string HandleJSONSerializableObject ( List < object > serializableObject , string experiment , string ppid , int sessionNum , string dataName , UXFDataType dataType , int optionalTrialNum = 0 )
0 commit comments