Skip to content

Commit

Permalink
Updated observation data model.
Browse files Browse the repository at this point in the history
  • Loading branch information
interkosmos committed Feb 28, 2024
1 parent 2d3eab9 commit 1db27b6
Show file tree
Hide file tree
Showing 41 changed files with 2,699 additions and 960 deletions.
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ DEBUG = -g -O0 -Wall -fcheck=all -fmax-errors=1
RELEASE = -mtune=native -O2

# Common build options.
FFLAGS = $(RELEASE) -ffree-line-length-0
FFLAGS = $(RELEASE) -ffree-line-length-0 -std=f2018
CFLAGS = $(RELEASE)
PPFLAGS = -cpp -D__$(OS)__
ARFLAGS = -rcs
Expand Down Expand Up @@ -266,11 +266,11 @@ app: $(DMAPI) $(DMBACKUP) $(DMBEAT) $(DMDB) $(DMDBCTL) $(DMEXPORT) $(DMFEED) \

# Tests target.
test: dmtestapi dmtestatom dmtestbase64 dmtestcgi dmtestconfig dmtestcsv \
dmtestdb dmtestdp dmtestfile dmtesthash dmtesthdf5 dmtesthtml dmtestlogger \
dmtestlua dmtestjob dmtestjson dmtestmail dmtestmqtt dmtestmqueue dmtestnml \
dmtestobserv dmtestpath dmtestpipe dmtestplot dmtestregex dmtestrpc \
dmtestrts dmteststring dmtesttime dmtesttty dmtestunit dmtestutil \
dmtestuuid dmtestz
dmtestdb dmtestdp dmtestfile dmtesthash dmtesthdf5 dmtesthtml dmtestid \
dmtestlogger dmtestlua dmtestjob dmtestjson dmtestmail dmtestmqtt \
dmtestmqueue dmtestnml dmtestobserv dmtestpath dmtestpipe dmtestplot \
dmtestregex dmtestrpc dmtestrts dmteststring dmtesttime dmtesttty \
dmtestunit dmtestutil dmtestuuid dmtestz

# ******************************************************************************
#
Expand Down Expand Up @@ -494,6 +494,9 @@ dmtesthdf5: test/dmtesthdf5.f90 $(TARGET)
dmtesthtml: test/dmtesthtml.f90 $(TARGET)
$(FC) $(FFLAGS) $(LDFLAGS) -o dmtesthtml test/dmtesthtml.f90 $(TARGET) $(LDLIBS)

dmtestid: test/dmtestid.f90 $(TARGET)
$(FC) $(FFLAGS) $(LDFLAGS) -o dmtestid test/dmtestid.f90 $(TARGET) $(LDLIBS)

dmtestlogger: test/dmtestlogger.f90 $(TARGET)
$(FC) $(FFLAGS) $(LDFLAGS) -o dmtestlogger test/dmtestlogger.f90 $(TARGET) $(LDLIBS) $(LIBRT)

Expand Down
4 changes: 2 additions & 2 deletions adoc/dmfeed.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ different feeds. Run _dmuuid(1)_ to generate a valid UUID4.

The time stamp of the feed in the updated element is set to the date and time of
the last log message. If no logs have been added to the database since the last
file modification time of the feed, the output file is not updated, unless
argument `--force` is passed.
file modification of the feed, the output file is not updated, unless argument
`--force` is passed.

== OPTIONS

