From fe589a29e77844890c8a7688ec9afad7c04eae95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Merlin=20G=C3=A9linas?= <2133206@etu.cegepsth.qc.ca>
Date: Sat, 13 May 2023 14:44:28 -0400
Subject: [PATCH] Liasion? du gestion perceptron au window
---
.../JeuHoy_WPF_Natif/JeuHoy_WPF_Natif.csproj | 1 -
.../Model/GestionWEntrainement.cs | 15 ---------------
.../Presenter/PresentateurWEntrainement.cs | 9 ++++++---
.../JeuHoy_WPF_Natif/View/IwEntrainement.cs | 5 ++++-
.../JeuHoy_WPF_Natif/View/wEntrainement.xaml.cs | 4 +++-
5 files changed, 13 insertions(+), 21 deletions(-)
delete mode 100644 JeuHoyEtudiants/JeuHoy_WPF_Natif/Model/GestionWEntrainement.cs
diff --git a/JeuHoyEtudiants/JeuHoy_WPF_Natif/JeuHoy_WPF_Natif.csproj b/JeuHoyEtudiants/JeuHoy_WPF_Natif/JeuHoy_WPF_Natif.csproj
index 62de708..7d2702a 100644
--- a/JeuHoyEtudiants/JeuHoy_WPF_Natif/JeuHoy_WPF_Natif.csproj
+++ b/JeuHoyEtudiants/JeuHoy_WPF_Natif/JeuHoy_WPF_Natif.csproj
@@ -66,7 +66,6 @@
-
diff --git a/JeuHoyEtudiants/JeuHoy_WPF_Natif/Model/GestionWEntrainement.cs b/JeuHoyEtudiants/JeuHoy_WPF_Natif/Model/GestionWEntrainement.cs
deleted file mode 100644
index fe6f853..0000000
--- a/JeuHoyEtudiants/JeuHoy_WPF_Natif/Model/GestionWEntrainement.cs
+++ /dev/null
@@ -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
-{
- ///
- /// Description: Logique pour la vue Entrainement
- ///
- public class GestionWEntrainement
- {
- }
-}
diff --git a/JeuHoyEtudiants/JeuHoy_WPF_Natif/Presenter/PresentateurWEntrainement.cs b/JeuHoyEtudiants/JeuHoy_WPF_Natif/Presenter/PresentateurWEntrainement.cs
index c4e19eb..2cb1d0a 100644
--- a/JeuHoyEtudiants/JeuHoy_WPF_Natif/Presenter/PresentateurWEntrainement.cs
+++ b/JeuHoyEtudiants/JeuHoy_WPF_Natif/Presenter/PresentateurWEntrainement.cs
@@ -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);
}
}
}
diff --git a/JeuHoyEtudiants/JeuHoy_WPF_Natif/View/IwEntrainement.cs b/JeuHoyEtudiants/JeuHoy_WPF_Natif/View/IwEntrainement.cs
index 62619b8..90f10f9 100644
--- a/JeuHoyEtudiants/JeuHoy_WPF_Natif/View/IwEntrainement.cs
+++ b/JeuHoyEtudiants/JeuHoy_WPF_Natif/View/IwEntrainement.cs
@@ -16,5 +16,8 @@ namespace JeuHoy_WPF_Natif.View
string Console { get; set; }
Canvas Canvas { get; set; }
event EventHandler EntrainementEvt;
- }
+
+ int GetPositionEnCour();
+
+ }
}
diff --git a/JeuHoyEtudiants/JeuHoy_WPF_Natif/View/wEntrainement.xaml.cs b/JeuHoyEtudiants/JeuHoy_WPF_Natif/View/wEntrainement.xaml.cs
index ae65c66..d02f0de 100644
--- a/JeuHoyEtudiants/JeuHoy_WPF_Natif/View/wEntrainement.xaml.cs
+++ b/JeuHoyEtudiants/JeuHoy_WPF_Natif/View/wEntrainement.xaml.cs
@@ -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; }
}
}