195 def merge(self,mobj,override=False):
196 "Merge the given StatusObj into the list, ANDing (default) or override"
197 if (mobj.start>=mobj.stop):
202 while (ix<len(self.
_seq)):
205 if (mobj.start<self.
_seq[ix].start
and mobj.stop>oldstop):
207 nstart=
max(oldstop,mobj.start)
208 nstop=
min(self.
_seq[ix].start,mobj.stop)
212 self.
_seq.insert(ix,
StatusObj(nstart,nstop,mobj.code,mobj.deadfrac,mobj.thrust,mobj.nconfig,mobj.nworking,mobj.comment))
215 if (mobj.start<self.
_seq[ix].stop
and mobj.stop>self.
_seq[ix].start):
220 (mobj.code<=self.
_seq[ix].code
and mobj.code!=0)
or
221 (self.
_seq[ix].code==0)):
223 ecode=self.
_seq[ix].code
224 edeadfrac=self.
_seq[ix].deadfrac
225 ethrust=self.
_seq[ix].thrust
226 enconfig=self.
_seq[ix].nconfig
227 enworking=self.
_seq[ix].nworking
228 ecomment=self.
_seq[ix].comment
229 estart=self.
_seq[ix].start
230 estop=self.
_seq[ix].stop
233 if (mobj.start>estart):
235 self.
_seq.insert(ix,
StatusObj(estart,mobj.start,ecode,edeadfrac,ethrust,enconfig,enworking,ecomment))
238 if (mobj.stop<estop):
240 self.
_seq.insert(ix+1,
StatusObj(mobj.stop,estop,ecode,edeadfrac,ethrust,enconfig,enworking,ecomment))
243 self.
_seq[iy]=
StatusObj(
max(mobj.start,estart),
min(mobj.stop,estop),mobj.code,mobj.deadfrac,mobj.thrust,mobj.nconfig,mobj.nworking,mobj.comment)
245 oldstop=self.
_seq[ix].stop
249 if (len(self.
_seq)>0):
250 oldstop=self.
_seq[-1].stop
251 if (mobj.stop>oldstop):
252 nstart=
max(oldstop,mobj.start)
253 self.
_seq+=[
StatusObj(nstart,mobj.stop,mobj.code,mobj.deadfrac,mobj.thrust,mobj.nconfig,mobj.nworking,mobj.comment)]