Page 35 of 37

Re: ClimateDataCalculation

Posted: Thu Feb 02, 2017 9:52 am
by krambriw
This is how it will look like
Skärmklipp.JPG

Re: ClimateDataCalculation

Posted: Thu Feb 02, 2017 9:56 am
by Mastiff
Nice!

Re: ClimateDataCalculation

Posted: Thu Feb 02, 2017 1:48 pm
by krambriw
You can try this one:
CreateWindRoseHtml.zip
(2.56 KiB) Downloaded 135 times
Just unzip and replace the current file

Re: ClimateDataCalculation

Posted: Thu Feb 02, 2017 1:55 pm
by Mastiff
I'm afraid not. It's empty. Can that be because I haven't updated the High Charts in a long time? Do I need a new version of those?

Re: ClimateDataCalculation

Posted: Thu Feb 02, 2017 2:04 pm
by krambriw
What is empty?

This file should be unzipped into in the "plugin/ClimateDataCalculation" folder

Then when you run the report, you need to set the path pointing into the HighChart folder wherever you have that one

I'm still using the old HighChart library, is working fine

Re: ClimateDataCalculation

Posted: Thu Feb 02, 2017 4:31 pm
by Mastiff
The result was an empty page, like before the update. I have it set to my EG webserver root, like always, where Highcharts index.html is in the same directory and the WS_Package is a subdirectory. And I get a blank page with only "EventGhost Climate Data Report Graph" and the Highcharts menu for downloading and printing. But I found out that I had an older version of the rest of the CDC package on that virtual machine, so I updated that, and now it works! Thanks! :mrgreen:

Re: ClimateDataCalculation

Posted: Fri Feb 10, 2017 11:28 am
by Mastiff
Hi again! Would it be (easily) possible to combine the wind rose and the regular wind bar graph in a single page? The wind rose shows the direction and amount, but I would like to see the variations between days as well, in the same page.

Re: ClimateDataCalculation

Posted: Fri Feb 10, 2017 5:07 pm
by Mastiff
Finally, how can I log humitidy with variables? The code in "copy with python" does of course not work correctly since it doesn't contain the actual humidity. So where should I put that here?

Code: Select all

eg.plugins.ClimateDataCalculation.HumDataCapture(RoomNameVariable, SensorNumberVariable, 5, 70, 5, False, 5, False, u'equal-less-greater')

Re: ClimateDataCalculation

Posted: Sat Feb 11, 2017 6:49 am
by krambriw
Would it be (easily) possible to combine the wind rose and the regular wind bar graph in a single page?
Just a lot of work
how can I log humitidy with variables?
You need to use the following plugin function:
eg.plugins.ClimateDataCalculation.plugin.SaveHumData(tableId, humidity, sInterval, setPoint, movAverage, useHysteresis, hysteresis, useRule, rule)

As for your example, use this syntax where humidityVariable holds the actual humidity level as an integer

Code: Select all

eg.plugins.ClimateDataCalculation.plugin.SaveHumData(RoomNameVariable, humidityVariable, 5, 70, 5, False, 5, False, u'equal-less-greater')

Re: ClimateDataCalculation

Posted: Sat Feb 11, 2017 4:28 pm
by krambriw
Just a lot of work
It was not too much work to fix, see pre-view below. New version (0.4.7) uploaded, just unzip and replace

BR Walter
Skärmklipp.JPG

Re: ClimateDataCalculation

Posted: Mon Feb 13, 2017 8:07 am
by Mastiff
Great, thanks a lot! That really looks cool! :mrgreen: Two questions:

1. I tried to change "Back to previous page" to "Tilbake til temperaturoversikten" in the reports py files, but it didn't seem to take. Is there another place I have to change it too?

2. The report is to tall for a standard HD monitor (around 1400 pixels I would think). Is there a way to adjust size of the page in the file?

Re: ClimateDataCalculation

Posted: Mon Feb 13, 2017 10:09 am
by krambriw
1. I tried to change "Back to previous page"
If you open the CreateWindRoseHtml.py file and go to line 61, you see the following section

Code: Select all

    <script src="js/highcharts-more.js"></script>
    <script src="js/modules/data.js"></script>
    <script type="text/javascript">
    function GoBack(){
        history.back();
    }
    </script>
   	</body>
    </html>
    <td><button onMouseDown="GoBack()" style="background-color:white; height:50px; width:250px">&nbsp;Back to previous page</button></td>
    <br>
This function just uses the browser history. Means you can change the text in the button as you have already but history.back will not work if empty. So, if you have a main menu page with a link to the wind rose report it will go back to the main menu page if you first click the link. If you want a more specific navigation, you have to replace history.back() with some other javascript function, i.e. you can try window.location = 'http://www.yourdomain.com'

2. The report is to tall for a standard HD monitor
Go to line 595

Code: Select all

    c_code_0_2 = """' style="min-width: 1000px; height: 350px; margin: 0 auto"></div>"""
change to

Code: Select all

    c_code_0_2 = """' style="max-width: 1000px; height: 250px; margin: 0 auto"></div>"""
Here you can play with different values to see what fits best

Re: ClimateDataCalculation

Posted: Mon Feb 13, 2017 10:12 am
by Mastiff
Thanks again! I will try that this evening! :mrgreen:

Re: ClimateDataCalculation

Posted: Mon Feb 13, 2017 11:27 am
by Mastiff
Had to try earlier... I found out that the missing change in the "Back to..." was because I needed a restart of EG. So that's fixed. :mrgreen:

But I can't se any change from using the code for the size. It is on line 594, not 595 in my CreateWindRoseHtml.py, but there are no other lines near it, so I assume that's the one?

Re: ClimateDataCalculation

Posted: Mon Feb 13, 2017 11:58 am
by krambriw
Why don't you simply edit the generated html-file and refresh it in the browser? When you have found what fits best, then make the permanent change in the py-file