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
(1) |
Oct
(11) |
Nov
(2) |
Dec
|
|
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.
|
|
From: <net...@us...> - 2010-11-07 00:04:45
|
Revision: 90
http://openautomation.svn.sourceforge.net/openautomation/?rev=90&view=rev
Author: netzkind
Date: 2010-11-06 22:51:09 +0000 (Sat, 06 Nov 2010)
Log Message:
-----------
fixed error in logic for address syntax check
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-06 18:48:39 UTC (rev 89)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2010-11-06 22:51:09 UTC (rev 90)
@@ -361,7 +361,7 @@
switch (type) {
case "address":
- return !Boolean(val.match(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,2}$/));
+ return Boolean(val.match(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,2}$/) != 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-06 23:29:10
|
Revision: 91
http://openautomation.svn.sourceforge.net/openautomation/?rev=91&view=rev
Author: nilss1
Date: 2010-11-06 23:29:03 +0000 (Sat, 06 Nov 2010)
Log Message:
-----------
no longer get WireGateInstance as Argument to new Classes, instead user parent Class and make self.WG = parent.WG.
This way each class can reach all parents using self._parent
Modified Paths:
--------------
PyWireGate/trunk/WireGate.py
PyWireGate/trunk/comet_server/CometServer.py
PyWireGate/trunk/connector.py
PyWireGate/trunk/console_server/consoleserver.py
PyWireGate/trunk/cycler.py
PyWireGate/trunk/datastore.py
PyWireGate/trunk/knx_connector/BusMonitor.py
PyWireGate/trunk/knx_connector/DPT_Types.py
PyWireGate/trunk/knx_connector/GroupSocket.py
PyWireGate/trunk/knx_connector/KNX_Connector.py
PyWireGate/trunk/owfs_connector/OWFS_Connector.py
Modified: PyWireGate/trunk/WireGate.py
===================================================================
--- PyWireGate/trunk/WireGate.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/WireGate.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -31,6 +31,7 @@
class WireGate(daemon.Daemon):
def __init__(self,REDIRECTIO=False):
+ self._parent = self
self.WG = self
self.watchdoglist = {}
self.connectors = {}
Modified: PyWireGate/trunk/comet_server/CometServer.py
===================================================================
--- PyWireGate/trunk/comet_server/CometServer.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/comet_server/CometServer.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -33,8 +33,12 @@
CONNECTOR_NAME = 'Comet Server'
CONNECTOR_VERSION = 0.1
CONNECTOR_LOGNAME = 'comet_server'
- def __init__(self,WireGateInstance, instanceName):
- self.WG = WireGateInstance
+ def __init__(self,parent, instanceName):
+ self._parent = parent
+ if parent:
+ self.WG = parent.WG
+ else:
+ self.WG = False
self.instanceName = instanceName
defaultconfig = {
'port' : 4498
Modified: PyWireGate/trunk/connector.py
===================================================================
--- PyWireGate/trunk/connector.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/connector.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -7,8 +7,9 @@
CONNECTOR_LOGNAME = __name__
isrunning=False
- def __init__(self,WireGateInstance,instanceName):
- self.WG = WireGateInstance
+ def __init__(self,parent,instanceName):
+ self._parent = parent
+ self.WG = parent.WG
self.instanceName = instanceName
"""Overide"""
def start(self):
@@ -24,7 +25,7 @@
def log(self,msg,severity='info',instance=False):
if not instance:
instance = self.instanceName
- self.WG.log(msg,severity,instance)
+ self._parent.log(msg,severity,instance)
def shutdown(self):
self.log("%s (%s) shutting down" % (self.CONNECTOR_NAME, self.instanceName) ,'info','WireGate')
Modified: PyWireGate/trunk/console_server/consoleserver.py
===================================================================
--- PyWireGate/trunk/console_server/consoleserver.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/console_server/consoleserver.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -35,8 +35,12 @@
CONNECTOR_VERSION = 0.1
CONNECTOR_LOGNAME = 'console_server'
- def __init__(self,WireGateInstance, instanceName):
- self.WG = WireGateInstance
+ def __init__(self,parent, instanceName):
+ self._parent = parent
+ if parent:
+ self.WG = parent.WG
+ else:
+ self.WG = False
self.instanceName = instanceName
defaultconfig = {
'port' : 4401
Modified: PyWireGate/trunk/cycler.py
===================================================================
--- PyWireGate/trunk/cycler.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/cycler.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -20,101 +20,146 @@
import time
-class cycler:
- def __init__(self,WireGateInstance):
- self.WG = WireGateInstance
-
+class TaskRunner:
+ def __init__(self,parent):
+ self._parent = parent
+ if parent:
+ self.WG = parent.WG
+ else:
+ self.WG = False
self.isrunning = True
- ## Dummy Timer
+
self.waiting = threading.Timer(0,lambda: None)
- self.waiting.setDaemon(1)
+
+
self.mutex = threading.RLock()
+
+ ## function for time based sortingg of tasks
self.getTime = lambda x: x.getTime
- self.timerList = []
+
+ ## all not running tasks goes here
+ self.taskList = []
+
+ ## all started tasks goes here
self.running = {}
def debug(self,msg):
print "DEBUG Cycler: %s" % msg
- def remove(self, obj):
+
+ def remove(self, task):
if not self.isrunning:
- ## dont try to get a mutex
+
+ ## dont try to get a mutex on shutdown
return False
try:
self.mutex.acquire()
- if obj in self.timerList:
+ if task in self.taskList:
try:
- self.timerList.remove(obj)
+ self.taskList.remove(task)
except:
pass
- self.debug("Removed %r" % obj.action)
- if len(self.timerList) == 0:
+ self.debug("Removed %r" % task.action)
+ if len(self.taskList) == 0:
## kill waiting timer
self.debug("Cancel GLobal wait")
self.waiting.cancel()
- if obj in self.running:
+
+ if task in self.running:
try:
- if self.running[obj].isAlive():
- self.running[obj].cancel()
- self.debug("Canceled %r" % obj.args)
+ if self.running[task].isAlive():
+ self.running[task].cancel()
+ self.debug("Canceled %r" % task.args)
finally:
- self.debug("terminated %r" % obj.args)
- del self.running[obj]
+ self.debug("terminated %r" % task.args)
+ del self.running[task]
finally:
self.mutex.release()
+
+
+ def event(self,rtime,function,*args,**kwargs):
+ if not self.isrunning:
+ ## dont try to get a mutex
+ return False
+ self.debug("adding event: %r (%r / %r)" % (function,args,kwargs))
+ ## rtime is a date as unix timestamp
+ rtime = rtime - time.time()
+ if rtime >0:
+ task = Task(self,rtime,function,args=args,kwargs=kwargs)
+ self._Shedule(task)
+ return task
+ else:
+ print "expired %r (%r / %r)" % (function,args,kwargs)
+
def add(self,rtime,function,*args,**kwargs):
if not self.isrunning:
## dont try to get a mutex
return False
self.debug("adding task: %r (%r / %r)" % (function,args,kwargs))
- self.addShedule(sheduleObject(self,self.WG,rtime,function,args=args,kwargs=kwargs))
+ task = Task(self,rtime,function,args=args,kwargs=kwargs)
+ self._Shedule(task)
+ return task
def cycle(self,rtime,function,*args,**kwargs):
if not self.isrunning:
## dont try to get a mutex
return False
self.debug("adding cycliv task: %r (%r / %r)" % (function,args,kwargs))
- self.addShedule(sheduleObject(self,self.WG,rtime,function,cycle=True,args=args,kwargs=kwargs))
+ task = Task(self,rtime,function,cycle=True,args=args,kwargs=kwargs)
+ self._Shedule(task)
+ return task
- def addShedule(self,shed):
- print "ADD _shed %r" % shed
+ def _Shedule(self,task):
+ print "adding task %r" % task
self.mutex.acquire()
- self.timerList.append(shed)
+ self.taskList.append(task)
+
## Try to stop running timer
+ ## Fixme isalive
try:
self.waiting.cancel()
except:
pass
- self.timerList.sort(key=self.getTime)
+
+ self.taskList.sort(key=self.getTime)
self.mutex.release()
## check if any Timer need activation
self._check()
- return shed
-
-
+
def _check(self):
self.debug("Cycle")
try:
self.mutex.acquire()
+ print "acitve tasks %d " % threading.activeCount()
+ atasks = "Active tasks: "
+ for rtask in threading.enumerate():
+ atasks += " %r" % rtask.getName()
+
+
+ print atasks
## all actions that need activation in next 60seconds
- for shedobj in filter(lambda x: x.getTime() < 60, self.timerList):
+ for task in filter(lambda x: x.getTime() < 60, self.taskList):
try:
- self.running[shedobj] = threading.Timer(shedobj.getTime(),shedobj.run)
- self.running[shedobj].start()
- #print "run %s" % t.name
+ exectime = task.getTime()
+ name = "event"
+ if task.cycle:
+ name = "cycle"
+ self.running[task] = threading.Timer(exectime,task.run)
+ self.running[task].setName("%s_%r" % (name,time.asctime(time.localtime(task.timer))))
+ self.running[task].start()
except:
print "Failed"
raise
- ## remove from List because its now in the past
- self.timerList.remove(shedobj)
+ ## remove from List because its now active
+ self.taskList.remove(task)
finally:
- if len(self.timerList) >0:
- print "Wait for later timer %r" % (self.timerList[0].getTime()-5)
- self.waiting = threading.Timer(self.timerList[0].getTime()-5 ,self._check)
+ if len(self.taskList) >0:
+ print "Wait for later timer %r" % (self.taskList[0].getTime()-5)
+ self.waiting = threading.Timer(self.taskList[0].getTime()-5 ,self._check)
self.waiting.start()
self.mutex.release()
@@ -125,35 +170,36 @@
try:
## stop all new timer
self.mutex.acquire()
+ self.taskList = []
+ for task in self.running.keys():
+ print "acitve tasks %d " % threading.activeCount()
+ print "cancel task %r" % task.args
+ try:
+ rtask = self.running.pop(task)
+ rtask.cancel()
+ rtask.join()
+ except:
+ pass
+
+ print self.waiting
+
print "Have Mutex"
- self.waiting.cancel()
try:
- self.waiting.join(2)
+ self.waiting.cancel()
+ self.waiting.join()
except:
- ## maybe not even running
pass
print "Thread canceld"
- self.timerList = []
- for obj in self.running.keys():
- print "cancel task %r" % obj.args
- try:
- tobecanceled = self.running.pop(obj)
-
- except:
- pass
- tobecanceled.cancel()
- tobecanceled.is
- tobecanceled.join(2)
-
-
+
+
except:
self.debug("SHUTDOWN FAILED")
-class sheduleObject:
- def __init__(self,parent,WireGateInstance,rtime,function,cycle=False,args = [],kwargs={}):
+class Task:
+ def __init__(self,parent,rtime,function,cycle=False,args = [],kwargs={}):
self.Parent = parent
- self.WG = WireGateInstance
+ self.WG = parent.WG
self.delay = rtime
self.cycle = cycle
self._set()
@@ -171,7 +217,7 @@
self.Parent.remove(self)
if self.cycle:
self._set()
- self.Parent.addShedule(self)
+ self.Parent._Shedule(self)
def getTime(self):
@@ -181,23 +227,37 @@
if __name__ == '__main__':
try:
- cycle = cycler(False)
+ cycle = TaskRunner(False)
import sys
import atexit
- atexit.register(cycle.shutdown)
+ #atexit.register(cycle.shutdown)
def write_time(text=''):
print "running %s: %f" % (text,time.time())
write_time('Main')
- cycle.cycle(4,write_time,"Cycletask1!")
- #longtask=cycle.add(80,write_time,"task2!")
- #f=cycle.add(7,write_time,"task3!")
+ cycle1 = cycle.cycle(4,write_time,"Cycletask1!")
+ cycle2 = cycle.cycle(8,write_time,"Cycletask2!")
+
+ longtask=cycle.add(80,write_time,"Longtask 80 secs!")
+
+ f=cycle.add(7,write_time,"task3!")
+
+ cycle.event(time.mktime((2010,11,6,21,54,00,0,0,0)),write_time,"event 21:54")
time.sleep(2)
- #cycle.remove(f)
- #time.sleep(5)
- #cycle.remove(longtask)
+ cycle.remove(f)
+ time.sleep(5)
+ print "##################remove longtask %r" % longtask
+ cycle.remove(longtask)
+
+ #cycle.cycle(4,write_time,"Cycletask6!")
+ print "KILL CYCLE"
+ cycle.remove(cycle1)
+ cycle.remove(cycle2)
#cycle.shutdown()
#cycle.add(6,write_time,"task4!")
+ while threading.activeCount() > 1:
+ time.sleep(1)
except KeyboardInterrupt:
- #cycle.shutdown()
+ cycle.shutdown()
+ cycle.waiting.join(5)
sys.exit(0)
Modified: PyWireGate/trunk/datastore.py
===================================================================
--- PyWireGate/trunk/datastore.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/datastore.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -15,7 +15,7 @@
"""
Datastore Instance
"""
- def __init__(self,WireGateInstance):
+ def __init__(self,parent):
####################################################
## Function: __init__
## Parameter:
@@ -24,7 +24,8 @@
## Contructor for the DATASTORE instance
##
####################################################
- self.WG = WireGateInstance
+ self._parent = parent
+ self.WG = parent.WG
self.log("DATASTORE starting up")
self.DBLOADED = False
self.dataobjects = {}
@@ -82,7 +83,7 @@
type(self.dataobjects[id])
except KeyError:
## create a new one if it don't exist
- self.dataobjects[id] = dataObject(self.WG,id)
+ self.dataobjects[id] = dataObject(self,id)
## return it
self.locked.release()
return self.dataobjects[id]
@@ -95,7 +96,7 @@
loaddict = json.load(db)
db.close()
for name, obj in loaddict.items():
- self.dataobjects[name] = dataObject(self.WG,obj['id'],obj['name'])
+ self.dataobjects[name] = dataObject(self,obj['id'],obj['name'])
self.dataobjects[name].lastupdate = obj['lastupdate']
self.dataobjects[name].config = obj['config']
self.dataobjects[name].connected = obj['connected']
@@ -154,8 +155,9 @@
class dataObject:
- def __init__(self,WireGateInstance,id,name=False):
- self.WG = WireGateInstance
+ def __init__(self,parent,id,name=False):
+ self._parent = parent
+ self.WG = parent.WG
## Threadlocking
self.write_mutex = threading.RLock()
Modified: PyWireGate/trunk/knx_connector/BusMonitor.py
===================================================================
--- PyWireGate/trunk/knx_connector/BusMonitor.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/knx_connector/BusMonitor.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -20,12 +20,15 @@
import time
class busmonitor:
- def __init__(self, WireGateInstance,connectorInstance):
- self.WG = WireGateInstance
- self.KNX = connectorInstance
+ def __init__(self, parent):
+ self._parent = parent
+ if parent:
+ self.WG = parent.WG
+ else:
+ self.WG = False
self.nicehex=lambda x: " ".join(map(lambda y:"%.2x" % y,x))
self.tobinstr=lambda n,b=8: "".join([str((n >> y) & 1) for y in range(b-1, -1, -1)])
- self.dpt = DPT_Types.dpt_type(WireGateInstance)
+ self.dpt = DPT_Types.dpt_type(self)
## FIXME: Not fully implemented
self.apcicodes = {
@@ -101,7 +104,7 @@
if msg['ctrl2']['DestAddrType'] == 0 and msg['apdu']['tpdu'] == "T_DATA_XXX_REQ":
msg['dstaddr'] = self._decodeGrpAddr(buf[3:5])
- id = "%s:%s" % (self.KNX.instanceName, msg['dstaddr'])
+ id = "%s:%s" % (self._parent.instanceName, msg['dstaddr'])
## search Datastoreobject
dsobj = self.WG.DATASTORE.get(id)
@@ -265,10 +268,15 @@
except KeyError:
pass
return apci
+
+ def log(self,msg,severity='info',instance=False):
+ if not instance:
+ instance = self.instanceName
+ self._parent.log(msg,severity,instance)
+
def debug(self,msg):
- #print "DEBUG: BUSMON: "+ repr(msg)
- pass
+ self.log("DEBUG: BUSMON: "+ repr(msg),'debug')
if __name__ == "__main__":
Modified: PyWireGate/trunk/knx_connector/DPT_Types.py
===================================================================
--- PyWireGate/trunk/knx_connector/DPT_Types.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/knx_connector/DPT_Types.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -23,8 +23,12 @@
import struct
class dpt_type:
- def __init__(self,WireGateInstance):
- self.WG = WireGateInstance
+ def __init__(self,parent):
+ self._parent = parent
+ if parent:
+ self.WG = parent.WG
+ else:
+ self.WG = False
self.DECODER = {
1:self.decodeDPT1, # EIS 1/7 / 1 bit 0=Aus/1=Ein
2:self.decodeDPT2, # EIS 8 / 2 bit 0,1=Frei/2=Prio_Aus/3=Prio_Ein
@@ -133,8 +137,8 @@
def log(self,msg,severity='info',instance=False):
if not instance:
instance = "dpt-types"
- if self.WG:
- self.WG.log(msg,severity,instance)
+ if self._parent:
+ self._parent.log(msg,severity,instance)
def toByteArray(self,val,length):
## Set ByteArray
Modified: PyWireGate/trunk/knx_connector/GroupSocket.py
===================================================================
--- PyWireGate/trunk/knx_connector/GroupSocket.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/knx_connector/GroupSocket.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -20,12 +20,15 @@
import time
class groupsocket:
- def __init__(self, WireGateInstance, connectorInstance):
- self.WG = WireGateInstance
- self.KNX = connectorInstance
+ def __init__(self, parent):
+ self._parent = parent
+ if parent:
+ self.WG = parent.WG
+ else:
+ self.WG = False
self.nicehex=lambda x: " ".join(map(lambda y:"%.2x" % y,x))
self.tobinstr=lambda n,b=8: "".join([str((n >> y) & 1) for y in range(b-1, -1, -1)])
- self.dpt = DPT_Types.dpt_type(WireGateInstance)
+ self.dpt = DPT_Types.dpt_type(self)
def decode(self,buf,src,dst):
## Accept List Hex or Binary Data
@@ -49,7 +52,7 @@
msg['srcaddr'] = self._decodePhysicalAddr(src)
try:
msg['dstaddr'] = self._decodeGrpAddr(dst)
- id = "%s:%s" % (self.KNX.instanceName, msg['dstaddr'])
+ id = "%s:%s" % (self._parent.instanceName, msg['dstaddr'])
if (buf[0] & 0x3 or (buf[1] & 0xC0) == 0xC0):
##FIXME: unknown APDU
self.debug("unknown APDU from "+msg['srcaddr']+" to "+msg['dstaddr']+ " raw:"+buf)
@@ -88,9 +91,14 @@
def _decodeGrpAddr(self,raw):
return "%d/%d/%d" % ((raw >> 11) & 0x1f, (raw >> 8) & 0x07, (raw) & 0xff)
+
+ def log(self,msg,severity='info',instance=False):
+ if not instance:
+ instance = self.instanceName
+ self._parent.log(msg,severity,instance)
def debug(self,msg):
- #print "DEBUG: GROUPSOCKET: "+ repr(msg)
+ self.log("DEBUG: GROUPSOCKET: "+ repr(msg),'debug')
pass
Modified: PyWireGate/trunk/knx_connector/KNX_Connector.py
===================================================================
--- PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/knx_connector/KNX_Connector.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -33,17 +33,18 @@
CONNECTOR_NAME = 'KNX Connector'
CONNECTOR_VERSION = 0.2
CONNECTOR_LOGNAME = 'knx_connector'
- def __init__(self,WireGateInstance, instanceName):
- self.WG = WireGateInstance
+ def __init__(self,parent, instanceName):
+ self._parent = parent
+ self.WG = parent.WG
self.instanceName = instanceName
self.KNX = EIBConnection.EIBConnection()
self.KNXBuffer = EIBConnection.EIBBuffer()
self.KNXSrc = EIBConnection.EIBAddr()
self.KNXDst = EIBConnection.EIBAddr()
- self.busmon = BusMonitor.busmonitor(WireGateInstance,self)
- self.groupsocket = GroupSocket.groupsocket(WireGateInstance,self)
- self.dpt = DPT_Types.dpt_type(WireGateInstance)
+ 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)
Modified: PyWireGate/trunk/owfs_connector/OWFS_Connector.py
===================================================================
--- PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-06 22:51:09 UTC (rev 90)
+++ PyWireGate/trunk/owfs_connector/OWFS_Connector.py 2010-11-06 23:29:03 UTC (rev 91)
@@ -26,8 +26,12 @@
CONNECTOR_NAME = 'OWFS Connector'
CONNECTOR_VERSION = 0.1
CONNECTOR_LOGNAME = 'owfs_connector'
- def __init__(self,WireGateInstance, instanceName):
- self.WG = WireGateInstance
+ def __init__(self,parent, instanceName):
+ self._parent = parent
+ if parent:
+ self.WG = parent.WG
+ else:
+ self.WG = False
self.instanceName = instanceName
defaultconfig = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2010-11-06 18:48:47
|
Revision: 89
http://openautomation.svn.sourceforge.net/openautomation/?rev=89&view=rev
Author: netzkind
Date: 2010-11-06 18:48:39 +0000 (Sat, 06 Nov 2010)
Log Message:
-----------
new design, set as default: "discreet"
Modified Paths:
--------------
CometVisu/trunk/ChangeLog
CometVisu/trunk/visu/index.html
CometVisu/trunk/visu/lib/templateengine.js
Added Paths:
-----------
CometVisu/trunk/visu/fonts/
CometVisu/trunk/visu/fonts/AUTHORS
CometVisu/trunk/visu/fonts/COPYING
CometVisu/trunk/visu/fonts/ChangeLog
CometVisu/trunk/visu/fonts/License.txt
CometVisu/trunk/visu/fonts/README
CometVisu/trunk/visu/fonts/TODO
CometVisu/trunk/visu/fonts/liberationsans-bold.ttf
CometVisu/trunk/visu/fonts/liberationsans-regular.ttf
CometVisu/trunk/visu/images/
CometVisu/trunk/visu/images/body_bg.png
CometVisu/trunk/visu/images/button_bg.png
CometVisu/trunk/visu/images/dot_green.png
CometVisu/trunk/visu/images/dot_red.png
CometVisu/trunk/visu/images/gradient.png
CometVisu/trunk/visu/images/hr_bg.png
CometVisu/trunk/visu/style_discreet.css
Modified: CometVisu/trunk/ChangeLog
===================================================================
--- CometVisu/trunk/ChangeLog 2010-11-06 18:10:49 UTC (rev 88)
+++ CometVisu/trunk/ChangeLog 2010-11-06 18:48:39 UTC (rev 89)
@@ -11,6 +11,7 @@
- Added XML Schema / XSD to validate config-XML
- New Feature: tag for videos (HTML5 based)
- changed procedures for creating new widgets
+- added design "discreet", set as default
0.5.0
=====
Added: CometVisu/trunk/visu/fonts/AUTHORS
===================================================================
--- CometVisu/trunk/visu/fonts/AUTHORS (rev 0)
+++ CometVisu/trunk/visu/fonts/AUTHORS 2010-11-06 18:48:39 UTC (rev 89)
@@ -0,0 +1,23 @@
+AUTHORS
+
+Current Contributors (sorted alphabetically):
+
+ - Caius 'kaio' Chance <caius.chance at gmail.com>
+ Project Owner
+ Red Hat, Inc.
+
+ - Denis Jacquerye <moyogo at gmail.com>
+ Project Contributor
+
+ - Herbert Duerr <duerr at sun.com>
+ Narrow Fonts Contributor
+ Oracle, Inc.
+
+Previous Contributors
+
+ - Steve Matteson
+ Original Designer (support period expired)
+ Ascender, Inc.
+
+ - Mark Webbink <mwebbink AT redhat.com>
+ Release coordinator, Red Hat Inc.
Added: CometVisu/trunk/visu/fonts/COPYING
===================================================================
--- CometVisu/trunk/visu/fonts/COPYING (rev 0)
+++ CometVisu/trunk/visu/fonts/COPYING 2010-11-06 18:48:39 UTC (rev 89)
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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 2 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, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Added: CometVisu/trunk/visu/fonts/ChangeLog
===================================================================
--- CometVisu/trunk/visu/fonts/ChangeLog (rev 0)
+++ CometVisu/trunk/visu/fonts/ChangeLog 2010-11-06 18:48:39 UTC (rev 89)
@@ -0,0 +1,224 @@
+* Wed Jul 21 2010 Pravin Satpute <psa...@re...>
+- Update for New Release 1.06
+- Added New Family Narrow (Contribution from Herbert Duerr <her...@or...>)
+- updated version of fonts
+
+* Mon 10 May 2010 Caius 'kaio' Chance <me at kaio.net>
+- Fixed Romanian glyphs, U+021A, 021B, 0218, 0219, 0162, 0163, 015E, 015F,
+ 2010, 2011. (rhbz#440992)
+- Fixed height of arrows U+2190, 2192, 2194. (Issue #2)
+
+* Thu 06 May 2010 Caius 'kaio' Chance <me at kaio.net>
+- Cleaned up points and auto-instructed hinting of 'u', 'v', 'w', 'y'.
+(rhbz#463036)
+- Created the first project icon. (Issue #5)
+
+* Wed May 05 2010 Caius 'kaio' Chance <k at kaio.net>
+- Incorrect cent sign glyph (U+00A2) in Sans and Mono
+style in Liberation fonts. (rhbz#474522)
+
+* Wed 28 Apr 2010 Caius 'kaio' Chance <me at kaio.net>
+- rhbz#510174: Corrected version number of all SFD files.
+- Corrected license exceptions to GPLv2.
+- Updated README file.
+
+* Tue 27 Apr 2010 Caius 'kaio' Chance <me at kaio.net>
+- Renamed Narrow Fonts.
+- Updated list of contributors.
+- Released version 1.05.3.
+
+* Thu 22 Apr 2010 Herbert Duerr <duerr at sun.com>
+- Contributed Liberation Sans Narrow Fonts.
+
+* Fri 12 Mar 2010 Caius 'kaio' Chance <me at kaio.me>
+- Migrated to Google Code.
+- Updated AUTHORS.
+- Upgraded license to GPLv3+exceptions.
+
+* Sun 27 Jul 2009 Caius 'kaio' Chance <me at kaio.me>
+- Fixed ttf pack preparation error.
+
+* Tue 21 Jul 2009 Caius 'kaio' Chance <me at kaio.me>
+- Fixed 'wrongly encoded glyphs after U+10000' (rhbz#525498),
+ provided by Denis Jacquerye <moyogo at gmail.com>.
+
+* Tue 21 Jul 2009 Caius 'kaio' Chance <me at kaio.me>
+- Fixed fontforge script sfd2ttf.pe.
+- Include traditional kern table for Sans and Serif.
+
+* Tue 14 Jul 2009 Caius 'kaio' Chance <me at kaio.me>
+- Generated TTFs with tradition kern table, with fontforge ver 20090408.
+- Added make target alias dist-src as dist-sfd.
+
+* Mon 13 Jul 2009 Caius 'kaio' Chance <me at kaio.me>
+- Updated for generation of traditional kern table via scripts.
+
+* Mon 06 Jul 2009 Caius 'kaio' Chance <me at kaio.me>
+- Reconverted SFDs from original TTFs with traditional kern table.
+- Updated "clean" target in Makefile.
+
+* Tue 30 Jun 2009 Caius 'kaio' Chance <me at kaio.me>
+- Reconverted SFDs from original TTFs with traditional kern table.
+- Updated "clean" target in Makefile.
+
+* Tue 30 Jun 2009 Caius 'kaio' Chance <me at kaio.me>
+- Generated cleaner SFD from original TTFs.
+- Include Makefile in sources tarball.
+
+* Wed 24 Jun 2009 Caius 'kaio' Chance <me at kaio.me>
+- Makefile: pack SFD files as source tarball.
+- Makefile: pack TTF files as ttf packs.
+- Tidy up repository.
+- Updated documents.
+
+* Mon 12 Jan 2009 Caius Chance <cchance at redhat.com>
+- Fixed copyright holder name typo for Sans Regular font (rhbz#479521).
+
+* Tue 09 Dec 2008 Caius Chance <cchance at redhat.com>
+- Changed cent sign glyph (U+00A2) to be coressed in Sans and Mono
+ (rhbz#474522).
+
+* Wed 03 Dec 2008 Caius Chance <cchance at redhat.com>
+- Started 1.04.93.devel.
+- Fixed blurriness of U+03BC for Sans Regular font (rhbz#473481).
+- Fixed src tarball mis-inclusion of dist files in Makefile.
+
+* Fri 28 Nov 2008 Caius Chance <cchance at redhat.com>
+- Corrected version number in Makefile.
+- Fixed make target of source tarball.
+- Uploaded 1.04.92 source tarball to release area.
+
+* Wed 15 Oct 2008 Caius Chance <cchance at redhat.com>
+- Fixed blurred 'u' and 'W' for Sans Bold font (rhbz#463036).
+- Released as version 1.04.92
+
+* Wed 17 Sep 2008 Caius Chance <cchance at redhat.com>
+- Fixed missing hinting instructions for all Mono fonts (rhbz#460090).
+- Fixed missing hinting instructions for all Sans fonts (rhbz#460090).
+- Fixed missing hinting instructions for all Serif fonts (rhbz#460090).
+- Released as version 1.04.91
+
+* Tue 09 Sep 2008 Caius Chance <cchance at redhat.com>
+- Backed up all released files in ./dist directory.
+
+* Fri 05 Sep 2008 Caius Chance <cchance at redhat.com>
+- Fixed incorrect glyph points and missing hinting instructions for:
+ Mono Bold Italic (up to U+2012) (rhbz#460090).
+
+* Mon 25 Aug 2008 Caius Chance <cchance at redhat.com>
+- Fixed incorrect glyph points and missing hinting instructions for:
+ U+0079, U+03BC, U+0431, U+2010..2012, U+1114117 (rhbz#458592).
+- Released as version 1.04.90.
+
+* Thu 13 Jul 2008 Caius Chance <cchance at redhat.com>
+- Released as version 1.04.
+
+* Thu 12 Jun 2008 Caius Chance <cchance at redhat.com>
+- Released as version 1.04.beta2 (1.03.99).
+- Added ZIP package building for non-tar users.
+- rhbz#440992:
+ - Created Romanian "T/t/S/s with comma below" (U+0218..021B) on all fonts.
+ - Fixed "T/s with cedilla below" (U+0162/0163) on all fonts.
+ - Created "Hyphen" and "Non-Breaking Hyphen" (U+2010..2011) on all fonts.
+
+* Wed 11 Jun 2008 Caius Chance <cchance at redhat.com>
+- Added last Version 1.03 from original manufacturer.
+- Renamed directory 'archive' to 'sandbox'.
+- Added directory description in hosting home directory.
+- Created ZIP packages for Version 1.03 and 1.04.beta.
+
+* Tue 04 Jun 2008 Caius Chance <cchance at redhat.com>
+- rhbz#440992:
+ - Created "Hyphen" and "Non-Breaking Hyphen" (U+2010..2011) on Sans Regular.
+
+* Mon 03 Jun 2008 Caius Chance <cchance at redhat.com>
+- rhbz#440992:
+ - Created Romanian "T/t/S/s with comma below" (U+0218..021B) on Sans Regular.
+ - Fixed "T/s with cedilla below" (U+0162/0163) on Sans Regular.
+
+* Fri 30 May 2008 Caius Chance <cchance at redhat.com>
+- Release Version 1.04.beta (liberation-fonts-1_04_beta).
+
+* Thu 29 May 2008 Caius Chance <cchance at redhat.com>
+- Correct SFD version numbers in "TTF Info" categor for correct version
+ number during export to TTFs.
+
+* Wed 28 May 2008 Caius Chance <cchance at redhat.com>
+- Reencoded with "Glyph Order" by FontForge.
+- Corrected font name for all Regular fonts.
+- Generated TTFs (experimantal, in "archive") with old stle kern and dummy
+ DSIG table.
+- Updated README in 1.04b TTFs (experimental, in "archive").
+
+* Tue 27 May 2008 Caius Chance <cchance at redhat.com>
+- Fixed Unicode name mis-mapping of Sans and Serif TTF files.
+- Regenerate SFD files from Unicode name mis-mapping fixed Sans and Serif TTF
+ files.
+
+* Mon 26 May 2008 Caius Chance <cchance at redhat.com>
+- Fixed Unicode name mis-mapping of Mono TTF files.
+- Regenerate SFD files from Unicode name mis-mapping fixed Mono TTF files.
+==========
+- Applied following patches submitted by Nicolas Spalinger
+ <nicolas_spalinger sil org>:
+ - We-need-versioned-tarballs.
+ - Add-ignore-file-so-the-VCS-does-not-track-the-folder.
+ - Adjust-path-for-various-Makefile-targets-subfolders.
+ - Fix-versionning-mismatch-in-the-binary-font-metadata.
+ - Add-some-description-and-extra-lines-to-the-build-ta.
+ - Reword-and-restructure-maintainers-recommendations.
+ - Some-rewording-of-the-readme-file.
+==========
+
+* Thu May 22 2008 Caius Chance <cchance at redhat.com>
+- Added latest (1.03) TTF files from Ascender. (in 'archive')
+
+* Fri May 16 2008 Caius Chance <cchance at redhat.com>
+- Change source tree as 'trunk', 'tags', 'branches'.
+==========
+- Applied following patches submitted by Nicolas Spalinger
+ <nicolas_spalinger sil org>:
+ - Add-more-information-about-the-upstream-designer.
+ - Minor-typo-and-layout-fixes.
+ - Adjust-fontforge-path-with-env-as-a-source-build.
+==========
+
+* Wed May 14 2008 Caius Chance <cchance at redhat.com>
+- Renamed target 'ttf' to 'build'.
+- Removed 'Re-Package' chapter from README and refine contents.
+- Changed AUTHORS contents.
+- Created maintainer documentation MAINTAINER.
+
+* Tue May 06 2008 Caius Chance <cchance at redhat.com>
+- Refined clean target.
+- Removed TTFs from git.
+
+* Fri May 02 2008 Caius Chance <cchance at redhat.com>
+- Imported into fedorahosted.org repository and be hosted.
+ https://fedorahosted.org/liberation-fonts/
+- Modified source root directory name definition in Makefile.
+- Created 'dist' target for binary TTF tarball and 'src' for source tarball.
+- Corrected Regular fonts filenames.
+- Added TTF -> SFD make target.
+
+* Thu May 01 2008 Caius Chance <cchance at redhat.com>
+- Converted previous TTF files into SFD files to be open source.
+- Created fontforge SFD -> TTF scripts.
+- Created Makefile.
+- Added documentations: AUTHORS, ChangeLog, README.
+
+* Thu Apr 10 2008 Caius Chance <cchance at redhat.com>
+- Fixed exchanged and incomplete glyphs (from Ascender).
+- Repacked source tarball.
+- Released version 1.03.
+
+* Tue Mar 25 2008 Caius Chance <cchance at redhat.com>
+- Fixed alignment mismatch of dot accents (from Ascender).
+- Released version 1.02.
+
+* Mon Jan 14 2008 Caius Chance <cchance at redhat.com>
+- Updated new source tarball from Ascender.
+- Released version 1.0.
+
+* Thu Jun 14 2007 Caius Chance <cchance at redhat.com>
+- Updated new source tarball from Ascender.
Added: CometVisu/trunk/visu/fonts/License.txt
===================================================================
--- CometVisu/trunk/visu/fonts/License.txt (rev 0)
+++ CometVisu/trunk/visu/fonts/License.txt 2010-11-06 18:48:39 UTC (rev 89)
@@ -0,0 +1,19 @@
+LICENSE AGREEMENT AND LIMITED PRODUCT WARRANTY
+LIBERATION FONT SOFTWARE
+
+This agreement governs the use of the Software and any updates to the Software, regardless of the delivery mechanism. Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to the user ("Client") a license to this work pursuant to the GNU General Public License v.2 with the exceptions set forth below and such other terms as are set forth in this End User License Agreement.
+
+ 1. The Software and License Exception. LIBERATION font software (the "Software") consists of TrueType-OpenType formatted font software for rendering LIBERATION typefaces in sans-serif, serif, and monospaced character styles. You are licensed to use, modify, copy, and distribute the Software pursuant to the GNU General Public License v.2 with the following exceptions:
+
+ (a) As a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
+
+ (b) As a further exception, any distribution of the object code of the Software in a physical product must provide you the right to access and modify the source code for the Software and to reinstall that modified version of the Software in object code form on the same physical product on which you received it.
+
+ 2. Intellectual Property Rights. The Software and each of its components, including the source code, documentation, appearance, structure and organization are owned by Red Hat and others and are protected under copyright and other laws. Title to the Software and any component, or to any copy, modification, or merged portion shall remain with the aforementioned, subject to the applicable license. The "LIBERATION" trademark is a trademark of Red Hat, Inc. in the U.S. and other countries. This agreement does not permit Client to distribute modified versions of the Software using Red Hat's trademarks. If Client makes a redistribution of a modified version of the Software, then Client must modify the files names to remove any reference to the Red Hat trademarks and must not use the Red Hat trademarks in any way to reference or promote the modified Software.
+
+ 3. Limited Warranty. To the maximum extent permitted under applicable law, the Software is provided and licensed "as is" without warranty of any kind, expressed or implied, including the implied warranties of merchantability, non-infringement or fitness for a particular purpose. Red Hat does not warrant that the functions contained in the Software will meet Client's requirements or that the operation of the Software will be entirely error free or appear precisely as described in the accompanying documentation.
+
+ 4. Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential damages, including lost profits or lost savings arising out of the use or inability to use the Software, even if Red Hat or such dealer has been advised of the possibility of such damages.
+
+ 5. General. If any provision of this agreement is held to be unenforceable, that shall not affect the enforceability of the remaining provisions. This agreement shall be governed by the laws of the State of North Carolina and of the United States, without regard to any conflict of laws provisions, except that the United Nations Convention on the International Sale of Goods shall not apply.
+Copyright © 2007 Red Hat, Inc. All rights reserved. LIBERATION is a trademark of Red Hat, Inc.
Added: CometVisu/trunk/visu/fonts/README
===================================================================
--- CometVisu/trunk/visu/fonts/README (rev 0)
+++ CometVisu/trunk/visu/fonts/README 2010-11-06 18:48:39 UTC (rev 89)
@@ -0,0 +1,82 @@
+ 1. What's this?
+ =================
+
+ The Liberation Fonts is font collection which aims to provide document
+ layout compatibility as usage of Times New Roman, Arial, Courier New.
+
+
+ 2. Requirements
+ =================
+
+ * fontforge is installed.
+ (http://fontforge.sourceforge.net)
+
+
+ 3. Install
+ ============
+
+ 3.1 Decompress tarball
+
+ You can extract the files by following command:
+
+ $ tar zxvf liberation-fonts-[VERSION].tar.gz
+
+ 3.2 Build from the source
+
+ Change into directory liberation-fonts-[VERSION]/ and build from sources by
+ following commands:
+
+ $ cd liberation-fonts-[VERSION]
+ $ make
+
+ The built font files will be available in 'build' directory.
+
+ 3.3 Install to system
+
+ For Fedora, you could manually install the fonts by copying the TTFs to
+ ~/.fonts for user wide usage, or to /usr/share/fonts/truetype/liberation
+ for system-wide availability. Then, run "fc-cache" to let that cached.
+
+ For other distributions, please check out corresponding documentation.
+
+
+ 4. Usage
+ ==========
+
+ Simply select preferred liberation font in applications and start using.
+
+
+ 5. License
+ ============
+
+ This font set had been released under GNU Public License version 2
+ ("GPLv2") with exceptions.
+
+ Please read file "COPYING" for GPLv2 license.
+
+ Please read file "License.txt" for details of exceptions.
+
+
+ 6. For Maintainers
+ ====================
+
+ Before packaging a new release based on a new source tarball, you have to
+ update the version suffix in the Makefile:
+
+ VER = [VERSION]
+
+ Make sure that the defined version corresponds to the font software metadata
+ which you can check with ftinfo/otfinfo or fontforge itself. It is highly
+ recommended that file 'ChangeLog' is updated to reflect changes.
+
+ Create a tarball with the following command:
+
+ $ make dist
+
+ The new versioned tarball will be available in the dist/ folder as
+ 'liberation-fonts-[NEW_VERSION].tar.gz'.
+
+ 7. Credits
+ ============
+
+ Please read file "AUTHORS" for list of contributors.
Added: CometVisu/trunk/visu/fonts/TODO
===================================================================
--- CometVisu/trunk/visu/fonts/TODO (rev 0)
+++ CometVisu/trunk/visu/fonts/TODO 2010-11-06 18:48:39 UTC (rev 89)
@@ -0,0 +1,14 @@
+Here are todo for next release
+
+1) resolving bug related with hinting
+ - https://bugzilla.redhat.com/show_bug.cgi?id=606217
+ - https://bugzilla.redhat.com/show_bug.cgi?id=591556
+2) shape improvement
+ - https://bugzilla.redhat.com/show_bug.cgi?id=591559
+ - https://bugzilla.redhat.com/show_bug.cgi?id=487581
+3) Ascent Descent Values Improvement
+ - using absolute values instead of relative values in OS/2 table
+4) RFE: Add Greek Polytonic support to Liberation fonts
+ - need some volunteer to add these shapes
+ - https://bugzilla.redhat.com/show_bug.cgi?id=473842
+
Added: CometVisu/trunk/visu/fonts/liberationsans-bold.ttf
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/fonts/liberationsans-bold.ttf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/fonts/liberationsans-regular.ttf
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/fonts/liberationsans-regular.ttf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/images/body_bg.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/images/body_bg.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/images/button_bg.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/images/button_bg.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/images/dot_green.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/images/dot_green.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/images/dot_red.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/images/dot_red.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/images/gradient.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/images/gradient.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: CometVisu/trunk/visu/images/hr_bg.png
===================================================================
(Binary files differ)
Property changes on: CometVisu/trunk/visu/images/hr_bg.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: CometVisu/trunk/visu/index.html
===================================================================
--- CometVisu/trunk/visu/index.html 2010-11-06 18:10:49 UTC (rev 88)
+++ CometVisu/trunk/visu/index.html 2010-11-06 18:48:39 UTC (rev 89)
@@ -3,16 +3,12 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Test Client</title>
+ <title>CometVisu-Client</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" media="only screen and (max-device-width: 480px)" href="style_orange_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/jquery-ui-1.8.4.custom.min.js" type="text/javascript"></script>
- <script src="lib/jquery.tools.min.js" type="text/javascript"></script>
--->
<script src="lib/scrollable.js" type="text/javascript"></script>
<script src="lib/visuclient.js" type="text/javascript"></script>
<script src="lib/knx_decode.js" type="text/javascript"></script>
@@ -23,7 +19,6 @@
<body>
<div id="top">
<div class="nav_path">-</div>
- <hr />
</div>
<div id="main" style="width:900px;position:relative; overflow: hidden; ">
<div id="pages" class="clearfix" style="width:20000em; position:relative;clear:both;"><!-- all pages will be inserted here -->
@@ -32,8 +27,8 @@
<div id="bottom">
<hr />
<div class="footer">
- <img src="icon/comet_64_ff8000.png" alt="CometVisu" />
- by <a href="http://www.cometvisu.org/">ComeVisu.org</a> - <a href=".">Reload</a>
+ <img src="icon/comet_64_000000.png" alt="CometVisu" />
+ by <a href="http://www.cometvisu.org/">CometVisu.org</a> - <a href=".">Reload</a>
</div>
</div>
</body>
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-11-06 18:10:49 UTC (rev 88)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-06 18:48:39 UTC (rev 89)
@@ -148,7 +148,7 @@
// do nothing
} else {
var width = $( window ).width();
- var height = $( window ).height() - $( '#top' ).height() - $( '#bottom' ).height() - 2;
+ var height = $( window ).height() - $( '#top' ).outerHeight(true) - $( '#bottom' ).outerHeight(true) - 2;
$( '#main' ).css( 'width', width ).css( 'height', height );
$( 'head' ).append( '<style type="text/css">.page{width:' + (width-0) + 'px;height:' + height + 'px;}</style>' );
Added: CometVisu/trunk/visu/style_discreet.css
===================================================================
--- CometVisu/trunk/visu/style_discreet.css (rev 0)
+++ CometVisu/trunk/visu/style_discreet.css 2010-11-06 18:48:39 UTC (rev 89)
@@ -0,0 +1,287 @@
+@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;
+}
+.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;
+}
+
+.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 */
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <net...@us...> - 2010-11-06 18:10:55
|
Revision: 88
http://openautomation.svn.sourceforge.net/openautomation/?rev=88&view=rev
Author: netzkind
Date: 2010-11-06 18:10:49 +0000 (Sat, 06 Nov 2010)
Log Message:
-----------
removed single unnecessary file
Removed Paths:
-------------
CometVisu/trunk/visu/edit/visudesign_editmode.js
Deleted: CometVisu/trunk/visu/edit/visudesign_editmode.js
===================================================================
--- CometVisu/trunk/visu/edit/visudesign_editmode.js 2010-11-06 18:08:50 UTC (rev 87)
+++ CometVisu/trunk/visu/edit/visudesign_editmode.js 2010-11-06 18:10:49 UTC (rev 88)
@@ -1,99 +0,0 @@
-/* visudesign_custom.js (c) 2010 by Christian Mayer [CometVisu at ChristianMayer dot de]
- *
- * 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, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-*/
-
-/**
- * This class re-defines all methods so all elements behave like the
- * original from _pure, but have additional data so the editor can
- * work with.
- *
- */
-function VisuDesign_Custom() {}; // do NOT change here
-VisuDesign_Custom.prototype = new VisuDesign(); // do NOT chagen here
-
-
-VisuDesign_Custom.prototype.createPage = function(page, path)
- {
- var ret_val = new VisuDesign().createPage(page, path);
- ret_val.data({path: path});
- ret_val.addClass("pagelink");
- return ret_val;
- }
-
-VisuDesign_Custom.prototype.createLine = function()
- {
- var ret_val = new VisuDesign().createLine();
- return $("<div />").attr("class", "widget line").append(ret_val);
- }
-
-VisuDesign_Custom.prototype.createText = function(page)
- {
- var ret_val = new VisuDesign().createText(page);
- return ret_val;
- }
-
-VisuDesign_Custom.prototype.createInfo =
-VisuDesign_Custom.prototype.createShade = function( page )
- {
- var ret_val = new VisuDesign().createInfo(page);
- ret_val.data({
- pre: $(page).attr('pre'),
- post: $(page).attr('post')
- });
- ret_val.find(".actor").data("style", $(page).attr("design"));
- return ret_val;
- }
-
-VisuDesign_Custom.prototype.createDim = function( page )
- {
- var ret_val = new VisuDesign().createDim(page);
- ret_val.data({
- response_address: $(page).attr('response_address'),
- response_datatype: $(page).attr('response_datatype')
- });
- return ret_val;
- }
-
-VisuDesign_Custom.prototype.createSwitch =
-VisuDesign_Custom.prototype.createToggle = function( page )
- {
- var ret_val = new VisuDesign().createSwitch(page);
- ret_val.data({
- pre: $(page).attr('pre'),
- post: $(page).attr('post'),
- response_address: $(page).attr('response_address'),
- response_datatype: $(page).attr('response_datatype')
- });
- ret_val.find(".actor").data("style", $(page).attr("design"));
- return ret_val;
- }
-
-VisuDesign_Custom.prototype.createTrigger = function( page )
- {
- var ret_val = new VisuDesign().createTrigger(page);
- ret_val.data({
- pre: $(page).attr('pre'),
- post: $(page).attr('post')
- });
- ret_val.find(".actor").data("style", $(page).attr("design"));
- return ret_val;
- }
-
-VisuDesign_Custom.prototype.createUnknown = function( page )
- {
- var ret_val = new VisuDesign().createUnknown(page);
- return ret_val;
- }
\ 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: <net...@us...> - 2010-11-06 18:08:58
|
Revision: 87
http://openautomation.svn.sourceforge.net/openautomation/?rev=87&view=rev
Author: netzkind
Date: 2010-11-06 18:08:50 +0000 (Sat, 06 Nov 2010)
Log Message:
-----------
rewrite of editor-code, now auto-extensible; changed handling of creators in visudesign_pure; added automatic DPT and GA-dropdown; added validation for input-values
Modified Paths:
--------------
CometVisu/trunk/ChangeLog
CometVisu/trunk/visu/edit/save_config.php
CometVisu/trunk/visu/edit/style_edit.css
CometVisu/trunk/visu/edit/visuconfig_edit.js
CometVisu/trunk/visu/edit_config.html
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/lib/visudesign_custom.js
CometVisu/trunk/visu/lib/visudesign_pure.js
CometVisu/trunk/visu/visu_config.xsd
Added Paths:
-----------
CometVisu/trunk/visu/edit/get_addresses.php
Modified: CometVisu/trunk/ChangeLog
===================================================================
--- CometVisu/trunk/ChangeLog 2010-11-06 17:01:33 UTC (rev 86)
+++ CometVisu/trunk/ChangeLog 2010-11-06 18:08:50 UTC (rev 87)
@@ -1,7 +1,7 @@
HEAD
====
-- New Feature: editor
+- New Feature: editor (easily extensible)
- New Feature: generic slide widget
- New Feature: slide and dim widgets allow range and step attributes
- New Feature: ranges for mapping and style
@@ -10,6 +10,7 @@
- New Feature: <text> has new optional attribute "align"
- Added XML Schema / XSD to validate config-XML
- New Feature: tag for videos (HTML5 based)
+- changed procedures for creating new widgets
0.5.0
=====
Added: CometVisu/trunk/visu/edit/get_addresses.php
===================================================================
--- CometVisu/trunk/visu/edit/get_addresses.php (rev 0)
+++ CometVisu/trunk/visu/edit/get_addresses.php 2010-11-06 18:08:50 UTC (rev 87)
@@ -0,0 +1,35 @@
+<?php
+define('FILE_GA', "/etc/wiregate/eibga.conf");
+define('FILE_HG', "/etc/wiregate/eibga_hg.conf");
+define('FILE_MG', "/etc/wiregate/eibga_mg.conf");
+
+$arrGA = parse_ini_file(FILE_GA, true);
+$arrHG = parse_ini_file(FILE_HG, true);
+$arrMG = parse_ini_file(FILE_MG, true);
+
+
+$arrAdresses = array();
+foreach ($arrGA as $strGA => $arrData) {
+ $arrGAParts = explode("/", $strGA, 3);
+
+ $strHG = "";
+ if (true === isset($arrHG[$arrGAParts[0]])) {
+ $strHG = utf8_encode($arrHG[$arrGAParts[0]]['name']);
+ }
+
+ $strMG = "";
+ if (true === isset($arrMG[$arrGAParts[1]])) {
+ $strMG = utf8_encode($arrMG[$arrGAParts[1]]['name']);
+ }
+
+ $arrAdresses[$strHG][$strMG][] = array(
+ "address" => $strGA,
+ "name" => utf8_encode($arrData['name']),
+ "dpt" => $arrData['DPTSubId']
+ );
+}
+
+print json_encode($arrAdresses);
+exit;
+
+?>
Modified: CometVisu/trunk/visu/edit/save_config.php
===================================================================
--- CometVisu/trunk/visu/edit/save_config.php 2010-11-06 17:01:33 UTC (rev 86)
+++ CometVisu/trunk/visu/edit/save_config.php 2010-11-06 18:08:50 UTC (rev 87)
@@ -125,6 +125,11 @@
// Parameter die mit "_" beginnen sind special purpose
continue;
}
+
+ if ($strAttribute === "textContent") {
+ $objXML->nodeValue = $strValue;
+ continue;
+ }
$objXML->setAttribute($strAttribute, $strValue);
}
Modified: CometVisu/trunk/visu/edit/style_edit.css
===================================================================
--- CometVisu/trunk/visu/edit/style_edit.css 2010-11-06 17:01:33 UTC (rev 86)
+++ CometVisu/trunk/visu/edit/style_edit.css 2010-11-06 18:08:50 UTC (rev 87)
@@ -9,6 +9,8 @@
filter: alpha(opacity=50);
opacity: 0.5;
text-align: center;
+ float: none !important;
+ padding: 0 !important;
}
.editcontrol {
@@ -62,7 +64,7 @@
width: 1.5em;
}
-div#addDummy {
+div#addMaster {
border: 1px solid #444;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
Modified: CometVisu/trunk/visu/edit/visuconfig_edit.js
===================================================================
--- CometVisu/trunk/visu/edit/visuconfig_edit.js 2010-11-06 17:01:33 UTC (rev 86)
+++ CometVisu/trunk/visu/edit/visuconfig_edit.js 2010-11-06 18:08:50 UTC (rev 87)
@@ -4,7 +4,10 @@
confirm_save: "Save config?",
prompt_rename: "Rename page '%s' to ...",
save_good: "Config has been successfully saved.",
- save_bad: "Config not saved. Error: '%s'"
+ save_bad: "Config not saved. Error: '%s'",
+ value_required: "Field '%s' is required but empty. Please correct your input.",
+ value_invalid: "The value for field '%s' is invalid. Please correct your input.",
+ regexp_invalid: "There something wrong with the cable."
}
if (typeof texts[element] == "undefined") {
@@ -20,10 +23,12 @@
return myText;
}
+var addressesCache;
+
jQuery(document).ready(function() {
jQuery("div#addwidgetcontrol").bind("click", function() {
- jQuery("#addDummy").trigger("show").find("#add_type").triggerHandler("change");
+ jQuery("#addMaster").trigger("show").find("#add_type").triggerHandler("change");
});
$("#saveconfigcontrol").bind("click", function () {
@@ -33,7 +38,19 @@
}
});
+ // get all GA from the server
+ $.getJSON('edit/get_addresses.php', function(data) { addressesCache = data});
+
jQuery("#pages").bind("done", function() {
+ $("#pages hr, #pages br").each(function() {
+ if ($(this).closest(".widget").length == 0) {
+ $(this).wrap("<div class=\"widget line\" />");
+ var d = $.extend({}, $(this).data());
+ $(this).closest("div.widget").data(d);
+ }
+ });
+
+
jQuery(".page div").sortable({
handle: ".movecontrol",
items: '.widget',
@@ -54,13 +71,27 @@
jQuery(this).css("background-color", jQuery(this).data("background-color-old"));
jQuery(this).find("div.editcontrol, div.movecontrol, div.removecontrol").remove();
});
+
+ var options = {};
+ $("#addMaster").find("select#add_type").empty();
+ jQuery.each(design.creators, function (index, e) {
+ $("#addMaster").find("select#add_type").append(
+ $("<option />").attr("value", index).html(index)
+ );
+ });
});
jQuery(".removecontrol").live("click", function() {
var widget = $(this).parents("div.widget");
var data = getWidgetData(widget, true);
- var b = confirm(lingua("confirm_delete", data._text));
+ var t;
+ if (data._type == "page") {
+ t = data.name;
+ } else {
+ t = data.textContent;
+ }
+ var b = confirm(lingua("confirm_delete", t));
if (b) {
widget.remove();
}
@@ -68,6 +99,7 @@
jQuery(".editcontrol").live("click", function() {
+
var widget = $(this).parents("div.widget");
if (widget.is(".pagelink")) {
return renamePage(widget);
@@ -78,29 +110,21 @@
// kennzeichnen welches Element grade bearbeitet wird
widget.addClass("inedit");
- jQuery.each(data, function(i, element) {
- // alle bekannten Einstellungen in die Maske einfügen
- $("#addDummy").find("#add_" + i).val(element);
- });
+ $("#addMaster").data("widgetdata", data);
- if (typeof data._text != "undefined") {
- // text ist in einem Sonderfeld abgelegt
- $("#addDummy #add_text").val(data._text)
- }
+ $("#addMaster #add_type").find("option[value=" + data._type + "]").attr("selected", "selected");
- $("#addDummy #add_type").find("option[value=" + data._type + "]").attr("selected", "selected").trigger("change");
-
- $("#addDummy").triggerHandler("show");
+ $("#addMaster").triggerHandler("show");
});
jQuery("#pages").bind("done", function() {
// die Selectlisten vorbelegen
- $("#addDummy #add_mapping, #addDummy #add_style").empty().append($("<option />").attr("value", "").html("-"));
+ $("#addMaster #add_mapping, #addMaster #add_style").empty().append($("<option />").attr("value", "").html("-"));
jQuery.each(mappings, function(i, element) {
- $("#addDummy #add_mapping").append($("<option />").attr("value", i).html(i));
+ $("#addMaster #add_mapping").append($("<option />").attr("value", i).html(i));
});
jQuery.each(styles, function(i, element) {
- $("#addDummy #add_style").append($("<option />").attr("value", i).html(i));
+ $("#addMaster #add_style").append($("<option />").attr("value", i).html(i));
});
});
@@ -108,14 +132,21 @@
jQuery(function() {
- // dem AddDummy Leben einhauchen
- jQuery("#addDummy")
+ // dem addMaster Leben einhauchen
+ jQuery("#addMaster")
.bind("show", function() {
if ($("#pages .inedit").is(".widget")) {
$(this).find(".create").hide().end().find(".edit").show();
} else {
$(this).find(".create").show().end().find(".edit").hide();
}
+
+ // if we have widget-specific data, we must be in edit-mode
+ var widgetdata = $(this).data("widgetdata");
+ if (typeof widgetdata != "undefined") {
+ $(this).find("#add_type").find("option[value=" + widgetdata._type + "]").attr("selected", "selected").trigger("change");
+ }
+
$(this).show()
.find("#add_type").triggerHandler("change")
jQuery(".page div").sortable("destroy");
@@ -126,73 +157,162 @@
$("#pages").triggerHandler("done");
})
.bind("cleanup", function() {
+ $(this).removeData("widgetdata");
jQuery(this).find("input[type=text]").val("");
$("#pages").find(".inedit").removeClass("inedit");
})
.find("#add_cancel").click(function() {
- jQuery("#addDummy").trigger("hide").trigger("cleanup")
+ jQuery("#addMaster").trigger("hide").trigger("cleanup")
})
.end()
.find("#add_type").change(function() {
+ // the type has been changed
+ // we need to change the input-field accordingly to match
+ // what attributes we need
var val = jQuery(this).val();
- var divSelector = "";
- switch (val) {
- case 'switch':
- case 'toggle':
- divSelector = ".add_text, .add_address, .add_datatype, .add_response_address, .add_response_datatype, .add_pre, .add_post, .add_mapping, .add_style";
- break;
- case 'dim':
- case 'slide':
- divSelector = ".add_text, .add_address, .add_datatype, .add_response_address, .add_response_datatype, .add_pre, .add_post, .add_mapping, .add_style, .add_min, .add_max, .add_step";
- break;
- case 'trigger':
- divSelector = ".add_text, .add_address, .add_datatype, .add_pre, .add_post, .add_mapping, .add_style, .add_value";
- break;
- case 'line':
- divSelector = "";
- break;
- case 'shade':
- divSelector = "";
- break;
- case 'info':
- divSelector = ".add_text, .add_address, .add_datatype, .add_pre, .add_post, .add_mapping, .add_style";
- break;
- case 'text':
- divSelector = ".add_text";
- break;
- case 'page':
- divSelector = ".add_text";
- break;
+ var creator = design.getCreator(val);
+ var attributes = creator.attributes;
+ if (typeof attributes == "undefined") {
+ alert("there's something wrong with the cable");
+ return;
}
- jQuery("#addDummy").find("div.add_inputs")
- .not(divSelector).hide()
- .find("input[type=text]").val("")
- .end()
- .end()
- .filter(divSelector).show();
+ var container = $("#addMaster div.inputs");
+ var values = $.extend({}, $("#addMaster").data("widgetdata"));
+
+ // alte Werte zwischenspeichern
+ container.find(":input").each(function() {
+ if ($(this).val() != "") {
+ var name = $(this).data("name");
+ values[name] = $(this).val();
+ }
+ })
+ container.empty();
+
+ if (creator.content == "string") {
+ var element = $("<div />").addClass("add_input").addClass("content")
+ .append($("<label />").attr("for", "add_textContent").html("text-content"))
+ .append($("<input type=\"text\" id=\"add_textContent\"/>"));
+ if (typeof values["textContent"] != "undefined") {
+ element.find("input").val(values["textContent"]);
+ }
+
+ container.append(element);
+ delete element;
+ }
+
+ $.each(attributes, function (index, e) {
+ var element = $("<div />").addClass("add_input").addClass("attribute")
+ .append($("<label />").attr("for", "add_" + index).html(index));
+
+ switch (e.type) {
+ case "address":
+ element.append($("<select id=\"add_" + index + "\" />")
+ .append($("<option />").attr("value", "").html("-")));
+
+ element.find("select:first").append(getAddressesObject());
+
+ element.find("select").bind("change", function() {
+ // on changing the address, the coresponding datatype-field is
+ // automagically set
+ var name = $(this).attr("id");
+ var dptFieldName = name.replace(/_?address$/i, "_datatype");
+ var dpt = $(this).find("option:selected").attr("class").replace(/[^dpt_\d+\.\d+]*/, "").replace(/^dpt_/, "");
+ $("#addMaster div.inputs #" + dptFieldName).val(dpt);
+ });
+
+ if (typeof values[index] != "undefined") {
+ element.find("option[value=" + values[index] + "]").attr("selected", "selected");
+ }
+
+ break;
+
+ case "mapping":
+ element.append($("<select id=\"add_mapping\" />")
+ .append($("<option />").attr("value", "").html("-")));
+ jQuery.each(mappings, function(i, tmp) {
+ element.find("select#add_mapping").append($("<option />").attr("value", i).html(i));
+ });
+
+ if (typeof values[index] != "undefined") {
+ element.find("option[value=" + values[index] + "]").attr("selected", "selected");
+ }
+
+ break;
+
+ case "style":
+ element.append($("<select id=\"add_style\" />")
+ .append($("<option />").attr("value", "").html("-")));
+ jQuery.each(styles, function(i, tmp) {
+ element.find("select#add_style").append($("<option />").attr("value", i).html(i));
+ });
+
+ if (typeof values[index] != "undefined") {
+ element.find("option[value=" + values[index] + "]").attr("selected", "selected");
+ }
+
+ break;
+
+ default:
+ element.append($("<input type=\"text\" id=\"add_" + index + "\" />"));
+
+ if (typeof values[index] != "undefined") {
+ element.find("input").val(values[index]);
+ }
+
+ break;
+ }
+
+ element.find(":input")
+ .data("name", index)
+ .data("required", e.required)
+ .data("type", e.type);
+
+ container.append(element);
+ delete element;
+ });
})
.end()
.find("#add_submit").click(function() {
// Daten aus den Eingabefeldner übernehmen
- // einfach alle rein - das Design weiß schon welche Daten es benötigt
+ // einfach alle rein - wir haben ja nur die passenden Felder
+
+ var container = $("#addMaster div.inputs");
+
var dataObject = {
- value: jQuery("#addDummy input#add_value").val(),
- address: jQuery("#addDummy input#add_address").val(),
- datatype: jQuery("#addDummy input#add_datatype").val(),
- response_address: jQuery("#addDummy input#add_response_address").val(),
- response_datatype: jQuery("#addDummy input#add_response_datatype").val(),
- pre: jQuery("#addDummy input#add_pre").val(),
- post: jQuery("#addDummy input#add_post").val(),
- mapping: jQuery("#addDummy select#add_mapping").val(),
- design: jQuery("#addDummy select#add_style").val(),
- min: jQuery("#addDummy input#add_min").val(),
- max: jQuery("#addDummy input#add_max").val(),
- step: jQuery("#addDummy input#add_step").val(),
- textContent: jQuery("#addDummy input#add_text").val(),
- nodeName: jQuery("#addDummy #add_type").val(),
- name: jQuery("#addDummy input#add_text").val() // wird nur bei page benötigt
- };
+ nodeName: jQuery("#addMaster #add_type").val()
+ };
+
+ var error = false;
+
+ // alte Werte zwischenspeichern
+ container.find(":input").each(function() {
+ var name;
+ if ($(this).closest("div.add_input").hasClass("attribute")) {
+ name = $(this).data("name");
+ } else if ($(this).closest("div.add_input").hasClass("content")) {
+ name = "textContent";
+ }
+
+ if ($(this).val() != "") {
+ // validating
+ if (false === isInputValid($(this).val(), $(this).data("type"))) {
+ alert(lingua("value_invalid", name));
+ // do not save
+ error = true;
+ }
+ dataObject[name] = $(this).val();
+ } else if ($(this).data("required") === true) {
+ // do not save
+ alert(lingua("value_required", name));
+ error = true;
+ }
+ })
+
+ if (error !== false) {
+ return;
+ }
+
// als path verwenden wir einfach den aktuellen UNIX-Timestamp
// der wird nicht schon belegt sein
var path = $(".page:visible:last").attr("id");
@@ -210,12 +330,55 @@
jQuery("#pages").triggerHandler("done");
// und dann noch mich wieder verstecken
- jQuery("#addDummy").trigger("hide").trigger("cleanup");
+ jQuery("#addMaster").trigger("hide").trigger("cleanup");
})
.end();
});
+/**
+ * check whether a user-given value matches the type-criterias and thus is valid
+ */
+function isInputValid(val, type) {
+ if (typeof type == "undefined" || type == null) {
+ // nicht mit Geistern rumschlagen
+ return true;
+ }
+ if (typeof type == "object") {
+ // wohl ein regulärer Ausdruck
+ try {
+ if (val.match(type)) {
+ return true;
+ } else {
+ return false;
+ }
+
+ } catch (e) {
+ alert(lingua("regexp_invalid"));
+ return false;
+ }
+ }
+
+ switch (type) {
+ case "address":
+ return !Boolean(val.match(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,2}$/));
+ break;
+ case "numeric":
+ return Boolean(val.match(/^\d+([\.,]\d+)?$/g));
+ break;
+ case "string":
+ case "uri":
+ return Boolean(typeof val == "string");
+ break;
+ case "mapping":
+ return Boolean(typeof mappings[val] != "undefined");
+ break;
+ case "style":
+ return Boolean(typeof styles[val] != "undefined");
+ break;
+ }
+}
+
function saveConfig() {
var configData = createObjectFromPage("#0.page");
var configDataJSON = JSON.stringify(configData);
@@ -245,80 +408,17 @@
});
}
-function getWidgetData(element, nodive) {
+function getWidgetData(element) {
var myObj = {};
+
var e = $(element);
- var a = $(e).find(".actor");
- if (e.is("div.switch")) {
- // switch oder trigger
- if (a.data("type") == "trigger") {
- // trigger
- myObj = {
- address: a.data("GA"),
- datatype: a.data("datatype"),
- value: a.data("sendValue"),
- pre: e.data("pre"),
- post: e.data("post"),
- mapping: a.data("mapping"),
- style: a.data("style"),
- _text: e.find("div.label").text(),
- _type: "trigger"
- };
- } else {
- // switch
- myObj = {
- address: a.data("GA"),
- datatype: a.data("datatype"),
- pre: e.data("pre"),
- post: e.data("post"),
- mapping: a.data("mapping"),
- style: a.data("style"),
- response_address: e.data("response_address"),
- response_datatype: e.data("response_datatype"),
- _text: e.find("div.label").text(),
- _type: "switch"
- };
- }
- } else if (e.is("div.text")) {
- // text
- myObj = {
- _text: e.find("div.label").text(),
- _type: "text"
- };
- } else if (e.is("div.dim")) {
- // slider
- myObj = {
- address: a.data("GA"),
- datatype: a.data("datatype"),
- mapping: a.data("mapping"),
- style: a.data("style"),
- min: a.data("min"),
- max: a.data("max"),
- step: a.data("step"),
- response_address: e.data("response_address"),
- response_datatype: e.data("response_datatype"),
- _text: e.find("div.label").text(),
- _type: "dim"
- };
- } else if (e.is("div.info")) {
- // Info-Feld
- myObj = {
- address: a.data("GA"),
- datatype: a.data("datatype"),
- pre: e.data("pre"),
- post: e.data("post"),
- mapping: a.data("mapping"),
- style: a.data("style"),
- _text: e.find("div.label").text(),
- _type: "info"
- };
- } else if (e.is("div.line")) {
- // Trennlinie
- myObj = {
- _type: "line",
- _text: "line"
- }
- } else if (e.is(".pagelink")) {
+
+ myObj._type = e.data("nodeName");
+ myObj.textContent = e.data("textContent");
+ $.extend(myObj, e.data("attributes"));
+
+ if (e.is(".pagelink")) {
+ // it's a page, we need to dive in
// eine Sub-Seite
// versuchen die Seiten-Id durch den Link zu bekommen
var s = e.find("a");
@@ -334,19 +434,10 @@
if (subObject._elements.length > 0) {
myObj = subObject;
}
- } else if (nodive) {
- // wir sollen nicht rekursiv arbeiten,
- // aber dieses eine Objekt liefern wir zurück
- myObj = {
- _type: "page",
- _text: s.text(), // für edit-modus benötigt
- name: s.text()
- };
}
}
return myObj;
-
}
function createObjectFromPage(pageObject) {
@@ -378,7 +469,7 @@
function renamePage(widget) {
var data = getWidgetData(widget, true);
- var newText = prompt(lingua("prompt_rename", data._text), data._text);
+ var newText = prompt(lingua("prompt_rename", data.name), data.name);
if (!newText) {
return;
}
@@ -386,5 +477,35 @@
var path = widget.data("path");
widget.find("a").html(newText);
+ widget.data("name", newText);
$("#pages").find("#" + path + ".page").find("h1").html(newText);
+}
+
+var cachedAddressesObject;
+function getAddressesObject() {
+
+ if (typeof cachedAddressesObject == "object") {
+ return cachedAddressesObject.clone();
+ }
+
+ element = $("<select />");
+
+ $.each(addressesCache, function(hg, sub) {
+ $.each(sub, function(mg, addresses) {
+ element.append(
+ $("<optgroup />").attr("label", hg + " - " + mg)
+ );
+ $.each(addresses, function (i, address) {
+ element.find("optgroup:last")
+ .append($("<option />").attr("value", address.address)
+ .addClass("dpt_" + address.dpt)
+ .html(address.name)
+ )
+ });
+ });
+ });
+
+ cachedAddressesObject = element.children();
+
+ return cachedAddressesObject;
}
\ No newline at end of file
Modified: CometVisu/trunk/visu/edit_config.html
===================================================================
--- CometVisu/trunk/visu/edit_config.html 2010-11-06 17:01:33 UTC (rev 86)
+++ CometVisu/trunk/visu/edit_config.html 2010-11-06 18:08:50 UTC (rev 87)
@@ -13,7 +13,7 @@
<script src="lib/visuclient.js" type="text/javascript"></script>
<script src="lib/knx_decode.js" type="text/javascript"></script>
<script src="lib/visudesign_pure.js" type="text/javascript"></script>
- <script src="edit/visudesign_editmode.js" type="text/javascript"></script>
+ <script src="lib/visudesign_custom.js" type="text/javascript"></script>
<script src="lib/templateengine.js" type="text/javascript"></script>
<script src="edit/visuconfig_edit.js" type="text/javascript"></script>
<script src="edit/json2.js" type="text/javascript"></script>
@@ -35,7 +35,7 @@
</div>
</div>
- <div id="addDummy">
+ <div id="addMaster">
<form method="post" action="self">
<div class="addwidget">
<h2 class="create">Insert new widget</h2>
@@ -43,73 +43,13 @@
<div class="editcontrols">
<label for="add_type">Typ</label>
<select id="add_type">
- <option value="switch">switch</option>
- <option value="trigger">trigger</option>
- <option value="line">line</option>
- <option value="dim">slider/dimmer</option>
- <option value="shade">shade</option>
- <option value="info">info</option>
- <option value="text">text</option>
- <option value="page">page</option>
+ <option>-</option>
</select>
- <div class="add_inputs add_text">
- <label for="add_text">Text</label>
- <input type="text" id="add_text" />
- </div>
- <div class="add_inputs add_address">
- <label for="add_address">address</label>
- <input type="text" id="add_address" />
- </div>
- <div class="add_inputs add_datatype">
- <label for="add_datatype">DPT</label>
- <input type="text" id="add_datatype" />
- </div>
- <div class="add_inputs add_value">
- <label for="add_value">Value</label>
- <input type="text" id="add_value" />
- </div>
+ <div class="inputs">
- <div class="add_inputs add_response_address">
- <label for="add_response_address">response_address</label>
- <input type="text" id="add_response_address" />
</div>
- <div class="add_inputs add_response_datatype">
- <label for="add_response_datatype">response DPT</label>
- <input type="text" id="add_response_datatype" />
- </div>
- <div class="add_inputs add_min">
- <label for="add_min">mininmal value</label>
- <input type="text" id="add_min" />
- </div>
- <div class="add_inputs add_max">
- <label for="add_max">maximal value</label>
- <input type="text" id="add_max" />
- </div>
- <div class="add_inputs add_step">
- <label for="add_step">step size</label>
- <input type="text" id="add_step" />
- </div>
-
-
- <div class="add_inputs add_pre">
- <label for="add_pre">pre</label>
- <input type="text" id="add_pre" />
- </div>
- <div class="add_inputs add_post">
- <label for="add_post">post</label>
- <input type="text" id="add_post" />
- </div>
-
- <div class="add_inputs add_mapping">
- <label for="add_mapping">mapping</label>
- <select id="add_mapping"><option>-</option></select>
- </div>
- <div class="add_inputs add_style">
- <label for="add_style">style</label>
- <select id="add_style"><option>-</option></select>
- </div>
</div>
<input type="button" id="add_submit" value="OK"/>
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-11-06 17:01:33 UTC (rev 86)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-06 18:08:50 UTC (rev 87)
@@ -215,9 +215,26 @@
function create_pages( page, path )
{
- if( design.creators[ page.nodeName ] )
- return design.creators[ page.nodeName ]( page, path );
- return design.creators.unknown( page );
+ var retval;
+ retval = design.creators[ page.nodeName ].create( page, path );
+
+ node = $(page).get(0);
+ var attributes = {};
+ if (typeof node.attributes != "undefined") {
+ for(var i=0; i<node.attributes.length; i++) {
+ if(node.attributes.item(i).specified) {
+ attributes[node.attributes.item(i).nodeName]=node.attributes.item(i).nodeValue
+ }
+ }
+ } else {
+ $.extend(attributes, node);
+ }
+
+ retval.data("attributes", attributes)
+ .data("path", path)
+ .data("nodeName", page.nodeName)
+ .data("textContent", page.textContent);
+ return retval;
}
function scrollToPage( page_id )
Modified: CometVisu/trunk/visu/lib/visudesign_custom.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_custom.js 2010-11-06 17:01:33 UTC (rev 86)
+++ CometVisu/trunk/visu/lib/visudesign_custom.js 2010-11-06 18:08:50 UTC (rev 87)
@@ -24,12 +24,13 @@
/**
* Custom changes could go here and look e.g. like
****************************************
-VisuDesign_Custom.prototype.creators.text = function( page )
-{
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'text' );
- ret_val.append( '<div class="label">[' + page.textContent + ']</div>' );
- return ret_val;
-}
+VisuDesign_Custom.prototype.addCreator("line", {
+ create: function( page, path ) {
+ return $( '<hr />' );
+ },
+ attributes: {
+ },
+ content: false
+});
****************************************
*/
Modified: CometVisu/trunk/visu/lib/visudesign_pure.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-06 17:01:33 UTC (rev 86)
+++ CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-06 18:08:50 UTC (rev 87)
@@ -18,202 +18,300 @@
/**
* This class defines all the building blocks for a Visu in the "Pure" design
*/
-function VisuDesign()
-{
- /**
- * The creators object contians all widgets creators and their mappin to the
- * XML config file tags
- */
- this.creators = {};
- this.creators.page = function( page, path )
- {
- var ret_val = $('<div class="widget" />');
- var style = ( '0' != path ) ? 'display:none' : '';
- var name = $(page).attr('name'); //path += '_' + name;
- var type = $(page).attr('type'); //text, 2d or 3d
- ret_val.addClass( 'link' );
- ret_val.append( '<a href="javascript:scrollToPage(\''+path+'\')">' + name + '</a>' );
- var childs = $(page).children();
- var container = $( '<div class="clearfix"/>' );
+function VisuDesign() {
+ this.creators = {};
- container.append( '<h1>' + name + '</h1>' );
- $( childs ).each( function(i){
- container.append( create_pages(childs[i], path + '_' + i ) );
- } );
- $('#pages').prepend( $( '<div class="page" id="' + path + '" style="'+style+';"/>' ).append(container) );
- return ret_val;
- }
+ this.addCreator = function (name, object) {
+ this.creators[name] = object;
+ }
- this.creators.line = function()
- {
- return $( '<hr />' );
- }
+ this.getCreator = function(name) {
+ if (typeof this.creators[name] == undefined) {
+ return this.creators.unknown;
+ }
+ return this.creators[name];
+ }
- this.creators.break = function()
- {
- return $( '<br />' );
- }
+ /**
+ * The creators object contians all widgets creators and their mappin to the
+ * XML config file tags
+ */
+ this.addCreator("page", {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ var style = ( '0' != path ) ? 'display:none' : '';
+ var name = $(page).attr('name'); //path += '_' + name;
+ var type = $(page).attr('type'); //text, 2d or 3d
+ ret_val.addClass( 'link' ).addClass("pagelink");
+ ret_val.append( '<a href="javascript:scrollToPage(\''+path+'\')">' + name + '</a>' );
+ var childs = $(page).children();
+ var container = $( '<div class="clearfix"/>' );
- this.creators.text = function( page )
- {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'text' );
- var style = '';
- if( $(page).attr('align') ) style += 'text-align:' + $(page).attr('align') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- ret_val.append( '<div ' + style + '>' + page.textContent + '</div>' );
- return ret_val;
- }
+ container.append( '<h1>' + name + '</h1>' );
+ $( childs ).each( function(i){
+ container.append( create_pages(childs[i], path + '_' + i ) );
+ } );
+ $('#pages').prepend( $( '<div class="page" id="' + path + '" style="'+style+';"/>' ).append(container) );
+ return ret_val;
+ },
+ attributes: {
+ name: {type: "string", required: true}
+ },
+ content: true
+ });
- this.creators.info =
- this.creators.shade = function( page )
- {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'info' );
- var label = '<div class="label">' + page.textContent + '</div>';
- ga_list.push( $(page).attr('address') );
- var actor = '<div class="actor GA' + $(page).attr('address').split('/').join('_') + '">';
- if( $(page).attr('pre') ) actor += '<div>' + $(page).attr('pre') + '</div>';
- actor += '<div class="value">-</div>';
- if( $(page).attr('post') ) actor += '<div>' + $(page).attr('post') + '</div>';
- actor += '</div>';
- ret_val.append( label ).append( $(actor).data( {
- 'GA': $(page).attr('address'),
- 'datatype': $(page).attr('datatype'),
- 'mapping' : $(page).attr('mapping'),
- 'style' : $(page).attr('style')
- } ) );
- return ret_val;
- }
+ this.addCreator("line", {
+ create: function( page, path ) {
+ return $( '<hr />' );
+ },
+ attributes: {
+ },
+ content: false
+ });
- this.creators.dim =
- this.creators.slide = function( page )
- {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'dim' );
- var label = '<div class="label">' + page.textContent + '</div>';
- ga_list.push( $(page).attr('address') );
- var actor = $('<div class="actor GA' + $(page).attr('address').split('/').join('_') + '" />');
- ret_val.append( label ).append( actor );
- var min = parseFloat( $(page).attr('min') || 0 );
- var max = parseFloat( $(page).attr('max') || 100 );
- var step = parseFloat( $(page).attr('step') || 0.5 );
- ret_val.find('.actor').data( {
- 'events': $(actor).data( 'events' ),
- 'GA': $(page).attr('address'),
- 'datatype': $(page).attr('datatype'),
- 'mapping' : $(page).attr('mapping'),
- 'style' : $(page).attr('style'),
- 'min' : min,
- 'max' : max,
- 'step' : step,
- 'type' : 'dim'
- }).slider({step:step,min:min,max:max, animate: true,start:slideStart,change:slideChange});//slide:slideAction});
+ this.addCreator("break", {
+ create: function( page, path ) {
+ return $( '<br />' );
+ },
+ attributes: {
+ },
+ content: false
+ });
- return ret_val;
- }
- this.creators.switch =
- this.creators.toggle = function( page )
- {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'switch' );
- var label = '<div class="label">' + page.textContent + '</div>';
- var response_address = $(page).attr('response_address');
- ga_list.push( response_address );
- var actor = '<div class="actor GA' + response_address.split('/').join('_') + ' switchUnpressed">';
- if( $(page).attr('pre') ) actor += $(page).attr('pre');
- actor += '<div class="value">-</div>';
- if( $(page).attr('post') ) actor += $(page).attr('post');
- actor += '</div>';
- ret_val.append( label ).append( $(actor).data( {
- 'GA': $(page).attr('address'),
- 'datatype': $(page).attr('datatype'),
- 'mapping' : $(page).attr('mapping'),
- 'style' : $(page).attr('style'),
- 'type' : 'toggle'
- } ).bind('click',switchAction) );
- return ret_val;
- }
+ this.addCreator("text", {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'text' );
+ var style = '';
+ if( $(page).attr('align') ) style += 'text-align:' + $(page).attr('align') + ';';
+ if( style != '' ) style = 'style="' + style + '"';
+ ret_val.append( '<div ' + style + '>' + page.textContent + '</div>' );
+ return ret_val;
+ },
+ attributes: {
+ align: {type: "string", required: false}
+ },
+ content: "string"
+ });
+
+ this.addCreator("info", {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'info' );
+ var label = '<div class="label">' + page.textContent + '</div>';
+ ga_list.push( $(page).attr('address') );
+ var actor = '<div class="actor GA' + $(page).attr('address').split('/').join('_') + '">';
+ if( $(page).attr('pre') ) actor += '<div>' + $(page).attr('pre') + '</div>';
+ actor += '<div class="value">-</div>';
+ if( $(page).attr('post') ) actor += '<div>' + $(page).attr('post') + '</div>';
+ actor += '</div>';
+ ret_val.append( label ).append( $(actor).data( {
+ 'GA': $(page).attr('address'),
+ 'datatype': $(page).attr('datatype'),
+ 'mapping' : $(page).attr('mapping'),
+ 'style' : $(page).attr('style')
+ } ) );
+ return ret_val;
+ },
+ attributes: {
+ address: {type: "address", required: true},
+ datatype: {type: "numeric", required: true},
+ pre: {type: "string", required: false},
+ post: {type: "string", required: false},
+ mapping: {type: "mapping", required: false},
+ style: {type: "style", required: false}
+ },
+ content: "string"
+ });
- this.creators.trigger = function( page )
- {
- var value = $(page).attr('value') ? $(page).attr('value') : 0;
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'switch' );
- var label = '<div class="label">' + page.textContent + '</div>';
- var address = $(page).attr('address');
- var actor = '<div class="actor switchUnpressed">';
- if( $(page).attr('pre') ) actor += $(page).attr('pre');
- var map = $(page).attr('mapping');
- if( mappings[map] && mappings[map][value] )
- actor += '<div class="value">' + mappings[map][value] + '</div>';
- else
- actor += '<div class="value">' + value + '</div>';
- if( $(page).attr('post') ) actor += $(page).attr('post');
- actor += '</div>';
- ret_val.append( label ).append( $(actor).data( {
- 'GA': $(page).attr('address'),
- 'datatype': $(page).attr('datatype'),
- 'mapping' : $(page).attr('mapping'),
- 'style' : $(page).attr('style'),
- 'type' : 'trigger',
- 'sendValue': value
- } ).bind('click',triggerAction) );
+ this.addCreator("shade", this.getCreator("info"));
- return ret_val;
- }
- this.creators.image = function( page )
- {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'image' );
- ret_val.append( '<div class="label">' + page.textContent + '</div>' );
- var style = '';
- if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
- if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><img src="' +$(page).attr('src') + '" ' + style + ' /></div>';
- var refresh = $(page).attr('refresh') ? $(page).attr('refresh')*1000 : 0;
- ret_val.append( $(actor).data( {
- 'refresh': refresh
- } ).each(setupRefreshAction) ); // abuse "each" to call in context...
- return ret_val;
- }
+ this.addCreator("dim", {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'dim' );
+ var label = '<div class="label">' + page.textContent + '</div>';
+ ga_list.push( $(page).attr('address') );
+ var actor = $('<div class="actor GA' + $(page).attr('address').split('/').join('_') + '" />');
+ ret_val.append( label ).append( actor );
+ var min = parseFloat( $(page).attr('min') || 0 );
+ var max = parseFloat( $(page).attr('max') || 100 );
+ var step = parseFloat( $(page).attr('step') || 0.5 );
+ ret_val.find('.actor').data( {
+ 'events': $(actor).data( 'events' ),
+ 'GA': $(page).attr('address'),
+ 'datatype': $(page).attr('datatype'),
+ 'mapping' : $(page).attr('mapping'),
+ 'style' : $(page).attr('style'),
+ 'min' : min,
+ 'max' : max,
+ 'step' : step,
+ 'type' : 'dim'
+ }).slider({step:step,min:min,max:max, animate: true,start:slideStart,change:slideChange});//slide:slideAction});
- this.creators.video = function( page )
- {
- var ret_val = $('<div class="widget" />');
- ret_val.addClass( 'video' );
- ret_val.append( '<div class="label">' + page.textContent + '</div>' );
- var style = '';
- if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
- if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
- if( style != '' ) style = 'style="' + style + '"';
- var actor = '<div class="actor"><video src="' +$(page).attr('src') + '" ' + style + ' controls="controls" /></div>';
- var refresh = $(page).attr('refresh') ? $(page).attr('refresh')*1000 : 0;
- ret_val.append( $(actor).data( {
- 'refresh': refresh
- } ).each(setupRefreshAction) ); // abuse "each" to call in context...
- return ret_val;
- }
+ return ret_val;
+ },
+ attributes: {
+ address: {type: "address", required: true},
+ datatype: {type: "numeric", required: true},
+ response_address: {type: "address", required: true},
+ response_datatype: {type: "numeric", required: true},
+ min: {type: "numeric", required: false},
+ max: {type: "numeric", required: false},
+ step: {type: "numeric", required: false},
+ mapping: {type: "mapping", required: false},
+ style: {type: "style", required: false}
+ },
+ content: "string"
+ });
- this.creators.unknown = function( page )
- {
- var ret_val = $('<div class="widget" />');
- ret_val.append( '<pre>' + page.textContent + '</pre>' );
- return ret_val;
- }
+ this.addCreator("slide", this.getCreator("dim"));
- this.switchAction = function()
- {
+ this.addCreator("switch", {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'switch' );
+ var label = '<div class="label">' + page.textContent + '</div>';
+ var response_address = $(page).attr('response_address');
+ ga_list.push( response_address );
+ var actor = '<div class="actor GA' + response_address.split('/').join('_') + ' switchUnpressed">';
+ if( $(page).attr('pre') ) actor += $(page).attr('pre');
+ actor += '<div class="value">-</div>';
+ if( $(page).attr('post') ) actor += $(page).attr('post');
+ actor += '</div>';
+ ret_val.append( label ).append( $(actor).data( {
+ 'GA': $(page).attr('address'),
+ 'datatype': $(page).attr('datatype'),
+ 'mapping' : $(page).attr('mapping'),
+ 'style' : $(page).attr('style'),
+ 'type' : 'toggle'
+ } ).bind('click',switchAction) );
+ return ret_val;
+ },
+ attributes: {
+ address: {type: "address", required: true},
+ datatype: {type: "numeric", required: true},
+ response_address: {type: "address", required: true},
+ response_datatype: {type: "numeric", required: true},
+ pre: {type: "string", required: false},
+ post: {type: "string", required: false},
+ mapping: {type: "mapping", required: false},
+ style: {type: "style", required: false}
+ },
+ content: "string"
+ });
+
+ this.addCreator("toggle", this.getCreator("switch"));
+
+ this.addCreator("trigger", {
+ create: function( page, path ) {
+ var value = $(page).attr('value') ? $(page).attr('value') : 0;
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'switch' );
+ var label = '<div class="label">' + page.textContent + '</div>';
+ var address = $(page).attr('address');
+ var actor = '<div class="actor switchUnpressed">';
+ if( $(page).attr('pre') ) actor += $(page).attr('pre');
+ var map = $(page).attr('mapping');
+ if( mappings[map] && mappings[map][value] )
+ actor += '<div class="value">' + mappings[map][value] + '</div>';
+ else
+ actor += '<div class="value">' + value + '</div>';
+ if( $(page).attr('post') ) actor += $(page).attr('post');
+ actor += '</div>';
+ ret_val.append( label ).append( $(actor).data( {
+ 'GA': $(page).attr('address'),
+ 'datatype': $(page).attr('datatype'),
+ 'mapping' : $(page).attr('mapping'),
+ 'style' : $(page).attr('style'),
+ 'type' : 'trigger',
+ 'sendValue': value
+ } ).bind('click',triggerAction) );
+
+ return ret_val;
+ },
+ attributes: {
+ address: {type: "address", required: true},
+ datatype: {type: "numeric", required: true},
+ value: {type: "string", required: true},
+ pre: {type: "string", required: false},
+ post: {type: "string", required: false},
+ mapping: {type: "mapping", required: false},
+ style: {type: "style", required: false}
+ },
+ content: "string"
+ });
+
+ this.addCreator("image", {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'image' );
+ ret_val.append( '<div class="label">' + page.textContent + '</div>' );
+ var style = '';
+ if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
+ if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
+ if( style != '' ) style = 'style="' + style + '"';
+ var actor = '<div class="actor"><img src="' +$(page).attr('src') + '" ' + style + ' /></div>';
+ var refresh = $(page).attr('refresh') ? $(page).attr('refresh')*1000 : 0;
+ ret_val.append( $(actor).data( {
+ 'refresh': refresh
+ } ).each(setupRefreshAction) ); // abuse "each" to call in context...
+ return ret_val;
+ },
+ attributes: {
+ src: {type: "uri", required: true},
+ width: {type: "string", required: false},
+ height: {type: "string", required: false},
+ refresh: {type: "numeric", required: false}
+ },
+ content: "string"
+ });
+
+ this.addCreator("video", {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'video' );
+ ret_val.append( '<div class="label">' + page.textContent + '</div>' );
+ var style = '';
+ if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
+ if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
+ if( style != '' ) style = 'style="' + style + '"';
+ var actor = '<div class="actor"><video src="' +$(page).attr('src') + '" ' + style + ' controls="controls" /></div>';
+ var refresh = $(page).attr('refresh') ? $(page).attr('refresh')*1000 : 0;
+ ret_val.append( $(actor).data( {
+ 'refresh': refresh
+ } ).each(setupRefreshAction) ); // abuse "each" to call in context...
+ return ret_val;
+ },
+ attributes: {
+ src: {type: "uri", required: true},
+ width: {type: "string", required: false},
+ height: {type: "string", required: false},
+ refresh: {type: "numeric", required: false}
+ },
+ content: "string"
+ });
+
+ this.addCreator("unknown", {
+ create: function( page, path ) {
+ var ret_val = $('<div class="widget" />');
+ ret_val.append( '<pre>' + page.textContent + '</pre>' );
+ return ret_val;
+ },
+ attributes: {
+ },
+ content: "string"
+ });
+
+ this.switchAction = function() {
var data = $(this).data();
// alert( data.GA + ' = ' + data.value );
visu.write( data.GA, data.value=='1' ? '0' : '1', data.datatype );
}
- this.slideAction = function(event,ui)
- {
+ this.slideAction = function(event,ui) {
//alert(ui.value);
var now = new Date().getTime();
var data = $( '.actor', $(this).parent() ).data();
@@ -229,8 +327,7 @@
* Setup a refresh interval in seconds if the 'refresh' in the .data()
* ist bigger than 0
*/
- this.refreshAction = function(that)
- {
+ this.refreshAction = function(that) {
var data = $(this).data();
alert('this.refreshAction');
}
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2010-11-06 17:01:33 UTC (rev 86)
+++ CometVisu/trunk/visu/visu_config.xsd 2010-11-06 18:08:50 UTC (rev 87)
@@ -178,7 +178,7 @@
<xsd:attribute name="src" type="uri" use="required" />
<xsd:attribute name="width" type="dimension" />
<xsd:attribute name="height" type="dimension" />
- <xsd:attribute name="refresh" type="xsd:decima" />
+ <xsd:attribute name="refresh" type="xsd:decimal" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ni...@us...> - 2010-11-06 17:01:41
|
Revision: 86
http://openautomation.svn.sourceforge.net/openautomation/?rev=86&view=rev
Author: nilss1
Date: 2010-11-06 17:01:33 +0000 (Sat, 06 Nov 2010)
Log Message:
-----------
Sheduler testing
Added Paths:
-----------
PyWireGate/trunk/cycler.py
Added: PyWireGate/trunk/cycler.py
===================================================================
--- PyWireGate/trunk/cycler.py (rev 0)
+++ PyWireGate/trunk/cycler.py 2010-11-06 17:01:33 UTC (rev 86)
@@ -0,0 +1,203 @@
+# -*- 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 threading
+
+import time
+
+
+class cycler:
+ def __init__(self,WireGateInstance):
+ self.WG = WireGateInstance
+
+ self.isrunning = True
+ ## Dummy Timer
+ self.waiting = threading.Timer(0,lambda: None)
+ self.waiting.setDaemon(1)
+ self.mutex = threading.RLock()
+ self.getTime = lambda x: x.getTime
+ self.timerList = []
+ self.running = {}
+
+ def debug(self,msg):
+ print "DEBUG Cycler: %s" % msg
+ def remove(self, obj):
+ if not self.isrunning:
+ ## dont try to get a mutex
+ return False
+ try:
+ self.mutex.acquire()
+ if obj in self.timerList:
+ try:
+ self.timerList.remove(obj)
+ except:
+ pass
+ self.debug("Removed %r" % obj.action)
+ if len(self.timerList) == 0:
+ ## kill waiting timer
+ self.debug("Cancel GLobal wait")
+ self.waiting.cancel()
+ if obj in self.running:
+ try:
+ if self.running[obj].isAlive():
+ self.running[obj].cancel()
+ self.debug("Canceled %r" % obj.args)
+ finally:
+ self.debug("terminated %r" % obj.args)
+ del self.running[obj]
+
+ finally:
+ self.mutex.release()
+
+
+ def add(self,rtime,function,*args,**kwargs):
+ if not self.isrunning:
+ ## dont try to get a mutex
+ return False
+ self.debug("adding task: %r (%r / %r)" % (function,args,kwargs))
+ self.addShedule(sheduleObject(self,self.WG,rtime,function,args=args,kwargs=kwargs))
+
+ def cycle(self,rtime,function,*args,**kwargs):
+ if not self.isrunning:
+ ## dont try to get a mutex
+ return False
+ self.debug("adding cycliv task: %r (%r / %r)" % (function,args,kwargs))
+ self.addShedule(sheduleObject(self,self.WG,rtime,function,cycle=True,args=args,kwargs=kwargs))
+
+ def addShedule(self,shed):
+ print "ADD _shed %r" % shed
+ self.mutex.acquire()
+ self.timerList.append(shed)
+ ## Try to stop running timer
+ try:
+ self.waiting.cancel()
+ except:
+ pass
+ self.timerList.sort(key=self.getTime)
+ self.mutex.release()
+
+ ## check if any Timer need activation
+ self._check()
+
+ return shed
+
+
+ def _check(self):
+ self.debug("Cycle")
+ try:
+ self.mutex.acquire()
+ ## all actions that need activation in next 60seconds
+ for shedobj in filter(lambda x: x.getTime() < 60, self.timerList):
+ try:
+ self.running[shedobj] = threading.Timer(shedobj.getTime(),shedobj.run)
+ self.running[shedobj].start()
+ #print "run %s" % t.name
+ except:
+ print "Failed"
+ raise
+ ## remove from List because its now in the past
+ self.timerList.remove(shedobj)
+ finally:
+ if len(self.timerList) >0:
+ print "Wait for later timer %r" % (self.timerList[0].getTime()-5)
+ self.waiting = threading.Timer(self.timerList[0].getTime()-5 ,self._check)
+ self.waiting.start()
+ self.mutex.release()
+
+
+ def shutdown(self):
+ print "Try killing"
+ self.isrunning = False
+ try:
+ ## stop all new timer
+ self.mutex.acquire()
+ print "Have Mutex"
+ self.waiting.cancel()
+ try:
+ self.waiting.join(2)
+ except:
+ ## maybe not even running
+ pass
+ print "Thread canceld"
+ self.timerList = []
+ for obj in self.running.keys():
+ print "cancel task %r" % obj.args
+ try:
+ tobecanceled = self.running.pop(obj)
+
+ except:
+ pass
+ tobecanceled.cancel()
+ tobecanceled.is
+ tobecanceled.join(2)
+
+
+ except:
+ self.debug("SHUTDOWN FAILED")
+
+
+class sheduleObject:
+ def __init__(self,parent,WireGateInstance,rtime,function,cycle=False,args = [],kwargs={}):
+ self.Parent = parent
+ self.WG = WireGateInstance
+ self.delay = rtime
+ self.cycle = cycle
+ self._set()
+ self.action = function
+ self.args = args
+ self.kwargs = kwargs
+
+ def _set(self):
+ self.timer = time.time() + self.delay
+
+ def run(self):
+ args = self.args
+ kwargs = self.kwargs
+ self.action(*args,**kwargs)
+ self.Parent.remove(self)
+ if self.cycle:
+ self._set()
+ self.Parent.addShedule(self)
+
+
+ def getTime(self):
+ return self.timer - time.time()
+
+
+
+if __name__ == '__main__':
+ try:
+ cycle = cycler(False)
+ import sys
+ import atexit
+ atexit.register(cycle.shutdown)
+ def write_time(text=''):
+ print "running %s: %f" % (text,time.time())
+ write_time('Main')
+ cycle.cycle(4,write_time,"Cycletask1!")
+ #longtask=cycle.add(80,write_time,"task2!")
+ #f=cycle.add(7,write_time,"task3!")
+ time.sleep(2)
+ #cycle.remove(f)
+ #time.sleep(5)
+ #cycle.remove(longtask)
+ #cycle.shutdown()
+ #cycle.add(6,write_time,"task4!")
+ except KeyboardInterrupt:
+ #cycle.shutdown()
+ sys.exit(0)
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-05 21:55:33
|
Revision: 85
http://openautomation.svn.sourceforge.net/openautomation/?rev=85&view=rev
Author: mayerch
Date: 2010-11-05 21:55:26 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Created "creators" object in the VisuDesign object to simplify page creation and provide meta information for a future editor version
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/lib/visudesign_custom.js
CometVisu/trunk/visu/lib/visudesign_pure.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-11-05 20:29:23 UTC (rev 84)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-05 21:55:26 UTC (rev 85)
@@ -215,34 +215,9 @@
function create_pages( page, path )
{
- switch( page.nodeName )
- {
- case 'page':
- return design.createPage( page, path );
- case 'line':
- return design.createLine();
- case 'break':
- return design.createBreak();
- case 'text':
- return design.createText( page );
- case 'info':
- case 'shade':
- return design.createInfo( page );
- case 'dim':
- return design.createDim( page );
- case 'slide':
- return design.createSlide( page );
- case 'switch':
- case 'toggle':
- return design.createSwitch( page );
- case 'trigger':
- return design.createTrigger( page );
- case 'image':
- return design.createImage( page );
- case 'video':
- return design.createVideo( page );
- }
- return design.createUnknown( page );
+ if( design.creators[ page.nodeName ] )
+ return design.creators[ page.nodeName ]( page, path );
+ return design.creators.unknown( page );
}
function scrollToPage( page_id )
Modified: CometVisu/trunk/visu/lib/visudesign_custom.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_custom.js 2010-11-05 20:29:23 UTC (rev 84)
+++ CometVisu/trunk/visu/lib/visudesign_custom.js 2010-11-05 21:55:26 UTC (rev 85)
@@ -24,7 +24,7 @@
/**
* Custom changes could go here and look e.g. like
****************************************
-VisuDesign_Custom.prototype.createText = function( page )
+VisuDesign_Custom.prototype.creators.text = function( page )
{
var ret_val = $('<div class="widget" />');
ret_val.addClass( 'text' );
Modified: CometVisu/trunk/visu/lib/visudesign_pure.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-05 20:29:23 UTC (rev 84)
+++ CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-05 21:55:26 UTC (rev 85)
@@ -20,7 +20,12 @@
*/
function VisuDesign()
{
- this.createPage = function( page, path )
+ /**
+ * The creators object contians all widgets creators and their mappin to the
+ * XML config file tags
+ */
+ this.creators = {};
+ this.creators.page = function( page, path )
{
var ret_val = $('<div class="widget" />');
var style = ( '0' != path ) ? 'display:none' : '';
@@ -39,17 +44,17 @@
return ret_val;
}
- this.createLine = function()
+ this.creators.line = function()
{
return $( '<hr />' );
}
- this.createBreak = function()
+ this.creators.break = function()
{
return $( '<br />' );
}
- this.createText = function( page )
+ this.creators.text = function( page )
{
var ret_val = $('<div class="widget" />');
ret_val.addClass( 'text' );
@@ -60,8 +65,8 @@
return ret_val;
}
- this.createInfo =
- this.createShade = function( page )
+ this.creators.info =
+ this.creators.shade = function( page )
{
var ret_val = $('<div class="widget" />');
ret_val.addClass( 'info' );
@@ -81,8 +86,8 @@
return ret_val;
}
- this.createDim =
- this.createSlide = function( page )
+ this.creators.dim =
+ this.creators.slide = function( page )
{
var ret_val = $('<div class="widget" />');
ret_val.addClass( 'dim' );
@@ -108,8 +113,8 @@
return ret_val;
}
- this.createSwitch =
- this.createToggle = function( page )
+ this.creators.switch =
+ this.creators.toggle = function( page )
{
var ret_val = $('<div class="widget" />');
ret_val.addClass( 'switch' );
@@ -131,7 +136,7 @@
return ret_val;
}
- this.createTrigger = function( page )
+ this.creators.trigger = function( page )
{
var value = $(page).attr('value') ? $(page).attr('value') : 0;
var ret_val = $('<div class="widget" />');
@@ -159,7 +164,7 @@
return ret_val;
}
- this.createImage = function( page )
+ this.creators.image = function( page )
{
var ret_val = $('<div class="widget" />');
ret_val.addClass( 'image' );
@@ -176,7 +181,7 @@
return ret_val;
}
- this.createVideo = function( page )
+ this.creators.video = function( page )
{
var ret_val = $('<div class="widget" />');
ret_val.addClass( 'video' );
@@ -193,7 +198,7 @@
return ret_val;
}
- this.createUnknown = function( page )
+ this.creators.unknown = function( page )
{
var ret_val = $('<div class="widget" />');
ret_val.append( '<pre>' + page.textContent + '</pre>' );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-05 20:29:29
|
Revision: 84
http://openautomation.svn.sourceforge.net/openautomation/?rev=84&view=rev
Author: mayerch
Date: 2010-11-05 20:29:23 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Added refresh@image and video tag to definitions
Modified Paths:
--------------
CometVisu/trunk/visu/visu_config.xsd
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2010-11-05 19:56:15 UTC (rev 83)
+++ CometVisu/trunk/visu/visu_config.xsd 2010-11-05 20:29:23 UTC (rev 84)
@@ -103,6 +103,7 @@
<xsd:element name="info" type="info" />
<xsd:element name="shade" type="info" />
<xsd:element name="image" type="image" />
+ <xsd:element name="video" type="video" />
<xsd:element name="break" type="break" />
<xsd:element ref="page" />
</xsd:choice>
@@ -177,10 +178,21 @@
<xsd:attribute name="src" type="uri" use="required" />
<xsd:attribute name="width" type="dimension" />
<xsd:attribute name="height" type="dimension" />
+ <xsd:attribute name="refresh" type="xsd:decima" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
+<xsd:complexType name="video">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="src" type="uri" use="required" />
+ <xsd:attribute name="width" type="dimension" />
+ <xsd:attribute name="height" type="dimension" />
+ </xsd:extension>
+ </xsd:simpleContent>
+</xsd:complexType>
+
<xsd:complexType name="break" />
<xsd:complexType name="line" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-05 19:56:21
|
Revision: 83
http://openautomation.svn.sourceforge.net/openautomation/?rev=83&view=rev
Author: mayerch
Date: 2010-11-05 19:56:15 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
- New Feature: tag for videos (HTML5 based)
Modified Paths:
--------------
CometVisu/trunk/ChangeLog
Modified: CometVisu/trunk/ChangeLog
===================================================================
--- CometVisu/trunk/ChangeLog 2010-11-05 19:53:53 UTC (rev 82)
+++ CometVisu/trunk/ChangeLog 2010-11-05 19:56:15 UTC (rev 83)
@@ -9,6 +9,7 @@
- New Feature: tag for images
- New Feature: <text> has new optional attribute "align"
- Added XML Schema / XSD to validate config-XML
+- New Feature: tag for videos (HTML5 based)
0.5.0
=====
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-05 19:53:59
|
Revision: 82
http://openautomation.svn.sourceforge.net/openautomation/?rev=82&view=rev
Author: mayerch
Date: 2010-11-05 19:53:53 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
New Feature: tag for videos (HTML5 based)
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/lib/visudesign_pure.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-11-05 18:35:30 UTC (rev 81)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-05 19:53:53 UTC (rev 82)
@@ -239,6 +239,8 @@
return design.createTrigger( page );
case 'image':
return design.createImage( page );
+ case 'video':
+ return design.createVideo( page );
}
return design.createUnknown( page );
}
Modified: CometVisu/trunk/visu/lib/visudesign_pure.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-05 18:35:30 UTC (rev 81)
+++ CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-05 19:53:53 UTC (rev 82)
@@ -176,6 +176,23 @@
return ret_val;
}
+ this.createVideo = function( page )
+ {
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'video' );
+ ret_val.append( '<div class="label">' + page.textContent + '</div>' );
+ var style = '';
+ if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
+ if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
+ if( style != '' ) style = 'style="' + style + '"';
+ var actor = '<div class="actor"><video src="' +$(page).attr('src') + '" ' + style + ' controls="controls" /></div>';
+ var refresh = $(page).attr('refresh') ? $(page).attr('refresh')*1000 : 0;
+ ret_val.append( $(actor).data( {
+ 'refresh': refresh
+ } ).each(setupRefreshAction) ); // abuse "each" to call in context...
+ return ret_val;
+ }
+
this.createUnknown = function( page )
{
var ret_val = $('<div class="widget" />');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-05 18:35:36
|
Revision: 81
http://openautomation.svn.sourceforge.net/openautomation/?rev=81&view=rev
Author: mayerch
Date: 2010-11-05 18:35:30 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
New Feature: images allow refresh attribute
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
CometVisu/trunk/visu/lib/visudesign_pure.js
CometVisu/trunk/visu/visu_config.xml
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-11-05 10:25:12 UTC (rev 80)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-11-05 18:35:30 UTC (rev 81)
@@ -290,6 +290,22 @@
visu.write( data.GA, data.sendValue, data.datatype );
}
+function refreshAction( target, src )
+{
+ target.src = src + '&' + new Date().getTime();
+}
+function setupRefreshAction()
+{
+ var refresh = $(this).data('refresh');
+ if( refresh && refresh > 0 )
+ {
+ var target = $('img', $(this) )[0];
+ var src = target.src;
+ if( src.indexOf('?') < 0 ) src += '?';
+ $(this).data('interval', setInterval( function(){refreshAction(target, src);}, refresh ) );
+ }
+}
+
/**
* The update thread to send the slider position to the bus
*/
Modified: CometVisu/trunk/visu/lib/visudesign_pure.js
===================================================================
--- CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-05 10:25:12 UTC (rev 80)
+++ CometVisu/trunk/visu/lib/visudesign_pure.js 2010-11-05 18:35:30 UTC (rev 81)
@@ -168,7 +168,11 @@
if( $(page).attr('width') ) style += 'width:' + $(page).attr('width') + ';';
if( $(page).attr('height') ) style += 'height:' + $(page).attr('height') + ';';
if( style != '' ) style = 'style="' + style + '"';
- ret_val.append( '<div class="actor"><img src="' +$(page).attr('src') + '" ' + style + ' /></div>' );
+ var actor = '<div class="actor"><img src="' +$(page).attr('src') + '" ' + style + ' /></div>';
+ var refresh = $(page).attr('refresh') ? $(page).attr('refresh')*1000 : 0;
+ ret_val.append( $(actor).data( {
+ 'refresh': refresh
+ } ).each(setupRefreshAction) ); // abuse "each" to call in context...
return ret_val;
}
@@ -198,4 +202,14 @@
//visu.write( data.GA, data.value=='1' ? '0' : '1', data.datatype );
//FIXME eigentlich richtig... visu.write( data.GA, ui.value, data.datatype );
}
+
+ /**
+ * Setup a refresh interval in seconds if the 'refresh' in the .data()
+ * ist bigger than 0
+ */
+ this.refreshAction = function(that)
+ {
+ var data = $(this).data();
+ alert('this.refreshAction');
+ }
};
Modified: CometVisu/trunk/visu/visu_config.xml
===================================================================
--- CometVisu/trunk/visu/visu_config.xml 2010-11-05 10:25:12 UTC (rev 80)
+++ CometVisu/trunk/visu/visu_config.xml 2010-11-05 18:35:30 UTC (rev 81)
@@ -48,6 +48,9 @@
<image src="icon/comet_128_ff8000.png" >Ein Bild</image>
<image src="icon/comet_128_ff8000.png" />
<image src="icon/comet_128_ff8000.png" width="500px" height="46px" />
+ <image src="http://www.e-zeeinternet.com/count.php?page=546016&style=default&nbdigits=9&reloads=1" refresh="10" >Update every 10 sec</image>
+ <break />
+ <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">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|