Example #1
0
 private void Init(Multiplicity src = null)
 {
     if (src != null)
     {
         FA = src.FA;
         backgroundGateTimeStepInTics = src.backgroundGateTimeStepInTics;
         accidentalsGateDelayInTics   = src.accidentalsGateDelayInTics;
         SR     = new ShiftRegisterParameters(src.SR);
         reason = string.Copy(src.reason);
     }
     else
     {
         //10240 NOT a reasonable default value for FA analysis per Martyn. HN 6.24.2015
         if (FA == FAType.FAOn)
         {
             backgroundGateTimeStepInTics = 2;
             accidentalsGateDelayInTics   = 2;
         }
         else
         {
             backgroundGateTimeStepInTics = 10240;
             accidentalsGateDelayInTics   = 10240; // 10240 matches some traditional HW, larger values produce more accurate results, but slow down the processing
         }
         SR = new ShiftRegisterParameters();
     }
 }
Example #2
0
 private void Init(Multiplicity src = null)
 {
     if (src != null)
     {
         FA = src.FA;
         backgroundGateTimeStepInTics = src.backgroundGateTimeStepInTics;
         accidentalsGateDelayInTics   = src.accidentalsGateDelayInTics;
         SR     = new ShiftRegisterParameters(src.SR);
         reason = string.Copy(src.reason);
         Rank   = src.Rank;
     }
     else
     {
         //10240 NOT a reasonable default value for FA analysis per Martyn. HN 6.24.2015
         if (FA == FAType.FAOn)
         {
             backgroundGateTimeStepInTics = 10;
             accidentalsGateDelayInTics   = 10; // 1Mhz
         }
         else
         {
             backgroundGateTimeStepInTics = 40960; //Not used for slow? HN
             accidentalsGateDelayInTics   = 40960; // Per Daniela
         }
         SR = new ShiftRegisterParameters();
     }
 }
Example #3
0
        public bool HasMultiplicity(FAType ft, bool activeOnly = true)
        {
            SpecificCountingAnalyzerParams sap = Find(p => { return(p.ActiveConstraint(activeOnly) &&
                                                                    (p is Multiplicity) && ((p as Multiplicity).FA == ft)); });

            return(sap != null);
        }
Example #4
0
 public MultiplicityResult GetIthMultiplicityResult(FAType fa, int i)
 {
     if (fa == FAType.FAOn)
     {
         if (results != null && results.numFastBackgroundMultiplicityAnalyzers > 0)
         {
             return(results.multiplicityFastBackgroundResults[i]);
         }
         else
         {
             return(null);
         }
     }
     else if (fa == FAType.FAOff)
     {
         if (results != null && results.numSlowBackgroundMultiplicityAnalyzers > 0)
         {
             return(results.multiplicitySlowBackgroundResults[i]);
         }
         else
         {
             return(null);
         }
     }
     return(null);
 }
Example #5
0
        /// <summary>
        /// transform run_rec_ext results into a MultiplicityCountingRes, also see INCKnew.RunToCycle
        /// later step will place results on current cycle in appropriate results map using the Det.MultiplicityParams key
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="cycle"></param>
        public void TransformResults(DataSourceIdentifier Id, Cycle cycle)
        {
            FAType fa = Id.SRType.DefaultFAFor();

            tds.mcr = new MultiplicityCountingRes(fa, 0);
            RunValuesToResults(tds.run, cycle, Det.MultiplicityParams, tds.mcr);
        }
Example #6
0
 public void CopyValues(Multiplicity mul)
 {
     if (mul == null)
     {
         return;
     }
     FA = mul.FA;
     backgroundGateTimeStepInTics = mul.backgroundGateTimeStepInTics;
     accidentalsGateDelayInTics   = mul.accidentalsGateDelayInTics;
     SR     = new ShiftRegisterParameters(mul.SR);
     reason = string.Copy(mul.reason);
 }
Example #7
0
        /// <summary>
        /// Get a list of submission IDs from a search query.
        /// </summary>
        public async Task <IEnumerable <int> > SearchSubmissionIdsAsync(
            string q,
            int page         = 1,
            FAOrder order_by = FAOrder.date,
            FAOrderDirection order_direction = FAOrderDirection.desc,
            FARange range     = FARange.all,
            FASearchMode mode = FASearchMode.extended,
            FARating rating   = FARating.general | FARating.mature | FARating.adult,
            FAType type       = FAType.art | FAType.flash | FAType.music | FAType.photo | FAType.poetry | FAType.story
            )
        {
            var url  = $"https://faexport.boothale.net/search.json?q={WebUtility.UrlEncode(q)}&page={page}&perpage=60&order_by={order_by}&order_direction={order_direction}&range={range}&mode={mode}&rating={rating.ToString().Replace(" ", "")}&type={type.ToString().Replace(" ", "")}";
            var json = await FAExportRequestAsync(url);

            return(JsonConvert.DeserializeObject <IEnumerable <int> >(json, _jsonSettings));
        }
