wviewweather.com Forum Index wviewweather.com
wview and Weather Topics
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

new MM chart wrong?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    wviewweather.com Forum Index -> Troubleshooting
View previous topic :: View next topic  
Author Message
chrisale



Joined: 09 Nov 2005
Posts: 187

PostPosted: Sat Jan 28, 2006 3:52 pm    Post subject: new MM chart wrong? Reply with quote

Hopefully I'm just missing something.

But in 3.1 everything looks to be working awesome for the MM values for all the rain tags.

BUT, the charts are all showing cm values on the Y axis still and the dials are all acting as if it's CM....

bummer! Sad

were the charts not updated?

http://www.alberniweather.ca
Back to top
View user's profile Send private message MSN Messenger
chrisale



Joined: 09 Nov 2005
Posts: 187

PostPosted: Sat Jan 28, 2006 10:25 pm    Post subject: Reply with quote

OK.

I see that the there were no new dial values added to htmlgenerate.c ... but there *has* been a new if statement catching the metricMM condition.

Perhaps if others could test for this working in CM and Inches conditions we could roll this into a new release?

Soooo... since I've taken the changes I've used before and added them in again, but slightly modified so that they do not disturb the original code when using CM.

first I added the new dial ticks.

Code:

static char *netrainLabels0C[12] =
{
    "-3.0", "-2.5", "-2.0", "-1.5", "-1.0", "-0.5", "0", "0.5", "1.0", "1.5", "2.0", "2.5"
};
static char *netrainLabels0F[12] =
{
    "-1.2", "-1.0", "-0.8", "-0.6", "-0.4", "-0.2", "0", "0.2", "0.4", "0.6", "0.8", "1.0"
};
static char *netrainLabels1C[12] =
{
    "-30 ", "-25 ", "-20 ", "-15 ", "-10 ", "-5  ", "0", "  5", " 10", " 15", " 20", " 25"
};
static char *netrainLabels1F[12] =
{
    "-12 ", "-10 ", "-8  ", "-6  ", "-4  ", "-2  ", "0", "  2", "  4", "  6", "  8", " 10"
};
static char *netrainLabels2C[12] =
{
    "-60 ", "-50 ", "-40 ", "-30 ", "-20 ", "-10 ", "0", " 10", " 20", " 30", " 40", " 50"
};
static char *netrainLabels2F[12] =
{
    "-24 ", "-20 ", "-16 ", "-12 ", "-8  ", "-4  ", "0", "  4", "  8", " 12", " 16", " 20"
};
static char *netrainLabels3C[12] =
{
    "-300", "-250", "-200", "-150", "-100", "-50 ", "0", " 50", "100", "150", "200", "250"
};
static char *netrainLabels3F[12] =
{
    "-120", "-100", "-80 ", "-60 ", "-40 ", "-20 ", "0", " 20", " 40", " 60", " 80", "100"
};

///ADDING CUSTOM LABELS///

static char *netrainLabels4C[12] =
{
    "-5 ", "0 ", "5 ", "10 ", "15 ", "20 ", "25", " 30", " 35", " 40", " 45", " 50"
};

static char *netrainLabels4F[12] =
{
    "-10", "0 ", "10 ", "20 ", "30 ", "40 ", "50", " 60", " 70", " 80", " 90", " 100"
};

static char *netrainLabels5C[12] =
{
    "-20", "0 ", "20 ", "40 ", "60 ", "80 ", "100", " 120", " 140", " 160", " 180", " 200"
};

static char *netrainLabels5F[12] =
{
    "-50", "0 ", "50 ", "100", "150", "200", "250", "300", "350", "400", "450", "500"
};

static char *netrainLabels6C[12] =
{
    "-100", "0 ", "100 ", "200", "300", "400", "500", "600", "700", "800", "900", "1000"
};

static char *netrainLabels6F[12] =
{
    "-150", "0 ", "150 ", "300", "450", "600", "750", "900", "1050", "1200", "1350", "1500"
};


I then added in the conditions for the large MM values in the if statement for the metricMM condition (had to add some curly {} of course). I then made sure the following else for the CM had curly {} as well to keep that in it's place.

Here is the entire section of code for the dial conditions including MM, CM, and (not-modified) Inches.

