}//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
Exemple #2
0
        private static void SetUp()
        {
            FacadePipe myPipe = new FacadePipe(myConfig.Station[0]);

            myMaster = new FacadeApplicationLayerMaster();
            myFacadeISegmentStatistics = new FacadeISegmentStatistics();

            SegmentTiming();

            myMachine = new SegmentStateMachine(myMaster, parameters, false, myFacadeISegmentStatistics, myTimeList);
            myMachine.ResetCounter();
            myMachine.DisconnectedAfterFailureEntered += new EventHandler(myMachine_DisconnectedAfterFailureEntered);
            FacadeSegment myFacadeSegment   = new FacadeSegment();
            int           myMaxNumberOfTags = int.MaxValue;

            Statistics.ChannelStatistics myChanel  = new Statistics.ChannelStatistics(myConfig.Channels[0]);
            DiagnosticSegment            mySegment = new DiagnosticSegment(myConfig.Segments[0], myChanel);

            myInterface = (new FacadeSegment.FacadePipeInterface(new InterfaceParameters(myConfig.Interfaces[0]), myPipe, mySegment));
            myInterface.ResetCounter();
            FacadeSegment.FacadeDataDescription myDataDescription = new FacadeSegment.FacadeDataDescription(myConfig.DataBlocks[0], ref myMaxNumberOfTags);
            myDataDescription.ResetCounter();
            myPipeDataBlock = new FacadeSegment.FacadePipeInterface.FacadePipeDataBlock(myFacadeSegment, myDataDescription, myInterface);
            myPipeDataBlock.ResetCounter();
        }