daemon/core/misc/xmlwriter1.py
def addSessionConfiguration(self):
        ''' Add CORE-specific session configuration XML elements.
        '''
        config = self.createElement("CORE:sessionconfig")

        # origin: geolocation of cartesian coordinate 0,0,0
        refgeo = self.coreSession.location.refgeo
        origin = self.createElement("origin")
        attrs = ("lat","lon","alt")
        have_origin = False
        for i in xrange(3):
            if refgeo[i] is not None:
                origin.setAttribute(attrs[i], str(refgeo[i]))
                have_origin = True
        if have_origin:
            if self.coreSession.location.refscale != 1.0: # 100 pixels = refscale m
                origin.setAttribute("scale100", str(self.coreSession.location.refscale))
            if self.coreSession.location.refxyz != (0.0, 0.0, 0.0):
                pt = self.createElement("point")
                origin.appendChild(pt)
                x,y,z = self.coreSession.location.refxyz
                coordstxt = "%s,%s" % (x,y)
                if z:
                    coordstxt += ",%s" % z
                coords = self.createTextNode(coordstxt)
                pt.appendChild(coords)
            config.appendChild(origin)


        # options
        options = self.createElement("options")
        defaults = self.coreSession.options.getdefaultvalues()
        for i, (k, v) in enumerate(self.coreSession.options.getkeyvaluelist()):
            if str(v) != str(defaults[i]):
                XmlElement.add_parameter(self.document, options, k, v)
        if options.hasChildNodes():
            config.appendChild(options)

        # hook scripts
        hooks = self.createElement("hooks")
        for state in sorted(self.coreSession._hooks.keys()):
            for (filename, data) in self.coreSession._hooks[state]:
                hook = self.createElement("hook")
                hook.setAttribute("name", filename)
                hook.setAttribute("state", str(state))
                txt = self.createTextNode(data)
                hook.appendChild(txt)
                hooks.appendChild(hook)
        if hooks.hasChildNodes():
            config.appendChild(hooks)

        # metadata
        meta = self.createElement("metadata")
        for (k, v) in self.coreSession.metadata.items():
            XmlElement.add_parameter(self.document, meta, k, v)
        if meta.hasChildNodes():
            config.appendChild(meta)

        if config.hasChildNodes():
            self.appendChild(config)
 Add CORE-specific session configuration XML elements.
        
Add CORE-specific session configuration XML elements.
Add CORE - specific session configuration XML elements .
def addSessionConfiguration(self):
        config = self.createElement("CORE:sessionconfig")
        refgeo = self.coreSession.location.refgeo
        origin = self.createElement("origin")
        attrs = ("lat","lon","alt")
        have_origin = False
        for i in xrange(3):
            if refgeo[i] is not None:
                origin.setAttribute(attrs[i], str(refgeo[i]))
                have_origin = True
        if have_origin:
            if self.coreSession.location.refscale != 1.0: 
                origin.setAttribute("scale100", str(self.coreSession.location.refscale))
            if self.coreSession.location.refxyz != (0.0, 0.0, 0.0):
                pt = self.createElement("point")
                origin.appendChild(pt)
                x,y,z = self.coreSession.location.refxyz
                coordstxt = "%s,%s" % (x,y)
                if z:
                    coordstxt += ",%s" % z
                coords = self.createTextNode(coordstxt)
                pt.appendChild(coords)
            config.appendChild(origin)
        options = self.createElement("options")
        defaults = self.coreSession.options.getdefaultvalues()
        for i, (k, v) in enumerate(self.coreSession.options.getkeyvaluelist()):
            if str(v) != str(defaults[i]):
                XmlElement.add_parameter(self.document, options, k, v)
        if options.hasChildNodes():
            config.appendChild(options)
        hooks = self.createElement("hooks")
        for state in sorted(self.coreSession._hooks.keys()):
            for (filename, data) in self.coreSession._hooks[state]:
                hook = self.createElement("hook")
                hook.setAttribute("name", filename)
                hook.setAttribute("state", str(state))
                txt = self.createTextNode(data)
                hook.appendChild(txt)
                hooks.appendChild(hook)
        if hooks.hasChildNodes():
            config.appendChild(hooks)
        meta = self.createElement("metadata")
        for (k, v) in self.coreSession.metadata.items():
            XmlElement.add_parameter(self.document, meta, k, v)
        if meta.hasChildNodes():
            config.appendChild(meta)
        if config.hasChildNodes():
            self.appendChild(config)
def addSessionConfiguration ( self ) : config = self . createElement ( "CORE:sessionconfig" ) refgeo = self . coreSession . location . refgeo origin = self . createElement ( "origin" ) attrs = ( "lat" , "lon" , "alt" ) have_origin = False for i in xrange ( 3 ) : if refgeo [ i ] is not None : origin . setAttribute ( attrs [ i ] , str ( refgeo [ i ] ) ) have_origin = True if have_origin : if self . coreSession . location . refscale != 1.0 : origin . setAttribute ( "scale100" , str ( self . coreSession . location . refscale ) ) if self . coreSession . location . refxyz != ( 0.0 , 0.0 , 0.0 ) : pt = self . createElement ( "point" ) origin . appendChild ( pt ) x , y , z = self . coreSession . location . refxyz coordstxt = "%s,%s" % ( x , y ) if z : coordstxt += ",%s" % z coords = self . createTextNode ( coordstxt ) pt . appendChild ( coords ) config . appendChild ( origin ) options = self . createElement ( "options" ) defaults = self . coreSession . options . getdefaultvalues ( ) for i , ( k , v ) in enumerate ( self . coreSession . options . getkeyvaluelist ( ) ) : if str ( v ) != str ( defaults [ i ] ) : XmlElement . add_parameter ( self . document , options , k , v ) if options . hasChildNodes ( ) : config . appendChild ( options ) hooks = self . createElement ( "hooks" ) for state in sorted ( self . coreSession . _hooks . keys ( ) ) : for ( filename , data ) in self . coreSession . _hooks [ state ] : hook = self . createElement ( "hook" ) hook . setAttribute ( "name" , filename ) hook . setAttribute ( "state" , str ( state ) ) txt = self . createTextNode ( data ) hook . appendChild ( txt ) hooks . appendChild ( hook ) if hooks . hasChildNodes ( ) : config . appendChild ( hooks ) meta = self . createElement ( "metadata" ) for ( k , v ) in self . coreSession . metadata . items ( ) : XmlElement . add_parameter ( self . document , meta , k , v ) if meta . hasChildNodes ( ) : config . appendChild ( meta ) if config . hasChildNodes ( ) : self . appendChild ( config )
Add CORE-specific session configuration XML elements.
Add CORE - specific session configuration XML elements .
''' Add CORE-specific session configuration XML elements.
        ''' # origin: geolocation of cartesian coordinate 0,0,0 # 100 pixels = refscale m # options # hook scripts # metadata
self