Ejemplo n.º 1
0
        public List <int> GetSelection()
        {
            List <int> rez = new List <int>();

            try
            {
                float lyfrom  = (float)LyFromFld.Value;
                float lyto    = (float)LyToFld.Value;
                int   ionfrom = (int)IonFromFld.Value;
                int   ionto   = (int)IonToFld.Value;
                int   intfrom = (int)IntFromFld.Value;
                int   intto   = (int)IntToFld.Value;
                for (int i = 0; i < Common.LDb.Data.Count; i++)
                {
                    LineDbRecord r = Common.LDb.Data[i];
                    //r.TypeOfIntens = IntensTypeCbx.SelectedIndex;
                    if (ESelector.IsSelected(r.Element) == false)
                    {
                        continue;
                    }
                    if (r.Ly < lyfrom || r.Ly > lyto)
                    {
                        continue;
                    }
                    if (IonUnknownIncl.Checked == false && r.IonLevel > 200)
                    {
                        continue;
                    }
                    if (r.IonLevel < ionfrom || r.IonLevel > ionto)
                    {
                        continue;
                    }

                    int intens;
                    switch (IntensTypeCbx.SelectedIndex)
                    {
                    case 0: intens = r.NistIntens;      break;

                    case 1: intens = r.ZIntensIskra;    break;

                    case 2: intens = r.ZIntensDuga;     break;

                    default: intens = 0; break;
                    }
                    if (IntUnknownIncl.Checked && intens < 0)
                    {
                    }
                    else
                    {
                        if (intens < intfrom || intens > intto)
                        {
                            continue;
                        }
                    }
                    rez.Add(i);
                }
            }
            catch (Exception ex)
            {
                Common.Log(ex);
            }
            return(rez);
        }
Ejemplo n.º 2
0
        private void PreviewData_Paint(object sender, PaintEventArgs e)
        {
            try
            {
                e.Graphics.FillRectangle(Brushes.White, 0, 0, PreviewData.Width, PreviewData.Height);
                int from = PreviewFromScrollBar.Value;
                int step = 10;
                int y    = 2;
                for (int i = from; i < CurrentResults.Count && y < PreviewData.Height; i++)
                {
                    LineDbRecord r   = Common.LDb.Data[CurrentResults[i]];
                    string       str = ElementTable.Elements[r.Element].Name + " ";
                    while (str.Length < 3)
                    {
                        str += " ";
                    }
                    if (r.IonLevel > 0)
                    {
                        switch (r.IonLevel)
                        {
                        case 1: str += "I"; break;

                        case 2: str += "II"; break;

                        case 3: str += "III"; break;

                        case 4: str += "IV"; break;

                        case 5: str += "V"; break;

                        case 6: str += "VI"; break;

                        case 7: str += "VII"; break;

                        default: str += r.IonLevel; break;
                        }
                    }
                    while (str.Length < 7)
                    {
                        str += " ";
                    }
                    str += Math.Round(r.Ly, 2) + "A ";
                    while (str.Length < 16)
                    {
                        str += " ";
                    }
                    int intens = -1;
                    switch (IntensTypeCbx.SelectedIndex)
                    {
                    case 0: intens = r.NistIntens;    break;

                    case 1: intens = r.ZIntensIskra; break;

                    case 2: intens = r.ZIntensDuga; break;
                    }
                    if (intens < 0)
                    {
                        str += "-";
                    }
                    else
                    {
                        str += intens;
                    }
                    e.Graphics.DrawString(str, Df, Brushes.Black, 2, y);
                    y += step;
                }
            }
            catch (Exception ex)
            {
                Common.LogNoMsg(ex);
            }
        }
Ejemplo n.º 3
0
 public float GetQIntens(LineDbRecord r)
 {
     return(r.GetQIntens(IntensTypeCbx.SelectedIndex));
 }
Ejemplo n.º 4
0
 public void Add(LineDbRecord rec)
 {
     Data.Add(rec);
 }