Example #1
0
        public byte[] Encode(object o)
        {
            ManuOffsetGain ManuOffsetGain = myBatis.QueryManuOffsetGain("QueryManuOffsetGain");

            byte[] bytes = new byte[12];

            bytes[0] = 0x02;
            bytes[1] = 0x27;
            bytes[2] = (byte)('0' + ManuOffsetGain.WaveLength);
            int[] d = MachineControlProtocol.HDecConverToHex(ManuOffsetGain.OffSet);
            bytes[3]  = (byte)d[0];
            bytes[4]  = (byte)d[1];
            bytes[5]  = (byte)d[2];
            d         = MachineControlProtocol.HDecConverToHex(ManuOffsetGain.Gain);
            bytes[6]  = (byte)d[0];
            bytes[7]  = (byte)d[1];
            bytes[8]  = (byte)d[2];
            bytes[9]  = 0x03;
            bytes[10] = 0x00;
            bytes[11] = 0x00;
            byte[] checksum = MachineControlProtocol.CheckSum(bytes);
            bytes[10] = checksum[0];
            bytes[11] = checksum[1];

            return(bytes);
        }
Example #2
0
        private void btnCommand_Click(object sender, EventArgs e)
        {
            string    strSender     = "";
            Subsystem ConfigureInfo = MachineInfo.SubsystemList.Find(str => str.Name == "Common");

            switch (((SimpleButton)sender).Name)
            {
            case "btnBegin":
                strSender = ConfigureInfo.ComponetList.Find(componet => componet.Name == "Maintance").CommandList.Find(command => command.FullName == btnBegin.Text).Name;
                break;

            case "btnStop":
                strSender = ConfigureInfo.ComponetList.Find(componet => componet.Name == "Maintance").CommandList.Find(command => command.FullName == btnStop.Text).Name;
                break;

            default:
                break;
            }

            if (((SimpleButton)sender).Name == "btnBegin" && cboWaveLength.SelectedIndex >= 0)
            {
                ManuOffsetGain manuGain = new ManuOffsetGain();
                manuGain.WaveLength = int.Parse(cboWaveLength.SelectedItem.ToString());
                if (txtGain.Text == null || txtGain.Text == "")
                {
                    manuGain.Gain = 80;
                }
                else
                {
                    manuGain.Gain = int.Parse(txtGain.Text);
                }

                if (txtOffset.Text == null || txtOffset.Text == "")
                {
                    manuGain.OffSet = 255;
                }
                else
                {
                    manuGain.OffSet = int.Parse(txtOffset.Text);
                }
                lightSystenDic.Clear();
                lightSystenDic.Add("InitialPhotometerManualCheck", new object[] { XmlUtility.Serializer(typeof(ManuOffsetGain), manuGain) });
                CommunicationUI.ServiceClient.ClientSendMsgToServiceMethod(ModuleInfo.SystemEquipmentManage, lightSystenDic);

                return;
            }


            if (SendNetworkEvent != null && strSender != "" && cboWaveLength.SelectedIndex >= 0)
            {
                SendNetworkEvent(strSender);
            }
        }
Example #3
0
        public ManuOffsetGain QueryManuOffsetGain(string strMethodName)
        {
            ManuOffsetGain manu = new ManuOffsetGain();

            try
            {
                manu = ism_SqlMap.QueryForObject("EquipmentManage." + strMethodName, null) as ManuOffsetGain;
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("ManuOffsetGain QueryManuOffsetGain(string strMethodName)==" + e.ToString(), Module.System);
            }

            return(manu);
        }
Example #4
0
        public int InitialPhotometerManualCheck(string strMethodName, ManuOffsetGain manuOffsetGain)
        {
            int iResult = 0;

            try
            {
                // 1.删除表中数据
                ism_SqlMap.Delete("EquipmentManage.DeleteManuOffsetGainInfo", null);
                // 2.插入需扫描数据
                ism_SqlMap.Insert("EquipmentManage.AddManuOffsetGainInfo", manuOffsetGain);

                iResult = 1;
            }
            catch (Exception e)
            {
                LogInfo.WriteErrorLog("InitialPhotometerManualCheck(string strMethodName, ManuOffsetGain manuOffsetGain)==" + e.ToString(), Module.System);
            }

            return(iResult);
        }
Example #5
0
 public int InitialPhotometerManualCheck(string strMethodName, ManuOffsetGain manuOffsetGain)
 {
     return(myBatis.InitialPhotometerManualCheck(strMethodName, manuOffsetGain));
 }