代码拉取完成,页面将自动刷新
#include "mainframdata.h"
QString EnvmPrm::StartFlag;
QString EnvmPrm::EndFlag;
MotorPara EnvmPrm::m_MotorPara;
double EnvmPrm::JogDistance[4];
int EnvmPrm::PiontCount;
QMap<int,Point> EnvmPrm::PointMap;
EnvmPrm::EnvmPrm()
{
}
QString EnvmPrm::doubleToQString(double value, int format) //自动调整小数点
{
QString str;
str=QString::number(value,'f');
if(format==0)
{
while (str.endsWith('0'))
{
str = str.left(str.length()-1);
}
if(str.endsWith('.'))
str.replace(".","");
}
return str;
}
void shareIO::setLimit_positive(long value)
{
QMutex Mutex;
Mutex.lock();
Limit_positive=value;
Mutex.unlock();
}
void shareIO::setLimit_negative(long value)
{
QMutex Mutex;
Mutex.lock();
Limit_negative=value;
Mutex.unlock();
}
void shareIO::setAlarm(long value)
{
QMutex Mutex;
Mutex.lock();
Alarm=value;
Mutex.unlock();
}
void shareIO::setHome(long value)
{
QMutex Mutex;
Mutex.lock();
Home=value;
Mutex.unlock();
}
void shareIO::setArrive(long value)
{
QMutex Mutex;
Mutex.lock();
Arrive=value;
Mutex.unlock();
}
void shareIO::setGPI_Value(long value)
{
QMutex Mutex;
Mutex.lock();
GPI_Value=value;
Mutex.unlock();
}
long shareIO::getLimit_positive()
{
QMutex Mutex;
Mutex.lock();
long value=Limit_positive;
Mutex.unlock();
return value;
}
long shareIO::getLimit_negative()
{
QMutex Mutex;
Mutex.lock();
long value=Limit_negative;
Mutex.unlock();
return value;
}
long shareIO::getAlarm()
{
QMutex Mutex;
Mutex.lock();
long value=Alarm;
Mutex.unlock();
return value;
}
long shareIO::getHome()
{
QMutex Mutex;
Mutex.lock();
long value=Home;
Mutex.unlock();
return value;
}
long shareIO::getArrive()
{
QMutex Mutex;
Mutex.lock();
long value=Arrive;
Mutex.unlock();
return value;
}
long shareIO::getGPI_value()
{
QMutex Mutex;
Mutex.lock();
long value=GPI_Value;
Mutex.unlock();
return value;
}
void shareIO::setEnable(long value)
{
QMutex Mutex;
Mutex.lock();
Enable=value;
Mutex.unlock();
}
void shareIO::setClear(long value)
{
QMutex Mutex;
Mutex.lock();
Clear=value;
Mutex.unlock();
}
void shareIO::setGPO_value(long value)
{
QMutex Mutex;
Mutex.lock();
GPO_value=value;
Mutex.unlock();
}
void shareIO::setEnableBit(short index, short value)
{
char Bit;
QMutex Mutex;
Mutex.lock();
long EN=Enable ;
Mutex.unlock();
if(value==0)
{
Bit='0'; //low
}
else
{
Bit='1'; //higth
}
QString strV=QString::number(EN,2).rightJustified(8,'0');
QString str=strV.replace(7-index,Bit);
bool ok;
long temp=str.toInt(&ok,2);
setEnable(temp);
}
void shareIO::setClearBit(short index, short value)
{
char Bit;
QMutex Mutex;
Mutex.lock();
long CLR=Clear;
Mutex.unlock();
if(value==0)
{
Bit='0'; //low
}
else
{
Bit='1'; //higth
}
QString strV=QString::number(CLR,2).rightJustified(8,'0');
QString str=strV.replace(7-index,Bit);
bool ok;
long temp=str.toInt(&ok,2);
setEnable(temp);
}
void shareIO::setGPO_valueBit(short index, short value)
{
char Bit;
QMutex Mutex;
Mutex.lock();
long GPO=GPO_value;
Mutex.unlock();
if(value==0)
{
Bit='0'; //low
}
else
{
Bit='1'; //higth
}
QString strV=QString::number(GPO,2).rightJustified(16,'0');
QString str=strV.replace(15-index,Bit);
bool ok;
long temp=str.toInt(&ok,2);
setGPO_value(temp);
}
long shareIO::getEnable()
{
QMutex Mutex;
Mutex.lock();
long value=Enable;
Mutex.unlock();
return value;
}
long shareIO::getClear()
{
QMutex Mutex;
Mutex.lock();
long value=Clear;
Mutex.unlock();
return value;
}
long shareIO::getGPO_value()
{
QMutex Mutex;
Mutex.lock();
long value=GPO_value;
Mutex.unlock();
return value;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。