|
28
|
1 |
/* |
|
15
|
2 |
* This file is part of the TraKERS\Middleware package. |
|
|
3 |
* |
|
|
4 |
* (c) IRI <http://www.iri.centrepompidou.fr/> |
|
|
5 |
* |
|
27
|
6 |
* For the full copyright and license information, please view the LICENSE |
|
15
|
7 |
* file that was distributed with this source code. |
|
|
8 |
*/ |
|
|
9 |
|
|
|
10 |
/* |
|
|
11 |
* Projet : TraKERS |
|
|
12 |
* Module : MIDDLEWARE |
|
|
13 |
* Sous-Module : Debug |
|
|
14 |
* Classe : DebugWindow |
|
|
15 |
* |
|
|
16 |
* Auteur : alexandre.bastien@iri.centrepompidou.fr |
|
|
17 |
* |
|
|
18 |
* Fonctionnalités : Reçoit des notifications des sous-modules Tracking, Communication et Exception. |
|
|
19 |
* Intéragit avec la fenêtre XAML de debug de façon à afficher un rendu visuel. |
|
|
20 |
*/ |
|
|
21 |
|
|
|
22 |
using System; |
|
|
23 |
using System.Windows; |
|
|
24 |
using System.Windows.Controls; |
|
|
25 |
using System.Windows.Media; |
|
|
26 |
using System.Windows.Media.Imaging; |
|
|
27 |
using System.Windows.Shapes; |
|
|
28 |
using System.Drawing; |
|
|
29 |
using Microsoft.Kinect; |
|
|
30 |
using System.Resources; |
|
|
31 |
using System.Reflection; |
|
|
32 |
using System.Timers; |
|
|
33 |
using System.Configuration; |
|
37
|
34 |
using System.IO; |
|
41
|
35 |
using System.Collections.Specialized; |
|
15
|
36 |
|
|
|
37 |
namespace Trakers.Debug |
|
|
38 |
{ |
|
|
39 |
public partial class DebugWindow : Window |
|
|
40 |
{ |
|
|
41 |
//Gestionnaire de ressources. |
|
|
42 |
private ResourceManager rm; |
|
|
43 |
|
|
|
44 |
//Paramètres du serveur TUIO. |
|
41
|
45 |
private OrderedDictionary config; |
|
|
46 |
|
|
18
|
47 |
//Images |
|
|
48 |
private String imgLocation; |
|
15
|
49 |
|
|
|
50 |
//Timer. |
|
|
51 |
private System.Timers.Timer _timer; |
|
|
52 |
//Membre permettant d'atteindre la classe KinectMain du sous-module Tracking. |
|
|
53 |
//private KinectMain kinectMain; |
|
|
54 |
//Tableau contenant une image en couleurs. |
|
|
55 |
private byte[] colorPixelData; |
|
|
56 |
//Indique si la kinect est allumée/éteinte. |
|
|
57 |
private bool on; |
|
|
58 |
//Indique si la fenêtre de debug est actuellement en cours de fermeture. |
|
|
59 |
private bool closing; |
|
|
60 |
//Indique si l'image doit être raffraichie. |
|
|
61 |
private Boolean refreshImage; |
|
|
62 |
|
|
|
63 |
/* |
|
|
64 |
* Constructeur : Affiche la fenêtre de debug en lui passant en paramètre une instanciation de la |
|
|
65 |
* classe KinectMain. |
|
|
66 |
* Au départ, la kinect est éteinte. |
|
|
67 |
*/ |
|
|
68 |
public DebugWindow()//KinectMain main) |
|
|
69 |
{ |
|
|
70 |
InitializeComponent(); |
|
18
|
71 |
|
|
|
72 |
imgLocation = "Imgs"; |
|
|
73 |
|
|
41
|
74 |
config = new OrderedDictionary(); |
|
|
75 |
|
|
15
|
76 |
//On fait appel au gestionnaire de ressources. |
|
|
77 |
rm = new ResourceManager("Trakers.Debug.Properties.Resources", Assembly.GetExecutingAssembly()); |
|
|
78 |
//On tente de charger les paramètres du fichier params.ini. |
|
|
79 |
//Si on n'y arrive pas, on affiche une erreur et on charge les paramètres par défaut. |
|
|
80 |
if (!loadParameters()) |
|
|
81 |
{ |
|
|
82 |
ExceptionLbl.Content = rm.GetString("loadParametersFail"); |
|
41
|
83 |
config.Clear(); |
|
15
|
84 |
//Distances de détection des mains par défaut pour la recherche (ici de 1m à 2m de la Kinect). |
|
41
|
85 |
config.Add("minDistHands", 1.0f); |
|
|
86 |
config.Add("maxDistHands", 1.5f); |
|
|
87 |
config.Add("minDist", 1.0f); |
|
|
88 |
config.Add("maxDist", 4.0f); |
|
|
89 |
config.Add("zeroPoint", 1.7f); |
|
|
90 |
config.Add("tuioConnexionHost", "127.0.0.1"); |
|
|
91 |
config.Add("tuioConnexionPort", 80); |
|
|
92 |
config.Add("wsConnexionHost", "127.0.0.1"); |
|
|
93 |
config.Add("wsConnexionPort", 81); |
|
|
94 |
config.Add("tuioTimerElapsing", 1000); |
|
|
95 |
config.Add("wsTimerElapsing", 1000); |
|
|
96 |
config.Add("imagesToShow", 20); |
|
|
97 |
config.Add("takenPoints", 10); |
|
|
98 |
config.Add("directionChangeTresholdXY", 10); |
|
|
99 |
config.Add("directionChangeTresholdZ", 0.01f); |
|
49
|
100 |
//Chemins des readme et doc. |
|
|
101 |
config.Add("readmeMiddleware", "..\\readme - Middleware.txt"); |
|
|
102 |
config.Add("readmeFrontProcessing", "..\\readme - Front Processing.txt"); |
|
|
103 |
config.Add("docFrontProcessing", "..\\tutorial front processing.html"); |
|
|
104 |
config.Add("readmeFrontJS", "..\\readme - Front Web.txt"); |
|
|
105 |
config.Add("docFrontJS", "..\\tutorial front js et wamp.html"); |
|
|
106 |
//Chemins des exemples processing. |
|
|
107 |
config.Add("exPFMPS", "..\\Front Processing\\src\\Fluid_manipulation\\Fluid_manipulation.pde"); |
|
|
108 |
config.Add("exPFMExe", "..\\Front Processing\\src\\Fluid_manipulation\\application.windows\\Fluid_manipulation.exe"); |
|
|
109 |
config.Add("exPSMPS", "..\\Front Processing\\src\\Smoke_manipulation\\Smoke_manipulation.pde"); |
|
|
110 |
config.Add("exPSMExe", "..\\Front Processing\\src\\Smoke_manipulation\\application.windows\\Smoke_manipulation.exe"); |
|
|
111 |
config.Add("exPTPS", "..\\Front Processing\\src\\Trakers\\Trakers.pde"); |
|
|
112 |
config.Add("exPTExe", "..\\Front Processing\\src\\Trakers\\application.windows\\Trakers.exe"); |
|
|
113 |
config.Add("exPTGPS", "..\\Front Processing\\src\\Trakers_gestures\\Trakers_gestures.pde"); |
|
|
114 |
config.Add("exPTGExe", "..\\Front Processing\\src\\Trakers_gestures\\application.windows\\Trakers_gestures.exe"); |
|
|
115 |
config.Add("exPIEHand1DPS", "..\\Front Processing\\src\\Interaction_examples\\Hands_1D\\Hands_1D.pde"); |
|
|
116 |
config.Add("exPIEHand1DExe", "..\\Front Processing\\src\\Interaction_examples\\Hands_1D\\application.windows\\Hands_1D.exe"); |
|
|
117 |
config.Add("exPIEHand2DPS", "..\\Front Processing\\src\\Interaction_examples\\Hands_2D\\Hands_2D.pde"); |
|
|
118 |
config.Add("exPIEHand2DExe", "..\\Front Processing\\src\\Interaction_examples\\Hands_2D\\application.windows\\Hands_2D.exe"); |
|
|
119 |
config.Add("exPIEHandPressPS", "..\\Front Processing\\src\\Interaction_examples\\Hand_press\\Hand_press.pde"); |
|
|
120 |
config.Add("exPIEHandPressExe", "..\\Front Processing\\src\\Interaction_examples\\Hand_press\\application.windows\\Hand_press.exe"); |
|
|
121 |
config.Add("exPIEHandSignalPS", "..\\Front Processing\\src\\Interaction_examples\\Hand_signal\\Hand_signal.pde"); |
|
|
122 |
config.Add("exPIEHandSignalExe", "..\\Front Processing\\src\\Interaction_examples\\Hand_signal\\application.windows\\Hand_signal.exe"); |
|
|
123 |
//Chemins des exemples web. |
|
|
124 |
config.Add("exWPointersPS", "C:\\wamp\\www\\Front JS\\pointers\\"); |
|
|
125 |
config.Add("exWPointersExe", "http://localhost/Front%20JS/pointers/"); |
|
|
126 |
config.Add("exWGesturesPS", "C:\\wamp\\www\\Front JS\\pointers\\"); |
|
|
127 |
config.Add("exWGesturesExe", "http://localhost/Front%20JS/gestures/"); |
|
15
|
128 |
} |
|
|
129 |
|
|
49
|
130 |
//On donne les noms des éléments du menu. |
|
|
131 |
FileMenu.Header = rm.GetString("menuFile"); |
|
|
132 |
ReadmeMiddlewareMenu.Header = rm.GetString("menuReadmeMiddleware"); |
|
|
133 |
ReadmeFrontProcessingMenu.Header = rm.GetString("menuReadmeFrontProcessing"); |
|
|
134 |
DocumentationFrontProcessingMenu.Header = rm.GetString("menuDocFrontP"); |
|
|
135 |
ReadmeFrontJSMenu.Header = rm.GetString("menuReadmeFrontJS"); |
|
|
136 |
DocumentationFrontJSMenu.Header = rm.GetString("menuDocFrontJS"); |
|
|
137 |
QuitMenu.Header = rm.GetString("menuQuit"); |
|
|
138 |
ConfigMenu.Header = rm.GetString("menuConfig"); |
|
|
139 |
ParamMenu.Header = rm.GetString("menuParam"); |
|
|
140 |
ExamplesMenu.Header = rm.GetString("menuEx"); |
|
|
141 |
ProcessingMenu.Header = rm.GetString("menuExP"); |
|
|
142 |
ProcessingMenuFM.Header = rm.GetString("menuExPFluid"); |
|
|
143 |
ProcessingMenuFMPS.Header = rm.GetString("menuExSource"); |
|
|
144 |
ProcessingMenuFMExe.Header = rm.GetString("menuExExe"); |
|
|
145 |
ProcessingMenuSM.Header = rm.GetString("menuExPSmoke"); |
|
|
146 |
ProcessingMenuSMPS.Header = rm.GetString("menuExSource"); |
|
|
147 |
ProcessingMenuSMExe.Header = rm.GetString("menuExExe"); |
|
|
148 |
ProcessingMenuIE.Header = rm.GetString("menuExPIE"); |
|
|
149 |
ProcessingMenuIEHand1D.Header = rm.GetString("menuExPIEHand1D"); |
|
|
150 |
ProcessingMenuIEHand1DPS.Header = rm.GetString("menuExSource"); |
|
|
151 |
ProcessingMenuIEHand1DExe.Header = rm.GetString("menuExExe"); |
|
|
152 |
ProcessingMenuIEHand2D.Header = rm.GetString("menuExPIEHand2D"); |
|
|
153 |
ProcessingMenuIEHand2DPS.Header = rm.GetString("menuExSource"); |
|
|
154 |
ProcessingMenuIEHand2DExe.Header = rm.GetString("menuExExe"); |
|
|
155 |
ProcessingMenuIEHandPress.Header = rm.GetString("menuExPIEHandPress"); |
|
|
156 |
ProcessingMenuIEHandPressPS.Header = rm.GetString("menuExSource"); |
|
|
157 |
ProcessingMenuIEHandPressExe.Header = rm.GetString("menuExExe"); |
|
|
158 |
ProcessingMenuIEHandSignal.Header = rm.GetString("menuExPIEHandSignal"); |
|
|
159 |
ProcessingMenuIEHandSignalPS.Header = rm.GetString("menuExSource"); |
|
|
160 |
ProcessingMenuIEHandSignalExe.Header = rm.GetString("menuExExe"); |
|
|
161 |
ProcessingMenuT.Header = rm.GetString("menuExPT"); |
|
|
162 |
ProcessingMenuTPS.Header = rm.GetString("menuExSource"); |
|
|
163 |
ProcessingMenuTExe.Header = rm.GetString("menuExExe"); |
|
|
164 |
ProcessingMenuTG.Header = rm.GetString("menuExPTG"); |
|
|
165 |
ProcessingMenuTGPS.Header = rm.GetString("menuExSource"); |
|
|
166 |
ProcessingMenuTGExe.Header = rm.GetString("menuExExe"); |
|
|
167 |
WebMenu.Header = rm.GetString("menuExW"); |
|
|
168 |
WebMenuPointers.Header = rm.GetString("menuExWPointers"); |
|
|
169 |
WebMenuPointersPS.Header = rm.GetString("menuExSource"); |
|
|
170 |
WebMenuPointersExe.Header = rm.GetString("menuExExe"); |
|
|
171 |
WebMenuGestures.Header = rm.GetString("menuExWGestures"); |
|
|
172 |
WebMenuGesturesPS.Header = rm.GetString("menuExSource"); |
|
|
173 |
WebMenuGesturesExe.Header = rm.GetString("menuExExe"); |
|
|
174 |
|
|
15
|
175 |
//kinectMain = main; |
|
|
176 |
on = true; |
|
|
177 |
closing = false; |
|
|
178 |
refreshImage = true; |
|
|
179 |
try |
|
|
180 |
{ |
|
41
|
181 |
//On instancie les timers à N ms. |
|
|
182 |
_timer = new System.Timers.Timer((int)config["tuioTimerElapsing"]); |
|
15
|
183 |
//Dès que le timer est expiré, on appelle _timer_Elapsed. |
|
|
184 |
_timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed); |
|
|
185 |
} |
|
|
186 |
catch (Exception){} |
|
|
187 |
} |
|
|
188 |
|
|
|
189 |
/* |
|
|
190 |
* Méthode d'effacement du label d'exceptions. |
|
|
191 |
*/ |
|
|
192 |
public void NoException() |
|
|
193 |
{ |
|
|
194 |
ExceptionLbl.Content = ""; |
|
|
195 |
} |
|
|
196 |
|
|
|
197 |
/* |
|
|
198 |
* Méthode d'affichage des exceptions dans le label d'exceptions. |
|
|
199 |
*/ |
|
|
200 |
public void ShowException(String reference) |
|
|
201 |
{ |
|
|
202 |
ExceptionLbl.Content = rm.GetString(reference); |
|
|
203 |
} |
|
|
204 |
|
|
|
205 |
/* |
|
|
206 |
* Méthode de fermeture de l'interface. |
|
|
207 |
*/ |
|
|
208 |
public void ShutDownInterface() |
|
|
209 |
{ |
|
|
210 |
DebugImage.Source = null; |
|
|
211 |
ExceptionLbl.Content = ""; |
|
|
212 |
} |
|
|
213 |
|
|
|
214 |
/* |
|
41
|
215 |
* Méthode appelée à l'expiration du timer ws pour les gestures et modes. |
|
15
|
216 |
*/ |
|
|
217 |
public void _timer_Elapsed(object sender, ElapsedEventArgs e) |
|
|
218 |
{ |
|
|
219 |
//On débloque le raffraichissement de l'image. |
|
|
220 |
refreshImage = true; |
|
|
221 |
//On arrête le timer. |
|
|
222 |
_timer.Stop(); |
|
|
223 |
} |
|
|
224 |
|
|
|
225 |
/* |
|
|
226 |
* Getter pour le membre indiquant la fermeture de la fenêtre de debug. |
|
|
227 |
*/ |
|
|
228 |
public bool isClosing() |
|
|
229 |
{ |
|
|
230 |
return closing; |
|
|
231 |
} |
|
|
232 |
|
|
|
233 |
/* |
|
49
|
234 |
* Est appelé lors de la fermeture du Middleware par le menu. |
|
|
235 |
*/ |
|
|
236 |
private void QuitMenu_Click(object sender, RoutedEventArgs e) |
|
|
237 |
{ |
|
|
238 |
closing = true; |
|
|
239 |
Application.Current.Shutdown(); |
|
|
240 |
} |
|
|
241 |
|
|
|
242 |
/* |
|
15
|
243 |
* Est appelée à la fermeture de la fenêtre. |
|
|
244 |
*/ |
|
|
245 |
public void Window_Closed(object sender, EventArgs e) |
|
|
246 |
{ |
|
|
247 |
closing = true; |
|
|
248 |
} |
|
|
249 |
|
|
|
250 |
/* |
|
|
251 |
* Bouton ON/OFF. |
|
|
252 |
*/ |
|
|
253 |
private void Switch_Click(object sender, RoutedEventArgs e) |
|
|
254 |
{ |
|
|
255 |
//S'il valait faux, il vaut vrai maintenant et inversement. |
|
|
256 |
on = !on; |
|
|
257 |
//Si la kinect est allumée. |
|
|
258 |
if (on) |
|
|
259 |
{ |
|
|
260 |
//Il affiche OFF (pour éteindre la kinect). |
|
|
261 |
Switch.Content = "OFF"; |
|
|
262 |
//On vide le label des exceptions. |
|
|
263 |
ExceptionLbl.Content = ""; |
|
|
264 |
} |
|
|
265 |
else |
|
|
266 |
{ |
|
|
267 |
//Il affiche ON (pour allumer la kinect). |
|
|
268 |
Switch.Content = "ON"; |
|
|
269 |
//On remet à zéro tous les éléments du retour visuel. |
|
|
270 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
271 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
272 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
273 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
274 |
DistanceLbl.Content = "Distance :"; |
|
|
275 |
LeftHand.Background = System.Windows.Media.Brushes.DarkGray; |
|
|
276 |
LeftHand.Content = ""; |
|
|
277 |
RightHand.Background = System.Windows.Media.Brushes.DarkGray; |
|
|
278 |
RightHand.Content = ""; |
|
|
279 |
DebugCanvas.Children.RemoveRange(1, DebugCanvas.Children.Count - 1); |
|
|
280 |
} |
|
|
281 |
} |
|
|
282 |
|
|
|
283 |
/* |
|
|
284 |
* Récupère le flux video et met à jour le rendu visuel de debug. |
|
|
285 |
*/ |
|
|
286 |
public void RefreshVideo(AllFramesReadyEventArgs e) |
|
|
287 |
{ |
|
|
288 |
if (refreshImage) |
|
|
289 |
{ |
|
|
290 |
bool receivedData = false; |
|
|
291 |
ColorImageFrame colorImageFrameData; |
|
|
292 |
using (colorImageFrameData = e.OpenColorImageFrame()) |
|
|
293 |
{ |
|
|
294 |
//Si on ne reçoit pas de trames de la kinect. |
|
|
295 |
if (colorImageFrameData == null) |
|
|
296 |
{ |
|
|
297 |
//L'image est supprimée. |
|
|
298 |
DebugImage.Source = null; |
|
|
299 |
} |
|
|
300 |
//Si le tableau stockant l'image en cours est nul. |
|
|
301 |
if (colorPixelData == null) |
|
|
302 |
//On alloue un nouveau tableau. |
|
|
303 |
colorPixelData = new byte[colorImageFrameData.PixelDataLength]; |
|
|
304 |
else |
|
|
305 |
{ |
|
|
306 |
try |
|
|
307 |
{ |
|
|
308 |
//Sinon on met à jour le tableau en copiant le contenu de la trame dans le tableau. |
|
|
309 |
colorImageFrameData.CopyPixelDataTo(colorPixelData); |
|
|
310 |
receivedData = true; |
|
|
311 |
} |
|
|
312 |
catch (Exception) { } |
|
|
313 |
} |
|
|
314 |
} |
|
|
315 |
//Si on a des données dans le tableau et que la kinect est allumée. |
|
|
316 |
if (receivedData && on) |
|
|
317 |
{ |
|
|
318 |
//On met à jour l'image de la caméra. |
|
|
319 |
DebugImage.Source = BitmapSource.Create(colorImageFrameData.Width, colorImageFrameData.Height, 96, 96, PixelFormats.Bgr32, null, colorPixelData, colorImageFrameData.Width * colorImageFrameData.BytesPerPixel); |
|
|
320 |
DebugImage.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; |
|
|
321 |
DebugImage.VerticalAlignment = System.Windows.VerticalAlignment.Center; |
|
|
322 |
DebugImage.Stretch = Stretch.Fill; |
|
|
323 |
//On annule l'image associée aux gestures. |
|
|
324 |
Gestures.Source = null; |
|
|
325 |
} |
|
|
326 |
} |
|
|
327 |
} |
|
|
328 |
|
|
|
329 |
/* |
|
|
330 |
* Affiche la distance de l'utilisateur dans le rendu visuel. |
|
|
331 |
* Sous forme de nombre en m et de rectangles changeant de couleur en fonction de la distance. |
|
|
332 |
*/ |
|
|
333 |
public void showDistance(float proximity) |
|
|
334 |
{ |
|
|
335 |
DistanceLbl.Content = "Proximity : " + proximity + "%"; |
|
|
336 |
|
|
|
337 |
if (proximity == 0) |
|
|
338 |
{ |
|
|
339 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
340 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
341 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
342 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
343 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
344 |
R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
345 |
R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
346 |
R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
347 |
R8.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
348 |
R9.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
349 |
R10.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
350 |
} |
|
|
351 |
else if (proximity > 0 && proximity < 10) |
|
|
352 |
{ |
|
|
353 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
354 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
355 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
356 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
357 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
358 |
R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
359 |
R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
360 |
R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
361 |
R8.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
362 |
R9.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
363 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
364 |
} |
|
|
365 |
else if (proximity > 10 && proximity < 20) |
|
|
366 |
{ |
|
|
367 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
368 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
369 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
370 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
371 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
372 |
R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
373 |
R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
374 |
R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
375 |
R8.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
376 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
377 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
378 |
} |
|
|
379 |
else if (proximity > 20 && proximity < 30) |
|
|
380 |
{ |
|
|
381 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
382 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
383 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
384 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
385 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
386 |
R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
387 |
R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
388 |
R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
389 |
R8.Fill = System.Windows.Media.Brushes.Red; |
|
|
390 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
391 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
392 |
} |
|
|
393 |
else if (proximity > 30 && proximity < 40) |
|
|
394 |
{ |
|
|
395 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
396 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
397 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
398 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
399 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
400 |
R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
401 |
R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
402 |
R7.Fill = System.Windows.Media.Brushes.Orange; |
|
|
403 |
R8.Fill = System.Windows.Media.Brushes.Red; |
|
|
404 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
405 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
406 |
} |
|
|
407 |
else if (proximity > 40 && proximity < 50) |
|
|
408 |
{ |
|
|
409 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
410 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
411 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
412 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
413 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
414 |
R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
415 |
R6.Fill = System.Windows.Media.Brushes.Orange; |
|
|
416 |
R7.Fill = System.Windows.Media.Brushes.Orange; |
|
|
417 |
R8.Fill = System.Windows.Media.Brushes.Red; |
|
|
418 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
419 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
420 |
} |
|
|
421 |
else if (proximity > 50 && proximity < 60) |
|
|
422 |
{ |
|
|
423 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
424 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
425 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
426 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
427 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
428 |
R5.Fill = System.Windows.Media.Brushes.Orange; |
|
|
429 |
R6.Fill = System.Windows.Media.Brushes.Orange; |
|
|
430 |
R7.Fill = System.Windows.Media.Brushes.Orange; |
|
|
431 |
R8.Fill = System.Windows.Media.Brushes.Red; |
|
|
432 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
433 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
434 |
} |
|
|
435 |
else if (proximity > 60 && proximity < 70) |
|
|
436 |
{ |
|
|
437 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
438 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
439 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
440 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
441 |
R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
442 |
R5.Fill = System.Windows.Media.Brushes.Orange; |
|
|
443 |
R6.Fill = System.Windows.Media.Brushes.Orange; |
|
|
444 |
R7.Fill = System.Windows.Media.Brushes.Orange; |
|
|
445 |
R8.Fill = System.Windows.Media.Brushes.Red; |
|
|
446 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
447 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
448 |
} |
|
|
449 |
else if (proximity > 70 && proximity < 80) |
|
|
450 |
{ |
|
|
451 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
452 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
453 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
454 |
R3.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
455 |
R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
456 |
R5.Fill = System.Windows.Media.Brushes.Orange; |
|
|
457 |
R6.Fill = System.Windows.Media.Brushes.Orange; |
|
|
458 |
R7.Fill = System.Windows.Media.Brushes.Orange; |
|
|
459 |
R8.Fill = System.Windows.Media.Brushes.Red; |
|
|
460 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
461 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
462 |
} |
|
|
463 |
else if (proximity > 80 && proximity < 90) |
|
|
464 |
{ |
|
|
465 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
466 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
467 |
R2.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
468 |
R3.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
469 |
R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
470 |
R5.Fill = System.Windows.Media.Brushes.Orange; |
|
|
471 |
R6.Fill = System.Windows.Media.Brushes.Orange; |
|
|
472 |
R7.Fill = System.Windows.Media.Brushes.Orange; |
|
|
473 |
R8.Fill = System.Windows.Media.Brushes.Red; |
|
|
474 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
475 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
476 |
} |
|
|
477 |
else if (proximity > 90 && proximity < 100) |
|
|
478 |
{ |
|
|
479 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
480 |
R1.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
481 |
R2.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
482 |
R3.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
483 |
R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
484 |
R5.Fill = System.Windows.Media.Brushes.Orange; |
|
|
485 |
R6.Fill = System.Windows.Media.Brushes.Orange; |
|
|
486 |
R7.Fill = System.Windows.Media.Brushes.Orange; |
|
|
487 |
R8.Fill = System.Windows.Media.Brushes.Red; |
|
|
488 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
489 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
490 |
} |
|
|
491 |
else if (proximity == 100) |
|
|
492 |
{ |
|
|
493 |
R0.Fill = System.Windows.Media.Brushes.Green; |
|
|
494 |
R1.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
495 |
R2.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
496 |
R3.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
497 |
R4.Fill = System.Windows.Media.Brushes.Yellow; |
|
|
498 |
R5.Fill = System.Windows.Media.Brushes.Orange; |
|
|
499 |
R6.Fill = System.Windows.Media.Brushes.Orange; |
|
|
500 |
R7.Fill = System.Windows.Media.Brushes.Orange; |
|
|
501 |
R8.Fill = System.Windows.Media.Brushes.Red; |
|
|
502 |
R9.Fill = System.Windows.Media.Brushes.Red; |
|
|
503 |
R10.Fill = System.Windows.Media.Brushes.Red; |
|
|
504 |
} |
|
|
505 |
} |
|
|
506 |
|
|
|
507 |
/* |
|
|
508 |
* Affiche la détection de la main droite via un label. |
|
|
509 |
*/ |
|
|
510 |
public void showRightHandRect(bool show) |
|
|
511 |
{ |
|
|
512 |
if (show) |
|
|
513 |
RightHand.Background = System.Windows.Media.Brushes.Blue; |
|
|
514 |
else |
|
|
515 |
RightHand.Background = System.Windows.Media.Brushes.DarkGray; |
|
|
516 |
} |
|
|
517 |
|
|
|
518 |
/* |
|
|
519 |
* Affiche la détection de la main gauche via un label. |
|
|
520 |
*/ |
|
|
521 |
public void showLeftHandRect(bool show) |
|
|
522 |
{ |
|
|
523 |
if (show) |
|
|
524 |
LeftHand.Background = System.Windows.Media.Brushes.Blue; |
|
|
525 |
else |
|
|
526 |
LeftHand.Background = System.Windows.Media.Brushes.DarkGray; |
|
|
527 |
} |
|
|
528 |
|
|
|
529 |
/* |
|
|
530 |
* Dessine les noeuds du squelette dans le rendu visuel. |
|
|
531 |
*/ |
|
|
532 |
public void drawJoints(JointCollection joints, Skeleton first) |
|
|
533 |
{ |
|
|
534 |
if (refreshImage) |
|
|
535 |
{ |
|
|
536 |
//On enlève tout élément du Canvas à part l'image, de manière à mettre à jour la position du squelette. |
|
|
537 |
DebugCanvas.Children.RemoveRange(1, DebugCanvas.Children.Count - 1); |
|
|
538 |
|
|
|
539 |
//Pour chaque noeud. |
|
|
540 |
foreach (Joint joint in first.Joints) |
|
|
541 |
{ |
|
|
542 |
//On crée une ellipse de taille 20 et de largeur 20. |
|
|
543 |
Ellipse node = new Ellipse(); |
|
|
544 |
node.Height = 20; |
|
|
545 |
node.Width = 20; |
|
|
546 |
|
|
|
547 |
//S'il s'agit d'un noeud de tête, on le colorie en rouge, sinon en bleu. |
|
|
548 |
if (joint.JointType == JointType.Head) |
|
|
549 |
node.Fill = System.Windows.Media.Brushes.Red; |
|
|
550 |
else if (joint.JointType == JointType.ShoulderCenter) |
|
|
551 |
node.Fill = System.Windows.Media.Brushes.Green; |
|
|
552 |
else if (joint.JointType == JointType.HipCenter) |
|
|
553 |
node.Fill = System.Windows.Media.Brushes.Green; |
|
|
554 |
else if (joint.JointType == JointType.HandRight) |
|
|
555 |
node.Fill = System.Windows.Media.Brushes.Red; |
|
|
556 |
else |
|
|
557 |
node.Fill = System.Windows.Media.Brushes.Blue; |
|
|
558 |
|
|
|
559 |
//On met à la bonne échelle les coordonnées des positions des noeuds. |
|
|
560 |
Joint scaledJoint = Coding4Fun.Kinect.Wpf.SkeletalExtensions.ScaleTo(joint, 600, 400, 0.75f, 0.75f); |
|
|
561 |
|
|
|
562 |
//On positionne le noeud dans le Canvas, et on l'ajoute. |
|
|
563 |
Canvas.SetLeft(node, scaledJoint.Position.X); |
|
|
564 |
Canvas.SetTop(node, scaledJoint.Position.Y); |
|
|
565 |
DebugCanvas.Children.Add(node); |
|
|
566 |
} |
|
|
567 |
} |
|
|
568 |
} |
|
|
569 |
|
|
|
570 |
/* |
|
|
571 |
* Dessine un os, en ayant en paramètres deux noeuds. |
|
|
572 |
*/ |
|
|
573 |
public void drawBone(Joint j1, Joint j2) |
|
|
574 |
{ |
|
|
575 |
//On crée une nouvelle ligne verte d'épaisseur 8 entre les deux noeuds et on l'ajoute au Canvas. |
|
|
576 |
Line line = new Line(); |
|
|
577 |
line.Stroke = System.Windows.Media.Brushes.Green; |
|
|
578 |
line.X1 = j1.Position.X; |
|
|
579 |
line.X2 = j2.Position.X; |
|
|
580 |
line.Y1 = j1.Position.Y; |
|
|
581 |
line.Y2 = j2.Position.Y; |
|
|
582 |
line.StrokeThickness = 8; |
|
|
583 |
DebugCanvas.Children.Add(line); |
|
|
584 |
} |
|
|
585 |
|
|
|
586 |
/* |
|
|
587 |
* Dessine le squelette (ensemble des os), en ayant en paramètres tous les noeuds. |
|
|
588 |
*/ |
|
|
589 |
public void showSkeleton(Joint hipCenter, Joint spine, Joint shoulderCenter, Joint head, Joint shoulderLeft, Joint elbowLeft, Joint wristLeft, Joint handLeft, Joint shoulderRight, Joint elbowRight, Joint wristRight, Joint handRight, Joint hipLeft, Joint kneeLeft, Joint ankleLeft, Joint footLeft, Joint hipRight, Joint kneeRight, Joint ankleRight, Joint footRight) |
|
|
590 |
{ |
|
|
591 |
if (refreshImage) |
|
|
592 |
{ |
|
|
593 |
//On met les noeuds deux par deux en fonction de leur position dans le squelette. |
|
|
594 |
drawBone(head, shoulderCenter); |
|
|
595 |
drawBone(shoulderCenter, shoulderLeft); |
|
|
596 |
drawBone(shoulderLeft, elbowLeft); |
|
|
597 |
drawBone(elbowLeft, wristLeft); |
|
|
598 |
drawBone(wristLeft, handLeft); |
|
|
599 |
drawBone(shoulderCenter, shoulderRight); |
|
|
600 |
drawBone(shoulderRight, elbowRight); |
|
|
601 |
drawBone(elbowRight, wristRight); |
|
|
602 |
drawBone(wristRight, handRight); |
|
|
603 |
drawBone(shoulderCenter, spine); |
|
|
604 |
drawBone(spine, hipCenter); |
|
|
605 |
drawBone(hipCenter, hipLeft); |
|
|
606 |
drawBone(hipLeft, kneeLeft); |
|
|
607 |
drawBone(kneeLeft, ankleLeft); |
|
|
608 |
drawBone(ankleLeft, footLeft); |
|
|
609 |
drawBone(hipCenter, hipRight); |
|
|
610 |
drawBone(hipRight, kneeRight); |
|
|
611 |
drawBone(kneeRight, ankleRight); |
|
|
612 |
drawBone(ankleRight, footRight); |
|
|
613 |
} |
|
|
614 |
} |
|
|
615 |
|
|
|
616 |
/* |
|
|
617 |
* Cache le squelette et le reste de l'interface à part l'image. |
|
|
618 |
*/ |
|
|
619 |
public void hideSkeleton() |
|
|
620 |
{ |
|
|
621 |
//On vide le canvas mais en gardant l'image. |
|
|
622 |
if(DebugCanvas.Children.Count > 1) |
|
|
623 |
DebugCanvas.Children.RemoveRange(1, DebugCanvas.Children.Count - 1); |
|
|
624 |
//On colore en gris tous les indicateurs. |
|
|
625 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
626 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
627 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
628 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
629 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
630 |
R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
631 |
R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
632 |
R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
633 |
R8.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
634 |
R9.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
635 |
R10.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
636 |
} |
|
|
637 |
|
|
|
638 |
/* |
|
|
639 |
* Affiche la position de la main gauche dans le rendu visuel. |
|
|
640 |
*/ |
|
|
641 |
public void showLeftHandCoord(String coord) |
|
|
642 |
{ |
|
|
643 |
LeftHand.Content = coord; |
|
|
644 |
} |
|
|
645 |
|
|
|
646 |
/* |
|
|
647 |
* Affiche la position de la main gauche dans le rendu visuel. |
|
|
648 |
*/ |
|
|
649 |
public void showRightHandCoord(String coord) |
|
|
650 |
{ |
|
|
651 |
RightHand.Content = coord; |
|
|
652 |
} |
|
|
653 |
|
|
|
654 |
/* |
|
|
655 |
* Méthode associée à l'événement : Quitter via le menu. |
|
|
656 |
*/ |
|
|
657 |
public void Quit_Click(object sender, RoutedEventArgs e) |
|
|
658 |
{ |
|
|
659 |
closing = true; |
|
|
660 |
//On éteint la Kinect (pour éviter qu'elle reste allumée même lorsque le programme est éteint). |
|
|
661 |
|
|
|
662 |
Application.Current.Shutdown(); |
|
|
663 |
} |
|
|
664 |
|
|
|
665 |
/* |
|
|
666 |
* Permet d'initialiser la Kinect dès que la fenêtre est lancée. |
|
|
667 |
*/ |
|
|
668 |
private void Window_Loaded(object sender, RoutedEventArgs e) |
|
|
669 |
{ |
|
|
670 |
//kinectMain.KinectInitialization(); |
|
|
671 |
} |
|
|
672 |
|
|
|
673 |
/* |
|
18
|
674 |
* Permet d'obtenir l'image associée à l'emplacement des images si celle-ci existe. |
|
|
675 |
*/ |
|
|
676 |
public Bitmap getImage(String location) |
|
|
677 |
{ |
|
|
678 |
try |
|
|
679 |
{ |
|
|
680 |
return new Bitmap(location); |
|
|
681 |
} |
|
|
682 |
catch (Exception) |
|
|
683 |
{ |
|
|
684 |
return (Bitmap)rm.GetObject("_404"); |
|
|
685 |
} |
|
|
686 |
} |
|
|
687 |
|
|
|
688 |
/* |
|
15
|
689 |
* Méthode d'affichage des gestures. |
|
|
690 |
*/ |
|
|
691 |
public void showGesture(String gesture) |
|
|
692 |
{ |
|
|
693 |
if (refreshImage) |
|
|
694 |
{ |
|
|
695 |
refreshImage = false; |
|
|
696 |
_timer.Start(); |
|
|
697 |
Bitmap bitmap = null; |
|
|
698 |
//S'il s'agit de telle ou telle gesture, on prend l'image correspondante dans les ressources, |
|
|
699 |
//on la convertit et on l'affiche. |
|
37
|
700 |
|
|
15
|
701 |
switch (gesture) |
|
|
702 |
{ |
|
18
|
703 |
case "SWIPE-LEFT": bitmap = getImage(imgLocation + "\\swipe_left.png"); |
|
15
|
704 |
break; |
|
18
|
705 |
case "SWIPE-RIGHT": bitmap = getImage(imgLocation + "\\swipe_right.png"); |
|
15
|
706 |
break; |
|
18
|
707 |
case "PUSH-RIGHT": bitmap = getImage(imgLocation + "\\push_right.png"); |
|
15
|
708 |
break; |
|
18
|
709 |
case "PUSH-LEFT": bitmap = getImage(imgLocation + "\\push_left.png"); |
|
15
|
710 |
break; |
|
18
|
711 |
case "PUSH-BOTH": bitmap = getImage(imgLocation + "\\push_both.png"); |
|
15
|
712 |
break; |
|
18
|
713 |
case "PULL-RIGHT": bitmap = getImage(imgLocation + "\\pull_right.png"); |
|
15
|
714 |
break; |
|
18
|
715 |
case "PULL-LEFT": bitmap = getImage(imgLocation + "\\pull_left.png"); |
|
15
|
716 |
break; |
|
18
|
717 |
case "PULL-BOTH": bitmap = getImage(imgLocation + "\\pull_both.png"); |
|
15
|
718 |
break; |
|
37
|
719 |
case "WAVE": bitmap = getImage(imgLocation + "\\hello.png"); |
|
17
|
720 |
break; |
|
18
|
721 |
case "BEND": bitmap = getImage(imgLocation + "\\bend.png"); |
|
17
|
722 |
break; |
|
37
|
723 |
case "KNEE-UP": bitmap = getImage(imgLocation + "\\knee_up.png"); |
|
17
|
724 |
break; |
|
37
|
725 |
case "JUMP": bitmap = getImage(imgLocation + "\\jump.png"); |
|
|
726 |
break; |
|
|
727 |
case "FALL": bitmap = getImage(imgLocation + "\\fall.png"); |
|
17
|
728 |
break; |
|
15
|
729 |
} |
|
|
730 |
Gestures.Source = CreateBitmapSourceFromBitmap(bitmap); |
|
|
731 |
} |
|
|
732 |
|
|
|
733 |
DebugImage.Source = null; |
|
|
734 |
hideSkeleton(); |
|
|
735 |
} |
|
|
736 |
|
|
|
737 |
/* |
|
|
738 |
* Méthode d'indication de raffraichissement de l'image ("on la raffraichit ou pas ?"). |
|
|
739 |
*/ |
|
|
740 |
public void setRefreshImage(bool refresh) |
|
|
741 |
{ |
|
|
742 |
refreshImage = refresh; |
|
|
743 |
} |
|
|
744 |
|
|
|
745 |
/* |
|
|
746 |
* Méthode de conversion de Bitmap (des ressources) en BitmapSource (du debug). |
|
|
747 |
*/ |
|
|
748 |
public static BitmapSource CreateBitmapSourceFromBitmap(Bitmap bitmap) |
|
|
749 |
{ |
|
|
750 |
if (bitmap == null) |
|
|
751 |
return null; |
|
|
752 |
|
|
|
753 |
return System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap( |
|
|
754 |
bitmap.GetHbitmap(), |
|
|
755 |
IntPtr.Zero, |
|
|
756 |
Int32Rect.Empty, |
|
|
757 |
BitmapSizeOptions.FromEmptyOptions()); |
|
|
758 |
} |
|
|
759 |
|
|
|
760 |
/* |
|
41
|
761 |
* Méthode de chargement des paramètres via le fichier de configuration. |
|
|
762 |
*/ |
|
37
|
763 |
public bool loadParameters() |
|
|
764 |
{ |
|
|
765 |
try |
|
|
766 |
{ |
|
41
|
767 |
//On lit le fichier de config. |
|
37
|
768 |
String[] lines = System.IO.File.ReadAllLines("config.txt"); |
|
|
769 |
|
|
41
|
770 |
//On repère les paramètres supposés être des int ou float de manière à les parser. |
|
|
771 |
String[] ints = { "tuioConnexionPort", "wsConnexionPort", "takenPoints", "tuioTimerElapsing", "wsTimerElapsing", "directionChangeTresholdXY", "imagesToShow" }; |
|
|
772 |
String[] floats = { "minDistHands", "minDist", "maxDistHands", "maxDist", "zeroPoint", "directionChangeTresholdZ" }; |
|
|
773 |
|
|
|
774 |
//Indique si on a affecté le paramètre actuel. |
|
|
775 |
bool goToNextParam = false; |
|
|
776 |
|
|
|
777 |
//Pour chaque ligne du fichier de config. |
|
|
778 |
for (int i = 0 ; i < lines.Length ; i++) |
|
|
779 |
{ |
|
|
780 |
//On récupère la clé et la valeur. |
|
|
781 |
String key = lines[i].Split(':')[0]; |
|
49
|
782 |
int keyLength = key.Length; |
|
|
783 |
String value = lines[i].Substring((keyLength + 1), (lines[i].Length - keyLength - 1)); |
|
|
784 |
//String value = lines[i].Substring(keyLength, lines[i].Length - keyLength - 1); |
|
|
785 |
|
|
|
786 |
Console.WriteLine("PARAMS ======= " + key + " " + value); |
|
41
|
787 |
|
|
|
788 |
//Si c'est un int on le parse. |
|
|
789 |
for (int j = 0 ; j < ints.Length ; j++) |
|
|
790 |
{ |
|
|
791 |
if (ints[j] == key) |
|
|
792 |
{ |
|
|
793 |
config.Add(key, int.Parse(value)); |
|
|
794 |
goToNextParam = true; |
|
|
795 |
} |
|
|
796 |
} |
|
|
797 |
|
|
|
798 |
//Si il n'était pas un int. |
|
|
799 |
if (!goToNextParam) |
|
|
800 |
{ |
|
|
801 |
//Si c'est un float on le parse. |
|
|
802 |
for (int j = 0; j < floats.Length; j++) |
|
|
803 |
{ |
|
|
804 |
if (floats[j] == key) |
|
|
805 |
{ |
|
|
806 |
config.Add(key, float.Parse(value)); |
|
|
807 |
goToNextParam = true; |
|
|
808 |
} |
|
|
809 |
} |
|
|
810 |
|
|
|
811 |
//Si c'était en fait un string. |
|
|
812 |
if (!goToNextParam) |
|
|
813 |
{ |
|
|
814 |
config.Add(key, value); |
|
|
815 |
} |
|
|
816 |
} |
|
|
817 |
goToNextParam = false; |
|
|
818 |
} |
|
37
|
819 |
} |
|
41
|
820 |
//S'il s'est passé un problème durant la lecture du fichier de config. |
|
37
|
821 |
catch (Exception e) |
|
|
822 |
{ |
|
41
|
823 |
//On génère un fichier qui va afficher l'erreur. |
|
37
|
824 |
StreamWriter SW; |
|
|
825 |
try |
|
|
826 |
{ |
|
|
827 |
SW = File.CreateText("ErrorFile.txt"); |
|
|
828 |
SW.WriteLine(e.Message); |
|
|
829 |
SW.Close(); |
|
|
830 |
} |
|
|
831 |
catch { } |
|
|
832 |
|
|
|
833 |
return false; |
|
|
834 |
} |
|
|
835 |
|
|
41
|
836 |
//Si l'extraction s'est bien passé mais que les paramètres sont incohérents. |
|
|
837 |
if ((float)config["maxDistHands"] <= 0f || (float)config["minDistHands"] <= 0f || (float)config["maxDistHands"] > (float)config["maxDist"] || (float)config["minDistHands"] > (float)config["maxDist"] || |
|
|
838 |
(float)config["minDistHands"] >= (float)config["maxDistHands"] || (float)config["zeroPoint"] < (float)config["maxDistHands"] || (float)config["minDistHands"] > (float)config["minDist"] || |
|
|
839 |
(float)config["zeroPoint"] >= (float)config["maxDist"] || (int)config["tuioConnexionPort"] < 0 || (int)config["wsConnexionPort"] < 0 || (int)config["tuioTimerElapsing"] < 0 || (int)config["wsTimerElapsing"] < 0 || (int)config["imagesToShow"] < 1 || |
|
|
840 |
(int)config["takenPoints"] <= 0 || (int)config["directionChangeTresholdXY"] < 0 || (float)config["directionChangeTresholdZ"] < 0) |
|
37
|
841 |
{ |
|
|
842 |
ExceptionLbl.Content = rm.GetString("loadParametersIncorrect"); |
|
|
843 |
|
|
|
844 |
StreamWriter SW; |
|
|
845 |
try |
|
|
846 |
{ |
|
41
|
847 |
//On indique les incohérences trouvées dans le fichier. |
|
37
|
848 |
SW = File.CreateText("ErrorFile.txt"); |
|
41
|
849 |
if ((float)config["maxDistHands"] <= 0f) { SW.WriteLine("searchMaxDistance <= 0"); } |
|
|
850 |
if ((float)config["minDistHands"] <= 0f) { SW.WriteLine("minDistance <= 0"); } |
|
|
851 |
if ((float)config["maxDistHands"] > (float)config["maxDist"]) { SW.WriteLine("searchMaxDistance > maxDistance"); } |
|
|
852 |
if ((float)config["minDistHands"] > (float)config["maxDist"]) { SW.WriteLine("searchMinDistance > maxDistance"); } |
|
|
853 |
if ((float)config["minDistHands"] >= (float)config["maxDistHands"]) { SW.WriteLine("searchMinDistance >= searchMaxDistance"); } |
|
|
854 |
if ((float)config["zeroPoint"] < (float)config["maxDistHands"]) { SW.WriteLine("zeroPoint < searchMaxDistance"); } |
|
|
855 |
if ((float)config["minDistHands"] > (float)config["minDist"]) { SW.WriteLine("searchMinDistance > minDistance"); } |
|
|
856 |
if ((float)config["zeroPoint"] >= (float)config["maxDist"]) { SW.WriteLine("zeroPoint >= maxDistance"); } |
|
|
857 |
if ((int)config["tuioConnexionPort"] < 0) { SW.WriteLine("tuioConnexionPort < 0"); } |
|
|
858 |
if ((int)config["wsConnexionPort"] < 0) { SW.WriteLine("wsConnexionPort < 0"); } |
|
|
859 |
if ((int)config["tuioTimerElapsing"] < 0) { SW.WriteLine("tuioTimerElapsing < 0"); } |
|
|
860 |
if ((int)config["wsTimerElapsing"] < 0) { SW.WriteLine("wsTimerElapsing < 0"); } |
|
|
861 |
if ((int)config["imagesToShow"] < 1) { SW.WriteLine("imagesToShow < 1"); } |
|
|
862 |
if ((int)config["takenPoints"] <= 0) { SW.WriteLine("takenPoints <= 0"); } |
|
|
863 |
if ((int)config["directionChangeTresholdXY"] < 0) { SW.WriteLine("directionChangeTresholdXY < 0"); } |
|
|
864 |
if ((float)config["directionChangeTresholdZ"] < 0) { SW.WriteLine("directionChangeTresholdZ < 0"); } |
|
37
|
865 |
SW.Close(); |
|
|
866 |
Console.WriteLine("Error File Created SucacessFully"); |
|
|
867 |
} |
|
|
868 |
catch (Exception){} |
|
|
869 |
|
|
|
870 |
return false; |
|
|
871 |
} |
|
|
872 |
return true; |
|
15
|
873 |
} |
|
|
874 |
|
|
|
875 |
/* |
|
|
876 |
* Getters et setters des paramètres du Middleware. |
|
|
877 |
*/ |
|
|
878 |
public void setMinDistHands(float min) |
|
|
879 |
{ |
|
41
|
880 |
config["minDistHands"] = min; |
|
15
|
881 |
} |
|
|
882 |
public void setMaxDistHands(float max) |
|
|
883 |
{ |
|
41
|
884 |
config["maxDistHands"] = max; |
|
15
|
885 |
} |
|
|
886 |
public void setMinDist(float min) |
|
|
887 |
{ |
|
41
|
888 |
config["minDist"] = min; |
|
15
|
889 |
} |
|
|
890 |
public void setMaxDist(float max) |
|
|
891 |
{ |
|
41
|
892 |
config["maxDist"] = max; |
|
15
|
893 |
} |
|
|
894 |
public void setZeroPoint(float zero) |
|
|
895 |
{ |
|
41
|
896 |
config["zeroPoint"] = zero; |
|
15
|
897 |
} |
|
41
|
898 |
public void setTuioConnexionHost(String host) |
|
15
|
899 |
{ |
|
41
|
900 |
config["tuioConnexionHost"] = host; |
|
|
901 |
} |
|
|
902 |
public void setTuioConnexionPort(int port) |
|
|
903 |
{ |
|
|
904 |
config["tuioConnexionPort"] = port; |
|
15
|
905 |
} |
|
41
|
906 |
public void setWsConnexionHost(String host) |
|
15
|
907 |
{ |
|
41
|
908 |
config["wsConnexionHost"] = host; |
|
|
909 |
} |
|
|
910 |
public void setWsConnexionPort(int port) |
|
|
911 |
{ |
|
|
912 |
config["wsConnexionPort"] = port; |
|
15
|
913 |
} |
|
41
|
914 |
public void setTuioTimerElapsing(int time) |
|
15
|
915 |
{ |
|
41
|
916 |
config["tuioTimerElapsing"] = time; |
|
|
917 |
} |
|
|
918 |
public void setWsTimerElapsing(int time) |
|
|
919 |
{ |
|
|
920 |
config["wsTimerElapsing"] = time; |
|
15
|
921 |
} |
|
|
922 |
public void setImagesToShow(int _imagesToShow) |
|
|
923 |
{ |
|
41
|
924 |
config["imagesToShow"] = _imagesToShow; |
|
15
|
925 |
} |
|
|
926 |
public void setTakenPoints(int _takenPoints) |
|
|
927 |
{ |
|
41
|
928 |
config["takenPoints"] = _takenPoints; |
|
15
|
929 |
} |
|
|
930 |
public void setDirectionChangeTresholdXY(int _directionChangeTresholdXY) |
|
|
931 |
{ |
|
41
|
932 |
config["directionChangeTresholdXY"] = _directionChangeTresholdXY; |
|
15
|
933 |
} |
|
|
934 |
public void setDirectionChangeTresholdZ(float _directionChangeTresholdZ) |
|
|
935 |
{ |
|
41
|
936 |
config["directionChangeTresholdZ"] = _directionChangeTresholdZ; |
|
15
|
937 |
} |
|
|
938 |
public void setSwitch(Button _switch) |
|
|
939 |
{ |
|
|
940 |
Switch = _switch; |
|
|
941 |
} |
|
|
942 |
public void setOn(bool _on) |
|
|
943 |
{ |
|
|
944 |
on = _on; |
|
|
945 |
} |
|
41
|
946 |
|
|
15
|
947 |
public float getMinDistHands() |
|
|
948 |
{ |
|
41
|
949 |
return (float)config["minDistHands"]; |
|
15
|
950 |
} |
|
|
951 |
public float getMaxDistHands() |
|
|
952 |
{ |
|
41
|
953 |
return (float)config["maxDistHands"]; |
|
15
|
954 |
} |
|
|
955 |
public float getMinDist() |
|
|
956 |
{ |
|
41
|
957 |
return (float)config["minDist"]; |
|
15
|
958 |
} |
|
|
959 |
public float getMaxDist() |
|
|
960 |
{ |
|
41
|
961 |
return (float)config["maxDist"]; |
|
15
|
962 |
} |
|
|
963 |
public float getZeroPoint() |
|
|
964 |
{ |
|
41
|
965 |
return (float)config["zeroPoint"]; |
|
15
|
966 |
} |
|
41
|
967 |
public String getTuioConnexionHost() |
|
15
|
968 |
{ |
|
41
|
969 |
return (String)config["tuioConnexionHost"]; |
|
|
970 |
} |
|
|
971 |
public int getTuioConnexionPort() |
|
|
972 |
{ |
|
|
973 |
return (int)config["tuioConnexionPort"]; |
|
15
|
974 |
} |
|
41
|
975 |
public int getTuioTimerElapsing() |
|
15
|
976 |
{ |
|
41
|
977 |
return (int)config["tuioTimerElapsing"]; |
|
|
978 |
} |
|
|
979 |
public String getWsConnexionHost() |
|
|
980 |
{ |
|
|
981 |
return (String)config["wsConnexionHost"]; |
|
15
|
982 |
} |
|
41
|
983 |
public int getWsConnexionPort() |
|
15
|
984 |
{ |
|
41
|
985 |
return (int)config["wsConnexionPort"]; |
|
|
986 |
} |
|
|
987 |
public int getWsTimerElapsing() |
|
|
988 |
{ |
|
|
989 |
return (int)config["wsTimerElapsing"]; |
|
15
|
990 |
} |
|
|
991 |
public int getImagesToShow() |
|
|
992 |
{ |
|
41
|
993 |
return (int)config["imagesToShow"]; |
|
15
|
994 |
} |
|
|
995 |
public int getTakenPoints() |
|
|
996 |
{ |
|
41
|
997 |
return (int)config["takenPoints"]; |
|
15
|
998 |
} |
|
|
999 |
public int getDirectionChangeTresholdXY() |
|
|
1000 |
{ |
|
41
|
1001 |
return (int)config["directionChangeTresholdXY"]; |
|
15
|
1002 |
} |
|
|
1003 |
public float getDirectionChangeTresholdZ() |
|
|
1004 |
{ |
|
41
|
1005 |
return (float)config["directionChangeTresholdZ"]; |
|
15
|
1006 |
} |
|
|
1007 |
public Button getSwitch() |
|
|
1008 |
{ |
|
|
1009 |
return Switch; |
|
|
1010 |
} |
|
49
|
1011 |
public MenuItem getQuitMenu() |
|
|
1012 |
{ |
|
|
1013 |
return QuitMenu; |
|
|
1014 |
} |
|
|
1015 |
|
|
15
|
1016 |
public bool getOn() |
|
|
1017 |
{ |
|
|
1018 |
return on; |
|
|
1019 |
} |
|
17
|
1020 |
|
|
|
1021 |
public void onR0(bool b) |
|
|
1022 |
{ |
|
|
1023 |
if(b) |
|
|
1024 |
R0.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1025 |
else |
|
|
1026 |
R0.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1027 |
} |
|
|
1028 |
public void onR1(bool b) |
|
|
1029 |
{ |
|
|
1030 |
if (b) |
|
|
1031 |
R1.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1032 |
else |
|
|
1033 |
R1.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1034 |
} |
|
|
1035 |
public void onR2(bool b) |
|
|
1036 |
{ |
|
|
1037 |
if (b) |
|
|
1038 |
R2.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1039 |
else |
|
|
1040 |
R2.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1041 |
} |
|
|
1042 |
public void onR3(bool b) |
|
|
1043 |
{ |
|
|
1044 |
if (b) |
|
|
1045 |
R3.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1046 |
else |
|
|
1047 |
R3.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1048 |
} |
|
|
1049 |
public void onR4(bool b) |
|
|
1050 |
{ |
|
|
1051 |
if (b) |
|
|
1052 |
R4.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1053 |
else |
|
|
1054 |
R4.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1055 |
} |
|
|
1056 |
public void onR5(bool b) |
|
|
1057 |
{ |
|
|
1058 |
if (b) |
|
|
1059 |
R5.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1060 |
else |
|
|
1061 |
R5.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1062 |
} |
|
|
1063 |
public void onR6(bool b) |
|
|
1064 |
{ |
|
|
1065 |
if (b) |
|
|
1066 |
R6.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1067 |
else |
|
|
1068 |
R6.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1069 |
} |
|
|
1070 |
public void onR7(bool b) |
|
|
1071 |
{ |
|
|
1072 |
if (b) |
|
|
1073 |
R7.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1074 |
else |
|
|
1075 |
R7.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1076 |
} |
|
|
1077 |
public void onR8(bool b) |
|
|
1078 |
{ |
|
|
1079 |
if (b) |
|
|
1080 |
R8.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1081 |
else |
|
|
1082 |
R8.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1083 |
} |
|
|
1084 |
public void onR9(bool b) |
|
|
1085 |
{ |
|
|
1086 |
if (b) |
|
|
1087 |
R9.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1088 |
else |
|
|
1089 |
R9.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1090 |
} |
|
|
1091 |
public void onR10(bool b) |
|
|
1092 |
{ |
|
|
1093 |
if (b) |
|
|
1094 |
R10.Fill = System.Windows.Media.Brushes.Blue; |
|
|
1095 |
else |
|
|
1096 |
R10.Fill = System.Windows.Media.Brushes.DarkGray; |
|
|
1097 |
} |
|
49
|
1098 |
|
|
|
1099 |
/* |
|
|
1100 |
* Ouvre un fichier selon son chemin. |
|
|
1101 |
*/ |
|
|
1102 |
public void OpenFile(String filePath) |
|
|
1103 |
{ |
|
|
1104 |
try |
|
|
1105 |
{ |
|
|
1106 |
System.Diagnostics.Process.Start(@filePath); |
|
|
1107 |
} |
|
|
1108 |
catch (Exception) |
|
|
1109 |
{ |
|
|
1110 |
ExceptionLbl.Content = filePath + " : " + rm.GetString("fileNotFound"); |
|
|
1111 |
} |
|
|
1112 |
} |
|
|
1113 |
|
|
|
1114 |
public void OpenFile(String program, String filePath) |
|
|
1115 |
{ |
|
|
1116 |
try |
|
|
1117 |
{ |
|
|
1118 |
System.Diagnostics.Process.Start(program, @filePath); |
|
|
1119 |
} |
|
|
1120 |
catch (Exception) |
|
|
1121 |
{ |
|
|
1122 |
ExceptionLbl.Content = filePath + " : " + rm.GetString("fileNotFound"); |
|
|
1123 |
} |
|
|
1124 |
} |
|
|
1125 |
|
|
|
1126 |
/* |
|
|
1127 |
* Ouvre le readme du Middleware. |
|
|
1128 |
*/ |
|
|
1129 |
private void MiddlewareReadmeMenu_Click(object sender, RoutedEventArgs e) |
|
|
1130 |
{ |
|
|
1131 |
OpenFile((String)config["readmeMiddleware"]); |
|
|
1132 |
} |
|
|
1133 |
|
|
|
1134 |
/* |
|
|
1135 |
* Ouvre le readme du Front Processing. |
|
|
1136 |
*/ |
|
|
1137 |
private void FrontProcessingReadmeMenu_Click(object sender, RoutedEventArgs e) |
|
|
1138 |
{ |
|
|
1139 |
OpenFile((String)config["readmeFrontProcessing"]); |
|
|
1140 |
} |
|
|
1141 |
|
|
|
1142 |
/* |
|
|
1143 |
* Ouvre la documentation du Front Processing. |
|
|
1144 |
*/ |
|
|
1145 |
private void FrontProcessingDocumentationMenu_Click(object sender, RoutedEventArgs e) |
|
|
1146 |
{ |
|
|
1147 |
OpenFile((String)config["docFrontProcessing"]); |
|
|
1148 |
} |
|
|
1149 |
|
|
|
1150 |
/* |
|
|
1151 |
* Ouvre le readme du Front JS. |
|
|
1152 |
*/ |
|
|
1153 |
private void FrontJSReadmeMenu_Click(object sender, RoutedEventArgs e) |
|
|
1154 |
{ |
|
|
1155 |
OpenFile((String)config["readmeFrontJS"]); |
|
|
1156 |
} |
|
|
1157 |
|
|
|
1158 |
/* |
|
|
1159 |
* Ouvre la documentation du Front JS. |
|
|
1160 |
*/ |
|
|
1161 |
private void FrontJSDocumentationMenu_Click(object sender, RoutedEventArgs e) |
|
|
1162 |
{ |
|
|
1163 |
OpenFile((String)config["docFrontJS"]); |
|
|
1164 |
} |
|
|
1165 |
|
|
|
1166 |
/* |
|
|
1167 |
* Ouvre le fichier des paramètres. |
|
|
1168 |
*/ |
|
|
1169 |
private void ParamMenu_Click(object sender, RoutedEventArgs e) |
|
|
1170 |
{ |
|
|
1171 |
OpenFile(".\\config.txt"); |
|
|
1172 |
} |
|
|
1173 |
|
|
|
1174 |
/* |
|
|
1175 |
* Code de l'exemple processing de manipulation de fluide. |
|
|
1176 |
*/ |
|
|
1177 |
private void ProcessingMenuFMPS_Click(object sender, RoutedEventArgs e) |
|
|
1178 |
{ |
|
|
1179 |
OpenFile((String)config["exPFMPS"]); |
|
|
1180 |
} |
|
|
1181 |
|
|
|
1182 |
//Exemple processing de manipulation de fluide. |
|
|
1183 |
private void ProcessingMenuFMExe_Click(object sender, RoutedEventArgs e) |
|
|
1184 |
{ |
|
|
1185 |
OpenFile((String)config["exPFMExe"]); |
|
|
1186 |
} |
|
|
1187 |
|
|
|
1188 |
/* |
|
|
1189 |
* Code de l'exemple processing de manipulation de fumée. |
|
|
1190 |
*/ |
|
|
1191 |
private void ProcessingMenuSMPS_Click(object sender, RoutedEventArgs e) |
|
|
1192 |
{ |
|
|
1193 |
OpenFile((String)config["exPSMPS"]); |
|
|
1194 |
} |
|
|
1195 |
|
|
|
1196 |
/* |
|
|
1197 |
* Exemple processing de manipulation de fumée. |
|
|
1198 |
*/ |
|
|
1199 |
private void ProcessingMenuSMExe_Click(object sender, RoutedEventArgs e) |
|
|
1200 |
{ |
|
|
1201 |
OpenFile((String)config["exPSMExe"]); |
|
|
1202 |
} |
|
|
1203 |
|
|
|
1204 |
/* |
|
|
1205 |
* Code de l'exemple processing d'affichage des gestures. |
|
|
1206 |
*/ |
|
|
1207 |
private void ProcessingMenuTGPS_Click(object sender, RoutedEventArgs e) |
|
|
1208 |
{ |
|
|
1209 |
OpenFile((String)config["exPTGPS"]); |
|
|
1210 |
} |
|
|
1211 |
|
|
|
1212 |
/* |
|
|
1213 |
* Exemple processing d'affichage des gestures. |
|
|
1214 |
*/ |
|
|
1215 |
private void ProcessingMenuTGExe_Click(object sender, RoutedEventArgs e) |
|
|
1216 |
{ |
|
|
1217 |
OpenFile((String)config["exPTGExe"]); |
|
|
1218 |
} |
|
|
1219 |
|
|
|
1220 |
/* |
|
|
1221 |
* Code de l'exemple processing d'affichage des pointeurs. |
|
|
1222 |
*/ |
|
|
1223 |
private void ProcessingMenuTPS_Click(object sender, RoutedEventArgs e) |
|
|
1224 |
{ |
|
|
1225 |
OpenFile((String)config["exPTPS"]); |
|
|
1226 |
} |
|
|
1227 |
|
|
|
1228 |
/* |
|
|
1229 |
* Exemple processing d'affichage des pointeurs. |
|
|
1230 |
*/ |
|
|
1231 |
private void ProcessingMenuTExe_Click(object sender, RoutedEventArgs e) |
|
|
1232 |
{ |
|
|
1233 |
OpenFile((String)config["exPTExe"]); |
|
|
1234 |
} |
|
|
1235 |
|
|
|
1236 |
/* |
|
|
1237 |
* Code de l'exemple processing du press de la main. |
|
|
1238 |
*/ |
|
|
1239 |
private void ProcessingMenuIEHandPressPS_Click(object sender, RoutedEventArgs e) |
|
|
1240 |
{ |
|
|
1241 |
OpenFile((String)config["exPIEHandPressPS"]); |
|
|
1242 |
} |
|
|
1243 |
|
|
|
1244 |
/* |
|
|
1245 |
* Exemple processing du press de la main. |
|
|
1246 |
*/ |
|
|
1247 |
private void ProcessingMenuIEHandPressExe_Click(object sender, RoutedEventArgs e) |
|
|
1248 |
{ |
|
|
1249 |
OpenFile((String)config["exPIEHandPressExe"]); |
|
|
1250 |
} |
|
|
1251 |
|
|
|
1252 |
/* |
|
|
1253 |
* Code de l'exemple processing du signal de la main. |
|
|
1254 |
*/ |
|
|
1255 |
private void ProcessingMenuIEHandSignalPS_Click(object sender, RoutedEventArgs e) |
|
|
1256 |
{ |
|
|
1257 |
OpenFile((String)config["exPIEHandSignalPS"]); |
|
|
1258 |
} |
|
|
1259 |
|
|
|
1260 |
/* |
|
|
1261 |
* Exemple processing du signal de la main. |
|
|
1262 |
*/ |
|
|
1263 |
private void ProcessingMenuIEHandSignalExe_Click(object sender, RoutedEventArgs e) |
|
|
1264 |
{ |
|
|
1265 |
OpenFile((String)config["exPIEHandSignalExe"]); |
|
|
1266 |
} |
|
|
1267 |
|
|
|
1268 |
/* |
|
|
1269 |
* Code de l'exemple processing de la manipulation 1D de la main. |
|
|
1270 |
*/ |
|
|
1271 |
private void ProcessingMenuIEHand1DPS_Click(object sender, RoutedEventArgs e) |
|
|
1272 |
{ |
|
|
1273 |
OpenFile((String)config["exPIEHand1DPS"]); |
|
|
1274 |
} |
|
|
1275 |
|
|
|
1276 |
/* |
|
|
1277 |
* Exemple processing de la manipulation 1D de la main. |
|
|
1278 |
*/ |
|
|
1279 |
private void ProcessingMenuIEHand1DExe_Click(object sender, RoutedEventArgs e) |
|
|
1280 |
{ |
|
|
1281 |
OpenFile((String)config["exPIEHand1DExe"]); |
|
|
1282 |
} |
|
|
1283 |
|
|
|
1284 |
/* |
|
|
1285 |
* Code de l'exemple processing de la manipulation 2D de la main. |
|
|
1286 |
*/ |
|
|
1287 |
private void ProcessingMenuIEHand2DPS_Click(object sender, RoutedEventArgs e) |
|
|
1288 |
{ |
|
|
1289 |
OpenFile((String)config["exPIEHand2DPS"]); |
|
|
1290 |
} |
|
|
1291 |
|
|
|
1292 |
/* |
|
|
1293 |
* Exemple processing de la manipulation 2D de la main. |
|
|
1294 |
*/ |
|
|
1295 |
private void ProcessingMenuIEHand2DExe_Click(object sender, RoutedEventArgs e) |
|
|
1296 |
{ |
|
|
1297 |
OpenFile((String)config["exPIEHand2DExe"]); |
|
|
1298 |
} |
|
|
1299 |
|
|
|
1300 |
/* |
|
|
1301 |
* Code de l'exemple web de l'affichage des pointeurs. |
|
|
1302 |
*/ |
|
|
1303 |
private void WebMenuPointersPS_Click(object sender, RoutedEventArgs e) |
|
|
1304 |
{ |
|
|
1305 |
OpenFile((String)config["exWPointersPS"]); |
|
|
1306 |
} |
|
|
1307 |
|
|
|
1308 |
/* |
|
|
1309 |
* Exemple web de l'affichage des pointeurs. |
|
|
1310 |
*/ |
|
|
1311 |
private void WebMenuPointersExe_Click(object sender, RoutedEventArgs e) |
|
|
1312 |
{ |
|
|
1313 |
OpenFile((String)config["exWPointersExe"]); |
|
|
1314 |
} |
|
|
1315 |
|
|
|
1316 |
/* |
|
|
1317 |
* Code de l'exemple web de l'affichage des gestures. |
|
|
1318 |
*/ |
|
|
1319 |
private void WebMenuGesturesPS_Click(object sender, RoutedEventArgs e) |
|
|
1320 |
{ |
|
|
1321 |
OpenFile((String)config["exWGesturesPS"]); |
|
|
1322 |
} |
|
|
1323 |
|
|
|
1324 |
/* |
|
|
1325 |
* Exemple web de l'affichage des gestures. |
|
|
1326 |
*/ |
|
|
1327 |
private void WebMenuGesturesExe_Click(object sender, RoutedEventArgs e) |
|
|
1328 |
{ |
|
|
1329 |
OpenFile((String)config["exWGesturesExe"]); |
|
|
1330 |
} |
|
15
|
1331 |
} |
|
|
1332 |
} |