├── .nvmrc
├── .gemini
└── code-config.yaml
├── Utils
├── EnumMap.cpp
├── IJsonable.cpp
├── StringVector.h
├── ExitCode.h
├── utils_export.h
├── win.h
├── equals_within.cpp
├── IJsonable.h
├── equals_within.h
├── fastmove.h
├── CrossPlatform.h
├── libarchive_extract.h
├── timestamp.h
├── crow_win.h
├── UrlEncoding.h
├── CrowReturnable.h
├── FileReader.h
├── StopWatch.h
├── JsonCrowReturnable.h
├── fastmove.cpp
├── StopWatch.cpp
├── CommandLineArgs.h
├── CMakeLists.txt
├── timestamp.cpp
├── FileReader.cpp
├── CrossPlatform.cpp
├── ArchiveExtractor.h
├── UrlEncoding.cpp
├── EnumMap.h
└── str_utils.h
├── test_data
└── FILES
│ └── test.txt
├── local_ai_instruction_modules
├── ai-local-instructions.md
└── ai-terminal-commands.md
├── OdbDesignLib
├── App
│ ├── IOdbApp.cpp
│ ├── IOdbServerApp.cpp
│ ├── IOdbApp.h
│ ├── RequestAuthenticationBase.h
│ ├── IOdbServerApp.h
│ ├── OdbAppBase.h
│ ├── RouteController.h
│ ├── BasicRequestAuthentication.h
│ ├── RequestAuthenticationBase.cpp
│ ├── OdbDesignArgs.h
│ ├── OdbServerAppBase.h
│ ├── DesignCache.h
│ └── OdbDesignArgs.cpp
├── FileModel
│ ├── invalid_odb_error.cpp
│ ├── Design
│ │ ├── FileArchive.h
│ │ ├── AttributeLookupTable.h
│ │ ├── RgbColor.h
│ │ ├── PropertyRecord.cpp
│ │ ├── PropertyRecord.h
│ │ ├── SymbolName.h
│ │ ├── RgbColor.cpp
│ │ ├── SymbolsDirectory.h
│ │ ├── AttrListFile.h
│ │ ├── AttributeLookupTable.cpp
│ │ ├── LayerDirectory.h
│ │ ├── SymbolName.cpp
│ │ ├── ContourPolygon.h
│ │ ├── StepHdrFile.h
│ │ ├── ContourPolygon.cpp
│ │ ├── StandardFontsFile.h
│ │ └── StepDirectory.h
│ ├── IStreamSaveable.h
│ ├── ISaveable.h
│ ├── invalid_odb_error.h
│ ├── parse_error.cpp
│ ├── OdbFile.cpp
│ ├── OdbFile.h
│ ├── parse_info.cpp
│ ├── parse_info.h
│ └── parse_error.h
├── protoc
│ ├── part.proto
│ ├── pin.proto
│ ├── color.proto
│ ├── via.proto
│ ├── symbolname.proto
│ ├── attrlistfile.proto
│ ├── symbolsdirectory.proto
│ ├── enums.proto
│ ├── net.proto
│ ├── package.proto
│ ├── pinconnection.proto
│ ├── layerdirectory.proto
│ ├── miscinfofile.proto
│ ├── component.proto
│ ├── stepdirectory.proto
│ ├── filearchive.proto
│ ├── toolsfile.proto
│ ├── standardfontsfile.proto
│ ├── common.proto
│ ├── stephdrfile.proto
│ ├── design.proto
│ ├── netlistfile.proto
│ ├── matrixfile.proto
│ ├── featuresfile.proto
│ └── componentsfile.proto
├── OdbDesign.h
├── odbdesign_export.h
├── Constants.h
├── enums.h
└── ProductModel
│ ├── Part.cpp
│ ├── Part.h
│ ├── Pin.cpp
│ ├── Via.h
│ ├── Pin.h
│ ├── Via.cpp
│ ├── Net.h
│ ├── Package.h
│ ├── PinConnection.h
│ ├── Component.h
│ ├── Net.cpp
│ └── PinConnection.cpp
├── docs
├── odb_spec_user.pdf
├── odb++ file hierarchy (implemented).png
├── _config.yml
├── CONTRIBUTING.md
├── SECURITY.md
└── CODEQL_SETUP_COMPLETE.md
├── OdbDesign.code-workspace
├── OdbDesignServer
├── OdbDesignServer.h
├── templates
│ └── helloworld.html
├── main.cpp
├── Controllers
│ ├── HelloWorldController.h
│ ├── HealthCheckController.h
│ ├── HelloWorldController.cpp
│ ├── FileUploadController.h
│ ├── DesignsController.h
│ └── HealthCheckController.cpp
├── OdbDesignServerApp.h
├── CMakeLists.txt
└── OdbDesignServerApp.cpp
├── .github
├── CODEOWNERS
├── prompts
│ ├── odf_inp_adv-mem.prompt.md
│ └── odf_project-setup_advanced-memory.prompt.md
├── dependabot.yml
├── workflows
│ ├── disabled
│ │ ├── validate-plans.yml
│ │ ├── python-publish.yml
│ │ └── test-runtime.yml
│ ├── sbom-generate-submit.yml
│ ├── prebuild.yml
│ ├── dependency-review.yml
│ └── validate-setup-scripts.yml
├── problem-matchers
│ ├── eslint-stylish.json
│ └── dotnet.json
├── ISSUE_TEMPLATE
│ ├── feature_request.md
│ ├── bug_report.md
│ └── copilot-task.md
├── codeql
│ └── cpp-queries
│ │ ├── odbdesign-suite.qls
│ │ └── odbdesign-security.ql
├── .branch-protection-ruleset_protected branches.json
├── codeql-config.yml
├── .labels.json
├── .mcp-github.json
└── mcp.json
├── .idea
├── OdbDesign.iml
├── misc.xml
├── codeStyles
│ └── codeStyleConfig.xml
├── vcs.xml
└── modules.xml
├── deploy
├── helm
│ ├── values-trivy.yaml
│ └── values-prom.yaml
└── kube
│ ├── k3d-volume-pvc.yaml
│ ├── k3d-volume-pv.yaml
│ ├── issuer.yaml
│ ├── OdbDesignServer-SwaggerUI
│ ├── service.yaml
│ └── deployment.yaml
│ ├── OdbDesignServer
│ └── service.yaml
│ ├── local-ingress.yaml
│ └── default-ingress (eks).yaml
├── .vscode
├── settings.json
├── mcp.json
└── codeql-settings.json
├── OdbDesignApp
├── OdbDesignApp.h
└── CMakeLists.txt
├── .dockerignore
├── scripts
├── odbdesign-server-request-secret.ps1
├── fetch-setup-linux-script.ps1
├── install-dependencies-deb.sh
├── patch
│ ├── compile_wrapper_consider_clang-cl.patch
│ └── mingw-w64-x86_64.cmake
├── compress-artifacts.sh
├── deploy-monitoring.ps1
├── compile-protobuf.ps1
├── patch-vcpkg-install.ps1
├── compress-artifacts.ps1
├── common-auth.ps1
├── validate-toolset.ps1
├── deploy.ps1
├── create-k3d-cluster.ps1
└── create-release.js
├── vcpkg-configuration.json
├── release
└── release-body.md
├── OdbDesignTests
├── Fixtures
│ ├── DesignNameValueParamTest.h
│ ├── FileArchiveLoadFixture.h
│ ├── TestDataFixture.h
│ ├── FileArchiveLoadFixture.cpp
│ └── TestDataFixture.cpp
├── CMakeLists_Remote.txt
├── ArchiveTests.cpp
├── ArchiveExtractorTests.cpp
├── DesignCacheLoadTests.cpp
├── CMakeLists.txt
├── TestTests.cpp
└── FileReaderTests.cpp
├── testEnvironments.json
├── vcpkg.json
├── Those qualities are certainly beneficial.txt
├── compose.yml
├── .gitignore
└── .devcontainer
└── devcontainer.json
/.nvmrc:
--------------------------------------------------------------------------------
1 | 22.18.0
2 |
--------------------------------------------------------------------------------
/.gemini/code-config.yaml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Utils/EnumMap.cpp:
--------------------------------------------------------------------------------
1 | #include "EnumMap.h"
--------------------------------------------------------------------------------
/Utils/IJsonable.cpp:
--------------------------------------------------------------------------------
1 | #include "IJsonable.h"
--------------------------------------------------------------------------------
/test_data/FILES/test.txt:
--------------------------------------------------------------------------------
1 | Test file content
2 |
--------------------------------------------------------------------------------
/local_ai_instruction_modules/ai-local-instructions.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/OdbDesignLib/App/IOdbApp.cpp:
--------------------------------------------------------------------------------
1 | #include "IOdbServerApp.h"
--------------------------------------------------------------------------------
/OdbDesignLib/App/IOdbServerApp.cpp:
--------------------------------------------------------------------------------
1 | #include "IOdbServerApp.h"
--------------------------------------------------------------------------------
/docs/odb_spec_user.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nam20485/OdbDesign/HEAD/docs/odb_spec_user.pdf
--------------------------------------------------------------------------------
/OdbDesign.code-workspace:
--------------------------------------------------------------------------------
1 | {
2 | "folders": [
3 | {
4 | "path": "."
5 | }
6 | ],
7 | "settings": {}
8 | }
--------------------------------------------------------------------------------
/OdbDesignServer/OdbDesignServer.h:
--------------------------------------------------------------------------------
1 | // OdbDesignServer.h : Header file for your target.
2 |
3 | #pragma once
4 |
5 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | #
2 | # CODEOWNERS
3 | #
4 |
5 | # Everything in this repo is owned by @nam20485
6 | * @nam20485
--------------------------------------------------------------------------------
/.idea/OdbDesign.iml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/OdbDesignLib/FileModel/invalid_odb_error.cpp:
--------------------------------------------------------------------------------
1 | #include "invalid_odb_error.h"
2 |
3 | namespace Odb::Lib::FileModel
4 | {
5 |
6 | }
--------------------------------------------------------------------------------
/OdbDesignLib/FileModel/Design/FileArchive.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nam20485/OdbDesign/HEAD/OdbDesignLib/FileModel/Design/FileArchive.h
--------------------------------------------------------------------------------
/docs/odb++ file hierarchy (implemented).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nam20485/OdbDesign/HEAD/docs/odb++ file hierarchy (implemented).png
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/deploy/helm/values-trivy.yaml:
--------------------------------------------------------------------------------
1 | serviceMonitor:
2 | # enabled determines whether a serviceMonitor should be deployed
3 | enabled: true
4 | trivy:
5 | ignoreUnfixed: true
--------------------------------------------------------------------------------
/OdbDesignServer/templates/helloworld.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Hello {{design}}!
5 |
6 |
--------------------------------------------------------------------------------
/Utils/StringVector.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | namespace Utils
7 | {
8 | typedef std::vector StringVector;
9 | }
10 |
--------------------------------------------------------------------------------
/deploy/helm/values-prom.yaml:
--------------------------------------------------------------------------------
1 | prometheus:
2 | prometheusSpec:
3 | serviceMonitorSelectorNilUsesHelmValues: true
4 | serviceMonitorSelector: {}
5 | serviceMonitorNamespaceSelector: {}
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "sonarlint.pathToCompileCommands": "${config:cmake.buildDirectory}/compile_commands.json",
3 | "sonarlint.connectedMode.project": {
4 | "connectionId": "nam20485",
5 | "projectKey": "nam20485_OdbDesign"
6 | }
7 | }
--------------------------------------------------------------------------------
/OdbDesignApp/OdbDesignApp.h:
--------------------------------------------------------------------------------
1 | // OdbDesignApp.h : Include file for standard system include files,
2 | // or project specific include files.
3 |
4 | #pragma once
5 |
6 | //#include
7 |
8 | // TODO: Reference additional headers your program requires here.
9 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | out/
2 | .vs/
3 | .github/
4 | .git/
5 | .gitignore
6 | .gitattributes
7 | Dockerfile*
8 | docker-compose.yml
9 | *.code-workspace
10 | vcpkg_installed/
11 | ssl/
12 | out/
13 | cmake-build-*/
14 | build/
15 | .idea/
16 | Testing/
17 | *.code-workspace
18 |
--------------------------------------------------------------------------------
/scripts/odbdesign-server-request-secret.ps1:
--------------------------------------------------------------------------------
1 | kubectl create secret generic 'odbdesign-server-request-secret' --from-literal=ODBDESIGN_SERVER_REQUEST_USERNAME=$env:ODBDESIGN_SERVER_REQUEST_USERNAME --from-literal=ODBDESIGN_SERVER_REQUEST_PASSWORD=$env:ODBDESIGN_SERVER_REQUEST_PASSWORD
--------------------------------------------------------------------------------
/scripts/fetch-setup-linux-script.ps1:
--------------------------------------------------------------------------------
1 | Invoke-WebRequest -Uri "https://raw.githubusercontent.com/nam20485/OdbDesign/development/.github/setup-environment.sh" `
2 | -OutFile ".github/setup-environment.sh" `
3 | -Headers @{"Accept"="application/vnd.github.raw"}
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/OdbDesignServer/main.cpp:
--------------------------------------------------------------------------------
1 | // main.cpp : Source file for your target.
2 | //
3 |
4 | #include "OdbDesignServerApp.h"
5 |
6 | using namespace Odb::App::Server;
7 |
8 | int main(int argc, char* argv[])
9 | {
10 | OdbDesignServerApp serverApp(argc, argv);
11 | return static_cast(serverApp.Run());
12 | }
--------------------------------------------------------------------------------
/deploy/kube/k3d-volume-pvc.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: v1
3 | kind: PersistentVolumeClaim
4 | metadata:
5 | #name: task-pv-claim
6 | name: k3d-volume-claim
7 | spec:
8 | storageClassName: manual
9 | accessModes:
10 | - ReadWriteOnce
11 | resources:
12 | requests:
13 | storage: 10Gi
14 |
--------------------------------------------------------------------------------
/.github/prompts/odf_inp_adv-mem.prompt.md:
--------------------------------------------------------------------------------
1 | ---
2 | mode: agent
3 | ---
4 |
5 | /orchestrate-dynamic-workflow
6 | - $workflow_name = `initiate-new-repo`,
7 | - $context = {
8 | repo_name = "advanced_memory",
9 | app_plan_docs = [ #file:Advanced Memory .NET - Dev Plan.md , #file:index.html ]
10 | }
11 |
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/part.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | package Odb.Lib.Protobuf.ProductModel;
7 |
8 | //
9 | // Part.h
10 | //
11 |
12 | message Part {
13 |
14 | optional string name = 1;
15 |
16 | }
--------------------------------------------------------------------------------
/.github/prompts/odf_project-setup_advanced-memory.prompt.md:
--------------------------------------------------------------------------------
1 | ---
2 | mode: agent
3 | ---
4 |
5 | /orchestrate-dynamic-workflow
6 | - $workflow_name = `project-setup`,
7 | - $context = {
8 | repo_name = "advanced_memory",
9 | app_plan_docs = [ #file:Advanced Memory .NET - Dev Plan.md , #file:index.html ]
10 | }
--------------------------------------------------------------------------------
/deploy/kube/k3d-volume-pv.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: PersistentVolume
3 | metadata:
4 | name: k3d-volume
5 | #name: task-pv-volume
6 | labels:
7 | type: local
8 | spec:
9 | storageClassName: manual
10 | capacity:
11 | storage: 1Ti
12 | accessModes:
13 | - ReadWriteOnce
14 | hostPath:
15 | path: /mnt/d/k3dvolume
--------------------------------------------------------------------------------
/Utils/ExitCode.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | namespace Utils
5 | {
6 | enum class ExitCode
7 | {
8 | Success = 0,
9 | FailedInit = 1,
10 | FailedInitSsl = 2,
11 | FailedInitSslDirDoesNotExist = 3,
12 | FailedInitLoadDesign = 4,
13 | PreServerRunFailed = 5,
14 | PostServerRunFailed = 6,
15 | UnknownError = 7
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/Utils/utils_export.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(_WIN32)
3 | # if defined(Utils_EXPORTS)
4 | # define UTILS_EXPORT __declspec(dllexport)
5 | # define EXPIMP_TEMPLATE
6 | # else
7 | # define UTILS_EXPORT __declspec(dllimport)
8 | # //define EXPIMP_TEMPLATE extern
9 | # endif
10 | #else // non windows
11 | # define UTILS_EXPORT
12 | #endif
13 |
--------------------------------------------------------------------------------
/OdbDesignLib/FileModel/IStreamSaveable.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include "../odbdesign_export.h"
5 |
6 | namespace Odb::Lib::FileModel
7 | {
8 | class ODBDESIGN_EXPORT IStreamSaveable
9 | {
10 | public:
11 | virtual bool Save(std::ostream& os) = 0;
12 |
13 | protected:
14 | IStreamSaveable() = default;
15 | };
16 | }
--------------------------------------------------------------------------------
/OdbDesignLib/FileModel/ISaveable.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include "../odbdesign_export.h"
5 |
6 | namespace Odb::Lib::FileModel
7 | {
8 | class ODBDESIGN_EXPORT ISaveable
9 | {
10 | public:
11 | virtual bool Save(const std::filesystem::path& directory) = 0;
12 |
13 | protected:
14 | ISaveable() = default;
15 | };
16 | }
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/pin.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | package Odb.Lib.Protobuf.ProductModel;
7 |
8 | //
9 | // Pin.h
10 | //
11 |
12 | message Pin {
13 |
14 | optional string name = 1;
15 | optional uint32 index = 2;
16 |
17 | }
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/color.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | package Odb.Lib.Protobuf;
7 |
8 | message Color {
9 | optional float red = 1;
10 | optional float green = 2;
11 | optional float blue = 3;
12 |
13 | optional bool noPreference = 4;
14 | }
--------------------------------------------------------------------------------
/Utils/win.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #ifdef _MSC_VER
4 |
5 | #define WIN32_LEAN_AND_MEAN
6 |
7 | #include
8 |
9 | #ifndef _WIN32_WINNT_WIN7
10 | # define _WIN32_WINNT_WIN7 0x0601
11 | #endif
12 |
13 | #define _WIN32_WINNT _WIN32_WINNT_WIN7
14 | #define WINVER _WIN32_WINNT
15 |
16 | #include
17 | //#include
18 |
19 | #endif
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | remote_theme: pages-themes/minimal@v0.2.0
2 | plugins:
3 | - jekyll-remote-theme # add this line to the plugins list if you already have one
4 |
5 | title: OdbDesign ODB++ Parser
6 | description: REST API and C++ library for parsing ODB++ Design archives
7 | show_downloads: false
8 |
9 | url: https://source.odbdesignserver.com
10 | #baseurl: /jekyll-blog-demo
11 |
--------------------------------------------------------------------------------
/OdbDesignLib/OdbDesign.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // include headers for linking to library
4 |
5 | #include "FileModel/Design/FileArchive.h"
6 | #include "FileModel/parse_error.h"
7 | #include "FileModel/invalid_odb_error.h"
8 |
9 | #include "ProductModel/Design.h"
10 |
11 | #include "App/DesignCache.h"
12 | #include "App/OdbAppBase.h"
13 | #include "App/OdbServerAppBase.h"
14 |
15 |
16 |
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/via.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | import "enums.proto";
7 |
8 | package Odb.Lib.Protobuf.ProductModel;
9 |
10 | //
11 | // Via.h
12 | //
13 |
14 | message Via {
15 |
16 | optional string name = 1;
17 | optional BoardSide boardSide = 2;
18 |
19 | }
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/symbolname.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | import "enums.proto";
7 |
8 | package Odb.Lib.Protobuf;
9 |
10 | //
11 | // SymbolName.h
12 | //
13 |
14 | message SymbolName {
15 |
16 | optional string name = 1;
17 | optional UnitType unitType = 2;
18 | }
19 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: github-actions
4 | directory: /
5 | schedule:
6 | interval: weekly
7 |
8 | - package-ecosystem: pip
9 | directory: /PyOdbDesignServer
10 | schedule:
11 | interval: weekly
12 |
13 | - package-ecosystem: docker
14 | directory: /
15 | schedule:
16 | interval: weekly
17 | #target-branch: nam20485
18 |
--------------------------------------------------------------------------------
/.github/workflows/disabled/validate-plans.yml:
--------------------------------------------------------------------------------
1 | name: Disabled - goldens removed (SSOT)
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | pull_request:
7 | workflow_dispatch:
8 |
9 | jobs:
10 | noop:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: No-op
14 | run: echo "Plan validation via goldens is disabled. Dynamic workflows and assignments are the single source of truth."
15 |
--------------------------------------------------------------------------------
/OdbDesignLib/odbdesign_export.h:
--------------------------------------------------------------------------------
1 |
2 | #if defined(_WIN32)
3 | # if defined(OdbDesign_EXPORTS)
4 | # define ODBDESIGN_EXPORT __declspec(dllexport)
5 | # define EXPIMP_TEMPLATE
6 | # else
7 | # define ODBDESIGN_EXPORT __declspec(dllimport)
8 | # //define EXPIMP_TEMPLATE extern
9 | # endif
10 | #else // non windows define it to nothing (Linux exports by default)
11 | # define ODBDESIGN_EXPORT
12 | #endif
13 |
--------------------------------------------------------------------------------
/OdbDesignServer/Controllers/HelloWorldController.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "App/RouteController.h"
4 | #include "App/IOdbServerApp.h"
5 |
6 |
7 | namespace Odb::App::Server
8 | {
9 | class HelloWorldController : public Odb::Lib::App::RouteController
10 | {
11 | public:
12 | HelloWorldController(Odb::Lib::App::IOdbServerApp& serverApp);
13 |
14 | void register_routes() override;
15 |
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/Utils/equals_within.cpp:
--------------------------------------------------------------------------------
1 | #include "equals_within.h"
2 |
3 | namespace Utils
4 | {
5 | bool float_equals(float a, float b, float epsilon)
6 | {
7 | //return std::abs(a - b) < epsilon;
8 | return equals_within(a, b, epsilon);
9 | }
10 |
11 | bool double_equals(double a, double b, double epsilon)
12 | {
13 | //return std::abs(a - b) < epsilon;
14 | return equals_within(a, b, epsilon);
15 | }
16 | }
--------------------------------------------------------------------------------
/vcpkg-configuration.json:
--------------------------------------------------------------------------------
1 | {
2 | "default-registry": {
3 | "kind": "git",
4 | "baseline": "cf035d9916a0a23042b41fcae7ee0386d245af08",
5 | "repository": "https://github.com/microsoft/vcpkg"
6 | },
7 | "registries": [
8 | {
9 | "kind": "artifact",
10 | "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
11 | "name": "microsoft"
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/Utils/IJsonable.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include "utils_export.h"
5 |
6 | namespace Utils
7 | {
8 | class UTILS_EXPORT IJsonable
9 | {
10 | public:
11 | virtual ~IJsonable() {}
12 |
13 | virtual std::string to_json() const = 0;
14 | virtual void from_json(const std::string& json) = 0;
15 |
16 | protected:
17 | // abstract class/interface
18 | IJsonable() = default;
19 |
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/release/release-body.md:
--------------------------------------------------------------------------------
1 | ## Docker
2 |
3 | The signed Docker image for this release can be found here:
4 |
5 | * [nam20485/odbdesign:release-latest](https://github.com/nam20485/OdbDesign/pkgs/container/odbdesign/139993649?tag=release-latest)
6 |
7 | _If a specific tag that changes with each release is required, you can find the matching tag of the form `release-nnn`, where `nnn` is an monotonically-increasing integer, on the same page._
8 |
--------------------------------------------------------------------------------
/OdbDesignTests/Fixtures/DesignNameValueParamTest.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "gtest/gtest.h"
4 | #include
5 | #include "OdbDesign.h"
6 | #include
7 | #include
8 | #include "FileArchiveLoadFixture.h"
9 |
10 | namespace Odb::Test::Fixtures
11 | {
12 | class DesignNameValueParamTest : public FileArchiveLoadFixture,
13 | public testing::WithParamInterface
14 | {
15 |
16 | };
17 | }
--------------------------------------------------------------------------------
/Utils/equals_within.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include "utils_export.h"
5 |
6 | namespace Utils
7 | {
8 | template
9 | bool equals_within(const R a, const R b, const R epsilon = 0.001f)
10 | {
11 | return std::abs(a - b) < epsilon;
12 | }
13 |
14 | UTILS_EXPORT bool float_equals(float a, float b, float epsilon = 0.001f);
15 |
16 | UTILS_EXPORT bool double_equals(double a, double b, double epsilon = 0.001);
17 | }
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/attrlistfile.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | package Odb.Lib.Protobuf;
7 |
8 | //
9 | // StepDirectory.h
10 | //
11 |
12 | message AttrListFile {
13 |
14 | optional string directory = 1;
15 | optional string path = 2;
16 | optional string units = 3;
17 | map attributesByName = 4;
18 | }
--------------------------------------------------------------------------------
/scripts/install-dependencies-deb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | sudo apt update
5 | sudo apt install -y -qq --no-install-recommends \
6 | git \
7 | cmake \
8 | ninja-build \
9 | build-essential \
10 | docker.io \
11 | docker-compose-v2
12 |
13 | git clone https://github.com/microsoft/vcpkg $HOME/vcpkg
14 | "$HOME/vcpkg/bootstrap-vcpkg.sh"
--------------------------------------------------------------------------------
/Utils/fastmove.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include "utils_export.h"
5 | #include
6 |
7 | namespace Utils
8 | {
9 | UTILS_EXPORT void move_file(const std::filesystem::path& source, const std::filesystem::path& dest, bool overwriteExisting, std::error_code& ec);
10 | UTILS_EXPORT void fastmove_file(const std::filesystem::path& source, const std::filesystem::path& dest, bool overwriteExisting, std::error_code& ec);
11 | }
12 |
--------------------------------------------------------------------------------
/testEnvironments.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1",
3 | "environments": [
4 | // See https://aka.ms/remotetesting for more details
5 | // about how to configure remote environments.
6 | {
7 | "name": "WSL Ubuntu",
8 | "type": "wsl",
9 | "wslDistribution": "Ubuntu"
10 | },
11 | {
12 | "name": "Docker dotnet/sdk",
13 | "type": "docker",
14 | "dockerImage": "mcr.microsoft.com/dotnet/sdk"
15 | }
16 | ]
17 | }
--------------------------------------------------------------------------------
/.vscode/mcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "inputs": [],
3 | "servers": {
4 | "sequential-thinking": {
5 | "type": "stdio",
6 | "command": "npx",
7 | "args": [
8 | "-y",
9 | "@modelcontextprotocol/server-sequential-thinking"
10 | ],
11 | "version": "0.0.1"
12 | },
13 | "memory": {
14 | "type": "stdio",
15 | "command": "npx",
16 | "args": [
17 | "-y",
18 | "@modelcontextprotocol/server-memory"
19 | ],
20 | "version": "0.0.1"
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/OdbDesignLib/Constants.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | //
4 | // Created by nmill on 10/13/2023.
5 | //
6 |
7 | namespace Odb::Lib::FileModel::Design
8 | {
9 | class Constants
10 | {
11 | public:
12 | inline static const auto COMMENT_TOKEN = "#";
13 | inline static const auto UNITS_TOKEN = "UNITS";
14 | inline static const auto ARRAY_RECORD_OPEN_TOKEN = "{";
15 | inline static const auto ARRAY_RECORD_CLOSE_TOKEN = "}";
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/OdbDesignLib/FileModel/invalid_odb_error.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 |
6 | namespace Odb::Lib::FileModel
7 | {
8 | class invalid_odb_error : public std::runtime_error
9 | {
10 | public:
11 | invalid_odb_error(const char* message)
12 | : runtime_error(message)
13 | {
14 | }
15 |
16 | invalid_odb_error(const std::string& message)
17 | : invalid_odb_error(message.c_str())
18 | {
19 | }
20 | };
21 | }
--------------------------------------------------------------------------------
/OdbDesignLib/enums.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Odb::Lib
4 | {
5 | enum class BoardSide
6 | {
7 | BsNone,
8 | Top,
9 | Bottom
10 | };
11 |
12 | enum class LineShape
13 | {
14 | Square,
15 | Round
16 | };
17 |
18 | enum class Polarity
19 | {
20 | Positive,
21 | Negative
22 | };
23 |
24 | enum class UnitType
25 | {
26 | None,
27 | Metric,
28 | Imperial
29 | };
30 |
31 | enum class DesignType
32 | {
33 | FileArchive,
34 | Design
35 | };
36 | }
37 |
--------------------------------------------------------------------------------
/Utils/CrossPlatform.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | //#include
4 | #include "utils_export.h"
5 | #include
6 | #include
7 | #include
8 |
9 | namespace Utils
10 | {
11 | class UTILS_EXPORT CrossPlatform
12 | {
13 | public:
14 | static bool localtime_safe(const std::time_t* time, struct std::tm& tmOut);
15 | static bool getenv_safe(const char* env_var, std::string& envValueOut);
16 | static bool tmpnam_safe(std::string& tempNameOut);
17 |
18 | };
19 | }
20 |
--------------------------------------------------------------------------------
/Utils/libarchive_extract.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "utils_export.h"
4 | #include
5 |
6 | namespace Utils
7 | {
8 | enum class CompressionType
9 | {
10 | TarGzip
11 | };
12 |
13 | bool extract(const char* filename, const char* destDir);
14 | UTILS_EXPORT bool compress_dir(const char* srcDir,
15 | const char* destDir,
16 | const char* archiveName,
17 | std::string& fileOut,
18 | CompressionType type = CompressionType::TarGzip);
19 | }
20 |
--------------------------------------------------------------------------------
/Utils/timestamp.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by nam20485 on 6/12/22.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 | #include "utils_export.h"
10 |
11 | namespace Utils
12 | {
13 | std::string UTILS_EXPORT make_timestamp(const std::chrono::system_clock::time_point& timepoint);
14 | std::string UTILS_EXPORT make_timestamp();
15 |
16 | std::chrono::system_clock::time_point UTILS_EXPORT parse_timestamp(const std::string& timestamp, const std::string& format);
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/Utils/crow_win.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // disable error-checking in crow's json code to improve its performance
4 | // https://crowcpp.org/master/guides/json/
5 | //#define CROW_JSON_NO_ERROR_CHECK
6 |
7 | #include "win.h"
8 | #include "crow.h"
9 | #include "crow/middlewares/cors.h"
10 | #include "crow/app.h"
11 | #include "crow/http_request.h"
12 | #include "crow/http_response.h"
13 | #include
14 | #include
15 |
16 |
17 | using CrowApp = crow::Crow;
--------------------------------------------------------------------------------
/Utils/UrlEncoding.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include "utils_export.h"
5 |
6 | namespace Utils
7 | {
8 | // inspired by: https://github.com/davisking/dlib/blob/f7d99ae0dc97c00c1690863881709b7a8b89bb40/dlib/server/server_http.cpp
9 |
10 | class UTILS_EXPORT UrlEncoding
11 | {
12 | public:
13 | static std::string encode(const std::string& unencoded);
14 | static std::string decode(const std::string& encoded);
15 |
16 | // static-only class
17 | UrlEncoding() = delete;
18 |
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/symbolsdirectory.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | package Odb.Lib.Protobuf;
7 |
8 | import "attrlistfile.proto";
9 | import "featuresfile.proto";
10 |
11 | //
12 | // LayerDirectory.h
13 | //
14 |
15 | message SymbolsDirectory {
16 |
17 | optional string name = 1;
18 | optional string path = 2;
19 |
20 | optional AttrListFile attrlistFile = 3;
21 | optional FeaturesFile featureFile = 4;
22 | }
--------------------------------------------------------------------------------
/docs/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | The project is happy to accept pull requests if you would like to contribute. Please open an issue to discuss your proposed changes before submitting a pull request. Pull requests are accepted against the `development` branch. Please make sure your pull request is up to date with the latest changes in the `development` branch before submitting it.
4 |
5 | All contributed code must be covered by accompanying test cases. Please make sure your changes are covered by test cases before submitting a pull request.
6 |
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/enums.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | package Odb.Lib.Protobuf;
7 |
8 | enum BoardSide
9 | {
10 | BsNone = 0;
11 | Top = 1;
12 | Bottom = 2;
13 | };
14 |
15 | enum LineShape
16 | {
17 | Square = 0;
18 | Round = 1;
19 | };
20 |
21 | enum Polarity
22 | {
23 | Positive = 0;
24 | Negative = 1;
25 | };
26 |
27 | enum UnitType
28 | {
29 | None = 0;
30 | Metric = 1;
31 | Imperial = 2;
32 | };
--------------------------------------------------------------------------------
/scripts/patch/compile_wrapper_consider_clang-cl.patch:
--------------------------------------------------------------------------------
1 | diff --git a/usr/share/automake-1.16/compile b/usr/share/automake-1.16/compile
2 | index 2078fc833..dfc946593 100755
3 | --- a/usr/share/automake-1.16/compile
4 | +++ b/usr/share/automake-1.16/compile
5 | @@ -256,6 +256,7 @@ EOF
6 | exit $?
7 | ;;
8 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
9 | + clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
10 | icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
11 | func_cl_wrapper "$@" # Doesn't return...
12 | ;;
13 |
--------------------------------------------------------------------------------
/OdbDesignLib/App/IOdbApp.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "OdbDesignArgs.h"
4 | #include "DesignCache.h"
5 | #include "ExitCode.h"
6 | #include "../odbdesign_export.h"
7 |
8 | namespace Odb::Lib::App
9 | {
10 | class ODBDESIGN_EXPORT IOdbApp
11 | {
12 | public:
13 | virtual ~IOdbApp() {}
14 |
15 | virtual const OdbDesignArgs& args() const = 0;
16 | virtual DesignCache& designs() = 0;
17 |
18 | virtual Utils::ExitCode Run() = 0;
19 |
20 | protected:
21 | // abstract class/interface
22 | IOdbApp() = default;
23 |
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/OdbDesignLib/App/RequestAuthenticationBase.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "../odbdesign_export.h"
4 | #include "crow_win.h"
5 |
6 | namespace Odb::Lib::App
7 | {
8 | class ODBDESIGN_EXPORT RequestAuthenticationBase
9 | {
10 | public:
11 | virtual crow::response AuthenticateRequest(const crow::request& req);
12 |
13 | protected:
14 | RequestAuthenticationBase(bool disableAuthentication);
15 |
16 | // pure virtual interface
17 | RequestAuthenticationBase() = default;
18 |
19 | bool m_disableAuthentication = false;
20 |
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/.github/problem-matchers/eslint-stylish.json:
--------------------------------------------------------------------------------
1 | {
2 | "problemMatcher": [
3 | {
4 | "owner": "eslint-stylish",
5 | "pattern": [
6 | {
7 | "regexp": "^([^\\s].*)$",
8 | "file": 1
9 | },
10 | {
11 | "regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$",
12 | "line": 1,
13 | "column": 2,
14 | "severity": 3,
15 | "message": 4,
16 | "code": 5,
17 | "loop": true
18 | }
19 | ]
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/net.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | import "pinconnection.proto";
7 |
8 | package Odb.Lib.Protobuf.ProductModel;
9 |
10 | //
11 | // Net.h
12 | //
13 |
14 | message Net {
15 |
16 | // std::string m_name;
17 | // PinConnection::Vector m_pinConnections;
18 | // unsigned int m_index;
19 |
20 | optional string name = 1;
21 | repeated PinConnection pinConnections = 2;
22 | optional uint32 index = 3;
23 |
24 | }
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/package.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | import "pin.proto";
7 |
8 | package Odb.Lib.Protobuf.ProductModel;
9 |
10 | //
11 | // Package.h
12 | //
13 |
14 | message Package {
15 |
16 | // std::string m_name;
17 | // Pin::Vector m_pins;
18 | // Pin::StringMap m_pinsByName;
19 | // unsigned int m_index;
20 |
21 | optional string name = 1;
22 | repeated Pin pins = 2;
23 | map pinsByName = 3;
24 | optional uint32 index = 4;
25 | }
--------------------------------------------------------------------------------
/deploy/kube/issuer.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: cert-manager.io/v1
2 | kind: Issuer
3 | metadata:
4 | name: letsencrypt-staging
5 | spec:
6 | acme:
7 | # The ACME server URL
8 | server: https://acme-staging-v02.api.letsencrypt.org/directory
9 | # Email address used for ACME registration
10 | email: nmiller217@gmail.com
11 | # Name of a secret used to store the ACME account private key
12 | privateKeySecretRef:
13 | name: letsencrypt-staging-tls
14 | # Enable the HTTP-01 challenge provider
15 | solvers:
16 | - http01:
17 | ingress:
18 | ingressClassName: traefik
--------------------------------------------------------------------------------
/OdbDesignLib/protoc/pinconnection.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | //// https://protobuf.dev/reference/cpp/cpp-generated/#message
4 | //option optimize_for = CODE_SIZE;
5 |
6 | import "component.proto";
7 | import "pin.proto";
8 |
9 | package Odb.Lib.Protobuf.ProductModel;
10 |
11 | //
12 | // PinConnection.h
13 | //
14 |
15 | message PinConnection {
16 |
17 | // std::string m_name;
18 | // std::shared_ptr m_pComponent;
19 | // std::shared_ptr m_pPin;
20 |
21 | optional string name = 1;
22 | optional Component component = 2;
23 | optional Pin pin = 3;
24 |
25 | }
--------------------------------------------------------------------------------
/OdbDesignApp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # CMakeList.txt : CMake project for OdbDesignApp, include source and define
2 | # project specific logic here.
3 | #
4 |
5 | # Add source to this project's executable.
6 | add_executable (OdbDesignApp "OdbDesignApp.cpp" "OdbDesignApp.h" )
7 |
8 | ## PCH
9 | #if (NOT DEFINED ENV{CI})
10 | file (GLOB_RECURSE ODBDESIGN_APP_HEADER_FILES "*.h")
11 | target_precompile_headers(OdbDesignApp PRIVATE ${ODBDESIGN_APP_HEADER_FILES})
12 | #endif()
13 |
14 | # link to OdbDesign library
15 | target_link_libraries(OdbDesignApp PRIVATE OdbDesign)
16 |
17 | # TODO: Add tests and install targets if needed.
18 |
--------------------------------------------------------------------------------
/OdbDesignServer/OdbDesignServerApp.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "OdbDesignServer.h"
4 | #include "App/OdbServerAppBase.h"
5 |
6 |
7 | namespace Odb::App::Server
8 | {
9 | class OdbDesignServerApp : public Odb::Lib::App::OdbServerAppBase
10 | {
11 | public:
12 | OdbDesignServerApp(int argc, char* argv[]);
13 | //~OdbDesignServerApp();
14 |
15 | //Utils::ExitCode Run() override;
16 |
17 | protected:
18 | void add_controllers() override;
19 |
20 |
21 | // Inherited via OdbServerAppBase
22 | bool preServerRun() override;
23 | //bool postServerRun() override;
24 |
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/OdbDesignLib/App/IOdbServerApp.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "IOdbApp.h"
4 | #include "../odbdesign_export.h"
5 | #include "RequestAuthenticationBase.h"
6 | #include
7 |
8 | namespace Odb::Lib::App
9 | {
10 | class ODBDESIGN_EXPORT IOdbServerApp : public virtual IOdbApp
11 | {
12 | public:
13 | virtual ~IOdbServerApp() {}
14 |
15 | virtual CrowApp& crow_app() = 0;
16 | virtual RequestAuthenticationBase& request_auth() = 0;
17 | virtual void request_auth(std::unique_ptr requestAuthentication) = 0;
18 |
19 | protected:
20 | IOdbServerApp() = default;
21 |
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/OdbDesignLib/FileModel/Design/AttributeLookupTable.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include