Ejemplo n.º 1
0
        private void Trends_Load(object sender, EventArgs e)
        {
            zgMain.IsEnableHZoom = false;
            zgMain.IsEnableVZoom = false;
            zgMain.GraphPane.XAxis.MajorGrid.IsVisible = false;
            zgMain.GraphPane.YAxis.MajorGrid.IsVisible = false;
            zgMain.GraphPane.XAxis.Scale.Min = 0;
            zgMain.GraphPane.YAxis.Scale.Max = 100;
            zgMain.GraphPane.XAxis.Scale.Min = 0;
            zgMain.GraphPane.XAxis.Scale.Max = 1800;
            zgMain.GraphPane.Legend.IsVisible = false;
            zgMain.GraphPane.Title.FontSpec.Size = 12;
            zgMain.GraphPane.XAxis.Title.Text = "";
            zgMain.GraphPane.YAxis.Title.Text = "";
            zgMain.GraphPane.XAxis.Scale.FontSpec.Size = 10;
            zgMain.GraphPane.YAxis.Scale.FontSpec.Size = 10;
            zgMain.GraphPane.XAxis.Scale.MajorStep = 300;
            zgMain.GraphPane.XAxis.Scale.MinorStep = 60;
            zgMain.GraphPane.XAxis.ScaleFormatEvent += new Axis.ScaleFormatHandler(XAxis_ScaleFormatEvent);
            List<PointPairList> pointPairLists = new List<PointPairList>();
            for (int i = 0; i < 6; i++ )
                pointPairLists.Add(new PointPairList());

            MainGateClient mainGate = new MainGateClient(new InstanceContext(new TrendsListener(zgMain, pointPairLists)));
            mainGate.Subscribe();
        }
Ejemplo n.º 2
0
        private void ReceivingThread()
        {
            m_MainGateClient = m_ConnectionName == null
                                   ? new MainGateClient(new InstanceContext(new PrimaryListener(m_EventListener)))
                                   : new MainGateClient(new InstanceContext(new PrimaryListener(m_EventListener)),
                                                        m_ConnectionName);
            m_MainGateClient.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted);
            m_MainGateClient.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Faulted);
            if (m_IsSubscribed &&
                (m_MainGateClient.State == CommunicationState.Opened ||
                 m_MainGateClient.State == CommunicationState.Created))
                m_MainGateClient.Subscribe();

            m_Initialized = true;
            do {
                Thread.Sleep(100);
            } while (true);
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     MainGateClient mainGate = new MainGateClient(new InstanceContext(new EventsListener(this)));
     mainGate.Subscribe();
 }
Ejemplo n.º 4
0
 private void InnerDuplexChannel_Faulted(object obj1, object obj2)
 {
     //Console.WriteLine("Connection faulted");
     //Thread.Sleep(500);
     m_MainGateClient = m_ConnectionName == null
                            ? new MainGateClient(new InstanceContext(new PrimaryListener(m_EventListener)))
                            : new MainGateClient(new InstanceContext(new PrimaryListener(m_EventListener)),
                                                 m_ConnectionName);
     m_MainGateClient.InnerDuplexChannel.Faulted += new EventHandler(InnerDuplexChannel_Faulted);
     m_MainGateClient.InnerDuplexChannel.Closed += new EventHandler(InnerDuplexChannel_Faulted);
     if (m_IsSubscribed &&
         (m_MainGateClient.State == CommunicationState.Opened ||
          m_MainGateClient.State == CommunicationState.Created))
         m_MainGateClient.Subscribe();
 }