Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
7fd6bcb
still need to finish up the waterheater systems using a target temps …
Tylores Dec 21, 2022
b9dd3d1
System stubs done for water heater simulator
Tylores Dec 21, 2022
6671e4d
nearly done with the updated demo. Need to add the metering resource …
Tylores Dec 22, 2022
62b6218
Updated the remaining resources we will be using for the trust demo. …
Tylores Jan 24, 2023
26c528c
testing the waters with mermaid.js
Tylores Feb 4, 2023
e812de2
Update README.md
Tylores Feb 4, 2023
8749eb2
Update README.md
Tylores Feb 4, 2023
b277d8c
Update README.md
Tylores Feb 4, 2023
a4cec20
Update README.md
Tylores Feb 4, 2023
1ccee7d
Update README.md
Tylores Feb 4, 2023
f51e393
Update README.md
Tylores Feb 4, 2023
d383ae5
still testing out some of the new figures.
Tylores Feb 9, 2023
07fb242
Merge branch 'diagrams' of https://github.com/PortlandStatePowerLab/d…
Tylores Feb 9, 2023
3e6ea95
restructure and clean up of DCM along with sep modifications
Tylores Apr 26, 2023
5908f76
continued renaming sep objects for ecs and better std alignment
Tylores Apr 26, 2023
c4f5651
complete update of sep objects and typing
Tylores Apr 27, 2023
4d00a03
updates to xml adapters for modified sep objects
Tylores Apr 28, 2023
1f23f58
towards fixing xml adapters and tests with new sep objects
Tylores Apr 28, 2023
88a4b72
xml adapters and tests are working as expected and the ecs systems ar…
Tylores Apr 29, 2023
20129cb
clients and server now use the updated sep objects and demo is workin…
Tylores Apr 29, 2023
6966b8d
reorganization of https server code as there cannot be a generic serv…
Tylores May 1, 2023
c4db67a
update ecs modules, will be reconfiguring the access module to use th…
Tylores May 2, 2023
e1f8ae8
working towards the updated http methods with the gsp
Tylores May 3, 2023
27d5f88
still working towards the updates for the gsp server using new sep ob…
Tylores May 5, 2023
d6ddc40
updated cmake instructions for a debug/release build and fixed all bu…
Tylores May 6, 2023
1e5fda5
switching back from tablet
Tylores May 7, 2023
8ac40df
There is something weird going on with cmake and I think it has to do…
Tylores May 8, 2023
7493015
Updated cmakefiles to use more modern syntax. Cleaned up file structu…
Tylores May 9, 2023
4da331d
Still cleaning things up and moving things around. The dtm no shall j…
Tylores May 9, 2023
0fa1d68
cmake updates are done and everything is building and linking correctly.
Tylores May 10, 2023
798511e
The server/client interactions don't appear to be working correclty. …
Tylores May 12, 2023
e08b023
optionals are what we were missing. I need to update the adapters to …
Tylores May 13, 2023
7988f2d
alright rather than rewriting the entire sep models and adapters I am…
Tylores May 15, 2023
17853c8
ok after some tinkering I think boost optional will be required. We n…
Tylores May 20, 2023
bff7515
working towards updating all models with boost optional.
Tylores May 23, 2023
9b8d62c
boost optional is taking a while, but there are just a large number i…
Tylores May 23, 2023
2d0ce5c
the tests have been updated to use boost optional and are nearly fini…
Tylores May 23, 2023
59887d8
ok now all the adapters and tests have been updated. I missed a few b…
Tylores May 24, 2023
ea46cb7
alright boost optional adapter is working correctly. It isn't perfect…
Tylores May 26, 2023
5a18ab4
The end device DeviceCategoryType is causing issues now for some reas…
Tylores May 28, 2023
bbc7e07
the hex values need to be read/written as a string. I had assumed I w…
Tylores May 28, 2023
206a199
For some reason now the changedTime element is causing the xml valida…
Tylores May 28, 2023
05235d1
alright I think there is something weird happening since dcap is work…
Tylores May 29, 2023
a55defc
Online validators are also saying the adapter is invalid so there is …
Tylores May 29, 2023
ca2dfa9
apparently the sequence declaration in xml schema means it has to app…
Tylores May 29, 2023
edc82ee
finally wrapped up the optional additions and tests are working again
Tylores May 29, 2023
cc6578a
addition of optional tests for primary components with a large set of…
Tylores May 30, 2023
a9f8d55
starting the cleanup of the client and server using optionals. Next m…
Tylores May 31, 2023
bffe59a
alright I was using the lookup method wrong which was causing all kin…
Tylores Jun 1, 2023
0c3f2c3
alright there are alot of moving parts involved when changing the uri…
Tylores Jun 4, 2023
5dc79b6
adding routes to resources isn't the most intuitive as some are world…
Tylores Jun 5, 2023
82723d1
still a few world methods that need to be modified for the response r…
Tylores Jun 9, 2023
c0dd738
responses are now working correctly. The last thing is creating a pow…
Tylores Jun 10, 2023
873d279
power status up and running. Now I just need to finalize the gsp and …
Tylores Jun 11, 2023
ff42a8c
starting pulling over the systems for the dcm.
Tylores Jun 12, 2023
96f808d
alright apparently cascading module imports doesn't work as expected,…
Tylores Jun 14, 2023
f07a653
I found that you can create an observer with multiple components. How…
Tylores Jun 15, 2023
ea7850d
updated the ssl gen script to capture registration info for dcm and gsp
Tylores Jun 20, 2023
4a500f8
currently I am going to keep the waterdraw profiles for now
Tylores Jun 24, 2023
b6dae08
ecs singleton clock working correctly now
Tylores Jun 24, 2023
533368b
the systems that us singletons don't seem to be getting called correc…
Tylores Jun 24, 2023
56f2008
There was a weird clock sync issue between the client and server. I e…
Tylores Jun 27, 2023
ca4432c
added a script for running the egot system and updated readme.
Tylores Jun 28, 2023
344c440
For ease of instllation I moved the setup.sh file to the main folder …
sonalinf Jun 28, 2023
576d6b1
Merge branch 'diagrams' of https://github.com/PortlandStatePowerLab/d…
sonalinf Jun 28, 2023
328ec3b
Moved the setup.sh to tools folder for organization purposes.
sonalinf Jun 28, 2023
6ce0135
temp shifting work for my laptop
Tylores Jul 25, 2023
8c96c32
still working on the waterheater systems
Tylores Jul 28, 2023
576e508
schedule updated is finally working correctly. Next waterheater event…
Tylores Jul 28, 2023
90d268e
The waterheater systems are nearly there. The state isn't working and…
Tylores Jul 29, 2023
4fe3521
I was begin stupid and didn't give each of the water heater systems a…
Tylores Jul 30, 2023
87a940b
linking the sep model to the water heater. Next link the response to …
Tylores Aug 1, 2023
838a3ca
alright now the energy calculation looks better. Need to double check…
Tylores Aug 1, 2023
ba54ae8
water heater sim is in a good place. Revamping the flow reservation s…
Tylores Aug 3, 2023
e69d2c1
Update setup.sh
Tylores Aug 3, 2023
49eb77d
adding a barebones ecs to test the raspberry pi
Tylores Aug 4, 2023
469a60d
Update setup.sh
Tylores Aug 5, 2023
6ff3d1b
update to flecs master for now until a new version is release with th…
Tylores Aug 7, 2023
12e615a
time sync format for gsp
Tylores Aug 22, 2023
2cd18c5
simple update to allow flecs explorer app to visualize server
Tylores Aug 29, 2023
555ad8a
updated registration ssl to capture areas
Tylores Sep 3, 2023
fe2eb16
updated ME resource files and gsp registration process
Tylores Sep 5, 2023
5dffdfa
removing flecs explorer for now as its warnings are annoying
Tylores Sep 17, 2023
702dd4b
simple example of the service resource distribution between parent an…
Tylores Nov 26, 2023
6cff8c4
added doxygen build instruction for documentation and final testing o…
Tylores Dec 7, 2023
6aeff57
updating comments for doxygen, mostly lib/sep
Tylores Dec 9, 2023
a682897
cleaning doxygen generated folders that shouldn't exist
Tylores Dec 9, 2023
ca65b83
updated code documentation which caused me to change some code orderi…
Tylores Dec 17, 2023
ad051f6
there was some funky behavior with the ECS Module constructors and pr…
Tylores Dec 17, 2023
353eb83
updated cta2045 interface for ucm/device and added dcm-aosmith in apps
Tylores Dec 20, 2023
bd5c43b
updated trust library for cta2045 device client
Tylores Dec 20, 2023
4788405
updated dcm-aosmith to use the trust cta2045 device
Tylores Dec 21, 2023
c4d4981
updated the dcm-aosmith to use the simple ecs with a commodity system
Tylores Dec 21, 2023
33164be
trust::cta2045 client was posting to the wront dtm path for messages
Tylores Dec 21, 2023
3e4eac6
refactored the trust ucm to use commodity enums and added observers f…
Tylores Dec 21, 2023
ed1b5ca
cannot init an enum class with an int
Tylores Dec 21, 2023
88d8cb6
figuring out why the commodity read sucks
Tylores Dec 21, 2023
e85bf30
potential fix to prevent flecs and cea2045 libs from being downloaded…
Tylores Dec 21, 2023
cc4c40a
ignore stream truncated error in https client
Tylores Dec 22, 2023
a7b7d66
fixing cta2045 commodity read method pointer issue
Tylores Dec 22, 2023
240d924
hopefully fixed the fetch content download issue every build
Tylores Dec 22, 2023
acce2db
fixed cta2045 observers to actually trigger on set
Tylores Dec 22, 2023
587e99a
fixing the serial port path for the aosmith
Tylores Dec 22, 2023
7969e4c
addition of a cta2045 comms test for the aosmith dcm
Tylores Dec 22, 2023
5d4feaa
the commdity read and xml weird symbol are fixed. added opcode and co…
MidrarAdham Dec 23, 2023
527b91f
updating sep xml adapters and tests for registration process
Tylores Dec 28, 2023
d3e9aff
nearly done with the der settings update
Tylores Dec 29, 2023
7b3efda
still getting weird multiplier read issues for some reason.
Tylores Dec 29, 2023
cc053bd
the updated der adapters are complete and tests are mostly running as…
Tylores Dec 29, 2023
40893da
updated ecs client/server for der resources
Tylores Dec 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
*.out
*.app

