本文整理汇总了C++中TAxis::getFWeight方法的典型用法代码示例。如果您正苦于以下问题:C++ TAxis::getFWeight方法的具体用法?C++ TAxis::getFWeight怎么用?C++ TAxis::getFWeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAxis
的用法示例。
在下文中一共展示了TAxis::getFWeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetVehFromDev
TWtVehicle TWtDev::GetVehFromDev(int AIndex)
{
int ret, ZhouZuShu;
long TyreWeight[4];
long AxisWeight[10];
TAxis A;
TWtVehicle V;
double Speed;
quint32 ZhouZuWeight;
int AxisType;
//取轴组数
//取各轴组轴型以及各轴重
//取车速
// Result= nil;
ret = Dev_AxisCount(AIndex);
if(ret == -1)
{
V.Clear();
LogMsg("lane",tr("[TWtDev.GetVehFromDev]WimDev_AxisCount失败"));
return V;
}
if (ret==0)
{
V.Clear();
LogMsg("lane",tr("[TWtDev.GetVehFromDev]WimDev_AxisCount返回0,车辆序号不存在"));
return V;
}
//V = TWtVehicle;
ZhouZuShu= ret;
for(int i= 1; i<= ZhouZuShu; i++)
{
qMemSet(TyreWeight, 0, sizeof(TyreWeight));
ret =Dev_AxisData(AIndex, i, &AxisType, TyreWeight);
if( ret==-1)
{
LogMsg("lane",tr("[TWtDev.GetVehFromDev]WimDev_AxisData调用失败"));
V.clear(); //只要取任何轴组出错,就返回nil
return V;
}
ZhouZuWeight = 0;
for( int j= 0;j<sizeof(TyreWeight);j++)
{
if( TyreWeight[j] > 0)
{
A.setWeight((quint32)qRound(TyreWeight[j] * (1 -FDiscountRate)));
V.append(A);
ZhouZuWeight = ZhouZuWeight + A.getFWeight();
}
}
if (i <= 12 ) //最多12个轴组信息
{
QString info= V.GetFAxisInfo() + QObject::tr("%1").arg(AxisType) +QObject::tr("%1").arg(ZhouZuWeight,6,10,QLatin1Char('0'));
V.setFAxisInfo(info);
}
}
//取车速
Speed = 0;
qMemSet(AxisWeight,0, sizeof(AxisWeight));
ret = Dev_AxisInfo(AIndex, AxisWeight, Speed);
if( ret==0)
{
V.setFSpeed(Speed);
}
else
{
V.Clear();
LogMsg("lane",tr("[TWtDev.GetVehFromDev]WimDev_AxisInfo调用失败"));
}
return V;
}