Author Topic: Meteotemplate - new free website template  (Read 16366 times)

0 Members and 1 Guest are viewing this topic.

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #25 on: July 18, 2015, 08:34:12 PM »
In your HEAD section of that page try:

<style>
body{
color:#000000!important;
}
</style>

Offline tstorm

  • Contributor
  • ***
  • Posts: 141
    • Harpers Ferry Weather
Re: Meteotemplate - new free website template
« Reply #26 on: July 18, 2015, 08:51:13 PM »
Excellent!  Thanks.  There's 1 more small thing.  The title at the top "Weather Alerts for Frederick Co, MD" is still showing in blue.

http://www.harpersferry-weather.com/meteotemplate1.0/nws-alerts-details-inc.php?a=MDZ004#WA2

John

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #27 on: July 18, 2015, 09:01:21 PM »
Code: [Select]
<div style="width:630px; margin:0px auto 0px auto; border:1px solid #06C; background-color:#EFEFEF">
  <a name="WA1" id="WA1"></a>
  <table width="610px" border="0" cellspacing="0" cellpadding="0" style="margin:10px auto 14px auto">
   <tr>
    <td colspan="3" style="text-align:center; color:#06C; padding:4px 0px 2px; font-size:110%"> <img src="./alert-images/SPS.gif" width="12" height="12" alt="Air Quality Alert" title=" Air Quality Alert" />&nbsp;&nbsp;<b>AIR QUALITY ALERT</b>&nbsp;&nbsp; <img src="./alert-images/SPS.gif" width="12" height="12" alt="Air Quality Alert" title=" Air Quality Alert" /></td>
   </tr>
....


replace with
Code: [Select]
<div style="width:630px; margin:0px auto 0px auto; border:1px solid #06C; background-color:#EFEFEF">
  <a name="WA1" id="WA1"></a>
  <table width="610px" border="0" cellspacing="0" cellpadding="0" style="margin:10px auto 14px auto">
   <tr>
    <td colspan="3" style="text-align:center; color:inherit; padding:4px 0px 2px; font-size:110%"> <img src="./alert-images/SPS.gif" width="12" height="12" alt="Air Quality Alert" title=" Air Quality Alert" />&nbsp;&nbsp;<b>AIR QUALITY ALERT</b>&nbsp;&nbsp; <img src="./alert-images/SPS.gif" width="12" height="12" alt="Air Quality Alert" title=" Air Quality Alert" /></td>
   </tr>

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 255
    • Sanford Weather
Re: Meteotemplate - new free website template
« Reply #28 on: July 19, 2015, 11:05:10 AM »
Hi,

makes sense. In that case my first idea is this:

Import:
I would probably make a script that will take all files from a given folder and insert their values into the db. So you would then move all your daily logs into that folder and it would go one by one.

Update:
I looked at the saratoga and I guess I would prefer if it was possible to have this as a txt file with just the current conditions. In other words, a text file that would contain the latest temp, humidity, pressure, solar, rain, wind, gust etc. plus date/time.
Then you would set up your CRON and this script would be executed at the specified CRON interval and always take these values, check them and if they are ok, save them into db. If this was not possible then I guess it could also work if the current daily log was available on the server, it would then simply take the latest value, but I would rather use the first method.

Give me a couple days to play with it and I'll see about generating a txt file with just the current conditions. Off the top of my head I don't see a problem but you never know until you try.

Jachym,

The attached is the closest I can get to the required data, I just took your docs on the structure of the database and inserted the wview values to see what form they are in, not intended as the update file.  Date is the only one that doesn't match but I hope the import script can take care of any reformatting necessary.

I expect you'd want the final version of the update file to be something like the format you show in the csv upload method, ie

Date Time;T;Tmax;Tmin;H;D;W;G;B;RR;R;P;S;A

Bill

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #29 on: July 19, 2015, 11:43:43 AM »
Hi Bill, 
So can you attach one of the text files generated by the software,  the exact txt that would regularly be uploaded to the server

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 255
    • Sanford Weather
Re: Meteotemplate - new free website template
« Reply #30 on: July 19, 2015, 12:12:12 PM »
Hi Bill, 
So can you attach one of the text files generated by the software,  the exact txt that would regularly be uploaded to the server

Sorry for the delay but I had not yet built that file, but have now
Here are the source file so you can see what parameters are in what order and the output!

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #31 on: July 19, 2015, 12:22:30 PM »
Thanks this looks good I will look at it later today and ideally make the scripts

