@@ -570,7 +570,7 @@ class PreSourceTransitionParser(SourceTransitionParser):
570570 def __init__ (self , payload , sourceInfos , moduleCentric ):
571571 self ._moduleCentric = moduleCentric
572572 super ().__init__ (payload , sourceInfos )
573- self ._sourceInfo = sourceInfos . get ( self . index , {})
573+ self ._sourceInfo = sourceInfos [ 0 ]
574574 def textSpecial (self ):
575575 return "starting"
576576 def jsonInfo (self , syncs , temp , data ):
@@ -626,16 +626,16 @@ def __init__(self, payload, sourceInfos, moduleCentric):
626626 else :
627627 self .allocInfo = AllocInfo (payload [3 :])
628628 self ._moduleCentric = moduleCentric
629- self ._sourceInfo = sourceInfos . get ( self . index , {})
629+ self ._sourceInfo = sourceInfos [ 0 ]
630630 def textSpecial (self ):
631631 return "finished"
632632 def jsonInfo (self , syncs , temp , data ):
633633 start = temp .findTime ("source" , self .transition , self .index )
634634 #we do not know the sync yet so have to wait until the framework transition
635635 if self .transition in [ Phase .construction , Phase .getNextTransition , Phase .destruction , Phase .openFile ]:
636- data .insert ( "source" , self ._sourceInfo ._cpptype if self . _sourceInfo else "Source" , start , self .time , self .transition , self .index , (0 ,) , Activity .process , self .allocInfo )
636+ data .insert ( "source" , self ._sourceInfo ._cpptype , start , self .time , self .transition , self .index , (0 ,) , Activity .process , self .allocInfo )
637637 else :
638- data .insert ( "source" , self ._sourceInfo ._cpptype if self . _sourceInfo else "Source" , start , self .time , self .transition , self .index , self .index , Activity .process , self .allocInfo )
638+ data .insert ( "source" , self ._sourceInfo ._cpptype , start , self .time , self .transition , self .index , self .index , Activity .process , self .allocInfo )
639639 def jsonVisInfo (self , data ):
640640 index = self .index
641641 if self .transition == Phase .Event :
@@ -994,7 +994,7 @@ def __init__(self,f, moduleCentric):
994994 continue
995995 if len (l ) > 5 and l [0 :2 ] == "#S" :
996996 (id ,name ,sType )= tuple (l [2 :].split ())
997- sourceInfos [int ( id ) ] = ModuleInfo (name ,sType )
997+ sourceInfos [0 ] = ModuleInfo (name ,sType )
998998 continue
999999 if len (l ) > 5 and l [0 :2 ] == "#R" :
10001000 (id ,name )= tuple (l [2 :].split ())
@@ -1309,7 +1309,7 @@ def jsonVisualizationInfo(parser):
13091309 time += t ["finish" ]- t ["start" ]
13101310 modules [- 1 ]['time' ]= time
13111311 modules .sort (key = lambda x : x ['time' ], reverse = True )
1312- final ['transitions' ].append ({"name" : "source" , "cpptype" : parser ._sourceInfos [1 ]._cpptype , "slots" :sourceSlot })
1312+ final ['transitions' ].append ({"name" : "source" , "cpptype" : parser ._sourceInfos [0 ]._cpptype , "slots" :sourceSlot })
13131313 for m in modules :
13141314 final ['transitions' ].append (m )
13151315
0 commit comments