mirror of
https://github.com/fenix-soft/fmeteo.git
synced 2025-03-12 14:30:04 +01:00
rf5 v1.1
This commit is contained in:
parent
7bb84712a1
commit
e4f5fbbcbf
46
tools/rf5
46
tools/rf5
@ -1,35 +1,39 @@
|
||||
#!/bin/bash
|
||||
# read and print video forecast 5 data
|
||||
# V.1.0
|
||||
# V.1.1
|
||||
|
||||
|
||||
forecast5() {
|
||||
echo " "
|
||||
echo "┌---------------------------------------------------------------┐"
|
||||
echo "┊ OFFLINE FORECAST WEATHER 5 DAY DATA ┊"
|
||||
echo "└---------------------------------------------------------------┘"
|
||||
|
||||
for ((i=0; i<6; i++)); do
|
||||
|
||||
# exstract forecast 5 data to jason file
|
||||
|
||||
city_name=`cat meteonow.txt | jq -r '.list[0]|.name'`
|
||||
L=`cat meteonow.txt | jq -r '.list[0]|.sys[]'`
|
||||
Lat=`cat meteonow.txt | jq -r '.list[0]|.coord.lat'`
|
||||
Lon=`cat meteonow.txt | jq -r '.list[0]|.coord.lon'`
|
||||
data_X=`cat meteo5.txt | jq -r '.list['$i']|.dt'`
|
||||
city_name=`cat meteonow.json | jq -r '.list[0]|.name'`
|
||||
L=`cat meteonow.json | jq -r '.list[0]|.sys[]'`
|
||||
Lat=`cat meteonow.json | jq -r '.list[0]|.coord.lat'`
|
||||
Lon=`cat meteonow.json | jq -r '.list[0]|.coord.lon'`
|
||||
data_X=`cat meteo5.json | jq -r '.list['$i']|.dt'`
|
||||
data_U=`date -d @$data_X`
|
||||
Wcond_n=`cat meteo5.txt | jq -r '.list['$i']|.weather[].main'`
|
||||
Wcond_nd=`cat meteo5.txt | jq -r '.list['$i']|.weather[].description'`
|
||||
Tmax=`cat meteo5.txt | jq -r '.list['$i']|.temp.max'`
|
||||
Tmin=`cat meteo5.txt | jq -r '.list['$i']|.temp.min'`
|
||||
TM=`cat meteo5.txt | jq -r '.list['$i']|.temp.morn'`
|
||||
TE=`cat meteo5.txt | jq -r '.list['$i']|.temp.eve'`
|
||||
TN=`cat meteo5.txt | jq -r '.list['$i']|.temp.night'`
|
||||
TD=`cat meteo5.txt | jq -r '.list['$i']|.temp.day'`
|
||||
Hm=`cat meteo5.txt | jq -r '.list['$i']|.humidity'`
|
||||
PrS=`cat meteo5.txt | jq -r '.list['$i']|.pressure'`
|
||||
#ClD=`cat meteo5.txt | jq -r '.list['$i']|.clouds'`
|
||||
R=`cat meteo5.txt | jq -r '.list['$i']|.rain'`
|
||||
S=`cat meteo5.txt | jq -r '.list['$i']|.snow'`
|
||||
Ws=`cat meteo5.txt | jq -r '.list['$i']|.speed'`
|
||||
Wsd=`cat meteo5.txt | jq -r '.list['$i']|.deg'`
|
||||
Wcond_n=`cat meteo5.json | jq -r '.list['$i']|.weather[].main'`
|
||||
Wcond_nd=`cat meteo5.json | jq -r '.list['$i']|.weather[].description'`
|
||||
Tmax=`cat meteo5.json | jq -r '.list['$i']|.temp.max'`
|
||||
Tmin=`cat meteo5.json | jq -r '.list['$i']|.temp.min'`
|
||||
TM=`cat meteo5.json | jq -r '.list['$i']|.temp.morn'`
|
||||
TE=`cat meteo5.json | jq -r '.list['$i']|.temp.eve'`
|
||||
TN=`cat meteo5.json | jq -r '.list['$i']|.temp.night'`
|
||||
TD=`cat meteo5.json | jq -r '.list['$i']|.temp.day'`
|
||||
Hm=`cat meteo5.json | jq -r '.list['$i']|.humidity'`
|
||||
PrS=`cat meteo5.json | jq -r '.list['$i']|.pressure'`
|
||||
#ClD=`cat meteo5.json | jq -r '.list['$i']|.clouds'`
|
||||
R=`cat meteo5.json | jq -r '.list['$i']|.rain'`
|
||||
S=`cat meteo5.json | jq -r '.list['$i']|.snow'`
|
||||
Ws=`cat meteo5.json | jq -r '.list['$i']|.speed'`
|
||||
Wsd=`cat meteo5.json | jq -r '.list['$i']|.deg'`
|
||||
|
||||
# convert m/s to Km/s
|
||||
WsKM=$(echo "3.6"*$Ws | bc)
|
||||
|
@ -1,10 +1,18 @@
|
||||
# rf5:
|
||||
|
||||
**rf5**: read and print on video the forecast 5 **jason data** (meteo5.txt) generated to fmeteo.
|
||||
**rf5**: read and print on video the forecast 5 **jason data** (meteo5.json) generated to fmeteo.
|
||||
|
||||
The script is a utility to test a future implementation on fmeteo, or read the **old** forecast 5 data, offline.
|
||||
|
||||
|
||||
# use:
|
||||
|
||||
For use this, put or copy the script, in the same directory of fmeteo and run it.
|
||||
For use this, put or copy the script, in the same directory of fmeteo and run it.
|
||||
|
||||
rf5
|
||||
|
||||
or if we are a terminal that does not support xserver we can use a pager to display the data page by page:
|
||||
|
||||
rf5 | less
|
||||
|
||||
use space or the arrow to go forward or back, "q" to exit
|
@ -1,3 +1,7 @@
|
||||
# V.1.1
|
||||
- fix data for fmeteo V1.5 change
|
||||
- add fmeteo print style
|
||||
|
||||
# V.1.0
|
||||
|
||||
- initial relase
|
@ -1 +1 @@
|
||||
V.1.0
|
||||
V.1.1
|
Loading…
x
Reference in New Issue
Block a user