mirror of
https://github.com/arcan1s/moldyn.git
synced 2026-05-22 15:56:16 +00:00
Reorganization
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
cmake_policy(SET CMP0003 OLD)
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
cmake_policy(SET CMP0015 NEW)
|
||||
|
||||
# set project name
|
||||
set (PROJECT mathmech)
|
||||
# set additional cmake file
|
||||
include (${PROJECT}.cmake)
|
||||
|
||||
|
||||
# additional options
|
||||
OPTION (WITH_DEBUG_MODE "Build with debug mode" OFF)
|
||||
OPTION (ADD_INCLUDE "Add include files" OFF)
|
||||
|
||||
# set libraries
|
||||
set (LIBRARIES)
|
||||
foreach (LIBRARY ${LIBRARIES})
|
||||
find_library ("${LIBRARY}_FOUND" ${LIBRARY})
|
||||
message (STATUS "Check the ${LIBRARY} is installed: " ${${LIBRARY}_FOUND})
|
||||
if ("${${LIBRARY}_FOUND}" STREQUAL "${LIBRARY}_FOUND-NOTFOUND")
|
||||
message (STATUS "Adding library sources")
|
||||
add_subdirectory (../${LIBRARY} lib/${LIBRARY})
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
# additional targets
|
||||
set (TARGETS "")
|
||||
set (HEADERS "")
|
||||
|
||||
add_subdirectory (${PROJECT_SOURCE_DIR})
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,31 @@
|
||||
# set directories
|
||||
set (PROJECT_BINARY_DIR bin)
|
||||
set (PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
set (PROJECT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
set (PROJECT_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib)
|
||||
set (PROJECT_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources)
|
||||
set (PROJECT_TRANSLATION_DIR ${PROJECT_RESOURCE_DIR}/translations)
|
||||
|
||||
# library path
|
||||
link_directories (${PROJECT_LIB_DIR})
|
||||
# executable path
|
||||
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
||||
|
||||
# verbose
|
||||
set (CMAKE_VERBOSE_MAKEFILE ON)
|
||||
|
||||
# flags
|
||||
if ( WITH_DEBUG_MODE )
|
||||
add_definitions ( -DDEBUG_MODE=1 )
|
||||
endif ()
|
||||
if ( CMAKE_COMPILER_IS_GNUCXX )
|
||||
set (ADD_CXX_FLAGS "-Wall")
|
||||
set (CMAKE_CXX_FLAGS "-O0 ${ADD_CXX_FLAGS}")
|
||||
set (CMAKE_CXX_FLAGS_DEBUG "-g -O0")
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
||||
elseif ( MSVC )
|
||||
set (ADD_CXX_FLAGS "/W4")
|
||||
set (CMAKE_CXX_FLAGS "${ADD_CXX_FLAGS}")
|
||||
else ()
|
||||
message ("Unknown compiler")
|
||||
endif ()
|
||||
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>translations/rus.qm</file>
|
||||
<file>translations/eng.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -0,0 +1 @@
|
||||
<クdハ�箆!ソ`。スン
|
||||
@@ -0,0 +1,378 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0">
|
||||
<context>
|
||||
<name>AgglWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/agglwindow.cpp" line="37"/>
|
||||
<source>Select file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/agglwindow.cpp" line="39"/>
|
||||
<source>'statgen' output files (*.dat);;All files (*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/agglwindow.cpp" line="137"/>
|
||||
<source>Save file as...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/agglwindow.cpp" line="139"/>
|
||||
<source>Agglomerate files (*.agl);;All files (*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AglAll</name>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="82"/>
|
||||
<location filename="../../src/aglallwindow.cpp" line="83"/>
|
||||
<source>Processing 'agl'...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="207"/>
|
||||
<source>Done</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AglAllWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="44"/>
|
||||
<source>Select work directory</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="54"/>
|
||||
<source>Select trajectory file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="56"/>
|
||||
<source>'statgen' output files (*.dat);;All files (*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="65"/>
|
||||
<source>Save file as...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="67"/>
|
||||
<source>PDB files (*.pdb);;All files (*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AtomTypesWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="87"/>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="100"/>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="103"/>
|
||||
<source>Add new molecule</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="42"/>
|
||||
<source>Save file as...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="44"/>
|
||||
<source>Atom types files (*.types);;All files (*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ErrorWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="22"/>
|
||||
<source>Work directory does not exists</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="25"/>
|
||||
<source>Input file is not set</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="28"/>
|
||||
<source>Atoms in plane must be different</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="31"/>
|
||||
<source>Atom types file is not set</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="34"/>
|
||||
<source>Output file is not set</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="37"/>
|
||||
<source>Atom type must contain 2 characters</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="40"/>
|
||||
<source>Log file is not set</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="43"/>
|
||||
<source>Component is not found</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="46"/>
|
||||
<source>Atom types is not set</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="49"/>
|
||||
<source>Something wrong</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="52"/>
|
||||
<source>Interactions are not set</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="55"/>
|
||||
<source>Invalid file type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="58"/>
|
||||
<source>Interaction step is not set</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="61"/>
|
||||
<source>Unknown error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="26"/>
|
||||
<source>Ready</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="236"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="290"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="333"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="376"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="419"/>
|
||||
<source>Select work directory</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="246"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="343"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="429"/>
|
||||
<source>Select trajectory file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="248"/>
|
||||
<source>All files (*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="257"/>
|
||||
<source>Select atom types file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="259"/>
|
||||
<source>Atom types files (*.types);;All files (*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="268"/>
|
||||
<source>Save files as</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="270"/>
|
||||
<source>Mask of trajectory files</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="279"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="322"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="365"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="408"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="462"/>
|
||||
<source>Save log file as...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="281"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="324"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="367"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="410"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="464"/>
|
||||
<source>Log files (*.log)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="300"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="386"/>
|
||||
<source>Select trajectory files</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="302"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="345"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="388"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="431"/>
|
||||
<source>Trajectory files (*.*[0-9])</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="311"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="397"/>
|
||||
<source>Save output file as...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="313"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="399"/>
|
||||
<source>Output files (*.dat)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="354"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="451"/>
|
||||
<source>Save PDB file as...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="356"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="453"/>
|
||||
<source>PDB files (*.pdb)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="440"/>
|
||||
<source>Select agglomerate file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="442"/>
|
||||
<source>Agglomerate files (*.agl);;All files (*.*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="611"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="612"/>
|
||||
<source>Processing 'trj'...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="622"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="703"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="751"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="821"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="889"/>
|
||||
<source>Done</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="675"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="676"/>
|
||||
<source>Processing 'statgen'...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="741"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="742"/>
|
||||
<source>Processing 'envir'...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="807"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="808"/>
|
||||
<source>Processing 'radf'...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="864"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="865"/>
|
||||
<source>Processing 'agl'...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="869"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="870"/>
|
||||
<source>Processing 'trj2pdb'...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/settingswindow.cpp" line="185"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="196"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="207"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="218"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="229"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="240"/>
|
||||
<source>Select component</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/settingswindow.cpp" line="187"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="198"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="209"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="220"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="231"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="242"/>
|
||||
<source>All files (*)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>StatgenGraphWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="54"/>
|
||||
<source>N</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="55"/>
|
||||
<source>p</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="72"/>
|
||||
<source>r</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="73"/>
|
||||
<source>g</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="147"/>
|
||||
<source>Save image as...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="149"/>
|
||||
<source>JPEG file (*.jpeg);;Portable Network Graphics file (*.png);;Bitmap file (*.bmp)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
Binary file not shown.
@@ -0,0 +1,378 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0" language="ru_RU">
|
||||
<context>
|
||||
<name>AgglWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/agglwindow.cpp" line="37"/>
|
||||
<source>Select file</source>
|
||||
<translation>Выбор файла</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/agglwindow.cpp" line="39"/>
|
||||
<source>'statgen' output files (*.dat);;All files (*.*)</source>
|
||||
<translation>Файлы 'statgen' (*.dat);;Все файлы (*.*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/agglwindow.cpp" line="137"/>
|
||||
<source>Save file as...</source>
|
||||
<translation>Сохранить файл как...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/agglwindow.cpp" line="139"/>
|
||||
<source>Agglomerate files (*.agl);;All files (*.*)</source>
|
||||
<translation>Файл с агломератом (*.agl);Все файлы (*.*)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AglAll</name>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="82"/>
|
||||
<location filename="../../src/aglallwindow.cpp" line="83"/>
|
||||
<source>Processing 'agl'...</source>
|
||||
<translation>Выполняется 'agl'...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="207"/>
|
||||
<source>Done</source>
|
||||
<translation>Готово</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AglAllWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="44"/>
|
||||
<source>Select work directory</source>
|
||||
<translation>Выбор рабочей директории</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="54"/>
|
||||
<source>Select trajectory file</source>
|
||||
<translation>Выбор файла траектории</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="56"/>
|
||||
<source>'statgen' output files (*.dat);;All files (*.*)</source>
|
||||
<translation>Файлы 'statgen' (*.dat);;Все файлы (*.*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="65"/>
|
||||
<source>Save file as...</source>
|
||||
<translation>Сохранить файл как...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/aglallwindow.cpp" line="67"/>
|
||||
<source>PDB files (*.pdb);;All files (*.*)</source>
|
||||
<translation>PDB файлы (*.pdb);;Все файлы (*.*)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AtomTypesWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="87"/>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="100"/>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="103"/>
|
||||
<source>Add new molecule</source>
|
||||
<translation>Добавить новую молекулу</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="42"/>
|
||||
<source>Save file as...</source>
|
||||
<translation>Сохранить файл как...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/atomtypeswindow.cpp" line="44"/>
|
||||
<source>Atom types files (*.types);;All files (*.*)</source>
|
||||
<translation>Файл типов атомов (*.types);;Все файлы (*.*)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ErrorWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="22"/>
|
||||
<source>Work directory does not exists</source>
|
||||
<translation>Рабочая директория не существует</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="25"/>
|
||||
<source>Input file is not set</source>
|
||||
<translation>Входной файл не задан</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="28"/>
|
||||
<source>Atoms in plane must be different</source>
|
||||
<translation>Атомы, образующие плоскость, должны быть различными</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="31"/>
|
||||
<source>Atom types file is not set</source>
|
||||
<translation>Типы атомов не заданы</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="34"/>
|
||||
<source>Output file is not set</source>
|
||||
<translation>Выходной файл не задан</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="37"/>
|
||||
<source>Atom type must contain 2 characters</source>
|
||||
<translation>Тип атома должен содержать 2 символа</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="40"/>
|
||||
<source>Log file is not set</source>
|
||||
<translation>Лог файл не задан</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="43"/>
|
||||
<source>Component is not found</source>
|
||||
<translation>Компонент не найден</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="46"/>
|
||||
<source>Atom types is not set</source>
|
||||
<translation>Тип атома не задан</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="49"/>
|
||||
<source>Something wrong</source>
|
||||
<translation>Что то не так</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="52"/>
|
||||
<source>Interactions are not set</source>
|
||||
<translation>Взаимодействия не заданы</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="55"/>
|
||||
<source>Invalid file type</source>
|
||||
<translation>Неправильный тип файла</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="58"/>
|
||||
<source>Interaction step is not set</source>
|
||||
<translation>Шаг взаимодействия не задан</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/errorwindow.cpp" line="61"/>
|
||||
<source>Unknown error</source>
|
||||
<translation>Неизвестная ошибка</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="26"/>
|
||||
<source>Ready</source>
|
||||
<translation>Готов</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="236"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="290"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="333"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="376"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="419"/>
|
||||
<source>Select work directory</source>
|
||||
<translation>Выбор рабочей директории</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="246"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="343"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="429"/>
|
||||
<source>Select trajectory file</source>
|
||||
<translation>Выбор файла траектории</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="248"/>
|
||||
<source>All files (*.*)</source>
|
||||
<translation>Все файлы (*.*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="257"/>
|
||||
<source>Select atom types file</source>
|
||||
<translation>Выбор файла типов атомов</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="259"/>
|
||||
<source>Atom types files (*.types);;All files (*.*)</source>
|
||||
<translation>Файл типов атомов (*.types);;Все файлы (*.*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="268"/>
|
||||
<source>Save files as</source>
|
||||
<translation>Сохранить файл как...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="270"/>
|
||||
<source>Mask of trajectory files</source>
|
||||
<translation>Маска файлов траектории</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="279"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="322"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="365"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="408"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="462"/>
|
||||
<source>Save log file as...</source>
|
||||
<translation>Сохранить лог как...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="281"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="324"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="367"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="410"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="464"/>
|
||||
<source>Log files (*.log)</source>
|
||||
<translation>Лог (*.log)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="300"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="386"/>
|
||||
<source>Select trajectory files</source>
|
||||
<translation>Выбор файла траектории</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="302"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="345"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="388"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="431"/>
|
||||
<source>Trajectory files (*.*[0-9])</source>
|
||||
<translation>Файлы траектории (*.*[0-9])</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="311"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="397"/>
|
||||
<source>Save output file as...</source>
|
||||
<translation>Сохранить файл как...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="313"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="399"/>
|
||||
<source>Output files (*.dat)</source>
|
||||
<translation>Выходной файл (*.dat)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="354"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="451"/>
|
||||
<source>Save PDB file as...</source>
|
||||
<translation>Сохранить PDB как...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="356"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="453"/>
|
||||
<source>PDB files (*.pdb)</source>
|
||||
<translation>PDB файл (*.pdb)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="440"/>
|
||||
<source>Select agglomerate file</source>
|
||||
<translation>Выбор файла с агломератом</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="442"/>
|
||||
<source>Agglomerate files (*.agl);;All files (*.*)</source>
|
||||
<translation>Файл с агломератом (*.agl);Все файлы (*.*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="611"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="612"/>
|
||||
<source>Processing 'trj'...</source>
|
||||
<translation>Выполняется 'trj'...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="622"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="703"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="751"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="821"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="889"/>
|
||||
<source>Done</source>
|
||||
<translation>Готово</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="675"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="676"/>
|
||||
<source>Processing 'statgen'...</source>
|
||||
<translation>Выполняется 'statgen'...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="741"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="742"/>
|
||||
<source>Processing 'envir'...</source>
|
||||
<translation>Выполняется 'envir'...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="807"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="808"/>
|
||||
<source>Processing 'radf'...</source>
|
||||
<translation>Выполняется 'radf'...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="864"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="865"/>
|
||||
<source>Processing 'agl'...</source>
|
||||
<translation>Выполняется 'agl'...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/mainwindow.cpp" line="869"/>
|
||||
<location filename="../../src/mainwindow.cpp" line="870"/>
|
||||
<source>Processing 'trj2pdb'...</source>
|
||||
<translation>Выполняется 'trj2pdb'...</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/settingswindow.cpp" line="185"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="196"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="207"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="218"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="229"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="240"/>
|
||||
<source>Select component</source>
|
||||
<translation>Выбор компонента</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/settingswindow.cpp" line="187"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="198"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="209"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="220"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="231"/>
|
||||
<location filename="../../src/settingswindow.cpp" line="242"/>
|
||||
<source>All files (*)</source>
|
||||
<translation>Все файлы (*)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>StatgenGraphWindow</name>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="54"/>
|
||||
<source>N</source>
|
||||
<translation>N</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="55"/>
|
||||
<source>p</source>
|
||||
<translation>p</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="72"/>
|
||||
<source>r</source>
|
||||
<translation>r</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="73"/>
|
||||
<source>g</source>
|
||||
<translation>g</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="147"/>
|
||||
<source>Save image as...</source>
|
||||
<translation>Сохранить изображение как...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/statgengraphwindow.cpp" line="149"/>
|
||||
<source>JPEG file (*.jpeg);;Portable Network Graphics file (*.png);;Bitmap file (*.bmp)</source>
|
||||
<translation>JPEG (*.jpeg);;Portable Network Graphics (*.png);;Bitmap (*.bmp)</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -0,0 +1,67 @@
|
||||
set (PROJECT_VERSION_MAJOR 1)
|
||||
set (PROJECT_VERSION_MINOR 0)
|
||||
set (PROJECT_VERSION_PATCH 0)
|
||||
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
|
||||
|
||||
message (STATUS "${PROJECT}: Version ${PROJECT_VERSION}")
|
||||
|
||||
# set files
|
||||
file (GLOB SOURCES *.cpp)
|
||||
file (GLOB HEADERS *.h)
|
||||
file (GLOB FORMS *.ui)
|
||||
# set library
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set (LIBRARIES m qwt)
|
||||
else ()
|
||||
set (LIBRARIES qwt)
|
||||
endif()
|
||||
set (LANGUAGES
|
||||
eng
|
||||
rus)
|
||||
set (RESOURCES ${PROJECT_RESOURCE_DIR}/resources.qrc)
|
||||
|
||||
message (STATUS "SOURCES: ${SOURCES}")
|
||||
message (STATUS "HEADERS: ${HEADERS}")
|
||||
message (STATUS "FORMS: ${FORMS}")
|
||||
|
||||
|
||||
# compile
|
||||
project (${PROJECT})
|
||||
# include_path
|
||||
include_directories (${PROJECT_INCLUDE_DIR}/${PROJECT}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
find_package (Qt4 REQUIRED)
|
||||
include (${QT_USE_FILE})
|
||||
qt4_add_resources (QRC_SOURCES ${RESOURCES})
|
||||
qt4_wrap_cpp (MOC_SOURCES ${HEADERS})
|
||||
qt4_wrap_ui (UI_HEADERS ${FORMS})
|
||||
foreach (LANGUAGE ${LANGUAGES})
|
||||
set (TS ${PROJECT_TRANSLATION_DIR}/${LANGUAGE}.ts)
|
||||
set (QM ${PROJECT_TRANSLATION_DIR}/${LANGUAGE}.qm)
|
||||
set (TRANSLATIONS ${TRANSLATIONS} ${TS})
|
||||
set (TRANSLATIONS_BINARY ${TRANSLATIONS_BINARY} ${QM})
|
||||
add_custom_command (
|
||||
OUTPUT ${QM}
|
||||
COMMAND ${QT_LRELEASE_EXECUTABLE} ${TS}
|
||||
MAIN_DEPENDENCY ${TS})
|
||||
endforeach()
|
||||
add_custom_target (
|
||||
translations
|
||||
COMMAND ${QT_LUPDATE_EXECUTABLE} ${HEADERS} ${SOURCES} -ts ${TRANSLATIONS})
|
||||
add_custom_command (
|
||||
TARGET translations
|
||||
COMMAND ${QT_LRELEASE_EXECUTABLE} ${TRANSLATIONS})
|
||||
|
||||
source_group ("Header Files" FILES ${HEADERS})
|
||||
source_group ("Source Files" FILES ${SOURCES})
|
||||
source_group ("Generated Files" FILES ${MOC_SOURCES})
|
||||
source_group ("Resource Files" FILES ${QRC_SOURCES})
|
||||
|
||||
add_executable (${PROJECT} WIN32 ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${TRANSLATIONS})
|
||||
|
||||
target_link_libraries (${PROJECT} ${LIBRARIES} ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
|
||||
|
||||
# install properties
|
||||
INSTALL (TARGETS ${PROJECT} DESTINATION bin)
|
||||
@@ -0,0 +1,429 @@
|
||||
#############################################################################
|
||||
# Makefile for building: mathmech
|
||||
# Generated by qmake (2.01a) (Qt 4.8.5) on: ?? ??? 23 22:01:14 2013
|
||||
# Project: mathmech.pro
|
||||
# Template: app
|
||||
# Command: /usr/bin/qmake-qt4 -o Makefile mathmech.pro
|
||||
#############################################################################
|
||||
|
||||
####### Compiler, tools and options
|
||||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
DEFINES = -DQWT_DLL -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
|
||||
CFLAGS = -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wall -W -D_REENTRANT $(DEFINES)
|
||||
CXXFLAGS = -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wall -W -D_REENTRANT $(DEFINES)
|
||||
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSvg -I/usr/include/qt4 -I. -I/usr/include/qwt -I. -I.
|
||||
LINK = g++
|
||||
LFLAGS = -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1 -lrt
|
||||
LIBS = $(SUBLIBS) -L/usr/lib -L/usr/lib -lqwt -lQtSvg -lQtGui -lQtCore -lpthread
|
||||
AR = ar cqs
|
||||
RANLIB =
|
||||
QMAKE = /usr/bin/qmake-qt4
|
||||
TAR = tar -cf
|
||||
COMPRESS = gzip -9f
|
||||
COPY = cp -f
|
||||
SED = sed
|
||||
COPY_FILE = $(COPY)
|
||||
COPY_DIR = $(COPY) -r
|
||||
STRIP = strip
|
||||
INSTALL_FILE = install -m 644 -p
|
||||
INSTALL_DIR = $(COPY_DIR)
|
||||
INSTALL_PROGRAM = install -m 755 -p
|
||||
DEL_FILE = rm -f
|
||||
SYMLINK = ln -f -s
|
||||
DEL_DIR = rmdir
|
||||
MOVE = mv -f
|
||||
CHK_DIR_EXISTS= test -d
|
||||
MKDIR = mkdir -p
|
||||
|
||||
####### Output directory
|
||||
|
||||
OBJECTS_DIR = ./
|
||||
|
||||
####### Files
|
||||
|
||||
SOURCES = main.cpp \
|
||||
mainwindow.cpp \
|
||||
errorwindow.cpp \
|
||||
clear_items.cpp \
|
||||
start_events.cpp \
|
||||
update_fields.cpp \
|
||||
atomtypeswindow.cpp \
|
||||
agglwindow.cpp \
|
||||
aboutwindow.cpp \
|
||||
statgengraphwindow.cpp \
|
||||
settingswindow.cpp \
|
||||
aglallwindow.cpp moc_mainwindow.cpp \
|
||||
moc_errorwindow.cpp \
|
||||
moc_clear_items.cpp \
|
||||
moc_start_events.cpp \
|
||||
moc_update_fields.cpp \
|
||||
moc_atomtypeswindow.cpp \
|
||||
moc_agglwindow.cpp \
|
||||
moc_aboutwindow.cpp \
|
||||
moc_statgengraphwindow.cpp \
|
||||
moc_settingswindow.cpp \
|
||||
moc_aglallwindow.cpp
|
||||
OBJECTS = main.o \
|
||||
mainwindow.o \
|
||||
errorwindow.o \
|
||||
clear_items.o \
|
||||
start_events.o \
|
||||
update_fields.o \
|
||||
atomtypeswindow.o \
|
||||
agglwindow.o \
|
||||
aboutwindow.o \
|
||||
statgengraphwindow.o \
|
||||
settingswindow.o \
|
||||
aglallwindow.o \
|
||||
moc_mainwindow.o \
|
||||
moc_errorwindow.o \
|
||||
moc_clear_items.o \
|
||||
moc_start_events.o \
|
||||
moc_update_fields.o \
|
||||
moc_atomtypeswindow.o \
|
||||
moc_agglwindow.o \
|
||||
moc_aboutwindow.o \
|
||||
moc_statgengraphwindow.o \
|
||||
moc_settingswindow.o \
|
||||
moc_aglallwindow.o
|
||||
DIST = /usr/share/qt4/mkspecs/common/unix.conf \
|
||||
/usr/share/qt4/mkspecs/common/linux.conf \
|
||||
/usr/share/qt4/mkspecs/common/gcc-base.conf \
|
||||
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
|
||||
/usr/share/qt4/mkspecs/common/g++-base.conf \
|
||||
/usr/share/qt4/mkspecs/common/g++-unix.conf \
|
||||
/usr/share/qt4/mkspecs/qconfig.pri \
|
||||
/usr/share/qt4/mkspecs/modules/qt_phonon.pri \
|
||||
/usr/share/qt4/mkspecs/modules/qt_webkit.pri \
|
||||
/usr/share/qt4/mkspecs/features/qt_functions.prf \
|
||||
/usr/share/qt4/mkspecs/features/qt_config.prf \
|
||||
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
|
||||
/usr/share/qt4/mkspecs/features/default_pre.prf \
|
||||
/usr/share/qt4/mkspecs/features/release.prf \
|
||||
/usr/share/qt4/mkspecs/features/default_post.prf \
|
||||
/usr/share/qt4/mkspecs/features/qwtconfig.pri \
|
||||
/usr/share/qt4/mkspecs/features/qwtfunctions.pri \
|
||||
/usr/share/qt4/mkspecs/features/qwt.prf \
|
||||
/usr/share/qt4/mkspecs/features/shared.prf \
|
||||
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
|
||||
/usr/share/qt4/mkspecs/features/warn_on.prf \
|
||||
/usr/share/qt4/mkspecs/features/qt.prf \
|
||||
/usr/share/qt4/mkspecs/features/unix/thread.prf \
|
||||
/usr/share/qt4/mkspecs/features/moc.prf \
|
||||
/usr/share/qt4/mkspecs/features/resources.prf \
|
||||
/usr/share/qt4/mkspecs/features/uic.prf \
|
||||
/usr/share/qt4/mkspecs/features/yacc.prf \
|
||||
/usr/share/qt4/mkspecs/features/lex.prf \
|
||||
/usr/share/qt4/mkspecs/features/include_source_dir.prf \
|
||||
mathmech.pro
|
||||
QMAKE_TARGET = mathmech
|
||||
DESTDIR =
|
||||
TARGET = mathmech
|
||||
|
||||
first: all
|
||||
####### Implicit rules
|
||||
|
||||
.SUFFIXES: .o .c .cpp .cc .cxx .C
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
.cc.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
.cxx.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
.C.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
####### Build rules
|
||||
|
||||
all: Makefile $(TARGET)
|
||||
|
||||
$(TARGET): ui_mainwindow.h ui_errorwindow.h ui_atomtypeswindow.h ui_agglwindow.h ui_aboutwindow.h ui_statgengraphwindow.h ui_settingswindow.h ui_aglallwindow.h $(OBJECTS)
|
||||
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
|
||||
|
||||
Makefile: mathmech.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
|
||||
/usr/share/qt4/mkspecs/common/linux.conf \
|
||||
/usr/share/qt4/mkspecs/common/gcc-base.conf \
|
||||
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
|
||||
/usr/share/qt4/mkspecs/common/g++-base.conf \
|
||||
/usr/share/qt4/mkspecs/common/g++-unix.conf \
|
||||
/usr/share/qt4/mkspecs/qconfig.pri \
|
||||
/usr/share/qt4/mkspecs/modules/qt_phonon.pri \
|
||||
/usr/share/qt4/mkspecs/modules/qt_webkit.pri \
|
||||
/usr/share/qt4/mkspecs/features/qt_functions.prf \
|
||||
/usr/share/qt4/mkspecs/features/qt_config.prf \
|
||||
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
|
||||
/usr/share/qt4/mkspecs/features/default_pre.prf \
|
||||
/usr/share/qt4/mkspecs/features/release.prf \
|
||||
/usr/share/qt4/mkspecs/features/default_post.prf \
|
||||
/usr/share/qt4/mkspecs/features/qwtconfig.pri \
|
||||
/usr/share/qt4/mkspecs/features/qwtfunctions.pri \
|
||||
/usr/share/qt4/mkspecs/features/qwt.prf \
|
||||
/usr/share/qt4/mkspecs/features/shared.prf \
|
||||
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
|
||||
/usr/share/qt4/mkspecs/features/warn_on.prf \
|
||||
/usr/share/qt4/mkspecs/features/qt.prf \
|
||||
/usr/share/qt4/mkspecs/features/unix/thread.prf \
|
||||
/usr/share/qt4/mkspecs/features/moc.prf \
|
||||
/usr/share/qt4/mkspecs/features/resources.prf \
|
||||
/usr/share/qt4/mkspecs/features/uic.prf \
|
||||
/usr/share/qt4/mkspecs/features/yacc.prf \
|
||||
/usr/share/qt4/mkspecs/features/lex.prf \
|
||||
/usr/share/qt4/mkspecs/features/include_source_dir.prf \
|
||||
/usr/lib/libQtSvg.prl \
|
||||
/usr/lib/libQtGui.prl \
|
||||
/usr/lib/libQtCore.prl
|
||||
$(QMAKE) -o Makefile mathmech.pro
|
||||
/usr/share/qt4/mkspecs/common/unix.conf:
|
||||
/usr/share/qt4/mkspecs/common/linux.conf:
|
||||
/usr/share/qt4/mkspecs/common/gcc-base.conf:
|
||||
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf:
|
||||
/usr/share/qt4/mkspecs/common/g++-base.conf:
|
||||
/usr/share/qt4/mkspecs/common/g++-unix.conf:
|
||||
/usr/share/qt4/mkspecs/qconfig.pri:
|
||||
/usr/share/qt4/mkspecs/modules/qt_phonon.pri:
|
||||
/usr/share/qt4/mkspecs/modules/qt_webkit.pri:
|
||||
/usr/share/qt4/mkspecs/features/qt_functions.prf:
|
||||
/usr/share/qt4/mkspecs/features/qt_config.prf:
|
||||
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
|
||||
/usr/share/qt4/mkspecs/features/default_pre.prf:
|
||||
/usr/share/qt4/mkspecs/features/release.prf:
|
||||
/usr/share/qt4/mkspecs/features/default_post.prf:
|
||||
/usr/share/qt4/mkspecs/features/qwtconfig.pri:
|
||||
/usr/share/qt4/mkspecs/features/qwtfunctions.pri:
|
||||
/usr/share/qt4/mkspecs/features/qwt.prf:
|
||||
/usr/share/qt4/mkspecs/features/shared.prf:
|
||||
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
|
||||
/usr/share/qt4/mkspecs/features/warn_on.prf:
|
||||
/usr/share/qt4/mkspecs/features/qt.prf:
|
||||
/usr/share/qt4/mkspecs/features/unix/thread.prf:
|
||||
/usr/share/qt4/mkspecs/features/moc.prf:
|
||||
/usr/share/qt4/mkspecs/features/resources.prf:
|
||||
/usr/share/qt4/mkspecs/features/uic.prf:
|
||||
/usr/share/qt4/mkspecs/features/yacc.prf:
|
||||
/usr/share/qt4/mkspecs/features/lex.prf:
|
||||
/usr/share/qt4/mkspecs/features/include_source_dir.prf:
|
||||
/usr/lib/libQtSvg.prl:
|
||||
/usr/lib/libQtGui.prl:
|
||||
/usr/lib/libQtCore.prl:
|
||||
qmake: FORCE
|
||||
@$(QMAKE) -o Makefile mathmech.pro
|
||||
|
||||
dist:
|
||||
@$(CHK_DIR_EXISTS) .tmp/mathmech1.0.0 || $(MKDIR) .tmp/mathmech1.0.0
|
||||
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/mathmech1.0.0/ && $(COPY_FILE) --parents mainwindow.h errorwindow.h clear_items.h start_events.h update_fields.h atomtypeswindow.h agglwindow.h aboutwindow.h statgengraphwindow.h settingswindow.h aglallwindow.h .tmp/mathmech1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp errorwindow.cpp clear_items.cpp start_events.cpp update_fields.cpp atomtypeswindow.cpp agglwindow.cpp aboutwindow.cpp statgengraphwindow.cpp settingswindow.cpp aglallwindow.cpp .tmp/mathmech1.0.0/ && $(COPY_FILE) --parents mainwindow.ui errorwindow.ui atomtypeswindow.ui agglwindow.ui aboutwindow.ui statgengraphwindow.ui settingswindow.ui aglallwindow.ui .tmp/mathmech1.0.0/ && (cd `dirname .tmp/mathmech1.0.0` && $(TAR) mathmech1.0.0.tar mathmech1.0.0 && $(COMPRESS) mathmech1.0.0.tar) && $(MOVE) `dirname .tmp/mathmech1.0.0`/mathmech1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/mathmech1.0.0
|
||||
|
||||
|
||||
clean:compiler_clean
|
||||
-$(DEL_FILE) $(OBJECTS)
|
||||
-$(DEL_FILE) *~ core *.core
|
||||
|
||||
|
||||
####### Sub-libraries
|
||||
|
||||
distclean: clean
|
||||
-$(DEL_FILE) $(TARGET)
|
||||
-$(DEL_FILE) Makefile
|
||||
|
||||
|
||||
check: first
|
||||
|
||||
mocclean: compiler_moc_header_clean compiler_moc_source_clean
|
||||
|
||||
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
|
||||
|
||||
compiler_moc_header_make_all: moc_mainwindow.cpp moc_errorwindow.cpp moc_clear_items.cpp moc_start_events.cpp moc_update_fields.cpp moc_atomtypeswindow.cpp moc_agglwindow.cpp moc_aboutwindow.cpp moc_statgengraphwindow.cpp moc_settingswindow.cpp moc_aglallwindow.cpp
|
||||
compiler_moc_header_clean:
|
||||
-$(DEL_FILE) moc_mainwindow.cpp moc_errorwindow.cpp moc_clear_items.cpp moc_start_events.cpp moc_update_fields.cpp moc_atomtypeswindow.cpp moc_agglwindow.cpp moc_aboutwindow.cpp moc_statgengraphwindow.cpp moc_settingswindow.cpp moc_aglallwindow.cpp
|
||||
moc_mainwindow.cpp: mainwindow.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp
|
||||
|
||||
moc_errorwindow.cpp: errorwindow.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) errorwindow.h -o moc_errorwindow.cpp
|
||||
|
||||
moc_clear_items.cpp: clear_items.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) clear_items.h -o moc_clear_items.cpp
|
||||
|
||||
moc_start_events.cpp: start_events.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) start_events.h -o moc_start_events.cpp
|
||||
|
||||
moc_update_fields.cpp: update_fields.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) update_fields.h -o moc_update_fields.cpp
|
||||
|
||||
moc_atomtypeswindow.cpp: atomtypeswindow.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) atomtypeswindow.h -o moc_atomtypeswindow.cpp
|
||||
|
||||
moc_agglwindow.cpp: agglwindow.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) agglwindow.h -o moc_agglwindow.cpp
|
||||
|
||||
moc_aboutwindow.cpp: aboutwindow.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) aboutwindow.h -o moc_aboutwindow.cpp
|
||||
|
||||
moc_statgengraphwindow.cpp: statgengraphwindow.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) statgengraphwindow.h -o moc_statgengraphwindow.cpp
|
||||
|
||||
moc_settingswindow.cpp: settingswindow.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) settingswindow.h -o moc_settingswindow.cpp
|
||||
|
||||
moc_aglallwindow.cpp: aglallwindow.h
|
||||
/usr/lib/qt4/bin/moc $(DEFINES) $(INCPATH) aglallwindow.h -o moc_aglallwindow.cpp
|
||||
|
||||
compiler_rcc_make_all:
|
||||
compiler_rcc_clean:
|
||||
compiler_image_collection_make_all: qmake_image_collection.cpp
|
||||
compiler_image_collection_clean:
|
||||
-$(DEL_FILE) qmake_image_collection.cpp
|
||||
compiler_moc_source_make_all:
|
||||
compiler_moc_source_clean:
|
||||
compiler_uic_make_all: ui_mainwindow.h ui_errorwindow.h ui_atomtypeswindow.h ui_agglwindow.h ui_aboutwindow.h ui_statgengraphwindow.h ui_settingswindow.h ui_aglallwindow.h
|
||||
compiler_uic_clean:
|
||||
-$(DEL_FILE) ui_mainwindow.h ui_errorwindow.h ui_atomtypeswindow.h ui_agglwindow.h ui_aboutwindow.h ui_statgengraphwindow.h ui_settingswindow.h ui_aglallwindow.h
|
||||
ui_mainwindow.h: mainwindow.ui
|
||||
/usr/lib/qt4/bin/uic mainwindow.ui -o ui_mainwindow.h
|
||||
|
||||
ui_errorwindow.h: errorwindow.ui
|
||||
/usr/lib/qt4/bin/uic errorwindow.ui -o ui_errorwindow.h
|
||||
|
||||
ui_atomtypeswindow.h: atomtypeswindow.ui
|
||||
/usr/lib/qt4/bin/uic atomtypeswindow.ui -o ui_atomtypeswindow.h
|
||||
|
||||
ui_agglwindow.h: agglwindow.ui
|
||||
/usr/lib/qt4/bin/uic agglwindow.ui -o ui_agglwindow.h
|
||||
|
||||
ui_aboutwindow.h: aboutwindow.ui
|
||||
/usr/lib/qt4/bin/uic aboutwindow.ui -o ui_aboutwindow.h
|
||||
|
||||
ui_statgengraphwindow.h: statgengraphwindow.ui
|
||||
/usr/lib/qt4/bin/uic statgengraphwindow.ui -o ui_statgengraphwindow.h
|
||||
|
||||
ui_settingswindow.h: settingswindow.ui
|
||||
/usr/lib/qt4/bin/uic settingswindow.ui -o ui_settingswindow.h
|
||||
|
||||
ui_aglallwindow.h: aglallwindow.ui
|
||||
/usr/lib/qt4/bin/uic aglallwindow.ui -o ui_aglallwindow.h
|
||||
|
||||
compiler_yacc_decl_make_all:
|
||||
compiler_yacc_decl_clean:
|
||||
compiler_yacc_impl_make_all:
|
||||
compiler_yacc_impl_clean:
|
||||
compiler_lex_make_all:
|
||||
compiler_lex_clean:
|
||||
compiler_clean: compiler_moc_header_clean compiler_uic_clean
|
||||
|
||||
####### Compile
|
||||
|
||||
main.o: main.cpp mainwindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
|
||||
|
||||
mainwindow.o: mainwindow.cpp aboutwindow.h \
|
||||
agglwindow.h \
|
||||
aglallwindow.h \
|
||||
atomtypeswindow.h \
|
||||
settingswindow.h \
|
||||
clear_items.h \
|
||||
start_events.h \
|
||||
statgengraphwindow.h \
|
||||
update_fields.h \
|
||||
mainwindow.h \
|
||||
ui_mainwindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
|
||||
|
||||
errorwindow.o: errorwindow.cpp errorwindow.h \
|
||||
ui_errorwindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o errorwindow.o errorwindow.cpp
|
||||
|
||||
clear_items.o: clear_items.cpp clear_items.h \
|
||||
mainwindow.h \
|
||||
ui_mainwindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o clear_items.o clear_items.cpp
|
||||
|
||||
start_events.o: start_events.cpp mainwindow.h \
|
||||
ui_mainwindow.h \
|
||||
errorwindow.h \
|
||||
start_events.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o start_events.o start_events.cpp
|
||||
|
||||
update_fields.o: update_fields.cpp mainwindow.h \
|
||||
ui_mainwindow.h \
|
||||
update_fields.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o update_fields.o update_fields.cpp
|
||||
|
||||
atomtypeswindow.o: atomtypeswindow.cpp errorwindow.h \
|
||||
atomtypeswindow.h \
|
||||
ui_atomtypeswindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o atomtypeswindow.o atomtypeswindow.cpp
|
||||
|
||||
agglwindow.o: agglwindow.cpp errorwindow.h \
|
||||
agglwindow.h \
|
||||
ui_agglwindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o agglwindow.o agglwindow.cpp
|
||||
|
||||
aboutwindow.o: aboutwindow.cpp aboutwindow.h \
|
||||
ui_aboutwindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o aboutwindow.o aboutwindow.cpp
|
||||
|
||||
statgengraphwindow.o: statgengraphwindow.cpp statgengraphwindow.h \
|
||||
ui_statgengraphwindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o statgengraphwindow.o statgengraphwindow.cpp
|
||||
|
||||
settingswindow.o: settingswindow.cpp errorwindow.h \
|
||||
mainwindow.h \
|
||||
ui_mainwindow.h \
|
||||
settingswindow.h \
|
||||
ui_settingswindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o settingswindow.o settingswindow.cpp
|
||||
|
||||
aglallwindow.o: aglallwindow.cpp errorwindow.h \
|
||||
aglallwindow.h \
|
||||
ui_aglallwindow.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o aglallwindow.o aglallwindow.cpp
|
||||
|
||||
moc_mainwindow.o: moc_mainwindow.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
|
||||
|
||||
moc_errorwindow.o: moc_errorwindow.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_errorwindow.o moc_errorwindow.cpp
|
||||
|
||||
moc_clear_items.o: moc_clear_items.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_clear_items.o moc_clear_items.cpp
|
||||
|
||||
moc_start_events.o: moc_start_events.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_start_events.o moc_start_events.cpp
|
||||
|
||||
moc_update_fields.o: moc_update_fields.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_update_fields.o moc_update_fields.cpp
|
||||
|
||||
moc_atomtypeswindow.o: moc_atomtypeswindow.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_atomtypeswindow.o moc_atomtypeswindow.cpp
|
||||
|
||||
moc_agglwindow.o: moc_agglwindow.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_agglwindow.o moc_agglwindow.cpp
|
||||
|
||||
moc_aboutwindow.o: moc_aboutwindow.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_aboutwindow.o moc_aboutwindow.cpp
|
||||
|
||||
moc_statgengraphwindow.o: moc_statgengraphwindow.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_statgengraphwindow.o moc_statgengraphwindow.cpp
|
||||
|
||||
moc_settingswindow.o: moc_settingswindow.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_settingswindow.o moc_settingswindow.cpp
|
||||
|
||||
moc_aglallwindow.o: moc_aglallwindow.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_aglallwindow.o moc_aglallwindow.cpp
|
||||
|
||||
####### Install
|
||||
|
||||
install: FORCE
|
||||
|
||||
uninstall: FORCE
|
||||
|
||||
FORCE:
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include "aboutwindow.h"
|
||||
#include "ui_aboutwindow.h"
|
||||
|
||||
AboutWindow::AboutWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::AboutWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
AboutWindow::~AboutWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// ESC press event
|
||||
void AboutWindow::keyPressEvent(QKeyEvent *pressedKey)
|
||||
{
|
||||
if (pressedKey->key() == Qt::Key_Escape)
|
||||
close();
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef ABOUTWINDOW_H
|
||||
#define ABOUTWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
namespace Ui {
|
||||
class AboutWindow;
|
||||
}
|
||||
|
||||
class AboutWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AboutWindow(QWidget *parent = 0);
|
||||
~AboutWindow();
|
||||
|
||||
private:
|
||||
Ui::AboutWindow *ui;
|
||||
|
||||
// ESC pressed event
|
||||
void keyPressEvent(QKeyEvent *pressedKey);
|
||||
};
|
||||
|
||||
#endif /* ABOUTWINDOW_H */
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AboutWindow</class>
|
||||
<widget class="QMainWindow" name="AboutWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>383</width>
|
||||
<height>320</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>About</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Liberation Serif'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Mathematical Molecular Mechanics</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Version:</span> 1.0.0</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">License:</span> GPL</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Author:</span> Evgeniy Alekseev</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">E-mail:</span> esalexeev@gmail.com</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Graphical user interface for &quot;mathmech&quot; program pack.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="about_layout_buttons">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="about_pushButton_close">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>textBrowser</tabstop>
|
||||
<tabstop>about_pushButton_close</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>about_pushButton_close</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>AboutWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>358</x>
|
||||
<y>303</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>358</x>
|
||||
<y>314</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,185 @@
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QKeyEvent>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "errorwindow.h"
|
||||
|
||||
#include "agglwindow.h"
|
||||
#include "ui_agglwindow.h"
|
||||
|
||||
AgglWindow::AgglWindow(QWidget *parent, QString inputfile) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::AgglWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->agl_lineEdit_input->setText(inputfile);
|
||||
}
|
||||
|
||||
AgglWindow::~AgglWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// ESC press event
|
||||
void AgglWindow::keyPressEvent(QKeyEvent *pressedKey)
|
||||
{
|
||||
if (pressedKey->key() == Qt::Key_Escape)
|
||||
close();
|
||||
}
|
||||
|
||||
// events
|
||||
void AgglWindow::on_agl_pushButton_input_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select file"),
|
||||
QDir::currentPath(),
|
||||
tr("'statgen' output files (*.dat);;All files (*.*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->agl_lineEdit_input->setText(filename);
|
||||
}
|
||||
|
||||
void AgglWindow::on_pushButton_clicked()
|
||||
{
|
||||
errorwin = new ErrorWindow(this);
|
||||
|
||||
QString input = ui->agl_lineEdit_input->text();
|
||||
QString tmp_str;
|
||||
QFile inp_agl(input);
|
||||
bool exists = inp_agl.open(QIODevice::ReadOnly);
|
||||
if ((input == "") || (!exists))
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
tmp_str = QString(inp_agl.readLine());
|
||||
if (!tmp_str.contains(QString("statgen")))
|
||||
{
|
||||
errorwin->set_message(11);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
|
||||
while (!tmp_str.contains(QString("END")))
|
||||
tmp_str = QString(inp_agl.readLine());
|
||||
|
||||
QStringList cur_aggl_mol, one_file_aggl, one_file_aggl_mol;
|
||||
int mol;
|
||||
while (!tmp_str.contains(QString("SUMMARY STATISTIC")))
|
||||
{
|
||||
tmp_str = QString(inp_agl.readLine());
|
||||
if (tmp_str.contains(QString("FILE=")))
|
||||
{
|
||||
inp_file.append(tmp_str.split(QString("FILE="), QString::SkipEmptyParts)[0].
|
||||
split(QString("\n"), QString::SkipEmptyParts)[0]);
|
||||
aggl.append(one_file_aggl.join(QString(";")));
|
||||
one_file_aggl.clear();
|
||||
aggl_mol.append(one_file_aggl_mol.join(QString(";")));
|
||||
one_file_aggl_mol.clear();
|
||||
}
|
||||
else if (tmp_str.contains(QString("AGL=")))
|
||||
{
|
||||
cur_aggl_mol.clear();
|
||||
mol = tmp_str.split('=')[1].toInt();
|
||||
one_file_aggl.append(tmp_str.split(QString("AGL="), QString::SkipEmptyParts)[0].
|
||||
split(QString("\n"), QString::SkipEmptyParts)[0]);
|
||||
for (int i=0; i<mol; i++)
|
||||
{
|
||||
tmp_str = QString(inp_agl.readLine());
|
||||
cur_aggl_mol.append(tmp_str);
|
||||
}
|
||||
one_file_aggl_mol.append(cur_aggl_mol.join(QString("")));
|
||||
}
|
||||
}
|
||||
aggl.append(one_file_aggl.join(QString(";")));
|
||||
one_file_aggl.clear();
|
||||
aggl.removeFirst();
|
||||
aggl_mol.append(one_file_aggl_mol.join(QString(";")));
|
||||
one_file_aggl_mol.clear();
|
||||
aggl_mol.removeFirst();
|
||||
inp_agl.close();
|
||||
|
||||
ui->agl_comboBox->clear();
|
||||
ui->agl_comboBox->addItems(inp_file);
|
||||
|
||||
delete errorwin;
|
||||
}
|
||||
|
||||
void AgglWindow::on_agl_comboBox_currentIndexChanged(int index)
|
||||
{
|
||||
ui->agl_listWidget->clear();
|
||||
ui->agl_textBrowser->clear();
|
||||
if (index != -1)
|
||||
{
|
||||
ui->agl_listWidget->addItems(aggl[index].split(QString(";")));
|
||||
ui->agl_listWidget->setCurrentRow(0);
|
||||
}
|
||||
}
|
||||
|
||||
void AgglWindow::on_agl_listWidget_itemActivated()
|
||||
{
|
||||
int index = ui->agl_listWidget->currentRow();
|
||||
ui->agl_textBrowser->clear();
|
||||
ui->agl_textBrowser->setText(aggl_mol[ui->agl_comboBox->currentIndex()].split(QString(";"))[index]);
|
||||
ui->agl_lineEdit_output->setText(QFileInfo(ui->agl_lineEdit_input->text()).canonicalPath() + QDir::separator() +
|
||||
QFileInfo(ui->agl_lineEdit_input->text()).completeBaseName() +
|
||||
QString("_") + QString::number(ui->agl_comboBox->currentIndex()) +
|
||||
QString("_") + QString::number(index) + QString(".agl"));
|
||||
}
|
||||
|
||||
void AgglWindow::on_agl_pushButton_output_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save file as..."),
|
||||
QDir::currentPath(),
|
||||
tr("Agglomerate files (*.agl);;All files (*.*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->agl_lineEdit_output->setText(filename);
|
||||
}
|
||||
|
||||
void AgglWindow::on_agl_pushButton_clear_clicked()
|
||||
{
|
||||
aggl.clear();
|
||||
aggl_mol.clear();
|
||||
inp_file.clear();
|
||||
ui->agl_comboBox->clear();
|
||||
ui->agl_lineEdit_input->clear();
|
||||
ui->agl_lineEdit_output->clear();
|
||||
}
|
||||
|
||||
void AgglWindow::on_agl_pushButton_create_clicked()
|
||||
{
|
||||
errorwin = new ErrorWindow(this);
|
||||
|
||||
QString output = ui->agl_lineEdit_output->text();
|
||||
int file_num = ui->agl_comboBox->currentIndex();
|
||||
int aggl_num = ui->agl_listWidget->currentRow();
|
||||
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
|
||||
output = QFileInfo(output).absoluteFilePath();
|
||||
QFile f_out(output);
|
||||
if (!f_out.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
errorwin->set_message(9);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
QTextStream out(&f_out);
|
||||
out << "AGL=" << aggl[file_num].split(QString(";"))[aggl_num] << "\n";
|
||||
out << aggl_mol[file_num].split(QString(";"))[aggl_num];
|
||||
f_out.close();
|
||||
|
||||
ui->agl_lineEdit_output->clear();
|
||||
|
||||
delete errorwin;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef AGGLWINDOW_H
|
||||
#define AGGLWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
class ErrorWindow;
|
||||
|
||||
namespace Ui {
|
||||
class AgglWindow;
|
||||
}
|
||||
|
||||
class AgglWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AgglWindow(QWidget *parent = 0, QString inputfile = "");
|
||||
~AgglWindow();
|
||||
|
||||
private slots:
|
||||
// events
|
||||
void on_agl_pushButton_input_clicked();
|
||||
void on_pushButton_clicked();
|
||||
void on_agl_comboBox_currentIndexChanged(int index);
|
||||
void on_agl_listWidget_itemActivated();
|
||||
void on_agl_pushButton_output_clicked();
|
||||
void on_agl_pushButton_clear_clicked();
|
||||
void on_agl_pushButton_create_clicked();
|
||||
|
||||
private:
|
||||
Ui::AgglWindow *ui;
|
||||
ErrorWindow *errorwin;
|
||||
QStringList inp_file;
|
||||
QStringList aggl;
|
||||
QStringList aggl_mol;
|
||||
|
||||
// ESC pressed event
|
||||
void keyPressEvent(QKeyEvent *pressedKey);
|
||||
};
|
||||
|
||||
#endif /* AGGLWINDOW_H */
|
||||
@@ -0,0 +1,268 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AgglWindow</class>
|
||||
<widget class="QMainWindow" name="AgglWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>396</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Agglomerate</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="agl_layout_input">
|
||||
<item>
|
||||
<widget class="QLabel" name="agl_label_input">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Input file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="agl_lineEdit_input">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="agl_pushButton_input">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="agl_comboBox"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="agl_listWidget">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="agl_textBrowser"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="agl_layout_output">
|
||||
<item>
|
||||
<widget class="QLabel" name="agl_label_output">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Output file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="agl_lineEdit_output">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="agl_pushButton_output">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="agl_layout_buttons">
|
||||
<item>
|
||||
<widget class="QPushButton" name="agl_pushButton_clear">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="agl_pushButton_create">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="agl_pushButton_close">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>agl_lineEdit_input</tabstop>
|
||||
<tabstop>agl_pushButton_input</tabstop>
|
||||
<tabstop>pushButton</tabstop>
|
||||
<tabstop>agl_comboBox</tabstop>
|
||||
<tabstop>agl_listWidget</tabstop>
|
||||
<tabstop>agl_textBrowser</tabstop>
|
||||
<tabstop>agl_lineEdit_output</tabstop>
|
||||
<tabstop>agl_pushButton_output</tabstop>
|
||||
<tabstop>agl_pushButton_clear</tabstop>
|
||||
<tabstop>agl_pushButton_create</tabstop>
|
||||
<tabstop>agl_pushButton_close</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>agl_pushButton_close</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>AgglWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>344</x>
|
||||
<y>373</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>350</x>
|
||||
<y>398</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,222 @@
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QKeyEvent>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "errorwindow.h"
|
||||
|
||||
#include "aglallwindow.h"
|
||||
#include "ui_aglallwindow.h"
|
||||
|
||||
AglAllWindow::AglAllWindow(QWidget *parent, QString mm_agl_path) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::AglAllWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
_mm_agl_path = mm_agl_path;
|
||||
}
|
||||
|
||||
AglAllWindow::~AglAllWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// ESC press event
|
||||
void AglAllWindow::keyPressEvent(QKeyEvent *pressedKey)
|
||||
{
|
||||
if (pressedKey->key() == Qt::Key_Escape)
|
||||
close();
|
||||
}
|
||||
|
||||
void AglAllWindow::on_aglall_pushButton_clear_clicked()
|
||||
{
|
||||
ui->aglall_lineEdit_workDir->clear();
|
||||
ui->aglall_lineEdit_input->clear();
|
||||
ui->aglall_lineEdit_output->clear();
|
||||
ui->aglall_spinBox_file->setValue(0);
|
||||
ui->aglall_spinBox_num->setValue(0);
|
||||
}
|
||||
|
||||
void AglAllWindow::on_aglall_pushButton_workDir_clicked()
|
||||
{
|
||||
QString dirname = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Select work directory"),
|
||||
QDir::currentPath());
|
||||
if (!dirname.isEmpty())
|
||||
ui->aglall_lineEdit_workDir->setText(dirname);
|
||||
}
|
||||
|
||||
void AglAllWindow::on_pdb_pushButton_input_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select trajectory file"),
|
||||
QDir(ui->aglall_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("'statgen' output files (*.dat);;All files (*.*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->aglall_lineEdit_input->setText(filename);
|
||||
}
|
||||
|
||||
void AglAllWindow::on_aglall_pushButton_output_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save file as..."),
|
||||
QDir(ui->aglall_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("PDB files (*.pdb);;All files (*.*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->aglall_lineEdit_output->setText(filename.split(QString("."))[0]);
|
||||
}
|
||||
|
||||
void AglAllWindow::on_aglall_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralwidget->setDisabled(true);
|
||||
start_agl();
|
||||
ui->centralwidget->setEnabled(true);
|
||||
}
|
||||
|
||||
void AglAllWindow::start_agl()
|
||||
{
|
||||
errorwin = new ErrorWindow(this);
|
||||
ui->statusbar->showMessage(QApplication::translate("AglAll", "Processing 'agl'..."));
|
||||
ui->statusbar->showMessage(QApplication::translate("AglAll", "Processing 'agl'..."));
|
||||
|
||||
// read variables
|
||||
QString workDir = ui->aglall_lineEdit_workDir->text();
|
||||
QString input = ui->aglall_lineEdit_input->text();
|
||||
QString output = ui->aglall_lineEdit_output->text();
|
||||
|
||||
// error check
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if (input == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if (!QFile(_mm_agl_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if (output.contains(QString(".pdb")))
|
||||
output = output.split(QString(".pdb"), QString::SkipEmptyParts)[0];
|
||||
if (output.contains(QDir::separator()))
|
||||
output = QFileInfo(output).absoluteFilePath();
|
||||
else
|
||||
output = QFileInfo(QDir(workDir), output).absoluteFilePath();
|
||||
|
||||
// reading file
|
||||
QString tmp_str;
|
||||
QFile inp_agl(input);
|
||||
bool exists = inp_agl.open(QIODevice::ReadOnly);
|
||||
if (!exists)
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
tmp_str = QString(inp_agl.readLine());
|
||||
if (!tmp_str.contains(QString("statgen")))
|
||||
{
|
||||
errorwin->set_message(11);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
|
||||
QString mask;
|
||||
float cellX, cellY, cellZ;
|
||||
while (!tmp_str.contains(QString("END")))
|
||||
{
|
||||
if (tmp_str.contains(QString("MASK=")))
|
||||
mask = tmp_str.split(QString("MASK="), QString::SkipEmptyParts)[0];
|
||||
else if (tmp_str.contains(QString("CELL=")))
|
||||
{
|
||||
cellX = tmp_str.split(QString("CELL="), QString::SkipEmptyParts)[0].
|
||||
split(QString(","), QString::SkipEmptyParts)[0].toFloat();
|
||||
cellY = tmp_str.split(QString("CELL="), QString::SkipEmptyParts)[0].
|
||||
split(QString(","), QString::SkipEmptyParts)[1].toFloat();
|
||||
cellZ = tmp_str.split(QString("CELL="), QString::SkipEmptyParts)[0].
|
||||
split(QString(","), QString::SkipEmptyParts)[2].toFloat();
|
||||
}
|
||||
tmp_str = QString(inp_agl.readLine());
|
||||
}
|
||||
char cell[256];
|
||||
sprintf (cell, "%.4f,%.4f,%.4f", cellX, cellY, cellZ);
|
||||
|
||||
int num_file = ui->aglall_spinBox_file->value();
|
||||
int num_mol = ui->aglall_spinBox_num->value();
|
||||
int agl_num = 0, cur_agl_size = -1, cur_file = -1;
|
||||
QString agl_output, cur_file_name;
|
||||
while (!tmp_str.contains(QString("SUMMARY STATISTIC")))
|
||||
{
|
||||
if (tmp_str.contains(QString("FILE=")))
|
||||
{
|
||||
cur_file = tmp_str.split(QString("FILE="), QString::SkipEmptyParts)[0].
|
||||
split(QString("\n"), QString::SkipEmptyParts)[0].
|
||||
split(QString("."), QString::SkipEmptyParts).last().toInt();
|
||||
cur_file_name = tmp_str.split(QString("FILE="), QString::SkipEmptyParts)[0].
|
||||
split(QString("\n"), QString::SkipEmptyParts)[0];
|
||||
}
|
||||
else if ((tmp_str.contains(QString("AGL="))) &&
|
||||
((cur_file == num_file) || (num_file == 0)))
|
||||
{
|
||||
cur_agl_size = tmp_str.split(QString("="), QString::SkipEmptyParts)[1].toInt();
|
||||
if ((cur_agl_size == num_mol) || (num_mol == 0))
|
||||
{
|
||||
agl_output = workDir + QString("/temp_agl.agl");
|
||||
QFile f_out(agl_output);
|
||||
if (!f_out.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
errorwin->set_message(9);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
QTextStream out(&f_out);
|
||||
out << tmp_str;
|
||||
for (int i=0; i<cur_agl_size; i++)
|
||||
{
|
||||
tmp_str = QString(inp_agl.readLine());
|
||||
out << tmp_str;
|
||||
}
|
||||
f_out.close();
|
||||
// start event
|
||||
agl_num++;
|
||||
start_agl_event(agl_output, cur_file_name, QString(cell),
|
||||
output + QString("_") + QString::number(cur_file) +
|
||||
QString("_") + QString::number(agl_num) + QString(".pdb"));
|
||||
}
|
||||
}
|
||||
tmp_str = QString(inp_agl.readLine());
|
||||
}
|
||||
inp_agl.close();
|
||||
|
||||
ui->statusbar->showMessage(QApplication::translate("AglAll", "Done"));
|
||||
delete errorwin;
|
||||
}
|
||||
|
||||
void AglAllWindow::start_agl_event(QString aglfile, QString trjfile, QString cellsize, QString out_file)
|
||||
{
|
||||
QString command;
|
||||
command.append(_mm_agl_path);
|
||||
command.append(" -a " + aglfile);
|
||||
command.append(" -i " + trjfile);
|
||||
command.append(" -c " + cellsize);
|
||||
command.append(" -o " + out_file);
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef AGLALLWINDOW_H
|
||||
#define AGLALLWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
class ErrorWindow;
|
||||
|
||||
namespace Ui {
|
||||
class AglAllWindow;
|
||||
}
|
||||
|
||||
class AglAllWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AglAllWindow(QWidget *parent = 0, QString mm_agl_path = "");
|
||||
~AglAllWindow();
|
||||
|
||||
private slots:
|
||||
void on_aglall_pushButton_clear_clicked();
|
||||
void on_aglall_pushButton_workDir_clicked();
|
||||
void on_pdb_pushButton_input_clicked();
|
||||
void on_aglall_pushButton_output_clicked();
|
||||
void on_aglall_pushButton_start_clicked();
|
||||
|
||||
private:
|
||||
Ui::AglAllWindow *ui;
|
||||
ErrorWindow *errorwin;
|
||||
QString _mm_agl_path;
|
||||
|
||||
void start_agl();
|
||||
void start_agl_event(QString aglfile, QString trjfile,
|
||||
QString cellsize, QString out_file);
|
||||
// ESC pressed event
|
||||
void keyPressEvent(QKeyEvent *pressedKey);
|
||||
};
|
||||
|
||||
#endif /* AGLALLWINDOW_H */
|
||||
@@ -0,0 +1,352 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AglAllWindow</class>
|
||||
<widget class="QMainWindow" name="AglAllWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>502</width>
|
||||
<height>260</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>agl_all</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="aglall_layout_workDir">
|
||||
<item>
|
||||
<widget class="QLabel" name="aglall_label_workDir">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Work directory</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="aglall_lineEdit_workDir">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>280</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="aglall_pushButton_workDir">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="aglall_layout_input">
|
||||
<item>
|
||||
<widget class="QLabel" name="aglall_label_input">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Input file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="aglall_lineEdit_input">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>280</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pdb_pushButton_input">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="aglall_layout_output">
|
||||
<item>
|
||||
<widget class="QLabel" name="aglall_label_output">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mask of output files</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="aglall_lineEdit_output">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>280</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="aglall_pushButton_output">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="aglall_layout_num">
|
||||
<item>
|
||||
<widget class="QLabel" name="aglall_label_file">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="aglall_spinBox_file">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="aglall_label_num">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Number of molecules</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="aglall_spinBox_num">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="aglall_layout_buttons">
|
||||
<item>
|
||||
<widget class="QPushButton" name="aglall_pushButton_clear">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_15">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="aglall_pushButton_start">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="aglall_pushButton_close">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>aglall_lineEdit_workDir</tabstop>
|
||||
<tabstop>aglall_pushButton_workDir</tabstop>
|
||||
<tabstop>aglall_lineEdit_input</tabstop>
|
||||
<tabstop>pdb_pushButton_input</tabstop>
|
||||
<tabstop>aglall_lineEdit_output</tabstop>
|
||||
<tabstop>aglall_pushButton_output</tabstop>
|
||||
<tabstop>aglall_spinBox_file</tabstop>
|
||||
<tabstop>aglall_spinBox_num</tabstop>
|
||||
<tabstop>aglall_pushButton_clear</tabstop>
|
||||
<tabstop>aglall_pushButton_start</tabstop>
|
||||
<tabstop>aglall_pushButton_close</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>aglall_pushButton_close</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>AglAllWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>462</x>
|
||||
<y>225</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>495</x>
|
||||
<y>224</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,154 @@
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QKeyEvent>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "errorwindow.h"
|
||||
|
||||
#include "atomtypeswindow.h"
|
||||
#include "ui_atomtypeswindow.h"
|
||||
|
||||
AtomTypesWindow::AtomTypesWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::AtomTypesWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
num_of_mol = new int[100];
|
||||
for (int i=0; i<100; i++)
|
||||
{
|
||||
num_of_mol[i] = 1;
|
||||
atomTypes.append(QString(""));
|
||||
}
|
||||
}
|
||||
|
||||
AtomTypesWindow::~AtomTypesWindow()
|
||||
{
|
||||
delete ui;
|
||||
delete num_of_mol;
|
||||
}
|
||||
|
||||
// ESC press event
|
||||
void AtomTypesWindow::keyPressEvent(QKeyEvent *pressedKey)
|
||||
{
|
||||
if (pressedKey->key() == Qt::Key_Escape)
|
||||
close();
|
||||
}
|
||||
|
||||
// events
|
||||
void AtomTypesWindow::on_atomTypes_pushButton_output_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save file as..."),
|
||||
QDir::currentPath(),
|
||||
tr("Atom types files (*.types);;All files (*.*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->atomTypes_lineEdit_output->setText(filename);
|
||||
}
|
||||
|
||||
void AtomTypesWindow::on_atomTypes_pushButton_add_clicked()
|
||||
{
|
||||
errorwin = new ErrorWindow(this);
|
||||
QString charAtomType = ui->atomTypes_lineEdit_chType->text();
|
||||
QString intAtomType= QString::number(ui->atomTypes_spinBox_intType->value());
|
||||
|
||||
if ((charAtomType.count() != 2) || (charAtomType.split(' ', QString::SkipEmptyParts)[0] != charAtomType))
|
||||
{
|
||||
errorwin->set_message(5);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
|
||||
ui->atomTypes_listWidget->addItem(charAtomType + "=" + intAtomType);
|
||||
atomTypes[ui->atomTypes_comboBox_mol->currentIndex()] = QString("");
|
||||
for (int i=0; i<ui->atomTypes_listWidget->count(); i++)
|
||||
atomTypes[ui->atomTypes_comboBox_mol->currentIndex()].append(ui->atomTypes_listWidget->item(i)->text() + ",");
|
||||
|
||||
delete errorwin;
|
||||
}
|
||||
|
||||
void AtomTypesWindow::on_atomTypes_pushButton_typeRem_clicked()
|
||||
{
|
||||
int curIndex = ui->atomTypes_listWidget->currentRow();
|
||||
if (curIndex > -1)
|
||||
delete ui->atomTypes_listWidget->item(curIndex);
|
||||
}
|
||||
|
||||
void AtomTypesWindow::on_atomTypes_pushButton_clear_clicked()
|
||||
{
|
||||
for (int i=0; i<100; i++)
|
||||
{
|
||||
num_of_mol[i] = 1;
|
||||
atomTypes[i] = QString("");
|
||||
}
|
||||
ui->atomTypes_lineEdit_output->clear();
|
||||
ui->atomTypes_comboBox_mol->clear();
|
||||
ui->atomTypes_comboBox_mol->addItem(QString("1"));
|
||||
ui->atomTypes_comboBox_mol->addItem(QApplication::translate("AtomTypesWindow", "Add new molecule"));
|
||||
}
|
||||
|
||||
void AtomTypesWindow::on_atomTypes_spinBox_numOfMol_editingFinished()
|
||||
{
|
||||
num_of_mol[ui->atomTypes_comboBox_mol->currentIndex()] = ui->atomTypes_spinBox_numOfMol->value();
|
||||
}
|
||||
|
||||
void AtomTypesWindow::on_atomTypes_comboBox_mol_currentIndexChanged(int index)
|
||||
{
|
||||
ui->atomTypes_lineEdit_chType->clear();
|
||||
ui->atomTypes_spinBox_intType->setValue(1);
|
||||
ui->atomTypes_listWidget->clear();
|
||||
if (ui->atomTypes_comboBox_mol->itemText(index) == (QApplication::translate("AtomTypesWindow", "Add new molecule")))
|
||||
{
|
||||
ui->atomTypes_comboBox_mol->setItemText(index, QString::number(index+1));
|
||||
ui->atomTypes_comboBox_mol->addItem(QApplication::translate("AtomTypesWindow", "Add new molecule"));
|
||||
ui->atomTypes_spinBox_numOfMol->setValue(num_of_mol[index]);
|
||||
}
|
||||
else if (index != -1)
|
||||
{
|
||||
ui->atomTypes_spinBox_numOfMol->setValue(num_of_mol[index]);
|
||||
ui->atomTypes_listWidget->addItems(atomTypes[index].split(',', QString::SkipEmptyParts));
|
||||
}
|
||||
}
|
||||
|
||||
void AtomTypesWindow::on_atomTypes_pushButton_create_clicked()
|
||||
{
|
||||
errorwin = new ErrorWindow(this);
|
||||
QString output = ui->atomTypes_lineEdit_output->text();
|
||||
QString num_mol = QString::number(ui->atomTypes_comboBox_mol->count() - 1);
|
||||
|
||||
for (int i=0; i<num_mol.toInt(); i++)
|
||||
if (atomTypes[i] == "")
|
||||
{
|
||||
errorwin->set_message(8);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
|
||||
output = QFileInfo(output).absoluteFilePath();
|
||||
QFile f_out(output);
|
||||
if (!f_out.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
errorwin->set_message(9);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
QTextStream out(&f_out);
|
||||
out << "NUMTYPES=" << num_mol << "\n";
|
||||
for (int i=0; i<num_mol.toInt(); i++)
|
||||
{
|
||||
out << "NUMMOL=" << num_of_mol[i] << "\n";
|
||||
out << "NUMAT=" << atomTypes[i].split(',', QString::SkipEmptyParts).count() << "\n";
|
||||
out << atomTypes[i].split(',', QString::SkipEmptyParts).join("\n") << "\n";
|
||||
}
|
||||
f_out.close();
|
||||
|
||||
on_atomTypes_pushButton_clear_clicked();
|
||||
|
||||
delete errorwin;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef ATOMTYPESWINDOW_H
|
||||
#define ATOMTYPESWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
class ErrorWindow;
|
||||
|
||||
namespace Ui {
|
||||
class AtomTypesWindow;
|
||||
}
|
||||
|
||||
class AtomTypesWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AtomTypesWindow(QWidget *parent = 0);
|
||||
~AtomTypesWindow();
|
||||
|
||||
private slots:
|
||||
// events
|
||||
void on_atomTypes_pushButton_output_clicked();
|
||||
void on_atomTypes_pushButton_add_clicked();
|
||||
void on_atomTypes_pushButton_typeRem_clicked();
|
||||
void on_atomTypes_pushButton_clear_clicked();
|
||||
void on_atomTypes_spinBox_numOfMol_editingFinished();
|
||||
void on_atomTypes_comboBox_mol_currentIndexChanged(int index);
|
||||
void on_atomTypes_pushButton_create_clicked();
|
||||
|
||||
private:
|
||||
Ui::AtomTypesWindow *ui;
|
||||
ErrorWindow *errorwin;
|
||||
int *num_of_mol;
|
||||
QStringList atomTypes;
|
||||
|
||||
// ESC pressed event
|
||||
void keyPressEvent(QKeyEvent *pressedKey);
|
||||
};
|
||||
|
||||
#endif /* ATOMTYPESWINDOW_H */
|
||||
@@ -0,0 +1,361 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AtomTypesWindow</class>
|
||||
<widget class="QMainWindow" name="AtomTypesWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>468</width>
|
||||
<height>320</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Atom types</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="atomTypes_layout_output">
|
||||
<item>
|
||||
<widget class="QLabel" name="atomTypes_label_output">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Output file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="atomTypes_lineEdit_output">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="atomTypes_pushButton_output">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="atomTypes_layout_mol">
|
||||
<item>
|
||||
<widget class="QLabel" name="atomTypes_label_mol">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Molecule</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="atomTypes_comboBox_mol">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Add new molecule</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="atomTypes_label_numOfMol">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Number of molecules</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="atomTypes_spinBox_numOfMol">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="atomTypes_layout_atom">
|
||||
<item>
|
||||
<widget class="QLabel" name="atomTypes_label_chType">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Char atom type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="atomTypes_lineEdit_chType">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="atomTypes_label_intType">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Int atom type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="atomTypes_spinBox_intType">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="atomTypes_pushButton_add">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="atomTypes_listWidget">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="atomTypes_layout_intRem">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="atomTypes_pushButton_typeRem">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="atomTypes_layout_buttons">
|
||||
<item>
|
||||
<widget class="QPushButton" name="atomTypes_pushButton_clear">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="atomTypes_pushButton_create">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Create</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="atomTypes_pushButton_close">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>atomTypes_lineEdit_output</tabstop>
|
||||
<tabstop>atomTypes_pushButton_output</tabstop>
|
||||
<tabstop>atomTypes_comboBox_mol</tabstop>
|
||||
<tabstop>atomTypes_spinBox_numOfMol</tabstop>
|
||||
<tabstop>atomTypes_lineEdit_chType</tabstop>
|
||||
<tabstop>atomTypes_spinBox_intType</tabstop>
|
||||
<tabstop>atomTypes_pushButton_add</tabstop>
|
||||
<tabstop>atomTypes_listWidget</tabstop>
|
||||
<tabstop>atomTypes_pushButton_typeRem</tabstop>
|
||||
<tabstop>atomTypes_pushButton_clear</tabstop>
|
||||
<tabstop>atomTypes_pushButton_create</tabstop>
|
||||
<tabstop>atomTypes_pushButton_close</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>atomTypes_pushButton_close</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>AtomTypesWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>388</x>
|
||||
<y>294</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>447</x>
|
||||
<y>324</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,107 @@
|
||||
#include "clear_items.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
Clear_items::Clear_items(MainWindow *wid) :
|
||||
parent(wid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Clear_items::clear_trj()
|
||||
{
|
||||
parent->ui->trj_lineEdit_workDir->clear();
|
||||
parent->ui->trj_lineEdit_input->clear();
|
||||
parent->ui->trj_comboBox_type->setCurrentIndex(0);
|
||||
parent->ui->trj_spinBox_steps->setValue(1);
|
||||
parent->ui->trj_lineEdit_atoms->clear();
|
||||
parent->ui->trj_lineEdit_output->clear();
|
||||
parent->ui->trj_spinBox_totalTypes->setValue(1024);
|
||||
parent->ui->trj_checkBox_log->setCheckState(Qt::Checked);
|
||||
parent->ui->trj_lineEdit_log->clear();
|
||||
}
|
||||
|
||||
void Clear_items::clear_statgen()
|
||||
{
|
||||
parent->ui->statgen_lineEdit_workDir->clear();
|
||||
parent->ui->statgen_lineEdit_input->clear();
|
||||
parent->ui->statgen_spinBox_stepsFirst->setValue(1);
|
||||
parent->ui->statgen_spinBox_stepsLast->setValue(1);
|
||||
parent->ui->statgen_doubleSpinBox_cellX->setValue(0.1);
|
||||
parent->ui->statgen_doubleSpinBox_cellY->setValue(0.1);
|
||||
parent->ui->statgen_doubleSpinBox_cellZ->setValue(0.1);
|
||||
parent->ui->statgen_spinBox_atoms0->setValue(0);
|
||||
parent->ui->statgen_checkBox_atoms1->setCheckState(Qt::Unchecked);
|
||||
parent->ui->statgen_spinBox_atoms1->setValue(0);
|
||||
parent->ui->statgen_spinBox_atoms2->setValue(0);
|
||||
parent->ui->statgen_spinBox_atoms3->setValue(0);
|
||||
parent->ui->statgen_doubleSpinBox_int->setValue(0.0);
|
||||
parent->ui->statgen_listWidget_int->clear();
|
||||
parent->ui->statgen_lineEdit_output->clear();
|
||||
parent->ui->statgen_checkBox_depth->setCheckState(Qt::Checked);
|
||||
parent->ui->statgen_spinBox_depth->setValue(10);
|
||||
parent->ui->statgen_checkBox_log->setCheckState(Qt::Checked);
|
||||
parent->ui->statgen_lineEdit_log->clear();
|
||||
parent->ui->statgen_checkBox_anal->setCheckState(Qt::Unchecked);
|
||||
parent->ui->statgen_doubleSpinBox_anal->setValue(0.05);
|
||||
parent->ui->statgen_checkBox_graph->setCheckState(Qt::Checked);
|
||||
}
|
||||
|
||||
void Clear_items::clear_envir()
|
||||
{
|
||||
parent->ui->envir_lineEdit_workDir->clear();
|
||||
parent->ui->envir_lineEdit_input->clear();
|
||||
parent->ui->envir_doubleSpinBox_cellX->setValue(0.1);
|
||||
parent->ui->envir_doubleSpinBox_cellY->setValue(0.1);
|
||||
parent->ui->envir_doubleSpinBox_cellZ->setValue(0.1);
|
||||
parent->ui->envir_lineEdit_output->clear();
|
||||
parent->ui->envir_spinBox_molecule->setValue(1);
|
||||
parent->ui->envir_doubleSpinBox_radius->setValue(0.0);
|
||||
parent->ui->envir_checkBox_log->setCheckState(Qt::Checked);
|
||||
parent->ui->envir_lineEdit_log->clear();
|
||||
}
|
||||
|
||||
void Clear_items::clear_radf()
|
||||
{
|
||||
parent->ui->radf_lineEdit_workDir->clear();
|
||||
parent->ui->radf_lineEdit_input->clear();
|
||||
parent->ui->radf_spinBox_stepsFirst->setValue(1);
|
||||
parent->ui->radf_spinBox_stepsLast->setValue(1);
|
||||
parent->ui->radf_doubleSpinBox_cellX->setValue(0.1);
|
||||
parent->ui->radf_doubleSpinBox_cellY->setValue(0.1);
|
||||
parent->ui->radf_doubleSpinBox_cellZ->setValue(0.1);
|
||||
parent->ui->radf_lineEdit_output->clear();
|
||||
parent->ui->radf_comboBox_atom->setCurrentIndex(0);
|
||||
parent->ui->radf_spinBox_atoms0->setValue(0);
|
||||
parent->ui->radf_spinBox_atoms1->setValue(0);
|
||||
parent->ui->radf_spinBox_atoms2->setValue(0);
|
||||
parent->ui->radf_spinBox_atoms3->setValue(0);
|
||||
parent->ui->radf_spinBox_atoms4->setValue(0);
|
||||
parent->ui->radf_spinBox_atoms5->setValue(0);
|
||||
parent->ui->radf_doubleSpinBox_radMin->setValue(2.0);
|
||||
parent->ui->radf_doubleSpinBox_radMax->setValue(15.0);
|
||||
parent->ui->radf_doubleSpinBox_radStep->setValue(0.2);
|
||||
parent->ui->radf_checkBox_ang->setCheckState(Qt::Unchecked);
|
||||
parent->ui->radf_doubleSpinBox_angMin->setValue(0.0);
|
||||
parent->ui->radf_doubleSpinBox_angMax->setValue(90.0);
|
||||
parent->ui->radf_doubleSpinBox_angStep->setValue(15.0);
|
||||
parent->ui->radf_checkBox_matrix->setCheckState(Qt::Unchecked);
|
||||
parent->ui->radf_checkBox_log->setCheckState(Qt::Checked);
|
||||
parent->ui->radf_lineEdit_log->clear();
|
||||
parent->ui->radf_checkBox_graph->setCheckState(Qt::Checked);
|
||||
}
|
||||
|
||||
void Clear_items::clear_pdb()
|
||||
{
|
||||
parent->ui->pdb_comboBox_mode->setCurrentIndex(0);
|
||||
parent->ui->pdb_lineEdit_workDir->clear();
|
||||
parent->ui->pdb_lineEdit_input->clear();
|
||||
parent->ui->pdb_lineEdit_agl->clear();
|
||||
parent->ui->pdb_doubleSpinBox_cellX->setValue(0.1);
|
||||
parent->ui->pdb_doubleSpinBox_cellY->setValue(0.1);
|
||||
parent->ui->pdb_doubleSpinBox_cellZ->setValue(0.1);
|
||||
parent->ui->pdb_lineEdit_output->clear();
|
||||
parent->ui->pdb_checkBox_log->setCheckState(Qt::Checked);
|
||||
parent->ui->pdb_lineEdit_log->clear();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef CLEAR_ITEMS_H
|
||||
#define CLEAR_ITEMS_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Clear_items : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Clear_items(MainWindow *wid = 0);
|
||||
void clear_trj();
|
||||
void clear_statgen();
|
||||
void clear_envir();
|
||||
void clear_radf();
|
||||
void clear_pdb();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
private slots:
|
||||
|
||||
private:
|
||||
MainWindow *parent;
|
||||
};
|
||||
|
||||
#endif /* CLEAR_ITEMS_H */
|
||||
@@ -0,0 +1,66 @@
|
||||
#include "errorwindow.h"
|
||||
#include "ui_errorwindow.h"
|
||||
|
||||
ErrorWindow::ErrorWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::ErrorWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
ErrorWindow::~ErrorWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ErrorWindow::set_message(int mess)
|
||||
{
|
||||
QString message;
|
||||
switch(mess)
|
||||
{
|
||||
case 0:
|
||||
message = QApplication::translate("ErrorWindow", "Work directory does not exists");
|
||||
break;
|
||||
case 1:
|
||||
message = QApplication::translate("ErrorWindow", "Input file is not set");
|
||||
break;
|
||||
case 2:
|
||||
message = QApplication::translate("ErrorWindow", "Atoms in plane must be different");
|
||||
break;
|
||||
case 3:
|
||||
message = QApplication::translate("ErrorWindow", "Atom types file is not set");
|
||||
break;
|
||||
case 4:
|
||||
message = QApplication::translate("ErrorWindow", "Output file is not set");
|
||||
break;
|
||||
case 5:
|
||||
message = QApplication::translate("ErrorWindow", "Atom type must contain 2 characters");
|
||||
break;
|
||||
case 6:
|
||||
message = QApplication::translate("ErrorWindow", "Log file is not set");
|
||||
break;
|
||||
case 7:
|
||||
message = QApplication::translate("ErrorWindow", "Component is not found");
|
||||
break;
|
||||
case 8:
|
||||
message = QApplication::translate("ErrorWindow", "Atom types is not set");
|
||||
break;
|
||||
case 9:
|
||||
message = QApplication::translate("ErrorWindow", "Something wrong");
|
||||
break;
|
||||
case 10:
|
||||
message = QApplication::translate("ErrorWindow", "Interactions are not set");
|
||||
break;
|
||||
case 11:
|
||||
message = QApplication::translate("ErrorWindow", "Invalid file type");
|
||||
break;
|
||||
case 12:
|
||||
message = QApplication::translate("ErrorWindow", "Interaction step is not set");
|
||||
break;
|
||||
default:
|
||||
message = QApplication::translate("ErrorWindow", "Unknown error");
|
||||
break;
|
||||
}
|
||||
|
||||
ui->label->setText(message);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef ERRORWINDOW_H
|
||||
#define ERRORWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
namespace Ui {
|
||||
class ErrorWindow;
|
||||
}
|
||||
|
||||
class ErrorWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ErrorWindow(QWidget *parent = 0);
|
||||
~ErrorWindow();
|
||||
void set_message(int mess);
|
||||
|
||||
private:
|
||||
Ui::ErrorWindow *ui;
|
||||
};
|
||||
|
||||
#endif /* ERRORWINDOW_H */
|
||||
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ErrorWindow</class>
|
||||
<widget class="QMainWindow" name="ErrorWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>287</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Error</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Error text</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ok</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>pushButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>ErrorWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>143</x>
|
||||
<y>93</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>143</x>
|
||||
<y>57</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,14 @@
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include <QLocale>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QLocale::setDefault(QLocale::C);
|
||||
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
@@ -0,0 +1,955 @@
|
||||
#include <QFileDialog>
|
||||
#include <QDir>
|
||||
|
||||
#include "aboutwindow.h"
|
||||
#include "agglwindow.h"
|
||||
#include "aglallwindow.h"
|
||||
#include "atomtypeswindow.h"
|
||||
#include "settingswindow.h"
|
||||
#include "clear_items.h"
|
||||
#include "start_events.h"
|
||||
#include "statgengraphwindow.h"
|
||||
#include "update_fields.h"
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow),
|
||||
clear_items(new Clear_items(this)),
|
||||
update_fields(new Update_fields(this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
statgen_crit = new float[10];
|
||||
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Ready"));
|
||||
|
||||
createActions();
|
||||
start_events = new Start_events(this);
|
||||
|
||||
SettingsWindow *settingsWindow;
|
||||
settingsWindow = new SettingsWindow(this);
|
||||
delete settingsWindow;
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
delete clear_items;
|
||||
delete start_events;
|
||||
delete update_fields;
|
||||
delete statgen_crit;
|
||||
}
|
||||
|
||||
// signals
|
||||
void MainWindow::on_trj_checkBox_log_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
{
|
||||
ui->trj_lineEdit_log->setDisabled(true);
|
||||
ui->trj_pushButton_log->setDisabled(true);
|
||||
}
|
||||
else if (arg1 == 2)
|
||||
{
|
||||
ui->trj_lineEdit_log->setEnabled(true);
|
||||
ui->trj_pushButton_log->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_checkBox_depth_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
ui->statgen_spinBox_depth->setDisabled(true);
|
||||
else if (arg1 == 2)
|
||||
ui->statgen_spinBox_depth->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_checkBox_log_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
{
|
||||
ui->statgen_lineEdit_log->setDisabled(true);
|
||||
ui->statgen_pushButton_log->setDisabled(true);
|
||||
}
|
||||
else if (arg1 == 2)
|
||||
{
|
||||
ui->statgen_lineEdit_log->setEnabled(true);
|
||||
ui->statgen_pushButton_log->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_checkBox_atoms1_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
{
|
||||
ui->statgen_spinBox_atoms1->setDisabled(true);
|
||||
ui->statgen_checkBox_atoms2->setCheckState(Qt::Unchecked);
|
||||
ui->statgen_checkBox_atoms2->setDisabled(true);
|
||||
}
|
||||
else if (arg1 == 2)
|
||||
{
|
||||
ui->statgen_spinBox_atoms1->setEnabled(true);
|
||||
ui->statgen_checkBox_atoms2->setEnabled(true);
|
||||
}
|
||||
update_interaction();
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_checkBox_atoms2_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
{
|
||||
ui->statgen_spinBox_atoms2->setDisabled(true);
|
||||
ui->statgen_checkBox_atoms3->setCheckState(Qt::Unchecked);
|
||||
ui->statgen_checkBox_atoms3->setDisabled(true);
|
||||
}
|
||||
else if (arg1 == 2)
|
||||
{
|
||||
ui->statgen_spinBox_atoms2->setEnabled(true);
|
||||
ui->statgen_checkBox_atoms3->setEnabled(true);
|
||||
}
|
||||
update_interaction();
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_checkBox_atoms3_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
ui->statgen_spinBox_atoms3->setDisabled(true);
|
||||
else if (arg1 == 2)
|
||||
ui->statgen_spinBox_atoms3->setEnabled(true);
|
||||
update_interaction();
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_checkBox_anal_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
ui->statgen_doubleSpinBox_anal->setDisabled(true);
|
||||
else if (arg1 == 2)
|
||||
ui->statgen_doubleSpinBox_anal->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::on_envir_checkBox_log_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
{
|
||||
ui->envir_lineEdit_log->setDisabled(true);
|
||||
ui->envir_pushButton_log->setDisabled(true);
|
||||
}
|
||||
else if (arg1 == 2)
|
||||
{
|
||||
ui->envir_lineEdit_log->setEnabled(true);
|
||||
ui->envir_pushButton_log->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_comboBox_atom_currentIndexChanged(int index)
|
||||
{
|
||||
if (index == 0)
|
||||
{
|
||||
ui->radf_spinBox_atoms1->setDisabled(true);
|
||||
ui->radf_spinBox_atoms2->setDisabled(true);
|
||||
ui->radf_spinBox_atoms4->setDisabled(true);
|
||||
ui->radf_spinBox_atoms5->setDisabled(true);
|
||||
}
|
||||
else if (index == 1)
|
||||
{
|
||||
ui->radf_spinBox_atoms1->setEnabled(true);
|
||||
ui->radf_spinBox_atoms2->setEnabled(true);
|
||||
ui->radf_spinBox_atoms4->setEnabled(true);
|
||||
ui->radf_spinBox_atoms5->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_checkBox_ang_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
{
|
||||
ui->radf_checkBox_graph->setCheckState(Qt::Checked);
|
||||
ui->radf_doubleSpinBox_angMax->setDisabled(true);
|
||||
ui->radf_doubleSpinBox_angMin->setDisabled(true);
|
||||
ui->radf_doubleSpinBox_angStep->setDisabled(true);
|
||||
ui->radf_checkBox_graph->setEnabled(true);
|
||||
}
|
||||
else if (arg1 == 2)
|
||||
{
|
||||
ui->radf_checkBox_graph->setCheckState(Qt::Unchecked);
|
||||
ui->radf_doubleSpinBox_angMax->setEnabled(true);
|
||||
ui->radf_doubleSpinBox_angMin->setEnabled(true);
|
||||
ui->radf_doubleSpinBox_angStep->setEnabled(true);
|
||||
ui->radf_checkBox_graph->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_checkBox_log_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
{
|
||||
ui->radf_lineEdit_log->setDisabled(true);
|
||||
ui->radf_pushButton_log->setDisabled(true);
|
||||
}
|
||||
else if (arg1 == 2)
|
||||
{
|
||||
ui->radf_lineEdit_log->setEnabled(true);
|
||||
ui->radf_pushButton_log->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_comboBox_mode_currentIndexChanged(int index)
|
||||
{
|
||||
if (index == 1)
|
||||
{
|
||||
ui->pdb_lineEdit_agl->setDisabled(true);
|
||||
ui->pdb_pushButton_agl->setDisabled(true);
|
||||
ui->pdb_doubleSpinBox_cellX->setDisabled(true);
|
||||
ui->pdb_doubleSpinBox_cellY->setDisabled(true);
|
||||
ui->pdb_doubleSpinBox_cellZ->setDisabled(true);
|
||||
}
|
||||
else if (index == 0)
|
||||
{
|
||||
ui->pdb_lineEdit_agl->setEnabled(true);
|
||||
ui->pdb_pushButton_agl->setEnabled(true);
|
||||
ui->pdb_doubleSpinBox_cellX->setEnabled(true);
|
||||
ui->pdb_doubleSpinBox_cellY->setEnabled(true);
|
||||
ui->pdb_doubleSpinBox_cellZ->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_checkBox_log_stateChanged(int arg1)
|
||||
{
|
||||
if (arg1 == 0)
|
||||
{
|
||||
ui->pdb_lineEdit_log->setDisabled(true);
|
||||
ui->pdb_pushButton_log->setDisabled(true);
|
||||
}
|
||||
else if (arg1 == 2)
|
||||
{
|
||||
ui->pdb_lineEdit_log->setEnabled(true);
|
||||
ui->pdb_pushButton_log->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
// file dialogs
|
||||
void MainWindow::on_trj_pushButton_workDir_clicked()
|
||||
{
|
||||
QString dirname = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Select work directory"),
|
||||
QDir::currentPath());
|
||||
if (!dirname.isEmpty())
|
||||
ui->trj_lineEdit_workDir->setText(dirname);
|
||||
}
|
||||
|
||||
void MainWindow::on_trj_pushButton_input_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select trajectory file"),
|
||||
QDir(ui->trj_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("All files (*.*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->trj_lineEdit_input->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_trj_pushButton_atoms_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select atom types file"),
|
||||
QDir(ui->trj_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Atom types files (*.types);;All files (*.*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->trj_lineEdit_atoms->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_trj_pushButton_output_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save files as"),
|
||||
QDir(ui->trj_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Mask of trajectory files"));
|
||||
if (!filename.isEmpty())
|
||||
ui->trj_lineEdit_output->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_trj_pushButton_log_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save log file as..."),
|
||||
QDir(ui->trj_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Log files (*.log)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->trj_lineEdit_log->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_pushButton_workDir_clicked()
|
||||
{
|
||||
QString dirname = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Select work directory"),
|
||||
QDir::currentPath());
|
||||
if (!dirname.isEmpty())
|
||||
ui->statgen_lineEdit_workDir->setText(dirname);
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_pushButton_input_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select trajectory files"),
|
||||
QDir(ui->statgen_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Trajectory files (*.*[0-9])"));
|
||||
if (!filename.isEmpty())
|
||||
ui->statgen_lineEdit_input->setText(filename.split(QString("."))[0]);
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_pushButton_output_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save output file as..."),
|
||||
QDir(ui->statgen_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Output files (*.dat)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->statgen_lineEdit_output->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_pushButton_log_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save log file as..."),
|
||||
QDir(ui->statgen_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Log files (*.log)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->statgen_lineEdit_log->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_envir_pushButton_workDir_clicked()
|
||||
{
|
||||
QString dirname = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Select work directory"),
|
||||
QDir::currentPath());
|
||||
if (!dirname.isEmpty())
|
||||
ui->envir_lineEdit_workDir->setText(dirname);
|
||||
}
|
||||
|
||||
void MainWindow::on_envir_pushButton_input_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select trajectory file"),
|
||||
QDir(ui->envir_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Trajectory files (*.*[0-9])"));
|
||||
if (!filename.isEmpty())
|
||||
ui->envir_lineEdit_input->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_envir_pushButton_output_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save PDB file as..."),
|
||||
QDir(ui->envir_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("PDB files (*.pdb)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->envir_lineEdit_output->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_envir_pushButton_log_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save log file as..."),
|
||||
QDir(ui->envir_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Log files (*.log)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->envir_lineEdit_log->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_pushButton_workDir_clicked()
|
||||
{
|
||||
QString dirname = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Select work directory"),
|
||||
QDir::currentPath());
|
||||
if (!dirname.isEmpty())
|
||||
ui->radf_lineEdit_workDir->setText(dirname);
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_pushButton_input_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select trajectory files"),
|
||||
QDir(ui->radf_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Trajectory files (*.*[0-9])"));
|
||||
if (!filename.isEmpty())
|
||||
ui->radf_lineEdit_input->setText(filename.split(QString("."))[0]);
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_pushButton_output_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save output file as..."),
|
||||
QDir(ui->radf_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Output files (*.dat)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->radf_lineEdit_output->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_pushButton_log_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save log file as..."),
|
||||
QDir(ui->radf_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Log files (*.log)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->radf_lineEdit_log->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_pushButton_workDir_clicked()
|
||||
{
|
||||
QString dirname = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Select work directory"),
|
||||
QDir::currentPath());
|
||||
if (!dirname.isEmpty())
|
||||
ui->pdb_lineEdit_workDir->setText(dirname);
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_pushButton_input_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select trajectory file"),
|
||||
QDir(ui->pdb_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Trajectory files (*.*[0-9])"));
|
||||
if (!filename.isEmpty())
|
||||
ui->pdb_lineEdit_input->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_pushButton_agl_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select agglomerate file"),
|
||||
QDir(ui->pdb_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Agglomerate files (*.agl);;All files (*.*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->pdb_lineEdit_agl->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_pushButton_output_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save PDB file as..."),
|
||||
QDir(ui->pdb_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("PDB files (*.pdb)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->pdb_lineEdit_output->setText(filename);
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_pushButton_log_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save log file as..."),
|
||||
QDir(ui->pdb_lineEdit_workDir->text()).absolutePath(),
|
||||
tr("Log files (*.log)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->pdb_lineEdit_log->setText(filename);
|
||||
}
|
||||
|
||||
// clear actions
|
||||
void MainWindow::on_trj_pushButton_clear_clicked()
|
||||
{
|
||||
clear_items->clear_trj();
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_pushButton_clear_clicked()
|
||||
{
|
||||
clear_items->clear_statgen();
|
||||
}
|
||||
|
||||
void MainWindow::on_envir_pushButton_clear_clicked()
|
||||
{
|
||||
clear_items->clear_envir();
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_pushButton_clear_clicked()
|
||||
{
|
||||
clear_items->clear_radf();
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_pushButton_clear_clicked()
|
||||
{
|
||||
clear_items->clear_pdb();
|
||||
}
|
||||
|
||||
// set interaction (statgen)
|
||||
void MainWindow::update_interaction()
|
||||
{
|
||||
int num_inter = 0;
|
||||
|
||||
if (ui->statgen_checkBox_atoms1->checkState() == 2)
|
||||
num_inter++;
|
||||
if (ui->statgen_checkBox_atoms2->checkState() == 2)
|
||||
num_inter++;
|
||||
if (ui->statgen_checkBox_atoms3->checkState() == 2)
|
||||
num_inter++;
|
||||
|
||||
ui->statgen_comboBox_int->clear();
|
||||
ui->statgen_comboBox_int->addItem("0-0");
|
||||
if (num_inter >= 1)
|
||||
{
|
||||
ui->statgen_comboBox_int->addItem("0-1");
|
||||
ui->statgen_comboBox_int->addItem("1-1");
|
||||
}
|
||||
if (num_inter >= 2)
|
||||
{
|
||||
ui->statgen_comboBox_int->addItem("0-2");
|
||||
ui->statgen_comboBox_int->addItem("1-2");
|
||||
ui->statgen_comboBox_int->addItem("2-2");
|
||||
}
|
||||
if (num_inter >= 3)
|
||||
{
|
||||
ui->statgen_comboBox_int->addItem("0-3");
|
||||
ui->statgen_comboBox_int->addItem("1-3");
|
||||
ui->statgen_comboBox_int->addItem("2-3");
|
||||
ui->statgen_comboBox_int->addItem("3-3");
|
||||
}
|
||||
|
||||
for (int i=0; i<10; i++)
|
||||
statgen_crit[i] = 0.0;
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_comboBox_int_currentIndexChanged(int index)
|
||||
{
|
||||
ui->statgen_doubleSpinBox_int->setValue(statgen_crit[index]);
|
||||
}
|
||||
|
||||
void MainWindow::on_stagen_pushButton_intSave_clicked()
|
||||
{
|
||||
int index;
|
||||
index = ui->statgen_comboBox_int->currentIndex();
|
||||
statgen_crit[index] = ui->statgen_doubleSpinBox_int->value();
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_doubleSpinBox_int_editingFinished()
|
||||
{
|
||||
int index;
|
||||
index = ui->statgen_comboBox_int->currentIndex();
|
||||
statgen_crit[index] = ui->statgen_doubleSpinBox_int->value();
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_pushButton_intAdd_clicked()
|
||||
{
|
||||
QString interaction;
|
||||
QString crit;
|
||||
|
||||
int num_inter = ui->statgen_comboBox_int->count();
|
||||
for (int i=0; i<num_inter; i++)
|
||||
{
|
||||
interaction.append(ui->statgen_comboBox_int->itemText(i));
|
||||
interaction.append(QString(":"));
|
||||
crit.setNum(statgen_crit[i], 'f', 3);
|
||||
interaction.append(crit);
|
||||
interaction.append(QString(","));
|
||||
}
|
||||
interaction.remove(interaction.count()-1, 1);
|
||||
ui->statgen_listWidget_int->addItem(interaction);
|
||||
ui->statgen_doubleSpinBox_int->setValue(0.0);
|
||||
for (int i=0; i<10; i++)
|
||||
statgen_crit[i] = 0.0;
|
||||
}
|
||||
|
||||
void MainWindow::on_stagen_pushButton_intRem_clicked()
|
||||
{
|
||||
int curIndex = ui->statgen_listWidget_int->currentRow();
|
||||
if (curIndex > -1)
|
||||
delete ui->statgen_listWidget_int->item(curIndex);
|
||||
}
|
||||
|
||||
// start signals
|
||||
void MainWindow::on_trj_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralWidget->setDisabled(true);
|
||||
start_events_trj();
|
||||
ui->centralWidget->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::start_events_trj()
|
||||
{
|
||||
QString workDir = ui->trj_lineEdit_workDir->text();
|
||||
QString input = ui->trj_lineEdit_input->text();
|
||||
QString type;
|
||||
switch (ui->trj_comboBox_type->currentIndex())
|
||||
{
|
||||
case 0:
|
||||
type = QString("gmx");
|
||||
break;
|
||||
case 1:
|
||||
type = QString("puma");
|
||||
break;
|
||||
}
|
||||
QString steps = QString::number(ui->trj_spinBox_steps->value());
|
||||
QString atomType = ui->trj_lineEdit_atoms->text();
|
||||
QString mask = ui->trj_lineEdit_output->text();
|
||||
QString totalTypes = QString::number(ui->trj_spinBox_totalTypes->value());
|
||||
QString log;
|
||||
if (ui->trj_checkBox_log->checkState() == 2)
|
||||
log = ui->trj_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'trj'..."));
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'trj'..."));
|
||||
bool check = start_events->start_trj(mm_trj_path,
|
||||
workDir,
|
||||
input,
|
||||
type,
|
||||
steps,
|
||||
atomType,
|
||||
mask,
|
||||
totalTypes,
|
||||
log);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
}
|
||||
|
||||
void MainWindow::on_statgen_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralWidget->setDisabled(true);
|
||||
start_events_statgen();
|
||||
ui->centralWidget->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::start_events_statgen()
|
||||
{
|
||||
QString workDir = ui->statgen_lineEdit_workDir->text();
|
||||
QString mask = ui->statgen_lineEdit_input->text();
|
||||
QString firstStep = QString::number(ui->statgen_spinBox_stepsFirst->value());
|
||||
QString lastStep = QString::number(ui->statgen_spinBox_stepsLast->value());
|
||||
QString cellX, cellY, cellZ;
|
||||
cellX.setNum(ui->statgen_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(ui->statgen_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(ui->statgen_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
QString atom0 = QString::number(ui->statgen_spinBox_atoms0->value());
|
||||
QString atom1, atom2, atom3;
|
||||
if (ui->statgen_checkBox_atoms1->checkState() == 2)
|
||||
atom1.setNum(ui->statgen_spinBox_atoms1->value());
|
||||
else
|
||||
atom1 = QString("#");
|
||||
if (ui->statgen_checkBox_atoms2->checkState() == 2)
|
||||
atom2.setNum(ui->statgen_spinBox_atoms2->value());
|
||||
else
|
||||
atom2 = QString("#");
|
||||
if (ui->statgen_checkBox_atoms3->checkState() == 2)
|
||||
atom3.setNum(ui->statgen_spinBox_atoms3->value());
|
||||
else
|
||||
atom3 = QString("#");
|
||||
QString inter;
|
||||
inter = QString("");
|
||||
for (int i=0; i<ui->statgen_listWidget_int->count(); i++)
|
||||
inter.append(" -r " + ui->statgen_listWidget_int->item(i)->text());
|
||||
QString output = ui->statgen_lineEdit_output->text();
|
||||
QString depth;
|
||||
if (ui->statgen_checkBox_depth->checkState() == 2)
|
||||
depth.setNum(ui->statgen_spinBox_depth->value());
|
||||
else
|
||||
depth = QString("#");
|
||||
float int_step;
|
||||
if (ui->statgen_checkBox_anal->checkState() == 2)
|
||||
int_step = ui->statgen_doubleSpinBox_anal->value();
|
||||
QString log;
|
||||
if (ui->statgen_checkBox_log->checkState() == 2)
|
||||
log = ui->statgen_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'statgen'..."));
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'statgen'..."));
|
||||
bool check;
|
||||
if (ui->statgen_checkBox_anal->checkState() == 0)
|
||||
check = start_events->start_statgen(mm_statgen_path,
|
||||
workDir,
|
||||
mask,
|
||||
firstStep,
|
||||
lastStep,
|
||||
cellX, cellY, cellZ,
|
||||
atom0, atom1, atom2, atom3,
|
||||
inter,
|
||||
output,
|
||||
depth,
|
||||
log);
|
||||
else if (ui->statgen_checkBox_anal->checkState() == 2)
|
||||
check = start_events->start_statgen_analysis(mm_statgen_path,
|
||||
workDir,
|
||||
mask,
|
||||
firstStep,
|
||||
lastStep,
|
||||
cellX, cellY, cellZ,
|
||||
atom0, atom1, atom2, atom3,
|
||||
inter,
|
||||
output,
|
||||
depth,
|
||||
log,
|
||||
int_step);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
|
||||
if ((ui->statgen_checkBox_graph->checkState() == 2) && (check == true))
|
||||
{
|
||||
QString filename = output;
|
||||
if (!filename.contains(QDir::separator()))
|
||||
filename = QFileInfo(QDir(workDir), filename).absoluteFilePath();
|
||||
StatgenGraphWindow *graphwin;
|
||||
graphwin = new StatgenGraphWindow(this, filename);
|
||||
graphwin->show();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_envir_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralWidget->setDisabled(true);
|
||||
start_events_envir();
|
||||
ui->centralWidget->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::start_events_envir()
|
||||
{
|
||||
QString workDir = ui->envir_lineEdit_workDir->text();
|
||||
QString input = ui->envir_lineEdit_input->text();
|
||||
QString cellX, cellY, cellZ;
|
||||
cellX.setNum(ui->envir_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(ui->envir_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(ui->envir_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
QString output = ui->envir_lineEdit_output->text();
|
||||
QString molecule = QString::number(ui->envir_spinBox_molecule->value());
|
||||
QString radius;
|
||||
radius.setNum(ui->envir_doubleSpinBox_radius->value(), 'f', 4);
|
||||
QString log;
|
||||
if (ui->envir_checkBox_log->checkState() == 2)
|
||||
log = ui->envir_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'envir'..."));
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'envir'..."));
|
||||
bool check = start_events->start_envir(mm_envir_path,
|
||||
workDir,
|
||||
input,
|
||||
cellX, cellY, cellZ,
|
||||
output,
|
||||
molecule,
|
||||
radius,
|
||||
log);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
}
|
||||
|
||||
void MainWindow::on_radf_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralWidget->setDisabled(true);
|
||||
start_events_radf();
|
||||
ui->centralWidget->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::start_events_radf()
|
||||
{
|
||||
QString workDir = ui->radf_lineEdit_workDir->text();
|
||||
QString mask = ui->radf_lineEdit_input->text();
|
||||
QString firstStep = QString::number(ui->radf_spinBox_stepsFirst->value());
|
||||
QString lastStep = QString::number(ui->radf_spinBox_stepsLast->value());
|
||||
QString cellX, cellY, cellZ;
|
||||
cellX.setNum(ui->radf_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(ui->radf_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(ui->radf_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
QString output = ui->radf_lineEdit_output->text();
|
||||
QString atom0 = QString::number(ui->radf_spinBox_atoms0->value());
|
||||
QString atom3 = QString::number(ui->radf_spinBox_atoms3->value());
|
||||
QString atom1, atom2, atom4, atom5;
|
||||
if (ui->radf_comboBox_atom->currentIndex() == 1)
|
||||
{
|
||||
atom1 = QString::number(ui->radf_spinBox_atoms1->value());
|
||||
atom2 = QString::number(ui->radf_spinBox_atoms1->value());
|
||||
atom4 = QString::number(ui->radf_spinBox_atoms1->value());
|
||||
atom5 = QString::number(ui->radf_spinBox_atoms1->value());
|
||||
}
|
||||
else
|
||||
atom1 = QString("#");
|
||||
QString radMin, radMax, radStep, angMin, angMax, angStep;
|
||||
radMin.setNum(ui->radf_doubleSpinBox_radMin->value(), 'f', 3);
|
||||
radMax.setNum(ui->radf_doubleSpinBox_radMax->value(), 'f', 3);
|
||||
radStep.setNum(ui->radf_doubleSpinBox_radStep->value(), 'f', 3);
|
||||
if (ui->radf_checkBox_ang->checkState() == 2)
|
||||
{
|
||||
angMin.setNum(ui->radf_doubleSpinBox_angMin->value(), 'f', 2);
|
||||
angMax.setNum(ui->radf_doubleSpinBox_angMax->value(), 'f', 2);
|
||||
angStep.setNum(ui->radf_doubleSpinBox_angStep->value(), 'f', 2);
|
||||
}
|
||||
else
|
||||
angStep = QString("#");
|
||||
QString log;
|
||||
if (ui->radf_checkBox_log->checkState() == 2)
|
||||
log = ui->radf_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
int matrix;
|
||||
if (ui->radf_checkBox_matrix->checkState() == 2)
|
||||
matrix = 1;
|
||||
else
|
||||
matrix = 0;
|
||||
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'radf'..."));
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'radf'..."));
|
||||
bool check = start_events->start_radf(mm_radf_path,
|
||||
workDir,
|
||||
mask,
|
||||
firstStep,
|
||||
lastStep,
|
||||
cellX, cellY, cellZ,
|
||||
output,
|
||||
atom0, atom1, atom2,
|
||||
atom3, atom4, atom5,
|
||||
radMin, radMax, radStep,
|
||||
angMin, angMax, angStep,
|
||||
log, matrix);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
|
||||
if ((ui->radf_checkBox_graph->checkState() == 2) && (check == true))
|
||||
{
|
||||
QString filename = output;
|
||||
if (!filename.contains(QDir::separator()))
|
||||
filename = QFileInfo(QDir(workDir), filename).absoluteFilePath();
|
||||
StatgenGraphWindow *graphwin;
|
||||
graphwin = new StatgenGraphWindow(this, filename);
|
||||
graphwin->show();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_pdb_pushButton_start_clicked()
|
||||
{
|
||||
ui->centralWidget->setDisabled(true);
|
||||
start_events_pdb();
|
||||
ui->centralWidget->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::start_events_pdb()
|
||||
{
|
||||
QString workDir = ui->pdb_lineEdit_workDir->text();
|
||||
QString input = ui->pdb_lineEdit_input->text();
|
||||
QString agl, cellX, cellY, cellZ;
|
||||
if (ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
{
|
||||
agl = ui->pdb_lineEdit_agl->text();
|
||||
cellX.setNum(ui->pdb_doubleSpinBox_cellX->value(), 'f', 4);
|
||||
cellY.setNum(ui->pdb_doubleSpinBox_cellY->value(), 'f', 4);
|
||||
cellZ.setNum(ui->pdb_doubleSpinBox_cellZ->value(), 'f', 4);
|
||||
}
|
||||
else
|
||||
agl = QString("#");
|
||||
QString output = ui->pdb_lineEdit_output->text();
|
||||
QString log;
|
||||
if (ui->pdb_checkBox_log->checkState() == 2)
|
||||
log = ui->pdb_lineEdit_log->text();
|
||||
else
|
||||
log = QString("#");
|
||||
|
||||
if (ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
{
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'agl'..."));
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'agl'..."));
|
||||
}
|
||||
else if (ui->pdb_comboBox_mode->currentIndex() == 1)
|
||||
{
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'trj2pdb'..."));
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Processing 'trj2pdb'..."));
|
||||
}
|
||||
bool check;
|
||||
if (ui->pdb_comboBox_mode->currentIndex() == 0)
|
||||
check = start_events->start_pdb(mm_agl_path,
|
||||
workDir,
|
||||
input,
|
||||
agl,
|
||||
cellX, cellY, cellZ,
|
||||
output,
|
||||
log);
|
||||
else if (ui->pdb_comboBox_mode->currentIndex() == 1)
|
||||
check = start_events->start_pdb(mm_trj2pdb_path,
|
||||
workDir,
|
||||
input,
|
||||
agl,
|
||||
cellX, cellY, cellZ,
|
||||
output,
|
||||
log);
|
||||
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Done"));
|
||||
}
|
||||
|
||||
// completion
|
||||
void MainWindow::on_tabWidget_currentChanged(int index)
|
||||
{
|
||||
switch(index)
|
||||
{
|
||||
case 1:
|
||||
update_fields->setup_def_statgen();
|
||||
break;
|
||||
case 2:
|
||||
update_fields->setup_def_envir();
|
||||
break;
|
||||
case 3:
|
||||
update_fields->setup_def_radf();
|
||||
break;
|
||||
case 4:
|
||||
update_fields->setup_def_pdb();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// window signals
|
||||
void MainWindow::createActions()
|
||||
{
|
||||
connect(ui->actionAtom_types_file, SIGNAL(triggered()), this, SLOT(createAtomTypes()));
|
||||
connect(ui->actionAgglomerate_file, SIGNAL(triggered()), this, SLOT(createAgglFile()));
|
||||
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(aboutWin()));
|
||||
connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(settingsWinShow()));
|
||||
connect(ui->actionAgl_all, SIGNAL(triggered()), this, SLOT(aglallWinShow()));
|
||||
}
|
||||
|
||||
void MainWindow::createAtomTypes()
|
||||
{
|
||||
AtomTypesWindow *atomTypes;
|
||||
atomTypes = new AtomTypesWindow(this);
|
||||
atomTypes->show();
|
||||
}
|
||||
|
||||
void MainWindow::createAgglFile()
|
||||
{
|
||||
AgglWindow *agglWindow;
|
||||
agglWindow = new AgglWindow(this, ui->statgen_lineEdit_output->text());
|
||||
agglWindow->show();
|
||||
}
|
||||
|
||||
void MainWindow::aboutWin()
|
||||
{
|
||||
AboutWindow *aboutWindow;
|
||||
aboutWindow = new AboutWindow(this);
|
||||
aboutWindow->show();
|
||||
}
|
||||
|
||||
void MainWindow::settingsWinShow()
|
||||
{
|
||||
SettingsWindow *settingsWindow;
|
||||
settingsWindow = new SettingsWindow(this);
|
||||
settingsWindow->show();
|
||||
}
|
||||
|
||||
void MainWindow::aglallWinShow()
|
||||
{
|
||||
AglAllWindow *aglallWin;
|
||||
aglallWin = new AglAllWindow(this, mm_agl_path);
|
||||
aglallWin->show();
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
class Clear_items;
|
||||
class SettingsWindow;
|
||||
class Start_events;
|
||||
class Update_fields;
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
QString language;
|
||||
QString mm_agl_path;
|
||||
QString mm_envir_path;
|
||||
QString mm_radf_path;
|
||||
QString mm_statgen_path;
|
||||
QString mm_trj_path;
|
||||
QString mm_trj2pdb_path;
|
||||
|
||||
private slots:
|
||||
// enable/disable signals
|
||||
void on_trj_checkBox_log_stateChanged (int arg1);
|
||||
void on_statgen_checkBox_depth_stateChanged (int arg1);
|
||||
void on_statgen_checkBox_log_stateChanged (int arg1);
|
||||
void on_statgen_checkBox_atoms1_stateChanged(int arg1);
|
||||
void on_statgen_checkBox_atoms2_stateChanged(int arg1);
|
||||
void on_statgen_checkBox_atoms3_stateChanged(int arg1);
|
||||
void on_statgen_checkBox_anal_stateChanged(int arg1);
|
||||
void on_envir_checkBox_log_stateChanged(int arg1);
|
||||
void on_radf_comboBox_atom_currentIndexChanged(int index);
|
||||
void on_radf_checkBox_ang_stateChanged(int arg1);
|
||||
void on_radf_checkBox_log_stateChanged(int arg1);
|
||||
void on_pdb_comboBox_mode_currentIndexChanged(int index);
|
||||
void on_pdb_checkBox_log_stateChanged(int arg1);
|
||||
// select directory signals
|
||||
void on_trj_pushButton_workDir_clicked();
|
||||
void on_trj_pushButton_input_clicked();
|
||||
void on_trj_pushButton_atoms_clicked();
|
||||
void on_trj_pushButton_output_clicked();
|
||||
void on_trj_pushButton_log_clicked();
|
||||
void on_statgen_pushButton_workDir_clicked();
|
||||
void on_statgen_pushButton_input_clicked();
|
||||
void on_statgen_pushButton_output_clicked();
|
||||
void on_statgen_pushButton_log_clicked();
|
||||
void on_envir_pushButton_workDir_clicked();
|
||||
void on_envir_pushButton_input_clicked();
|
||||
void on_envir_pushButton_output_clicked();
|
||||
void on_envir_pushButton_log_clicked();
|
||||
void on_radf_pushButton_workDir_clicked();
|
||||
void on_radf_pushButton_input_clicked();
|
||||
void on_radf_pushButton_output_clicked();
|
||||
void on_radf_pushButton_log_clicked();
|
||||
void on_pdb_pushButton_workDir_clicked();
|
||||
void on_pdb_pushButton_input_clicked();
|
||||
void on_pdb_pushButton_agl_clicked();
|
||||
void on_pdb_pushButton_output_clicked();
|
||||
void on_pdb_pushButton_log_clicked();
|
||||
// clear signals
|
||||
void on_trj_pushButton_clear_clicked();
|
||||
void on_statgen_pushButton_clear_clicked();
|
||||
void on_envir_pushButton_clear_clicked();
|
||||
void on_radf_pushButton_clear_clicked();
|
||||
void on_pdb_pushButton_clear_clicked();
|
||||
// interaction (statgen)
|
||||
void on_statgen_comboBox_int_currentIndexChanged(int index);
|
||||
void on_stagen_pushButton_intSave_clicked();
|
||||
void on_statgen_doubleSpinBox_int_editingFinished();
|
||||
void on_statgen_pushButton_intAdd_clicked();
|
||||
void on_stagen_pushButton_intRem_clicked();
|
||||
// start events
|
||||
void on_trj_pushButton_start_clicked();
|
||||
void on_statgen_pushButton_start_clicked();
|
||||
void on_envir_pushButton_start_clicked();
|
||||
void on_radf_pushButton_start_clicked();
|
||||
void on_pdb_pushButton_start_clicked();
|
||||
// completion
|
||||
void on_tabWidget_currentChanged(int index);
|
||||
// window signals
|
||||
void createAtomTypes();
|
||||
void createAgglFile();
|
||||
void aboutWin();
|
||||
void settingsWinShow();
|
||||
void aglallWinShow();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
void update_interaction();
|
||||
float *statgen_crit;
|
||||
|
||||
void start_events_trj();
|
||||
void start_events_statgen();
|
||||
void start_events_envir();
|
||||
void start_events_radf();
|
||||
void start_events_pdb();
|
||||
|
||||
Clear_items *clear_items;
|
||||
friend class Clear_items;
|
||||
Update_fields *update_fields;
|
||||
friend class Update_fields;
|
||||
Start_events *start_events;
|
||||
|
||||
// window signals
|
||||
void createActions();
|
||||
};
|
||||
|
||||
#endif /* MAINWINDOW_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
######################################################################
|
||||
# Automatically generated by qmake (2.01a) ?? ??? 5 17:39:40 2013
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET =
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
CONFIG += qwt
|
||||
|
||||
# Input
|
||||
HEADERS += mainwindow.h \
|
||||
errorwindow.h \
|
||||
clear_items.h \
|
||||
start_events.h \
|
||||
update_fields.h \
|
||||
atomtypeswindow.h \
|
||||
agglwindow.h \
|
||||
aboutwindow.h \
|
||||
statgengraphwindow.h \
|
||||
settingswindow.h \
|
||||
aglallwindow.h
|
||||
FORMS += mainwindow.ui \
|
||||
errorwindow.ui \
|
||||
atomtypeswindow.ui \
|
||||
agglwindow.ui \
|
||||
aboutwindow.ui \
|
||||
statgengraphwindow.ui \
|
||||
settingswindow.ui \
|
||||
aglallwindow.ui
|
||||
SOURCES += main.cpp mainwindow.cpp \
|
||||
errorwindow.cpp \
|
||||
clear_items.cpp \
|
||||
start_events.cpp \
|
||||
update_fields.cpp \
|
||||
atomtypeswindow.cpp \
|
||||
agglwindow.cpp \
|
||||
aboutwindow.cpp \
|
||||
statgengraphwindow.cpp \
|
||||
settingswindow.cpp \
|
||||
aglallwindow.cpp
|
||||
@@ -0,0 +1,257 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 2.8.0, 2013-08-24T21:55:08. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QString" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap"/>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{a22d6db7-e0a5-452b-9173-b8efacd95ba3}</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
|
||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||
<value type="QString">-w</value>
|
||||
<value type="QString">-r</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||
<value type="QString">-w</value>
|
||||
<value type="QString">-r</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Отладка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/arcanis/build-mathmech-Desktop-Debug</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
|
||||
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
|
||||
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||
<value type="QString">-w</value>
|
||||
<value type="QString">-r</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
|
||||
<value type="QString">-w</value>
|
||||
<value type="QString">-r</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Выпуск</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/arcanis/build-mathmech-Desktop-Release</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Установка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Локальная установка</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="bool" key="Analyzer.Project.UseGlobal">true</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">mathmech</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/arcanis/Documents/github/moldyn/mathmech/src/mathmech.pro</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">mathmech.pro</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
|
||||
<value type="QByteArray">{ab3ec085-9c1a-4bfc-af86-f7898da68a64}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">14</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
@@ -0,0 +1,245 @@
|
||||
#include <QDir>
|
||||
#include <QKeyEvent>
|
||||
#include <QFileDialog>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "errorwindow.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include "settingswindow.h"
|
||||
#include "ui_settingswindow.h"
|
||||
|
||||
SettingsWindow::SettingsWindow(MainWindow *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::SettingsWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
_parent = parent;
|
||||
|
||||
#ifdef _WIN32
|
||||
configpath = QFileInfo(QDir::currentPath(), ("mathmech.ini")).absoluteFilePath();
|
||||
#elif __linux
|
||||
configpath = QFileInfo(QDir(QDir::homePath() + "/.config"), ("mathmech.conf")).absoluteFilePath();
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
if (QFileInfo(configpath).exists())
|
||||
readSettings();
|
||||
else
|
||||
{
|
||||
setDefaults();
|
||||
applySettings();
|
||||
}
|
||||
showSettings();
|
||||
}
|
||||
|
||||
SettingsWindow::~SettingsWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// ESC press event
|
||||
void SettingsWindow::keyPressEvent(QKeyEvent *pressedKey)
|
||||
{
|
||||
if (pressedKey->key() == Qt::Key_Escape)
|
||||
close();
|
||||
}
|
||||
|
||||
void SettingsWindow::applySettings()
|
||||
{
|
||||
errorwin = new ErrorWindow(this);
|
||||
|
||||
QString mm_trj_path = ui->settings_lineEdit_trj->text();
|
||||
QString mm_statgen_path = ui->settings_lineEdit_statgen->text();
|
||||
QString mm_envir_path = ui->settings_lineEdit_envir->text();
|
||||
QString mm_agl_path = ui->settings_lineEdit_agl->text();
|
||||
QString mm_radf_path = ui->settings_lineEdit_radf->text();
|
||||
QString mm_trj2pdb_path = ui->settings_lineEdit_trj2pdb->text();
|
||||
|
||||
if ((!QFile(mm_trj_path).exists()) || (mm_trj_path == "") ||
|
||||
(!QFile(mm_statgen_path).exists()) || (mm_statgen_path == "") ||
|
||||
(!QFile(mm_envir_path).exists()) || (mm_envir_path == "") ||
|
||||
(!QFile(mm_agl_path).exists()) || (mm_agl_path == "") ||
|
||||
(!QFile(mm_radf_path).exists()) || (mm_radf_path == "") ||
|
||||
(!QFile(mm_trj2pdb_path).exists()) || (mm_trj2pdb_path == ""))
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ui->settings_comboBox_lang->currentIndex() == 0)
|
||||
_parent->language = QString("eng");
|
||||
else if (ui->settings_comboBox_lang->currentIndex() == 1)
|
||||
_parent->language = QString("rus");
|
||||
_parent->mm_trj_path = mm_trj_path;
|
||||
_parent->mm_statgen_path = mm_statgen_path;
|
||||
_parent->mm_envir_path = mm_envir_path;
|
||||
_parent->mm_radf_path = mm_radf_path;
|
||||
_parent->mm_trj2pdb_path = mm_trj2pdb_path;
|
||||
_parent->mm_agl_path = mm_agl_path;
|
||||
|
||||
delete errorwin;
|
||||
printSettings();
|
||||
}
|
||||
|
||||
void SettingsWindow::printSettings()
|
||||
{
|
||||
errorwin = new ErrorWindow(this);
|
||||
|
||||
QFile conf_file(configpath);
|
||||
if (!conf_file.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
{
|
||||
errorwin->set_message(9);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
QTextStream out(&conf_file);
|
||||
out << "LANG=" << _parent->language << "\n";
|
||||
out << "MM_TRJ_PATH=" << _parent->mm_trj_path << "\n";
|
||||
out << "MM_STATGEN_PATH=" << _parent->mm_statgen_path << "\n";
|
||||
out << "MM_ENVIR_PATH=" << _parent->mm_envir_path << "\n";
|
||||
out << "MM_RADF_PATH=" << _parent->mm_radf_path << "\n";
|
||||
out << "MM_TRJ2PDB_PATH=" << _parent->mm_trj2pdb_path << "\n";
|
||||
out << "MM_AGL_PATH=" << _parent->mm_agl_path << "\n";
|
||||
conf_file.close();
|
||||
|
||||
delete errorwin;
|
||||
}
|
||||
|
||||
void SettingsWindow::setDefaults()
|
||||
{
|
||||
QString suffix = "";
|
||||
#ifdef _WIN32
|
||||
suffix = QString(".exe");
|
||||
#endif
|
||||
_parent->language = QString("eng");
|
||||
_parent->mm_trj_path = QDir::currentPath() + QDir::separator() + "mm_trj" + suffix;
|
||||
_parent->mm_statgen_path = QDir::currentPath() + QDir::separator() + "mm_statgen" + suffix;
|
||||
_parent->mm_envir_path = QDir::currentPath() + QDir::separator() + "mm_envir" + suffix;
|
||||
_parent->mm_radf_path = QDir::currentPath() + QDir::separator() + "mm_radf" + suffix;
|
||||
_parent->mm_trj2pdb_path = QDir::currentPath() + QDir::separator() + "mm_trj2pdb" + suffix;
|
||||
_parent->mm_agl_path = QDir::currentPath() + QDir::separator() + "mm_agl" + suffix;
|
||||
}
|
||||
|
||||
void SettingsWindow::readSettings()
|
||||
{
|
||||
errorwin = new ErrorWindow(this);
|
||||
|
||||
QFile conf_file(configpath);
|
||||
if (!conf_file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
{
|
||||
errorwin->set_message(9);
|
||||
errorwin->show();
|
||||
return;
|
||||
}
|
||||
QTextStream out(&conf_file);
|
||||
QStringList text = out.readAll().split(QString("\n"), QString::SkipEmptyParts);
|
||||
conf_file.close();
|
||||
|
||||
for (int i=0; i<text.count(); i++)
|
||||
if (text[i].contains(QString("LANG=")))
|
||||
_parent->language = text[i].split(QString("LANG="), QString::SkipEmptyParts)[0];
|
||||
else if (text[i].contains(QString("MM_TRJ_PATH=")))
|
||||
_parent->mm_trj_path = text[i].split(QString("MM_TRJ_PATH="), QString::SkipEmptyParts)[0];
|
||||
else if (text[i].contains(QString("MM_STATGEN_PATH=")))
|
||||
_parent->mm_statgen_path = text[i].split(QString("MM_STATGEN_PATH="), QString::SkipEmptyParts)[0];
|
||||
else if (text[i].contains(QString("MM_ENVIR_PATH=")))
|
||||
_parent->mm_envir_path = text[i].split(QString("MM_ENVIR_PATH="), QString::SkipEmptyParts)[0];
|
||||
else if (text[i].contains(QString("MM_RADF_PATH=")))
|
||||
_parent->mm_radf_path = text[i].split(QString("MM_RADF_PATH="), QString::SkipEmptyParts)[0];
|
||||
else if (text[i].contains(QString("MM_TRJ2PDB_PATH=")))
|
||||
_parent->mm_trj2pdb_path = text[i].split(QString("MM_TRJ2PDB_PATH="), QString::SkipEmptyParts)[0];
|
||||
else if (text[i].contains(QString("MM_AGL_PATH=")))
|
||||
_parent->mm_agl_path = text[i].split(QString("MM_AGL_PATH="), QString::SkipEmptyParts)[0];
|
||||
|
||||
delete errorwin;
|
||||
}
|
||||
|
||||
void SettingsWindow::showSettings()
|
||||
{
|
||||
ui->settings_lineEdit_trj->setText(_parent->mm_trj_path);
|
||||
ui->settings_lineEdit_statgen->setText(_parent->mm_statgen_path);
|
||||
ui->settings_lineEdit_envir->setText(_parent->mm_envir_path);
|
||||
ui->settings_lineEdit_radf->setText(_parent->mm_radf_path);
|
||||
ui->settings_lineEdit_agl->setText(_parent->mm_agl_path);
|
||||
ui->settings_lineEdit_trj2pdb->setText(_parent->mm_trj2pdb_path);
|
||||
if (_parent->language == QString("eng"))
|
||||
ui->settings_comboBox_lang->setCurrentIndex(0);
|
||||
else if (_parent->language == QString("rus"))
|
||||
ui->settings_comboBox_lang->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void SettingsWindow::on_settings_pushButton_save_clicked()
|
||||
{
|
||||
applySettings();
|
||||
close();
|
||||
}
|
||||
|
||||
// browse signals
|
||||
void SettingsWindow::on_settings_pushButton_trj_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select component"),
|
||||
QDir::currentPath(),
|
||||
tr("All files (*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->settings_lineEdit_trj->setText(filename);
|
||||
}
|
||||
|
||||
void SettingsWindow::on_settings_pushButton_statgen_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select component"),
|
||||
QDir::currentPath(),
|
||||
tr("All files (*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->settings_lineEdit_statgen->setText(filename);
|
||||
}
|
||||
|
||||
void SettingsWindow::on_settings_pushButton_envir_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select component"),
|
||||
QDir::currentPath(),
|
||||
tr("All files (*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->settings_lineEdit_envir->setText(filename);
|
||||
}
|
||||
|
||||
void SettingsWindow::on_settings_pushButton_radf_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select component"),
|
||||
QDir::currentPath(),
|
||||
tr("All files (*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->settings_lineEdit_radf->setText(filename);
|
||||
}
|
||||
|
||||
void SettingsWindow::on_settings_pushButton_trj2pdb_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select component"),
|
||||
QDir::currentPath(),
|
||||
tr("All files (*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->settings_lineEdit_trj2pdb->setText(filename);
|
||||
}
|
||||
|
||||
void SettingsWindow::on_settings_pushButton_agl_clicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Select component"),
|
||||
QDir::currentPath(),
|
||||
tr("All files (*)"));
|
||||
if (!filename.isEmpty())
|
||||
ui->settings_lineEdit_agl->setText(filename);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
#ifndef SETTINGSWINDOW_H
|
||||
#define SETTINGSWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
class MainWindow;
|
||||
class ErrorWindow;
|
||||
|
||||
namespace Ui {
|
||||
class SettingsWindow;
|
||||
}
|
||||
|
||||
class SettingsWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SettingsWindow(MainWindow *parent = 0);
|
||||
~SettingsWindow();
|
||||
void applySettings();
|
||||
void printSettings();
|
||||
void readSettings();
|
||||
void setDefaults();
|
||||
void showSettings();
|
||||
|
||||
private slots:
|
||||
void on_settings_pushButton_save_clicked();
|
||||
void on_settings_pushButton_trj_clicked();
|
||||
void on_settings_pushButton_statgen_clicked();
|
||||
void on_settings_pushButton_envir_clicked();
|
||||
void on_settings_pushButton_radf_clicked();
|
||||
void on_settings_pushButton_trj2pdb_clicked();
|
||||
void on_settings_pushButton_agl_clicked();
|
||||
|
||||
private:
|
||||
Ui::SettingsWindow *ui;
|
||||
QString configpath;
|
||||
MainWindow *_parent;
|
||||
ErrorWindow *errorwin;
|
||||
|
||||
// ESC pressed event
|
||||
void keyPressEvent(QKeyEvent *pressedKey);
|
||||
};
|
||||
|
||||
#endif /* SETTINGSWINDOW_H */
|
||||
@@ -0,0 +1,372 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SettingsWindow</class>
|
||||
<widget class="QMainWindow" name="SettingsWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>392</width>
|
||||
<height>320</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="settings_layout_trj">
|
||||
<item>
|
||||
<widget class="QLabel" name="settings_label_trj">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>mm_trj</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="settings_lineEdit_trj"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settings_pushButton_trj">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="settings_layout_statgen">
|
||||
<item>
|
||||
<widget class="QLabel" name="settings_label_statgen">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>mm_statgen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="settings_lineEdit_statgen"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settings_pushButton_statgen">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="settings_layout_envir">
|
||||
<item>
|
||||
<widget class="QLabel" name="settings_label_envir">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>mm_envir</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="settings_lineEdit_envir"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settings_pushButton_envir">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="settings_layout_radf">
|
||||
<item>
|
||||
<widget class="QLabel" name="settings_label_radf">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>mm_radf</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="settings_lineEdit_radf"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settings_pushButton_radf">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="settings_layout_trj2pdb">
|
||||
<item>
|
||||
<widget class="QLabel" name="settings_label_trj2pdb">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>mm_trj2pdb</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="settings_lineEdit_trj2pdb"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settings_pushButton_trj2pdb">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="settings_layout_agl">
|
||||
<item>
|
||||
<widget class="QLabel" name="settings_label_agl">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>mm_agl</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="settings_lineEdit_agl"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settings_pushButton_agl">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="settings_layout_lang">
|
||||
<item>
|
||||
<widget class="QLabel" name="settings_label_lang">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>110</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="settings_comboBox_lang">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>English</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Russian</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>51</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="settings_layout_buttons">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settings_pushButton_save">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="settings_pushButton_close">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>settings_lineEdit_trj</tabstop>
|
||||
<tabstop>settings_pushButton_trj</tabstop>
|
||||
<tabstop>settings_lineEdit_statgen</tabstop>
|
||||
<tabstop>settings_pushButton_statgen</tabstop>
|
||||
<tabstop>settings_lineEdit_envir</tabstop>
|
||||
<tabstop>settings_pushButton_envir</tabstop>
|
||||
<tabstop>settings_lineEdit_radf</tabstop>
|
||||
<tabstop>settings_pushButton_radf</tabstop>
|
||||
<tabstop>settings_lineEdit_trj2pdb</tabstop>
|
||||
<tabstop>settings_pushButton_trj2pdb</tabstop>
|
||||
<tabstop>settings_lineEdit_agl</tabstop>
|
||||
<tabstop>settings_pushButton_agl</tabstop>
|
||||
<tabstop>settings_comboBox_lang</tabstop>
|
||||
<tabstop>settings_pushButton_close</tabstop>
|
||||
<tabstop>settings_pushButton_save</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>settings_pushButton_close</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>SettingsWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>337</x>
|
||||
<y>299</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>343</x>
|
||||
<y>319</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,551 @@
|
||||
#include <QDir>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "errorwindow.h"
|
||||
|
||||
#include "start_events.h"
|
||||
|
||||
Start_events::Start_events(MainWindow *wid) :
|
||||
parent(wid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool Start_events::start_trj(QString mm_trj_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString type,
|
||||
QString steps,
|
||||
QString atomType,
|
||||
QString mask,
|
||||
QString totalTypes,
|
||||
QString log)
|
||||
{
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if ((input == "") || (!QFile(input).exists()))
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if ((atomType == "") || (!QFile(atomType).exists()))
|
||||
{
|
||||
errorwin->set_message(3);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (mask == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_trj_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
command.append(mm_trj_path);
|
||||
if (input.contains(QDir::separator()))
|
||||
command.append(" -i " + QFileInfo(input).absoluteFilePath());
|
||||
else
|
||||
command.append(" -i " + QFileInfo(QDir(workDir), input).absoluteFilePath());
|
||||
command.append(" -t " + type);
|
||||
command.append(" -s " + steps);
|
||||
if (atomType.contains(QDir::separator()))
|
||||
command.append(" -a " + QFileInfo(atomType).absoluteFilePath());
|
||||
else
|
||||
command.append(" -a " + QFileInfo(QDir(workDir), atomType).absoluteFilePath());
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), mask).absoluteFilePath());
|
||||
command.append(" -tt " + totalTypes);
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
else
|
||||
command.append(" -l " + QFileInfo(QDir(workDir), log).absoluteFilePath());
|
||||
}
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Start_events::start_statgen(QString mm_statgen_path,
|
||||
QString workDir,
|
||||
QString mask,
|
||||
QString firstStep,
|
||||
QString lastStep,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString atom0, QString atom1, QString atom2, QString atom3,
|
||||
QString inter,
|
||||
QString output,
|
||||
QString depth,
|
||||
QString log)
|
||||
{
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (mask == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (inter == "")
|
||||
{
|
||||
errorwin->set_message(10);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_statgen_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
command.append(mm_statgen_path);
|
||||
if (mask.contains(QDir::separator()))
|
||||
command.append(" -i " + QFileInfo(mask).absoluteFilePath());
|
||||
else
|
||||
command.append(" -i " + QFileInfo(QDir(workDir), mask).absoluteFilePath());
|
||||
command.append(" -s " + firstStep + "," + lastStep);
|
||||
command.append(" -c " + cellX + "," + cellY + "," + cellZ);
|
||||
command.append(" -a " + atom0);
|
||||
if (atom1 != QString("#"))
|
||||
command.append("," + atom1);
|
||||
if (atom2 != QString("#"))
|
||||
command.append("," + atom2);
|
||||
if (atom3 != QString("#"))
|
||||
command.append("," + atom3);
|
||||
command.append(inter);
|
||||
if (output.contains(QDir::separator()))
|
||||
command.append(" -o " + QFileInfo(output).absoluteFilePath());
|
||||
else
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
if (depth != QString("#"))
|
||||
command.append(" -g " + depth);
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
else
|
||||
command.append(" -l " + QFileInfo(QDir(workDir), log).absoluteFilePath());
|
||||
}
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Start_events::start_statgen_analysis(QString mm_statgen_path,
|
||||
QString workDir,
|
||||
QString mask,
|
||||
QString firstStep,
|
||||
QString lastStep,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString atom0, QString atom1, QString atom2, QString atom3,
|
||||
QString inter,
|
||||
QString output,
|
||||
QString depth,
|
||||
QString log,
|
||||
float int_step)
|
||||
{
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (mask == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (inter == "")
|
||||
{
|
||||
errorwin->set_message(10);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (int_step == 0.0)
|
||||
{
|
||||
errorwin->set_message(12);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_statgen_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// parsing criteria
|
||||
int imax = 10;
|
||||
QStringList inter_list = inter.split(QString(" -r "), QString::SkipEmptyParts);
|
||||
float *inter_list_one;
|
||||
inter_list_one = new float[16*inter_list.count()];
|
||||
for (int i=0; i<16*inter_list.count(); i++)
|
||||
inter_list_one[i] = -1.0;
|
||||
float item;
|
||||
int index;
|
||||
for (int i=0; i<inter_list.count(); i++)
|
||||
for (int j=0; j<inter_list[i].split(QString(","), QString::SkipEmptyParts).count(); j++)
|
||||
{
|
||||
item = inter_list[i].split(QString(","), QString::SkipEmptyParts)[j].
|
||||
split(QString(":"), QString::SkipEmptyParts)[1].toFloat();
|
||||
index = inter_list[i].split(QString(","), QString::SkipEmptyParts)[j].
|
||||
split(QString(":"), QString::SkipEmptyParts)[0].
|
||||
split(QString("-"), QString::SkipEmptyParts)[0].toInt() +
|
||||
inter_list[i].split(QString(","), QString::SkipEmptyParts)[j].
|
||||
split(QString(":"), QString::SkipEmptyParts)[0].
|
||||
split(QString("-"), QString::SkipEmptyParts)[1].toInt() * 4;
|
||||
inter_list_one[16*i+index] = item;
|
||||
}
|
||||
for (int i=0; i<16*inter_list.count(); i++)
|
||||
if (inter_list_one[i] > 0.0)
|
||||
while (imax*int_step > inter_list_one[i])
|
||||
imax--;
|
||||
|
||||
// exec
|
||||
for (int i=-imax; i<=imax; i++)
|
||||
{
|
||||
QString command;
|
||||
command.append(mm_statgen_path);
|
||||
if (mask.contains(QDir::separator()))
|
||||
command.append(" -i " + QFileInfo(mask).absoluteFilePath());
|
||||
else
|
||||
command.append(" -i " + QFileInfo(QDir(workDir), mask).absoluteFilePath());
|
||||
command.append(" -s " + firstStep + "," + lastStep);
|
||||
command.append(" -c " + cellX + "," + cellY + "," + cellZ);
|
||||
command.append(" -a " + atom0);
|
||||
if (atom1 != QString("#"))
|
||||
command.append("," + atom1);
|
||||
if (atom2 != QString("#"))
|
||||
command.append("," + atom2);
|
||||
if (atom3 != QString("#"))
|
||||
command.append("," + atom3);
|
||||
command.append(inter);
|
||||
if (output.contains(QDir::separator()))
|
||||
command.append(" -o " + QFileInfo(output).absoluteFilePath());
|
||||
else
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
if (depth != QString("#"))
|
||||
command.append(" -g " + depth);
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
else
|
||||
command.append(" -l " + QFileInfo(QDir(workDir), log).absoluteFilePath());
|
||||
}
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
}
|
||||
delete inter_list_one;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Start_events::start_envir(QString mm_envir_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString molecule,
|
||||
QString radius,
|
||||
QString log)
|
||||
{
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (input == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_envir_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
command.append(mm_envir_path);
|
||||
if (input.contains(QDir::separator()))
|
||||
command.append(" -i " + QFileInfo(input).absoluteFilePath());
|
||||
else
|
||||
command.append(" -i " + QFileInfo(QDir(workDir), input).absoluteFilePath());
|
||||
command.append(" -c " + cellX + "," + cellY + "," + cellZ);
|
||||
if (output.contains(QDir::separator()))
|
||||
command.append(" -o " + QFileInfo(output).absoluteFilePath());
|
||||
else
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
command.append(" -n " + molecule);
|
||||
command.append(" -r " + radius);
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
else
|
||||
command.append(" -l " + QFileInfo(QDir(workDir), log).absoluteFilePath());
|
||||
}
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Start_events::start_radf(QString mm_radf_path,
|
||||
QString workDir,
|
||||
QString mask,
|
||||
QString firstStep,
|
||||
QString lastStep,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString atom0, QString atom1, QString atom2,
|
||||
QString atom3, QString atom4, QString atom5,
|
||||
QString radMin, QString radMax, QString radStep,
|
||||
QString angMin, QString angMax, QString angStep,
|
||||
QString log, int matrix)
|
||||
{
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (mask == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (atom1 != QString("#"))
|
||||
if ((atom0 == atom1) || (atom0 == atom2) || (atom1 == atom2) ||
|
||||
(atom3 == atom4) || (atom3 == atom5) || (atom4 == atom5))
|
||||
{
|
||||
errorwin->set_message(2);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_radf_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
command.append(mm_radf_path);
|
||||
if (mask.contains(QDir::separator()))
|
||||
command.append(" -i " + QFileInfo(mask).absoluteFilePath());
|
||||
else
|
||||
command.append(" -i " + QFileInfo(QDir(workDir), mask).absoluteFilePath());
|
||||
command.append(" -s " + firstStep + "," + lastStep);
|
||||
command.append(" -c " + cellX + "," + cellY + "," + cellZ);
|
||||
if (atom1 == QString("#"))
|
||||
command.append(" -at " + atom0 + "-" + atom3);
|
||||
else
|
||||
command.append(" -at " + atom0 + "," + atom1 + "," + atom2 +
|
||||
"-" + atom3 + "," + atom4 + "," + atom5);
|
||||
if (output.contains(QDir::separator()))
|
||||
command.append(" -o " + QFileInfo(output).absoluteFilePath());
|
||||
else
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
command.append(" -r " + radMin + "," + radMax);
|
||||
command.append(" -rs " + radStep);
|
||||
if (angStep != QString("#"))
|
||||
{
|
||||
command.append(" -a " + angMin + "," + angMax);
|
||||
command.append(" -as " + angStep);
|
||||
}
|
||||
if (matrix == 1)
|
||||
command.append(" -m ");
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
else
|
||||
command.append(" -l " + QFileInfo(QDir(workDir), log).absoluteFilePath());
|
||||
}
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Start_events::start_pdb(QString mm_pdb_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString agl,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString log)
|
||||
{
|
||||
// error check
|
||||
errorwin = new ErrorWindow(parent);
|
||||
if ((workDir == "") || (!QDir(workDir).exists()))
|
||||
{
|
||||
errorwin->set_message(0);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (input == "")
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if ((agl != QString("#")) && (agl == ""))
|
||||
{
|
||||
errorwin->set_message(1);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (output == "")
|
||||
{
|
||||
errorwin->set_message(4);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if ((log != QString("#")) && (log == ""))
|
||||
{
|
||||
errorwin->set_message(6);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
if (!QFile(mm_pdb_path).exists())
|
||||
{
|
||||
errorwin->set_message(7);
|
||||
errorwin->show();
|
||||
return false;
|
||||
}
|
||||
delete errorwin;
|
||||
|
||||
// exec
|
||||
QString command;
|
||||
command.append(mm_pdb_path);
|
||||
if (agl != QString("#"))
|
||||
{
|
||||
if (agl.contains(QDir::separator()))
|
||||
command.append(" -a " + QFileInfo(agl).absoluteFilePath());
|
||||
else
|
||||
command.append(" -a " + QFileInfo(QDir(workDir), agl).absoluteFilePath());
|
||||
}
|
||||
if (input.contains(QDir::separator()))
|
||||
command.append(" -i " + QFileInfo(input).absoluteFilePath());
|
||||
else
|
||||
command.append(" -i " + QFileInfo(QDir(workDir), input).absoluteFilePath());
|
||||
if (agl != QString("#"))
|
||||
command.append(" -c " + cellX + "," + cellY + "," + cellZ);
|
||||
if (output.contains(QDir::separator()))
|
||||
command.append(" -o " + QFileInfo(output).absoluteFilePath());
|
||||
else
|
||||
command.append(" -o " + QFileInfo(QDir(workDir), output).absoluteFilePath());
|
||||
if (log != QString("#"))
|
||||
{
|
||||
if (log.contains(QDir::separator()))
|
||||
command.append(" -l " + QFileInfo(log).absoluteFilePath());
|
||||
else
|
||||
command.append(" -l " + QFileInfo(QDir(workDir), log).absoluteFilePath());
|
||||
}
|
||||
command.append(" -q");
|
||||
|
||||
system(command.toStdString().c_str());
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
#ifndef START_EVENTS_H
|
||||
#define START_EVENTS_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class MainWindow;
|
||||
class ErrorWindow;
|
||||
|
||||
class Start_events : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Start_events(MainWindow *wid = 0);
|
||||
bool start_trj(QString mm_trj_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString type,
|
||||
QString steps,
|
||||
QString atomType,
|
||||
QString mask,
|
||||
QString totalTypes,
|
||||
QString log);
|
||||
bool start_statgen(QString mm_statgen_path,
|
||||
QString workDir,
|
||||
QString mask,
|
||||
QString firstStep,
|
||||
QString lastStep,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString atom0, QString atom1, QString atom2, QString atom3,
|
||||
QString inter,
|
||||
QString output,
|
||||
QString depth,
|
||||
QString log);
|
||||
bool start_statgen_analysis(QString mm_statgen_path,
|
||||
QString workDir,
|
||||
QString mask,
|
||||
QString firstStep,
|
||||
QString lastStep,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString atom0, QString atom1, QString atom2, QString atom3,
|
||||
QString inter,
|
||||
QString output,
|
||||
QString depth,
|
||||
QString log,
|
||||
float int_step);
|
||||
bool start_envir(QString mm_envir_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString molecule,
|
||||
QString radius,
|
||||
QString log);
|
||||
bool start_radf(QString mm_radf_path,
|
||||
QString workDir,
|
||||
QString mask,
|
||||
QString firstStep,
|
||||
QString lastStep,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString atom0, QString atom1, QString atom2,
|
||||
QString atom3, QString atom4, QString atom5,
|
||||
QString radMin, QString radMax, QString radStep,
|
||||
QString angMin, QString angMax, QString angStep,
|
||||
QString log, int matrix);
|
||||
bool start_pdb(QString mm_pdb_path,
|
||||
QString workDir,
|
||||
QString input,
|
||||
QString agl,
|
||||
QString cellX, QString cellY, QString cellZ,
|
||||
QString output,
|
||||
QString log);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
private slots:
|
||||
|
||||
private:
|
||||
MainWindow *parent;
|
||||
ErrorWindow *errorwin;
|
||||
};
|
||||
|
||||
#endif /* START_EVENTS_H */
|
||||
@@ -0,0 +1,159 @@
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QKeyEvent>
|
||||
#include <QTextStream>
|
||||
|
||||
#include <qwt/qwt_plot.h>
|
||||
#include <qwt/qwt_plot_curve.h>
|
||||
#include <qwt/qwt_series_data.h>
|
||||
|
||||
#include "statgengraphwindow.h"
|
||||
#include "ui_statgengraphwindow.h"
|
||||
|
||||
StatgenGraphWindow::StatgenGraphWindow(QWidget *parent, QString inputfile) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::StatgenGraphWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
_inputfile = inputfile;
|
||||
|
||||
readData();
|
||||
paintGraph();
|
||||
}
|
||||
|
||||
StatgenGraphWindow::~StatgenGraphWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// ESC press event
|
||||
void StatgenGraphWindow::keyPressEvent(QKeyEvent *pressedKey)
|
||||
{
|
||||
if (pressedKey->key() == Qt::Key_Escape)
|
||||
close();
|
||||
}
|
||||
|
||||
void StatgenGraphWindow::paintGraph()
|
||||
{
|
||||
plot = new QwtPlot(ui->centralwidget);
|
||||
plot->setMinimumSize(QSize(322, 280));
|
||||
ui->verticalLayout->addWidget(plot);
|
||||
|
||||
plot->setFont(QFont("Times New Roman", 8, QFont::Bold));
|
||||
plot->setAxisFont(QwtPlot::xBottom, QFont("Times New Roman", 8, QFont::Bold));
|
||||
plot->setAxisFont(QwtPlot::yLeft, QFont("Times New Roman", 8, QFont::Bold));
|
||||
plot->setAxisAutoScale(QwtPlot::xBottom, true);
|
||||
plot->setAxisAutoScale(QwtPlot::yLeft, true);
|
||||
plot->setAutoReplot(true);
|
||||
|
||||
QPen pen;
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
plot->setAxisTitle(QwtPlot::xBottom, trUtf8("N"));
|
||||
plot->setAxisTitle(QwtPlot::yLeft, trUtf8("p"));
|
||||
|
||||
pen = QPen(QColor(0,0,0));
|
||||
QwtPlotCurve *p_curve;
|
||||
p_curve = new QwtPlotCurve(QString("p"));
|
||||
p_curve->setPen(pen);
|
||||
p_curve->attach(plot);
|
||||
p_curve->setSamples(x_axis, p_points);
|
||||
|
||||
QwtPlotCurve *pn_curve;
|
||||
pen = QPen(QColor(255,0,0));
|
||||
pn_curve = new QwtPlotCurve(QString("pn"));
|
||||
pn_curve->setPen(pen);
|
||||
pn_curve->attach(plot);
|
||||
pn_curve->setSamples(x_axis, pn_points);
|
||||
break;
|
||||
case 1:
|
||||
plot->setAxisTitle(QwtPlot::xBottom, trUtf8("r"));
|
||||
plot->setAxisTitle(QwtPlot::yLeft, trUtf8("g"));
|
||||
|
||||
pen = QPen(QColor(0,0,0));
|
||||
QwtPlotCurve *radf_curve;
|
||||
radf_curve = new QwtPlotCurve(QString("RDF"));
|
||||
radf_curve->setPen(pen);
|
||||
radf_curve->attach(plot);
|
||||
radf_curve->setSamples(x_axis, p_points);
|
||||
break;
|
||||
}
|
||||
plot->replot();
|
||||
}
|
||||
|
||||
void StatgenGraphWindow::readData()
|
||||
{
|
||||
QString tmp_str;
|
||||
QFile inp_file(_inputfile);
|
||||
inp_file.open(QIODevice::ReadOnly);
|
||||
tmp_str = QString(inp_file.readLine());
|
||||
int matrix=0;
|
||||
if (tmp_str.contains(QString("statgen")))
|
||||
type = 0;
|
||||
else if (tmp_str.contains(QString("radf")))
|
||||
type = 1;
|
||||
while (!tmp_str.contains(QString("SUMMARY STATISTIC")))
|
||||
{
|
||||
tmp_str = QString(inp_file.readLine());
|
||||
if ((type == 1) && (tmp_str.contains(QString("MATRIX="))))
|
||||
matrix = tmp_str.split(QString("MATRIX="), QString::SkipEmptyParts)[0].toInt();
|
||||
}
|
||||
if (matrix == 0)
|
||||
{
|
||||
tmp_str = QString(inp_file.readLine());
|
||||
tmp_str = QString(inp_file.readLine());
|
||||
}
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case 0:
|
||||
tmp_str = QString(inp_file.readLine());
|
||||
while (!tmp_str.contains(QString("---")))
|
||||
{
|
||||
x_axis.append(tmp_str.split(QString(" "), QString::SkipEmptyParts)[0].toDouble());
|
||||
p_points.append(tmp_str.split(QString(" "), QString::SkipEmptyParts)[3].toDouble());
|
||||
pn_points.append(tmp_str.split(QString(" "), QString::SkipEmptyParts)[4].toDouble());
|
||||
tmp_str = QString(inp_file.readLine());
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
tmp_str = QString(inp_file.readLine());
|
||||
while (!tmp_str.contains(QString("---")))
|
||||
{
|
||||
x_axis.append(tmp_str.split(QString(" "), QString::SkipEmptyParts)[0].toDouble());
|
||||
switch(matrix)
|
||||
{
|
||||
case 0:
|
||||
p_points.append(tmp_str.split(QString(" "), QString::SkipEmptyParts)[3].toDouble());
|
||||
break;
|
||||
case 1:
|
||||
p_points.append(tmp_str.split(QString(" "), QString::SkipEmptyParts)[1].toDouble());
|
||||
break;
|
||||
}
|
||||
tmp_str = QString(inp_file.readLine());
|
||||
}
|
||||
break;
|
||||
}
|
||||
inp_file.close();
|
||||
}
|
||||
|
||||
void StatgenGraphWindow::on_graph_pushButton_save_clicked()
|
||||
{
|
||||
QPixmap qPix = QPixmap::grabWidget(plot);
|
||||
QString filename = QFileDialog::getSaveFileName(
|
||||
this,
|
||||
tr("Save image as..."),
|
||||
QDir::currentPath(),
|
||||
tr("JPEG file (*.jpeg);;Portable Network Graphics file (*.png);;Bitmap file (*.bmp)"));
|
||||
if (!filename.isEmpty())
|
||||
{
|
||||
if (filename.contains(QRegExp("jpeg")))
|
||||
qPix.save(filename, "JPEG");
|
||||
else if (filename.contains(QRegExp("png")))
|
||||
qPix.save(filename, "PNG");
|
||||
else if (filename.contains(QRegExp("bmp")))
|
||||
qPix.save(filename, "BMP");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef STATGENGRAPHWINDOW_H
|
||||
#define STATGENGRAPHWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <qwt/qwt_plot.h>
|
||||
|
||||
namespace Ui {
|
||||
class StatgenGraphWindow;
|
||||
}
|
||||
|
||||
class StatgenGraphWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StatgenGraphWindow(QWidget *parent = 0, QString inputfile = "");
|
||||
~StatgenGraphWindow();
|
||||
void paintGraph();
|
||||
void readData();
|
||||
|
||||
private slots:
|
||||
void on_graph_pushButton_save_clicked();
|
||||
|
||||
private:
|
||||
Ui::StatgenGraphWindow *ui;
|
||||
QwtPlot *plot;
|
||||
QVector<double> x_axis;
|
||||
QVector<double> p_points;
|
||||
QVector<double> pn_points;
|
||||
int type;
|
||||
QString _inputfile;
|
||||
|
||||
void keyPressEvent(QKeyEvent *pressedKey);
|
||||
};
|
||||
|
||||
#endif /* STATGENGRAPHWINDOW_H */
|
||||
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>StatgenGraphWindow</class>
|
||||
<widget class="QMainWindow" name="StatgenGraphWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>418</width>
|
||||
<height>299</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Graph</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="graph_layout_buttons">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="graph_pushButton_save">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="graph_pushButton_close">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>graph_pushButton_save</tabstop>
|
||||
<tabstop>graph_pushButton_close</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>graph_pushButton_close</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>StatgenGraphWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>400</x>
|
||||
<y>322</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>400</x>
|
||||
<y>342</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -0,0 +1,221 @@
|
||||
#include <QDir>
|
||||
#include <math.h>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include "update_fields.h"
|
||||
|
||||
Update_fields::Update_fields(MainWindow *wid) :
|
||||
parent(wid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Update_fields::setup_def_statgen()
|
||||
{
|
||||
// set work directory
|
||||
parent->ui->statgen_lineEdit_workDir->setText(parent->ui->trj_lineEdit_workDir->text());
|
||||
// set mask
|
||||
parent->ui->statgen_lineEdit_input->setText(parent->ui->trj_lineEdit_output->text());
|
||||
// set steps
|
||||
parent->ui->statgen_spinBox_stepsLast->setValue(parent->ui->trj_spinBox_steps->value());
|
||||
// set cell size
|
||||
float cellX, cellY, cellZ;
|
||||
QStringList tmp_str;
|
||||
QString input = parent->ui->trj_lineEdit_input->text();
|
||||
if (input.contains(QDir::separator()))
|
||||
input = QFileInfo(input).absoluteFilePath();
|
||||
else
|
||||
input = QFileInfo(QDir(parent->ui->trj_lineEdit_workDir->text()), input).absoluteFilePath();
|
||||
QFile inp_trj(input);
|
||||
bool exists = inp_trj.open(QIODevice::ReadOnly);
|
||||
if (!exists)
|
||||
return;
|
||||
if (parent->ui->trj_comboBox_type->currentIndex() == 0)
|
||||
{
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
if (tmp_str[1] != QString("frame"))
|
||||
return;
|
||||
for (int i=0; i<2; i++)
|
||||
inp_trj.readLine();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellX = 10 * tmp_str[2].remove(tmp_str[2].count()-1, 1).toFloat();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellY = 10 * tmp_str[3].remove(tmp_str[3].count()-1, 1).toFloat();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellZ = 10 * tmp_str[4].remove(tmp_str[4].count()-2, 1).toFloat();
|
||||
}
|
||||
else if (parent->ui->trj_comboBox_type->currentIndex() == 1)
|
||||
{
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
bool ok = false;
|
||||
cellX = tmp_str[0].toInt(&ok, 10);
|
||||
if (!ok)
|
||||
return;
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellX = tmp_str[0].toFloat();
|
||||
cellY = tmp_str[1].toFloat();
|
||||
cellZ = tmp_str[2].toFloat();
|
||||
}
|
||||
else
|
||||
return;
|
||||
inp_trj.close();
|
||||
parent->ui->statgen_doubleSpinBox_cellX->setValue(cellX);
|
||||
parent->ui->statgen_doubleSpinBox_cellY->setValue(cellY);
|
||||
parent->ui->statgen_doubleSpinBox_cellZ->setValue(cellZ);
|
||||
}
|
||||
|
||||
void Update_fields::setup_def_envir()
|
||||
{
|
||||
// set work directory
|
||||
parent->ui->envir_lineEdit_workDir->setText(parent->ui->trj_lineEdit_workDir->text());
|
||||
// set cell size
|
||||
float cellX, cellY, cellZ;
|
||||
QStringList tmp_str;
|
||||
QString input = parent->ui->trj_lineEdit_input->text();
|
||||
if (input.contains(QDir::separator()))
|
||||
input = QFileInfo(input).absoluteFilePath();
|
||||
else
|
||||
input = QFileInfo(QDir(parent->ui->trj_lineEdit_workDir->text()), input).absoluteFilePath();
|
||||
QFile inp_trj(input);
|
||||
bool exists = inp_trj.open(QIODevice::ReadOnly);
|
||||
if (!exists)
|
||||
return;
|
||||
if (parent->ui->trj_comboBox_type->currentIndex() == 0)
|
||||
{
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
if (tmp_str[1] != QString("frame"))
|
||||
return;
|
||||
for (int i=0; i<2; i++)
|
||||
inp_trj.readLine();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellX = 10 * tmp_str[2].remove(tmp_str[2].count()-1, 1).toFloat();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellY = 10 * tmp_str[3].remove(tmp_str[3].count()-1, 1).toFloat();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellZ = 10 * tmp_str[4].remove(tmp_str[4].count()-2, 1).toFloat();
|
||||
}
|
||||
else if (parent->ui->trj_comboBox_type->currentIndex() == 1)
|
||||
{
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
bool ok = false;
|
||||
cellX = tmp_str[0].toInt(&ok, 10);
|
||||
if (!ok)
|
||||
return;
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellX = tmp_str[0].toFloat();
|
||||
cellY = tmp_str[1].toFloat();
|
||||
cellZ = tmp_str[2].toFloat();
|
||||
}
|
||||
else
|
||||
return;
|
||||
inp_trj.close();
|
||||
parent->ui->envir_doubleSpinBox_cellX->setValue(cellX);
|
||||
parent->ui->envir_doubleSpinBox_cellY->setValue(cellY);
|
||||
parent->ui->envir_doubleSpinBox_cellZ->setValue(cellZ);
|
||||
}
|
||||
|
||||
void Update_fields::setup_def_radf()
|
||||
{
|
||||
// set work directory
|
||||
parent->ui->radf_lineEdit_workDir->setText(parent->ui->trj_lineEdit_workDir->text());
|
||||
// set mask
|
||||
parent->ui->radf_lineEdit_input->setText(parent->ui->trj_lineEdit_output->text());
|
||||
// set steps
|
||||
parent->ui->radf_spinBox_stepsLast->setValue(parent->ui->trj_spinBox_steps->value());
|
||||
// set cell size
|
||||
float cellX, cellY, cellZ;
|
||||
QStringList tmp_str;
|
||||
QString input = parent->ui->trj_lineEdit_input->text();
|
||||
if (input.contains(QDir::separator()))
|
||||
input = QFileInfo(input).absoluteFilePath();
|
||||
else
|
||||
input = QFileInfo(QDir(parent->ui->trj_lineEdit_workDir->text()), input).absoluteFilePath();
|
||||
QFile inp_trj(input);
|
||||
bool exists = inp_trj.open(QIODevice::ReadOnly);
|
||||
if (!exists)
|
||||
return;
|
||||
if (parent->ui->trj_comboBox_type->currentIndex() == 0)
|
||||
{
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
if (tmp_str[1] != QString("frame"))
|
||||
return;
|
||||
for (int i=0; i<2; i++)
|
||||
inp_trj.readLine();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellX = 10 * tmp_str[2].remove(tmp_str[2].count()-1, 1).toFloat();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellY = 10 * tmp_str[3].remove(tmp_str[3].count()-1, 1).toFloat();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellZ = 10 * tmp_str[4].remove(tmp_str[4].count()-2, 1).toFloat();
|
||||
}
|
||||
else if (parent->ui->trj_comboBox_type->currentIndex() == 1)
|
||||
{
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
bool ok = false;
|
||||
cellX = tmp_str[0].toInt(&ok, 10);
|
||||
if (!ok)
|
||||
return;
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellX = tmp_str[0].toFloat();
|
||||
cellY = tmp_str[1].toFloat();
|
||||
cellZ = tmp_str[2].toFloat();
|
||||
}
|
||||
else
|
||||
return;
|
||||
inp_trj.close();
|
||||
parent->ui->radf_doubleSpinBox_cellX->setValue(cellX);
|
||||
parent->ui->radf_doubleSpinBox_cellY->setValue(cellY);
|
||||
parent->ui->radf_doubleSpinBox_cellZ->setValue(cellZ);
|
||||
}
|
||||
|
||||
void Update_fields::setup_def_pdb()
|
||||
{
|
||||
// set work directory
|
||||
parent->ui->pdb_lineEdit_workDir->setText(parent->ui->trj_lineEdit_workDir->text());
|
||||
// set cell size
|
||||
float cellX, cellY, cellZ;
|
||||
QStringList tmp_str;
|
||||
QString input = parent->ui->trj_lineEdit_input->text();
|
||||
if (input.contains(QDir::separator()))
|
||||
input = QFileInfo(input).absoluteFilePath();
|
||||
else
|
||||
input = QFileInfo(QDir(parent->ui->trj_lineEdit_workDir->text()), input).absoluteFilePath();
|
||||
QFile inp_trj(input);
|
||||
bool exists = inp_trj.open(QIODevice::ReadOnly);
|
||||
if (!exists)
|
||||
return;
|
||||
if (parent->ui->trj_comboBox_type->currentIndex() == 0)
|
||||
{
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
if (tmp_str[1] != QString("frame"))
|
||||
return;
|
||||
for (int i=0; i<2; i++)
|
||||
inp_trj.readLine();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellX = 10 * tmp_str[2].remove(tmp_str[2].count()-1, 1).toFloat();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellY = 10 * tmp_str[3].remove(tmp_str[3].count()-1, 1).toFloat();
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellZ = 10 * tmp_str[4].remove(tmp_str[4].count()-2, 1).toFloat();
|
||||
}
|
||||
else if (parent->ui->trj_comboBox_type->currentIndex() == 1)
|
||||
{
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
bool ok = false;
|
||||
cellX = tmp_str[0].toInt(&ok, 10);
|
||||
if (!ok)
|
||||
return;
|
||||
tmp_str = QString(inp_trj.readLine()).split(' ', QString::SkipEmptyParts);
|
||||
cellX = tmp_str[0].toFloat();
|
||||
cellY = tmp_str[1].toFloat();
|
||||
cellZ = tmp_str[2].toFloat();
|
||||
}
|
||||
else
|
||||
return;
|
||||
inp_trj.close();
|
||||
parent->ui->pdb_doubleSpinBox_cellX->setValue(cellX);
|
||||
parent->ui->pdb_doubleSpinBox_cellY->setValue(cellY);
|
||||
parent->ui->pdb_doubleSpinBox_cellZ->setValue(cellZ);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef UPDATE_FIELDS_H
|
||||
#define UPDATE_FIELDS_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Update_fields : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Update_fields(MainWindow *wid = 0);
|
||||
void setup_def_statgen();
|
||||
void setup_def_envir();
|
||||
void setup_def_radf();
|
||||
void setup_def_pdb();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
private:
|
||||
MainWindow *parent;
|
||||
};
|
||||
|
||||
#endif /* UPDATE_FIELDS_H */
|
||||
Reference in New Issue
Block a user