Changeset 327


Ignore:
Timestamp:
Feb 28, 2011 11:03:04 PM (12 years ago)
Author:
jemian
Message:

show bars for open-close pairs; display each log in a WWW page

Location:
33id_eps_log/src/eps_log_miner
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • 33id_eps_log/src/eps_log_miner/33bmPLC_eps.html

    r326 r327  
    3232         width:          "20%",
    3333         intervalUnit:   Timeline.DateTime.MINUTE,
    34          intervalPixels: 50
     34         intervalPixels: 40
    3535     }),
    3636     Timeline.createBandInfo({
     
    3939         width:          "20%",
    4040         intervalUnit:   Timeline.DateTime.HOUR,
    41          intervalPixels: 50
     41         intervalPixels: 150
    4242     }),
    4343     Timeline.createBandInfo({
     
    4646         width:          "20%",
    4747         intervalUnit:   Timeline.DateTime.DAY,
    48          intervalPixels: 100
     48         intervalPixels: 200
    4949     }),
    5050     Timeline.createBandInfo({
     
    5353         width:          "40%",
    5454         intervalUnit:   Timeline.DateTime.WEEK,
    55          intervalPixels: 100
     55         intervalPixels: 200
    5656     })
    5757   ];
  • 33id_eps_log/src/eps_log_miner/eps_log.py

    r326 r327  
    157157    '''
    158158    root = etree.Element( str(rootTag) )
     159    db = {}
    159160    # build the XML document in memory
    160     for entry in logs.values():
     161    for k in iter(sorted(logs)):
     162        entry = logs[k]
    161163        node = etree.SubElement(root, "event")
    162164        node.attrib['start'] = "T".join( entry['stamp'].split() )
     
    171173        msg += "details: %s<br />" % entry['details']
    172174        try:
    173             node.text = repr(msg)
     175            node.text = msg
    174176        except:
    175177            print "problem with: " + msg
     178        if entry['summary'].endswith(" opened"):
     179            key = entry['summary'].rstrip(" opened")
     180            db[key] = k
     181        elif entry['summary'].endswith(" closed"):
     182            key = entry['summary'].rstrip(" closed")
     183            if key in db:
     184                k0 = db[key]
     185                del db[key]
     186                node = etree.SubElement(root, "event")
     187                node.attrib['start'] = "T".join( logs[k0]['stamp'].split() )
     188                node.attrib['end'] = "T".join( logs[k]['stamp'].split() )
     189                node.attrib['durationEvent'] = "true"
     190                node.attrib['title'] = key + " open"
     191                node.attrib['caption'] = key + " open"
     192                msg = "<b>%s</b><br />" % key
     193                msg += "opened: %s<br />" % k0
     194                msg += "closed: %s<br />" % k
     195                node.text = msg
    176196       
    177197    success = False
Note: See TracChangeset for help on using the changeset viewer.