/// <summary> /// Rozpoczęcie sczytywania stanów zbiorników przez COM /// </summary> public void Init() { _measurementBL = new MeasurementBL(); _measurementBL.Init(); _containerBL = new ContainerBL(); _containerBL.Init(); SystemConfigBL configBL = new SystemConfigBL(); configBL.Init(); configBL.FillRecord(); _rs232 = new RS232(); _rs232.ReadTimeOut = 1000; _rs232.DataReceivedEvent += new RS232.DataReceived(_rs232_DataReceivedEvent); _rs232.CanReadExisting = true; _rs232.Open(configBL.MainRow.ComName, 1200); }
public void AddMeasurements() { MeasurementBL measurementBL = new MeasurementBL(); measurementBL.Init(); ContainerBL containerBL = new ContainerBL(); containerBL.Init(); containerBL.FillList(); //dodanie aktualnego measurementBL.AddNewMeasurement(MainRow.ContainerId, MainRow.CurrentHeight, MainRow.CurrentCapacity); //przepisanie reszty foreach (ContainerDataSet.ContainerRow containerRow in containerBL.ContainerDataSet.Container.Select()) { if (containerRow.ContainerId != MainRow.ContainerId) measurementBL.AddNewMeasurement(containerRow.ContainerId, containerRow.CurrentHeight, containerRow.CurrentCapacity); } measurementBL.Save(); }