/// <summary> /// Defines or undefines a intermediate cell. /// </summary> /// <param name="inputs">List of cells</param> /// <param name="define">Optíon to set wheter the cells will add, or remove from the intermediate cell list</param> public void DefineIntermediateCell(List <Cell> intermediates, CellDefinitionOption define) { if (define == CellDefinitionOption.Define) { foreach (var c in intermediates) { // create sif cell name if (c.SifLocation == null) { c.SifLocation = CellManager.Instance.CreateSIFCellName(this, CellManager.Instance.GetA1Adress(this, c.Location)); } //remove from the other lists this.InputCells.Remove(c); this.OutputCells.Remove(c); //add to intermediate list if (!this.intermediateCells.Contains(c)) { this.intermediateCells.Add(c.ToIntermediateCell()); } } } else if (define == CellDefinitionOption.Undefine) { //remove from intermediate list foreach (var c in intermediates) { this.intermediateCells.Remove(c); } } OnCellDefinitionChanged(new EventArgs()); }
/// <summary> /// Defines or undefines a output cell. /// </summary> /// <param name="inputs">List of cells</param> /// <param name="define">Optíon to set wheter the cells will add, or remove from the output cell list</param> public void DefineOutputCell(List<Cell> outputs, CellDefinitionOption define) { if (define == CellDefinitionOption.Define) { foreach (var c in outputs) { // create sif cell name if (c.SifLocation == null) { c.SifLocation = CellManager.Instance.CreateSIFCellName(this, CellManager.Instance.GetA1Adress(this, c.Location)); } //remove from the other lists this.InputCells.Remove(c); this.IntermediateCells.Remove(c); //add to intermediate list if (!this.outputCells.Contains(c)) { this.outputCells.Add(c.ToOutputCell()); } } } else if (define == CellDefinitionOption.Undefine) { //remove from intermediate list foreach (var c in outputs) { this.outputCells.Remove(c); } } OnCellDefinitionChanged(new EventArgs()); }
/// <summary> /// Defines or undefines a sanity value cell. /// </summary> /// <param name="inputs">List of cells</param> /// <param name="define">Optíon to set wheter the cells will add, or remove from the intermediate cell list</param> public void DefineSanityValueCell(List<Cell> sanityValues, CellDefinitionOption define) { if (define == CellDefinitionOption.Define) { foreach (var c in sanityValues) { // create sif cell name if (c.SifLocation == null) { c.SifLocation = CellManager.Instance.CreateSIFCellName(this, CellManager.Instance.GetA1Adress(this, c.Location)); } //remove from the other lists InputCells.Remove(c); OutputCells.Remove(c); IntermediateCells.Remove(c); _sanityCheckingCells.Remove(c); _sanityExplanationCells.Remove(c); _sanityConstraintCells.Remove(c); //add to sanityValue list if (!_sanityValueCells.Contains(c)) { _sanityValueCells.Add(c.ToSanityValueCell()); } } } else if (define == CellDefinitionOption.Undefine) { //remove from intermediate list foreach (var c in sanityValues) { _sanityValueCells.Remove(c); } } OnCellDefinitionChanged(new EventArgs()); }
/// <summary> /// Defines or undefines a input cell. /// </summary> /// <param name="inputs">List of cells</param> /// <param name="define">Optíon to set wheter the cells will add, or remove from the input cell list</param> public void DefineInputCell(List<Cell> inputs, CellDefinitionOption define) { switch (define) { case CellDefinitionOption.Define: foreach (var c in inputs) { // create sif cell name if (c.SifLocation == null) { c.SifLocation = CellManager.Instance.CreateSIFCellName(this, CellManager.Instance.GetA1Adress(this, c.Location)); } //remove from the other lists IntermediateCells.Remove(c); OutputCells.Remove(c); //add to input list if (!_inputCells.Contains(c)) { InputCells.Add(c.ToInputCell()); } } break; case CellDefinitionOption.Undefine: //remove from input list foreach (var c in inputs) { try { InputCells.Remove(c); } catch (Exception e) { Console.Out.WriteLine(e); } } break; } OnCellDefinitionChanged(new EventArgs()); }