# Diagrams
*.svg

# Directories
.vscode/
.cache/
.cmake/
build/
debug/
release/
docs/html/
docs/latex/
100 changes: 0 additions & 100 deletions 100.txt

This file was deleted.

72 changes: 33 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,59 +1,53 @@
# You should always specify a range with the newest
# and oldest tested versions of CMake.
cmake_minimum_required(VERSION 3.14)

# set version
set(PROJECT_VERSION 2.0.0)
set(PROJECT_NAME EGOT_ESI)
# You should always specify a range with the newest and oldest tested versions
# of CMake.
cmake_minimum_required(VERSION 3.18)

# This is your project statement. You should always list languages;
project(
${PROJECT_NAME}
VERSION ${PROJECT_VERSION}
)
EGoT
VERSION 0.1.0
LANGUAGES CXX)

# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# fetch remote packages for development
find_package(Boost REQUIRED filesystem python3)
find_package(PythonLibs 3 REQUIRED)
find_package(Boost REQUIRED python filesystem)

find_package(Python3 COMPONENTS Interpreter Development)

include(FindThreads)

include(FindXercesC)

include(FindGTest)

include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0
)

set(FETCHCONTENT_UPDATES_DISCONNECTED
ON
CACHE BOOL "Do not update everytime I run cmake, please")

