Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Pierogi
Summary Forums Tracker Lists Tasks Docs News SCM Files
1 #include "pirkeysetmanager.h"
3 #include "pirkeysetmetadata.h"
4 #include "pirselectkeysetform.h"
5 #include "pirkeysetwidgetitem.h"
7 #include "keysets/acer.h"
8 #include "keysets/admiral.h"
9 #include "keysets/aiwa.h"
10 #include "keysets/apple.h"
11 #include "keysets/beko.h"
12 #include "keysets/bose.h"
13 #include "keysets/cambridge.h"
14 #include "keysets/daewoo.h"
15 #include "keysets/denon.h"
16 #include "keysets/digitalstream.h"
17 #include "keysets/directv.h"
18 #include "keysets/dish.h"
19 #include "keysets/ei.h"
20 #include "keysets/elgato.h"
21 #include "keysets/emerson.h"
22 #include "keysets/fortec.h"
23 #include "keysets/goldstar.h"
24 #include "keysets/grundig.h"
25 #include "keysets/haier.h"
26 #include "keysets/hauppauge.h"
27 #include "keysets/hitachi.h"
28 #include "keysets/homecast.h"
29 #include "keysets/hp.h"
30 #include "keysets/huawei.h"
31 #include "keysets/jvc.h"
32 #include "keysets/kenwood.h"
33 #include "keysets/lg.h"
34 #include "keysets/logitech.h"
35 #include "keysets/magnavox.h"
36 #include "keysets/mce.h"
37 #include "keysets/mitsubishi.h"
38 #include "keysets/motorola.h"
39 #include "keysets/nokia.h"
40 #include "keysets/onida.h"
41 #include "keysets/panasonic.h"
42 #include "keysets/philco.h"
43 #include "keysets/philips.h"
44 #include "keysets/pinnacle.h"
45 #include "keysets/pioneer.h"
46 #include "keysets/raite.h"
47 #include "keysets/rca.h"
48 #include "keysets/roku.h"
49 #include "keysets/saba.h"
50 #include "keysets/sagem.h"
51 #include "keysets/samsung.h"
52 #include "keysets/sanyo.h"
53 #include "keysets/sharp.h"
54 #include "keysets/sky.h"
55 #include "keysets/sony.h"
56 #include "keysets/tivo.h"
57 #include "keysets/topfield.h"
58 #include "keysets/toshiba.h"
59 #include "keysets/vestel.h"
60 #include "keysets/virgin.h"
61 #include "keysets/vizio.h"
62 #include "keysets/wd.h"
63 #include "keysets/westinghouse.h"
64 #include "keysets/yamaha.h"
65 #include "keysets/zenith.h"
67 #include "pirexception.h"
69 // I'll be handling the threading of the keyset commands in this object:
70 #include <QMutex>
72 // Global communications mechanism:
73 extern bool stopRepeatingFlag;
74 extern QMutex stopRepeatingMutex;
76 // Global helper objects:
77 PIRMakeMgr makeManager;
78 PIRDeviceTypeMgr deviceManager;
80 // Now, on to the actual method definitions:
82 PIRKeysetManager::PIRKeysetManager()
83   : counter(0)
84 {
85   // Create the keysets.  Ugly!  This needs to be worked on!
86   setupKeyset(new AcerTV1(counter++));
87   setupKeyset(new AcerPC1(counter++));
89   setupKeyset(new AdmiralTV1(counter++));
90   setupKeyset(new AdmiralTV2(counter++));
91   setupKeyset(new AdmiralVCR1(counter++));
93   setupKeyset(new AiwaVCR1(counter++));
94   setupKeyset(new AiwaVCR2(counter++));
95   setupKeyset(new AiwaVCR3(counter++));
96   setupKeyset(new AiwaAudio1(counter++));
97   setupKeyset(new AiwaAudio1a(counter++));
98   setupKeyset(new AiwaAudio2(counter++));
99   setupKeyset(new AiwaAudio2a(counter++));
100   setupKeyset(new AiwaAudio2b(counter++));
101   setupKeyset(new AiwaAudio2c(counter++));
102   setupKeyset(new AiwaAudio3(counter++));
103   setupKeyset(new AiwaAudio4(counter++));
104   setupKeyset(new AiwaAudio5(counter++));
105   setupKeyset(new AiwaAudio6(counter++));
106   setupKeyset(new AiwaCarStereo1(counter++));
107   setupKeyset(new AiwaDVD1(counter++));
109   setupKeyset(new AppleWhiteRemote(counter++));
111   setupKeyset(new BekoTV1(counter++));
113   setupKeyset(new BoseRadio1(counter++));
114   setupKeyset(new BoseRadio2(counter++));
115   setupKeyset(new BoseRadio3(counter++));
116   setupKeyset(new BoseHomeTheater1(counter++));
118   setupKeyset(new CambridgeCD1(counter++));
119   setupKeyset(new CambridgeAudio1(counter++));
120   setupKeyset(new CambridgeAudio2(counter++));
121   setupKeyset(new CambridgeAudio3(counter++));
122   setupKeyset(new CambridgeDVD1(counter++));
124   setupKeyset(new DaewooTV1(counter++));
125   setupKeyset(new DaewooTV2(counter++));
126   setupKeyset(new DaewooTV3(counter++));
127   setupKeyset(new DaewooTV4(counter++));
128   setupKeyset(new DaewooDVD1(counter++));
129   setupKeyset(new DaewooVCR1(counter++));
130   setupKeyset(new DaewooVCR2(counter++));
132   setupKeyset(new DenonDVD1(counter++));
133   setupKeyset(new DenonDVD2(counter++));
134   setupKeyset(new DenonDVD3(counter++));
135   setupKeyset(new DenonReceiver1(counter++));
136   setupKeyset(new DenonReceiver1a(counter++));
137   setupKeyset(new DenonReceiver1b(counter++));
138   setupKeyset(new DenonReceiver1c(counter++));
139   setupKeyset(new DenonReceiver1d(counter++));
140   setupKeyset(new DenonReceiver1e(counter++));
141   setupKeyset(new DenonReceiver1f(counter++));
142   setupKeyset(new DenonReceiver2(counter++));
143   setupKeyset(new DenonReceiver2a(counter++));
144   setupKeyset(new DenonReceiver3(counter++));
145   setupKeyset(new DenonAudio1(counter++));
146   setupKeyset(new DenonAudio1a(counter++));
147   setupKeyset(new DenonAudio1b(counter++));
148   setupKeyset(new DenonAudio1c(counter++));
149   setupKeyset(new DenonAudio1d(counter++));
150   setupKeyset(new DenonAudio2(counter++));
151   setupKeyset(new DenonAudio3(counter++));
152   setupKeyset(new DenonAudio4(counter++));
154   setupKeyset(new DigitalStreamReceiver(counter++));
156   setupKeyset(new DirectvReceiver1(counter++));
158   setupKeyset(new DishReceiver1(counter++));
159   setupKeyset(new DishReceiver1a(counter++));
160   setupKeyset(new DishReceiver1b(counter++));
161   setupKeyset(new DishReceiver1c(counter++));
162   setupKeyset(new DishReceiver1d(counter++));
163   setupKeyset(new DishReceiver1e(counter++));
164   setupKeyset(new DishReceiver1f(counter++));
165   setupKeyset(new DishReceiver1g(counter++));
166   setupKeyset(new DishReceiver1h(counter++));
167   setupKeyset(new DishReceiver1i(counter++));
168   setupKeyset(new DishReceiver1j(counter++));
169   setupKeyset(new DishReceiver1k(counter++));
170   setupKeyset(new DishReceiver1l(counter++));
171   setupKeyset(new DishReceiver1m(counter++));
172   setupKeyset(new DishReceiver1n(counter++));
173   setupKeyset(new DishReceiver1o(counter++));
175   setupKeyset(new EiTV1(counter++));
177   setupKeyset(new ElgatoEyeTV1(counter++));
179   setupKeyset(new EmersonTV1(counter++));
180   setupKeyset(new EmersonDVD1(counter++));
182   setupKeyset(new FortecReceiver1(counter++));
183   setupKeyset(new FortecReceiver2(counter++));
185   setupKeyset(new GoldStarTV1(counter++));
186   setupKeyset(new GoldStarTV2(counter++));
187   setupKeyset(new GoldStarVCR1(counter++));
188   setupKeyset(new GoldStarVCR1a(counter++));
189   setupKeyset(new GoldStarVCR1b(counter++));
190   setupKeyset(new GoldStarVCR1c(counter++));
191   setupKeyset(new GoldStarCD1(counter++));
193   setupKeyset(new GrundigSat1(counter++));
194   setupKeyset(new GrundigSat2(counter++));
195   setupKeyset(new GrundigAmp1(counter++));
196   setupKeyset(new GrundigAudio1(counter++));
197   setupKeyset(new GrundigAudio2(counter++));
198   setupKeyset(new GrundigVCR1(counter++));
199   setupKeyset(new GrundigVCR1a(counter++));
200   setupKeyset(new GrundigTV1(counter++));
201   setupKeyset(new GrundigTV2(counter++));
202   setupKeyset(new GrundigTV3(counter++));
203   setupKeyset(new GrundigDVD1(counter++));
205   setupKeyset(new HaierTV1(counter++));
207   setupKeyset(new HauppaugePCTV1(counter++));
208   setupKeyset(new HauppaugePCTV1a(counter++));
209   setupKeyset(new HauppaugePCTV1b(counter++));
210   setupKeyset(new HauppaugePCTV1c(counter++));
211   setupKeyset(new HauppaugePCTV2(counter++));
213   setupKeyset(new HitachiTV1(counter++));
214   setupKeyset(new HitachiTV1a(counter++));
215   setupKeyset(new HitachiTV1b(counter++));
216   setupKeyset(new HitachiTV1c(counter++));
217   setupKeyset(new HitachiTV2(counter++));
218   setupKeyset(new HitachiTV3(counter++));
219   setupKeyset(new HitachiProjector(counter++));
220   setupKeyset(new HitachiDVD1(counter++));
221   setupKeyset(new HitachiAudio1(counter++));
222   setupKeyset(new HitachiVCR1(counter++));
224   setupKeyset(new HomecastReceiver1(counter++));
225   setupKeyset(new HomecastReceiver2(counter++));
227   setupKeyset(new HPRemote1(counter++));
229   setupKeyset(new HuaweiSTB1(counter++));
230   setupKeyset(new HuaweiSTB2(counter++));
232   setupKeyset(new JVCSat1(counter++));
233   setupKeyset(new JVCSat2(counter++));
234   setupKeyset(new JVCVCR1(counter++));
235   setupKeyset(new JVCVCR1a(counter++));
236   setupKeyset(new JVCVCRBmode1(counter++));
237   setupKeyset(new JVCVCRBmode1a(counter++));
238   setupKeyset(new JVCTV1(counter++));
239   setupKeyset(new JVCTV1a(counter++));
240   setupKeyset(new JVCTV1b(counter++));
241   setupKeyset(new JVCTV1c(counter++));
242   setupKeyset(new JVCTV1d(counter++));
243   setupKeyset(new JVCDAT1(counter++));
244   setupKeyset(new JVCCarDeck1(counter++));
245   setupKeyset(new JVCAudio1(counter++));
246   setupKeyset(new JVCAudio1a(counter++));
247   setupKeyset(new JVCAudio1b(counter++));
248   setupKeyset(new JVCAudio2(counter++));
249   setupKeyset(new JVCDVD1(counter++));
251   setupKeyset(new KenwoodAudio1(counter++));
252   setupKeyset(new KenwoodComponent1(counter++));
253   setupKeyset(new KenwoodComponent2(counter++));
254   setupKeyset(new KenwoodComponent3(counter++));
255   setupKeyset(new KenwoodCD1(counter++));
256   setupKeyset(new KenwoodDVD1(counter++));
257   setupKeyset(new KenwoodTV1(counter++));
259   setupKeyset(new LGTV1(counter++));
260   setupKeyset(new LGTV1a(counter++));
261   setupKeyset(new LGTV1b(counter++));
262   setupKeyset(new LGTV1c(counter++));
263   setupKeyset(new LGTV2(counter++));
264   setupKeyset(new LGTV2a(counter++));
265   setupKeyset(new LGTV2b(counter++));
266   setupKeyset(new LGDisc1(counter++));
267   setupKeyset(new LGDisc2(counter++));
268   setupKeyset(new LGDisc2a(counter++));
269   setupKeyset(new LGVCR1(counter++));
270   setupKeyset(new LGVCR1a(counter++));
271   setupKeyset(new LGVCR1b(counter++));
272   setupKeyset(new LGAC1(counter++));
274   setupKeyset(new LogitechSpeakers(counter++));
276   setupKeyset(new MagnavoxDVD1(counter++));
277   setupKeyset(new MagnavoxVCR1(counter++));
278   setupKeyset(new MagnavoxConverterBox1(counter++));
279   setupKeyset(new MagnavoxTV1(counter++));
281   setupKeyset(new MCERemote1(counter++));
282   setupKeyset(new MCERemote1a(counter++));
283   setupKeyset(new MCERemote1b(counter++));
284   setupKeyset(new MCERemote1c(counter++));
285   setupKeyset(new MCERemote1d(counter++));
286   setupKeyset(new MCERemote1e(counter++));
287   setupKeyset(new MCERemote1f(counter++));
288   setupKeyset(new MCERemote1g(counter++));
290   setupKeyset(new MitsubishiTV1(counter++));
291   setupKeyset(new MitsubishiTV1a(counter++));
292   setupKeyset(new MitsubishiVCR1(counter++));
293   setupKeyset(new MitsubishiVCR1a(counter++));
295   setupKeyset(new Motorola4DTV(counter++));
296   setupKeyset(new MotorolaSTB1(counter++));
297   setupKeyset(new MotorolaSTB1a(counter++));
298   setupKeyset(new MotorolaSTB1b(counter++));
299   setupKeyset(new MotorolaSkyDigital(counter++));
301   setupKeyset(new NokiaGenericVCR(counter++));
303   setupKeyset(new OnidaTV1(counter++));
304   setupKeyset(new OnidaDVD1(counter++));
306   setupKeyset(new PanasonicCarAudio(counter++));
307   setupKeyset(new PanasonicSat1(counter++));
308   setupKeyset(new PanasonicSat1a(counter++));
309   setupKeyset(new PanasonicTV1(counter++));
310   setupKeyset(new PanasonicTV1a(counter++));
311   setupKeyset(new PanasonicTV1b(counter++));
312   setupKeyset(new PanasonicVCR1(counter++));
313   setupKeyset(new PanasonicVCR1a(counter++));
314   setupKeyset(new PanasonicVCR1b(counter++));
315   setupKeyset(new PanasonicVCR1c(counter++));
316   setupKeyset(new PanasonicDVD1(counter++));
317   setupKeyset(new PanasonicDVD1a(counter++));
318   setupKeyset(new PanasonicAudio1(counter++));
319   setupKeyset(new PanasonicAC1(counter++));
321   setupKeyset(new PhilcoTV(counter++));
323   setupKeyset(new PhilipsTV1(counter++));
324   setupKeyset(new PhilipsTV1a(counter++));
325   setupKeyset(new PhilipsTV1b(counter++));
326   setupKeyset(new PhilipsTV1c(counter++));
327   setupKeyset(new PhilipsTV1d(counter++));
328   setupKeyset(new PhilipsTV1e(counter++));
329   setupKeyset(new PhilipsTV1f(counter++));
330   setupKeyset(new PhilipsTV2(counter++));
331   setupKeyset(new PhilipsTV2a(counter++));
332   setupKeyset(new PhilipsTV2b(counter++));
333   setupKeyset(new PhilipsTV3(counter++));
334   setupKeyset(new PhilipsDVD1(counter++));
335   setupKeyset(new PhilipsDVD1a(counter++));
336   setupKeyset(new PhilipsDVD1b(counter++));
337   setupKeyset(new PhilipsDVD1c(counter++));
338   setupKeyset(new PhilipsDVD1d(counter++));
339   setupKeyset(new PhilipsDVD2(counter++));
340   setupKeyset(new PhilipsDVD3(counter++));
341   setupKeyset(new PhilipsDVD3a(counter++));
342   setupKeyset(new PhilipsDVD4(counter++));
343   setupKeyset(new PhilipsVCR1(counter++));
344   setupKeyset(new PhilipsVCR1a(counter++));
345   setupKeyset(new PhilipsVCR1b(counter++));
346   setupKeyset(new PhilipsVCR1c(counter++));
347   setupKeyset(new PhilipsSat1(counter++));
348   setupKeyset(new PhilipsSat2(counter++));
349   setupKeyset(new PhilipsSat2a(counter++));
350   setupKeyset(new PhilipsSat3(counter++));
351   setupKeyset(new PhilipsAudio1(counter++));
352   setupKeyset(new PhilipsAudio1a(counter++));
353   setupKeyset(new PhilipsAudio1b(counter++));
354   setupKeyset(new PhilipsAudio2(counter++));
355   setupKeyset(new PhilipsAudio3(counter++));
356   setupKeyset(new PhilipsAudio4(counter++));
358   setupKeyset(new PinnaclePCTV1(counter++));
359   setupKeyset(new PinnaclePCTV2(counter++));
360   setupKeyset(new PinnaclePCTV3(counter++));
362   setupKeyset(new PioneerTV1(counter++));
363   setupKeyset(new PioneerTV2(counter++));
364   setupKeyset(new PioneerTV3(counter++));
365   setupKeyset(new PioneerAudio1(counter++));
366   setupKeyset(new PioneerAudio1a(counter++));
367   setupKeyset(new PioneerAudio2(counter++));
368   setupKeyset(new PioneerAudio3(counter++));
369   setupKeyset(new PioneerAudio4(counter++));
370   setupKeyset(new PioneerAudio5(counter++));
371   setupKeyset(new PioneerCD1(counter++));
372   setupKeyset(new PioneerLaserDisc1(counter++));
373   setupKeyset(new PioneerDVD1(counter++));
375   setupKeyset(new RaiteDVD1(counter++));
377   setupKeyset(new RCATV1(counter++));
378   setupKeyset(new RCATV1a(counter++));
379   setupKeyset(new RCATV1b(counter++));
380 //  setupKeyset(new RCAAux1(counter++));
381 //  setupKeyset(new RCAAux2(counter++));
382 //  setupKeyset(new RCAAux2a(counter++));
383   setupKeyset(new RCAVCR1(counter++));
384   setupKeyset(new RCAVCR1a(counter++));
385   setupKeyset(new RCADVD1(counter++));
386   setupKeyset(new RCADVD1a(counter++));
387   setupKeyset(new RCASat1(counter++));
388   setupKeyset(new RCASat2(counter++));
390   setupKeyset(new RokuBox1(counter++));
391   setupKeyset(new RokuBox2(counter++));
393   setupKeyset(new SabaTV1(counter++));
394   setupKeyset(new SabaTV2(counter++));
396   setupKeyset(new SagemTVBox1(counter++));
397   setupKeyset(new SagemTVBox1a(counter++));
399   setupKeyset(new SamsungTV1(counter++));
400   setupKeyset(new SamsungTV1a(counter++));
401   setupKeyset(new SamsungTV1b(counter++));
402   setupKeyset(new SamsungTV1c(counter++));
403   setupKeyset(new SamsungTV1d(counter++));
404   setupKeyset(new SamsungTV1e(counter++));
405   setupKeyset(new SamsungTV1f(counter++));
406   setupKeyset(new SamsungTV2(counter++));
407   setupKeyset(new SamsungTV2a(counter++));
408   setupKeyset(new SamsungVCR1(counter++));
409   setupKeyset(new SamsungVCR1a(counter++));
410   setupKeyset(new SamsungVCR1b(counter++));
411   setupKeyset(new SamsungVCR1c(counter++));
412   setupKeyset(new SamsungVCR1d(counter++));
413   setupKeyset(new SamsungVCR1e(counter++));
414   setupKeyset(new SamsungDVD1(counter++));
415   setupKeyset(new SamsungDVD1a(counter++));
416   setupKeyset(new SamsungDVD1b(counter++));
417   setupKeyset(new SamsungDVD2(counter++));
418   setupKeyset(new SamsungAC1(counter++));
419   setupKeyset(new SamsungDVBT1(counter++));
421   setupKeyset(new SanyoVCR1(counter++));
422   setupKeyset(new SanyoDVD1(counter++));
423   setupKeyset(new SanyoTV1(counter++));
424   setupKeyset(new SanyoTV1a(counter++));
425   setupKeyset(new SanyoTV1b(counter++));
426   setupKeyset(new SanyoTV1c(counter++));
427   setupKeyset(new SanyoTV1d(counter++));
428   setupKeyset(new SanyoProjector(counter++));
430   setupKeyset(new SharpTV1(counter++));
431   setupKeyset(new SharpTV1a(counter++));
432   setupKeyset(new SharpTV1b(counter++));
433   setupKeyset(new SharpTV1c(counter++));
434   setupKeyset(new SharpTV1d(counter++));
435   setupKeyset(new SharpTV1e(counter++));
436   setupKeyset(new SharpVCR1(counter++));
437   setupKeyset(new SharpReceiver1(counter++));
438   setupKeyset(new SharpAC1(counter++));
440   setupKeyset(new SkyReceiver1(counter++));
441   setupKeyset(new SkyReceiver1a(counter++));
443   setupKeyset(new SonyTV1(counter++));
444   setupKeyset(new SonyTV1a(counter++));
445   setupKeyset(new SonyTV1b(counter++));
446   setupKeyset(new SonyTV1c(counter++));
447   setupKeyset(new SonyAmp1(counter++));
448   setupKeyset(new SonyAmp2(counter++));
449   setupKeyset(new SonyAudio1(counter++));
450   setupKeyset(new SonyAudio1a(counter++));
451   setupKeyset(new SonyDAT1(counter++));
452   setupKeyset(new SonyDVD1(counter++));
453   setupKeyset(new SonyDVD1a(counter++));
454   setupKeyset(new SonyDVD1b(counter++));
455   setupKeyset(new SonyDVD1c(counter++));
456   setupKeyset(new SonyVCR1(counter++));
457   setupKeyset(new SonyVCR1a(counter++));
458   setupKeyset(new SonyVCR1b(counter++));
459   setupKeyset(new SonyReceiver1(counter++));
461   setupKeyset(new Tivo1(counter++));
462   setupKeyset(new Tivo1a(counter++));
463   setupKeyset(new Tivo1b(counter++));
464   setupKeyset(new Tivo1c(counter++));
465   setupKeyset(new Tivo1d(counter++));
467   setupKeyset(new TopfieldPVR1(counter++));
468   setupKeyset(new TopfieldSat1(counter++));
470   setupKeyset(new ToshibaTV1(counter++));
471   setupKeyset(new ToshibaTV1a(counter++));
472   setupKeyset(new ToshibaTV1b(counter++));
473   setupKeyset(new ToshibaTV1c(counter++));
474   setupKeyset(new ToshibaTV1d(counter++));
475   setupKeyset(new ToshibaTV1e(counter++));
476   setupKeyset(new ToshibaTV1f(counter++));
477   setupKeyset(new ToshibaTV1g(counter++));
478   setupKeyset(new ToshibaTV1h(counter++));
479   setupKeyset(new ToshibaVCR1(counter++));
480   setupKeyset(new ToshibaVCR1a(counter++));
481   setupKeyset(new ToshibaDisc1(counter++));
482   setupKeyset(new ToshibaDisc1a(counter++));
483   setupKeyset(new ToshibaDisc1b(counter++));
484   setupKeyset(new ToshibaDisc1c(counter++));
485   setupKeyset(new ToshibaDisc1d(counter++));
487   setupKeyset(new VestelTV1(counter++));
488   setupKeyset(new VestelTV2(counter++));
490   setupKeyset(new VirginSTB1(counter++));
492   setupKeyset(new VizioTV1(counter++));
494   setupKeyset(new WDMediaPlayer1(counter++));
495   setupKeyset(new WDMediaPlayer1a(counter++));
497   setupKeyset(new WestinghouseTV1(counter++));
498   setupKeyset(new WestinghouseTV2(counter++));
500   setupKeyset(new YamahaDVD1(counter++));
501   setupKeyset(new YamahaDVD1a(counter++));
502   setupKeyset(new YamahaAudio1(counter++));
503   setupKeyset(new YamahaAudio1a(counter++));
504   setupKeyset(new YamahaAudio2(counter++));
505   setupKeyset(new YamahaAudio2a(counter++));
506   setupKeyset(new YamahaAudio2b(counter++));
507   setupKeyset(new YamahaAudio2c(counter++));
508   setupKeyset(new YamahaAudio2d(counter++));
509   setupKeyset(new YamahaAudio3(counter++));
510   setupKeyset(new YamahaAudio4(counter++));
511   setupKeyset(new YamahaTV1(counter++));
512   setupKeyset(new YamahaKaraoke1(counter++));
514   setupKeyset(new ZenithC32V37(counter++));
516   // Start the thread running:
517   commandThread.start();
521 PIRKeysetManager::~PIRKeysetManager()
523   // Tell the keysets to stop doing any work:
524   {
525     QMutexLocker locker(&stopRepeatingMutex);
526     stopRepeatingFlag = true;
527   }
529   // Tell the thread that we want it to stop:
530   commandThread.exit();
532   // Wait for the thread to stop:
533   commandThread.wait();
535   // Delete all the keysets:
536   PIRKeysetCollection::iterator i = keysetsInfo.begin();
537   while (i != keysetsInfo.end())
538   {
539     if ((*i).second) delete (*i).second;
540     ++i;
541   }
545 bool PIRKeysetManager::keysetExists(
546   unsigned int keysetID) const
548   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
550   return (i != keysetsInfo.end());
554 bool PIRKeysetManager::findKeysetID(
555   QString make,
556   QString name,
557   unsigned int &id) const
559   // Only modify the id if we actually find a match!
561   PIRKeysetMakeIndex::const_iterator i = makeIndex.find(make);
562   if (i == makeIndex.end())
563   {
564     return false;
565   }
567   PIRKeysetNameIndex::const_iterator ii = (*i).second.find(name);
568   if (ii == (*i).second.end())
569   {
570     return false;
571   }
573   //  Ok, we've found it, pull out the id:
574   id = (*ii).second;
575   return true;
579 PIRKeysetWidgetItem *PIRKeysetManager::makeKeysetItem(
580   QString make,
581   QString name) const
583   unsigned int id;
585   if (!findKeysetID(make, name, id))
586   {
587     return NULL;
588   }
590   QString fullname = make;
591   fullname.append(" ");
592   fullname.append(name);
594   return new PIRKeysetWidgetItem(fullname, id, getMake(id));
598 bool PIRKeysetManager::hasKey(
599   unsigned int keysetID,
600   PIRKeyName name) const
602   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
604   if ((i == keysetsInfo.end()) || !i->second) return false;
606   return i->second->hasKey(name);
610 PIRMakeName PIRKeysetManager::getMake(
611   unsigned int keysetID) const
613   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
615   if ((i == keysetsInfo.end()) || !i->second) return Any_Make;
617   return i->second->getMake();
621 QString PIRKeysetManager::getDisplayName(
622   unsigned int keysetID) const
624   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
626   if ((i == keysetsInfo.end()) || !i->second)
627     return QString("Database Error");
629   return QString(i->second->getKeysetName());
633 void PIRKeysetManager::populateKeyset(
634   QObject *guiObject,
635   unsigned int keysetID)
637   PIRKeysetCollection::iterator i = keysetsInfo.find(keysetID);
639   if (i == keysetsInfo.end())
640   {
641     // Should have some sort of error message here!
642     return;
643   }
645   i->second->populateProtocol(guiObject);
646   i->second->moveToThread(&commandThread);
650 void PIRKeysetManager::setupKeyset(
651   PIRKeysetMetaData *keyset)
653   // Set up the keyset collection:
654   keysetsInfo[keyset->getID()] = keyset;
656   // Set up a name-based index into the collection:
657   makeIndex
658     [QString(makeManager.getMakeString(keyset->getMake()))]
659     [QString(keyset->getKeysetName())]
660     = keyset->getID();
664 void PIRKeysetManager::populateGuiWidget(
665   PIRSelectKeysetForm *skf) const
667   PIRMakeName make;
668   PIRKeysetWidgetItem *kwi;
670   PIRKeysetCollection::const_iterator i = keysetsInfo.begin();
672   while (i != keysetsInfo.end())
673   {
674     make = i->second->getMake();
675     QString tempString = makeManager.getMakeString(make);
676     tempString.append(" ");
677     tempString.append(i->second->getKeysetName());
678     kwi = new PIRKeysetWidgetItem(tempString, i->first, make);
679     i->second->populateDeviceTypes(kwi);
680     skf->addWidgetItem(kwi);
681     ++i;
682   }
686 void PIRKeysetManager::populateDeviceTypes(
687   PIRKeysetWidgetItem *kwi,
688   unsigned int keysetID) const
690   PIRKeysetCollection::const_iterator i = keysetsInfo.find(keysetID);
691   if ((i != keysetsInfo.end()) && i->second)
692   {
693     i->second->populateDeviceTypes(kwi);
694   }

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment