Commit 7e3459d4 authored by Tobias WEBER's avatar Tobias WEBER
Browse files

cosmetic changes

parent 0e618c76
......@@ -48,6 +48,7 @@ tmp/**
build/**
tools/structfact/build/**
tools/magstructfact/build/**
tools/magsgbrowser/build/**
tools/pol/build/**
*.pyc
.DS_Store
......
......@@ -4,7 +4,7 @@
# @license GPLv3, see 'LICENSE' file
# @desc The present version was forked on 8-Nov-2018 from the privately developed "magtools" project (https://github.com/t-weber/magtools).
#
project(sgbrowser)
project(magsgbrowser)
cmake_minimum_required(VERSION 3.0)
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets)
......@@ -19,12 +19,12 @@ include_directories("${PROJECT_SOURCE_DIR}" "../..")
# -----------------------------------------------------------------------------
# main program
add_executable(sgbrowser
add_executable(magsgbrowser
main.cpp
browser.cpp browser.h
)
target_link_libraries(sgbrowser
target_link_libraries(magsgbrowser
Qt5::Core Qt5::Gui Qt5::Widgets
)
# -----------------------------------------------------------------------------
......
......@@ -68,7 +68,7 @@ SgBrowserDlg::SgBrowserDlg(QWidget* pParent, QSettings *pSett)
void SgBrowserDlg::SetupSpaceGroups()
{
std::cerr << "Loading space groups ... ";
m_sgs.Load("../magsg.info");
m_sgs.Load("magsg.info");
std::cerr << "Done." << std::endl;
const auto *pSgs = m_sgs.GetSpacegroups();
......
......@@ -4,6 +4,8 @@
* @date 18-nov-17
* @license GPLv3, see 'LICENSE' file
* @desc The present version was forked on 8-Nov-2018 from the privately developed "magtools" project (https://github.com/t-weber/magtools).
*
* g++-8 -std=c++17 -fconcepts -I../../ -o convmag convmag.cpp
*/
#include <iostream>
......@@ -384,12 +386,12 @@ void convert_spacegroup(std::istream& istr, ptree::ptree& prop, const std::strin
}
void convert_table(const char* pcFile)
void convert_table(const char* pcInFile, const char* pcOutFile)
{
std::ifstream istr(pcFile);
std::ifstream istr(pcInFile);
if(!istr)
{
std::cerr << "Cannot open \"" << pcFile << "\"." << std::endl;
std::cerr << "Cannot open \"" << pcInFile << "\"." << std::endl;
return;
}
......@@ -421,17 +423,23 @@ void convert_table(const char* pcFile)
std::cout << "\n";
/*ptree::write_xml("magsg.xml", prop,
/*ptree::write_xml(pcOutFile, prop,
std::locale(),
ptree::xml_writer_make_settings('\t', 1, std::string("utf-8")));*/
ptree::write_info("magsg.info", prop,
ptree::write_info(pcOutFile, prop,
std::locale(),
ptree::info_writer_make_settings('\t', 1));
}
int main()
int main(int argc, char **argv)
{
convert_table("mag.dat");
if(argc < 3)
{
std::cerr << "Usage: " << argv[0] << " <in.dat> <out.info>" << std::endl;
return -1;
}
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