/* This function adds a transmit trace */ public void AddTxTrace(Csp.Trace trace, Channel.enChannelType chanType) { TxAlphabet.Add(trace); /* Create a transmit channel for this trace */ AddChannel(trace, chanType); }
public String GetFirstTxTrace() { if (TxAlphabet != null && TxAlphabet.Count > 0) { return(TxAlphabet.First().Name); } else { return(String.Empty); } }
/* This function adds a transmit and a receive trace */ /* NOTE: This function receives a trace without directional information */ public void AddTxRxTrace(Trace trace, Channel.enChannelType chanType) { String sSyncTraceTx = String.Format("!{0}", trace.Name.Trim(new char[] { '!', '?' })); String sSyncTraceRx = String.Format("?{0}", trace.Name.Trim(new char[] { '!', '?' })); TxAlphabet.Add(new Csp.Trace(trace) { Name = sSyncTraceTx }); RxAlphabet.Add(new Csp.Trace(trace) { Name = sSyncTraceRx }); /* Create a transmit channel for this trace */ AddChannel(trace, chanType); }
/* This function returns all the traces of the process, with all non-synchronising traces hidden */ public List <Trace> GetSyncTraces2014() { List <Trace> retList = new List <Trace>(); /* Add all the tx traces to the list */ foreach (Trace trace in TxAlphabet.Where(p => p.synchronisation == true)) { if (!retList.Any(p => p.Name == trace.Name)) { retList.Add(new Trace(trace)); } } /* Add all the rx traces to the list */ foreach (Trace trace in RxAlphabet.Where(p => p.synchronisation == true)) { if (!retList.Any(p => p.Name == trace.Name)) { retList.Add(new Trace(trace)); } } return(retList); }