예제 #1
0
        //Запускает один полный расчет без чтения списка параметров
        private void Cycle()
        {
            double sc = IsReadSources ? Sources.Count * 30 + Imitators.Count * 15 : 0,
                   pc = Projects.Count * 20,
                   ac = IsWriteArchives ? Projects.Count * 15 : 0,
                   rc = IsWriteReceivers ? Receivers.Count * 10 : 0,
                   vc = VedSaver != null ? 20 : 0;

            if (sc + pc + ac + rc > 1)
            {
                double n = 100.0 / (sc + pc + ac + rc + vc + 15), i = 0;
                if (IsReadSources)
                {
                    IsSourcesRead = Start(ReadSources, i, i += sc * n);
                }
                Start(Calculate, i, i += pc * n);
                if (IsWriteReceivers)
                {
                    Start(WriteReceivers, i, i += rc * n);
                }
                if (IsWriteArchives)
                {
                    Start(WriteArchives, i, i += ac * n);
                }
                if (IsWriteVed)
                {
                    StartAtom(Atom.WriteVed, new VedSaver(ProjectsList.First(), VedFile, VedTask).SaveVed, i, i + vc * n);
                }
                LastPeriodBegin = PeriodBegin;
                LastPeriodEnd   = PeriodEnd;
            }
        }