
Originariamente Scritto da
bufera
allora..con i codici me la cavo..quindi volendo potrei anche riuscire...l'unica cosa che non sò dove prendere i tags per richiamare i dati (anche tipo il bulbo della temp o i "contenitori" della pioggia)...inoltre per stabilire i posizionamenti dei dati c'è un metodo alternativo per inserire la posizione in numeri? o
cmq un semplice metodo per ricavarle?
grazie
Io sono l'ultimo per dare consigli sui codici data la mia scarsissima preparazione in merito, ma ho dato un'occhiata (anche due..) a quelli standard già fatti di GW e alla fine con un copia ed incolla sono riuscito a fare qualche cosa che mi soddisfaceva.
Io trovo che la schermata fatta da Franco, è ben strutturata e comprensibile, insomma adatta anche per uno studio didattico sul tema che puo anche avere delle variazioni. Dato che è scaricabile dal sito di Gigi su disponibilità di Franco stesso, mi permetto di metterla qui in formato codice e anche con la corrispondente schermata.
Per quanto riguarda il posizionamento dei vari oggetti, io ho sempre lavorato di prove su prove variando i valori numerici dei vari "widht" "height" " position-x" e "position-y"
Codice:
<?xml version="1.0" encoding="iso-8859-1" ?>
<stylesheet>
<image width="790" height="730"/>
<!-- ================= Frame ================= -->
<frame width="790" height="730" position-x="0" position-y="0" >
<title text="Nome vostra stazione \nDati rilevati alle $CurrentDate[ore %H:%M di %A %d %B %Y]" alignement="hcenter" angle="0">
<font color="FFccffff" facename="Times" size="26" weight="600" italic="1" />
</title>
<background color="FF000000" stretch="1" />
<!-- <background texture="A_Marmo_verde.jpg" stretch="1" /> -->
<border cornerradius="10" color="FF000000" />
</frame>
<!-- ================= Temperatura ================= -->
<textbox width="82" height="260" position-x="5" position-y="103">
<text alignement="bottom|hcenter">
<line text="$Current[outdoor_temperature] $Unit[Temperature]" />
<line text="$Current[rate_outdoor_temperature] °C/h" />
<font color="FFff0033" facename="Arial" size="14" weight="600" italic="0" />
</text>
<background color="" stretch="1" />
<border cornerradius="8" color="FFffffff" thick="1" />
</textbox>
<textbox width="82" height="410" position-x="5" position-y="64">
<text alignement="top|hcenter">
<line text="Temper.\nrelativa" />
<font color="FFff0033" facename="Arial" size="14" weight="600" italic="0" />
</text>
</textbox>
<!-- ================= Colonna Temperatura ================= -->
<lineargauge width="82" height="370" orientation="1" position-x="20" position-y="0" margin-top="114" margin-right="0" margin-bottom="60" margin-left="0">
<title text="">
<font color="FFcc0000" facename="Arial" size="18" weight="800" italic="0" />
</title>
<axis color="FFffffff" min="-10" max="40" side="hcenter" titlemargin="20">
<labels labelinterval="1" side="left" hide="0">
<font color="ffccffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="11" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="10" majorticksize="18"/>
</axis>
<index>
<current_outdoor_temperature color1="FF669999" color2="FF669999" filled="1" side="left" thick="18" axisdelta="0"/>
<stats_day_max_outdoor_temperature texture="img_modern_index_20x24_rosso.png" side="left" thick="5" axisdelta="5"/>
<stats_day_min_outdoor_temperature texture="img_modern_index_20x24_verde.png" side="left" thick="5" axisdelta="5"/>
</index>
<border cornerradius="0" color="FFffffff" thick="0" />
</lineargauge>
<!-- ================= Umidità ================= -->
<textbox width="82" height="260" position-x="92" position-y="103">
<text alignement="bottom|hcenter">
<line text="$Current[outdoor_humidity] %" />
<line text="$Current[rate_outdoor_humidity]% ur/h" />
<font color="FFffff00" facename="Arial" size="14" weight="600" italic="0" />
</text>
<background color="" stretch="1" />
<border cornerradius="8" color="FFffffff" thick="1" />
</textbox>
<textbox width="82" height="460" position-x="92" position-y="64">
<text alignement="top|hcenter">
<line text="Umidità\nralativa" />
<font color="FFffff00" facename="Arial" size="14" weight="600" italic="0" />
</text>
</textbox>
<!-- ================= Colonna Umidità ================= -->
<lineargauge width="82" height="370" orientation="1" position-x="106" position-y="0" margin-top="114" margin-right="0" margin-bottom="60" margin-left="0">
<axis color="FFffffff" min="0" max="100" side="hcenter" titlemargin="20">
<labels labelinterval="1" side="left" hide="0">
<font color="ffccffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="11" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="10" majorticksize="18"/>
</axis>
<index>
<current_outdoor_humidity color1="FF669999" color2="FF669999" filled="1" side="left" thick="18" axisdelta="0"/>
<stats_day_max_outdoor_humidity texture="img_modern_index_20x24_rosso.png" side="left" thick="5" axisdelta="5"/>
<stats_day_min_outdoor_humidity texture="img_modern_index_20x24_verde.png" side="left" thick="5" axisdelta="5"/>
</index>
<border cornerradius="0" color="FFffffff" thick="0" />
</lineargauge>
<!-- ================= Punto Rugiada / Dew Point ================= -->
<textbox width="82" height="260" position-x="179" position-y="103">
<text alignement="bottom|hcenter">
<line text="$Current[dew_point] $Unit[Temperature]" />
<line text="$Current[rate_dew_point] $Unit[Temperature]/h" />
<font color="FFff00ff" facename="Arial" size="14" weight="600" italic="0" />
</text>
<border cornerradius="8" color="FFffffff" thick="1" />
</textbox>
<textbox width="82" height="460" position-x="179" position-y="64">
<text alignement="top|hcenter">
<line text="Punto di\nrugiada" />
<font color="FFff00ff" facename="Arial" size="14" weight="600" italic="0" />
</text>
</textbox>
<!-- ================= Colonna Punto Rugiada / Dew Point ================= -->
<lineargauge width="82" height="370" orientation="1" position-x="195" position-y="0" margin-top="114" margin-right="0" margin-bottom="60" margin-left="0">
<axis color="FFffffff" min="-10" max="40" side="hcenter" titlemargin="20">
<labels labelinterval="1" side="left" hide="0">
<font color="FFccffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="11" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="10" majorticksize="18"/>
</axis>
<index>
<current_dew_point color1="FF669999" color2="FF669999" filled="1" side="left" thick="18" axisdelta="0"/>
<stats_day_max_dew_point texture="img_modern_index_20x24_rosso.png" side="left" thick="5" axisdelta="5"/>
<stats_day_min_dew_point texture="img_modern_index_20x24_verde.png" side="left" thick="5" axisdelta="5"/>
</index>
</lineargauge>
<!-- ================= Calore ================= -->
<textbox width="82" height="260" position-x="266" position-y="103">
<text alignement="bottom|hcenter">
<line text="$Current[heat_index] $Unit[Temperature]" />
<line text="$Current[rate_heat_index] $Unit[Temperature]/h" />
<font color="FF6699ff" facename="Arial" size="14" weight="600" italic="0" />
</text>
<background color="" stretch="1" />
<border cornerradius="8" color="FFffffff" thick="1" />
</textbox>
<textbox width="82" height="460" position-x="266" position-y="64">
<text alignement="top|hcenter">
<line text="Calore\npercepito" />
<font color="FF6699ff" facename="Arial" size="14" weight="600" italic="0" />
</text>
</textbox>
<!-- ================= Colonna Calore ================= -->
<lineargauge width="82" height="370" orientation="1" position-x="280" position-y="0" margin-top="114" margin-right="0" margin-bottom="60" margin-left="0">
<title text="">
<font color="FFcc0000" facename="Arial" size="18" weight="800" italic="0" />
</title>
<axis color="FFffffff" min="-10" max="50" side="hcenter" titlemargin="20">
<labels labelinterval="1" side="left" hide="0">
<font color="ffccffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="13" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="10" majorticksize="18"/>
</axis>
<index>
<current_heat_index color1="FF669999" color2="FF669999" filled="1" side="left" thick="18" axisdelta="0"/>
<stats_day_max_heat_index texture="img_modern_index_20x24_rosso.png" side="left" thick="5" axisdelta="5"/>
<stats_day_min_heat_index texture="img_modern_index_20x24_verde.png" side="left" thick="5" axisdelta="5"/>
</index>
<border cornerradius="0" color="FFffffff" thick="0" />
</lineargauge>
<!-- ================= Wind Chill ================= -->
<textbox width="82" height="260" position-x="353" position-y="103">
<text alignement="bottom|hcenter">
<line text="$Current[wind_chill] $Unit[Temperature]" />
<line text="$Current[rate_wind_chill] $Unit[Temperature]/h" />
<font color="FFffffff" facename="Arial" size="14" weight="600" italic="0" />
</text>
<border cornerradius="8" color="FFffffff" thick="1" />
</textbox>
<textbox width="82" height="460" position-x="353" position-y="64">
<text alignement="tpo|hcenter">
<line text="Wind Chill\n" />
<font color="FFffffff" facename="Arial" size="14" weight="600" italic="0" />
</text>
</textbox>
<!-- ================= Colonna Wind Chill ================= -->
<lineargauge width="82" height="370" orientation="1" position-x="369" position-y="0" margin-top="114" margin-right="0" margin-bottom="60" margin-left="0">
<axis color="FFffffff" min="-20" max="35" side="hcenter" titlemargin="20">
<labels labelinterval="1" side="left" hide="0">
<font color="ffccffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="12" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="10" majorticksize="18"/>
</axis>
<index>
<current_wind_chill color1="FF669999" color2="FF669999" filled="1" side="left" thick="18" axisdelta="0"/>
<stats_day_max_wind_chill texture="img_modern_index_20x24_rosso.png" side="left" thick="5" axisdelta="5"/>
<stats_day_min_wind_chill texture="img_modern_index_20x24_verde.png" side="left" thick="5" axisdelta="5"/>
</index>
</lineargauge>
<!-- ================= Pressione ================= -->
<textbox width="82" height="260" shadow="0" position-x="440" position-y="103">
<text alignement="bottom|hcenter">
<line text="$Current[relative_pressure] $Unit[Pressure]" />
<line text="$Current[rate_relative_pressure] hPa/h" />
<font color="FF33ff00" facename="Arial" size="14" weight="600" italic="0" />
</text>
<border cornerradius="8" color="FFffffff" thick="1" />
</textbox>
<textbox width="82" height="460" shadow="0" position-x="440" position-y="64">
<text alignement="top|hcenter">
<line text="Pressione\nrelativa" />
<font color="FF33ff00" facename="Arial" size="14" weight="600" italic="0" />
</text>
</textbox>
<!-- ================= Colonna Pressione ================= -->
<lineargauge width="90" height="370" orientation="1" position-x="446" position-y="0" margin-top="114" margin-right="0" margin-bottom="60" margin-left="20">
<axis color="ffffffff" min="950" max="1050" side="hcenter" titlemargin="20">
<labels labelinterval="1" side="left" hide="0">
<font color="ffccffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="11" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="10" majorticksize="18"/>
</axis>
<index>
<current_relative_pressure color1="FF669999" color2="FF669999" filled="1" side="left" thick="18" axisdelta="0"/>
<stats_day_max_relative_pressure texture="img_modern_index_20x24_rosso.png" side="left" thick="5" axisdelta="5"/>
<stats_day_min_relative_pressure texture="img_modern_index_20x24_verde.png" side="left" thick="5" axisdelta="5"/>
</index>
</lineargauge>
<!-- ================= Pioggia 24h ================= -->
<textbox width="82" height="260" shadow="0" position-x="527" position-y="103">
<text alignement="bottom|hcenter">
<line text="Ult. 24h" />
<line text="$Current[rainfall_24h] $Unit[Rainfall]" />
<font color="FF00ffff" facename="Arial" size="14" weight="600" italic="0" />
</text>
<border cornerradius="8" color="FFffffff" thick="1" />
</textbox>
<!-- ================= Colonne Pioggia 24h ================= -->
<lineargauge width="82" height="370" orientation="1" position-x="543" position-y="0" margin-top="114" margin-right="0" margin-bottom="60" margin-left="0">
<axis color="FFffffff" min="0" max="100" side="hcenter" titlemargin="20">
<labels labelinterval="1" side="left" hide="0">
<font color="ffccffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="11" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="10" majorticksize="18"/>
</axis>
<index>
<current_rainfall_24h color1="FF669999" color2="FF669999" filled="1" side="left" thick="18" axisdelta="0"/>
</index>
</lineargauge>
<!-- ================= Pioggia Mese ================= -->
<textbox width="82" height="260" shadow="0" position-x="614" position-y="103">
<text alignement="bottom|hcenter">
<line text="Mensile" />
<line text="$Stats[Month,TotalRainfall] $Unit[Rainfall]" />
<font color="FF00ffff" facename="Arial" size="14" weight="600" italic="0" />
</text>
<border cornerradius="8" color="FFffffff" thick="1" />
</textbox>
<textbox width="250" height="360" shadow="0" position-x="530" position-y="64">
<text alignement="top|hcenter">
<line text="------------ Quantità di Pioggia ------------\n" />
<font color="FF00ffff" facename="Arial" size="14" weight="600" italic="0" />
</text>
</textbox>
<!-- ================= Colonne Pioggia Mese ================= -->
<lineargauge width="82" height="370" orientation="1" position-x="630" position-y="0" margin-top="114" margin-right="0" margin-bottom="60" margin-left="0">
<axis color="FFffffff" min="0" max="400" side="hcenter" titlemargin="20">
<labels labelinterval="1" side="left" hide="0">
<font color="ffccffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="9" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="10" majorticksize="18"/>
</axis>
<index>
<stats_month_totalrainfall color1="FF669999" color2="FF669999" filled="1" side="left" thick="18" axisdelta="0"/>
</index>
</lineargauge>
<!-- ================= Pioggia Anno ================= -->
<textbox width="82" height="260" shadow="0" position-x="701" position-y="103">
<text alignement="bottom|hcenter">
<line text="Annuale" />
<line text="$Stats[Year,TotalRainfall] $Unit[Rainfall]" />
<font color="FF00ffff" facename="Arial" size="14" weight="600" italic="0" />
</text>
<border cornerradius="8" color="FFffffff" thick="1" />
</textbox>
<!-- ================= Colonne Pioggia Anno ================= -->
<lineargauge width="82" height="370" orientation="1" position-x="717" position-y="0" margin-top="114" margin-right="0" margin-bottom="60" margin-left="0">
<axis color="FFffffff" min="0" max="1600" side="hcenter" titlemargin="20">
<labels labelinterval="1" side="left" hide="0">
<font color="ffccffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="17" minorticks="1" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="10" majorticksize="18"/>
</axis>
<index>
<stats_year_totalrainfall color1="FF669999" color2="FF669999" filled="1" side="left" thick="18" axisdelta="0"/>
</index>
</lineargauge>
<!-- ================= TextBox per firma ================= -->
<textbox width="70" height="30" position-x="720" position-y="-8">
<text text="by IV3OGT">
<font color="FF9999cc" facename="Arial" size="12" weight="400" italic="1" />
</text>
</textbox>
<!-- ================= First Lineplot ================= -->
<lineplot width="517" height="192" shadow="0" position-x="5" position-y="371" margin-top="25" margin-right="135" margin-bottom="45" margin-left="55">
<title text="" alignement="vcenter|hcenter" angle="0">
<font color="FFffffff" facename="Arial" size="18" weight="400" italic="0" />
</title>
<border cornerradius="8" color="FFffffff" thick="1" />
<xaxis color="FFffffff" grid="1" autoscale="0" min="0" max="0" titleside="bottom">
<title text="" alignement="vcenter|hcenter" angle="0">
<font color="FFffffff" facename="Arial" size="14" weight="400" italic="0" />
</title>
<labels labelinterval="1" angle="0" format="%H:%M\n%d/%m" side="left" hide="0">
<font color="FFffffff" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="5" minorticks="4" side="bottom" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
</xaxis>
<y1axis color="FFffffff" grid="1" autoscale="1" min="0" max="0" titleside="left" titlemargin="32">
<title text="Temperature ($Unit[Temperature])" alignement="vcenter|hcenter" angle="0">
<font color="FFff0033" facename="Arial" size="14" weight="400" italic="0" />
</title>
<labels labelinterval="1" angle="0" format=".0" side="left" hide="0">
<font color="FFff0033" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="5" minorticks="4" side="left" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
</y1axis>
<y2axis side="right" color="FFccffff" grid="0" autoscale="1" titleside="right" titlemargin="38">
<title text="Pressure ($Unit[Pressure])" alignement="vcenter|hcenter" angle="0">
<font color="FF00ff00" facename="Arial" size="14" weight="400" italic="0" />
</title>
<labels labelinterval="1" angle="0" format=".0" side="right" hide="0">
<font color="FF00ff00" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks majorticks="5" minorticks="4" side="right" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
</y2axis>
<y3axis ydelta="70" side="right" color="FF000000" grid="0" autoscale="0" min="0" max="100" titleside="right" titlemargin="35">
<title text="Humidity (%)" alignement="vcenter|hcenter" angle="0">
<font color="FFffff00" facename="Arial" size="14" weight="400" italic="0" />
</title>
<labels labelinterval="1" angle="0" format=".0" side="right" hide="0">
<font color="FFffff00" facename="Arial" size="14" weight="400" italic="0" />
</labels>
<ticks autoticks="0" majorticks="5" minorticks="4" side="right" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" />
</y3axis>
<!-- Non essendo stato capace di eliminare parte degli elementi della "Leggenda" li ho spostati fuori frame (legend position-x="6000") -->
<legend position-x="6000" position-y="70" hide="0" shadow="0">
<font color="FFffffff" facename="Arial" size="14" weight="400" italic="0" />
<border cornerradius="0" color="FFffffff" thick="0" />
<background color="00000000" />
</legend>
<background color="FF000000" texture="" stretch="1" />
<graphbackground color="FFcccccc" />
<data>
<outdoor_humidity axisbind="y3axis" legend="Outdoor humidity" color1="FFffff00" antialiasing="1" hidelegend="1" thick="2"/>
<wind_chill axisbind="y1axis" legend="Wind chill" color1="FFffffff" antialiasing="1" filled="0" hide="0" thick="2"/>
<outdoor_temperature axisbind="y1axis" legend="Outdoor temperature" color1="FFFF0000" antialiasing="1" filled="0" hide="0" thick="2"/>
<dew_point axisbind="y1axis" legend="Dew point" color1="FFff00ff" antialiasing="1" filled="0" hide="0" thick="2"/>
<relative_pressure axisbind="y2axis" legend="Rel. pressure" color1="FF009000" antialiasing="1" filled="0" hide="0" thick="2"/>
</data>
</lineplot>
<!-- ================= Frame Vento ================= -->
<textbox width="200" height="100" position-x="140" position-y="600">
<text alignement="vcenter|left">
<line text="Direzione\n$Current[wind_direction,f1]\n\n" />
<line text="Velocità\n$Current[wind_speed,f1] km/h" />
<font color="FFccffff" facename="Arial" size="14" weight="600" italic="0" />
</text>
</textbox>
<!-- ================= Direzione Vento ================= -->
<frame width="110" height="110" position-x="20" position-y="595">
<background texture="Sfondo_Vento_Nero.png" stretch="1" />
<border cornerradius="0" color="FF000000" thick="0" />
</frame>
<circulargauge width="200" height="200" orientation="1" position-x="20" position-y="550" margin-top="45" margin-right="0" margin-bottom="45" margin-left="0" >
<axis color="ffccffff" min="0" max="360" titlemargin="20" titleside="bottom" fromangle="90" toangle="450">
<labels labels="N;NW;W;SW;S;SE;E;NE" labelinterval="1" side="top" hide="0">
<font color="FFffffff" facename="Arial" size="12" weight="800" italic="0" />
</labels>
<ticks majorticks="9" minorticks="3" side="bottom" hidefirst="0" hidelast="0" hideminorticks="0" hide="0" minorticksize="5" majorticksize="9"/>
</axis>
<index>
<current_wind_direction color="ffccffff" filled="1" texture="img_modern_index4_120x40.png" side="left" thick="9" axisdelta="0"/>
</index>
</circulargauge>
<!-- ================= Luna ================= -->
<frame width="100" height="100" position-x="675" position-y="600">
<background texture="$MoonImage[]" stretch="1" />
<border cornerradius="8" color="FFFFFFFF" thick="1" />
</frame>
<textbox width="200" height="100" shadow="0" position-x="490" position-y="600" margin="1" >
<text alignement="left|hcenter">
<line text="Il Sole\nsorge alle: H $SunRise[%H:%M]" />
<line text="tramonta alle: H $SunSet[%H:%M]\n" />
<line text="La Luna\nsorge alle: H $MoonRise[%H:%M]" />
<line text="tramonta alle: H $MoonSet[%H:%M]" />
<font color="ffccffff" facename="Arial" size="14" weight="600" italic="0" />
</text>
</textbox>
<!-- ================= Webcam ================= -->
<frame width="256" height="192" position-x="527" position-y="371" >
<background texture="webcam.jpg" />
<border cornerradius="8" color="FFFFFFFF" thick="1" />
</frame>
<!-- Se si usa una webcam o si mette una immagine fissa questo textbox va eliminato o può venire utilizzato per una didascalia -->
<textbox width="256" height="192" position-x="527" position-y="370" >
<text alignement="hcenter|vcenter">
<line text="AREA PER\nIMMAGINE\nWEBCAM" />
<font color="FFff0000" facename="Arial" size="24" weight="800" />
</text>
</textbox>
<!-- ================= Map ================= -->
<frame width="220" height="130" position-x="250" position-y="585" shadow="0">
<background reload-texture="300" texture="http://www.fourmilab.ch/cgi-bin/uncgi/Earth?img=learth.evif&imgsize=220&dynimg=y&opt=-p&lat=&lon=&alt=&tle=&date=0&utc=&jd" />
<border cornerradius="8" color="FFFFFFFF" thick="1" />
</frame>
</stylesheet>
Segnalibri