Beispiel #1
0
        private void UpdateInfo(int Event, string flag, object result, string message, object sender)
        {
            switch (Event)
            {
            case TestController.TEST_CONTROLLER_MESSAGE_EVENT:
            {
                TestOperate step = (TestOperate)Enum.Parse(typeof(TestOperate), flag);
                this.ProcessTestMessage((TestType)result, step, message);
                break;
            }

            case ProjectService.PROJECT_LABEL_PRINT_FINISH_EVENT:
            {
                if (Program.TestManager.projectService.responseMessage.ErrorCode == (int)PrinterErrorCode.Ok)
                {
                    this.labelLabelResult.ForeColor = Color.Black;
                }
                else
                {
                    this.labelLabelResult.ForeColor = Color.Red;
                }
                this.labelLabelResult.Text = Program.TestManager.projectService.responseMessage.Message;

                break;
            }

            case ProjectService.PROJECT_LABEL_GENERATE_EVENT:
            {
                this.richTextBoxLabelData.Clear();
                if (Program.TestManager.projectService.result)
                {
                    this.richTextBoxLabelData.ForeColor = Color.Black;
                    this.labelLabelResult.ForeColor     = Color.Black;
                }
                else
                {
                    this.richTextBoxLabelData.ForeColor = Color.Red;
                    this.labelLabelResult.ForeColor     = Color.Red;
                }
                this.labelLabelResult.Text = Program.TestManager.projectService.message;

                if ((message != null) && (message.Length > 0))
                {
                    message = Utils.Unicode2String(message);
                    this.richTextBoxLabelData.AppendText(message);
                }
                break;
            }
            }
        }
Beispiel #2
0
        private void ProcessTestMessage(TestType testType, TestOperate operate, string message)
        {
            switch (operate)
            {
            case TestOperate.Stop:
            {
                switch (testType)
                {
                case TestType.Auto:
                {
                    this.buttonAutoTest.Text      = "开始自动测试";
                    this.buttonManualTest.Enabled = true;
                    break;
                }

                case TestType.Manual:
                {
                    this.buttonManualTest.Text  = "开始手动测试";
                    this.buttonAutoTest.Enabled = true;
                    break;
                }
                }
                Program.TestManager.AddDeviceTestResultRecord();
                break;
            }

            case TestOperate.Start:
            {
                switch (testType)
                {
                case TestType.Auto:
                {
                    this.buttonAutoTest.Text      = "停止自动测试";
                    this.buttonManualTest.Enabled = false;
                    break;
                }

                case TestType.Manual:
                {
                    this.buttonManualTest.Text  = "停止手动测试";
                    this.buttonAutoTest.Enabled = false;
                    break;
                }
                }
                break;
            }
            }
        }
Beispiel #3
0
        private void ProcessTestMessage(TestType testType, TestOperate operate, string message)
        {
            switch (operate)
            {
            case TestOperate.Start:
            {
                if (this.checkBoxStartToClear.Checked)
                {
                    this.richTextBoxMessage.Clear();
                }
                break;
            }
            }

            if (message.Length > 0)
            {
                this.labelTestMessage.Text = message;
                this.richTextBoxMessage.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + message + "\n");
            }
        }
Beispiel #4
0
        private void UpdateInfo(int Event, string flag, object result, string message, object sender)
        {
            switch (Event)
            {
            case DeviceController.REFRESH_DEVICE_LIST_EVENT:
            {
                DeviceOperateEvent operate = (DeviceOperateEvent)Enum.Parse(typeof(DeviceOperateEvent), flag);
                switch (operate)
                {
                case DeviceOperateEvent.ListAll:
                case DeviceOperateEvent.ListAdd:
                case DeviceOperateEvent.ListDelete:
                {
                    this.RefreshDeviceList();
                    break;
                }
                }
                break;
            }

            case DeviceController.REFRESH_DEVICE_EVENT:
            {
                DeviceOperateEvent operate = (DeviceOperateEvent)Enum.Parse(typeof(DeviceOperateEvent), flag);
                switch (operate)
                {
                case DeviceOperateEvent.ListAdd:
                {
                    this.AddListviewItem((DeviceItem)result);
                    break;
                }

                case DeviceOperateEvent.ListUpdate:
                {
                    this.UpdateListviewItem((DeviceItem)result);
                    this.RefreshlistViewRealDevicesSelectedItem();
                    break;
                }

                case DeviceOperateEvent.ListDelete:
                {
                    this.RefreshDeviceList();
                    break;
                }
                }
                break;
            }

            case DeviceController.REFRESH_GATEWAY_EVENT:
            {
                this.RefreshGatewayData();
                break;
            }

            case (int)HttpRequestType.RefreshDeviceNodes:
            {
                this.RefreshDeviceNodesCombox();
                break;
            }

            case TestController.TEST_CONTROLLER_MESSAGE_EVENT:
            {
                TestOperate step = (TestOperate)Enum.Parse(typeof(TestOperate), flag);
                this.ProcessTestMessage((TestType)result, step, message);
                break;
            }
            }
        }