Exemple #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);
        }
Exemple #2
0
        private void DataSubscriber_MetaDataReceived(object sender, EventArgs <DataSet> args)
        {
            UnsynchronizedSubscriptionInfo subscriptionInfo = new UnsynchronizedSubscriptionInfo(false);
            SignalLookup lookup = m_concentrator.Mapper.Lookup;

            m_concentrator.Mapper.CrunchMetadata(args.Argument);

            subscriptionInfo.FilterExpression = string.Join(";", SystemSettings.FilterExpressions
                                                            .SelectMany(expression => lookup.GetMeasurementKeys(expression))
                                                            .Select(key => key.SignalID)
                                                            .Distinct());

            m_dataSubscriber.Subscribe(subscriptionInfo);
        }