Skip to content

Commit

Permalink
Bug fixed and edit digital charts
Browse files Browse the repository at this point in the history
fixed issue with latest values
edit digital charts
cmi lock
  • Loading branch information
berwinter committed Sep 26, 2015
1 parent 5d1172d commit 7ef374f
Show file tree
Hide file tree
Showing 12 changed files with 304 additions and 150 deletions.
2 changes: 2 additions & 0 deletions config/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ database = uvr1611

[uvr1611]
logger = "bl-net"
blnet_login = false
address = 10.0.0.100
port = 40000
reset = false
http_port = 80

[app]
name = "Solar/Heizungs Datenauswertung"
debug = false
email = bertram.winter@gmail.com
chartcache = 600
latestcache = 60
Expand Down
38 changes: 27 additions & 11 deletions css/format.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body {
right:0;
bottom:0;
top:100%;
position:fixed;
position:absolute;
background-color: #FFF;
display:none;
}
Expand Down Expand Up @@ -92,24 +92,27 @@ div.hover > div.icon, div.active > div.icon {
margin-top:-210px;
width:400px;
height:80px;
z-index: 90;
position: absolute;
}

#contact {
color: #444;
position:absolute;
position:fixed;
right:20px;
top:10px;
z-index: 90;
}
#contact > a{
color: #444;
}

#login {
font-size:10px;
position:absolute;
position:fixed;
right:20px;
top:35px;
z-index: 90;
}

.schema {
Expand Down Expand Up @@ -200,7 +203,7 @@ table.weatherdetail td.leftalign span.temp {
border-bottom: 1px solid #DDD;
background-color: #EEE;
height: 35px;
position:absolute;
position:fixed;
width:100%;
}

Expand Down Expand Up @@ -326,26 +329,40 @@ table.chartinfo div.timestamp {
font-size: 0.8em;
}

div.dialogBox {
font-size: 0.9em;
}

#edit_chart_dialog {
display:none;
}

#edit_chart_dialog > table {
#edit_chart_tab table {
width: 100%;
height: 100%;
table-layout: fixed;
font-size: 0.8em;
border-collapse:collapse;
}

#edit_chart_dialog > table td {
#edit_chart_tab table > thead > tr {
height: 20px;
}

#edit_chart_tab table th {
padding: 5px;
text-align: left;
font-weight: normal;
}
#edit_chart_dialog > table > tr {

#edit_chart_tab table td {
padding: 5px;
}

#edit_chart_tab table > tbody > tr {
height: 100%;
}

