00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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