Verified Commit ce1a9b3b authored by Tobias WEBER's avatar Tobias WEBER
Browse files

continued with magnetic space group browser

parent 38976be3
......@@ -28,13 +28,10 @@
# External libraries
ext/**
plugins/**
!ext/.dir
!plugins/.dir
!plugins/qtas.py
data/**
# Temporary files
tmp/**
!tmp/.dir
build/**
tools/structfact/build/**
tools/cif2xml/build/**
......
......@@ -28,12 +28,9 @@ add_subdirectory(tools/scanbrowser)
if(NOT ONLY_BUILD_FINISHED)
# tools in development
# setup tools
add_subdirectory(tools/setup)
# magnetic structure factor browser
add_subdirectory(tools/magsgbrowser)
endif()
This diff is collapsed.
#!/bin/bash
#
# downloads external libraries for in20tools
# downloads external libraries
# @author Tobias Weber <tweber@ill.fr>
# @date 6-apr-18
# @license GPLv3, see 'LICENSE' file
......@@ -19,11 +19,13 @@ UZIP=unzip
TLIBS=https://forge.frm2.tum.de/cgit/cgit.cgi/frm2/mira/tlibs.git/snapshot/tlibs-master.tar.bz2
QCP=https://www.qcustomplot.com/release/2.0.1/QCustomPlot-source.tar.gz
GEMMI=https://github.com/project-gemmi/gemmi/archive/master.zip
MAGDATA=https://stokes.byu.edu/iso/magnetic_data.txt
# local file names
TLIBS_LOCAL=${TLIBS##*[/\\]}
QCP_LOCAL=${QCP##*[/\\]}
GEMMI_LOCAL=${GEMMI##*[/\\]}
MAGDATA_LOCAL=${MAGDATA##*[/\\]}
# -----------------------------------------------------------------------------
......@@ -80,10 +82,23 @@ function dl_gemmi()
mv gemmi-master gemmi
}
function dl_magdata()
{
if ! ${WGET} ${MAGDATA}
then
echo -e "Error downloading magnetic space group data.";
exit -1;
fi
mv ${MAGDATA_LOCAL} magsg.dat
}
# -----------------------------------------------------------------------------
mkdir -p ext
mkdir -pv data
mkdir -pv ext
cd ext
echo -e "\n--------------------------------------------------------------------------------"
......@@ -102,6 +117,11 @@ echo -e "Installing external Gemmi library...\n"
dl_gemmi
echo -e "--------------------------------------------------------------------------------\n"
echo -e "\n--------------------------------------------------------------------------------"
echo -e "Downloading magnetic space group data...\n"
dl_magdata
echo -e "--------------------------------------------------------------------------------\n"
echo -e "\n--------------------------------------------------------------------------------"
echo -e "Removing temporary files...\n"
clean_files
......
......@@ -80,7 +80,7 @@ SgBrowserDlg::SgBrowserDlg(QWidget* pParent, QSettings *pSett)
void SgBrowserDlg::SetupMagSpaceGroups()
{
std::cerr << "Loading magnetic space groups ... ";
m_magsgs.Load("magsg.info");
m_magsgs.Load("data/magsg.info");
std::cerr << "Done." << std::endl;
const auto *pSgs = m_magsgs.GetSpacegroups();
......
......@@ -12,11 +12,17 @@ add_definitions(-std=c++20)
include_directories("${PROJECT_SOURCE_DIR}" "../..")
message("PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}.")
message("CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}.")
message("CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}.")
# -----------------------------------------------------------------------------
# setup tool
add_executable(convmag
convmag.cpp
)
add_executable(setup convmag.cpp)
target_link_libraries(setup)
target_link_libraries(convmag)
add_custom_command(TARGET setup POST_BUILD
COMMAND cd ${CMAKE_SOURCE_DIR} && ${CMAKE_BINARY_DIR}/tools/setup/setup
MAIN_DEPENDENCY setup)
# -----------------------------------------------------------------------------
......@@ -438,12 +438,10 @@ void convert_table(const char* pcInFile, const char* pcOutFile)
int main(int argc, char **argv)
{
if(argc < 3)
{
std::cerr << "Usage: " << argv[0] << " <in.dat> <out.info>" << std::endl;
return -1;
}
if(argc >= 3)
convert_table(argv[1], argv[2]);
else
convert_table("ext/magsg.dat", "data/magsg.info");
convert_table(argv[1], argv[2]);
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment