39 | You can mouse over to highlight individual values.
40 |
41 |
42 | You can click and drag to zoom.
43 |
44 |
45 | Double-clicking will zoom you back out.
46 |
47 |
48 | Shift-drag will pan.
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/WebInterface/chart.js:
--------------------------------------------------------------------------------
1 | function GetArgument(name) {
2 | var results = new RegExp('[\?&]' + name + '=([^]*)').exec(window.location.href);
3 | if (results == null){
4 | return null;
5 | }
6 | else {
7 | return results[1] || 0;
8 | }
9 | }
10 |
11 | $(document).ready(function() {
12 | var series = GetArgument('id');
13 | $('#series').text(series);
14 | $('#raw').attr('href', 'content.html?id=' + encodeURIComponent(series));
15 |
16 | $.ajax({
17 | url: '../series/' + series + '/content?limit=0',
18 | cache: false,
19 | success: function(data) {
20 | var source = [];
21 |
22 | for (var i = 0; i < data.content.length; i++) {
23 | var item = data.content[i];
24 |
25 | if (!item.binary) {
26 | var value = parseFloat(item.value);
27 | if (!isNaN(value)) {
28 | source.push([ item.timestamp, value ]);
29 | }
30 | }
31 | }
32 |
33 | if (source.length == 0) {
34 | alert('This time series has no numeric payload!');
35 | }
36 |
37 | // http://dygraphs.com/data.html#array
38 | g = new Dygraph(document.getElementById('content'),
39 | source, {
40 | labels: [ 'Timestamp', 'Value' ]
41 | //legend: 'always',
42 | //title: 'Values',
43 | //showRoller: true,
44 | //rollPeriod: 14,
45 | //customBars: true,
46 | //ylabel: 'Temperature (F)'
47 | });
48 | }
49 | });
50 |
51 | });
52 |
--------------------------------------------------------------------------------
/Resources/CMake/RaspberryPiToolchain.cmake:
--------------------------------------------------------------------------------
1 | ##
2 | ## CMake toolchain for Raspberry Pi, using Crosstool-NG
3 | ## http://crosstool-ng.github.io/
4 | ## https://www.bootc.net/archives/2012/05/26/how-to-build-a-cross-compiler-for-your-raspberry-pi/
5 | ##
6 | ## Usage:
7 | ## cmake -DCROSSTOOLS_ROOT=/home/jodogne/x-tools/ -DSTATIC_BUILD=ON -DCMAKE_TOOLCHAIN_FILE=../Resources/CMake/RaspberryPiToolchain.cmake -DCMAKE_BUILD_TYPE=Release ..
8 | ##
9 |
10 | if (NOT DEFINED CROSSTOOLS_ROOT)
11 | # If not given at the CMake invokation, use the default target
12 | # location of Crosstool-NG (i.e. "~/x-tools", where the user
13 | # directory "~" is retrieved by reading the USER environment
14 | # variable)
15 | set(CROSSTOOLS_ROOT "/home/$ENV{USER}/x-tools")
16 | endif()
17 |
18 | if (NOT DEFINED CROSSTOOLS_ARCHITECTURE)
19 | set(CROSSTOOLS_ARCHITECTURE arm-unknown-linux-gnueabi)
20 | endif()
21 |
22 | # the name of the target operating system
23 | set(CMAKE_SYSTEM_NAME Linux)
24 |
25 | # which compilers to use for C and C++
26 | set(CMAKE_C_COMPILER ${CROSSTOOLS_ROOT}/${CROSSTOOLS_ARCHITECTURE}/bin/${CROSSTOOLS_ARCHITECTURE}-gcc)
27 | set(CMAKE_CXX_COMPILER ${CROSSTOOLS_ROOT}/${CROSSTOOLS_ARCHITECTURE}/bin/${CROSSTOOLS_ARCHITECTURE}-g++)
28 |
29 | # here is the target environment located
30 | set(CMAKE_FIND_ROOT_PATH ${CROSSTOOLS_PATH}/${CROSSTOOLS_ARCHITECTURE})
31 |
32 | # adjust the default behaviour of the FIND_XXX() commands:
33 | # search headers and libraries in the target environment, search
34 | # programs in the host environment
35 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
36 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
37 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
38 |
--------------------------------------------------------------------------------
/Resources/CMake/IMSTGateway.cmake:
--------------------------------------------------------------------------------
1 | if (ENABLE_IMST_GATEWAY)
2 |
3 | # WARNING: Release 3.1.0 does not work with RPi! Necessary to use the mainline version
4 |
5 | set(IMST_GATEWAY_SOURCES_DIR ${CMAKE_BINARY_DIR}/lora_gateway-2017-09-13)
6 | DownloadPackage(
7 | "0548d61d760bceec4a6380e6c093b5bd"
8 | "http://www.orthanc-server.com/downloads/third-party/atom-it/lora_gateway-2017-09-13.tar.gz"
9 | "${IMST_GATEWAY_SOURCES_DIR}")
10 |
11 | file(WRITE
12 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/inc/config.h
13 | "
14 | #pragma once
15 | #define LIBLORAGW_VERSION \"4.0.0\"
16 | #define CFG_SPI_NATIVE 1
17 | #define DEBUG_AUX 0
18 | #define DEBUG_SPI 0
19 | #define DEBUG_REG 0
20 | #define DEBUG_HAL 0
21 | #define DEBUG_GPS 0
22 | #define DEBUG_GPIO
23 | #define DEBUG_LBT 0
24 | #include \"imst_rpi.h\"
25 | ")
26 |
27 | include_directories(
28 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/inc/
29 | )
30 |
31 | set(IMST_GATEWAY_SOURCES
32 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/src/loragw_aux.c
33 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/src/loragw_fpga.c
34 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/src/loragw_gps.c
35 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/src/loragw_hal.c
36 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/src/loragw_lbt.c
37 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/src/loragw_radio.c
38 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/src/loragw_reg.c
39 | ${IMST_GATEWAY_SOURCES_DIR}/libloragw/src/loragw_spi.native.c
40 | )
41 |
42 | source_group(ThirdParty\\lora_gateway REGULAR_EXPRESSION ${IMST_GATEWAY_SOURCES_DIR}/.*)
43 |
44 | add_definitions(-DATOMIT_ENABLE_IMST_GATEWAY=1)
45 |
46 | else()
47 | add_definitions(-DATOMIT_ENABLE_IMST_GATEWAY=0)
48 |
49 | endif()
50 |
--------------------------------------------------------------------------------
/Framework/AtomITEnumerations.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Atom-IT - A Lightweight, RESTful microservice for IoT
3 | * Copyright (C) 2017 Sebastien Jodogne, WSL S.A., Belgium
4 | *
5 | * This program is free software: you can redistribute it and/or
6 | * modify it under the terms of the GNU General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * In addition, as a special exception, the copyright holders of this
11 | * program give permission to link the code of its release with the
12 | * OpenSSL project's "OpenSSL" library (or with modified versions of it
13 | * that use the same license as the "OpenSSL" library), and distribute
14 | * the linked executables. You must obey the GNU General Public License
15 | * in all respects for all of the code used other than "OpenSSL". If you
16 | * modify file(s) with this exception, you may extend this exception to
17 | * your version of the file(s), but you are not obligated to do so. If
18 | * you do not wish to do so, delete this exception statement from your
19 | * version. If you delete this exception statement from all source files
20 | * in the program, then also delete it here.
21 | *
22 | * This program is distributed in the hope that it will be useful, but
23 | * WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 | * General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with this program. If not, see .
29 | **/
30 |
31 |
32 | #pragma once
33 |
34 | namespace AtomIT
35 | {
36 | enum TimestampType
37 | {
38 | TimestampType_Default,
39 | TimestampType_Sequence,
40 | TimestampType_NanosecondsClock,
41 | TimestampType_MillisecondsClock,
42 | TimestampType_SecondsClock,
43 | TimestampType_Fixed
44 | };
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/UnitTestsSources/UnitTests.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Atom-IT - A Lightweight, RESTful microservice for IoT
3 | * Copyright (C) 2017 Sebastien Jodogne, WSL S.A., Belgium
4 | *
5 | * This program is free software: you can redistribute it and/or
6 | * modify it under the terms of the GNU General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * In addition, as a special exception, the copyright holders of this
11 | * program give permission to link the code of its release with the
12 | * OpenSSL project's "OpenSSL" library (or with modified versions of it
13 | * that use the same license as the "OpenSSL" library), and distribute
14 | * the linked executables. You must obey the GNU General Public License
15 | * in all respects for all of the code used other than "OpenSSL". If you
16 | * modify file(s) with this exception, you may extend this exception to
17 | * your version of the file(s), but you are not obligated to do so. If
18 | * you do not wish to do so, delete this exception statement from your
19 | * version. If you delete this exception statement from all source files
20 | * in the program, then also delete it here.
21 | *
22 | * This program is distributed in the hope that it will be useful, but
23 | * WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 | * General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with this program. If not, see .
29 | **/
30 |
31 |
32 | #include
33 |
34 | #include
35 |
36 | int main(int argc, char **argv)
37 | {
38 | Orthanc::Logging::Initialize();
39 | Orthanc::Logging::EnableInfoLevel(true);
40 |
41 | ::testing::InitGoogleTest(&argc, argv);
42 | int result = RUN_ALL_TESTS();
43 |
44 | Orthanc::Logging::Finalize();
45 |
46 | return result;
47 | }
48 |
--------------------------------------------------------------------------------
/Applications/FilterFactory.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Atom-IT - A Lightweight, RESTful microservice for IoT
3 | * Copyright (C) 2017 Sebastien Jodogne, WSL S.A., Belgium
4 | *
5 | * This program is free software: you can redistribute it and/or
6 | * modify it under the terms of the GNU General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * In addition, as a special exception, the copyright holders of this
11 | * program give permission to link the code of its release with the
12 | * OpenSSL project's "OpenSSL" library (or with modified versions of it
13 | * that use the same license as the "OpenSSL" library), and distribute
14 | * the linked executables. You must obey the GNU General Public License
15 | * in all respects for all of the code used other than "OpenSSL". If you
16 | * modify file(s) with this exception, you may extend this exception to
17 | * your version of the file(s), but you are not obligated to do so. If
18 | * you do not wish to do so, delete this exception statement from your
19 | * version. If you delete this exception statement from all source files
20 | * in the program, then also delete it here.
21 | *
22 | * This program is distributed in the hope that it will be useful, but
23 | * WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 | * General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with this program. If not, see .
29 | **/
30 |
31 |
32 | #pragma once
33 |
34 | #include "../Framework/ConfigurationSection.h"
35 | #include "../Framework/FileWritersPool.h"
36 | #include "../Framework/TimeSeries/ITimeSeriesManager.h"
37 | #include "../Framework/Filters/IFilter.h"
38 |
39 | namespace AtomIT
40 | {
41 | IFilter* CreateFilter(ITimeSeriesManager& manager,
42 | FileWritersPool& writers,
43 | const ConfigurationSection& config);
44 | }
45 |
--------------------------------------------------------------------------------
/Framework/TimeSeries/ITimeSeriesObserver.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Atom-IT - A Lightweight, RESTful microservice for IoT
3 | * Copyright (C) 2017 Sebastien Jodogne, WSL S.A., Belgium
4 | *
5 | * This program is free software: you can redistribute it and/or
6 | * modify it under the terms of the GNU General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * In addition, as a special exception, the copyright holders of this
11 | * program give permission to link the code of its release with the
12 | * OpenSSL project's "OpenSSL" library (or with modified versions of it
13 | * that use the same license as the "OpenSSL" library), and distribute
14 | * the linked executables. You must obey the GNU General Public License
15 | * in all respects for all of the code used other than "OpenSSL". If you
16 | * modify file(s) with this exception, you may extend this exception to
17 | * your version of the file(s), but you are not obligated to do so. If
18 | * you do not wish to do so, delete this exception statement from your
19 | * version. If you delete this exception statement from all source files
20 | * in the program, then also delete it here.
21 | *
22 | * This program is distributed in the hope that it will be useful, but
23 | * WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 | * General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with this program. If not, see .
29 | **/
30 |
31 |
32 | #pragma once
33 |
34 | #include
35 | #include
36 |
37 | namespace AtomIT
38 | {
39 | class ITimeSeriesObserver : public boost::noncopyable
40 | {
41 | public:
42 | virtual ~ITimeSeriesObserver()
43 | {
44 | }
45 |
46 | virtual void NotifySeriesDeleted(const std::string& name) = 0;
47 |
48 | virtual void NotifySeriesModified(const std::string& name) = 0;
49 | };
50 | }
51 |
--------------------------------------------------------------------------------
/Framework/TimeSeries/SQLiteBackend/SQLiteTimeSeriesBackend.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Atom-IT - A Lightweight, RESTful microservice for IoT
3 | * Copyright (C) 2017 Sebastien Jodogne, WSL S.A., Belgium
4 | *
5 | * This program is free software: you can redistribute it and/or
6 | * modify it under the terms of the GNU General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * In addition, as a special exception, the copyright holders of this
11 | * program give permission to link the code of its release with the
12 | * OpenSSL project's "OpenSSL" library (or with modified versions of it
13 | * that use the same license as the "OpenSSL" library), and distribute
14 | * the linked executables. You must obey the GNU General Public License
15 | * in all respects for all of the code used other than "OpenSSL". If you
16 | * modify file(s) with this exception, you may extend this exception to
17 | * your version of the file(s), but you are not obligated to do so. If
18 | * you do not wish to do so, delete this exception statement from your
19 | * version. If you delete this exception statement from all source files
20 | * in the program, then also delete it here.
21 | *
22 | * This program is distributed in the hope that it will be useful, but
23 | * WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 | * General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with this program. If not, see .
29 | **/
30 |
31 |
32 | #pragma once
33 |
34 | #include "SQLiteTimeSeriesTransaction.h"
35 | #include "../ITimeSeriesBackend.h"
36 |
37 | namespace AtomIT
38 | {
39 | class SQLiteTimeSeriesBackend : public ITimeSeriesBackend
40 | {
41 | private:
42 | class Transaction;
43 |
44 | SQLiteDatabase& database_;
45 | std::string name_;
46 |
47 | public:
48 | SQLiteTimeSeriesBackend(SQLiteDatabase& database,
49 | const std::string& name);
50 |
51 | virtual ITransaction* CreateTransaction(bool isReadOnly);
52 | };
53 | }
54 |
--------------------------------------------------------------------------------
/Framework/TimeSeries/ITimeSeriesFactory.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Atom-IT - A Lightweight, RESTful microservice for IoT
3 | * Copyright (C) 2017 Sebastien Jodogne, WSL S.A., Belgium
4 | *
5 | * This program is free software: you can redistribute it and/or
6 | * modify it under the terms of the GNU General Public License as
7 | * published by the Free Software Foundation, either version 3 of the
8 | * License, or (at your option) any later version.
9 | *
10 | * In addition, as a special exception, the copyright holders of this
11 | * program give permission to link the code of its release with the
12 | * OpenSSL project's "OpenSSL" library (or with modified versions of it
13 | * that use the same license as the "OpenSSL" library), and distribute
14 | * the linked executables. You must obey the GNU General Public License
15 | * in all respects for all of the code used other than "OpenSSL". If you
16 | * modify file(s) with this exception, you may extend this exception to
17 | * your version of the file(s), but you are not obligated to do so. If
18 | * you do not wish to do so, delete this exception statement from your
19 | * version. If you delete this exception statement from all source files
20 | * in the program, then also delete it here.
21 | *
22 | * This program is distributed in the hope that it will be useful, but
23 | * WITHOUT ANY WARRANTY; without even the implied warranty of
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 | * General Public License for more details.
26 | *
27 | * You should have received a copy of the GNU General Public License
28 | * along with this program. If not, see .
29 | **/
30 |
31 |
32 | #pragma once
33 |
34 | #include "ITimeSeriesBackend.h"
35 | #include "../AtomITEnumerations.h"
36 |
37 | #include