}//Scanner #endregion private #region creator private Channel(ComunicationNet.ChannelsRow myCDsc, CommServerComponent parent, bool demoVersion, ISettingsBase settings) : base(false, "ChannelSegTOL_" + myCDsc.Name) { CommServerComponent.Tracer.TraceVerbose(150, m_src, "Creating channel: " + myCDsc.Name); Multichannel.NextChannnel(); myStatistics = new Statistics.ChannelStatistics(myCDsc); PluginCollection m_Plugins = new PluginCollection(parent.m_CommonBusControl); foreach (ComunicationNet.ProtocolRow proto in myCDsc.GetProtocolRows()) { IApplicationLayerMaster chnProtocol = CreateApplicationProtocol(proto, parent, m_Plugins, settings); if (chnProtocol != null) { foreach (ComunicationNet.SegmentsRow currDSC in proto.GetSegmentsRows()) { SegmentParameters parameters = new SegmentParameters(currDSC); Diagnostic.Segment segmentStatistic = new Diagnostic.Segment(currDSC, myStatistics); Segment segment = new Segment (currDSC, (byte)proto.MaxNumberOfRetries, chnProtocol, parameters, demoVersion, segmentStatistic, this) { Cycle = parameters.TimeReconnect }; segment.ResetCounter(); } } else { string name = proto != null ? proto.Name : "---not set---"; CommServerComponent.Tracer.TraceWarning(199, m_src, "Cannot find component implementing the required protocol: " + name); } } //foreach (NetworkConfig.ComunicationNet.ProtocolRow proto in myCDsc.GetProtocolRows) CommServerComponent.Tracer.TraceVerbose(203, m_src, "Channel: " + myCDsc.Name + " has been created."); } //Channel
/// <summary> /// creates new channel row /// </summary> /// <param name="pRowToBeCopied">row to be copied</param> /// <param name="pShallowCopy">indicate if the copy is shallow or deep</param> /// <param name="pPrefix">prefix for the name</param> public void NewChannelsRow(ChannelsRow pRowToBeCopied, bool pShallowCopy, string pPrefix) { ComunicationNet.ChannelsRow cr = NewChannelsRow(pPrefix); AddChannelsRow(cr); if (!pShallowCopy) { foreach (ProtocolRow pr in pRowToBeCopied.GetProtocolRows()) { ((ComunicationNet)DataSet).Protocol.NewProtocolRow(cr.ChannelID, pr, false, pPrefix); } } return; }
/// <summary> /// creates new channel row /// </summary> /// <param name="pPrefix">prefix for the name</param> /// <returns>new channel row</returns> public ChannelsRow NewChannelsRow(string pPrefix) { ComunicationNet.ChannelsRow cr = NewChannelsRow(); cr.Name = string.Format("{0}{2}Channel{1}", pPrefix, cr.ChannelID.ToString(), m_IdentSep); return(cr); }