Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csv, json export #2

Open
Ubun1 opened this issue Apr 19, 2018 · 1 comment
Open

csv, json export #2

Ubun1 opened this issue Apr 19, 2018 · 1 comment

Comments

@Ubun1
Copy link

Ubun1 commented Apr 19, 2018

{
filestream.WriteLine("#Facie - Markers Count");
filestream.WriteLine("#ID");
filestream.WriteLine("#X (m)\tY (m)\tPressure (Pa)\tTemperature (C)\tAge (Ma)\tFacie\tPrnFile");
filestream.WriteLine("#Prn-files count: {0}", markersSet.Keys.Count);
filestream.WriteLine("#---");
foreach (var res in resultMarkersIndexes)
{
filestream.WriteLine("~{0} - {1}{2}", res.Key.Name, res.Value.Count, res.Key.Color.HasValue ? string.Format("|{0},{1},{2}", res.Key.Color.Value.R, res.Key.Color.Value.G, res.Key.Color.Value.B) : "" );
foreach (var mrk in res.Value)
{
filestream.WriteLine(mrk.Id);
foreach (var file in markersSet.Keys)
{
var curM = markersSet[file][mrk.Id];
var curFc = GeologyConfig.Instace.GetFacie(new PTPoint(curM.Pressure, curM.Temperature));
filestream.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}",
curM.XPosition.ToString("0"),
curM.YPosition.ToString("0"),
curM.Pressure.ToString("0"),
curM.Temperature.ToString("0"),
curM.Age.ToString("E2"),
(curFc == null) ? "Not_Defined" : curFc.Name,
file );
}
}
filestream.WriteLine(@"--***--");

нужен экспорт в человеческие форматы. а то если заниматься пост обработкой, нужно дополнительно все перепарсивать.
Предлагаю либо ейрархический формат json,

{
"mark_id" : 123456,
"temp" : [1,2,3,4],
"press": [1,2,3,4],
...
}

либо csv\tsv но mark_id выводить отдельный столбцом

id temp pa
1 123 123
1 124 124
2 123 123
2 124 123
@Serhantes91
Copy link
Owner

Serhantes91 commented Apr 22, 2018

В принципе, поддерживаю, но заниматься этим сейчас лень)
Если возьмешься - возражать не буду

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants