Skip to content

GESS EMS + BESS Simulator VS Code Workspace

This note explains how to open the EMS and BESS Simulator Git repositories together in VS Code so GitHub Copilot can see both codebases while keeping them as separate Git repositories.

Folder Structure

The local folders are:

/home/anura/
├── ES100CX12S/
├── bess_simulator/
│   └── EnergySyc_EMS_ES100Cx12S_BESS_simulator/
└── gess-ems-dev.code-workspace

The two projects remain independent Git repositories and can still be deployed in separate Docker containers.


1. Create the VS Code Workspace File

Create the workspace file in the home directory:

nano ~/gess-ems-dev.code-workspace

Add:

{
  "folders": [
    {
      "name": "EMS",
      "path": "/home/anura/ES100CX12S"
    },
    {
      "name": "BESS Simulator",
      "path": "/home/anura/bess_simulator/EnergySyc_EMS_ES100Cx12S_BESS_simulator"
    }
  ],
  "settings": {
    "git.autoRepositoryDetection": "subFolders",
    "search.useIgnoreFiles": true,
    "search.useGlobalIgnoreFiles": true
  }
}

Save in nano:

Ctrl+O
Enter
Ctrl+X

2. Start the Development Workspace

Whenever developing or troubleshooting EMS, run:

code ~/gess-ems-dev.code-workspace

VS Code will open both projects in the same window:

EMS
├── EnergySyc_EMS_ES100Cx12S
├── EMS_template_codes
├── docs
├── pcsData
└── ...

BESS Simulator
├── ...
└── simulator code

GitHub Copilot can then use both projects as workspace context.


3. Git Repositories Stay Separate

Opening both folders in one VS Code workspace does not combine the Git repositories.

Check the EMS repository:

cd ~/ES100CX12S
git status
git rev-parse --show-toplevel

Check the BESS Simulator repository:

cd ~/bess_simulator/EnergySyc_EMS_ES100Cx12S_BESS_simulator
git status
git rev-parse --show-toplevel

Commits, branches, pushes, and pulls remain independent.


4. Docker Deployment Stays Separate

The development workspace does not change the production/container architecture.

VS Code + Copilot
       |
       +----------------------+
       |                      |
   EMS Git Repo        BESS Simulator Git Repo
       |                      |
       v                      v
ems-backend             bess-simulator-backend
container                   container
       |                      |
       +------ Modbus TCP ----+

The EMS and BESS simulator can therefore continue to be built, installed, started, stopped, and updated independently.


5. Example Copilot Troubleshooting

Because both repositories are open in the workspace, Copilot can be asked questions such as:

Check the EMS PCS Modbus client against the EPCS105 implementation
in the BESS Simulator and find why the power command is not working.

Or:

Compare the PCS registers used by EMS with the simulator registers
and identify any address, datatype, scaling, unit ID, or sign mismatch.

Quick Start

Normally, this is the only command needed:

code ~/gess-ems-dev.code-workspace

Do not create a symlink between the repositories unless there is a specific reason. A VS Code multi-root workspace is cleaner because Copilot can see both projects while Git and Docker remain independent.