Skip to content

Commit bdc58d5

Browse files
author
Stevan M
committed
No directory error in 0.3.0 fixed
1 parent 67bdcdc commit bdc58d5

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

GeesWPF/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("0.3.0")]
55-
[assembly: AssemblyFileVersion("0.3.0")]
54+
[assembly: AssemblyVersion("0.3.1")]
55+
[assembly: AssemblyFileVersion("0.3.1")]

GeesWPF/ViewModel.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.ObjectModel;
44
using System.ComponentModel;
55
using System.Data;
6+
using System.IO;
67
using System.IO.Packaging;
78
using System.Linq;
89
using System.Runtime.CompilerServices;
@@ -135,6 +136,7 @@ public void UpdateTable()
135136
}
136137
private void BindData(string filePath)
137138
{
139+
MakeLogIfEmpty();
138140
logTable.Columns.Clear();
139141
logTable.Rows.Clear();
140142
string[] lines = System.IO.File.ReadAllLines(filePath);
@@ -164,6 +166,21 @@ private void BindData(string filePath)
164166
}
165167
#endregion
166168

169+
void MakeLogIfEmpty()
170+
{
171+
const string header = "Time,Plane,FPM,Impact (G),Air Speed (kt),Ground Speed (kt),Headwind (kt),Crosswind (kt),Sideslip (deg)";
172+
string myDocs = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
173+
Directory.CreateDirectory(myDocs + @"\MyMSFS2020Landings-Gees"); //create if doesn't exist
174+
string path = myDocs + @"\MyMSFS2020Landings-Gees\Landings.v1.csv";
175+
if (!File.Exists(path))
176+
{
177+
using (StreamWriter w = File.CreateText(path))
178+
{
179+
w.WriteLine(header);
180+
}
181+
}
182+
}
183+
167184
#region Landing Rate Data
168185
public class Parameters
169186
{

0 commit comments

Comments
 (0)