#availableLines, #activeLines {
ul.availableLines, ul.activeLines {
display: block;
list-style-type: none;
margin-top: 5px;
Expand All @@ -354,10 +371,9 @@ table.chartinfo div.timestamp {
height: 100%;
}

#availableLines li, #activeLines li {
ul.availableLines > li, ul.activeLines > li {
margin: 0 2px 2px 2px;
padding: 2px;
font-size: 1.2em;
}

#error {
Expand Down
87 changes: 59 additions & 28 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
<?php
include_once("lib/config.inc.php");
$config = Config::getInstance();
$email = "";
try {
$email = $config->app->email;
}
catch(Exception $ex) {}
$name = "";
try {
$name = $config->app->name;
}
catch(Exception $ex) {}
$address = "";
try {
$address = $config->uvr1611->address;
}
catch(Exception $ex) {}
$http_port = "";
try {
$http_port = $config->uvr1611->http_port;
}
catch(Exception $ex) {}
$email = $config->app->email;
$name = $config->app->name;
$address = $config->uvr1611->address;
$http_port = $config->uvr1611->http_port;

echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
Expand All @@ -45,13 +29,26 @@
<body>
<div id="contact"><?php include("VERSION"); ?> <a href="https://github.com/berwinter/uvr1611" target="_blank">GitHub</a> <a href="mailto:<?php echo $email; ?>">Kontakt</a></div>
<div id="login">

<?php
if($config->uvr1611->blnet_login) {
?>
<form id="bl_login_form" method="post" action="<?php echo "http://".$address.":".$http_port."/main.html"; ?>" target="_blank">
<input name="blu" type="hidden" value="1" checked="checked"/>
<input name="blp" type="hidden" size="10" maxlength="8"/>
<input name="bll" type="hidden" value="Login"/>
</form>
<?php
}
?>
<input name="password" class="text ui-widget-content ui-corner-all" id="login_password" type="password" size="12"/>
<?php
if($config->uvr1611->blnet_login) {
?>
<button id="bl_login">BL-Net</button>
<?php
}
?>
<button id="dl_login">Login</button><br/>
<span id="login_message"></span>
</div>
Expand Down Expand Up @@ -105,18 +102,52 @@
<div id="indicator"></div>
</div>
<div id="edit_chart_dialog" title="Diagramm ändern">
<table><tr><td>Aktive Linien:
<ul id="activeLines" class="editBox">
<li class="ui-state-default">Item 1</li>
<li class="ui-state-default">Item 2</li>
<div id="edit_chart_tab">
<ul>
<li><a href="#edit_analog">Analog</a></li>
<li><a href="#edit_digital">Digital</a></li>
</ul>
<div id="edit_analog">
<table>
<thead>
<tr>
<th>Aktive Linien:</th>
<th>Verfügbare Linien:</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<ul class="activeLines editBox">
</ul>
</td><td>
<ul class="availableLines editBox">
<ul>
</td></tr>
</tbody>
</table>
</div>
<div id="edit_digital">
<table>
<thead>
<tr>
<th>Aktive Linien:</th>
<th>Verfügbare Linien:</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<ul class="activeLines editBox">
</ul>
</td><td>Verfügbare Linien:
<ul id="availableLines" class="editBox">
<li class="ui-state-default">Item 1</li>
<li class="ui-state-default">Item 2</li>
</td><td>
<ul class="availableLines editBox">
<ul>
</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="error" class="ui-widget">
<div class="ui-state-error ui-corner-all" style="padding: 0.3em;">
Expand Down
18 changes: 13 additions & 5 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ var menu = {
{
var id = location.hash.substr(1);
if(id == "home" || menu.items[id]==null){
$("#logo").animate({'top':'50%','left':'50%'});
$("#logo").animate({'top':'50%','left':'50%'}).css({'position': 'absolute'});
$("#menu").fadeIn();
$("body").animate({'background-color':'#EEE'});
$("#content").animate({'top':'100%'},function(){
Expand All @@ -148,7 +148,7 @@ var menu = {
indicator.animate({'top':top});
}
indicator.animate({'left':left}, function() {
$("#logo").animate({'top':230,'left':230});
$("#logo").animate({'top':230,'left':230}).css({'position': 'fixed'});
$("#menu").fadeOut();
$("body").animate({'background-color':'#FFF'});
$("#content").show().animate({'top':90}, function() {
Expand Down Expand Up @@ -278,8 +278,8 @@ var actualValues =
display: function(data)
{
for(var i in actualValues.values) {
var value = actualValues.values[i];
try {
var value = actualValues.values[i];
var text = value.format.replace(/((DIGITAL|MWH|KWH|MISCHER_AUF|MISCHER_ZU|VENTIL|DREHZAHL|GRADCOLOR|ANIMATION)\()?#\.?(#*)\)?/g, function(number,tmp,modifier,fractions) {
switch(modifier) {
case "MISCHER_AUF":
Expand Down Expand Up @@ -325,10 +325,18 @@ var actualValues =
});
}
catch(e) {
var text = "ERROR";
if(e instanceof TypeError) {
var text = null;
}
else {
var text = "ERROR";
var message = "Could not format "+data[value.frame][value.type]+" of "+value.frame+"."+value.type+" using "+value.format+".";
$("#errorMessage").html("<strong>Error</strong> "+message);
$("#error").slideDown();
}
}

if(text != null)
if(text !== null && text !== "null" && text.indexOf("undefined") == -1)
{
$(value.path).text(text);
}
Expand Down
Loading

0 comments on commit 7ef374f

Please sign in to comment.