示例#1
0
        internal void SaveSettings()
        {
            realtime.Item1[0] = double.Parse(textBoxChartInterval.Text);
            List <Tuple <Tuple <string, IMeasurement, object[]>, Tuple <Color[], bool, double[]> > > output =
                userControlRealtimeMeasurements.Output;
            List <Tuple <string, object[]> > measurementsList = new List <Tuple <string, object[]> >();
            Dictionary <string, Tuple <Func <object, double>, Tuple <Tuple <string, IMeasurement, object[]>,
                                                                     Tuple <Color[], bool, double[]> > > > dd =
                new Dictionary <string, Tuple <Func <object, double>,
                                               Tuple <Tuple <string, IMeasurement, object[]>, Tuple <Color[], bool, double[]> > > >();
            List <IMeasurement> lm = new List <IMeasurement>();

            foreach (Tuple <Tuple <string, IMeasurement, object[]>, Tuple <Color[], bool, double[]> > t in output)
            {
                string       na  = t.Item1.Item1;
                IMeasurement mea = t.Item1.Item2;
                lm.Add(mea);
                measurementsList.Add(new Tuple <string, object[]>(t.Item1.Item1, t.Item1.Item3));
                calc[mea] = t.Item1.Item3;
                Func <object, double> f = mea.GetDoubleFunction();
                if (f == null)
                {
                    add[t.Item1.Item1] = mea;
                    continue;
                }
                dd[t.Item1.Item1] = new Tuple <Func <object, double>,
                                               Tuple <Tuple <string, IMeasurement, object[]>,
                                                      Tuple <Color[], bool, double[]> > >(f, t);
                dArray[na] = t.Item1.Item3;
                Color cw = t.Item2.Item1[0];
                System.Windows.Media.Color cp = System.Windows.Media.Color.FromRgb(cw.R, cw.G, cw.B);
                Tuple <System.Windows.Media.Color, bool, double[], Func <object, double> > tp =
                    new Tuple <System.Windows.Media.Color, bool, double[], Func <object, double> >(
                        cp, t.Item2.Item2, t.Item2.Item3, f);
                performer[na] = tp;
            }
            performer.Reset();
            realtime.Item1[0] = double.Parse(textBoxChartInterval.Text);
            userControlRealtimeList.Set(measurementsList);
            Labels.GraphLabel lab = this.FindParent <Labels.GraphLabel>();
            lab.data.Item6[0] = realtime;
        }
示例#2
0
        void IRealTimeStartStop.Start()
        {
            if (calculationReason.IsRealtimeAnalysis())
            {
                return;
            }
            disassemblyDictionary.Clear();
            Dictionary <IMeasurement, BaseTypes.Interfaces.IDisassemblyObject> disassemblyDict =
                dataConsumer.CreateDisassemblyObjectDictionary();

            foreach (IMeasurement key in disassemblyDict.Keys)
            {
                disassemblyDictionary[key] = new
                                             Portable.MeasurementsDisasseblyWrapper(disassemblyDict[key], key);
            }
            add.Clear();
            calc.Clear();
            dObject.Clear();
            dArray.Clear();
            performer.Clear();
            performer.Reset();
            realtime.Item1[0]  = double.Parse(textBoxChartInterval.Text);
            performer.Interval = realtime.Item1[0];
            List <Tuple <Tuple <string, IMeasurement, object[]>, Tuple <Color[], bool, double[]> > > output =
                userControlRealtimeMeasurements.Output;
            List <Tuple <string, object[]> > measurementsList = new List <Tuple <string, object[]> >();
            Dictionary <string, Tuple <Func <object, double>, Tuple <Tuple <string, IMeasurement, object[]>,
                                                                     Tuple <Color[], bool, double[]> > > > dd =
                new Dictionary <string, Tuple <Func <object, double>,
                                               Tuple <Tuple <string, IMeasurement, object[]>, Tuple <Color[], bool, double[]> > > >();
            List <IMeasurement> lm = new List <IMeasurement>();

            foreach (Tuple <Tuple <string, IMeasurement, object[]>, Tuple <Color[], bool, double[]> > t in output)
            {
                string       na  = t.Item1.Item1;
                IMeasurement mea = t.Item1.Item2;
                lm.Add(mea);
                measurementsList.Add(new Tuple <string, object[]>(t.Item1.Item1, t.Item1.Item3));
                calc[mea] = t.Item1.Item3;
                Func <object, double> f = mea.GetDoubleFunction();
                if (f == null)
                {
                    add[t.Item1.Item1] = mea;
                    continue;
                }
                dd[t.Item1.Item1] = new Tuple <Func <object, double>,
                                               Tuple <Tuple <string, IMeasurement, object[]>,
                                                      Tuple <Color[], bool, double[]> > >(f, t);
                dArray[na] = t.Item1.Item3;
                Color cw = t.Item2.Item1[0];
                System.Windows.Media.Color cp = System.Windows.Media.Color.FromRgb(cw.R, cw.G, cw.B);
                Tuple <System.Windows.Media.Color, bool, double[], Func <object, double> > tp =
                    new Tuple <System.Windows.Media.Color, bool, double[], Func <object, double> >(
                        cp, t.Item2.Item2, t.Item2.Item3, f);
                performer[na] = tp;
            }
            performer.Reset();
            realtime.Item1[0] = double.Parse(textBoxChartInterval.Text);
            userControlRealtimeList.Set(measurementsList);
            Labels.GraphLabel lab = this.FindParent <Labels.GraphLabel>();
            lab.data.Item6[0] = realtime;
            UserControlGraph uc = this.FindParent <UserControlGraph>();
        }