Example #8
0
        public Multiplicity GetFirstMult(FAType ft, out bool addedIfNotPresent)
        {
            addedIfNotPresent = false;
            List <SpecificCountingAnalyzerParams> l = GetMults(ft, activeOnly: false);

            if (l != null && l.Count > 0)
            {
                return((Multiplicity)l[0]);
            }
            else
            {
                Multiplicity t = new Multiplicity(ft);
                addedIfNotPresent = true;
                Add(t);
                return(t);
            }
        }
Example #9
0
        public bool AddMultiplicity(Multiplicity m, FAType fa)
        {
            bool good;

            if (FAType.FAOn == fa)
            {
                good = handler.InstantiateMultiplicityAnalyzerFastBackground(m.SR.gateLength, m.SR.predelay, m.BackgroundGateTimeStepInTics, m.SR.deadTimeCoefficientTinNanoSecs, m.SR.deadTimeCoefficientAinMicroSecs, m.SR.deadTimeCoefficientBinPicoSecs, m.SR.deadTimeCoefficientCinNanoSecs);
            }
            else
            {
                good = handler.InstantiateMultiplicityAnalyzerSlowBackground(m.SR.gateLength, m.SR.predelay, m.AccidentalsGateDelayInTics, m.SR.deadTimeCoefficientTinNanoSecs, m.SR.deadTimeCoefficientAinMicroSecs, m.SR.deadTimeCoefficientBinPicoSecs, m.SR.deadTimeCoefficientCinNanoSecs);
            }
            if (!good)
            {
                logger.TraceEvent(LogLevels.Warning, 1501, "Multiplicity analyzer creation failed, que no? {0}", m.SR.ToString());  // todo: implement a nice ToString for ShiftRegisterParameters
            }
            return(good);
        }
Example #10
0
        public FALabel(FAType type = FAType.Solid) : this()
        {
            switch (type)
            {
            case FAType.Brands:
                FontFamily = Constants.FontAwesomeBrands;
                break;

            case FAType.Duotone:
                FontFamily = Constants.FontAwesomeDuotone;
                break;

            case FAType.Regular:
                FontFamily = Constants.FontAwesomeRegular;
                break;

            case FAType.Solid:
                FontFamily = Constants.FontAwesomeSolid;
                break;
            }
        }
Example #11
0
 void TTypeMap(string cs, out Type t, out FAType FA)
 {
     FA = FAType.FAOff;
     if (string.Compare(cs, barfoo[0]) == 0)
     {
         FA = FAType.FAOn;
         t = typeof(Multiplicity);
     }
     else if (string.Compare(cs, barfoo[1]) == 0)
         t = typeof(Multiplicity);
     else if (string.Compare(cs, barfoo[2]) == 0)
         t = typeof(Feynman);
     else if (string.Compare(cs, barfoo[3]) == 0)
         t = typeof(Rossi);
     else if (string.Compare(cs, barfoo[4]) == 0)
         t = typeof(TimeInterval);
     else if (string.Compare(cs, barfoo[5]) == 0)
         t = typeof(Coincidence);
     else
         t = typeof(Multiplicity);
 }
Example #12
0
        private void SetLMVSRFATypeAndVis()
        {
            LMFA.Visible = det.ListMode;

            if (!det.ListMode)
                return;

            AcquireParameters acq = Integ.GetCurrentAcquireParamsFor(det);
            m_curGateTriggerType = m_gateTriggerType = acq.lm.FADefault;
            LMFA.Checked = (m_gateTriggerType == FAType.FAOn);
        }
Example #13
0
 string HeaderX(Type t, FAType FA)
 {
     if (t.Equals(typeof(Multiplicity)) && FA == FAType.FAOn)
     {
         return "Bkg clock width";
     }
     else if ((t.Equals(typeof(Multiplicity)) && FA == FAType.FAOff) ||
               t.Equals(typeof(Coincidence)))
     {
         return "Long delay";
     }
     return "";
 }
