-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from cdesouza71/monthly_adjust_per_station
Monthly adjust per station
- Loading branch information
Showing
6 changed files
with
396 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Monthly Adjust per Station Plugin | ||
|
||
Alter the amount of water the station delivers by adjusting the | ||
watering time. This plugin allows a more fine grained level of control | ||
than the water level setting on the home page. | ||
|
||
The plugin will only have an effect on schedules started by programs | ||
triggered automatically and will ignore schedules started with RUN | ||
NOW. | ||
|
||
Adjustment levels can be entered per station per month to indicate | ||
the % adjustment to be applied to the watering time. | ||
|
||
If no value is entered for the station/month the value set in "Default | ||
Adjustment" is used. If the "Default Adjustment" is not set then the | ||
plugin will take no action for the station/month. | ||
|
||
Limitations: | ||
- The plugin does not currently respect the option "Ignore Plugin adjustments". |
31 changes: 31 additions & 0 deletions
31
monthly_adjust_per_station/monthly_adjust_per_station-docs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE HTML> | ||
<!-- Auto genwerated using markdown2 README.md --extras tables > monthly_adjust_per_station-docs.html --> | ||
<html> | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset="utf-8"> | ||
<title>Monthly Adjust per Station Docs</TITLE> | ||
</head> | ||
<body lang="en-us" bgcolor="#ffffff" dir="LTR" style="border: none; padding: 0in"> | ||
<h1>Monthly Adjust per Station Plugin</h1> | ||
|
||
<p>Alter the amount of water the station delivers by adjusting the | ||
watering time. This plugin allows a more fine grained level of control | ||
than the water level setting on the home page.</p> | ||
|
||
<p>The plugin will only have an effect on schedules started by programs | ||
triggered automatically and will ignore schedules started with RUN | ||
NOW.</p> | ||
|
||
<p>Adjustment levels can be entered per station per month to indicate | ||
the % adjustment to be applied to the watering time.</p> | ||
|
||
<p>If no value is entered for the station/month the value set in "Default | ||
Adjustment" is used. If the "Default Adjustment" is not set then the | ||
plugin will take no action for the station/month.</p> | ||
|
||
<p>Limitations: | ||
- The plugin does not currently respect the option "Ignore Plugin adjustments".</p> | ||
</body> | ||
</html> |
108 changes: 108 additions & 0 deletions
108
monthly_adjust_per_station/monthly_adjust_per_station.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
$def with(settings) | ||
|
||
$var title: $_('Monthly Adjust per Station') | ||
$var page: monthly_adjust_per_station | ||
<script> | ||
// Initialize behaviors | ||
jQuery(document).ready(function(){ | ||
|
||
jQuery("#cSubmit").click(function() { | ||
jQuery("#pluginForm").submit(); | ||
}); | ||
jQuery("button#cCancel").click(function(){ | ||
window.location="/"; | ||
}); | ||
|
||
jQuery("button#docButton").click(function(){ | ||
window.open("static/docs/plugins/monthly_adjust_per_station-docs.html", "_blank"); | ||
}); | ||
|
||
function pretty() { | ||
jQuery("table#st_mon tr").each(function(rowIndex) { | ||
$$(this).find("td").each(function(cellIndex) { | ||
console.log("Row " + rowIndex + ", cell " + cellIndex + ": " + $$(this).find("input[type=number]").val()); | ||
}); | ||
}); } | ||
// pretty(); | ||
}); | ||
</script> | ||
|
||
<style> | ||
td, input[type="checkbox"] { | ||
text-align: center; | ||
vertical-align: middle; | ||
accent-color: green; | ||
} | ||
|
||
td, input[type="number"] { | ||
white-space: nowrap; | ||
} | ||
|
||
table, th, td { | ||
border: 1px solid lightgray; | ||
border-collapse: collapse; | ||
padding: 5px; | ||
} | ||
|
||
input[type='number']{ | ||
width: 2.77em; | ||
} | ||
</style> | ||
|
||
<div id="plugin"> | ||
<div class="title">Monthly Adjust per Station | ||
<button class="execute" id="docButton" type="button" >$_('Help')</button> | ||
</div> | ||
|
||
<form id="pluginForm" action="/monthly_adjust_per_station-save" method="get"> | ||
</br> | ||
<p> | ||
Default adjustment: | ||
<input type="number" min="0" id="default" name="default" | ||
value="${settings[u"default"] if u"default" in settings and settings[u"default"] != u"" else u""}" | ||
onkeypress="if (isNaN(String.fromCharCode(event.keyCode))) return false;"> % | ||
</p> | ||
</br> | ||
|
||
<table id="st_mon" class="optionList"> | ||
<tr> | ||
<th class="columnName"> | ||
</th> | ||
<th class="columnName"> | ||
<div>$_(u'Enable')</div> | ||
</th> | ||
$for heading in ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']: | ||
<th class="columnName"> | ||
<div>$heading</div> | ||
</th> | ||
|
||
</tr> | ||
$#{settings} | ||
$for bid in range(0,gv.sd['nbrd']): | ||
$for s in range(0,8): | ||
$ sid = (bid * 8) + s; | ||
$ s_sid = str(sid); | ||
<tr> | ||
<td class="stationNumber">${gv.snames[sid]} | ||
</td> | ||
<td> | ||
<input type="checkbox" id="enable_${sid}" name="enable_${sid}" | ||
${"checked" if "enable_" + s_sid in settings else ""}> | ||
</td> | ||
$for mon in range(1,13): | ||
$ s_mon = str(mon) | ||
<td | ||
bgcolor="${settings[u"c_st_mon_" + s_sid + u"_" + s_mon] if u"c_st_mon_" + s_sid + u"_" + s_mon in settings else u""}"> | ||
<input type="number" min="0" id="st_mon_${sid}_${mon}" name="st_mon_${sid}_${mon}" | ||
value="${settings[u"st_mon_" + s_sid + u"_" + s_mon] if u"st_mon_" + s_sid + u"_" + s_mon in settings else u""}" | ||
onkeypress="if (isNaN(String.fromCharCode(event.keyCode))) return false;"> % | ||
</td> | ||
</tr> | ||
</table> | ||
</form> | ||
</br> | ||
<div class="controls"> | ||
<button id="cSubmit" class="submit"><b>$_('Submit')</b></button> | ||
<button id="cCancel" class="cancel danger">$_('Cancel')</button> | ||
</div> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
monthly_adjust_per_station/monthly_adjust_per_station.manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
A bare bones plugin designed to be used as a starting point for writing plugins. | ||
|
||
##### List all plugin files below preceded by a blank line [file_name.ext path] relative to SIP directory ##### | ||
|
||
monthly_adjust_per_station.py plugins | ||
monthly_adjust_per_station.html templates | ||
monthly_adjust_per_station-docs.html static/docs/plugins | ||
monthly_adjust_per_station.json data (generated) | ||
monthly_adjust_per_station.manifest plugins/manifests |
Oops, something went wrong.