Offline virusdunil

  • Forecaster
  • *****
  • Posts: 388
    • Station Meteo Hebertville
Re: Meteotemplate - new free website template
« Reply #32 on: July 19, 2015, 12:28:12 PM »
A quick word to say that im doing a french translation for the template ;)

Je sui a faire la traduction pour les utilisateurs francais  ;)
Cabled Vantage pro2 + Solar / Stevensen screen
Weather Display latest version + Boltek PCI-NexStorm-StormVue NGX / NSDisplay


http://www.meteolacstjean.com/weather28/index.php
Meteotemplate : http://www.meteolacstjean.com/hebert/index.php

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #33 on: July 19, 2015, 12:52:39 PM »
A quick word to say that im doing a french translation for the template ;)

Je sui a faire la traduction pour les utilisateurs francais  ;)
Trčs bien Carl,  merci  8-)

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #34 on: July 19, 2015, 05:03:53 PM »
Hi Bill, 
So can you attach one of the text files generated by the software,  the exact txt that would regularly be uploaded to the server

Sorry for the delay but I had not yet built that file, but have now
Here are the source file so you can see what parameters are in what order and the output!

Bill (or anyone using WView), I have a couple more questions:

1. the units in the text file you generated, are these fixed in WView or are they chosen by the user (for example in Cumulus the user must set the units of this file in the template settings, whereas in WD, the clientraw.txt uses standardized units which are always deg C, knots etc.), so I need to know this in order to properly set up the settings for the update

2. Does VWIev take into account user local settings? The problem with Cumulus for example is that it does, so it sometimes uses "," for decimals, whereas at other times "." and also for the date it uses "/" or "-" (the date I guess is not an issue in this case)

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 255
    • Sanford Weather
Re: Meteotemplate - new free website template
« Reply #35 on: July 19, 2015, 06:50:27 PM »
Hi Bill, 
So can you attach one of the text files generated by the software,  the exact txt that would regularly be uploaded to the server

Sorry for the delay but I had not yet built that file, but have now
Here are the source file so you can see what parameters are in what order and the output!

Bill (or anyone using WView), I have a couple more questions:

1. the units in the text file you generated, are these fixed in WView or are they chosen by the user (for example in Cumulus the user must set the units of this file in the template settings, whereas in WD, the clientraw.txt uses standardized units which are always deg C, knots etc.), so I need to know this in order to properly set up the settings for the update

2. Does VWIev take into account user local settings? The problem with Cumulus for example is that it does, so it sometimes uses "," for decimals, whereas at other times "." and also for the date it uses "/" or "-" (the date I guess is not an issue in this case)

Jachym,

The wview database appears to use imperial units internally so the setting must be defined in the template, I set it up so long ago I forget :grin:
The txt file I sent you could be modified to have the units added to each of the values, if that would help any?

There are two date parameter I could have used one is called stationdateMETRIC and is the one I used, the other is just stationdate and in my case it's comes out as mm/dd/yyyy

Not sure about the comma vrs dot, I'll have to do some more digging!

Bill



Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #36 on: July 19, 2015, 07:30:02 PM »
Hi,
ok, so I made a script that should work, based on the file you sent me. I tested it on my PC and it updated the database. I guess the best thing to do now would be if you could download the template files, set up config.php etc. and I would then send you this script and you could test it.

And then we can start testing and dealing with the importing of daily logs, that would be a separate script anyway. But for now, the script needs the rest of the files and also the MySQL created etc.

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 255
    • Sanford Weather
Re: Meteotemplate - new free website template
« Reply #37 on: July 19, 2015, 07:39:43 PM »
Hi,
ok, so I made a script that should work, based on the file you sent me. I tested it on my PC and it updated the database. I guess the best thing to do now would be if you could download the template files, set up config.php etc. and I would then send you this script and you could test it.

And then we can start testing and dealing with the importing of daily logs, that would be a separate script anyway. But for now, the script needs the rest of the files and also the MySQL created etc.

Great!

Just about to sit down for supper but preliminary edit of config.php is done and all files uploaded, MySQL created, of course no data yet! 

http://www.sanfordweather.com/meteo/

I looked through the config stuff for wview and can not find any reference to using comma vrs dot for separation of fractional units.

