Exemple #1
0
        // add to the probe's infoList the information about the current settings family (the info was loaded in the validProbes structure)
        private static void updateProbes(List <ProbeBind> oldProbes, List <ProbeBind> validProbes, SettingFamily setting)
        {
            foreach (ProbeBind probeBind in oldProbes)
            {
                ProbeBind newProbeBind = validProbes.SingleOrDefault(v => v.probe.SaleName.ToLowerInvariant() == probeBind.probe.SaleName.ToLowerInvariant());
                probeBind.probeInfoLst.Add(new probeInfo(setting, newProbeBind));

                UpdateProbeFields(probeBind.probe, newProbeBind.probe);
            }
        }
        // reads probe preset name and location for the current application
        private static List <ProbePreset> createProbeApps(ProbeBind probeBind, probeInfo currentProbeInfo, DBBuffer _buffer)
        {
            List <ProbePreset> resultProbeApp = new List <ProbePreset>();

            foreach (var app in currentProbeInfo.appNodes)
            {
                Application application  = _buffer.p_applications.SingleOrDefault(a => a.ProbeDescrName == app.Element("eApplication").Value.ToString());
                ProbePreset baseProbeApp = new ProbePreset()
                {
                    ProbeId          = probeBind.probe.Id,
                    ApplicationId    = application.Id,
                    SettingsFamilyId = currentProbeInfo.settingsFam.Id
                };

                resultProbeApp.AddRange(createPresetProbeApps(baseProbeApp, app));
            }
            return(resultProbeApp);
        }