00001
00002
00003
00004
00005
00006
00007 #include "Logger.h"
00008 #include <qdebug.h>
00009 #include <QGraphicsPixmapItem>
00010 #include <QGraphicsScene>
00011 #include <QGraphicsView>
00012 #include "TutorialButton.h"
00013 #include "TutorialDlg.h"
00014 #include "TutorialStateContext.h"
00015 #include "TutorialStatePointMatch.h"
00016
00017 TutorialStatePointMatch::TutorialStatePointMatch (TutorialStateContext &context) :
00018 TutorialStateAbstractBase (context)
00019 {
00020 }
00021
00022 void TutorialStatePointMatch::begin ()
00023 {
00024 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStatePointMatch::begin ()";
00025
00026 m_title = createTitle (tr ("Point Match"));
00027 m_background = createPixmapItem (":/engauge/img/panel_point_match.png",
00028 QPoint (0, 30));
00029 m_text0 = createTextItem (tr ("In Point Match mode, you pick\n"
00030 "one sample point, and Engauge\n"
00031 "then finds all matching points.\n\n"
00032 "Step 1 - Click on Point Match mode."),
00033 QPoint (300, 40));
00034 m_text1 = createTextItem (tr ("Step 2 - Select the curve the new\n"
00035 "points will belong to."),
00036 QPoint (320, 140));
00037 m_text2 = createTextItem (tr ("Step 3 - Click on a typical point.\n"
00038 "The circle turns green when it\n"
00039 "contains what may be a point."),
00040 QPoint (320, 200));
00041 m_text3 = createTextItem (tr ("Step 4 - Engauge will show a\n"
00042 "matched point with a yellow cross.\n"
00043 "Press the Right Arrow key to accept\n"
00044 "the matched point. Repeat this step\n"
00045 "until there are no more points."),
00046 QPoint (320, 270));
00047
00048 QSize backgroundSize = context().tutorialDlg().backgroundSize();
00049
00050 m_previous = new TutorialButton (tr ("Previous"),
00051 context().tutorialDlg().scene());
00052 m_previous->setGeometry (QPoint (buttonMargin (),
00053 backgroundSize.height() - buttonMargin() - m_previous->size().height()));
00054 connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));
00055
00056 m_next = new TutorialButton (tr ("Next"),
00057 context().tutorialDlg().scene());
00058 m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
00059 backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
00060 connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
00061 }
00062
00063 void TutorialStatePointMatch::end ()
00064 {
00065 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStatePointMatch::end ()";
00066
00067 context().tutorialDlg().scene().removeItem (m_title);
00068 context().tutorialDlg().scene().removeItem (m_background);
00069 context().tutorialDlg().scene().removeItem (m_text0);
00070 context().tutorialDlg().scene().removeItem (m_text1);
00071 context().tutorialDlg().scene().removeItem (m_text2);
00072 context().tutorialDlg().scene().removeItem (m_text3);
00073
00074
00075 delete m_title;
00076 delete m_background;
00077 delete m_text0;
00078 delete m_text1;
00079 delete m_text2;
00080 delete m_text3;
00081 delete m_next;
00082 delete m_previous;
00083
00084 m_title = 0;
00085 m_background = 0;
00086 m_text0 = 0;
00087 m_text1 = 0;
00088 m_text2 = 0;
00089 m_text3 = 0;
00090 m_next = 0;
00091 m_previous = 0;
00092 }
00093
00094 void TutorialStatePointMatch::slotNext ()
00095 {
00096 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStatePointMatch::slotNext";
00097
00098 context().requestDelayedStateTransition (TUTORIAL_STATE_CHECKLIST_WIZARD_POINTS);
00099 }
00100
00101 void TutorialStatePointMatch::slotPrevious ()
00102 {
00103 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStatePointMatch::slotPrevious";
00104
00105 context().requestDelayedStateTransition (TUTORIAL_STATE_CURVE_TYPE);
00106 }