Exemplo n.º 1
1
        public TableViewForm(TreeNode analysisViewNode)
        {
            InitializeComponent();

            mAnalysisViewNode = analysisViewNode;
            mTask = ((TaskModel)analysisViewNode.Parent.Parent.Tag).mTask;
        }
Exemplo n.º 2
0
        public EMIFileUploadForm(BindingTask task)
        {
            InitializeComponent();
            DataCenter.Instance().LoadData();
            mTask = task;

            HTTPAgent.instance().onUpdateTaskSuccessfully += new HTTPAgent.updateTaskSuccessfully(EMIFileUploadForm_onUpdateTaskSuccessfully);
            HTTPAgent.instance().onUpdateTaskFailed += new HTTPAgent.updateTaskFailed(EMIFileUploadForm_onUpdateTaskFailed);
        }
Exemplo n.º 3
0
        public ReportViewForm(TreeNode analysisViewNode)
        {
            InitializeComponent();

            mAnalysisViewNode = analysisViewNode;
            SingleAnalysisTabPage.Text = "360\x00B0Analysis";

            mTask = ((TaskModel)analysisViewNode.Parent.Parent.Tag).mTask;
            mChannelSettings = DataCenter.Instance().ChannelSettings[mTask.ChannelSettingID];

            mIsViewReport = false;
        }
Exemplo n.º 4
0
        public ReportViewForm(Report report)
        {
            InitializeComponent();
            SingleAnalysisTabPage.Text = "360\x00B0Analysis";
            mIsViewReport = true;
            mViewReport = report;

            mTask = DataCenter.Instance().Tasks[report.TaskID];
            mChannelSettings = DataCenter.Instance().ChannelSettings[report.ChannelSettingID];
            mEmiFileData = DataCenter.Instance().EMIs[mViewReport.EmiFileID];

            mLimitSetting = mViewReport.LimitSetting;
        }
Exemplo n.º 5
0
 public TaskModel(BindingTask task)
 {
     mTask = task;
 }
Exemplo n.º 6
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            if (!ValidateTask())
                return;

            BindingTask task = new BindingTask();
            task.Name = TaskNameEditor.Text;
            task.Description = TaskDescriptionEditor.Text;
            task.RegionID = mRegion.ID;
            task.Creator = HTTPAgent.Username;
            task.CreateTime = Utility.GetTimeStr();

            foreach (string userId in TaskAnalyzerList.Items)
                task.Analyzer.Add(userId);
            foreach (Site site in TaskSiteList.Items)
                task.Site.Add(site.SiteID);
            task.ChannelSettingID = mChannelSettingID;
            task.LinkConfigurationID = mLinkConfigurationID;
            task.EquipmentParameterID = mEquipmentParameterID;

            HTTPAgent.instance().addTask(this, DataCenter.Instance().GlobalRegion.Version, task);
        }
Exemplo n.º 7
0
 void NewTaskForm_onAddTaskSuccessfully(int RegionVersion, BindingTask task)
 {
     mTask = task;
     Close();
 }
Exemplo n.º 8
0
 void NewTaskForm_onAddTaskFailed(BindingTask task, System.Net.HttpStatusCode statusCode)
 {
     MessageBox.Show("Create task failed, status=" + statusCode.ToString() + " !");
     mTask = null;
     Close();
 }
Exemplo n.º 9
0
        private void ReportViewForm_Load(object sender, EventArgs e)
        {
            if (!mIsViewReport)
            {
                ChannelPowerCheckBox.Checked = Program.Config.ReadInt("General", "UseChannelPowerLimit", 0) == 1;
                ChannelPowerLimitEditor.Text = Program.Config.ReadString("General", "ChannelPowerLimit", "-85").Trim();
                DeltaPowerCheckBox.Checked = Program.Config.ReadInt("General", "UseDeltaPowerLimit", 0) == 1;
                DeltaPowerLimitEditor.Text = Program.Config.ReadString("General", "DeltaPowerLimit", "-3").Trim();

                List<EMIFileData> emiFileDatas = Utility.GetTaskAvailableEmiFiles(mTask);
                foreach (EMIFileData emiFileData in emiFileDatas)
                    EMIFileComboBox.Items.Add(emiFileData);

                ChannelSettingTextBox.Text = DataCenter.Instance().ChannelSettingDescriptions[mTask.ChannelSettingID].ToString();
            }
            else
            {
                ChannelPowerCheckBox.Checked = mViewReport.LimitSetting.UseChannelPowerLimit;
                ChannelPowerLimitEditor.Text = mViewReport.LimitSetting.ChannelPowerLimit.ToString();
                DeltaPowerCheckBox.Checked = mViewReport.LimitSetting.UseDeltaPowerLimit;
                DeltaPowerLimitEditor.Text = mViewReport.LimitSetting.DeltaPowerLimit.ToString();

                EMIFileComboBox.Items.Add(mEmiFileData);
                EMIFileComboBox.SelectedIndex = 0;
                EMIFileComboBox.Enabled = false;
                LoadButton.Visible = false;

                ChannelSettingTextBox.Text = DataCenter.Instance().ChannelSettingDescriptions[mViewReport.ChannelSettingID].ToString();
                mTask = DataCenter.Instance().Tasks[mViewReport.TaskID];

                AnalysisButton.Enabled = true;

                DisplayChannelCheckBox.Checked = mViewReport.IsDisplayChannel;
                StartFreqEditor.Text = WatsEmiReportTool.Utility.ConvertDoubleString(mViewReport.StartFreq);
                EndFreqEditor.Text = WatsEmiReportTool.Utility.ConvertDoubleString(mViewReport.EndFreq);
                SpanEditor.Text = mViewReport.Span.ToString();

                CommitButton.Visible = false;

                AnalysisButton_Click(null, null);
            }
        }
