예제 #1
0
        public void StartProductionExecute()
        {
            SaveSettingsExecute();
            var settings = SettingsHelper.GetSettings();

            LeonCommunication.NewLeonRegistrations += LeonCommunication_NewLeonRegistrations;

            Leon = new LeonViewModel();
            Leon.LoadFromDb();
            LeonCommunication.StartLeonExecute();
            OrionTeamsSetupViewModel = new OrionTeamsSetupViewModel(Leon, MainOrionViewModel);
            this.OrionTeamsSetupViewModel.GenerateOrionTeamsExecute();

            OrionCommunicationViewModel = new OrionCommunicationViewModel(OrionTeamsSetupViewModel, MainOrionViewModel);
            this.OrionCommunicationViewModel.StartOrionCommunication();

            this.OrionResultViewModel = new OrionResultViewModel(settings.OrionSetting);
            this.OrionResultViewModel.LoadFromDb();
            this.OrionTeamsSetupViewModel.MoveRegistrations += OrionTeamsSetupViewModel_MoveRegistrations;
            this.OrionResultViewModel.NewOrionResults       += OrionResultViewModel_NewOrionResults;
            m_orionResultUpdater = new OrionResultUpdater(settings.OrionSetting);
            m_orionResultUpdater.SetResultTypeOnOrionResult(OrionResultViewModel.OrionResults);
            this.OrionResultViewModel.StartOrionCommunication();

            var minneRange = settings.OrionSetting.OrionViewModels.SelectMany(o => o.RangeViews).SingleOrDefault(r => r.MinneShooting == true);

            if (minneRange != null)
            {
                if (string.IsNullOrEmpty(minneRange.CommunicationSetup.SelectedPath))
                {
                    minneRange.CommunicationSetup.SelectedPath = LeonCommunication.CommunicationSetup.SelectedPath;
                    //LeonCommunication.SetMinnePath(minneRange.CommunicationSetup.SelectedPath);
                }
                this.m_minneViewModel = new MinneViewModel(minneRange.CommunicationSetup);
                this.m_minneViewModel.LoadFromDB();
                this.m_minneViewModel.StartReadNewRegistrations();
            }

            ProductionMode = true;
            MainOrionViewModel.SendPropChanged();
        }
예제 #2
0
        ////public class NewRegistrationEventArgs : EventArgs
        ////{
        ////    public List<LeonPerson> NewRegistrations { get; set; }
        ////}

        ////public delegate void NewLeonRegistrationsEventHandler(object sender, NewRegistrationEventArgs e);

        ////public event NewLeonRegistrationsEventHandler NewLeonRegistrations;

        public OrionTeamsSetupViewModel(LeonViewModel leonViewModel, OrionSetupViewModel orionSetupViewModel)
        {
            m_leonViewModel       = leonViewModel;
            m_orionSetupViewModel = orionSetupViewModel;
        }