-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtech.tex
More file actions
101 lines (83 loc) · 6.32 KB
/
tech.tex
File metadata and controls
101 lines (83 loc) · 6.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
\section{Technical documentation}\label{tech}
\subsection{Installation}
The program is available via a git repository \cite{git}. To get the program just clone the repository by typing in bash:
\begin{lstlisting}
git clone git://github.com/twesterm/ged-interface.git
\end{lstlisting}
To compile the program Qt 4.5 \cite{qt} has to be installed. There are packages available for every major Linux distribution, Mac OS X and Windows. On OpenSuse \cite{opensuse} libqt4-devel (shipped with OpenSuse 11.0) is required for compiling. \\
Enter the get-interface directory and build with:
\begin{lstlisting}
qmake
make
\end{lstlisting}
A binary GED or GED.app (Mac OS X) is created which can be used. \\
The compile PIMAG, enter the ged-interface/PIMAG/ directory and run the compile script with:
\begin{lstlisting}
./compile
\end{lstlisting}
Note that the Intel FORTRAN compiler (ifort) \cite{ifort} is necessary to compile PIMAG. A PIMAG binary is produced that has to be copied or installed in a central location. .
\subsection{Program structure}
The program is written in C++ using Qt 4.5 (documentation online: \cite{qt}).\\
Data management is done via a QListWidget using GEDItem as a custom class for the Items of the list. GEDItem is inherited from QListWidgetItem. Most explanations are written as comments in the source code, nevertheless the most important custom memberfunctions and properties are mentioned. \\
\subsection{The GEDItem class}
The definition of the GEDItem class read as:
\begin{lstlisting}
class GEDItem : public QListWidgetItem
\end{lstlisting}
All inherited functions, slots, signals and properties are documented online \cite{qt}. \\
\subsubsection{Properties}
The (private) properties of the GEDItem class are:
\begin{lstlisting}
private:
QString IPLA, IXMA, JYMA;
QString PIXEL, XPIXFA, YPIXFA, XSCAT, YSCAT, XNULL, YNULL, RMIN, RMAX, DR, RMINT, RMAXT, DRT, TUNEXP, RADI, CADIST;
QString WAVE, DELTAS, SEPLA, ISECT, IRECOA, IRECOA2, ANGLE, SECFI;
bool Useable;
QString Path, Mode;
QString xRMAXT, yRMAXT, xAngle, yAngle;
\end{lstlisting}
There are get- and setmethods for every private property of the class named getProperty and setProperty.
\subsubsection{float GEDItem::distance(float x1, float x2, float y1, float y2)}
Gets two points $p_1$ and $p_2$ and returns the distance between the points.
\subsubsection{float GEDItem::calcAngle(float x1, float y1, float x2, float y2, float x3, float y3)}
Gets a triangle defined by points $p_1$, $p_2$ and $p_3$ and returns the angle in the defined triangle at $p_1$.
\subsubsection{QString GEDItem::writeInputFile()}
Writes out an input file for PIMAG \cite{pimag} and returns a QString with the complete filename (including path) of the written file. \\
The complete filename of the input file is the same then the selected .tif file, but with .txt instead of .tif. The returned filename is used for a list in QMainWindow. \\
\newpage
\subsection{The QMainWindow Class}
This class handles the main window and all of its slots and signals with the instance ui. The definition reads as:
\begin{lstlisting}
class MainWindowClass : public QMainWindow
\end{lstlisting}
The only notable property of QMainWindow is \lstinline$ QStringList fileList $ that contains the list of all inputfiles that have been written to hard drive.
\subsubsection{bool MainWindowClass::eventFilter( QObject $\ast$ watched, QEvent $\ast$ event )[slot]}
Is the primary eventfilter of the program. It handles all events coming from \lstinline$ ui->picLabel$ (the picture-frame of the program). \\
Returns always false (for internal reason).
\subsubsection{bool MainWindowClass::isIn(QString name) [slot] }
Returns true if the name is already in the list of the listWidget.
\subsubsection{ void MainWindowClass::on\_actionOpenFile\_triggered() [slot] }
Executes if the user clicks on openfile. Handles all renaming of doubled items in the listWidget and adds the selected files to the listWidget as GEDItems.
\subsubsection{void MainWindowClass::setValuesByMethod(QString method) }
When this function is called, it calculates the values for XSCAT, YSCAT and ANGLE and writes them to the corresponding lineEdits at the user interface.
\subsubsection{void MainWindowClass::on\_listWidget\_ itemClicked (QListWidgetItem $\ast$ item) [ slot ] }
Is called when the user clicks on an item at the listWidget. It sets all stored values to the lineEdit forms, sets the picture and calls setValuesByMethod().
\subsection{Porting to Windows}
In general it is possible to port xpimag to windows. There are two main problems: \\
1.: String processing. The following memberfunctions do string manipulation and would have to be carefully modified to take the difference in file names into account:
\begin{lstlisting}
void MainWindowClass::on_actionOpenFile_triggered()
void MainWindowClass::on_IntegratePushButton_pressed()
QString GEDItem::writeInputFile()
\end{lstlisting}
2.: The \lstinline! void MainWindowClass::on_IntegratePushButton_pressed() ! would have to be modified to produce scripts for Microsoft Power Shell.
\subsection{Further developments}
A number of features where are not yet implemented. A reasonable approach would be to implement automated rescaling of the image histogram to improve the contrast. That would make it easier see errors on the experimental data. \\
An other convenient feature would be the integration of PIMAG in the graphical interface. This has been tried, but failed because there was no possibility to link the C++ code of xpimag with the FORTRAN 77 of PIMAG. PIMAG does not compile with the g77 compiler and therefore fails to link with g++. A solution would be to use the Intel C++ Compiler for building and linking the whole project. \\
If this is implemented it should be easy to implement plotting of the output files into the program.
\newpage
\section*{Acknowledgment}
I would like to thank Dr. Raphael Berger for giving me the opportunity to work on this interesting topic, for the introduction to the topic and all the helpful discussions. I also would like to thank Dr. Stuart Hayes for the discussions and the introduction to the topic. \\
All staff of the chair of inorganic chemistry are acknowledged for the very good working environment and supporting this work. \\
The chair of theoretical chemistry is acknowledged for providing the computer resources for this work.
\newpage