FetchContent_Declare(
flecs
GIT_REPOSITORY https://github.com/SanderMertens/flecs.git
GIT_TAG v3.0.3
)
GIT_REPOSITORY git@github.com:SanderMertens/flecs.git
GIT_TAG master)

FetchContent_MakeAvailable(googletest flecs)
FetchContent_Declare(
cea2045
GIT_REPOSITORY https://github.com/epri-dev/CTA-2045-UCM-CPP-Library.git
GIT_TAG v1.0)

add_subdirectory(utilities)
add_subdirectory(standards)
add_subdirectory(ecs)
add_subdirectory(interfaces)
add_subdirectory(dtm)
#add_subdirectory(gsp)
#add_subdirectory(dcm)
FetchContent_MakeAvailable(flecs cea2045)

add_subdirectory(libs)
add_subdirectory(apps)

# install resources for programs
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/resources/
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
)
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/resources/ ${CMAKE_BINARY_DIR}/bin/)

execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/ssl/root-ca/
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-ca
)
COMMAND
${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/ssl/root-ca/
${CMAKE_BINARY_DIR}/bin/root-ca/)
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,56 @@
Department of Energy - Energy Grid of Things System

## Development
- https://tmuxcheatsheet.com/

### Linux OS

```
cd doe-egot-system
./setup.sh
./tools/setup.sh
```

## Building
For development the build type should be set to *Debug*, but all performance testing should use *Release*. There may be issues when trying to compile multiple build types so the build folder should have a different name.
```shell
cd doe-egot-system
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1
cmake --build build
```

### Documentation
If you would like to build the documentation install the following requirments and run doxygen.
```shell
sudo apt install doxygen graphviz
cd docs
doxygen
```

