Exemplo n.º 1
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            SignalLookup lookup = new SignalLookup();
            Mapper       mapper = new Mapper(lookup);

            s_window = this;

            m_algorithmMessageBoxWrapper    = new RichTextBoxWrapper(AlgorithmMessageBox);
            m_subscriberStatusBoxWrapper    = new RichTextBoxWrapper(SubscriberStatusBox);
            m_subscriberMessageBoxWrapper   = new RichTextBoxWrapper(SubscriberMessageBox);
            m_concentratorStatusBoxWrapper  = new RichTextBoxWrapper(ConcentratorStatusBox);
            m_concentratorMessageBoxWrapper = new RichTextBoxWrapper(ConcentratorMessageBox);

            m_concentrator = new Concentrator(mapper);
            m_concentrator.ProcessException += Concentrator_ProcessException;
            m_concentrator.FramesPerSecond   = 30;
            m_concentrator.LagTime           = 3;
            m_concentrator.LeadTime          = 1;
            m_concentrator.Start();

            m_subscriber = new Subscriber(m_concentrator);
            m_subscriber.StatusMessage    += Subscriber_StatusMessage;
            m_subscriber.ProcessException += Subscriber_ProcessException;
            m_subscriber.Start();

            new Action(UpdateStatus).DelayAndExecute(1000);
        }
Exemplo n.º 2
0
        public Subscriber(Concentrator concentrator)
        {
            m_concentrator = concentrator;

            m_dataSubscriber = new DataSubscriber();
            m_dataSubscriber.ConnectionEstablished += DataSubscriber_ConnectionEstablished;
            m_dataSubscriber.MetaDataReceived      += DataSubscriber_MetaDataReceived;
            m_dataSubscriber.NewMeasurements       += DataSubscriber_NewMeasurements;
            m_dataSubscriber.StatusMessage         += DataSubscriber_StatusMessage;
            m_dataSubscriber.ProcessException      += DataSubscriber_ProcessException;
        }