//Methods /// <summary> /// Checks consistency /// </summary> protected override void Check() { if (TestDataRatio <= 0 || TestDataRatio > MaxTestDataRatio) { throw new ArgumentException($"Invalid TestDataRatio {TestDataRatio.ToString(CultureInfo.InvariantCulture)}. TestDataRatio must be GT 0 and GE {MaxTestDataRatio.ToString(CultureInfo.InvariantCulture)}.", "TestDataRatio"); } if (Folds < 0) { throw new ArgumentException($"Invalid Folds {Folds.ToString(CultureInfo.InvariantCulture)}. Folds must be GE to 0 (0 means Auto folds).", "Folds"); } if (Repetitions < 1) { throw new ArgumentException($"Invalid Repetitions {Repetitions.ToString(CultureInfo.InvariantCulture)}. Repetitions must be GE to 1.", "Repetitions"); } foreach (ReadoutUnitSettings rus in ReadoutUnitsCfg.ReadoutUnitCfgCollection) { if (rus.TaskCfg.NetworkCfgCollection.Count == 0) { if (DefaultNetworksCfg.GetTaskNetworksCfgs(rus.TaskCfg.Type).Count == 0) { throw new ArgumentException($"Readout unit {rus.Name} has not associated network(s) settings.", "ReadoutUnitsCfg"); } } } return; }
/// <summary> /// Return network configurations associated with readout unit or default network configurations if no specific network configurations. /// </summary> /// <param name="readoutUnitIndex">Index of the readout unit</param> /// <returns></returns> public List <INonRecurrentNetworkSettings> GetReadoutUnitNetworksCollection(int readoutUnitIndex) { if (ReadoutUnitsCfg.ReadoutUnitCfgCollection[readoutUnitIndex].TaskCfg.NetworkCfgCollection.Count > 0) { return(ReadoutUnitsCfg.ReadoutUnitCfgCollection[readoutUnitIndex].TaskCfg.NetworkCfgCollection); } else { return(DefaultNetworksCfg.GetTaskNetworksCfgs(ReadoutUnitsCfg.ReadoutUnitCfgCollection[readoutUnitIndex].TaskCfg.Type)); } }