Code:
 if (isMetricUnits)
    {
        if (isMetricRainMM)
        {
            rain = wvutilsConvertRainInchesToMillimeters (rain);
           
            if (rain <= 50)
           {
                 baserain = 5;     // - minimum rain // Amount + rainfall to get 0
               mult = 6;          // degrees per cm // 330 degrees / 0 -> pegged
               for (i = 0; i < 12; i ++)
               {
                   labels[i] = netrainLabels4C[i];
               }
           }
       
        else if (rain <= 100)
           {
               baserain = 10;     // - minimum rain // Amount + rainfall to get 0
               mult = 3;          // degrees per cm // 330 degrees / 0 -> pegged
               for (i = 0; i < 12; i ++)
               {
                   labels[i] = netrainLabels4F[i];
               }
           }
       
         else if (rain <= 200)
           {
               baserain = 20;     // - minimum rain // Amount + rainfall to get 0
               mult = 1.5;          // degrees per cm
               for (i = 0; i < 12; i ++)
               {
                   labels[i] = netrainLabels5C[i];
                 }
           }
       
        else if (rain <= 500)
           {
               baserain = 50;     // - minimum rain // Amount + rainfall to get 0
               mult = 0.6;          // degrees per cm
               for (i = 0; i < 12; i ++)
               {
                   labels[i] = netrainLabels5F[i];
               }
           }
       
        else if (rain <= 1000)
           {
               baserain = 100;     // - minimum rain // Amount + rainfall to get 0
               mult = 0.3;          // degrees per cm
               for (i = 0; i < 12; i ++)
               {
                   labels[i] = netrainLabels6C[i];
               }
           }
       
        else
           {
              baserain = 150;     // - minimum rain // Amount + rainfall to get 0
               mult = 0.15;          // degrees per cm
               for (i = 0; i < 12; i ++)
               {
                   labels[i] = netrainLabels6F[i];
               }
           }
        }
        else
        {
            rain = wvutilsConvertRainInchesToCentimeters (rain);
       
        if (-2.5 <= minval && maxval <= 2.5)
        {
            baserain = 3;      // - minimum rain
            mult = 60;         // degrees per cm
            for (i = 0; i < 12; i ++)
            {
                labels[i] = netrainLabels0C[i];
            }
        }
        else if (-25 <= minval && maxval <= 25)
        {
            baserain = 30;     // - minimum rain
            mult = 6;          // degrees per cm
            for (i = 0; i < 12; i ++)
            {
                labels[i] = netrainLabels1C[i];
            }
        }
        else if (-50 <= minval && maxval <= 50)
        {
            baserain = 60;     // - minimum rain
            mult = 3;          // degrees per cm
            for (i = 0; i < 12; i ++)
            {
                labels[i] = netrainLabels2C[i];
            }
        }
        else
        {
            baserain = 300;    // - minimum rain
            mult = 0.6;        // degrees per cm
            for (i = 0; i < 12; i ++)
            {
                labels[i] = netrainLabels3C[i];
            }
        }
       
        }
    }
    else
    {
        if (-1 <= minval && maxval <= 1)
        {
            baserain = 1.2;    // - minimum rain
            mult = 150;        // degrees per inch
            for (i = 0; i < 12; i ++)
            {
                labels[i] = netrainLabels0F[i];
            }
        }
        else if (-10 <= minval && maxval <= 10)
        {
            baserain = 12;     // - minimum rain
            mult = 15;         // degrees per inch
            for (i = 0; i < 12; i ++)
            {
                labels[i] = netrainLabels1F[i];
            }
        }
        else if (-20 <= minval && maxval <= 20)
        {
            baserain = 24;     // - minimum rain
            mult = 7.5;        // degrees per inch
            for (i = 0; i < 12; i ++)
            {
                labels[i] = netrainLabels2F[i];
            }
        }
        else
        {
            baserain = 120;    // - minimum rain
            mult = 1.5;        // degrees per inch
            for (i = 0; i < 12; i ++)
            {
                labels[i] = netrainLabels3F[i];
            }
        }
    }
Back to top
View user's profile Send private message MSN Messenger
chrisale



Joined: 09 Nov 2005
Posts: 187

PostPosted: Sat Jan 28, 2006 10:43 pm    Post subject: Reply with quote

I'm still puzzled as to why the daily/monthly/yearly rain charts aren't in MM... even though they look like they're *expected* to be in MM...

I just checked the rain bucket images as well, and they're incorrect when on the MM setting too. They show MM units, but are still using CM values.
Back to top
View user's profile Send private message MSN Messenger
bodemory



Joined: 06 Dec 2005
Posts: 43

PostPosted: Sun Jan 29, 2006 3:52 am    Post subject: Reply with quote

Indeed, same problem here...
Back to top
View user's profile Send private message Visit poster's website
mteel



Joined: 30 Jun 2005
Posts: 435
Location: Collinsville, TX

