public VelMode IniReadVelMode(string section, string key) { VelMode velmode = new VelMode(1, 1, 1, 1); StringBuilder temp = new StringBuilder(255); string strres, strLowVel, strHighVel, strAcc, strDec; GetPrivateProfileString(section, key, "", temp, 255, this.Path); strres = temp.ToString(); try { strLowVel = strres.Split(new char[] { ',' })[0]; strHighVel = strres.Split(new char[] { ',' })[1]; strAcc = strres.Split(new char[] { ',' })[2]; strDec = strres.Split(new char[] { ',' })[3]; velmode.LowVel = double.Parse(strLowVel); velmode.HighVel = double.Parse(strHighVel); velmode.Acc = double.Parse(strAcc); velmode.Dec = double.Parse(strDec); } catch { //Function.function.PutInLog("读取" + Path + "中参数" + section + ":" + key + "出错", false); return(velmode); } return(velmode); }
public void IniWriteVelMode(string section, string key, VelMode velmode) { string strLowVel = velmode.LowVel.ToString("F3"); string strHighVel = velmode.HighVel.ToString("F3"); string strAcc = velmode.Acc.ToString("F3"); string strDec = velmode.Dec.ToString("F3"); WritePrivateProfileString(section, key, strLowVel + "," + strHighVel + "," + strAcc + "," + strDec, this.Path); }
/// <summary> /// 去安全高度 /// </summary> /// <param name="velMode"></param> /// <returns></returns> public short GoSafePos(VelMode velMode) { return(base.GoPos(this.SafeHeigh, velMode)); }