private void AddParam(int index, Service.DataParamOutput addedParam) { addedParam.Address = index * 2; for (int i = index; i < ListDataParams.Count; i++) { ListDataParams[i].Address += 2; } ListDataParams.Insert(index, addedParam); }
private void AddParam(int index) { ListDataParams.Insert(index, new Service.DataParam() { ID = new Random().Next(0, int.MaxValue), SlaveID = 1, ListParamsTypes = SparkWindow.settingUnits.ParamsTypes, ListParamsUnits = SparkWindow.settingUnits.ParamsTypes[0].ListUnits, Command = Service.ModbusCommandInput.ReadHolding, Type = Service.ModbusType.WORD, ParamType = SparkWindow.settingUnits.ParamsTypes[0], ParamUnit = SparkWindow.settingUnits.ParamsTypes[0].ListUnits[0] }); ListDataParams[index].OnChangeTitle += Dp_OnChangeTitle; }