Skip to content

Commit

Permalink
Merge branch 'trunk' of s4:git-repo/energyd into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Aug 17, 2023
2 parents 49e763a + aa49ead commit 31e3820
Show file tree
Hide file tree
Showing 4 changed files with 360 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build/
src/revision.hpp
src/mrsrc.hpp
.vscode/
energyd.conf
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
cmake_minimum_required(VERSION 3.16)

# set the project name
project(energyd VERSION 2.0.0 LANGUAGES CXX)
project(energyd VERSION 2.0.1 LANGUAGES CXX)

include(FindPkgConfig)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

set(CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
Expand All @@ -34,12 +34,10 @@ mrc_write_header(${PROJECT_SOURCE_DIR}/src/mrsrc.hpp)
# Libraries
find_package(zeep 6 REQUIRED)
find_package(libmcfp REQUIRED)

set(ENV{PKG_CONFIG_PATH} "$ENV{HOME}/.local/lib/pkgconfig/")
pkg_check_modules(PKG_PQ libpqxx>=7.2 libpq IMPORTED_TARGET REQUIRED)
find_package(libpqxx 7.8 REQUIRED)

add_executable(energyd ${PROJECT_SOURCE_DIR}/src/energyd.cpp)
target_link_libraries(energyd PkgConfig::PKG_PQ libmcfp::libmcfp zeep::zeep)
target_link_libraries(energyd libpqxx::pqxx libmcfp::libmcfp zeep::zeep)

# yarn rules for javascripts

Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Installation

To build and install energyd, you first need to install various other packages. Of course first of all you need [libzeep](https://github.com/mhekkel/libzeep). If you successfully installed libzeep, most of the requirements are already met, the remaining requirements are

* Postgresql
* The development version of [libpqxx](https://pqxx.org/development/libpqxx/)
* The javascript package manager [yarn](https://yarnpkg.com/)
* Postgresql
* The development version of [libpqxx](https://pqxx.org/development/libpqxx/)
* The javascript package manager [yarn](https://yarnpkg.com/)

Building the software should start with running `yarn` without arguments in the source directory followed by `configure` and `make`.

To summarize:

```
```bash
git clone https://github.com/mhekkel/energyd.git
cd energyd
yarn
Expand All @@ -29,17 +29,19 @@ This should give you an executable called energyd. The next thing to do is creat
The following commands are executed as a user that has admin rights on your postgres installation. First create a new user for this database,
this command will ask for a password.

```
```bash
createuser -P energie-admin
```

Then create the database with the newly created user as owner:

```
```bash
createdb -O energie-admin energie
```

Finally fill the database with tables and some data:

```
```bash
psql -h localhost -f energie.sql energie energie-admin
```

Expand All @@ -48,7 +50,7 @@ Running

Now that the database is ready, we can start the application. There are several options you can give:

```
```bash
$ ./energyd --help
./energyd [options] command:
-h [ --help ] Display help message
Expand Down Expand Up @@ -83,4 +85,4 @@ For debugging it might be useful to run the application in the foreground withou
Usage
-----

The meters are hard coded, so this is perhaps not very useful for others. To complicate matters further, all text in the user interface is in Dutch. The idea is that you regularly enter (_Voeg toe_ button, or _Invoer_) the current values for the various meters. The graph (_Grafieken_) will then display your usage over time. The list of current values (_Opnames_) are displayed on the home page.
The meters are hard coded, so this is perhaps not very useful for others. To complicate matters further, all text in the user interface is in Dutch. The idea is that you regularly enter (_Voeg toe_ button, or _Invoer_) the current values for the various meters. The graph (_Grafieken_) will then display your usage over time. The list of current values (_Opnames_) are displayed on the home page.
Loading

0 comments on commit 31e3820

Please sign in to comment.