private void InitializePointCollection() { Points = new ObservableCollection <BasePointItem>(); foreach (var c in ConfigReader.Instance.GetConfigurationItems()) { for (int i = 0; i < c.NumberOfRegisters; i++) { BasePointItem pi = CreatePoint(c, i, this.commandExecutor); if (pi != null) { Points.Add(pi); } } } }
private void InitializePointCollection() { List <DERMSCommon.SCADACommon.DataPoint> datapoints = new List <DERMSCommon.SCADACommon.DataPoint>(); Points = new ObservableCollection <BasePointItem>(); foreach (var c in configuration.GetConfigurationItems()) { BasePointItem pi = CreatePoint(c, c.NumberOfRegisters, this.commandExecutor); if (pi != null) { Points.Add(pi); DERMSCommon.SCADACommon.PointType dad = (DERMSCommon.SCADACommon.PointType)pi.Type; DERMSCommon.SCADACommon.DataPoint dataPoint = new DERMSCommon.SCADACommon.DataPoint((long)pi.Gid, (DERMSCommon.SCADACommon.PointType)pi.Type, pi.Address, pi.Timestamp, pi.Name, pi.DisplayValue, pi.RawValue, (DERMSCommon.SCADACommon.AlarmType)pi.Alarm, c.GidGeneratora); datapoints.Add(dataPoint); } } string client = string.Empty; client = GetLocalIPAddress(); client += ":19999"; NetTcpBinding binding = new NetTcpBinding(); binding.Security = new NetTcpSecurity() { Mode = SecurityMode.None }; factoryUI = new ChannelFactory <ISendDataToCEThroughScada>(binding, new EndpointAddress("net.tcp://*****:*****@Timestamp, @Gid, @Production)"; ////InsertInCollectTable(collectItems, queryStmt1, connectionString); ////dayItems = ReadFromCollectTable(connectionString1); //string queryStmt2 = "INSERT INTO dbo.Day(Gid, Pmin, Pmax, Pavg, E, Timestamp) VALUES(@Gid, @Pmin, @Pmax, @Pavg, @E, @Timestamp)"; ////InsertInDayTable(dayItems, queryStmt2, connectionString); ProxyUI.ReceiveFromScada(datapoints); }
private void InitializePointCollection() { Points = new ObservableCollection <BasePointItem>(); foreach (var c in configuration.GetConfigurationItems()) { for (int i = 0; i < c.NumberOfRegisters; i++) { BasePointItem pi = CreatePoint(c, i, this.processingManager); if (pi != null) { Points.Add(pi); pointsCache.Add(pi.PointId, pi as IPoint); processingManager.InitializePoint(pi.Type, pi.Address, pi.RawValue); } } } }