/// <summary> /// Adds argument labels to list /// </summary> /// <param name="list">The list to add</param> public void AddArgumentLabels(List <string> list) { foreach (object[] o in measurementControls) { ComboBox cb = o[0] as ComboBox; object ob = cb.SelectedItem; if (ob == null) { continue; } string sn = cb.SelectedItem.ToString(); if (sn.Length == 0) { continue; } IMeasurement m = o[1] as IMeasurement; string sm = m.Name; list.Add(sn + " = " + consumer.GetMeasurementsName(measurements) + "." + sm); } }
internal void Set(IDataConsumer consumer, IMeasurements measurements, Dictionary <string, Tuple <Color[], bool, double[]> > dictionary) { this.consumer = consumer; this.measurements = measurements; this.dictionary = dictionary; name = consumer.GetMeasurementsName(measurements); for (int i = 0; i < measurements.Count; i++) { Add(); } }
/// <summary> /// Modelled after CreateList meotod. Both methods have to be roofed by a single method, with and object of Object class rather than IEnumerable or IITerator /// </summary> /// <param name="consumer"></param> /// <param name="list"></param> /// <param name="components"></param> /// <param name="dictionary"></param> /// <returns></returns> public static IIterator CreateIterator(this IDataConsumer consumer, IEnumerable <object> list, IComponentCollection components, out Dictionary <IReplacedMeasurementParameter, string> dictionary) { Dictionary <IReplacedMeasurementParameter, string> dict = new Dictionary <IReplacedMeasurementParameter, string>(); List <object> ll = new List <object>(); components.ForEach((IMeasurements m) => { string name = consumer.GetMeasurementsName(m) + "."; for (int i = 0; i < m.Count; i++) { IMeasurement me = m[i]; if (me is IReplacedMeasurementParameter) { dict[me as IReplacedMeasurementParameter] = name + me.Name; } } }); Dictionary <string, INativeReader> dnr = new Dictionary <string, INativeReader>(); components.ForEach((INativeReader reader) => { if (reader is IAssociatedObject) { string name = (consumer as IAssociatedObject).GetRelativeName( reader as IAssociatedObject); dnr[name] = reader; } }); Dictionary <string, INativeEvent> dna = new Dictionary <string, INativeEvent>(); IAssociatedObject ao = consumer as IAssociatedObject; components.ForEach((INativeEvent ne) => { dna[ao.GetRelativeName(ne as IAssociatedObject)] = ne; }); dictionary = dict; return(null); }
void Set(IDataConsumer consumer, IMeasurements measurements) { this.consumer = consumer; this.measurements = measurements; name = consumer.GetMeasurementsName(measurements); }