Mercurial > hg > nsaunier > traffic-intelligence
comparison python/storage.py @ 695:957126bfb456 dev
corrected bug with indicator loading(also now correctly loading mostsevereismax)
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Thu, 09 Jul 2015 00:58:08 -0400 |
| parents | 5ee22bf7e4d5 |
| children | f0a897d7f3a5 |
comparison
equal
deleted
inserted
replaced
| 694:c4363aa6f0e5 | 695:957126bfb456 |
|---|---|
| 535 if row[0] != interactionNum: | 535 if row[0] != interactionNum: |
| 536 interactionNum = row[0] | 536 interactionNum = row[0] |
| 537 interactions.append(events.Interaction(interactionNum, moving.TimeInterval(row[3],row[4]), row[1], row[2])) | 537 interactions.append(events.Interaction(interactionNum, moving.TimeInterval(row[3],row[4]), row[1], row[2])) |
| 538 interactions[-1].indicators = {} | 538 interactions[-1].indicators = {} |
| 539 if indicatorTypeNum != row[5] or row[0] != interactionNum: | 539 if indicatorTypeNum != row[5] or row[0] != interactionNum: |
| 540 indicatorTypeNum = row[5] | |
| 540 indicatorName = events.Interaction.indicatorNames[indicatorTypeNum] | 541 indicatorName = events.Interaction.indicatorNames[indicatorTypeNum] |
| 541 indicatorValues = {row[6]:row[7]} | 542 indicatorValues = {row[6]:row[7]} |
| 542 interactions[-1].indicators[indicatorName] = indicators.SeverityIndicator(indicatorName, indicatorValues) | 543 interactions[-1].indicators[indicatorName] = indicators.SeverityIndicator(indicatorName, indicatorValues, mostSevereIsMax = not indicatorName in events.Interaction.timeIndicators) |
| 543 indicatorTypeNum = row[5] | |
| 544 else: | 544 else: |
| 545 indicatorValues[row[6]] = row[7] | 545 indicatorValues[row[6]] = row[7] |
| 546 interactions[-1].indicators[indicatorName].timeInterval.last = row[6] | 546 interactions[-1].indicators[indicatorName].timeInterval.last = row[6] |
| 547 except sqlite3.OperationalError as error: | 547 except sqlite3.OperationalError as error: |
| 548 printDBError(error) | 548 printDBError(error) |
