Skip to content

Commit

Permalink
remove DesignType enum and EnumMap
Browse files Browse the repository at this point in the history
  • Loading branch information
nam20485 committed May 12, 2024
1 parent 0276281 commit 1572c46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
8 changes: 4 additions & 4 deletions OdbDesignLib/App/RouteController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ namespace Odb::Lib::App
for (const auto& designName : unloadedDesignNames)
{
auto loaded = false;
auto designType = DesignType::FileArchive;
auto isDesign = false;
if (std::find(loadedFileArchiveNames.begin(), loadedFileArchiveNames.end(), designName) != loadedFileArchiveNames.end())
{
loaded = true;
designType = DesignType::FileArchive;
isDesign = false;
}
else if (std::find(loadedDesignNames.begin(), loadedDesignNames.end(), designName) != loadedDesignNames.end())
{
loaded = true;
designType = DesignType::Design;
isDesign = true;
}
crow::json::wvalue design;
design["name"] = designName;
design["loaded"] = loaded;
design["type"] = designTypeMap.getValue(designType);
design["type"] = isDesign? "Design" : "FileArchive";
designs.push_back(design);
}
crow::json::wvalue jsonResponse;
Expand Down
11 changes: 1 addition & 10 deletions OdbDesignLib/enums.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include "EnumMap.h"

namespace Odb::Lib
{
enum class BoardSide
Expand Down Expand Up @@ -34,12 +32,5 @@ namespace Odb::Lib
{
FileArchive,
Design
};

static const Utils::EnumMap<DesignType> designTypeMap{
{
"FileArchive",
"Design"
}
};
};
}

0 comments on commit 1572c46

Please sign in to comment.