This commit is contained in:
MarcEricMartel 2023-05-03 11:06:34 -04:00
commit 85d76a1be7
9 changed files with 121 additions and 9 deletions

View File

@ -60,15 +60,20 @@
</ApplicationDefinition>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Model\CstApplication.cs" />
<Compile Include="Model\GestionFichiersSorties.cs" />
<Compile Include="Model\IGestionFichiers.cs" />
<Compile Include="Model\Perceptron.cs" />
<Compile Include="Model\GestionPerceptrons.cs" />
<Compile Include="Model\Squelette.cs" />
<Compile Include="Model\GestionWEntrainement.cs" />
<Compile Include="Presenter\JouerMp3.cs" />
<Compile Include="Presenter\JouerSon.cs" />
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Presenter\PresentateurWEntrainement.cs" />
<Compile Include="View\IwEntrainement.cs" />
<Compile Include="View\wAide.xaml.cs">
<DependentUpon>wAide.xaml</DependentUpon>
</Compile>

View File

@ -0,0 +1,21 @@
using System.Collections.Generic;
namespace JeuHoy_WPF_Natif.Model
{
public class GestionFichiersSorties : IGestionFichiers
{
public GestionFichiersSorties()
{
}
public List<Squelette> ChargerCoordonnees(string fichier)
{
throw new System.NotImplementedException();
}
public int SauvegarderCoordonnees(string fichier, List<Squelette> lstData)
{
throw new System.NotImplementedException();
}
}
}

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace JeuHoy_WPF_Natif.Model {
public class GestionPerceptrons {
private Dictionary<string, Perceptron> _lstPerceptrons = new Dictionary<string, Perceptron>();
private IGestionFichiers _gestionSortie = new GestionFichiersSorties();
private Model.IGestionFichiers _gestionSortie = new GestionFichiersSorties();
private List<Squelette> _lstData = new List<Squelette>();
/// <summary>

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JeuHoy_WPF_Natif.Model
{
/// <summary>
/// Description: Logique pour la vue Entrainement
/// </summary>
public class GestionWEntrainement
{
}
}

View File

@ -0,0 +1,10 @@
using System.Collections.Generic;
namespace JeuHoy_WPF_Natif.Model
{
public interface IGestionFichiers
{
List<Squelette> ChargerCoordonnees(string fichier);
int SauvegarderCoordonnees(string fichier, List<Squelette> lstData);
}
}

View File

@ -0,0 +1,34 @@
using JeuHoy_WPF_Natif.Model;
using JeuHoy_WPF_Natif.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JeuHoy_WPF_Natif.Presenter
{
/// <summary>
/// Description: Permet de gérer les événements de la vue Entrainement et de les aiguiller
/// </summary>
public class PresentateurWEntrainement
{
private IwEntrainement _vue;
private GestionWEntrainement _gestionnaire;
public PresentateurWEntrainement(IwEntrainement vue)
{
_vue = vue;
_gestionnaire = new GestionWEntrainement();
_vue.EntrainementEvt += _vue_EntrainementEvt;
}
private void _vue_EntrainementEvt(object sender, EventArgs e)
{
// Perceptron!!!
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace JeuHoy_WPF_Natif.View
{
/// <summary>
/// Description: Interface pour la fenêtre d'entrainement
/// </summary>
public interface IwEntrainement
{
Image Image { get; set; }
string Console { get; set; }
Canvas Canvas { get; set; }
event EventHandler EntrainementEvt;
}
}

View File

@ -26,7 +26,7 @@
<TextBox x:Name="txtConsole" HorizontalAlignment="Center" Margin="0,0,0,0" Grid.Row="2" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="300" Height="300" Grid.RowSpan="2"/>
<Image x:Name="picPositionAFaire" Grid.Column="1" HorizontalAlignment="Left" Height="822" VerticalAlignment="Top" Width="828" Grid.RowSpan="3"/>
<Grid Grid.Column="0" Grid.Row="3" >
<Grid Grid.Column="1" Margin="758,10,10,190" >
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
@ -44,9 +44,6 @@
<Label x:Name="lblFigureEnCours" Grid.Column="1" Grid.Row="1" Content="1" HorizontalAlignment="Right" VerticalAlignment="Top" FontFamily="Matura MT Script Capitals" FontSize="50" />
<Label x:Name="lblNbPositions" Grid.Column="2" Grid.Row="1" Content=" / 10" HorizontalAlignment="Right" VerticalAlignment="Top" FontFamily="Matura MT Script Capitals" FontSize="50" />
</Grid>
</Grid>

View File

@ -1,4 +1,6 @@
using Microsoft.Kinect;
using JeuHoy_WPF_Natif.Presenter;
using JeuHoy_WPF_Natif.View;
using Microsoft.Kinect;
using System;
using System.Collections.Generic;
using System.Linq;
@ -17,13 +19,19 @@ namespace JeuHoy_WPF.View
/// Description: Permet de faire l'entrainement des différentes figures de danse.
/// Date: 2023-04-17
/// </summary>
public partial class wEntrainement : Window
public partial class wEntrainement : Window, IwEntrainement
{
private Dictionary<string, BitmapImage> _dicImgFigure = new Dictionary<string, BitmapImage>();
private JouerSon _son = new JouerSon();
private int _positionEnCours = 1;
private PresentateurWEntrainement _presentateur;
public event EventHandler EntrainementEvt;
public Image Image { get => picKinect; set => picKinect = value; }
public string Console { get => txtConsole.Text; set => txtConsole.Text = value; }
public Canvas Canvas { get => pDessinSquelette; set => pDessinSquelette = value; }
private KinectSensor _sensor;
private MultiSourceFrameReader _multiSourceFrameReader;
@ -41,7 +49,9 @@ namespace JeuHoy_WPF.View
/// </summary>
public wEntrainement()
{
InitializeComponent();
_presentateur = new PresentateurWEntrainement(this);
InitializeComponent();
_sensor = KinectSensor.GetDefault();
@ -285,7 +295,7 @@ namespace JeuHoy_WPF.View
private void btnApprendre_Click(object sender, RoutedEventArgs e)
{
//Ajouter du code ICI
EntrainementEvt(this, e);
}