Exemplo n.º 1
0
        private void send_Click(object sender, EventArgs e)
        {
            mrDevice.MMR_CurentSelectIndex = parseInt(this.comboBox1.Text);
            mrDevice.MMR_CurSpeed          = Int32.Parse(this.textBox1.Text);
            mrDevice.MMR_CurTemp           = Int32.Parse(this.textBox3.Text);
            mrDevice.MMR_CurTime           = Int32.Parse(this.textBox5.Text);
            mrDevice.MMR_CurAir            = Int32.Parse(this.textBox2.Text);
            mrDevice.MMR_CurPressure       = Int32.Parse(this.textBox4.Text);
            switch (curSelectModule)
            {
            case 1:
                mrDevice.MMR_ModuleSpeed1      = mrDevice.MMR_CurSpeed;
                mrDevice.MMR_ModuleTemp1       = mrDevice.MMR_CurTemp;
                mrDevice.MMR_ModuleSampleTime1 = mrDevice.MMR_CurTime;
                mrDevice.MMR_ModuleAir1        = mrDevice.MMR_CurAir;
                mrDevice.MMR_ModulemPa1        = mrDevice.MMR_CurPressure;
                break;

            case 2:
                mrDevice.MMR_ModuleSpeed2      = mrDevice.MMR_CurSpeed;
                mrDevice.MMR_ModuleTemp2       = mrDevice.MMR_CurTemp;
                mrDevice.MMR_ModuleSampleTime2 = mrDevice.MMR_CurTime;
                mrDevice.MMR_ModuleAir2        = mrDevice.MMR_CurAir;
                mrDevice.MMR_ModulemPa2        = mrDevice.MMR_CurPressure;
                break;

            case 3:
                mrDevice.MMR_ModuleSpeed3      = mrDevice.MMR_CurSpeed;
                mrDevice.MMR_ModuleTemp3       = mrDevice.MMR_CurTemp;
                mrDevice.MMR_ModuleSampleTime3 = mrDevice.MMR_CurTime;
                mrDevice.MMR_ModuleAir3        = mrDevice.MMR_CurAir;
                mrDevice.MMR_ModulemPa3        = mrDevice.MMR_CurPressure;
                break;

            case 4:
                mrDevice.MMR_ModuleSpeed4      = mrDevice.MMR_CurSpeed;
                mrDevice.MMR_ModuleTemp4       = mrDevice.MMR_CurTemp;
                mrDevice.MMR_ModuleSampleTime4 = mrDevice.MMR_CurTime;
                mrDevice.MMR_ModuleAir4        = mrDevice.MMR_CurAir;
                mrDevice.MMR_ModulemPa4        = mrDevice.MMR_CurPressure;
                break;

            case 5:
                mrDevice.MMR_ModuleSpeed5      = mrDevice.MMR_CurSpeed;
                mrDevice.MMR_ModuleTemp5       = mrDevice.MMR_CurTemp;
                mrDevice.MMR_ModuleSampleTime5 = mrDevice.MMR_CurTime;
                mrDevice.MMR_ModuleAir5        = mrDevice.MMR_CurAir;
                mrDevice.MMR_ModulemPa5        = mrDevice.MMR_CurPressure;
                break;

            case 6:
                mrDevice.MMR_ModuleSpeed6      = mrDevice.MMR_CurSpeed;
                mrDevice.MMR_ModuleTemp6       = mrDevice.MMR_CurTemp;
                mrDevice.MMR_ModuleSampleTime6 = mrDevice.MMR_CurTime;
                mrDevice.MMR_ModuleAir6        = mrDevice.MMR_CurAir;
                mrDevice.MMR_ModulemPa6        = mrDevice.MMR_CurPressure;
                break;

            case 7:
                mrDevice.MMR_ModuleSpeed7      = mrDevice.MMR_CurSpeed;
                mrDevice.MMR_ModuleTemp7       = mrDevice.MMR_CurTemp;
                mrDevice.MMR_ModuleSampleTime7 = mrDevice.MMR_CurTime;
                mrDevice.MMR_ModuleAir7        = mrDevice.MMR_CurAir;
                mrDevice.MMR_ModulemPa7        = mrDevice.MMR_CurPressure;
                break;

            case 8:
                mrDevice.MMR_ModuleSpeed8      = mrDevice.MMR_CurSpeed;
                mrDevice.MMR_ModuleTemp8       = mrDevice.MMR_CurTemp;
                mrDevice.MMR_ModuleSampleTime8 = mrDevice.MMR_CurTime;
                mrDevice.MMR_ModuleAir8        = mrDevice.MMR_CurAir;
                mrDevice.MMR_ModulemPa8        = mrDevice.MMR_CurPressure;
                break;

            default:
                break;
            }
            if (IsSocket)
            {
                String msg = MRDeviceMessageCreator.createSettingMsg(mrDevice.MMR_CurentSelectIndex, mrDevice.MMR_CurSpeed, mrDevice.MMR_CurTemp, mrDevice.MMR_CurTime, mrDevice.MMR_CurAir, mrDevice.MMR_CurPressure);
                mrDevice.SendMsg(msg);
            }
        }
Exemplo n.º 2
0
        private void start_Click(object sender, EventArgs e)
        {
            if (IsSocket)
            {
                switch (curSelectModule)
                {
                case 1:
                    if (!mrDevice.MMR_Module1)
                    {
                        String msg = MRDeviceMessageCreator.createStartMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module1 = true;
                    }
                    else
                    {
                        String msg = MRDeviceMessageCreator.createStopMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module1 = false;
                    }
                    break;

                case 2:
                    if (!mrDevice.MMR_Module2)
                    {
                        String msg = MRDeviceMessageCreator.createStartMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module2 = true;
                    }
                    else
                    {
                        String msg = MRDeviceMessageCreator.createStopMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module2 = false;
                    }
                    break;

                case 3:
                    if (!mrDevice.MMR_Module3)
                    {
                        String msg = MRDeviceMessageCreator.createStartMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module3 = true;
                    }
                    else
                    {
                        String msg = MRDeviceMessageCreator.createStopMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module3 = false;
                    }
                    break;

                case 4:
                    if (!mrDevice.MMR_Module4)
                    {
                        String msg = MRDeviceMessageCreator.createStartMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module4 = true;
                    }
                    else
                    {
                        String msg = MRDeviceMessageCreator.createStopMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module4 = false;
                    }
                    break;

                case 5:
                    if (!mrDevice.MMR_Module5)
                    {
                        String msg = MRDeviceMessageCreator.createStartMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module5 = true;
                    }
                    else
                    {
                        String msg = MRDeviceMessageCreator.createStopMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module5 = false;
                    }
                    break;

                case 6:
                    if (!mrDevice.MMR_Module6)
                    {
                        String msg = MRDeviceMessageCreator.createStartMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module6 = true;
                    }
                    else
                    {
                        String msg = MRDeviceMessageCreator.createStopMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module6 = false;
                    }
                    break;

                case 7:
                    if (!mrDevice.MMR_Module7)
                    {
                        String msg = MRDeviceMessageCreator.createStartMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module7 = true;
                    }
                    else
                    {
                        String msg = MRDeviceMessageCreator.createStopMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module7 = false;
                    }
                    break;

                case 8:
                    if (!mrDevice.MMR_Module8)
                    {
                        String msg = MRDeviceMessageCreator.createStartMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module8 = true;
                    }
                    else
                    {
                        String msg = MRDeviceMessageCreator.createStopMsg(curSelectModule);
                        mrDevice.SendMsg(msg);
                        mrDevice.MMR_Module8 = false;
                    }
                    break;
                }
            }
        }