Example #14
0
        void ConstructNewRow(DataGridViewRow row, Type t, FAType FA)
        {
            SpecificCountingAnalyzerParams s = null;
            if (t.Equals(typeof(Multiplicity)))
            {
                Multiplicity m = new Multiplicity(FA);
                row.Cells[3].Value = det.SRParams.predelay.ToString();
                row.Cells[3].Tag = det.SRParams.predelay;
                if (FA == FAType.FAOn)
                {
                    row.Cells[4].Value = m.BackgroundGateTimeStepInTics.ToString();
                    row.Cells[4].Tag = m.BackgroundGateTimeStepInTics;
                }
                else
                {
                    row.Cells[4].Value = m.AccidentalsGateDelayInTics.ToString();
                    row.Cells[4].Tag = m.AccidentalsGateDelayInTics;
                }
                m.gateWidthTics = det.SRParams.gateLength;
                s = m;
            }
            else if (t.Equals(typeof(Feynman)))
            {
                s = new Feynman();
            }
            else if (t.Equals(typeof(Rossi)))
            {
                s = new Rossi();
            }
            else if (t.Equals(typeof(TimeInterval)))
            {
                s = new TimeInterval();
            }
            else if (t.Equals(typeof(Coincidence)))
            {
                Coincidence c = new Coincidence();
                row.Cells[3].Value = det.SRParams.predelay.ToString();
                row.Cells[3].Tag = det.SRParams.predelay;
                row.Cells[4].Value = c.AccidentalsGateDelayInTics.ToString();
                row.Cells[4].Tag = c.AccidentalsGateDelayInTics;
                c.gateWidthTics = det.SRParams.gateLength;
                s = c;
            }

            row.Cells[0].Tag = s.Active;
            row.Cells[2].Tag = s.gateWidthTics;
            row.Cells[2].Value = s.gateWidthTics.ToString();
            row.Tag = s;
            SetRODetails(row, t);
        }
Example #15
0
 void ReconstructRow(DataGridViewRow row, Type t, FAType FA)
 {
     SpecificCountingAnalyzerParams s = (SpecificCountingAnalyzerParams)row.Tag;
     if (t.Equals(typeof(Multiplicity)) && typeof(Multiplicity) == s.GetType())  // keep the predelay and gw
     {
         Multiplicity m = (Multiplicity)s;
         if (FA != m.FA)  // set alt gate to default if FA changed
         {
             Multiplicity x = new Multiplicity(FA);
             if (FA == FAType.FAOn)
             {
                 row.Cells[4].Value = x.BackgroundGateTimeStepInTics.ToString();
                 row.Cells[4].Tag = x.BackgroundGateTimeStepInTics;
             }
             else
             {
                 row.Cells[4].Value = x.AccidentalsGateDelayInTics.ToString();
                 row.Cells[4].Tag = x.AccidentalsGateDelayInTics;
             }
         }
         else
         {
             if (FA == FAType.FAOn)
             {
                 row.Cells[4].Value = m.BackgroundGateTimeStepInTics.ToString();
                 row.Cells[4].Tag = m.BackgroundGateTimeStepInTics;
             }
             else
             {
                 row.Cells[4].Value = m.AccidentalsGateDelayInTics.ToString();
                 row.Cells[4].Tag = m.AccidentalsGateDelayInTics;
             }
         }
     }
     else if (t.Equals(s.GetType()))
     {
         ReconstructRow(row, s, t, FA);
     }
     row.Cells[2].Tag = s.gateWidthTics;
     row.Cells[2].Value = s.gateWidthTics.ToString();
     row.Tag = s;
     SetRODetails(row, t);
 }
Example #16
0
 // several get list<type>'s, because there may be several of each
 public List <SpecificCountingAnalyzerParams> GetMults(FAType ft, bool activeOnly = true)
 {
     return(FindAll(p => { return (p.ActiveConstraint(activeOnly) && p is Multiplicity && ((p as Multiplicity).FA == ft)); }));
 }
Example #17
0
 Multiplicity GetAMergedMult(FAType FA)
 {
     bool addedIfNotPresent = false;
     Multiplicity m0 = alt.GetFirstMult(FA, out addedIfNotPresent);
     if (addedIfNotPresent)
     {
         m0.SR.CopyValues(det.SRParams);  // merge default values wth this analyzer
         m0.SetGateWidthTics(det.SRParams.gateLength);
     }
     return m0;
 }
