Assigned Friday, Feb. 13, 2009, due Friday, Feb. 20, 2009
[1] Construct a state diagram for the SVD Creator Applet in which the matrix entry component (the white area surrounded by braces) is treated as a "submachine" (see page 111 of Blaha and Rumbaugh). You will describe the matrix entry component by its own separate state diagram. To simplify the diagram, you may neglect tools tips and the formatting of the matrix entries that occurs when the FMT button is hit. This problem is best done while interacting with the applet.
[2] Create a state diagram of your completed FunEval application in the computational problem (c). Be sure to indicate in this diagram what happens when a user inputs unacceptable data into the "x =" or the "F(x)=" text boxes.
[Discussion/Preliminaries] The goal of the computational problem is to create a "function evaluator" application with a Qt based graphical user interface by modifying an existing Qt application. Since you will be doing the modifications "by hand" (e.g. not using a GUI interface wizard) you will forced to become familiar with the essential aspects of creating a Qt based GUI. This familiarity is a necessary background to becoming proficient at using the GUI interface wizard that will be used in the later assignments.
In Math 157 we are using the open-source version of Qt and it is not directly integrated into the Visual Studio IDE. However, one can still use the Visual Studio IDE to build and work with Qt based programs, but it requires additional steps involving the qmake program. These steps are described in the problem statement.
For Linux/Unix users using the Eclipse IDE, you should create a "Standard C++ Make project" and then use the make files that are constructed (and managed) by the qmake program. The steps for creating the makefiles are identical to that for Visual Studio, except that you leave the TEMPLATE variable in the .pro file as app (the default).
(a) Download and build the executable for the function evaluator application. The steps to accomplish this using Visual Studio are
qmake -project -o FunEval.pro
TEMPLATE = vcapp
qmake FunEval.pro
![]() |
||
|
|
(b) Create a wrapper class DoubleSymbolicFunction, derived from the class DoubleFunction (DoubleFunction.h), that allows one to specify functions through a character string in the variable
x. The DoubleFunction.h file is included in the Assign7 repository.
(c) By modifying the files and adding additional support files to the FunEval project, create an enhanced function evaluator by modifying the FunEvalMainWindow class. Your modified application
should:
Function Evaluator Class Diagram
Use your DoubleSymbolicFunction to provide the capability for creating a function from a string. When you figure out what to do, you will only have to make a few changes to the FunEvalMainWindow class. To figure out what to do, I'd suggest looking carefully at the original version of the application and understand how it works and what the member functions do. It is useful to have the Qt Reference documentation on hand to look up documentation for the constructs that are used. This documentation browser can be invoked by typing "assistant" in a command prompt window.
To add additional supporting files and libraries to a Qt based project, one doesn't directly add these to the Visual Studio project using the IDE interface. Instead, one adds/modifies entries in the FunEval.pro file and then re-runs qmake to recreate the Visual Studio project file. After you run qmake, Visual Studio will notify you that the project file has changed and ask if you want the project file reloaded (you do). For example, you will need to specify include paths and library paths for the CAMsymbolic function library. As before, this is done by specifying the name and location of the library using the Unix convention of using -L for library path and -l for library name. After you make modifications to the FunEval.pro file, rerun qmake: e.g. qmake FunEval.pro
and accept the reload of the project file when Visual Studio prompts you.
The following is a sample FunEval.pro file for Assignment 7 that I used. The file you create and modify will differ from it because of your different file structure and code implementation.
###################################################################### # Automatically generated by qmake (2.01a) Thu Feb 12 17:36:28 2009 ######################################################################
TEMPLATE = vcapp TARGET = FunEval DEPENDPATH += . INCLUDEPATH += . INCLUDEPATH += ../CAMsymfun INCLUDEPATH += ../CommonFiles LIBS += -L../debug -lCAMsymfun # Input HEADERS += DoubleFunction.h FunEvalMainWindow.h SOURCES += FunEvalApp.cpp FunEvalMainWindow.cpp
Hardcopy to be turned in
In an Assign7 subdirectory of your submit directory, place