Example #1
0
        public void OnTrainingProjectFileReady()
        {
            ProjectDoc.Instance.LoadProjectsDescriptions();
            if (!String.IsNullOrEmpty(m_WaitForReadyProjectName))
            {
                Program.CurUser.ProjectName = m_WaitForReadyProjectName;
                if (!String.IsNullOrEmpty(Program.CurUser.ProjectName))
                {
                    m_WaitForReadyProjectName = null;
                }
            }
            var desc  = ProjectDoc.Instance.GetProjectDescription(Program.CurUser.ProjectName);
            var files = desc.MissingResourceFiles;

            Program.Service.MainChannel.ReportMissingResourceFiles(files);
            this.InvokeEx(() =>
            {
                if (files.Length > 0)
                {
                    CurStatus = TaskGroupMissionStatus.请求同步资源文件;
                    //RecreateProject(null);
                }
                else
                {
                    CurStatus = TaskGroupMissionStatus.等待训练开始;
                    RecreateProject(desc.FileName);
                }
            });
        }
Example #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            MessageController      = new MessageControl();
            MessageController.Dock = DockStyle.Fill;
            dcpMessages.Controls.Add(MessageController);
            MessageController.SendMessage += new MessageControl.Delegate_SendMessage(MessageController_SendMessage);

            CurStatus = TaskGroupMissionStatus.等待指定训练项目;

            dockMgr.ClosedPanel += new DevExpress.XtraBars.Docking.DockPanelEventHandler(dockMgr_ClosedPanel);
            try
            {
                if (System.IO.File.Exists(Program.Option.LayoutConfigFile))
                {
                    using (var ms = new System.IO.MemoryStream())
                    {
                        dockMgr.SaveLayoutToStream(ms);
                        DefaultDockManagerLayoutData = ms.ToArray();
                    }
                    dockMgr.RestoreLayoutFromXml(Program.Option.LayoutConfigFile);
                }
            }
            catch
            {
            }
            dockMgr.ActivePanel = dcpStudentGroups;

            RefreshTrainningUI();
            RefreshJudgementUI();
        }
Example #3
0
        public void RefreshTrainningUI()
        {
            if (!String.IsNullOrEmpty(Program.CurUser.ProjectName))
            {
                rbpCurProject.Text = Program.CurUser.ProjectName;
            }
            else
            {
                rbpCurProject.Text = "<训练项目>";
            }
            rbpCurProject.Tag = Program.CurUser.ProjectName;
            if (Program.CurUser.ProjectInstance == null)
            {
                if (!Program.CurUser.AdjudicatorMode || Program.CurUser.TargetMonitorUserOrGroupID != 0)
                {
                    CurStatus = TaskGroupMissionStatus.等待指定训练项目;
                }
                else
                {
                    CurStatus = TaskGroupMissionStatus.等待指定监控用户;
                }
            }
            ibnCurGroup.Enabled       = Program.CurUser.AdjudicatorMode;
            ibnCurGroup.ActAsDropDown = Program.CurUser.AdjudicatorMode;
            ibnCurGroup.ButtonStyle   = Program.CurUser.AdjudicatorMode ? BarButtonStyle.DropDown : BarButtonStyle.Default;
            if (Program.CurUser.AdjudicatorMode)
            {
                ribbonPageGroup_CurGroup.Text = "监控目标";
                if (Program.CurUser.IsMoniteringCooperationGroup)
                {
                    var grp = Program.GetTaskGroup((int)Program.CurUser.TargetMonitorUserOrGroupID * -1);
                    if (grp == null)
                    {
                        ibnCurGroup.Caption = "<未知分组>";
                    }
                    else
                    {
                        ibnCurGroup.Caption = grp.Name;
                    }
                }
                else
                {
                    var user = Program.GetLoginUserInfo(Program.CurUser.TargetMonitorUserOrGroupID);
                    if (user == null)
                    {
                        ibnCurGroup.Caption = "<未知用户>";
                    }
                    else
                    {
                        ibnCurGroup.Caption = user.Name;
                    }
                }
                trvResources.Enabled = false;
                rbpEdit.Visible      = false;
            }
            else
            {
                ribbonPageGroup_CurGroup.Text = "所在分组";
                if (Program.CurUser.ParentGroup == null)
                {
                    ibnCurGroup.Caption = "<未指定>";
                }
                else
                {
                    ibnCurGroup.Caption = Program.CurUser.ParentGroup.Name;
                }
                trvResources.Enabled = true;
                rbpEdit.Visible      = true;
            }

            bool bFreeTask = (Program.CurUser.FreeTaskPerm & FreeTaskPermission.自由选择任务) == FreeTaskPermission.自由选择任务;

            if (!String.IsNullOrEmpty(Program.CurUser.TaskName))
            {
                ibnCurTask.Caption = Program.CurUser.TaskName;
            }
            else
            {
                ibnCurTask.Caption = "<当前任务>";
            }
            ibnCurTask.Tag           = Program.CurUser.TaskName;
            ibnCurTask.ActAsDropDown = bFreeTask;
            ibnCurTask.ButtonStyle   = bFreeTask ? BarButtonStyle.DropDown : BarButtonStyle.Default;
            ibnCurTask.Enabled       = bFreeTask;

            bool bFreeScene = (Program.CurUser.FreeTaskPerm & FreeTaskPermission.自由选择场景) == FreeTaskPermission.自由选择场景;

            if (!String.IsNullOrEmpty(Program.CurUser.SceneName))
            {
                ibnCurScene.Caption = Program.CurUser.SceneName;
            }
            else
            {
                ibnCurScene.Caption = "<当前场景>";
            }
            ibnCurScene.Tag           = Program.CurUser.SceneName;
            ibnCurScene.ActAsDropDown = bFreeScene;
            ibnCurScene.ButtonStyle   = bFreeScene ? BarButtonStyle.DropDown : BarButtonStyle.Default;
            ibnCurScene.Enabled       = bFreeScene;

            bool bFreeView = (Program.CurUser.FreeTaskPerm & FreeTaskPermission.自由选择窗口) == FreeTaskPermission.自由选择窗口;

            foreach (var v in m_ViewportItems)
            {
                v.Checked = (int)v.Tag == Program.CurUser.ViewportIndex;
                v.Enabled = bFreeView;
            }
            RefreshStartMissionButton();
        }