You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(121) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(38) |
Feb
(36) |
Mar
(7) |
Apr
(2) |
May
(32) |
Jun
(24) |
Jul
(16) |
Aug
(21) |
Sep
(17) |
Oct
(62) |
Nov
(60) |
Dec
(70) |
2012 |
Jan
(54) |
Feb
(41) |
Mar
(21) |
Apr
(38) |
May
(76) |
Jun
(47) |
Jul
(25) |
Aug
(72) |
Sep
(29) |
Oct
(64) |
Nov
(93) |
Dec
(97) |
2013 |
Jan
(100) |
Feb
(168) |
Mar
(115) |
Apr
(59) |
May
(37) |
Jun
(32) |
Jul
(45) |
Aug
(42) |
Sep
(24) |
Oct
(73) |
Nov
(64) |
Dec
(4) |
2014 |
Jan
(14) |
Feb
(57) |
Mar
(58) |
Apr
(10) |
May
(18) |
Jun
(12) |
Jul
(7) |
Aug
(12) |
Sep
(15) |
Oct
(6) |
Nov
(32) |
Dec
(17) |
2015 |
Jan
(50) |
Feb
(5) |
Mar
(1) |
Apr
(26) |
May
(10) |
Jun
(3) |
Jul
(3) |
Aug
(2) |
Sep
(3) |
Oct
(18) |
Nov
(18) |
Dec
(8) |
2016 |
Jan
(33) |
Feb
(35) |
Mar
(50) |
Apr
(20) |
May
(25) |
Jun
(17) |
Jul
(8) |
Aug
(73) |
Sep
(64) |
Oct
(51) |
Nov
(20) |
Dec
(14) |
2017 |
Jan
(41) |
Feb
(57) |
Mar
(44) |
Apr
(136) |
May
(32) |
Jun
(39) |
Jul
(2) |
Aug
(12) |
Sep
(32) |
Oct
(103) |
Nov
(12) |
Dec
(4) |
2018 |
Jan
(9) |
Feb
(1) |
Mar
(60) |
Apr
(24) |
May
(15) |
Jun
(1) |
Jul
(2) |
Aug
(23) |
Sep
(15) |
Oct
(57) |
Nov
(21) |
Dec
(77) |
2019 |
Jan
(62) |
Feb
(99) |
Mar
(98) |
Apr
(49) |
May
(6) |
Jun
(3) |
Jul
(6) |
Aug
(18) |
Sep
(9) |
Oct
(15) |
Nov
(30) |
Dec
(6) |
2020 |
Jan
(14) |
Feb
(2) |
Mar
(22) |
Apr
(33) |
May
(47) |
Jun
(12) |
Jul
|
Aug
|
Sep
(4) |
Oct
(2) |
Nov
(5) |
Dec
(5) |
2021 |
Jan
(4) |
Feb
(101) |
Mar
(13) |
Apr
(32) |
May
(40) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
(25) |
Nov
(12) |
Dec
|
2022 |
Jan
(154) |
Feb
(82) |
Mar
(63) |
Apr
(27) |
May
(26) |
Jun
(5) |
Jul
(12) |
Aug
(23) |
Sep
(17) |
Oct
(37) |
Nov
(13) |
Dec
(21) |
2023 |
Jan
(43) |
Feb
(43) |
Mar
(15) |
Apr
(8) |
May
(3) |
Jun
(25) |
Jul
(6) |
Aug
(38) |
Sep
(5) |
Oct
(20) |
Nov
(9) |
Dec
(28) |
2024 |
Jan
(15) |
Feb
(2) |
Mar
(12) |
Apr
(2) |
May
(8) |
Jun
(10) |
Jul
(10) |
Aug
(2) |
Sep
(3) |
Oct
(15) |
Nov
(6) |
Dec
(20) |
2025 |
Jan
|
Feb
(2) |
Mar
(6) |
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ma...@us...> - 2010-11-12 23:54:01
|
Revision: 116 http://openautomation.svn.sourceforge.net/openautomation/?rev=116&view=rev Author: mayerch Date: 2010-11-12 23:53:55 +0000 (Fri, 12 Nov 2010) Log Message: ----------- Added dynamic change of stylesheet dependend on the pages-design-attribute Modified Paths: -------------- CometVisu/trunk/visu/index.html CometVisu/trunk/visu/lib/templateengine.js Modified: CometVisu/trunk/visu/index.html =================================================================== --- CometVisu/trunk/visu/index.html 2010-11-12 21:11:21 UTC (rev 115) +++ CometVisu/trunk/visu/index.html 2010-11-12 23:53:55 UTC (rev 116) @@ -5,8 +5,6 @@ <head> <title>CometVisu-Client</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <link rel="stylesheet" type="text/css" href="designs/discreet/basic.css" /> - <link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="designs/pure/mobile.css" type="text/css" /> <script src="lib/jquery.js" type="text/javascript"></script> <script src="lib/jquery-ui.js" type="text/javascript"></script> <script src="lib/scrollable.js" type="text/javascript"></script> Modified: CometVisu/trunk/visu/lib/templateengine.js =================================================================== --- CometVisu/trunk/visu/lib/templateengine.js 2010-11-12 21:11:21 UTC (rev 115) +++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-12 23:53:55 UTC (rev 116) @@ -161,6 +161,10 @@ { // erst mal den Cache für AJAX-Requests wieder aktivieren $.ajaxSetup({cache: true}); + + var design = $( 'pages', xml ).attr('design'); + $( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + design + '/basic.css" />' ); + $( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + design + '/mobile.css" media="only screen and (max-device-width: 480px)" />' ); // adapt width for pages to show handleResize(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2010-11-12 21:11:31
|
Revision: 115 http://openautomation.svn.sourceforge.net/openautomation/?rev=115&view=rev Author: mayerch Date: 2010-11-12 21:11:21 +0000 (Fri, 12 Nov 2010) Log Message: ----------- Moved stylesheets et al. to the newly created diretories Modified Paths: -------------- CometVisu/trunk/visu/index.html Added Paths: ----------- CometVisu/trunk/visu/designs/discreet/basic.css CometVisu/trunk/visu/designs/discreet/fonts/ CometVisu/trunk/visu/designs/discreet/images/ CometVisu/trunk/visu/designs/pure/basic.css CometVisu/trunk/visu/designs/pure/mobile.css Removed Paths: ------------- CometVisu/trunk/visu/fonts/ CometVisu/trunk/visu/images/ CometVisu/trunk/visu/style_discreet.css CometVisu/trunk/visu/style_orange.css CometVisu/trunk/visu/style_orange_mobile.css Copied: CometVisu/trunk/visu/designs/discreet/basic.css (from rev 112, CometVisu/trunk/visu/style_discreet.css) =================================================================== --- CometVisu/trunk/visu/designs/discreet/basic.css (rev 0) +++ CometVisu/trunk/visu/designs/discreet/basic.css 2010-11-12 21:11:21 UTC (rev 115) @@ -0,0 +1,290 @@ +@font-face { font-family: Liberation; src:url(fonts/liberationsans-regular.ttf); } +@font-face { font-family: Liberation; font-weight: bold; src:url(fonts/liberationsans-bold.ttf); } + +body +{ + color: white; + font-family: Liberation; + font-size: 5.5mm; + overflow: hidden; + margin:0; + background: #1d1d1d url(images/body_bg.png) repeat-x; +} + +h1 +{ + font-size: 2em; + margin-left: 15px; +} + +body hr +{ + clear:both; + color: #81664b; + background-color: #81664b; + height: 1px; + border:none; + padding:0px; + margin:0.1em; +} + +#pages hr { + border: 0; height: 30px; margin: 0 .1em; + background: transparent url(images/hr_bg.png) 50% repeat-x; + clear: both; +} + + +body br +{ + clear:both; +} + +div#top { + margin-top: 8px; +} + +.nav_path +{ + color: #81664b; + margin-left: 15px; +} +.nav_path a +{ + color: white; + text-decoration:none; +} + +.footer, +.footer * +{ + color: #000000; + font-size: 0.9em; + vertical-align: middle; +} + +.widget +{ + float:left; + width:48%; + margin: .2em; + padding: 0.3em; + /* border:yellow 1px solid; */ + border-color: #020202; + border-style: solid; + border-width: 2px 0px 0px 2px; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + min-height: 2em; + background-color: #101010; +} + +.text > div, +.link > a { + float:left; + text-align:left; + padding-left: 1em; +} + +.widget .label, +.widget.info .actor, +.text > div, +.link > a { + line-height: 2em; +} + +.widget .label +{ + float:left; + width:49%; +/* color:red; */ +/* padding-right:0.25em; */ + text-align:left; + padding-left: 1em; +/* border:blue 1px solid; */ +} +.widget .actor +{ + float:left; + margin-left:1em; + text-align:left; +} +.widget .actor div +{ + float:left; + white-space: pre-wrap; +} + + +.green.switchPressed div, .green.switchUnpressed div{ + background: transparent url(images/dot_green.png) no-repeat center center; + color: white !important; +} +.red.switchPressed div, .red.switchUnpressed div{ + background: transparent url(images/dot_red.png) no-repeat center center; + color: white !important; +} + + +.red +{ + color:#f44; + font-weight:bold; +} + +.green +{ + color:#4f4; +} + +.blue +{ + color:#44f; +} + +.purple +{ + color:#f4f; +} + +.link a +{ + color: #81664b; + width: 49%; +} + +.page +{ + float:left; + width: 900px; + overflow: auto; + position: relative; +} + +.switchPressed, .switchUnpressed { + border-style: solid; + -moz-border-radius: 12px; + -webkit-border-radius: 12px; + border-radius: 12px; + padding: 1px; + background: url(images/button_bg.png) #171717 repeat-x; +} + +.switchUnpressed +{ + border-width: 1px 2px 2px 1px; + border-color: #282828 #010101 #010101 #282828; + margin-top: 0px; + background-color: #3A3A3A; + background-position: center +2px; +} +.switchUnpressed div, .switchPressed div +{ + padding: 5px; + width: 5em; + float: left; + background: transparent; + text-align: center; + cursor: pointer; +} + +.switchPressed +{ + border-width: 2px 1px 1px 2px; + border-color: #010101 #282828 #282828 #010101; + margin-top: 1px; + background-position: center -2px; +} + +.switchUnpressed div { + margin-left: -1px; +} + +.switchPressed div { + margin-top: -1px; +} + +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } +.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; } +.ui-widget-content a { color: #333333; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } + +.dim .actor +{ + width: 3em; +} +.widget .ui-slider +{ + width: 30%; + float: left; + margin-left: 10px; + margin-left: 1em; + margin-top: 0.5em; + border-color: #010101 #282828 #282828 #010101; + background: url(images/gradient.png) #a7a7a7 repeat-y; +} + +.widget .ui-slider-handle +{ + border-style: solid; + -moz-border-radius: 12px; + -webkit-border-radius: 12px; + border-radius: 12px; + padding: 1px; + background: url(images/button_bg.png) #171717 repeat-x; + border-width: 1px 2px 2px 1px; + border-color: #282828 #010101 #010101 #282828; +} +/* Clearfix */ +.clearfix:after { + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} + +.clearfix { + display: inline-block; +} + +html[xmlns] .clearfix { + display: block; +} + +*:first-child+html .clearfix { + min-height: 0; +} + +* html .clearfix { + height: 1%; +} + +* html>body .clearfix { + display: inline-block; + width: 100%; +} + +* html .clearfix { + /* Hides from IE-mac \*/ + height: 1%; + /* End hide from IE-mac */ +} Copied: CometVisu/trunk/visu/designs/pure/basic.css (from rev 112, CometVisu/trunk/visu/style_orange.css) =================================================================== --- CometVisu/trunk/visu/designs/pure/basic.css (rev 0) +++ CometVisu/trunk/visu/designs/pure/basic.css 2010-11-12 21:11:21 UTC (rev 115) @@ -0,0 +1,253 @@ +body +{ + background-color: black; + color: white; + font-family: Verdana, Helvetica, sans-serif; + font-family: 'URW Gothic L','Century Gothic','Apple Gothic',Arial,sans-serif; + font-size: 6mm; + overflow: hidden; + margin:0; +} + +h1 +{ + font-size: 2em; +} + +body hr +{ + clear:both; + color: #ff8000; + background-color: #ff8000; + height: 1px; + border:none; + padding:0px; + margin:0.1em; +} + +body br +{ + clear:both; +} + +.nav_path +{ + color: #ff8000; +} +.nav_path a +{ + color: white; + text-decoration:none; +} + +.footer, +.footer * +{ + color: #ff8000; + font-size: 0.9em; + vertical-align: middle; +} + +.widget +{ + float:left; + width:48%; + margin:0.10em; + padding:0.1em; + /* border:yellow 1px solid; */ + border: 1px solid #444; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + min-height: 2em; +} + +.widget .label +{ + float:left; + width:49%; +/* color:red; */ +/* padding-right:0.25em; */ + text-align:right; +/* border:blue 1px solid; */ +} +.widget .actor +{ + float:left; + margin-left:1em; + /*width:49%;*/ + text-align:left; +/* color:green; */ +/* border:blue 1px solid; */ +} +.widget .actor div +{ + float:left; + white-space: pre-wrap; +} + +.red +{ + color:#f44; + font-weight:bold; +} + +.green +{ + color:#4f4; +} + +.blue +{ + color:#44f; +} + +.purple +{ + color:#f4f; +} + +.link a +{ + color: #ff8000; + text-align: right; + width: 49%; +} + +.page +{ + float:left; + width: 900px; + overflow: auto; + position: relative; +} + +.switchUnpressed +{ + border-style: solid; + border-width: 1px; + border-color: #666 #444 #444 #666; + -moz-border-radius: 7px; + -webkit-border-radius: 7px; + border-radius: 7px; + padding: 1px; +} +.switchUnpressed div +{ + border-style: solid; + border-width: 1px; + border-color: #fff #666 #666 #fff; + padding: 5px; + width: 5em; + float: left; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +.switchPressed +{ + border-top: 1px solid #666; + border-left: 1px solid #666; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; +} +.switchPressed +{ + border-style: solid; + border-width: 1px; + border-color: #666 #fff #fff #666; + -moz-border-radius: 7px; + -webkit-border-radius: 7px; + border-radius: 7px; + padding: 1px; +} +.switchPressed div +{ + border-style: solid; + border-width: 1px; + border-color: #444 #666 #666 #444; + padding: 5px; + width: 5em; + float: left; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + + +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } +.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; } +.ui-widget-content a { color: #333333; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } + +.dim .actor +{ + width: 3em; +} +.widget .ui-slider +{ + width: 30%; + float: left; + margin-left: 10px; + margin-left: 1em; + margin-top: 0.2em; + border-color: #666 #fff #fff #666; +} + +.widget .ui-slider-handle +{ + border-color: #fff #666 #666 #fff; +} +/* Clearfix */ +.clearfix:after { + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} + +.clearfix { + display: inline-block; +} + +html[xmlns] .clearfix { + display: block; +} + +*:first-child+html .clearfix { + min-height: 0; +} + +* html .clearfix { + height: 1%; +} + +* html>body .clearfix { + display: inline-block; + width: 100%; +} + +* html .clearfix { + /* Hides from IE-mac \*/ + height: 1%; + /* End hide from IE-mac */ +} Copied: CometVisu/trunk/visu/designs/pure/mobile.css (from rev 112, CometVisu/trunk/visu/style_orange_mobile.css) =================================================================== --- CometVisu/trunk/visu/designs/pure/mobile.css (rev 0) +++ CometVisu/trunk/visu/designs/pure/mobile.css 2010-11-12 21:11:21 UTC (rev 115) @@ -0,0 +1,12 @@ +.widget +{ + width:98%; +} + +#bottom { + display: none; +} + +.page { + overflow: visible; +} Modified: CometVisu/trunk/visu/index.html =================================================================== --- CometVisu/trunk/visu/index.html 2010-11-12 20:59:33 UTC (rev 114) +++ CometVisu/trunk/visu/index.html 2010-11-12 21:11:21 UTC (rev 115) @@ -5,8 +5,8 @@ <head> <title>CometVisu-Client</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <link rel="stylesheet" type="text/css" href="style_discreet.css" /> - <link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="style_orange_mobile.css" type="text/css" /> + <link rel="stylesheet" type="text/css" href="designs/discreet/basic.css" /> + <link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="designs/pure/mobile.css" type="text/css" /> <script src="lib/jquery.js" type="text/javascript"></script> <script src="lib/jquery-ui.js" type="text/javascript"></script> <script src="lib/scrollable.js" type="text/javascript"></script> Deleted: CometVisu/trunk/visu/style_discreet.css =================================================================== --- CometVisu/trunk/visu/style_discreet.css 2010-11-12 20:59:33 UTC (rev 114) +++ CometVisu/trunk/visu/style_discreet.css 2010-11-12 21:11:21 UTC (rev 115) @@ -1,290 +0,0 @@ -@font-face { font-family: Liberation; src:url(fonts/liberationsans-regular.ttf); } -@font-face { font-family: Liberation; font-weight: bold; src:url(fonts/liberationsans-bold.ttf); } - -body -{ - color: white; - font-family: Liberation; - font-size: 5.5mm; - overflow: hidden; - margin:0; - background: #1d1d1d url(images/body_bg.png) repeat-x; -} - -h1 -{ - font-size: 2em; - margin-left: 15px; -} - -body hr -{ - clear:both; - color: #81664b; - background-color: #81664b; - height: 1px; - border:none; - padding:0px; - margin:0.1em; -} - -#pages hr { - border: 0; height: 30px; margin: 0 .1em; - background: transparent url(images/hr_bg.png) 50% repeat-x; - clear: both; -} - - -body br -{ - clear:both; -} - -div#top { - margin-top: 8px; -} - -.nav_path -{ - color: #81664b; - margin-left: 15px; -} -.nav_path a -{ - color: white; - text-decoration:none; -} - -.footer, -.footer * -{ - color: #000000; - font-size: 0.9em; - vertical-align: middle; -} - -.widget -{ - float:left; - width:48%; - margin: .2em; - padding: 0.3em; - /* border:yellow 1px solid; */ - border-color: #020202; - border-style: solid; - border-width: 2px 0px 0px 2px; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - border-radius: 8px; - min-height: 2em; - background-color: #101010; -} - -.text > div, -.link > a { - float:left; - text-align:left; - padding-left: 1em; -} - -.widget .label, -.widget.info .actor, -.text > div, -.link > a { - line-height: 2em; -} - -.widget .label -{ - float:left; - width:49%; -/* color:red; */ -/* padding-right:0.25em; */ - text-align:left; - padding-left: 1em; -/* border:blue 1px solid; */ -} -.widget .actor -{ - float:left; - margin-left:1em; - text-align:left; -} -.widget .actor div -{ - float:left; - white-space: pre-wrap; -} - - -.green.switchPressed div, .green.switchUnpressed div{ - background: transparent url(images/dot_green.png) no-repeat center center; - color: white !important; -} -.red.switchPressed div, .red.switchUnpressed div{ - background: transparent url(images/dot_red.png) no-repeat center center; - color: white !important; -} - - -.red -{ - color:#f44; - font-weight:bold; -} - -.green -{ - color:#4f4; -} - -.blue -{ - color:#44f; -} - -.purple -{ - color:#f4f; -} - -.link a -{ - color: #81664b; - width: 49%; -} - -.page -{ - float:left; - width: 900px; - overflow: auto; - position: relative; -} - -.switchPressed, .switchUnpressed { - border-style: solid; - -moz-border-radius: 12px; - -webkit-border-radius: 12px; - border-radius: 12px; - padding: 1px; - background: url(images/button_bg.png) #171717 repeat-x; -} - -.switchUnpressed -{ - border-width: 1px 2px 2px 1px; - border-color: #282828 #010101 #010101 #282828; - margin-top: 0px; - background-color: #3A3A3A; - background-position: center +2px; -} -.switchUnpressed div, .switchPressed div -{ - padding: 5px; - width: 5em; - float: left; - background: transparent; - text-align: center; - cursor: pointer; -} - -.switchPressed -{ - border-width: 2px 1px 1px 2px; - border-color: #010101 #282828 #282828 #010101; - margin-top: 1px; - background-position: center -2px; -} - -.switchUnpressed div { - margin-left: -1px; -} - -.switchPressed div { - margin-top: -1px; -} - -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; } -.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; } -.ui-widget-content a { color: #333333; } -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } - -.dim .actor -{ - width: 3em; -} -.widget .ui-slider -{ - width: 30%; - float: left; - margin-left: 10px; - margin-left: 1em; - margin-top: 0.5em; - border-color: #010101 #282828 #282828 #010101; - background: url(images/gradient.png) #a7a7a7 repeat-y; -} - -.widget .ui-slider-handle -{ - border-style: solid; - -moz-border-radius: 12px; - -webkit-border-radius: 12px; - border-radius: 12px; - padding: 1px; - background: url(images/button_bg.png) #171717 repeat-x; - border-width: 1px 2px 2px 1px; - border-color: #282828 #010101 #010101 #282828; -} -/* Clearfix */ -.clearfix:after { - content: "."; - display: block; - clear: both; - visibility: hidden; - line-height: 0; - height: 0; -} - -.clearfix { - display: inline-block; -} - -html[xmlns] .clearfix { - display: block; -} - -*:first-child+html .clearfix { - min-height: 0; -} - -* html .clearfix { - height: 1%; -} - -* html>body .clearfix { - display: inline-block; - width: 100%; -} - -* html .clearfix { - /* Hides from IE-mac \*/ - height: 1%; - /* End hide from IE-mac */ -} Deleted: CometVisu/trunk/visu/style_orange.css =================================================================== --- CometVisu/trunk/visu/style_orange.css 2010-11-12 20:59:33 UTC (rev 114) +++ CometVisu/trunk/visu/style_orange.css 2010-11-12 21:11:21 UTC (rev 115) @@ -1,253 +0,0 @@ -body -{ - background-color: black; - color: white; - font-family: Verdana, Helvetica, sans-serif; - font-family: 'URW Gothic L','Century Gothic','Apple Gothic',Arial,sans-serif; - font-size: 6mm; - overflow: hidden; - margin:0; -} - -h1 -{ - font-size: 2em; -} - -body hr -{ - clear:both; - color: #ff8000; - background-color: #ff8000; - height: 1px; - border:none; - padding:0px; - margin:0.1em; -} - -body br -{ - clear:both; -} - -.nav_path -{ - color: #ff8000; -} -.nav_path a -{ - color: white; - text-decoration:none; -} - -.footer, -.footer * -{ - color: #ff8000; - font-size: 0.9em; - vertical-align: middle; -} - -.widget -{ - float:left; - width:48%; - margin:0.10em; - padding:0.1em; - /* border:yellow 1px solid; */ - border: 1px solid #444; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - min-height: 2em; -} - -.widget .label -{ - float:left; - width:49%; -/* color:red; */ -/* padding-right:0.25em; */ - text-align:right; -/* border:blue 1px solid; */ -} -.widget .actor -{ - float:left; - margin-left:1em; - /*width:49%;*/ - text-align:left; -/* color:green; */ -/* border:blue 1px solid; */ -} -.widget .actor div -{ - float:left; - white-space: pre-wrap; -} - -.red -{ - color:#f44; - font-weight:bold; -} - -.green -{ - color:#4f4; -} - -.blue -{ - color:#44f; -} - -.purple -{ - color:#f4f; -} - -.link a -{ - color: #ff8000; - text-align: right; - width: 49%; -} - -.page -{ - float:left; - width: 900px; - overflow: auto; - position: relative; -} - -.switchUnpressed -{ - border-style: solid; - border-width: 1px; - border-color: #666 #444 #444 #666; - -moz-border-radius: 7px; - -webkit-border-radius: 7px; - border-radius: 7px; - padding: 1px; -} -.switchUnpressed div -{ - border-style: solid; - border-width: 1px; - border-color: #fff #666 #666 #fff; - padding: 5px; - width: 5em; - float: left; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; -} - -.switchPressed -{ - border-top: 1px solid #666; - border-left: 1px solid #666; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; -} -.switchPressed -{ - border-style: solid; - border-width: 1px; - border-color: #666 #fff #fff #666; - -moz-border-radius: 7px; - -webkit-border-radius: 7px; - border-radius: 7px; - padding: 1px; -} -.switchPressed div -{ - border-style: solid; - border-width: 1px; - border-color: #444 #666 #666 #444; - padding: 5px; - width: 5em; - float: left; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; -} - - -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.6em; height: 1.6em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.5em; margin-left: -.8em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; } -.ui-widget-content { border: 1px solid #dddddd; background: #000 ; color: #000; } -.ui-widget-content a { color: #333333; } -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } - -.dim .actor -{ - width: 3em; -} -.widget .ui-slider -{ - width: 30%; - float: left; - margin-left: 10px; - margin-left: 1em; - margin-top: 0.2em; - border-color: #666 #fff #fff #666; -} - -.widget .ui-slider-handle -{ - border-color: #fff #666 #666 #fff; -} -/* Clearfix */ -.clearfix:after { - content: "."; - display: block; - clear: both; - visibility: hidden; - line-height: 0; - height: 0; -} - -.clearfix { - display: inline-block; -} - -html[xmlns] .clearfix { - display: block; -} - -*:first-child+html .clearfix { - min-height: 0; -} - -* html .clearfix { - height: 1%; -} - -* html>body .clearfix { - display: inline-block; - width: 100%; -} - -* html .clearfix { - /* Hides from IE-mac \*/ - height: 1%; - /* End hide from IE-mac */ -} Deleted: CometVisu/trunk/visu/style_orange_mobile.css =================================================================== --- CometVisu/trunk/visu/style_orange_mobile.css 2010-11-12 20:59:33 UTC (rev 114) +++ CometVisu/trunk/visu/style_orange_mobile.css 2010-11-12 21:11:21 UTC (rev 115) @@ -1,12 +0,0 @@ -.widget -{ - width:98%; -} - -#bottom { - display: none; -} - -.page { - overflow: visible; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2010-11-12 20:59:39
|
Revision: 114 http://openautomation.svn.sourceforge.net/openautomation/?rev=114&view=rev Author: mayerch Date: 2010-11-12 20:59:33 +0000 (Fri, 12 Nov 2010) Log Message: ----------- new directory structure for designs Added Paths: ----------- CometVisu/trunk/visu/designs/ CometVisu/trunk/visu/designs/discreet/ CometVisu/trunk/visu/designs/pure/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2010-11-12 20:56:18
|
Revision: 113 http://openautomation.svn.sourceforge.net/openautomation/?rev=113&view=rev Author: mayerch Date: 2010-11-12 20:56:09 +0000 (Fri, 12 Nov 2010) Log Message: ----------- Initial support for configurable designs Modified Paths: -------------- CometVisu/trunk/visu/visu_config.xml CometVisu/trunk/visu/visu_config.xsd Modified: CometVisu/trunk/visu/visu_config.xml =================================================================== --- CometVisu/trunk/visu/visu_config.xml 2010-11-12 10:33:27 UTC (rev 112) +++ CometVisu/trunk/visu/visu_config.xml 2010-11-12 20:56:09 UTC (rev 113) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<pages> +<pages design="pure"> <mappings> <mapping name="OpenClose"> <entry value="0">zu</entry> @@ -30,9 +30,9 @@ <entry range_min="0" range_max="100">red</entry> </style> </styles> - <page name="Übersicht"> + <page name="Übersicht" flavour="orange"> <text align="center">Willkommen bei der CometVisu!</text> - <toggle address="1/0/2" datatype="1.001" response_address="1/0/2" mapping="OnOff">Terrase Licht</toggle> + <toggle address="1/0/2" datatype="1.001" response_address="1/0/2" mapping="OnOff" style="RedGreen" >Terrase Licht</toggle> <trigger address="1/0/2" datatype="1.001" value="0" mapping="OnOff">Terrase Licht 0</trigger> <trigger address="1/0/2" datatype="1.001" value="1" mapping="OnOff">Terrase Licht 1</trigger> <trigger address="2/2/5" datatype="5.001" value="0" >Rolladen Licht 0</trigger> @@ -53,7 +53,7 @@ <image src="http://www.yr.no/place/Germany/Bavaria/Holzkirchen~2899676/meteogram.png" refresh="1800" /> <line /> <info address="1/0/41" datatype="1.000" mapping="OnOff">Treppenlicht</info> - <page name="Fenster Kontakte"> + <page name="Fenster Kontakte" flavour="blue"> <info address="4/3/10" datatype="1" mapping="OpenClose" style="GreenRed">Bad EG Reed Fenster</info> <info address="4/3/20" datatype="1.001" mapping="OpenClose" style="GreenRed">WC Reed Fenster</info> <info address="4/3/30" datatype="1" mapping="OpenClose" style="GreenRed">Schlafen Reed Fenster links</info> @@ -76,7 +76,7 @@ <info address="4/3/210" datatype="1.001">Lueftung Filter</info> <info address="4/3/250" datatype="1.001" mapping="OnOff">Rauchmelder</info> </page> - <page name="Temperaturen"> + <page name="Temperaturen" flavour="red"> <info address="4/0/10" datatype="9.001" pre="ca. " post=" °C">Bad EG Boden Temperatur</info> <info address="4/0/11" datatype="9.001" pre="ca. " post=" °C">Bad EG Luft Temperatur</info> <info address="4/0/15" datatype="9.001" pre="ca. " post=" °C">Bad EG Dusche Temperatur</info> @@ -101,7 +101,7 @@ <info address="4/0/203" datatype="9.001" pre="ca. " post=" °C">Kaltwasser Temperatur</info> <info address="4/0/205" datatype="9.001" pre="ca. " post=" °C">Warmwasser UG Temperatur</info> </page> - <page name="Rollläden"> + <page name="Rollläden" flavour="green"> <shade address="2/4/0" datatype="5.001">Rollladen Bad</shade> <shade address="2/4/1" datatype="5.001">Rollladen Schlafen Fenster</shade> <shade address="2/4/2" datatype="5.001">Rollladen Schlafen Türe</shade> Modified: CometVisu/trunk/visu/visu_config.xsd =================================================================== --- CometVisu/trunk/visu/visu_config.xsd 2010-11-12 10:33:27 UTC (rev 112) +++ CometVisu/trunk/visu/visu_config.xsd 2010-11-12 20:56:09 UTC (rev 113) @@ -51,6 +51,7 @@ <xsd:element ref="styles" /> <xsd:element ref="page" minOccurs="1" /> </xsd:choice> + <xsd:attribute name="design" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> @@ -108,6 +109,7 @@ <xsd:element ref="page" /> </xsd:choice> <xsd:attribute name="name" type="xsd:string" use="required" /> + <xsd:attribute name="flavour" type="xsd:string" /> </xsd:complexType> </xsd:element> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-12 10:33:40
|
Revision: 112 http://openautomation.svn.sourceforge.net/openautomation/?rev=112&view=rev Author: nilss1 Date: 2010-11-12 10:33:27 +0000 (Fri, 12 Nov 2010) Log Message: ----------- changed datastore cycles to apscheduler Modified Paths: -------------- PyWireGate/trunk/WireGate.py PyWireGate/trunk/datastore.py Modified: PyWireGate/trunk/WireGate.py =================================================================== --- PyWireGate/trunk/WireGate.py 2010-11-12 08:59:20 UTC (rev 111) +++ PyWireGate/trunk/WireGate.py 2010-11-12 10:33:27 UTC (rev 112) @@ -23,8 +23,8 @@ import traceback import daemon import log +import re - import ConfigParser import datastore @@ -41,7 +41,7 @@ self.REDIRECTIO = REDIRECTIO ## Get the path of this script - self.scriptpath = str(datastore).split( )[3][1:-15] + self.scriptpath = re.findall("from \x27(.*)\x2F",str(datastore))[0] self.readWireGateConfig() Modified: PyWireGate/trunk/datastore.py =================================================================== --- PyWireGate/trunk/datastore.py 2010-11-12 08:59:20 UTC (rev 111) +++ PyWireGate/trunk/datastore.py 2010-11-12 10:33:27 UTC (rev 112) @@ -15,6 +15,14 @@ sys.exit(1) +try: + from apscheduler.scheduler import Scheduler as apscheduler +except ImportError: + print >> sys.stderr, "apt-get install python-apscheduler" + sys.exit(1) + + + class datastore: """ Datastore Instance @@ -34,8 +42,8 @@ self.DBLOADED = False self.dataobjects = {} - self.cycleThreadLock = threading.RLock() - self.cycleThreads = {} + self.CYCLER = apscheduler() + self.CYCLER.start() self.locked = threading.RLock() self.locked.acquire() @@ -85,7 +93,7 @@ except KeyError: ## create a new one if it don't exist self.dataobjects[id] = dataObject(self,id) - if connector: + if hasattr(connector,'get_ds_defaults'): self.dataobjects[id].config = connector.get_ds_defaults(id) ## return it self.locked.release() @@ -143,34 +151,8 @@ dbfile.close() - def attachThread(self,obj,threadObj=False): - try: - self.cycleThreadLock.acquire() - ## check only - if not threadObj: - return obj in self.cycleThreads - self.cycleThreads[obj] = threadObj - finally: - self.cycleThreadLock.release() - - return self.cycleThreads[obj] - - - def removeThread(self,obj): - self.cycleThreadLock.acquire() - del self.cycleThreads[obj] - self.cycleThreadLock.release() - - def shutdown(self): - self.cycleThreadLock.acquire() - for obj in self.cycleThreads.keys(): - try: - self.cycleThreads[obj].cancel() - self.cycleThreads[obj].join() - except: - pass - self.cycleThreadLock.release() + self.CYCLER.shutdown() self.save() @@ -193,9 +175,7 @@ class dataObject: def __init__(self,parent,id,name=False): self._parent = parent - if parent: - self.WG = parent.WG - + self.WG = parent.WG ## Threadlocking self.write_mutex = threading.RLock() self.read_mutex = threading.RLock() @@ -220,7 +200,7 @@ ## guess that non unicode is iso8859 self.name = name.decode("iso-8859-15") ## some defaults - self.value = u"" + self.value = None self.lastupdate = 0 self.id = id @@ -231,6 +211,7 @@ self.config = {} self.cyclestore = [] + self._cyclejob = False ## connected Logics, communication objects ... goes here self.connected = [] @@ -249,17 +230,23 @@ self.write_mutex.release() def setValue(self,val,send=False): - if 'sendcycle' in self.config: - if not self.WG.DATASTORE.attachThread(self): + if 'sendcycle' in self.config and self.value <> None: + if not self._cyclejob: self._parent.debug("start Cycle ID: %s" % self.id) cycletime = float(self.config['sendcycle']) + self.lastupdate - time.time() if cycletime < 0.0: cycletime = 0 + + ## add value to List self.cyclestore.append(val) - ## FIXME: create global cycling Thread like in cycle.py - _cyclethread = self.WG.DATASTORE.attachThread(self,threading.Timer(cycletime,self._cycle)) - #_cyclethread.setDaemon(1) - _cyclethread.start() + + ## + repeat = 1 + if 'always' in self.config['sendcycleoption'].split(","): + repeat = 0 + self.write_mutex.acquire() + self._cyclejob = self.WG.DATASTORE.CYCLER.add_interval_job(self._cycle,seconds=cycletime,repeat=repeat) + self.write_mutex.release() else: self._parent.debug("ignore Cycle ID: %s" % self.id) self.cyclestore.append(val) @@ -293,9 +280,9 @@ try: self.WG.DATASTORE.dataobjects[attached].setValue(val,True) except: - print "FAILED %s" % attached - __import__('traceback').print_exc(file=__import__('sys').stdout) - pass + self.WG.log("sendconnected failed for %s" % attached,'error') + #__import__('traceback').print_exc(file=__import__('sys').stdout) + def getValue(self): @@ -308,17 +295,36 @@ self.read_mutex.release() def _cycle(self): - self._parent.debug("execute Cycle ID: %s" % self.id) - self.WG.DATASTORE.removeThread(self) - val = self.getValue() + self._parent.debug("----------------------execute Cycle ID: %s" % self.id) + val = None + cycleopts = [] if 'sendcycleoption' in self.config: - if self.config['sendcycleoption'] == 'average' and type(self.cyclestore[0]) in (int,float): - val = type(self.cyclestore[0])(0) - for i in self.cyclestore: - val += i - val = val / len(self.cyclestore) - self._parent.debug("Cycle ID: %s average: %f (%r)" % (self.id, val, self.cyclestore )) - self.cyclestore = [] + cycleopts = self.config['sendcycleoption'].split(",") + ## average only possible with data in cyclesotre else DivisionByZero + if len(self.cyclestore) > 0: + ## Average/Min/Max only possible with int and float + if type(self.value) in (int,float): + val = type(self.value)(0) + if 'average' in cycleopts: + for i in self.cyclestore: + val += i + val = val / len(self.cyclestore) + self._parent.debug("Cycle ID: %s average: %f (%r)" % (self.id, val, self.cyclestore )) + ## default use last + else: + val = self.cyclestore.pop() + else: + val = self.cyclestore.pop() + + if 'always' in cycleopts: + if val == None: + val = self.getValue() else: - val = self.cyclestore.pop() - self._real_setValue(val,False) + self.write_mutex.acquire() + self._cyclejob = False + self.write_mutex.release() + + ## reset cyclestore + self.cyclestore = [] + if val <> None: + self._real_setValue(val,False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-12 08:59:33
|
Revision: 111 http://openautomation.svn.sourceforge.net/openautomation/?rev=111&view=rev Author: nilss1 Date: 2010-11-12 08:59:20 +0000 (Fri, 12 Nov 2010) Log Message: ----------- set loglevel for failed reads to info Modified Paths: -------------- PyWireGate/trunk/owfs_connector/OWFS_Connector.py PyWireGate/trunk/owfs_connector/connection.py Modified: PyWireGate/trunk/owfs_connector/OWFS_Connector.py =================================================================== --- PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-11 17:37:13 UTC (rev 110) +++ PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-12 08:59:20 UTC (rev 111) @@ -24,7 +24,7 @@ class owfs_connector(Connector): CONNECTOR_NAME = 'OWFS Connector' - CONNECTOR_VERSION = 0.1 + CONNECTOR_VERSION = 0.2 CONNECTOR_LOGNAME = 'owfs_connector' def __init__(self,parent, instanceName): self._parent = parent @@ -51,7 +51,7 @@ self.issensor = re.compile(r"[0-9][0-9]\x2E[0-9a-fA-F]+") self.isbus = re.compile(r"\x2Fbus\x2E([0-9])+$", re.MULTILINE) - owfsdir = str(connection).split( )[3][1:-17] + owfsdir = re.findall("from \x27(.*)\x2F",str(connection))[0] ## Sensors and their interfaces self.debug("Read ini file from %s" % owfsdir+"/sensors.ini") sensorconfig = self.WG.readConfig(owfsdir+"/sensors.ini") @@ -225,19 +225,21 @@ owfspath = "/uncached/%s/%s%s" % (sensor,get,resolution) self.debug("Reading from path %s" % owfspath) + data = False try: ## read uncached and put into local-list data = self.owfs.read(owfspath) - try: - self.mutex.acquire() - self.busmaster[busname]['sensors'][sensor][get] = data - finally: - self.mutex.release() except: ## ignore all OWFS Errors - self.WG.errorlog("Reading from path %s failed" % owfspath) + #self.WG.errorlog("Reading from path %s failed" % owfspath) + self.log("Reading from path %s failed" % owfspath) + + try: + self.mutex.acquire() + self.busmaster[busname]['sensors'][sensor][get] = data + finally: + self.mutex.release() ## make an id for the sensor (OW:28.043242a32_temperature - try: ## only if there is any Data update it in the DATASTORE if self.busmaster[busname]['sensors'][sensor][get]: Modified: PyWireGate/trunk/owfs_connector/connection.py =================================================================== --- PyWireGate/trunk/owfs_connector/connection.py 2010-11-11 17:37:13 UTC (rev 110) +++ PyWireGate/trunk/owfs_connector/connection.py 2010-11-12 08:59:20 UTC (rev 111) @@ -152,7 +152,6 @@ if payload_len >= 0: data = s.recv(payload_len) return self.toNumber(data[:data_len]) - break else: # ping response return None This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2010-11-11 17:37:19
|
Revision: 110 http://openautomation.svn.sourceforge.net/openautomation/?rev=110&view=rev Author: makki1 Date: 2010-11-11 17:37:13 +0000 (Thu, 11 Nov 2010) Log Message: ----------- filled in some 1-wire devices to owfs/sensors.ini Modified Paths: -------------- PyWireGate/trunk/owfs_connector/sensors.ini Modified: PyWireGate/trunk/owfs_connector/sensors.ini =================================================================== --- PyWireGate/trunk/owfs_connector/sensors.ini 2010-11-11 15:56:02 UTC (rev 109) +++ PyWireGate/trunk/owfs_connector/sensors.ini 2010-11-11 17:37:13 UTC (rev 110) @@ -1,14 +1,70 @@ [DS1420] +# ROM id-chip +interfaces = present - [DS18B20] +# Temperature with resolution, family 28 cycle = 15 interfaces = temperature,power config_temperature_resolution = 10 config_temperature_sendcycle = 60 config_temperature_sendcycleoption = average +[DS18S20] +# Temperature with fixed resolution, family 10 +cycle = 15 +interfaces = temperature,power +config_temperature_sendcycle = 60 +config_temperature_sendcycleoption = average +[DS1990] +# ROM iButtons, family 01 +cycle = 1 +interfaces = present +# save parent busmaster-id/serial in DS to distinguish presence on different busmasters +config_present_busmaster = true + [DS2438] +# Battery-monitor with Vxx and current, family 26 +# /pages/page.3 conatins type: 0x19 or 0xF1 = TH, 0xF2 = THS +# FIXME: several more (not widely used) to be added cycle = 60 -interfaces = temperature,humidity,vis,VDD +interfaces = temperature,HIH4000/humidity,vis,VAD,VDD + +[DS2406] +# dual switch / IO, family 12 +# PIO.[A|B] if used as output +# sensed.[A|B] if used as input +# latch contains changed pin if alarming, must be reset after read +# owread /uncached/$key/latch.ALL; owwrite /$key/latch.BYTE 0; owwrite /$key/set_alarm 311 +# latch returns CSV 0,1 if B changed +cycle = 1 +interfaces = PIO.A,PIO.B,sensed.A,sensed.B,latch.ALL,latch.BYTE,set_alarm + +[DS2408] +# 8x switch / IO, family 29 +# PIO.[0-7] if used as output +# FIXME: sensed.[0-7] if used as input / latch not supported yet +cycle = 1 +interfaces = PIO.0,PIO.1,PIO.2,PIO.3,PIO.4,PIO.5,PIO.6,PIO.7 + +[DS2423] +# Dual-counter, family 1D +interfaces = counters.A,counters.B + +[DS2760] +# battery-monitor, family 30 +# used for soil-moisture +cycle = 60 +interfaces = temperature,current +# values need to be calibrated for each sensor +config_current_low = 0.14 +config_current_high = 0.14 + +[DS9490] +# USB-Busmaster, family 81 +# no interfaces but bus-specific statistics +# /interface/statistics/errors +# /interface/statistics/search_errors/error_pass_1 +# etc. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-11 15:56:08
|
Revision: 109 http://openautomation.svn.sourceforge.net/openautomation/?rev=109&view=rev Author: nilss1 Date: 2010-11-11 15:56:02 +0000 (Thu, 11 Nov 2010) Log Message: ----------- Fix date in DPT_Types.py * Fix parent error for DSupdate in datastore.py * change print to debug in scheduler.py Modified Paths: -------------- PyWireGate/trunk/datastore.py PyWireGate/trunk/knx_connector/DPT_Types.py PyWireGate/trunk/scheduler.py Modified: PyWireGate/trunk/datastore.py =================================================================== --- PyWireGate/trunk/datastore.py 2010-11-11 14:49:01 UTC (rev 108) +++ PyWireGate/trunk/datastore.py 2010-11-11 15:56:02 UTC (rev 109) @@ -193,7 +193,8 @@ class dataObject: def __init__(self,parent,id,name=False): self._parent = parent - self.WG = parent.WG + if parent: + self.WG = parent.WG ## Threadlocking self.write_mutex = threading.RLock() Modified: PyWireGate/trunk/knx_connector/DPT_Types.py =================================================================== --- PyWireGate/trunk/knx_connector/DPT_Types.py 2010-11-11 14:49:01 UTC (rev 108) +++ PyWireGate/trunk/knx_connector/DPT_Types.py 2010-11-11 15:56:02 UTC (rev 109) @@ -361,9 +361,11 @@ def encodeDPT11(self,val): ## make time struct accesible + utime=[] if type(val) in [float, int]: - utime = [v for v in time.localtime(tval)] - else: + if val > 0: + utime = [v for v in time.localtime(val)] + if utime == []: utime = [v for v in time.localtime()] if type(val) == str: Modified: PyWireGate/trunk/scheduler.py =================================================================== --- PyWireGate/trunk/scheduler.py 2010-11-11 14:49:01 UTC (rev 108) +++ PyWireGate/trunk/scheduler.py 2010-11-11 15:56:02 UTC (rev 109) @@ -47,12 +47,12 @@ for uoption in obj.config['cron'].keys(): kwargs[str(uoption)] = str(obj.config['cron'][uoption]) - print "Adding %s - %r" % (shed,obj) + self.debug("Adding %s - %r" % (shed,obj)) setattr(obj.sendConnected.im_func,'__name__',"%s" % shed.encode('UTF-8')) self.SCHEDULER.add_cron_job(self.WG.DATASTORE.dataobjects[shed].sendConnected,**kwargs) def shutdown(self): - print self.SCHEDULER.dump_jobs() + self.debug("shutdown Scheduler\n%s" % self.SCHEDULER.dump_jobs()) self.SCHEDULER.shutdown() def debug(self,msg): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-11 14:49:08
|
Revision: 108 http://openautomation.svn.sourceforge.net/openautomation/?rev=108&view=rev Author: nilss1 Date: 2010-11-11 14:49:01 +0000 (Thu, 11 Nov 2010) Log Message: ----------- add scheduler support Modified Paths: -------------- PyWireGate/trunk/WireGate.py Added Paths: ----------- PyWireGate/trunk/scheduler.py Modified: PyWireGate/trunk/WireGate.py =================================================================== --- PyWireGate/trunk/WireGate.py 2010-11-11 14:48:26 UTC (rev 107) +++ PyWireGate/trunk/WireGate.py 2010-11-11 14:49:01 UTC (rev 108) @@ -28,7 +28,9 @@ import ConfigParser import datastore +import scheduler + class WireGate(daemon.Daemon): def __init__(self,REDIRECTIO=False): self._parent = self @@ -47,7 +49,6 @@ ## Start the Datastore self.DATASTORE = datastore.datastore(self) - ## Start the Daemon daemon.Daemon.__init__(self,self.config['WireGate']['pidfile'],REDIRECTIO) @@ -138,6 +139,10 @@ except: self.WG.errorlog(connector) pass + + ## Start the Sheduler + self.SCHEDULER = scheduler.scheduler(self) + self.SCHEDULER.start() if os.getuid() == 0: import pwd @@ -186,6 +191,8 @@ #for dobj in self.DATASTORE.dataobjects.keys(): # print dobj+": "+str(self.DATASTORE.dataobjects[dobj].getValue()) self.log("### Shutdown WireGated ###") + + self.SCHEDULER.shutdown() for instance in self.connectors.keys(): try: self.connectors[instance].shutdown() Added: PyWireGate/trunk/scheduler.py =================================================================== --- PyWireGate/trunk/scheduler.py (rev 0) +++ PyWireGate/trunk/scheduler.py 2010-11-11 14:49:01 UTC (rev 108) @@ -0,0 +1,88 @@ +# -*- coding: iso8859-1 -*- +## ----------------------------------------------------- +## Cycler +## ----------------------------------------------------- +## Copyright (c) 2010, knx-user-forum e.V, All rights reserved. +## +## This program is free software; you can redistribute it and/or modify it under the terms +## of the GNU General Public License as published by the Free Software Foundation; either +## version 3 of the License, or (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +## without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +## See the GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License along with this program; +## if not, see <http://www.gnu.de/documents/gpl-3.0.de.html>. + +import time +import sys +from datetime import datetime +try: + from apscheduler.scheduler import Scheduler as apscheduler +except ImportError: + print >> sys.stderr, "apt-get install python-apscheduler" + sys.exit(1) + + + +class scheduler: + def __init__(self,parent): + self._parent = parent + if parent: + self.WG = parent.WG + self.SCHEDULER = apscheduler() + + def start(self): + self.load() + self.log("SCHEDULER starting up") + self.SCHEDULER.start() + + def load(self): + schedules = filter(lambda x: x.startswith("SCHEDULER:"),self.WG.DATASTORE.dataobjects.keys()) + for shed in schedules: + obj = self.WG.DATASTORE.dataobjects[shed] + if 'cron' in obj.config: + kwargs = {} + for uoption in obj.config['cron'].keys(): + kwargs[str(uoption)] = str(obj.config['cron'][uoption]) + + print "Adding %s - %r" % (shed,obj) + setattr(obj.sendConnected.im_func,'__name__',"%s" % shed.encode('UTF-8')) + self.SCHEDULER.add_cron_job(self.WG.DATASTORE.dataobjects[shed].sendConnected,**kwargs) + + def shutdown(self): + print self.SCHEDULER.dump_jobs() + self.SCHEDULER.shutdown() + + def debug(self,msg): + self.log(msg,'debug') + + + ## Central logging + def log(self,msg,severity='info',instance=False): + self.WG.log(msg,severity,"scheduler") + + +if __name__ == '__main__': + s = scheduler(False) + time.sleep(155) + s.shutdown() + + +## "SHEDULER:cron_job-001": { +## "config": { +## "cron" : { +## "day_of_week" : "mon-fri", +## "hour" : "8", +## "minute" : "30" +## } +## +## }, +## "connected": [ "KNX:14/1/50" ], +## "id": "cron_job-001", +## "lastupdate": 0, +## "name": "Test Cronjob weekday 8:30", +## "value": 1 +## } + \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-11 14:48:32
|
Revision: 107 http://openautomation.svn.sourceforge.net/openautomation/?rev=107&view=rev Author: nilss1 Date: 2010-11-11 14:48:26 +0000 (Thu, 11 Nov 2010) Log Message: ----------- seperate sendConnected to be called from scheduler * get initial Value from datastore.db Modified Paths: -------------- PyWireGate/trunk/datastore.py Modified: PyWireGate/trunk/datastore.py =================================================================== --- PyWireGate/trunk/datastore.py 2010-11-11 14:45:53 UTC (rev 106) +++ PyWireGate/trunk/datastore.py 2010-11-11 14:48:26 UTC (rev 107) @@ -64,14 +64,7 @@ ##TODO: central subscriber function for other connectore or servers - for attached in obj.connected: - try: - self.dataobjects[attached].setValue(val,True) - except: - print "FAILED %s" % attached - __import__('traceback').print_exc(file=__import__('sys').stdout) - pass - + obj.sendConnected() ## return the object for additional updates return obj @@ -110,6 +103,7 @@ self.dataobjects[name].lastupdate = obj['lastupdate'] self.dataobjects[name].config = obj['config'] self.dataobjects[name].connected = obj['connected'] + self.dataobjects[name].value = obj['value'] self.debug("%d entries loaded in DATASTORE" % len(self.dataobjects)) self.DBLOADED = True except IOError: @@ -220,6 +214,7 @@ else: self.name = name + ## set Name to function for Scheduler if type(self.name) <> unicode: ## guess that non unicode is iso8859 self.name = name.decode("iso-8859-15") @@ -239,6 +234,8 @@ ## connected Logics, communication objects ... goes here self.connected = [] + def __repr__(self): + return "%s - %s" % (self.id,self.name) def _setValue(self,refered_self): ## self override ## override with connector send function @@ -258,6 +255,7 @@ if cycletime < 0.0: cycletime = 0 self.cyclestore.append(val) + ## FIXME: create global cycling Thread like in cycle.py _cyclethread = self.WG.DATASTORE.attachThread(self,threading.Timer(cycletime,self._cycle)) #_cyclethread.setDaemon(1) _cyclethread.start() @@ -286,6 +284,18 @@ self.write_mutex.release() self.read_mutex.release() + def sendConnected(self): + self.read_mutex.acquire() + val = self.getValue() + self.read_mutex.release() + for attached in self.connected: + try: + self.WG.DATASTORE.dataobjects[attached].setValue(val,True) + except: + print "FAILED %s" % attached + __import__('traceback').print_exc(file=__import__('sys').stdout) + pass + def getValue(self): try: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-11 14:46:00
|
Revision: 106 http://openautomation.svn.sourceforge.net/openautomation/?rev=106&view=rev Author: nilss1 Date: 2010-11-11 14:45:53 +0000 (Thu, 11 Nov 2010) Log Message: ----------- Fixed time and date for val 0 send current Modified Paths: -------------- PyWireGate/trunk/knx_connector/DPT_Types.py Modified: PyWireGate/trunk/knx_connector/DPT_Types.py =================================================================== --- PyWireGate/trunk/knx_connector/DPT_Types.py 2010-11-11 14:37:02 UTC (rev 105) +++ PyWireGate/trunk/knx_connector/DPT_Types.py 2010-11-11 14:45:53 UTC (rev 106) @@ -21,6 +21,7 @@ ### sondern als LIST mit den dezimalen Werten ist das decode hier ein bischen angepasst import struct +import time class dpt_type: def __init__(self,parent): @@ -325,7 +326,11 @@ if len(timeval) == 3: sec = int(timeval[2]) elif type(val) in [float, int]: - now = time.localtime(val) + if val == 0: + ## current Time + now = time.localtime() + else: + now = time.localtime(val) weekday = now[6] hour = now[3] min = now[4] @@ -355,12 +360,12 @@ return u"%02d.%02d.%04d" % (day,mon,year) def encodeDPT11(self,val): + ## make time struct accesible if type(val) in [float, int]: - tval = val + utime = [v for v in time.localtime(tval)] else: - tval =0 - ## make time struct accesible - utime = [v for v in time.localtime(tval)] + utime = [v for v in time.localtime()] + if type(val) == str: datestr = val.split(".") if len(datestr) == 2: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-11 14:37:08
|
Revision: 105 http://openautomation.svn.sourceforge.net/openautomation/?rev=105&view=rev Author: nilss1 Date: 2010-11-11 14:37:02 +0000 (Thu, 11 Nov 2010) Log Message: ----------- Fix 14Byte encoding Modified Paths: -------------- PyWireGate/trunk/knx_connector/DPT_Types.py PyWireGate/trunk/knx_connector/KNX_Connector.py Modified: PyWireGate/trunk/knx_connector/DPT_Types.py =================================================================== --- PyWireGate/trunk/knx_connector/DPT_Types.py 2010-11-11 08:07:20 UTC (rev 104) +++ PyWireGate/trunk/knx_connector/DPT_Types.py 2010-11-11 14:37:02 UTC (rev 105) @@ -96,7 +96,10 @@ elif dsobj: if "dptid" in dsobj.config: dpt = dsobj.config['dptid'] - else: + if dpt == -1: + dpt = self.guessDPT(msg) + #return False + if dpt == 0: return False return self._encode(msg,dpt) @@ -438,6 +441,7 @@ return res.decode('iso-8859-15') def encodeDPT16(self,val): + self.debug("DPT16encode: %r (%s)" % (val,type(val))) if type(val) == unicode: val = val.encode('iso-8859-15') ## max 14 @@ -478,9 +482,22 @@ ## 14byte String return 16 return 0 + def guessDPT(self,raw): + if type(raw) == int: + if raw < 256: + return 5 + elif raw < 655535: + return 7 + elif type(raw) == float: + if raw > -671088.64 and raw < 670760.96: + return 9 + else: + return 14 + elif type(raw) == str or type(raw) == unicode: + return 16 + return 0 - if __name__ == "__main__": dpttypes = dpt_type(False) print dpttypes.decode([24,88],dptid=9) Modified: PyWireGate/trunk/knx_connector/KNX_Connector.py =================================================================== --- PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-11 08:07:20 UTC (rev 104) +++ PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-11 14:37:02 UTC (rev 105) @@ -174,13 +174,17 @@ def send(self,msg,dstaddr): try: - if type(msg) <> list: - self.log("Failed send %r to %r" % (msg,dstaddr),'warn') - return addr = self.str2grpaddr(dstaddr) if addr: - msg = [0,KNXWRITEFLAG] + msg - self.sendQueue.put((addr,msg)) + apdu = [0] + if type(msg) == int: + apdu.append(KNXWRITEFLAG | msg) + elif type(msg) == list: + apdu = apdu +[KNXWRITEFLAG]+ msg + else: + self.WG.errorlog("invalid Message %r to %r" % (msg,dstaddr)) + return + self.sendQueue.put((addr,apdu)) #self.KNX.EIBSendGroup(addr,msg) except: self.WG.errorlog("Failed send %r to %r" % (msg,dstaddr)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-11 08:07:26
|
Revision: 104 http://openautomation.svn.sourceforge.net/openautomation/?rev=104&view=rev Author: nilss1 Date: 2010-11-11 08:07:20 +0000 (Thu, 11 Nov 2010) Log Message: ----------- don't send if no valid Datastore Object for KNX address Modified Paths: -------------- PyWireGate/trunk/knx_connector/KNX_Connector.py Modified: PyWireGate/trunk/knx_connector/KNX_Connector.py =================================================================== --- PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-11 07:58:43 UTC (rev 103) +++ PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-11 08:07:20 UTC (rev 104) @@ -174,9 +174,12 @@ def send(self,msg,dstaddr): try: + if type(msg) <> list: + self.log("Failed send %r to %r" % (msg,dstaddr),'warn') + return addr = self.str2grpaddr(dstaddr) if addr: - msg = [0,KNXWRITEFLAG] +msg + msg = [0,KNXWRITEFLAG] + msg self.sendQueue.put((addr,msg)) #self.KNX.EIBSendGroup(addr,msg) except: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <net...@us...> - 2010-11-11 07:58:50
|
Revision: 103 http://openautomation.svn.sourceforge.net/openautomation/?rev=103&view=rev Author: netzkind Date: 2010-11-11 07:58:43 +0000 (Thu, 11 Nov 2010) Log Message: ----------- corrected CSS-URL for editor-mode Modified Paths: -------------- CometVisu/trunk/visu/edit_config.html Modified: CometVisu/trunk/visu/edit_config.html =================================================================== --- CometVisu/trunk/visu/edit_config.html 2010-11-10 23:25:23 UTC (rev 102) +++ CometVisu/trunk/visu/edit_config.html 2010-11-11 07:58:43 UTC (rev 103) @@ -5,7 +5,7 @@ <head> <title>Visu - Editor-Modus</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <link rel="stylesheet" type="text/css" href="style_orange.css" /> + <link rel="stylesheet" type="text/css" href="style_discreet.css" /> <link rel="stylesheet" type="text/css" href="edit/style_edit.css" /> <script src="lib/jquery.js" type="text/javascript"></script> <script src="lib/jquery-ui.js" type="text/javascript"></script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-10 23:25:30
|
Revision: 102 http://openautomation.svn.sourceforge.net/openautomation/?rev=102&view=rev Author: nilss1 Date: 2010-11-10 23:25:23 +0000 (Wed, 10 Nov 2010) Log Message: ----------- Fix locking on empty datastore.db Modified Paths: -------------- PyWireGate/trunk/WireGate.py PyWireGate/trunk/datastore.py Modified: PyWireGate/trunk/WireGate.py =================================================================== --- PyWireGate/trunk/WireGate.py 2010-11-10 16:20:00 UTC (rev 101) +++ PyWireGate/trunk/WireGate.py 2010-11-10 23:25:23 UTC (rev 102) @@ -147,10 +147,12 @@ getpath = lambda x: "/".join(x.split("/")[:-1]) ##Set Permissions on - os.chown(self.config['WireGate']['pidfile'],runasuser[2],runasuser[3]) - os.chown(self.config['WireGate']['logfile'],runasuser[2],runasuser[3]) - os.chown(self.config['WireGate']['datastore'],runasuser[2],runasuser[3]) + for sysfile in [self.config['WireGate']['pidfile'],self.config['WireGate']['logfile'],self.config['WireGate']['datastore']]: + if not os.path.exists(sysfile): + open(sysfile,'w').close() + os.chown(sysfile,runasuser[2],runasuser[3]) + ##removed until fixing permissions #os.setregid(runasuser[3],runasuser[3]) #os.setreuid(runasuser[2],runasuser[2]) Modified: PyWireGate/trunk/datastore.py =================================================================== --- PyWireGate/trunk/datastore.py 2010-11-10 16:20:00 UTC (rev 101) +++ PyWireGate/trunk/datastore.py 2010-11-10 23:25:23 UTC (rev 102) @@ -111,16 +111,19 @@ self.dataobjects[name].config = obj['config'] self.dataobjects[name].connected = obj['connected'] self.debug("%d entries loaded in DATASTORE" % len(self.dataobjects)) - self.locked.release() self.DBLOADED = True except IOError: ## no DB File pass - + except ValueError: + ## empty DB File + self.DBLOADED = True + pass except: self.WG.errorlog() ## error pass + self.locked.release() def save(self): @@ -167,10 +170,10 @@ def shutdown(self): self.cycleThreadLock.acquire() - for obj in self.cycleThreads: + for obj in self.cycleThreads.keys(): try: - obj.cancel() - obj.join() + self.cycleThreads[obj].cancel() + self.cycleThreads[obj].join() except: pass self.cycleThreadLock.release() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-10 16:20:07
|
Revision: 101 http://openautomation.svn.sourceforge.net/openautomation/?rev=101&view=rev Author: nilss1 Date: 2010-11-10 16:20:00 +0000 (Wed, 10 Nov 2010) Log Message: ----------- added sendcycle for datastore objects added sendcycleoption average Modified Paths: -------------- PyWireGate/trunk/datastore.py PyWireGate/trunk/owfs_connector/OWFS_Connector.py PyWireGate/trunk/owfs_connector/sensors.ini Modified: PyWireGate/trunk/datastore.py =================================================================== --- PyWireGate/trunk/datastore.py 2010-11-10 14:35:53 UTC (rev 100) +++ PyWireGate/trunk/datastore.py 2010-11-10 16:20:00 UTC (rev 101) @@ -33,6 +33,10 @@ self.log("DATASTORE starting up") self.DBLOADED = False self.dataobjects = {} + + self.cycleThreadLock = threading.RLock() + self.cycleThreads = {} + self.locked = threading.RLock() self.locked.acquire() ## Load JSON Database @@ -141,8 +145,37 @@ dbfile.write(utfdb) dbfile.close() + + def attachThread(self,obj,threadObj=False): + try: + self.cycleThreadLock.acquire() + ## check only + if not threadObj: + return obj in self.cycleThreads + self.cycleThreads[obj] = threadObj + finally: + self.cycleThreadLock.release() + + return self.cycleThreads[obj] + + + def removeThread(self,obj): + self.cycleThreadLock.acquire() + del self.cycleThreads[obj] + self.cycleThreadLock.release() + + def shutdown(self): + self.cycleThreadLock.acquire() + for obj in self.cycleThreads: + try: + obj.cancel() + obj.join() + except: + pass + self.cycleThreadLock.release() self.save() + def debug(self,msg): #################################################### @@ -198,6 +231,8 @@ ## connector specific vars self.config = {} + self.cyclestore = [] + ## connected Logics, communication objects ... goes here self.connected = [] @@ -213,6 +248,23 @@ self.write_mutex.release() def setValue(self,val,send=False): + if 'sendcycle' in self.config: + if not self.WG.DATASTORE.attachThread(self): + self._parent.debug("start Cycle ID: %s" % self.id) + cycletime = float(self.config['sendcycle']) + self.lastupdate - time.time() + if cycletime < 0.0: + cycletime = 0 + self.cyclestore.append(val) + _cyclethread = self.WG.DATASTORE.attachThread(self,threading.Timer(cycletime,self._cycle)) + #_cyclethread.setDaemon(1) + _cyclethread.start() + else: + self._parent.debug("ignore Cycle ID: %s" % self.id) + self.cyclestore.append(val) + else: + self._real_setValue(val,send) + + def _real_setValue(self,val,send): try: ## get read lock self.read_mutex.acquire() @@ -241,4 +293,18 @@ ## release lock self.read_mutex.release() - + def _cycle(self): + self._parent.debug("execute Cycle ID: %s" % self.id) + self.WG.DATASTORE.removeThread(self) + val = self.getValue() + if 'sendcycleoption' in self.config: + if self.config['sendcycleoption'] == 'average' and type(self.cyclestore[0]) in (int,float): + val = type(self.cyclestore[0])(0) + for i in self.cyclestore: + val += i + val = val / len(self.cyclestore) + self._parent.debug("Cycle ID: %s average: %f (%r)" % (self.id, val, self.cyclestore )) + self.cyclestore = [] + else: + val = self.cyclestore.pop() + self._real_setValue(val,False) Modified: PyWireGate/trunk/owfs_connector/OWFS_Connector.py =================================================================== --- PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-10 14:35:53 UTC (rev 100) +++ PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-10 16:20:00 UTC (rev 101) @@ -37,7 +37,7 @@ self.mutex = threading.RLock() defaultconfig = { - 'cycletime' : 60, + 'cycletime' : 15, 'server' : '127.0.0.1', 'port' : 4304 } Modified: PyWireGate/trunk/owfs_connector/sensors.ini =================================================================== --- PyWireGate/trunk/owfs_connector/sensors.ini 2010-11-10 14:35:53 UTC (rev 100) +++ PyWireGate/trunk/owfs_connector/sensors.ini 2010-11-10 16:20:00 UTC (rev 101) @@ -2,9 +2,11 @@ [DS18B20] -cycle = 60 +cycle = 15 interfaces = temperature,power config_temperature_resolution = 10 +config_temperature_sendcycle = 60 +config_temperature_sendcycleoption = average [DS2438] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-10 14:35:59
|
Revision: 100 http://openautomation.svn.sourceforge.net/openautomation/?rev=100&view=rev Author: nilss1 Date: 2010-11-10 14:35:53 +0000 (Wed, 10 Nov 2010) Log Message: ----------- sensor interfaces and default configs read from sensors.ini Modified Paths: -------------- PyWireGate/trunk/owfs_connector/OWFS_Connector.py Added Paths: ----------- PyWireGate/trunk/owfs_connector/sensors.ini Modified: PyWireGate/trunk/owfs_connector/OWFS_Connector.py =================================================================== --- PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-10 14:34:28 UTC (rev 99) +++ PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-10 14:35:53 UTC (rev 100) @@ -37,7 +37,7 @@ self.mutex = threading.RLock() defaultconfig = { - 'cycletime' : 15, + 'cycletime' : 60, 'server' : '127.0.0.1', 'port' : 4304 } @@ -51,31 +51,54 @@ self.issensor = re.compile(r"[0-9][0-9]\x2E[0-9a-fA-F]+") self.isbus = re.compile(r"\x2Fbus\x2E([0-9])+$", re.MULTILINE) - ## Sensors and their interfaces .. maybe import from a config file ? - self.supportedsensors = { - "DS1420":[], - "DS18B20" : [ - 'temperature', - 'power' - ], - "DS2438":[ - 'temperature', - 'humidity', - 'vis', - 'VDD' - ] - } + owfsdir = str(connection).split( )[3][1:-17] + ## Sensors and their interfaces + self.debug("Read ini file from %s" % owfsdir+"/sensors.ini") + sensorconfig = self.WG.readConfig(owfsdir+"/sensors.ini") + self.supportedsensors = {} + for sensor in sensorconfig.keys(): + ## add sensors + self.supportedsensors[sensor] = {} + cycledefault = defaultconfig['cycletime'] + if 'cycle' in sensorconfig[sensor]: + cycledefault = sensorconfig[sensor]['cycle'] + del sensorconfig[sensor]['cycle'] + if 'interfaces' in sensorconfig[sensor]: + self.supportedsensors[sensor]['interfaces'] = {} + for interface in sensorconfig[sensor]['interfaces'].split(","): + self.supportedsensors[sensor]['interfaces'][interface] = {'config': {'cycle':cycledefault} } + ## remove Interface key from dict + del sensorconfig[sensor]['interfaces'] + + for key in sensorconfig[sensor].keys(): + if key.startswith("config_"): + try: + cfg,interface,config = key.split("_",2) + self.supportedsensors[sensor]['interfaces'][interface]['config'][config] = sensorconfig[sensor][key] + print self.supportedsensors[sensor]['interfaces'][interface] + except KeyError: + pass + + #self.supportedsensors = self.WG.readConfig(owfsdir+"/sensors.ini") ## Local-list for the sensors self.busmaster = {} self.sensors = {} self.start() + def checkConfigDefaults(self,obj,default): + try: + for cfg in default['config'].keys(): + if cfg not in obj.config: + obj.config[cfg] = default['config'][cfg] + except: + pass + def get_ds_defaults(self,id): ## the defualt config for new Datasotre Items config = {} - if id[-11:] == 'temperature': - config['resolution'] = 10 + #if id[-11:] == 'temperature': + # config['resolution'] = 10 return config def run(self): @@ -136,13 +159,16 @@ finally: self.mutex.release() self.findsensors(bus) + self.checkBusCycleTime(bus) except: ## ignore all OWFS Errors pass return nochilds + def checkBusCycleTime(self,bus): + pass + - def findsensors(self,path=""): uncachedpath = "/uncached%s" % path for sensor in self.owfs.dir(uncachedpath): @@ -158,29 +184,24 @@ except: ## ignore all OWFS Errors continue - interfaces = [] - try: - ## check if sensort is supported - interfaces = self.supportedsensors[sensortype] - ### add it to the list of active sensors - ## FIXME: check for old sensor no longer active and remove - try: - self.mutex.acquire() - self.busmaster[path]['sensors'][sensor] = { - 'type':sensortype, - 'interfaces':interfaces, - 'resolution':'10' ## Resolution schould be read from Datastore - } - finally: - self.mutex.release() - - except KeyError: + if sensortype not in self.supportedsensors: self.debug("unsupported Type: %r" % sensortype) + continue + if 'interfaces' not in self.supportedsensors[sensortype]: + self.debug("Sensor Type: %r has no supported Interfaces" % sensortype) continue - except: - self.WG.errorlog() + + ### add it to the list of active sensors + ## FIXME: check for old sensor no longer active and remove + try: + self.mutex.acquire() + self.busmaster[path]['sensors'][sensor] = { + 'type':sensortype, + 'interfaces': self.supportedsensors[sensortype]['interfaces'] + } + finally: + self.mutex.release() - def _read(self,busname): @@ -191,12 +212,14 @@ #self.sensors[sensor]['power'] = self.owfs.read("/"+sensor+"/power") ## loop through their interfaces - for get in self.busmaster[busname]['sensors'][sensor]['interfaces']: + for get in self.busmaster[busname]['sensors'][sensor]['interfaces'].keys(): resolution = "" id = "%s:%s_%s" % (self.instanceName,sensor,get) ## get the Datastore Object and look for config obj = self.WG.DATASTORE.get(id) + sensortype = self.busmaster[busname]['sensors'][sensor]['type'] + self.checkConfigDefaults(obj,self.supportedsensors[sensortype]['interfaces'][get]) if "resolution" in obj.config: resolution = str(obj.config['resolution']) @@ -236,3 +259,5 @@ self.busmaster[busname]['readthread'].start() finally: self.mutex.release() + + Added: PyWireGate/trunk/owfs_connector/sensors.ini =================================================================== --- PyWireGate/trunk/owfs_connector/sensors.ini (rev 0) +++ PyWireGate/trunk/owfs_connector/sensors.ini 2010-11-10 14:35:53 UTC (rev 100) @@ -0,0 +1,12 @@ +[DS1420] + + +[DS18B20] +cycle = 60 +interfaces = temperature,power +config_temperature_resolution = 10 + + +[DS2438] +cycle = 60 +interfaces = temperature,humidity,vis,VDD This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-10 14:34:34
|
Revision: 99 http://openautomation.svn.sourceforge.net/openautomation/?rev=99&view=rev Author: nilss1 Date: 2010-11-10 14:34:28 +0000 (Wed, 10 Nov 2010) Log Message: ----------- Changed datastore save to shutdown Modified Paths: -------------- PyWireGate/trunk/WireGate.py PyWireGate/trunk/datastore.py Modified: PyWireGate/trunk/WireGate.py =================================================================== --- PyWireGate/trunk/WireGate.py 2010-11-10 13:46:13 UTC (rev 98) +++ PyWireGate/trunk/WireGate.py 2010-11-10 14:34:28 UTC (rev 99) @@ -191,18 +191,20 @@ pass ## now save Datastore - self.DATASTORE.save() + self.DATASTORE.shutdown() ## Handle Errors def errorlog(self,msg=False): - exc_type, exc_value, exc_traceback = sys.exc_info() - tback = traceback.extract_tb(exc_traceback) - #type(self.ErrorLOGGER) - #print tback - #print exc_type, exc_value + try: + exc_type, exc_value, exc_traceback = sys.exc_info() + tback = traceback.extract_tb(exc_traceback) + except: + exc_value = "" + exc_type = "" + tback = "" + pass if msg: - #print repr(msg) self.ErrorLOGGER.error(repr(msg)) errmsg = "%r %r %r" % (exc_type, exc_value,tback) self.ErrorLOGGER.error(errmsg) Modified: PyWireGate/trunk/datastore.py =================================================================== --- PyWireGate/trunk/datastore.py 2010-11-10 13:46:13 UTC (rev 98) +++ PyWireGate/trunk/datastore.py 2010-11-10 14:34:28 UTC (rev 99) @@ -141,7 +141,8 @@ dbfile.write(utfdb) dbfile.close() - + def shutdown(self): + self.save() def debug(self,msg): #################################################### @@ -240,4 +241,4 @@ ## release lock self.read_mutex.release() - + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <net...@us...> - 2010-11-10 13:46:19
|
Revision: 98 http://openautomation.svn.sourceforge.net/openautomation/?rev=98&view=rev Author: netzkind Date: 2010-11-10 13:46:13 +0000 (Wed, 10 Nov 2010) Log Message: ----------- Editor: validate GA correctly Modified Paths: -------------- CometVisu/trunk/visu/edit/visuconfig_edit.js Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js =================================================================== --- CometVisu/trunk/visu/edit/visuconfig_edit.js 2010-11-10 10:38:59 UTC (rev 97) +++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2010-11-10 13:46:13 UTC (rev 98) @@ -361,7 +361,7 @@ switch (type) { case "address": - return Boolean(val.match(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,2}$/) != null); + return Boolean(val.match(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,3}$/) != null); break; case "numeric": return Boolean(val.match(/^\d+([\.,]\d+)?$/g)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-10 10:39:05
|
Revision: 97 http://openautomation.svn.sourceforge.net/openautomation/?rev=97&view=rev Author: nilss1 Date: 2010-11-10 10:38:59 +0000 (Wed, 10 Nov 2010) Log Message: ----------- only use priority Queue if more then 10 Messages in Queue Modified Paths: -------------- PyWireGate/trunk/knx_connector/KNX_Connector.py Modified: PyWireGate/trunk/knx_connector/KNX_Connector.py =================================================================== --- PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-10 09:40:34 UTC (rev 96) +++ PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-10 10:38:59 UTC (rev 97) @@ -213,7 +213,10 @@ def _put(self, item): ## add addr to active addr addr = item[0] - prio = int(self.activeaddr.count(addr) > 5) + prio = 0 + if len(self.queue) > 10: + ## if queue size is over 10 use priority + prio = int(self.activeaddr.count(addr) > 5) self.activeaddr.append(addr) heapq.heappush(self.queue,(prio,item)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-10 09:40:40
|
Revision: 96 http://openautomation.svn.sourceforge.net/openautomation/?rev=96&view=rev Author: nilss1 Date: 2010-11-10 09:40:34 +0000 (Wed, 10 Nov 2010) Log Message: ----------- use priority based queue for knx messages, add an optional per connector method _shutdown to join local threads on exit Modified Paths: -------------- PyWireGate/trunk/connector.py PyWireGate/trunk/knx_connector/KNX_Connector.py Modified: PyWireGate/trunk/connector.py =================================================================== --- PyWireGate/trunk/connector.py 2010-11-09 13:42:57 UTC (rev 95) +++ PyWireGate/trunk/connector.py 2010-11-10 09:40:34 UTC (rev 96) @@ -30,6 +30,8 @@ def shutdown(self): self.log("%s (%s) shutting down" % (self.CONNECTOR_NAME, self.instanceName) ,'info','WireGate') self.isrunning=False + if hasattr(self,'_shutdown'): + self._shutdown() self._thread.join(2) if self._thread.isAlive(): self.log("Shutdown Failed",'critical') Modified: PyWireGate/trunk/knx_connector/KNX_Connector.py =================================================================== --- PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-09 13:42:57 UTC (rev 95) +++ PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-10 09:40:34 UTC (rev 96) @@ -24,6 +24,9 @@ import BusMonitor import GroupSocket import DPT_Types +from Queue import Empty,Full,Queue +import heapq +import threading KNXREADFLAG = 0x00 KNXRESPONSEFLAG = 0x40 @@ -42,10 +45,16 @@ self.KNXBuffer = EIBConnection.EIBBuffer() self.KNXSrc = EIBConnection.EIBAddr() self.KNXDst = EIBConnection.EIBAddr() + + #self.sendQueue = Queue.PriorityQueue(maxsize=5000) + self.sendQueue = KNXSendQueue(maxsize=5000) + + self.busmon = BusMonitor.busmonitor(self) self.groupsocket = GroupSocket.groupsocket(self) self.dpt = DPT_Types.dpt_type(self) + self.GrpAddrRegex = re.compile(r"(?:|(\d+)\x2F)(\d+)\x2F(\d+)$",re.MULTILINE) ## Deafaultconfig @@ -64,6 +73,9 @@ self.start() def run(self): + self._sendThread = threading.Thread(target=self._sendloop) + self._sendThread.setDaemon(True) + self._sendThread.start() while self.isrunning: ## Create Socket try: @@ -89,6 +101,12 @@ self.debug("Socket %r Closed waiting 5 sec" % self.config['url']) self.idle(5) + def _shutdown(self): + try: + self._sendThread.join() + except: + pass + def _run(self): while self.isrunning: ## Check if we are alive and responde until 10 secs @@ -140,14 +158,29 @@ return addr + def _sendloop(self): + addr = 0 + msg = [] + while self.isrunning: + try: + (addr,msg) = self.sendQueue.get(timeout=1) + self.KNX.EIBSendGroup(addr,msg) + except Empty: + pass + except: + self.WG.errorlog("Failed send %r %r" % (addr,msg)) + + + def send(self,msg,dstaddr): try: addr = self.str2grpaddr(dstaddr) if addr: msg = [0,KNXWRITEFLAG] +msg - self.KNX.EIBSendGroup(addr,msg) + self.sendQueue.put((addr,msg)) + #self.KNX.EIBSendGroup(addr,msg) except: - self.errormsg("Failed send %r to %r" % (msg,dstaddr)) + self.WG.errorlog("Failed send %r to %r" % (msg,dstaddr)) def setValue(self,dsobj,msg=False): try: @@ -156,4 +189,38 @@ self.debug("SEND %r to %s (%s)" % (msg,dsobj.name,dsobj.id)) self.send(self.dpt.encode(msg,dsobj=dsobj),dsobj.id) except: - print "----------- ERROR IN KNX_CONNECTOR.setValue ----------------" \ No newline at end of file + print "----------- ERROR IN KNX_CONNECTOR.setValue ----------------" + + +class KNXSendQueue(Queue): + def _init(self, maxsize): + self.maxsize = maxsize + self.queue = [] + self.activeaddr = [] + + def _qsize(self): + return len(self.queue) + + # Check whether the queue is empty + def _empty(self): + return not self.queue + + # Check whether the queue is full + def _full(self): + return self.maxsize > 0 and len(self.queue) == self.maxsize + + # Put a new item in the queue + def _put(self, item): + ## add addr to active addr + addr = item[0] + prio = int(self.activeaddr.count(addr) > 5) + self.activeaddr.append(addr) + heapq.heappush(self.queue,(prio,item)) + + # Get an item from the queue + def _get(self): + prio,item = heapq.heappop(self.queue) + addr = item[0] + self.activeaddr.remove(addr) + return item + \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-09 13:43:03
|
Revision: 95 http://openautomation.svn.sourceforge.net/openautomation/?rev=95&view=rev Author: nilss1 Date: 2010-11-09 13:42:57 +0000 (Tue, 09 Nov 2010) Log Message: ----------- remove simplejson Removed Paths: ------------- PyWireGate/trunk/simplejson/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-09 12:45:07
|
Revision: 94 http://openautomation.svn.sourceforge.net/openautomation/?rev=94&view=rev Author: nilss1 Date: 2010-11-09 12:45:00 +0000 (Tue, 09 Nov 2010) Log Message: ----------- changed mutex to not lock on reading Modified Paths: -------------- PyWireGate/trunk/owfs_connector/OWFS_Connector.py Modified: PyWireGate/trunk/owfs_connector/OWFS_Connector.py =================================================================== --- PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-09 09:48:10 UTC (rev 93) +++ PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-09 12:45:00 UTC (rev 94) @@ -204,9 +204,10 @@ self.debug("Reading from path %s" % owfspath) try: ## read uncached and put into local-list + data = self.owfs.read(owfspath) try: self.mutex.acquire() - self.busmaster[busname]['sensors'][sensor][get] = self.owfs.read(owfspath) + self.busmaster[busname]['sensors'][sensor][get] = data finally: self.mutex.release() except: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ni...@us...> - 2010-11-09 09:48:17
|
Revision: 93 http://openautomation.svn.sourceforge.net/openautomation/?rev=93&view=rev Author: nilss1 Date: 2010-11-09 09:48:10 +0000 (Tue, 09 Nov 2010) Log Message: ----------- OWFS Threads use mutex * get default configs for unknown datastore objects * except errors in knx_connector _setValue Function Modified Paths: -------------- PyWireGate/trunk/connector.py PyWireGate/trunk/datastore.py PyWireGate/trunk/knx_connector/KNX_Connector.py PyWireGate/trunk/owfs_connector/OWFS_Connector.py Modified: PyWireGate/trunk/connector.py =================================================================== --- PyWireGate/trunk/connector.py 2010-11-07 09:51:00 UTC (rev 92) +++ PyWireGate/trunk/connector.py 2010-11-09 09:48:10 UTC (rev 93) @@ -52,6 +52,12 @@ self.log("unconfigured setValue in %r called for %s" % (self,dsobj.name) ,'warn','WireGate') pass + def get_ds_defaults(self,id): + ## the defualt config for new Datasotre Items + config = { + } + return config + import SocketServer import socket class ConnectorServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer,Connector): Modified: PyWireGate/trunk/datastore.py =================================================================== --- PyWireGate/trunk/datastore.py 2010-11-07 09:51:00 UTC (rev 92) +++ PyWireGate/trunk/datastore.py 2010-11-09 09:48:10 UTC (rev 93) @@ -8,7 +8,11 @@ ## use included json in > Python 2.6 import json except ImportError: - import simplejson as json + try: + import simplejson as json + except ImportError: + print >>sys.stderr, "apt-get install python-simplejson" + sys.exit(1) class datastore: @@ -35,7 +39,7 @@ self.load() - def update(self,id,val): + def update(self,id,val,connector=False): ## Update the communication Object with value #################################################### ## Function: update @@ -48,7 +52,7 @@ #################################################### ## ## get the Datastore object - obj = self.get(id) + obj = self.get(id,connector=connector) self.debug("Updating %s (%s): %r" % (obj.name,id,val)) ## Set the value of the object @@ -68,7 +72,7 @@ ## return the object for additional updates return obj - def get(self,id): + def get(self,id,connector=False): #################################################### ## Function: get ## Parameter: @@ -84,6 +88,8 @@ except KeyError: ## create a new one if it don't exist self.dataobjects[id] = dataObject(self,id) + if connector: + self.dataobjects[id].config = connector.get_ds_defaults(id) ## return it self.locked.release() return self.dataobjects[id] @@ -133,7 +139,6 @@ dbfile = codecs.open(self.WG.config['WireGate']['datastore'],"wb",encoding='utf-8') utfdb = json.dumps(savedict,dbfile,ensure_ascii=False,sort_keys=True,indent=3) dbfile.write(utfdb) - #json.dump(savedict,dbfile,sort_keys=True,indent=3) dbfile.close() @@ -199,8 +204,12 @@ ## self override ## override with connector send function if self.namespace: - self._setValue = self.WG.connectors[self.namespace].setValue - self.WG.connectors[self.namespace].setValue(refered_self) + try: + self.write_mutex.acquire() + self._setValue = self.WG.connectors[self.namespace].setValue + self.WG.connectors[self.namespace].setValue(refered_self) + finally: + self.write_mutex.release() def setValue(self,val,send=False): try: Modified: PyWireGate/trunk/knx_connector/KNX_Connector.py =================================================================== --- PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-07 09:51:00 UTC (rev 92) +++ PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-09 09:48:10 UTC (rev 93) @@ -150,8 +150,10 @@ self.errormsg("Failed send %r to %r" % (msg,dstaddr)) def setValue(self,dsobj,msg=False): - if not msg: - msg = dsobj.getValue() - self.debug("SEND %r to %s (%s)" % (msg,dsobj.name,dsobj.id)) - self.send(self.dpt.encode(msg,dsobj=dsobj),dsobj.id) - \ No newline at end of file + try: + if not msg: + msg = dsobj.getValue() + self.debug("SEND %r to %s (%s)" % (msg,dsobj.name,dsobj.id)) + self.send(self.dpt.encode(msg,dsobj=dsobj),dsobj.id) + except: + print "----------- ERROR IN KNX_CONNECTOR.setValue ----------------" \ No newline at end of file Modified: PyWireGate/trunk/owfs_connector/OWFS_Connector.py =================================================================== --- PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-07 09:51:00 UTC (rev 92) +++ PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-09 09:48:10 UTC (rev 93) @@ -34,6 +34,8 @@ self.WG = False self.instanceName = instanceName + self.mutex = threading.RLock() + defaultconfig = { 'cycletime' : 15, 'server' : '127.0.0.1', @@ -69,6 +71,13 @@ self.sensors = {} self.start() + def get_ds_defaults(self,id): + ## the defualt config for new Datasotre Items + config = {} + if id[-11:] == 'temperature': + config['resolution'] = 10 + return config + def run(self): cnt = 10 while self.isrunning: @@ -113,15 +122,19 @@ if self.findbusmaster(bus): ## if this has no subbuses add it to the list try: - ## check if bus already in list and set time - self.busmaster[bus]['lastseen'] = time.time() - except KeyError: - ## add to list - self.busmaster[bus] = { - 'sensors' : {}, - 'lastseen' : time.time(), - 'readthread' : None - } + self.mutex.acquire() + try: + ## check if bus already in list and set time + self.busmaster[bus]['lastseen'] = time.time() + except KeyError: + ## add to list + self.busmaster[bus] = { + 'sensors' : {}, + 'lastseen' : time.time(), + 'readthread' : None + } + finally: + self.mutex.release() self.findsensors(bus) except: ## ignore all OWFS Errors @@ -151,11 +164,15 @@ interfaces = self.supportedsensors[sensortype] ### add it to the list of active sensors ## FIXME: check for old sensor no longer active and remove - self.busmaster[path]['sensors'][sensor] = { - 'type':sensortype, - 'interfaces':interfaces, - 'resolution':'10' ## Resolution schould be read from Datastore - } + try: + self.mutex.acquire() + self.busmaster[path]['sensors'][sensor] = { + 'type':sensortype, + 'interfaces':interfaces, + 'resolution':'10' ## Resolution schould be read from Datastore + } + finally: + self.mutex.release() except KeyError: self.debug("unsupported Type: %r" % sensortype) @@ -181,12 +198,17 @@ ## get the Datastore Object and look for config obj = self.WG.DATASTORE.get(id) if "resolution" in obj.config: - resolution = obj.config['resolution'] + resolution = str(obj.config['resolution']) owfspath = "/uncached/%s/%s%s" % (sensor,get,resolution) + self.debug("Reading from path %s" % owfspath) try: ## read uncached and put into local-list - self.busmaster[busname]['sensors'][sensor][get] = self.owfs.read(owfspath) + try: + self.mutex.acquire() + self.busmaster[busname]['sensors'][sensor][get] = self.owfs.read(owfspath) + finally: + self.mutex.release() except: ## ignore all OWFS Errors self.WG.errorlog("Reading from path %s failed" % owfspath) @@ -199,7 +221,7 @@ except: self.WG.errorlog() self.busmaster[busname]['readthread'] = None - self.debug("Thread for %s finshed reading %d sensors in % f secs " % (busname,len(self.busmaster[busname]['sensors']), time.time() - readtime)) + self.debug("Thread for %s finshed reading %d sensors in %f secs " % (busname,len(self.busmaster[busname]['sensors']), time.time() - readtime)) def read(self): for busname in self.busmaster.keys(): @@ -207,5 +229,9 @@ if not self.busmaster[busname]['readthread']: self.debug("Start read Thread for %s" % busname) threadname = "OWFS-Reader_%s" % busname - self.busmaster[busname]['readthread'] = threading.Thread(target=self._read,args=[busname],name=threadname) - self.busmaster[busname]['readthread'].start() + try: + self.mutex.acquire() + self.busmaster[busname]['readthread'] = threading.Thread(target=self._read,args=[busname],name=threadname) + self.busmaster[busname]['readthread'].start() + finally: + self.mutex.release() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <net...@us...> - 2010-11-07 09:51:07
|
Revision: 92 http://openautomation.svn.sourceforge.net/openautomation/?rev=92&view=rev Author: netzkind Date: 2010-11-07 09:51:00 +0000 (Sun, 07 Nov 2010) Log Message: ----------- "discreet": added highlight to unpressed button Modified Paths: -------------- CometVisu/trunk/visu/style_discreet.css Modified: CometVisu/trunk/visu/style_discreet.css =================================================================== --- CometVisu/trunk/visu/style_discreet.css 2010-11-06 23:29:03 UTC (rev 91) +++ CometVisu/trunk/visu/style_discreet.css 2010-11-07 09:51:00 UTC (rev 92) @@ -176,6 +176,8 @@ border-width: 1px 2px 2px 1px; border-color: #282828 #010101 #010101 #282828; margin-top: 0px; + background-color: #3A3A3A; + background-position: center +2px; } .switchUnpressed div, .switchPressed div { @@ -192,6 +194,7 @@ border-width: 2px 1px 1px 2px; border-color: #010101 #282828 #282828 #010101; margin-top: 1px; + background-position: center -2px; } .switchUnpressed div { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |