trainingassistant.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-  (for Emacs)
00002  *
00003  *  trainingassistant.h
00004  *  Digest
00005  * 
00006  *  Created by Aidan Lane on Tue Jul 21 2005.
00007  *  Copyright (c) 2005-2006 Optimisation and Constraint Solving Group,
00008  *  Monash University. All rights reserved.
00009  *
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00023  */
00024 
00025 #ifndef TRAININGASSISTANT_H
00026 #define TRAININGASSISTANT_H
00027 
00028 
00029 #include "DigestGuiCore/guicomponentwidgets.h"
00030 
00031 #include <QByteArray>
00032 #include <QList>
00033 #include <QSet>
00034 
00035 #include <jni.h>
00036 
00037 #include "ui_trainingassistantform.h"
00038 
00039 class QItemSelectionModel;
00040 class QStandardItemModel;
00041 
00042 class AbstractRecogniser;
00043 class CategoryItemModel;
00044 class GestureQueryModel;
00045 
00046 
00047 class TrainingAssistant : public GuiDbComponentDialog {
00048 
00049   Q_OBJECT
00050 
00051   enum Step { Introduction,
00052               SelectType,
00053               SelectFeatures,
00054               SelectGestures,
00055               FinalDetails,
00056               ConfirmDetails,
00057               Training,
00058               Finished,
00059               NoRecognisers,
00060               NoFeatures,
00061               Closed };
00062 
00063 public:
00064   TrainingAssistant( DigestDbController* controller,
00065                      JavaVM* jvm,
00066                      QWidget* parent = 0, Qt::WindowFlags flags = 0 );
00067 
00068 
00069 protected:
00070   void resetEvent( VEvent* );
00071   void trainedRecogsEvent( VTrainedRecogsEvent* );
00072 
00073 
00074 private slots:
00075   void on_goBackButton_clicked();
00076   void on_continueButton_clicked();
00077   void on_featureListWidget_itemSelectionChanged();
00078   void on_trainingFeatureListWidget_itemSelectionChanged();
00079 
00080   void gotoStep( TrainingAssistant::Step step );
00081   void reflectCurrentStep();
00082   void updateRecogInfoWidget( int recogTypeComboIndex );
00083   void updateFeatureInfoWidget( const QByteArray& key );
00084 
00085   void gatherDetails();
00086   void train();
00087 
00088   void onTrainingProgressed( int progress );
00089   void onCategoryModelDataChanged();
00090 
00091 
00092 private:
00093   void initWidgets();
00094   static void initStaticStrs();
00095 
00096   void worker_itemSelectionChanged( FeaturesListWidget* wCurrent,
00097                                     FeaturesListWidget* wNotCurrent );
00098 
00099   QString detailsAsHtml() const;
00100 
00101   JavaVM* m_jvm;
00102 
00103   Ui::TrainingAssistantForm ui;
00104   AbstractRecogniser* m_recogniser;
00105   int m_currentStep;
00106 
00107   CategoryItemModel*   m_categoryModel;
00108   GestureQueryModel*   m_gestureModel;
00109   QStandardItemModel*  m_dummyModel;
00110 
00111   QString m_gestureQuery;
00112 
00113   // Details:
00114   QString            m_recogLabelStr;
00115   QString            m_recogNotesStr;
00116   QByteArray         m_recogTypeKey;
00117   QList<QByteArray>  m_featureKeys;
00118   QSet<int>          m_gestureIds;
00119 };
00120 
00121 
00122 #endif  // ! TRAININGASSISTANT_H

Generated on Mon Jul 30 09:46:50 2007 for Digest by  doxygen 1.5.2