Beispiel #1
0
        /// <summary>
        /// Converts the array of strings represented ScanWindows to its instance.
        /// </summary>
        /// <param name="inputs">Array of strings represented ScanWindows to convert.</param>
        /// <returns></returns>
        static ScanWindows Parse(ArrayList inputs)
        {
            int i = 0;

            string[] images;
            byte[]   name;

            // read the name of first pattern and inizialise session by given word length
            string tmp = inputs[0] as string;

            Words.Init((byte)tmp.Substring(tmp.LastIndexOf(Abbr.TAB) + 1).Length, 0, false);

            ScanWindows sWins = new ScanWindows(inputs.Count, BY_DEF);   // Default sort mode was set by writing to a file

            // initialises sWins member
            foreach (string str in inputs)
            {
                // each string contains 6 number separated by TAB
                images     = str.Split(Abbr.TAB);
                name       = Sequence.Parse(images[4]);
                sWins[i++] = new ScanWindow(
                    int.Parse(images[0]),
                    int.Parse(images[1]),
                    //new Pattern(Words.GetNumber(name) * Words.WordLength, 1),
                    Words.GetNumber(name),
                    float.Parse(images[2]),
                    float.Parse(images[3]));
            }

            return(sWins);
        }
Beispiel #2
0
 /// <summary>Initialises a new instance of the Processing class.</summary>
 /// <param name="worker">The BackgroundWorker in wich Processing is run.</param>
 /// <param name="prgBar">The progress bar indicated executing.</param>
 /// <param name="wordLength">The length of word.</param>
 /// <param name="mismatchCnt">The amount of mismatches.</param>
 /// <param name="isAllPossible">True if all possible words are processed.</param>
 /// <param name="isTurbo">True if Turbo mode is defined.</param>
 /// <param name="isDrawPlot">True if a plot should be drawing; otherwise, false.</param>
 public Processing(BackgroundWorker worker, ProgressBar prgBar, byte wordLength, byte mismatchCnt, bool isAllPossible, bool isTurbo, bool isDrawPlot)
 {
     _worker     = worker;
     _prgBar     = prgBar;
     _isDrawPlot = isDrawPlot;
     Words.Init(wordLength, mismatchCnt, isTurbo);
     Patterns.Init(isAllPossible);
 }