Bill

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #38 on: July 19, 2015, 08:20:58 PM »
OK no problem, everything looks ok, so tomorrow I will send you the scripts to test :-)

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate - new free website template
« Reply #39 on: July 20, 2015, 06:12:04 AM »
    Hi Bill,

    got the first script ready, the one for updating database with current conditions. Obviously there is no documentation in the wiki so far, but I am sure you will be able to set it up. In fact you can just follow the instructions for updates with WD, just that the structure of the txt file is different, but that does not have to concern you as a user.

    So, the prerequisite is you have the template uploaded (which you obviously have :-) and that you already performed the first step of creating the mysql table (as described in the wiki) and therefore also have properly set up MySQL in the config.php.

    What you need to do now is this:
    • make sure that your current conditions txt file (whatever it is called) is being uploaded to the server at regular intervals (ideally every minute)
    • download the attached wview script and open it in a text editor. Now you must specify the path to the current conditions text file. This means you must specify the name of it (careful about upper/lower case, it matters) and the relative/absolute path to it on your server, to make sure the script finds it
  • on line 39 is where you specify this path
[/list]
Code: [Select]
$path = "UpdateMeteo.txt";
    [/li]
  • I then suggest you leave the parameter interval to what it is (5*60), you can read more about what this actually means in the wiki, this again is the same as for WD or Cumulus
  • now you can save, close and upload this file to the server into the update folder of the template
  • last, but very important thing you must do, is set the correct units. This is done in the config.php and you are now interested in the set of units that are related to the DB (they start with "data", the other set beginning with "display" is for the units used for displaying the data, but you are now interested in setting up units for the db. So here, you must make sure that the units specified correspond to the units in which the data are provided in the current conditions text file. These will then obviously also be the units in which your data will be saved in db (but the user can then choose what units they want to see). And, also make sure you specify the limits accordingly - this is again all described in the wiki, in summary, you have to set limits which will prevent spikes and non-sense data. But this again depends on the units you use. For example, if your pressure is in inHg, you would probably set your limits to something like from 25 to 35 etc. Whereas if they are in hPa, you would put something like 960 to 1060 etc. This is important because values outside this interval are then ignored. Save and update config.php on the server.
  • if all the above is done then the last thing you need to do is set up the cron. This is described in the wiki, there are links and instructions how to do it if you are not familiar. Basically you have to set up CRON updates to update the wview.php file, ideally in 1 minute interval - which is also the interval at which the real time conditions txt file is being updated. And, make sure you include the password as described in the wiki, so your cron will then look like something like this: ...../wview.php?pass=12345 . The pass corresponds to the password you specify in the config.php.

I hope it makes sense and let me know if it works. It should now update your database every 5 minutes using averages and aggregated data from 1 minute intervals.

EDIT: Just realized you cant upload PHP files here, so I changed the extension, simply change it back to php once you download it.
« Last Edit: July 20, 2015, 06:13:38 AM by Jachym »

Offline KapitainOne

  • Senior Contributor
  • ****
  • Posts: 255
    • Sanford Weather
Re: Meteotemplate - new free website template
« Reply #40 on: July 20, 2015, 11:09:15 PM »
      Hi Bill,

      got the first script ready, the one for updating database with current conditions. Obviously there is no documentation in the wiki so far, but I am sure you will be able to set it up. In fact you can just follow the instructions for updates with WD, just that the structure of the txt file is different, but that does not have to concern you as a user.

      So, the prerequisite is you have the template uploaded (which you obviously have :-) and that you already performed the first step of creating the mysql table (as described in the wiki) and therefore also have properly set up MySQL in the config.php.

      What you need to do now is this:
      • make sure that your current conditions txt file (whatever it is called) is being uploaded to the server at regular intervals (ideally every minute)
      • download the attached wview script and open it in a text editor. Now you must specify the path to the current conditions text file. This means you must specify the name of it (careful about upper/lower case, it matters) and the relative/absolute path to it on your server, to make sure the script finds it
    • on line 39 is where you specify this path
    [/list]
    Code: [Select]
    $path = "UpdateMeteo.txt";
      [/li]
      [li]I then suggest you leave the parameter interval to what it is (5*60), you can read more about what this actually means in the wiki, this again is the same as for WD or Cumulus[/li]
    • now you can save, close and upload this file to the server into the update folder of the template
    • last, but very important thing you must do, is set the correct units. This is done in the config.php and you are now interested in the set of units that are related to the DB (they start with "data", the other set beginning with "display" is for the units used for displaying the data, but you are now interested in setting up units for the db. So here, you must make sure that the units specified correspond to the units in which the data are provided in the current conditions text file. These will then obviously also be the units in which your data will be saved in db (but the user can then choose what units they want to see). And, also make sure you specify the limits accordingly - this is again all described in the wiki, in summary, you have to set limits which will prevent spikes and non-sense data. But this again depends on the units you use. For example, if your pressure is in inHg, you would probably set your limits to something like from 25 to 35 etc. Whereas if they are in hPa, you would put something like 960 to 1060 etc. This is important because values outside this interval are then ignored. Save and update config.php on the server.
    • if all the above is done then the last thing you need to do is set up the cron. This is described in the wiki, there are links and instructions how to do it if you are not familiar. Basically you have to set up CRON updates to update the wview.php file, ideally in 1 minute interval - which is also the interval at which the real time conditions txt file is being updated. And, make sure you include the password as described in the wiki, so your cron will then look like something like this: ...../wview.php?pass=12345 . The pass corresponds to the password you specify in the config.php.

    I hope it makes sense and let me know if it works. It should now update your database every 5 minutes using averages and aggregated data from 1 minute intervals.

    EDIT: Just realized you cant upload PHP files here, so I changed the extension, simply change it back to php once you download it.

    Good evening Jachym

    Got it running finally, first attempt was too early this morning while half asleep and while in a hurry but it is now working.

    Note that wview can only update every 5 minutes, changing that is beyond my limited capabilities, need to get into the C code to do so :sad:

    I've the cron job running every 2 minutes and things look OK

    Bill

    Offline virusdunil

    • Forecaster
    • *****
    • Posts: 388
      • Station Meteo Hebertville
    Re: Meteotemplate - new free website template
    « Reply #41 on: July 20, 2015, 11:25:20 PM »
    Another happy user  =D&gt;
    Cabled Vantage pro2 + Solar / Stevensen screen
    Weather Display latest version + Boltek PCI-NexStorm-StormVue NGX / NSDisplay


    http://www.meteolacstjean.com/weather28/index.php
    Meteotemplate : http://www.meteolacstjean.com/hebert/index.php

    Offline Jáchym

    • Meteotemplate Developer
    • Forecaster
    • *****
    • Posts: 8605
      • Meteotemplate
    Re: Meteotemplate - new free website template
    « Reply #42 on: July 21, 2015, 05:36:10 AM »
        Hi Bill,

        got the first script ready, the one for updating database with current conditions. Obviously there is no documentation in the wiki so far, but I am sure you will be able to set it up. In fact you can just follow the instructions for updates with WD, just that the structure of the txt file is different, but that does not have to concern you as a user.

        So, the prerequisite is you have the template uploaded (which you obviously have :-) and that you already performed the first step of creating the mysql table (as described in the wiki) and therefore also have properly set up MySQL in the config.php.

        What you need to do now is this:
        • make sure that your current conditions txt file (whatever it is called) is being uploaded to the server at regular intervals (ideally every minute)
        • download the attached wview script and open it in a text editor. Now you must specify the path to the current conditions text file. This means you must specify the name of it (careful about upper/lower case, it matters) and the relative/absolute path to it on your server, to make sure the script finds it
      • on line 39 is where you specify this path
      [/list]
      Code: [Select]
      $path = "UpdateMeteo.txt";
        [/li]
        [li]I then suggest you leave the parameter interval to what it is (5*60), you can read more about what this actually means in the wiki, this again is the same as for WD or Cumulus[/li]
      • now you can save, close and upload this file to the server into the update folder of the template
      • last, but very important thing you must do, is set the correct units. This is done in the config.php and you are now interested in the set of units that are related to the DB (they start with "data", the other set beginning with "display" is for the units used for displaying the data, but you are now interested in setting up units for the db. So here, you must make sure that the units specified correspond to the units in which the data are provided in the current conditions text file. These will then obviously also be the units in which your data will be saved in db (but the user can then choose what units they want to see). And, also make sure you specify the limits accordingly - this is again all described in the wiki, in summary, you have to set limits which will prevent spikes and non-sense data. But this again depends on the units you use. For example, if your pressure is in inHg, you would probably set your limits to something like from 25 to 35 etc. Whereas if they are in hPa, you would put something like 960 to 1060 etc. This is important because values outside this interval are then ignored. Save and update config.php on the server.
      • if all the above is done then the last thing you need to do is set up the cron. This is described in the wiki, there are links and instructions how to do it if you are not familiar. Basically you have to set up CRON updates to update the wview.php file, ideally in 1 minute interval - which is also the interval at which the real time conditions txt file is being updated. And, make sure you include the password as described in the wiki, so your cron will then look like something like this: ...../wview.php?pass=12345 . The pass corresponds to the password you specify in the config.php.

      I hope it makes sense and let me know if it works. It should now update your database every 5 minutes using averages and aggregated data from 1 minute intervals.

      EDIT: Just realized you cant upload PHP files here, so I changed the extension, simply change it back to php once you download it.

      Good evening Jachym

      Got it running finally, first attempt was too early this morning while half asleep and while in a hurry but it is now working.

      Note that wview can only update every 5 minutes, changing that is beyond my limited capabilities, need to get into the C code to do so :sad:

      I've the cron job running every 2 minutes and things look OK

      Bill

      Hi, sounds great. If your txt file with current conditions can only be updated once every 5 minutes, then that is not a problem at all.

      Wim sent me all the possible units so I will add that as a parameter there for the user to set (in your case I knew which ones you are using, but I have to add this so that it is universally usable) and then I will also play around with the possible date/time formats.

      I will then send you a new copy, which will contain this settings and it should do the same thing, just to make sure.

      The next part will then be creating a script for importing the daily logs. That will be slightly more difficult, so if you could maybe attach more than one, just so that I can check the format and also I would like to know, if this is the same case as with the current conditoins text - ie. the units within these daily logs can differ or if they are fixed and always the same.

      Offline tstorm

      • Contributor
      • ***
      • Posts: 141
        • Harpers Ferry Weather
      Re: Meteotemplate - new free website template
      « Reply #43 on: July 21, 2015, 08:48:44 AM »
      Hi Jachym,

        When you have a chance if you could add the capability of a banner to the template that would be great. I've tried several times without luck.  http://www.harpersferry-weather.com/meteotemplate1.0/banner_orig.php


      Thanks,

      John
      « Last Edit: July 21, 2015, 08:59:34 AM by tstorm »

      Offline KapitainOne

      • Senior Contributor
      • ****
      • Posts: 255
        • Sanford Weather
      Re: Meteotemplate - new free website template
      « Reply #44 on: July 21, 2015, 09:01:46 AM »
      Jachym

      Here's the last 7 days worth of archive data, and yes I do believe the units will change based on what the operator selected on install.

      Bill

      And I see from looking over these files that I may be starting to have a problem with my wind direction sensor!

      Offline Jáchym

      • Meteotemplate Developer
      • Forecaster
      • *****
      • Posts: 8605
        • Meteotemplate
      Re: Meteotemplate - new free website template
      « Reply #45 on: July 21, 2015, 09:07:58 AM »
      Hi Jachym,

        When you have a chance if you could add the capability of a banner to the template that would be great. I've tried several times without luck.  http://www.harpersferry-weather.com/meteotemplate1.0/banner_orig.php


      Thanks,

      John

      Hi John,
      yes, you are now the fourth person who asked for this :D Replacing the current top banner with my interactive banner. And in fact I had this planned even before I was asked by the first person. It will definately be available in the near future as an optional setting (use standard banner (current) / interactive banner).
      The only thing is I cant tell right now when this will be available, currently it will be slightly slower in terms of new features etc. because I now give priority to helping people setting it up. I have not yet started working on this so I cant tell how difficult it will be, but I dont assume it to be that bad, so my guess is maybe 1-2 weeks :-)

      Quote
      Here's the last 7 days worth of archive data, and yes I do believe the units will change based on what the operator selected on install.

      Bill

      Hi Bill, thanks, will have a look at it.

      Offline Jáchym

      • Meteotemplate Developer
      • Forecaster
      • *****
      • Posts: 8605
        • Meteotemplate
      Re: Meteotemplate - new free website template
      « Reply #46 on: July 21, 2015, 09:27:57 AM »
      OK,
      Bill, I looked at the files and it looks usable (the non-sense negative values dont matter, if you set your limits in the config.php it will ignore them), all the parameters I need are there except one and I have one more question.

      So my template uses:
      temp, humidity, pressure, wind, gust, bearing, rain, rain rate, solar (optional)

      Everything seems to be in the files except rainrate. My idea is that I could create a function, which would look at the previous value, subtract and calculate the difference and then do the same for the time between those intervals and then, divide this, so you would have difference in precipitation / time and then convert this to XY / h.

      And with regards to the gust, am I right in assuming that WIND is windspeed avg and HIwind is the gust? Also the Rain I assume is what I need, which means daily cumulative precipitation.

      Offline KapitainOne

      • Senior Contributor
      • ****
      • Posts: 255
        • Sanford Weather
      Re: Meteotemplate - new free website template
      « Reply #47 on: July 21, 2015, 09:49:10 AM »
      OK,
      Bill, I looked at the files and it looks usable (the non-sense negative values dont matter, if you set your limits in the config.php it will ignore them), all the parameters I need are there except one and I have one more question.

      So my template uses:
      temp, humidity, pressure, wind, gust, bearing, rain, rain rate, solar (optional)

      Everything seems to be in the files except rainrate. My idea is that I could create a function, which would look at the previous value, subtract and calculate the difference and then do the same for the time between those intervals and then, divide this, so you would have difference in precipitation / time and then convert this to XY / h.

      And with regards to the gust, am I right in assuming that WIND is windspeed avg and HIwind is the gust? Also the Rain I assume is what I need, which means daily cumulative precipitation.

      As far as your assumptions on wind and hiwind, you are correct. The rain amount I think is how much in that sample period. I'll go and find a file from when we had a bunch of rain! The file attached is from a day we had 42mm of rain late in the day. Looking at the file it does look like it shows the amount in the since the last sample.

      It's a shame that rainrate isn't in those files ad I do believe it is in the wview database.

      Offline Jáchym

      • Meteotemplate Developer
      • Forecaster
      • *****
      • Posts: 8605
        • Meteotemplate
      Re: Meteotemplate - new free website template
      « Reply #48 on: July 21, 2015, 10:03:23 AM »
      Hi,
      ok, so it is going to be slightly more complicated. The rain is not daily cumulative value, but rather the actual rainrate. Which means, I will have to take that number and use that as the amount of rain since last record - convert that and use as rainrate. Then for the actual Rain, it will have to iterate through all rain values from that file and calculate the sum. So nothing impossible, just slightly more coding necessary.

      Offline Jáchym

      • Meteotemplate Developer
      • Forecaster
      • *****
      • Posts: 8605
        • Meteotemplate
      Re: Meteotemplate - new free website template
      « Reply #49 on: July 21, 2015, 11:01:13 AM »
      So, Bill, lets take it step by step :D

      First lets try import of just one file - i.e. one daily log.
      I created all the necessary scripts, it should be as easy as 123.

      Assumption:
      alldata table created, all template files uploaded, config.php properly set up (mysql)-

      In your config.php also make sure that:
      - parameters for units that start with "data"  are set to the units used in the daily logs (the ones starting with "display" are used for the webpage, you can ignore those for now)
      - limits for parameters are set properly

      Then, upload the three files I attached and then, in your browser, simply open the WViewImport.html and follow the instructions.

      The only thing that will change in the future - as I said, this is just importing one file, so upload some random daily log (ideally one that has some rain to check it works) and upload that file into the same directory as these scripts (the install directory). Then, for the path, use the "name.txt" of this log file.

      The next step will then be specifying just a folder within the install directory, from which it will import all daily logs in bulk, but that will be the next step, first we have to make sure the imports work as such.

      If you read the instructions on that page it will ask you to specify column numbers etc. I suggest you go through it and try the link as well, even though you in particular dont really need to set it up because I set the default values based on your file and so they correspond.

      Last thing to do is enter your password, the on you specified in config.php (it is 12345 by default if you havent changed this).

      Then click Import and.... and lets pray that when you then check your alldata table, the values should be there...

      Let me know how it goes, it was relatively lot of changes I had to make, I modified the Cumulus import, but I had to make changes with regards to datetime formatting, the format of the file, automatic cumulative rain calculation etc, so it is possible it will not be working, but thats ok, I would fix this and Im sure we will eventually get it working.

      EDIT:
      SORRY THERE IS A MISTAKE IN THE FILES. IN THE WVIEW.PHP REPLACE THE "alldataTest" with "alldata" - THIS WAS JUST FOR TESTING PURPOSES AND I FORGOT TO CHANGE IT. IT IS THERE TWICE.