Liasion? du gestion perceptron au window

This commit is contained in:
Merlin Gélinas 2023-05-13 14:44:28 -04:00
parent 3e954843b3
commit fe589a29e7
5 changed files with 13 additions and 21 deletions

View File

@ -66,7 +66,6 @@
<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">

View File

@ -1,15 +0,0 @@
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

@ -14,12 +14,12 @@ namespace JeuHoy_WPF_Natif.Presenter
public class PresentateurWEntrainement
{
private IwEntrainement _vue;
private GestionWEntrainement _gestionnaire;
private GestionPerceptrons _gestionnairePerceptron;
public PresentateurWEntrainement(IwEntrainement vue)
{
_vue = vue;
_gestionnaire = new GestionWEntrainement();
_gestionnairePerceptron = new GestionPerceptrons();
_vue.EntrainementEvt += _vue_EntrainementEvt;
}
@ -28,7 +28,10 @@ namespace JeuHoy_WPF_Natif.Presenter
private void _vue_EntrainementEvt(object sender, EventArgs e)
{
// Perceptron!!!
throw new NotImplementedException();
string position = _vue.GetPositionEnCour().ToString();
Squelette sq = new Squelette(new double[1], position);
_vue.Console = _gestionnairePerceptron.Entrainement(sq, position);
}
}
}

View File

@ -16,5 +16,8 @@ namespace JeuHoy_WPF_Natif.View
string Console { get; set; }
Canvas Canvas { get; set; }
event EventHandler EntrainementEvt;
}
int GetPositionEnCour();
}
}

View File

@ -37,6 +37,7 @@ namespace JeuHoy_WPF.View
private MultiSourceFrameReader _multiSourceFrameReader;
private BodyFrameReader _bodyFrameReader;
private WriteableBitmap _bitmap;
private Body _currentBody;
//private DisplayFrameType _displayFrameType = DisplayFrameType.Color;
private byte[] _picPixels = null;
@ -132,6 +133,7 @@ namespace JeuHoy_WPF.View
if (body != null)
{
_currentBody = body;
DessinerSquelette(body, _sensor);
}
}
@ -298,6 +300,6 @@ namespace JeuHoy_WPF.View
EntrainementEvt(this, e);
}
public int GetPositionEnCour() { return _positionEnCours; }
}
}