Expand Down
10 changes: 5 additions & 5 deletions app/dmweb.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ function html_form_logs(nodes, sensors, targets, max_results, node_id, sensor_id
H_DIV_COL // &
dm_html_label('Source', for='source') // &
dm_html_input(HTML_INPUT_TYPE_TEXT, id='source', name='source', &
max_length=LOG_SOURCE_LEN, pattern='[\-0-9A-Za-z]+', &
max_length=LOG_SOURCE_LEN, pattern='[\-0-9A-Z_a-z]+', &
placeholder='Enter log source (optional)', value=source_) // &
dm_html_label('From', for='from') // &
dm_html_input(HTML_INPUT_TYPE_DATETIME_LOCAL, id='from', name='from', required=.true., value=from_) // &
Expand Down Expand Up @@ -1779,7 +1779,7 @@ function html_form_nodes(disabled) result(html)
H_DIV_COL // &
dm_html_label('ID', for='id') // &
dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='id', name='id', &
max_length=NODE_ID_LEN, pattern='[\-0-9A-Za-z]+', &
max_length=NODE_ID_LEN, pattern='[\-0-9A-Z_a-z]+', &
placeholder='Enter unique node id', required=.true.) // &
dm_html_label('Name', for='name') // &
dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='name', name='name', &
Expand Down Expand Up @@ -1999,7 +1999,7 @@ function html_form_plots(nodes, sensors, targets, max_results, node_id, sensor_i
H_DIV_COL // &
dm_html_label('Response Name', for='response_name') // &
dm_html_input(HTML_INPUT_TYPE_TEXT, id='response_name', name='response_name', &
max_length=RESPONSE_NAME_LEN, pattern='[\-0-9A-Za-z]+', &
max_length=RESPONSE_NAME_LEN, pattern='[\-0-9A-Z_a-z]+', &
placeholder='Enter response name', required=.true., &
value=response_name_) // &
dm_html_label('From', for='from') // &
Expand Down Expand Up @@ -2056,7 +2056,7 @@ function html_form_sensors(nodes, disabled) result(html)
dm_html_select(select_node, 'node_id', 'node_id', '', disabled=disabled_) // &
dm_html_label('ID', for='id') // &
dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='id', name='id', &
max_length=SENSOR_ID_LEN, pattern='[\-0-9A-Za-z]+', &
max_length=SENSOR_ID_LEN, pattern='[\-0-9A-Z_a-z]+', &
placeholder='Enter unique sensor id', required=.true.) // &
dm_html_label('Name', for='name') // &
dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='name', name='name', &
Expand Down Expand Up @@ -2118,7 +2118,7 @@ function html_form_targets(disabled) result(html)
H_DIV_COL // & ! column 1
dm_html_label('ID', for='id') // &
dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='id', name='id', &
max_length=TARGET_ID_LEN, pattern='[\-0-9A-Za-z]+', &
max_length=TARGET_ID_LEN, pattern='[\-0-9A-Z_a-z]+', &
placeholder='Enter unique target id', required=.true.) // &
dm_html_label('Name', for='name') // &
dm_html_input(HTML_INPUT_TYPE_TEXT, disabled=disabled_, id='name', name='name', &
Expand Down
1 change: 1 addition & 0 deletions config/dmfs.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ observs = {
receivers = { "dmdb" },
requests = {
{
name = "get-temp"
request = path,
pattern = "(?<temp>[-+0-9\\.]+)",
delay = 500,
Expand Down
2 changes: 2 additions & 0 deletions config/dmpipe.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ observ = {
-- Read CPU temperature.
--
{
name = "get-cpu-temp",
request = "sysctl hw.acpi.thermal.tz0.temperature",
pattern = "hw\\.acpi\\.thermal\\.tz0\\.temperature: (?<tz0>[-+0-9\\.,]+)C",
delay = 0,
Expand All @@ -46,6 +47,7 @@ observ = {
-- Read laptop battery status.
--
{
name = "get-battery",
request = "sysctl hw.acpi.battery.life",
pattern = "hw\\.acpi\\.battery\\.life: (?<battery>[0-9]+)",
delay = 0,
Expand Down
2 changes: 2 additions & 0 deletions config/dmserial.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ observs = {
receivers = { },
requests = {
{
name = "stop",
request = "s" .. del,
delimiter = "",
pattern = "",
Expand All @@ -74,6 +75,7 @@ observs = {
receivers = { "dmdb" },
requests = {
{
name = "get-values",
request = "Meter" .. del,
delimiter = del,
pattern = "^\\s*(?<temp>[-0-9.]+)\\s.C\\s+.t\\s+(?<humrel>[-0-9.]+)\\s%\\s+.t\\s+(?<humabs>[-0-9.]+)\\sg.m3.t\\s+(?<dew>[-0-9.]+)\\s.C\\s+.t\\s+(?<wetbulb>[-0-9.]+)",
Expand Down
36 changes: 24 additions & 12 deletions fpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ main = "dmtestbase64.f90"
name = "dmtestcgi"
main = "dmtestcgi.f90"

[[test]]
name = "dmtestconfig"
main = "dmtestconfig.f90"

[[test]]
name = "dmtestcsv"
main = "dmtestcsv.f90"
Expand All @@ -170,6 +174,10 @@ link = [ "sqlite3" ]
name = "dmtestdp"
main = "dmtestdp.f90"

[[test]]
name = "dmtestfile"
main = "dmtestfile.f90"

[[test]]
name = "dmtesthash"
main = "dmtesthash.f90"
Expand All @@ -184,14 +192,8 @@ name = "dmtesthtml"
main = "dmtesthtml.f90"

[[test]]
name = "dmtestlogger"
main = "dmtestlogger.f90"
link = [ "rt" ]

[[test]]
name = "dmtestlua"
main = "dmtestlua.f90"
link = [ "lua-5.4" ]
name = "dmtestid"
main = "dmtestid.f90"

[[test]]
name = "dmtestjob"
Expand All @@ -201,6 +203,16 @@ main = "dmtestjob.f90"
name = "dmtestjson"
main = "dmtestjson.f90"

[[test]]
name = "dmtestlogger"
main = "dmtestlogger.f90"
link = [ "rt" ]

[[test]]
name = "dmtestlua"
main = "dmtestlua.f90"
link = [ "lua-5.4" ]

[[test]]
name = "dmtestmail"
main = "dmtestmail.f90"
Expand Down Expand Up @@ -241,15 +253,15 @@ name = "dmtestregex"
main = "dmtestregex.f90"
link = [ "pcre2-8" ]

[[test]]
name = "dmtestrouter"
main = "dmtestrouter.f90"

[[test]]
name = "dmtestrpc"
main = "dmtestrpc.f90"
link = [ "curl", "z" ]

[[test]]
name = "dmtestrts"
main = "dmtestrts.f90"

[[test]]
name = "dmteststring"
main = "dmteststring.f90"
Expand Down
Loading

0 comments on commit 1db27b6

Please sign in to comment.