Skip to content

Commit

Permalink
Added support for writing straight to folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Markowitz committed Jan 2, 2017
1 parent 6dead7d commit 0b3f42f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 27 deletions.
57 changes: 33 additions & 24 deletions kinect2_nidaq/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ private void StartButton_Click(object sender, RoutedEventArgs e)
DepthReader = sensor.DepthFrameSource.OpenReader();
DepthReader.FrameArrived += DepthReader_FrameArrived;
IsDepthStreamEnabled = true;

}
else
{
Expand Down Expand Up @@ -646,32 +647,37 @@ private void SessionCleanup()
// close the readers, files and filewriting tasks


if (IsRecordingEnabled == true)
if (IsColorStreamEnabled == true && IsRecordingEnabled == true)
{
if (IsColorStreamEnabled == true)
{
ColorReader.Dispose();
ColorTSStream.Close();
ColorDumpTask.Dispose();
}

if (IsDepthStreamEnabled == true)
{
DepthReader.Dispose();
DepthTSStream.Close();
DepthVidStream.Close();
DepthDumpTask.Dispose();
}

if (IsNidaqEnabled == true)
{
NidaqStream.Close();
NidaqFile.Close();
NidaqDumpTask.Dispose();
}

ColorReader.Dispose();
ColorTSStream.Close();
ColorDumpTask.Dispose();
}
else if (IsColorStreamEnabled == true)
{
ColorReader.Dispose();
}

if (IsDepthStreamEnabled == true && IsRecordingEnabled== true)
{
DepthReader.Dispose();
DepthTSStream.Close();
DepthVidStream.Close();
DepthDumpTask.Dispose();
}
else if (IsDepthStreamEnabled == true)
{
DepthReader.Dispose();
}

if (IsNidaqEnabled == true && IsRecordingEnabled ==true)
{
NidaqStream.Close();
NidaqFile.Close();
NidaqDumpTask.Dispose();
}


StatusBarProgress.IsEnabled = true;
StatusBarProgressETA.IsEnabled = true;

Expand Down Expand Up @@ -1301,7 +1307,10 @@ private void SettingsChanged()
&& PreviewMode.IsChecked == false)
{

string BasePath = Path.GetTempPath();
// Temporary directory is defined here

//string BasePath = Path.GetTempPath();
string BasePath = SaveFolder;
string now = DateTime.Now.ToString("yyyyMMddHHmmss");

FilePath_ColorTs = Path.Combine(BasePath, String.Format("rgb_ts_{0}.txt", now));
Expand Down
37 changes: 34 additions & 3 deletions kinect2_nidaq/kinect2_nidaq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\Users\dattalab\Desktop\kinect2-nidaq\</PublishUrl>
<PublishUrl>C:\Users\dattalab\Desktop\kinect2-nidaq-vspublish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
Expand All @@ -25,8 +25,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down Expand Up @@ -232,6 +231,38 @@
<ItemGroup>
<Content Include="External\tar-cs\tar-cs\tar-cs.csproj" />
</ItemGroup>
<ItemGroup>
<PublishFile Include="Microsoft.Kinect">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="NationalInstruments.MStudioCLM">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
<PublishFile Include="NationalInstruments.NiLmClientDLL">
<Visible>False</Visible>
<Group>
</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Assembly</FileType>
</PublishFile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down

0 comments on commit 0b3f42f

Please sign in to comment.