void UpdateValidity() { if (linkedDesignFile == null) { throw new NullReferenceException("no linked file"); } List <OrderRow> currentList = new List <OrderRow>(); ExperimentDesign experimentDesign = ExperimentDesign.CreateFrom(linkedDesignFile); List <IndependentVariable> blockVariables = linkedDesignFile.GetVariables.BlockVariables; for (int rowIndex = 0; rowIndex < experimentDesign.BaseBlockTable.Rows.Count; rowIndex++) { DataRow row = experimentDesign.BaseBlockTable.Rows[rowIndex]; StringBuilder sb = new StringBuilder(); foreach (DataColumn column in experimentDesign.BaseBlockTable.Columns) { if (!ColumnIsBlockVariable(column, blockVariables)) { Debug.Log($"skipping column {column.ColumnName}"); continue; } sb.Append(column.ColumnName + "= " + row[column.ColumnName]); } currentList.Add(new OrderRow(rowIndex, sb.ToString())); } bool valid = currentList.SequenceEqual(List); isValid = valid; }
public void Init(ExperimentDesignFile2 designFile) { if (designFile == null) { throw new NullReferenceException("Design file null on init"); } linkedDesignFile = designFile; initialized = true; ExperimentDesign experimentDesign = ExperimentDesign.CreateFrom(designFile); List <IndependentVariable> blockVariables = designFile.GetVariables.BlockVariables; for (int rowIndex = 0; rowIndex < experimentDesign.BaseBlockTable.Rows.Count; rowIndex++) { DataRow row = experimentDesign.BaseBlockTable.Rows[rowIndex]; StringBuilder sb = new StringBuilder(); foreach (DataColumn column in experimentDesign.BaseBlockTable.Columns) { if (!ColumnIsBlockVariable(column, blockVariables)) { Debug.Log($"skipping column {column.ColumnName}"); continue; } sb.Append(column.ColumnName + "= " + row[column.ColumnName]); } List.Add(new OrderRow(rowIndex, sb.ToString())); } }
public DesignPreviewer(IExperimentDesignFile designFile) { DesignFile = designFile; ExperimentDesign = ExperimentDesign.CreateFrom(designFile); BlockOrderData = new BlockOrderData(ExperimentDesign); }