Skip to content
Snippets Groups Projects
Select Git revision
  • 996ba66754628a3671cd3edd7fa8d3c510182793
  • master default
  • 1.1
  • 1.0
4 results

translators.cpp

Blame
  • translators.cpp 13.80 KiB
    #include "translators.h"
    #include <vector>
    #include <iostream>
    #include <cassert>
    #include <map>
    #include <algorithm>
    #include <sstream>
    
    #include "strops.h"
    #include "eistype.h"
    #include "log.h"
    #include "componant.h"
    
    namespace eis
    {
    
    const struct std::pair<const char*, const char*> eisRelaxisTable[] =
    {
    	{"r", "R"},
    	{"R", "R"},
    	{"c", "C"},
    	{"C", "C"},
    	{"l", "I"},
    	{"L", "I"},
    	{"p", "P"},
    	{"P", "P"},
    	{"w", "W"},
    	{"W", "W"},
    	{"t", "Tlmo"},
    	{"T", "Tlmo"},
    	{nullptr, nullptr}
    };
    
    const struct std::pair<const char*, const char*> eisCdcTable[] =
    {
    	{"r", "R"},
    	{"R", "R"},
    	{"c", "C"},
    	{"C", "C"},
    	{"l", "L"},
    	{"L", "L"},
    	{"p", "P"},
    	{"P", "P"},
    	{"w", "W"},
    	{"W", "W"},
    	{"t", "T"},
    	{"T", "T"},
    	{nullptr, nullptr}
    };
    
    const struct std::pair<const char*, const char*> eisMadapTable[] =
    {
    	{"r", "R"},
    	{"R", "R"},
    	{"c", "C"},
    	{"C", "C"},
    	{"l", "L"},
    	{"L", "L"},
    	{"p", "CPE"},
    	{"P", "CPE"},
    	{"w", "W"},
    	{"W", "W"},
    	{"w", "Wo"},
    	{"W", "Wo"},
    	{nullptr, nullptr}
    };
    
    static std::string translateElement(const std::string& in, const struct std::pair<const char*, const char*>* table, bool reverse = false)
    {
    	size_t i = 0;