Skip to content

Commit

Permalink
Testapp updated
Browse files Browse the repository at this point in the history
  • Loading branch information
oliexe committed Mar 30, 2016
1 parent 231ca79 commit 3946d08
Show file tree
Hide file tree
Showing 67 changed files with 2,473 additions and 413 deletions.
Binary file modified examples/TestApp/.vs/TestApp/v14/.suo
Binary file not shown.
1,030 changes: 1,030 additions & 0 deletions examples/TestApp/.vs/config/applicationhost.config

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions examples/TestApp/TestApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{AAF16140-CC7D-4B3F-ADBD-B347365917CF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MindSetUWP", "..\..\src\MindSetUWA\MindSetUWP.csproj", "{156981C0-E892-44F4-9F10-73B8671ADF53}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Debug|Any CPU.ActiveCfg = Debug|x86
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Debug|ARM.ActiveCfg = Debug|ARM
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Debug|ARM.Build.0 = Debug|ARM
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Debug|ARM.Deploy.0 = Debug|ARM
Expand All @@ -24,6 +29,7 @@ Global
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Debug|x86.ActiveCfg = Debug|x86
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Debug|x86.Build.0 = Debug|x86
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Debug|x86.Deploy.0 = Debug|x86
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Release|Any CPU.ActiveCfg = Release|x86
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Release|ARM.ActiveCfg = Release|ARM
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Release|ARM.Build.0 = Release|ARM
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Release|ARM.Deploy.0 = Release|ARM
Expand All @@ -33,6 +39,22 @@ Global
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Release|x86.ActiveCfg = Release|x86
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Release|x86.Build.0 = Release|x86
{AAF16140-CC7D-4B3F-ADBD-B347365917CF}.Release|x86.Deploy.0 = Release|x86
{156981C0-E892-44F4-9F10-73B8671ADF53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{156981C0-E892-44F4-9F10-73B8671ADF53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{156981C0-E892-44F4-9F10-73B8671ADF53}.Debug|ARM.ActiveCfg = Debug|ARM
{156981C0-E892-44F4-9F10-73B8671ADF53}.Debug|ARM.Build.0 = Debug|ARM
{156981C0-E892-44F4-9F10-73B8671ADF53}.Debug|x64.ActiveCfg = Debug|x64
{156981C0-E892-44F4-9F10-73B8671ADF53}.Debug|x64.Build.0 = Debug|x64
{156981C0-E892-44F4-9F10-73B8671ADF53}.Debug|x86.ActiveCfg = Debug|x86
{156981C0-E892-44F4-9F10-73B8671ADF53}.Debug|x86.Build.0 = Debug|x86
{156981C0-E892-44F4-9F10-73B8671ADF53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{156981C0-E892-44F4-9F10-73B8671ADF53}.Release|Any CPU.Build.0 = Release|Any CPU
{156981C0-E892-44F4-9F10-73B8671ADF53}.Release|ARM.ActiveCfg = Release|ARM
{156981C0-E892-44F4-9F10-73B8671ADF53}.Release|ARM.Build.0 = Release|ARM
{156981C0-E892-44F4-9F10-73B8671ADF53}.Release|x64.ActiveCfg = Release|x64
{156981C0-E892-44F4-9F10-73B8671ADF53}.Release|x64.Build.0 = Release|x64
{156981C0-E892-44F4-9F10-73B8671ADF53}.Release|x86.ActiveCfg = Release|x86
{156981C0-E892-44F4-9F10-73B8671ADF53}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
38 changes: 9 additions & 29 deletions examples/TestApp/TestApp/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,49 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">

<Identity
Name="c3dd2a7b-8f45-4d39-890c-2bf9fcf181ea"
Publisher="CN=Stefa"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="c3dd2a7b-8f45-4d39-890c-2bf9fcf181ea" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="c3dd2a7b-8f45-4d39-890c-2bf9fcf181ea" Publisher="CN=Stefa" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="c3dd2a7b-8f45-4d39-890c-2bf9fcf181ea" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>HamburgerTemplate</DisplayName>
<PublisherDisplayName>Stefa</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
<Resource Language="x-generate" />
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="HamburgerTemplate.App">
<uap:VisualElements
DisplayName="HamburgerTemplate"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="HamburgerTemplate"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="HamburgerTemplate.App">
<uap:VisualElements DisplayName="HamburgerTemplate" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="HamburgerTemplate" BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<Capability Name="internetClient" />
<DeviceCapability Name="bluetooth" />
</Capabilities>
</Package>
7 changes: 6 additions & 1 deletion examples/TestApp/TestApp/TestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\..\src\MindSetUWA\MindSetUWP.csproj">
<Project>{156981c0-e892-44f4-9f10-73b8671adf53}</Project>
<Name>MindSetUWP</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions examples/TestApp/TestApp/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using TestApp.Models;
using MindSetUWA;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

Expand All @@ -23,9 +24,12 @@ namespace TestApp
/// </summary>
public sealed partial class MainPage : Page
{


public MainPage()
{
this.InitializeComponent();

}

private void NavMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
Expand Down
114 changes: 114 additions & 0 deletions examples/TestApp/TestApp/Views/PageNotFound.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,125 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TestApp.Views"
xmlns:controls="using:WinRTXamlToolkit.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:charting="using:WinRTXamlToolkit.Controls.DataVisualization.Charting"
mc:Ignorable="d">


<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
<Grid.RowDefinitions>
<RowDefinition
Height="auto" />
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
<RowDefinition
Height="auto" />
</Grid.RowDefinitions>
<Grid
Grid.Row="1"
Margin="0 0 0 10">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="20" />
<ColumnDefinition
Width="*" />
<ColumnDefinition
Width="20" />
<ColumnDefinition
Width="*" />
<ColumnDefinition
Width="20" />
<ColumnDefinition
Width="*" />
<ColumnDefinition
Width="20" />
</Grid.ColumnDefinitions>
<Border
Grid.Column="1"
Background="White"
Margin="0"/>
<Border
Grid.Column="5"
Background="White"
Margin="0">
<controls:Gauge
Minimum="0"
Maximum="100"
Height="{Binding Size}"
Value="{Binding Value}"
Unit="Meditation" Margin="70,64,10.333,10" />
</Border>
<Border
Grid.Column="3"
Background="White"
Margin="0"/>
</Grid>

<Grid
Grid.Row="2"
Margin="0 10 0 0">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="*" />
</Grid.ColumnDefinitions>
<Border
Grid.Column="3"
Background="Gainsboro"
Margin="0">
<charting:Chart
x:Name="MixedChart"
Title="Mixed Chart"
Margin="70,0">
<charting:LineSeries
Title="Delta"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
<charting:LineSeries
Title="Theta"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
<charting:LineSeries
Title="Alpha - Low"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
<charting:LineSeries
Title="Alpha - High"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
<charting:LineSeries
Title="Beta - Low"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
<charting:LineSeries
Title="Beta - High"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
<charting:LineSeries
Title="Gamma - Low"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
<charting:LineSeries
Title="Gamma - Mid"
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
</charting:Chart>

</Border>
</Grid>
</Grid>
</Grid>
</Page>
7 changes: 5 additions & 2 deletions examples/TestApp/TestApp/Views/Start.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
Background="White"
Margin="0">
<controls:Gauge
Name="AttenGauge"
Minimum="0"
Maximum="100"
Height="{Binding Size}"
Expand All @@ -57,6 +58,7 @@
Background="White"
Margin="0">
<controls:Gauge
Name="MeditGauge"
Minimum="0"
Maximum="100"
Height="{Binding Size}"
Expand All @@ -68,8 +70,9 @@
Background="White"
Margin="0">
<controls:Gauge
Name="SignalQual"
Minimum="0"
Maximum="100"
Maximum="255"
Height="{Binding Size}"
Value="{Binding Value}"
Unit="Signal Quality" />
Expand All @@ -92,7 +95,7 @@
Title="Raw brain values"
Margin="70,0">
<charting:AreaSeries
Title="Brainwaves"
Title=""
IndependentValueBinding="{Binding Name}"
DependentValueBinding="{Binding Value}"
IsSelectionEnabled="True" />
Expand Down
54 changes: 49 additions & 5 deletions examples/TestApp/TestApp/Views/Start.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using WinRTXamlToolkit.Tools;
using MindSetUWA;
using System.Threading;
using Windows.System.Threading;
using Windows.UI.Core;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

Expand All @@ -37,19 +41,59 @@ private void RunIfSelected(UIElement element, Action action)
action.Invoke();
}

MindSetConnection connection = new MindSetConnection();

public int enlapsedTime;
private DispatcherTimer dispatch;

public delegate void MyCallback();
public delegate void MyCallback2(int value);
public MyCallback OnStartTime;
public MyCallback OnStopTime;
public MyCallback OnEndTime;
public MyCallback2 OnCountTime;
public Boolean started = false;
private double _value;

public Start()
{
this.InitializeComponent();
enlapsedTime = 0;
dispatch = new DispatcherTimer();
dispatch.Interval = new TimeSpan(0, 0, 0, 0, 200) ;
dispatch.Tick += timer_Tick;
dispatch.Start();

var items = new List<NameValueItem>();
}



for (int i = 0; i < 10; i++)
{
items.Add(new NameValueItem { Name = "Test" + i, Value = _random.Next(10, 100) });
private void timer_Tick(object sender, object e)
{

if (!started)
{
connection.ConnectBluetooth("MindWave Mobile");
started = true;
}

var items = new List<NameValueItem>();
items.Clear();
items.Add(new NameValueItem { Name = "Delta", Value = connection.RealtimeData.Delta });
items.Add(new NameValueItem { Name = "Theta", Value = connection.RealtimeData.Theta });
items.Add(new NameValueItem { Name = "Alpha(Low)", Value = connection.RealtimeData.AlphaLow });
items.Add(new NameValueItem { Name = "Alpha(High)", Value = connection.RealtimeData.AlphaHigh });
items.Add(new NameValueItem { Name = "Theta", Value = connection.RealtimeData.Theta });
items.Add(new NameValueItem { Name = "Beta(High)", Value = connection.RealtimeData.BetaHigh });
items.Add(new NameValueItem { Name = "Beta(Low)", Value = connection.RealtimeData.BetaLow });
items.Add(new NameValueItem { Name = "Gamma(Low)", Value = connection.RealtimeData.GammaLow });
items.Add(new NameValueItem { Name = "Gamma(Mid)", Value = connection.RealtimeData.GammaMid });
this.SignalQual.Value = connection.RealtimeData.Quality;
this.AttenGauge.Value = connection.RealtimeData.Attention;
this.MeditGauge.Value = connection.RealtimeData.Meditation;
RunIfSelected(this.AreaChart, () => ((AreaSeries)this.AreaChart.Series[0]).ItemsSource = items); ;

}


}
}
Loading

0 comments on commit 3946d08

Please sign in to comment.