dngoins / Kinectv2HeartRate

http://dngoins.github.io/private.Kinectv2HeartRate
74 stars 35 forks source link

Culture variance messes up with the CSV file #11

Open legionaryu opened 8 years ago

legionaryu commented 8 years ago

On the line:

string data = string.Format("{0},{1},{2},{3},{4},{5}\n", m_secondsElapsed.ElapsedMilliseconds, norm_alpha, norm_red, norm_green, norm_blue, norm_ir);

C# converts the numbers to string, but as I'm from Brazil and we use commas as float separator, it messes up with the CSV file, I hat to put a CultureInfo as the first parameter. This is how I did with my version:

var enUS = new System.Globalization.CultureInfo("en-US");
.........
string data = string.Format(enUS, "{0},{1},{2},{3},{4},{5}\n", m_secondsElapsed.ElapsedMilliseconds, norm_alpha, norm_red, norm_green, norm_blue, norm_ir);
jals990 commented 8 years ago

@legionaryu brazuca aqui tbm, conseguiu usar a aplicação sem erros? Aqui não retorna nenhum valor de BPM e ao finalizar os 30´trava a aplicação, alterei as linhas como vc fez e nada :/