Exemplo n.º 10
0
        public void AddAssignedTaskNode(BindingTask task)
        {
            //Task Node
            TreeNode taskNode = mAssignedTasksNode.Nodes.Add(task.Name);
            taskNode.SelectedImageIndex = taskNode.ImageIndex = ICON_TASK;
            TaskModel taskModel = new TaskModel(task);
            taskNode.Tag = taskModel;

            //All EMI Files Node
            TreeNode emiFilesNode = taskNode.Nodes.Add("All EMI Files");
            emiFilesNode.SelectedImageIndex = emiFilesNode.ImageIndex = ICON_ALLEMIFILE;

            //Assigned Sites Node
            TreeNode assignedSiteNode = emiFilesNode.Nodes.Add("Assigned Sites");
            assignedSiteNode.SelectedImageIndex = assignedSiteNode.ImageIndex = ICON_SITES;

            //Assigned Site Node
            TreeNode siteNode;
            Site site;
            EMIFileData emiFileData;
            if (task.Site != null)
            {
                foreach (string siteID in task.Site)
                {
                    if (DataCenter.Instance().Sites.ContainsKey(siteID))
                        site = DataCenter.Instance().Sites[siteID];
                    else
                        site = new Site(siteID);
                    siteNode = assignedSiteNode.Nodes.Add(site.ToString());
                    siteNode.SelectedImageIndex = siteNode.ImageIndex = ICON_SITE;
                    siteNode.Tag = new SiteModel(site);

                    foreach (KeyValuePair<long, FileDescription> pair in DataCenter.Instance().EMIDescriptions)
                    {
                        //EMI Node
                        if (siteID.Equals(pair.Value.SiteID))
                        {
                            TreeNode emiNode = siteNode.Nodes.Add(pair.Value.Title);
                            emiNode.SelectedImageIndex = emiNode.ImageIndex = ICON_EMI;
                            emiFileData = DataCenter.Instance().EMIs[pair.Value.ID];
                            emiNode.Tag = new EMIFileModel(emiFileData);
                        }
                    }
                }
            }

            //Unassigned Sites Node
            TreeNode unAssignedSiteNode = emiFilesNode.Nodes.Add("Unassigned Sites");
            unAssignedSiteNode.SelectedImageIndex = unAssignedSiteNode.ImageIndex = ICON_UNASSIGNEDSITES;

            //UnAssigned Site Node
            if (task.UnassignedSite != null)
            {
                foreach (string siteID in task.UnassignedSite)
                {
                    if (DataCenter.Instance().Sites.ContainsKey(siteID))
                        site = DataCenter.Instance().Sites[siteID];
                    else
                        site = new Site(siteID);
                    siteNode = unAssignedSiteNode.Nodes.Add(site.ToString());
                    siteNode.SelectedImageIndex = siteNode.ImageIndex = ICON_UNASSIGNEDSITE;
                    siteNode.Tag = new SiteModel(site);

                    foreach (KeyValuePair<long, FileDescription> pair in DataCenter.Instance().EMIDescriptions)
                    {
                        //EMI Node
                        if (siteID.Equals(pair.Value.SiteID))
                        {
                            TreeNode emiNode = siteNode.Nodes.Add(pair.Value.Title);
                            emiNode.SelectedImageIndex = emiNode.ImageIndex = ICON_UNASSIGNEDEMI;
                            emiFileData = DataCenter.Instance().EMIs[pair.Value.ID];
                            emiNode.Tag = new EMIFileModel(emiFileData);
                        }
                    }
                }
            }

            //All Task Analysis Node
            List<AnalysisModel> analysisModelList = new List<AnalysisModel>();
            taskModel.AnalysisModelList = analysisModelList;
            TreeNode allTaskAnalysisNode = taskNode.Nodes.Add("Task Analysis");
            allTaskAnalysisNode.ImageIndex = allTaskAnalysisNode.SelectedImageIndex = ICON_ANALYSISES;
            allTaskAnalysisNode.Tag = analysisModelList;
        }
Exemplo n.º 11
0
        public void addTask(Form attachedForm, int curVersion, BindingTask task)
        {
            new Thread(delegate()
            {
                byte[] respData;
                string json = "";
                WebHeaderCollection headers;
                string url = getUrl(Action.createtask) + "/" + curVersion;
                HttpStatusCode statusCode = HTTPRequest.MakeRequest(url, "POST",
                    Constants.JSON_MIME, Constants.JSON_MIME,
                    Encoding.UTF8.GetBytes(Utility.JsonSerialize<BindingTask>(task)), out respData, out headers);
                if (statusCode == HttpStatusCode.Accepted)
                {
                    if (onAddTaskSuccessfully != null)
                    {
                        json = Encoding.UTF8.GetString(respData);
                        AddTaskResult result = Utility.JsonDeserialize<AddTaskResult>(json);
                        task.ID = result.TaskID;
                        attachedForm.BeginInvoke(onAddTaskSuccessfully, result.RegionVersion, task);
                    }
                }
                else
                {
                    if (onAddTaskFailed != null)
                        attachedForm.BeginInvoke(onAddTaskFailed, task, statusCode);
                }

            }).Start();
        }