예제 #1
0
        public MainForm()
        {
            InitializeComponent();
            var address = new Uri(ScadaConstants.TrendingUri);
            var binding = new NetTcpBinding {
                Security = { Mode = SecurityMode.None }
            };
            var factory = new DuplexChannelFactory <ITrending>(this, binding, new EndpointAddress(address));

            _proxy = factory.CreateChannel();

            _proxy.SubscribeToTags();
        }
예제 #2
0
        public GraphForm(Tag tag)
        {
            InitializeComponent();
            var address = new Uri(ScadaConstants.TrendingUri);
            var binding = new NetTcpBinding {
                Security = { Mode = SecurityMode.None }
            };
            var factory = new DuplexChannelFactory <ITrending>(this, binding, new EndpointAddress(address));

            _proxy = factory.CreateChannel();

            _proxy.SubscribeToTags();

            _tag = tag;
            chart.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
            chart.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;
            chart.Series[Series].ChartType = SeriesChartType.FastLine;
            chart.Series[Series].Points.AddXY(_xCoord++, tag.GetValue());
        }