SFCViewer.py
changeset 1 e9d01d824086
parent 0 b622defdfd98
child 2 93bc4c2cf376
equal deleted inserted replaced
0:b622defdfd98 1:e9d01d824086
  1571             self.ActionList += "%s%s"%(sep, action)
  1571             self.ActionList += "%s%s"%(sep, action)
  1572             sep = ","
  1572             sep = ","
  1573 
  1573 
  1574     def SetValues(self, actions):
  1574     def SetValues(self, actions):
  1575         for action in actions:
  1575         for action in actions:
  1576             row = {"Qualifier" : action["qualifier"], "Value" : action["value"],
  1576             row = {"Qualifier" : action["qualifier"], "Value" : action["value"]}
  1577                 "Indicator" : action["indicator"]}
       
  1578             if action["type"] == "reference":
  1577             if action["type"] == "reference":
  1579                 if action["value"] in self.ActionList:
  1578                 if action["value"] in self.ActionList:
  1580                     row["Type"] = "Action"
  1579                     row["Type"] = "Action"
  1581                 elif action["value"] in self.VariableList:
  1580                 elif action["value"] in self.VariableList:
  1582                     row["Type"] = "Variable"
  1581                     row["Type"] = "Variable"
  1584                     row["Type"] = "Inline"
  1583                     row["Type"] = "Inline"
  1585             else:
  1584             else:
  1586                 row["Type"] = "Inline"
  1585                 row["Type"] = "Inline"
  1587             if "duration" in action:
  1586             if "duration" in action:
  1588                 row["Duration"] = action["duration"]
  1587                 row["Duration"] = action["duration"]
       
  1588             else:
       
  1589                 row["Duration"] = ""
       
  1590             if "indicator" in action:
       
  1591                 row["Indicator"] = action["indicator"]
       
  1592             else:
       
  1593                 row["Indicator"] = ""
  1589             self.Table.AppendRow(row)
  1594             self.Table.AppendRow(row)
  1590         self.Table.ResetView(self.ActionsGrid)
  1595         self.Table.ResetView(self.ActionsGrid)
  1591     
  1596     
  1592     def GetValues(self):
  1597     def GetValues(self):
  1593         values = []
  1598         values = []
  1594         for data in self.Table.GetData():
  1599         for data in self.Table.GetData():
  1595             action = {"qualifier" : data["Qualifier"], "value" : data["Value"],
  1600             print data
  1596                 "indicator" : data["Indicator"]}
  1601             action = {"qualifier" : data["Qualifier"], "value" : data["Value"]}
  1597             if data["Type"] in ["Action", "Variable"]:
  1602             if data["Type"] in ["Action", "Variable"]:
  1598                 action["type"] = "reference"
  1603                 action["type"] = "reference"
  1599             else:
  1604             else:
  1600                 action["type"] = "inline"
  1605                 action["type"] = "inline"
  1601             if data["Duration"] != "":
  1606             if data["Duration"] != "":
  1602                 action["duration"] = data["Duration"]
  1607                 action["duration"] = data["Duration"]
       
  1608             if data["Indicator"] != "":
       
  1609                 action["indicator"] = data["Indicator"]
  1603             values.append(action)
  1610             values.append(action)
  1604         return values
  1611         return values