PostPosted: Thu Feb 02, 2006 5:13 pm    Post subject: Reply with quote

First, note that I did not do the initial mm changes, I just integrated a volunteer's changes while I was in the middle of getting a new station interface running. So I did not pay much attention to this (it is still silly and low priority in my mind as well).

I will try to get a stable release built with the mm changes tonight. But it will be up to one of the mm people to test it.

FYI, I plan to soon change all of the rain dials so they are zero-based if there is no ET support on the station.

If there are other issues with mm besides the rain dials, please list them in full and I will try to silence this madness.

Mark


Last edited by mteel on Thu Feb 02, 2006 10:31 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mteel



Joined: 30 Jun 2005
Posts: 435
Location: Collinsville, TX

PostPosted: Thu Feb 02, 2006 10:29 pm    Post subject: Reply with quote

3.1.2p4 is available at "Latest Stable" and it includes the mm additions for the rain dials as well as 0-based rain dials if there is no ET measurement.

Mark
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chrisale



Joined: 09 Nov 2005
Posts: 187

PostPosted: Thu Feb 02, 2006 10:53 pm    Post subject: Reply with quote

thank you for doing this Mark. one day maybe you'll see the reasoning behind the mm-madness Wink
Back to top
View user's profile Send private message MSN Messenger
bodemory



Joined: 06 Dec 2005
Posts: 43

PostPosted: Fri Feb 03, 2006 3:42 am    Post subject: Reply with quote

Just tested the latest stable (312p4).
Still the same problem with rain charts (cm/mm) otherwise, it's ok.
Back to top
View user's profile Send private message Visit poster's website
mteel



Joined: 30 Jun 2005
Posts: 435
Location: Collinsville, TX

PostPosted: Fri Feb 03, 2006 8:38 am    Post subject: Reply with quote

Well I hadn't addressed the charts or buckets yet - now I have.

Please try the Latest Stable (3.1.2p6) and let me know if there are any other mm issues with anything.

Thanks,
Mark
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bodemory



Joined: 06 Dec 2005
Posts: 43

PostPosted: Fri Feb 03, 2006 9:32 am    Post subject: Reply with quote

Unfortunately it doesn't work, please see :
http://ofxb.ch/img/index.html

It's weird, because once pre 3.1.0 version has been installed, mm charts
were OK. Then it suddenly returned to cm instead of mm (on the same version).

Thanks
Back to top
View user's profile Send private message Visit poster's website
mteel



Joined: 30 Jun 2005
Posts: 435
Location: Collinsville, TX

PostPosted: Fri Feb 03, 2006 9:37 am    Post subject: Reply with quote

There was no mm support prior to 3.1.0, so I am confused by your statement.

Also, I see no evidence it is not working on your site - what should I be looking for? The yearly rain total of 10.7 mm compares favorably with the 28-day rain chart...

Mark
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bodemory



Joined: 06 Dec 2005
Posts: 43

PostPosted: Fri Feb 03, 2006 9:54 am    Post subject: Reply with quote

I was meaning 310p versions. It went fine for sometime, then I had the same problem leading to this thread.
Actually you're right for the 28days graphs but the today's one displays
cm on the Y axis and it shouldn't (correct for other graphs).

Thanks
Back to top
View user's profile Send private message Visit poster's website
mteel



Joined: 30 Jun 2005
Posts: 435
Location: Collinsville, TX

PostPosted: Fri Feb 03, 2006 9:59 am    Post subject: Reply with quote

Because the y-axis values are 0.1, 0.2, etc? That would be the case with cm or mm graphs with no non-zero data - that is the default rain range for metric charts.
It says "Rain/hr mm" and I guarantee you it is mm if you have the mm config parm set...

What else do you think is wrong?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bodemory



Joined: 06 Dec 2005
Posts: 43

PostPosted: Fri Feb 03, 2006 10:12 am    Post subject: Reply with quote

Ok I was just puzzled by the y axis scale
Everything's fine.

Thanks for your work, and have some rest Smile
Back to top
View user's profile Send private message Visit poster's website
chrisale



Joined: 09 Nov 2005
Posts: 187

PostPosted: Fri Feb 03, 2006 10:28 pm    Post subject: Reply with quote

Ummm...

Everything is still not quite right here...

charts are still showing CM values...
dials are now starting at 0 (which is great!) but my year dial only goes up to 40... the rain value is 700mm+

www.alberniweather.ca

I see you've made a lot of changes to the code for the dials...
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    wviewweather.com Forum Index -> Troubleshooting All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group