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(); }
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()); }