If you would like a PDF of the documentation run install the following requirments and run make within the latex folder.
```shell
sudo apt install texlive-base texlive-latex-recommended texlive-latex-extra
cd docs
doxygen
cd latex
make
```

## Running
Running the system as a whole is done through the *run_egot.sh* script found in tools. It will spawn tree tmux sessions: GSP, DTMC, and DERS. The DERS session will have *n* number of DCMS running in individual windows within the session. See snapshot of terminal after running.


```shell
cd doe-egot-system
cmake -S . -B build
cmake --build build
./tools/run_egot.sh <n>
tmux ls
tmux a -t <session>
```

## Stop
Stopping the EGoT system only requires stopping all tmux sessions.

```shell
tmux kill-server
```

## Project Organization
Expand Down
11 changes: 11 additions & 0 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
add_subdirectory(dtm)
add_subdirectory(dcm)
add_subdirectory(dcm-aosmith)
add_subdirectory(gsp)
add_subdirectory(simple)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/dtm/
${CMAKE_BINARY_DIR}/bin/)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/me/
${CMAKE_BINARY_DIR}/bin/)
7 changes: 7 additions & 0 deletions apps/dcm-aosmith/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_executable(dcm_aosmith src/main.cpp)
target_link_libraries(dcm_aosmith trust::cta2045 ecs::cta2045 sep::models
EGoT::utils Threads::Threads)

add_executable(dcm_aosmith_test src/test.cpp)
target_link_libraries(dcm_aosmith_test trust::cta2045 ecs::cta2045 EGoT::utils
Threads::Threads)
File renamed without changes.
27 changes: 27 additions & 0 deletions apps/dcm-aosmith/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <ecs/client/cta2045/commodity.hpp>
#include <https/client/client.hpp>
#include <iostream>
#include <sep/models/active_power.hpp>
#include <sep/models/real_energy.hpp>
#include <string>
#include <trust/cta2045/trust_device.hpp>
#include <utilities/utilities.hpp>

std::string g_program_path;
// create config xml with these values and store somewhere
float frr_time_window;
float comfort_threshold;

int main(int argc, char **argv) {
std::cout << "Starting DCM for AOSmith water heater\n";
g_program_path = psu::utilities::getProgramPath(argv);

flecs::world ecs;
ecs.import <ecs::client::commodity::Module>();
ecs.entity().set<sep::ActivePower>({0, 0});
ecs.entity().set<sep::RealEnergy>({0, 0});
https::Context dtm_ctx = {"1", g_program_path, "0.0.0.0", "8090"};
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx);
ecs.app().target_fps(1).run();
return 0;
}
46 changes: 46 additions & 0 deletions apps/dcm-aosmith/src/test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

#include <chrono>
#include <https/client/client.hpp>
#include <iostream>
#include <string>
#include <thread>
#include <trust/cta2045/trust_device.hpp>
#include <utilities/utilities.hpp>

std::string g_program_path;

int main(int argc, char **argv) {
std::cout << "Starting DCM for AOSmith water heater\n";
g_program_path = psu::utilities::getProgramPath(argv);

https::Context dtm_ctx = {"1", g_program_path, "0.0.0.0", "8090"};
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx);
std::this_thread::sleep_for(std::chrono::seconds(1));
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getOutsideCommunicationStatus(cea2045::OutsideCommuncatonStatusCode::Found);
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getOperationalState();
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getDeviceInfo();
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getCommodity();
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).loadUp(0);
std::this_thread::sleep_for(std::chrono::seconds(10));
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getOperationalState();
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getCommodity();
std::this_thread::sleep_for(std::chrono::seconds(10));
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).endShed(0);
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).criticalPeakEvent(60);
std::this_thread::sleep_for(std::chrono::seconds(10));
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getOperationalState();
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).endShed(0);
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).gridEmergency(60);
std::this_thread::sleep_for(std::chrono::seconds(10));
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getOperationalState();
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).endShed(0);
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).shed(60);
std::this_thread::sleep_for(std::chrono::seconds(10));
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getOperationalState();
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).loadUp(0);
std::this_thread::sleep_for(std::chrono::seconds(10));
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getOperationalState();
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).getCommodity();
trust::cta2045Device::getInstance("/dev/ttyAMA0", dtm_ctx).shed(0);
return 0;
}
14 changes: 14 additions & 0 deletions apps/dcm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_executable(dcm
src/main.cpp
)

# target_include_directories(dcm PUBLIC include)

target_link_libraries(dcm
ecs::client::sep
ecs::simulator
https::client
trust::client
EGoT::utils
Threads::Threads
)
File renamed without changes.
Loading