Example #18
0
        void ReconstructRow(DataGridViewRow row, SpecificCountingAnalyzerParams s, Type t, FAType FA)
        {
            if (t.Equals(typeof(Multiplicity)))
            {
                Multiplicity m = (Multiplicity)s;
                row.Cells[3].Value = m.SR.predelay.ToString();
                row.Cells[3].Tag = m.SR.predelay;
                if (FA == FAType.FAOn)
                {
                    row.Cells[4].Value = m.BackgroundGateTimeStepInTics.ToString();
                    row.Cells[4].Tag = m.BackgroundGateTimeStepInTics;
                }
                else
                {
                    row.Cells[4].Value = m.AccidentalsGateDelayInTics.ToString();
                    row.Cells[4].Tag = m.AccidentalsGateDelayInTics;
                }
            }
            else if (t.Equals(typeof(Feynman)))
            {
            }
            else if (t.Equals(typeof(Rossi)))
            {
            }
            else if (t.Equals(typeof(TimeInterval)))
            {
            }
            else if (t.Equals(typeof(Coincidence)))
            {
                Coincidence c = (Coincidence)s;
                row.Cells[3].Value = c.SR.predelay.ToString();
                row.Cells[3].Tag = c.SR.predelay;
                row.Cells[4].Value = c.AccidentalsGateDelayInTics.ToString();
                row.Cells[4].Tag = c.AccidentalsGateDelayInTics;
            }

            row.Cells[0].Tag = s.Active;
            row.Cells[2].Tag = s.gateWidthTics;
            row.Cells[2].Value = s.gateWidthTics.ToString();
            SetRODetails(row, t);
        }
Example #19
0
 public Multiplicity(FAType c) : base()
 {
     FA = c;
     Init();
 }
Example #20
0
 public SimpleRawReport(NCCReporter.LMLoggers.LognLM ctrllog)
     : base(ctrllog)
 {
     selectedReportSections = Array.CreateInstance(typeof(bool), System.Enum.GetValues(typeof(ReportSections)).Length);
     foreach (ValueType v in System.Enum.GetValues(typeof(ReportSections)))
     {
         selectedReportSections.SetValue(true, (int)v);
     }
     FASelector = FAType.FAOn;
 }
Example #21
0
 public bool AddMultiplicity(Multiplicity m, FAType fa)
 {
     bool good;
     if (FAType.FAOn == fa)
         good = handler.InstantiateMultiplicityAnalyzerFastBackground(m.SR.gateLength, m.SR.predelay, m.BackgroundGateTimeStepInTics, m.SR.deadTimeCoefficientTinNanoSecs, m.SR.deadTimeCoefficientAinMicroSecs, m.SR.deadTimeCoefficientBinPicoSecs, m.SR.deadTimeCoefficientCinNanoSecs);
     else
         good = handler.InstantiateMultiplicityAnalyzerSlowBackground(m.SR.gateLength, m.SR.predelay, m.AccidentalsGateDelayInTics, m.SR.deadTimeCoefficientTinNanoSecs, m.SR.deadTimeCoefficientAinMicroSecs, m.SR.deadTimeCoefficientBinPicoSecs, m.SR.deadTimeCoefficientCinNanoSecs);
     if (!good)
         logger.TraceEvent(LogLevels.Warning, 1501, "Multiplicity analyzer creation failed, que no? {0}", m.SR.ToString());  // todo: implement a nice ToString for ShiftRegisterParameters
     return good;
 }
Example #22
0
 string TNameMap(Type t, FAType FA = FAType.FAOff)
 {
     if (barfoo == null)
          barfoo = new string[] {"Fast Multiplicity", "Multiplicity", "Feynman", "Rossi-α (alpha)", "Event Spacing", "Coincidence" };
     if (t.Equals(typeof(Multiplicity)) && FA == FAType.FAOn)
         return barfoo[0];
     if (t.Equals(typeof(Multiplicity)) && FA == FAType.FAOff)
         return barfoo[1];
     if (t.Equals(typeof(Feynman)))
         return barfoo[2];
     if (t.Equals(typeof(Rossi)))
         return barfoo[3];
     if (t.Equals(typeof(TimeInterval)))
         return barfoo[4];
     if (t.Equals(typeof(Coincidence)))
         return barfoo[5];
     return "";
 }
Example #23
0
 public MultiplicityResult GetIthMultiplicityResult(FAType fa, int i)
 {
     if (fa == FAType.FAOn)
     {
         if (results.numFastBackgroundMultiplicityAnalyzers > 0)
             return results.multiplicityFastBackgroundResults[i];
         else
             return null;
     }
     else if (fa == FAType.FAOff)
     {
         if (results.numSlowBackgroundMultiplicityAnalyzers > 0)
             return results.multiplicitySlowBackgroundResults[i];
         else
             return null;
     }
     return null;
 }