From afe3b99c7e1f7d54dc8f349186e405c090aa9e2f Mon Sep 17 00:00:00 2001 From: Yargo ASUS2 Date: Thu, 26 Jun 2014 07:31:17 +0200 Subject: [PATCH] simplified constant definitions, started examples --- Scratch/yargo.md | 15 +++++---------- examples/README.md | 7 +++++++ examples/ambros1/ambros.cfg | 9 +++++++++ src/ambros | 2 +- src/constants.sh | 16 +++++----------- src/fetcher | 4 ++-- src/morse/sniptime | 2 +- 7 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 examples/README.md create mode 100644 examples/ambros1/ambros.cfg diff --git a/Scratch/yargo.md b/Scratch/yargo.md index 6705698..19a099f 100644 --- a/Scratch/yargo.md +++ b/Scratch/yargo.md @@ -2,6 +2,9 @@ ## Konfiguration +Globales Konfigurationsfile `ambros.cfg` enthaelt Verweis auf Kanal- und +Quellenverzeichnis. + Jeder Kanal hat ein eigenes Verzeichnis mit Konfigurationsdateien und aktuellem Status sowie den SendeTexten. @@ -131,7 +134,7 @@ PBL-Zeilen mit anderem als Buchstaben an erster Stelle werden ignoriert (Komment - `INDEX` Index (Ganzzahl) - `DECAY` Zerfallszeit [sec] fuer abnehmende Sendewahrscheinlichkeit - `DURATION` Dauer [sec], rein informativ (fuer Sendeplanerstellung) -- `WPM` Tempo [WPM], minimal 1, maximal 255 +- `WPM` Tempo [WPM], minimal 1 - `GENESIS` Erstellungszeit [sec] - `SOURCE` Quelle (URL) - `IDENTIFICATION` Kurzbezeichnung (Wort, optional da durch Quelle gegeben) @@ -165,15 +168,7 @@ Format wie SauberText, allenfalls whitespace umformatiert #### PBL-Zeilen (Bezeichner grossgeschrieben) -_alle optional ausser_ `WPM` - -- `PRIORITY` Prioritaet (10..99, normalerweise nur 10..59) -- `INDEX` Index (Ganzzahl) -- `DECAY` Zerfallszeit [sec] fuer abnehmende Sendewahrscheinlichkeit -- `DURATION` Dauer [sec], rein informativ (fuer Sendeplanerstellung) -- `WPM` Tempo [WPM], minimal 1, maximal 255 -- `GENESIS` Erstellungszeit [sec, Ursprung fix je Installation/Plattform] -- `SOURCE` Quelle (URL) +wie oben, jedoch _alle optional ausser_ `WPM` --- diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..299c891 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,7 @@ +# AMBROS example files + +These are directories with example installations of channel and source +definitions for AMBROS. + +They can simply be copied to a temporary directory, where `ambros` can +be launched afterwards. diff --git a/examples/ambros1/ambros.cfg b/examples/ambros1/ambros.cfg new file mode 100644 index 0000000..3865c1a --- /dev/null +++ b/examples/ambros1/ambros.cfg @@ -0,0 +1,9 @@ +# global configuration file for AMBROS instance + +# channel and source directories +CHANNELDIR channels +SOURCEDIR sources +# configuration files in channel and sources directories +CHANNELCONFIG channels.cfg +SOURCECONFIG sources.cfg + diff --git a/src/ambros b/src/ambros index 6ceff65..be64af6 100644 --- a/src/ambros +++ b/src/ambros @@ -30,7 +30,7 @@ fi cd "$channeldir" echo working in channel $channeldir -speed=`configread $CHANNELCONFIG $PBLWPM` +speed=`configread $CHANNELCONFIG WPM` speed=${speed:-12} echo at speed $speed Words/min diff --git a/src/constants.sh b/src/constants.sh index 5cbf601..add258b 100644 --- a/src/constants.sh +++ b/src/constants.sh @@ -1,21 +1,15 @@ #!/bin/sh # functions, strings and other constants for shell scripts -# header names -PBLPRI=PRIORITY -PBLIDX=INDEX -PBLDCY=DECAY -PBLDUR=DURATION -PBLWPM=WPM -PBLGEN=GENESIS -PBLSRC=SOURCE +# for relation between dit unit and speed in words/min +# VVVVV=64, CODEX=60, PARIS=50 +SPEEDBASE=50 +# default speed [words/minute] +DEFAULTWPM=12 # timeout [sec] for fetch operations FETCHTIMEOUT=50 -# name of configuration file in channel directory -CHANNELCONFIG=channelconfig.cfg - # function to read config value by name # arguments: configfile name # value in stdout, exit nonzero if error diff --git a/src/fetcher b/src/fetcher index 1603785..01c8c5b 100644 --- a/src/fetcher +++ b/src/fetcher @@ -51,8 +51,8 @@ rss) *) gen=-1 ;; esac -echo $PBLSRC $proto://$src -echo $PBLGEN $gen +echo SOURCE $proto://$src +echo GENESIS $gen echo if test $gen -gt 0 then diff --git a/src/morse/sniptime b/src/morse/sniptime index 4f5ed3f..f20bf9d 100755 --- a/src/morse/sniptime +++ b/src/morse/sniptime @@ -10,7 +10,7 @@ # Morse character table, generated by chargen.sh chartab=`dirname $0`/chartab.txt # speedbase: VVVVV=64, CODEX=60, PARIS=50 -speedbase=50 +speedbase=${SPEEDBASE:-50} # calculate duration/ditunits of characters # (one character per argument) -- 2.11.4.GIT