本文整理汇总了C++中AcStringArray::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ AcStringArray::isEmpty方法的具体用法?C++ AcStringArray::isEmpty怎么用?C++ AcStringArray::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcStringArray
的用法示例。
在下文中一共展示了AcStringArray::isEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MinePreGasCacul
bool Calculate::MinePreGasCacul( const AcStringArray& baseDatas,const AcStringArray& listDatas,CString& strRet )
{
if(baseDatas.isEmpty() || listDatas.isEmpty()) return false;
doubleVector dBaseDatas,dListDatas;
StringsToNum(baseDatas,dBaseDatas);
StringsToNum(listDatas,dListDatas);
if(dBaseDatas[4] <= 0) return false;
if(abs(dBaseDatas[0] - dBaseDatas[1]) < 0.00001) return false;
int faceNum = (int)dBaseDatas[6];
double sumFace = 0;
for(int j = 0; j < faceNum; j++)
{
double length = dListDatas[5*j];
double height = dListDatas[5*j+1];
double dencity = dListDatas[5*j+2];
double dayAdvance = dListDatas[5*j + 3];
double recovRate = dListDatas[5*j+4];
double temp = length*height*dencity*dayAdvance*0.01*recovRate;
sumFace += temp;
}
double ret = dBaseDatas[3]*0.01*dBaseDatas[2]*0.0001/dBaseDatas[4]/(dBaseDatas[0] - dBaseDatas[1]) + dBaseDatas[5]*330*0.0001*sumFace;
strRet.Format(_T("%.2lf"),ret);
return true;
}
示例2: fillVarList
void FieldInfoDlg::fillVarList()
{
m_varList.ResetContent(); // 清空列表
AcStringArray names;
switch( m_lt )
{
case LT_STRING:
StringListHelper::GetAllNames( names );
break;
case LT_INT:
IntStrListHelper::GetAllNames( names );
break;
case LT_OBJECT:
DataObjectListHelper::GetAllNames( names );
break;
}
if( names.isEmpty() ) return;
int index = names.find( m_varName );
if( index < 0 ) m_varName = _T( "" ); // 清空
int len = names.length();
for( int i = 0; i < len; i++ )
{
m_varList.AddString( names[i].kACharPtr() );
}
m_varList.SetCurSel( index );
}
示例3: DisplayPropertyDataDlg
bool PropertyDataDlgHelper::DisplayPropertyDataDlg( const AcDbObjectId& objId )
{
if( objId.isNull() ) return false;
AcDbObjectId dObjId;
if( !DataHelper::GetDataObject( objId, dObjId ) ) return false;
CString type;
if( !DataHelper::GetTypeName( objId, type ) ) return false;
AcStringArray fields;
FieldHelper::GetAllFields( type, fields );
//acutPrintf(_T("\n类型:%s"),type);
if( fields.isEmpty() )
{
CString msg;
//msg.Format(_T("类型:%s的字段个数为0,没有数据可以显示..."), type);
msg.Format( _T( "没有数据可以显示..." ) );
AfxMessageBox( msg );
return false;
}
else
{
DisplayPartialPropertyDataDlg( dObjId, fields );
return true;
}
}
示例4: explodeBlock
void BlockDraw::explodeBlock( AcGeVoidPointerArray& ents )
{
// 填充属性数据
AcStringArray names;
regPropertyDataNames( names );
if( names.isEmpty() )
{
acutPrintf( _T( "\n没有注册要提取的字段..." ) );
return;
}
if( names.length() != m_attValues.length() )
{
acutPrintf( _T( "\n注册的属性数据与读取的数据个数不相等!" ) );
return;
}
AcDbObjectId blkId = GetBlockDefinitionByName( m_blockName );
if( blkId.isNull() )
{
acutPrintf( _T( "\n未知的块定义:%s" ), m_blockName );
return;
}
// 计算变换矩阵
AcGeMatrix3d blkXform = GetBlockTransformMatrix( blkId, m_insertPt, m_angle, m_scale );
// 分解块定义
BlockToEntity( blkId, blkXform, names, m_attValues, ents );
}
示例5: DisplayPropertyByFunName
bool PropertyDataDlgHelper::DisplayPropertyByFunName( const AcDbObjectId& objId, const CString funName )
{
if( objId.isNull() ) return false;
AcDbObjectId dObjId;
if( !DataHelper::GetDataObject( objId, dObjId ) ) return false;
CString type;
if( !DataHelper::GetTypeName( objId, type ) ) return false;
AcStringArray fields;
FuncFieldHelper::GetFields(funName,type,fields);
//for (int i = 0; i < fields.length(); i++)
//{
// acutPrintf(_T("\n功能:%s\t字段:%s"),funName,fields[i]);
//}
//FieldHelper::GetAllFields( type, fields );
if( fields.isEmpty() )
{
CString msg;
//msg.Format(_T("类型:%s的字段个数为0,没有数据可以显示..."), type);
msg.Format( _T( "没有数据可以显示..." ) );
AfxMessageBox( msg );
return false;
}
InputPropertyDataDlg( dObjId, fields,funName );
return true;
}
示例6: BuildPropGridCtrl
bool PropertyDataUpdater::BuildPropGridCtrl( CMFCPropertyGridCtrl* pPropDataList, const CString& type, const AcStringArray& fields )
{
if( pPropDataList == NULL ) return false;
if( type.GetLength() == 0 ) return false;
if( fields.isEmpty() ) return false;
// 清空已添加的属性
pPropDataList->RemoveAll();
//acutPrintf(_T("\n清空所有属性..."));
// 创建MFCPropertyGridCtrlHelper对象
// 同时初始化m_propertyDataList的属性
// 参见MFCPropertyGridCtrlHelper的构造函数
MFCPropertyGridCtrlHelper pgch( pPropDataList );
int len = fields.length();
for( int i = 0; i < len; i++ )
{
CString name = fields[i].kACharPtr();
FieldInfo info; // 默认设置(DT_STRING, m_enable=true, m_descr =_T(""))
FieldInfoHelper::ReadFieldInfo( type, name, info );
// 构建PropertyList
BuildPropList( pgch, name, _T( "" ), info ); // 赋予空字符串
}
//PrintPropList(pPropDataList);
return true;
}
示例7: GetTopParentClass
bool ArxClassHelper::GetTopParentClass( const CString& type, CString& parentType )
{
AcStringArray types;
GetClassHierarchy( type, types, false );
if( types.isEmpty() ) return false; // type本身就是抽象类
parentType = types.first().kACharPtr();
return true;
}
示例8: MineGasCapacityCacul
/*
* 参数1代表
* |-0矿井相对瓦斯涌出量
* |-1矿井总回风巷瓦斯浓度
* |-2当地大气压
* |-3矿井最大总回风风量
* |-4抽采系统工况系数
* |-5瓦斯泵台数
* 参数2代表
* 单台瓦斯泵额定流量、瓦斯抽采浓度、瓦斯泵压力、抽采泵富余系数、每套抽采主管道实际内径、每套管道混合经济流速、管道富余系数
* 参数3代表计算结果
*/
bool Calculate::MineGasCapacityCacul( const AcStringArray& baseDatas,const AcStringArray& pumpDatas,CString& strPumpRet,CString& strSysRet )
{
if(baseDatas.isEmpty() || pumpDatas.isEmpty()) return false;
doubleVector dBaseDatas,dPumpDatas;
StringsToNum(baseDatas,dBaseDatas);
StringsToNum(pumpDatas,dPumpDatas);
if(dBaseDatas[0] <= 0) return false;
int pumpNum = (int)dBaseDatas[5];
double sumPump = 0;
double sumTube = 0;
for(int j = 0; j < pumpNum; j++)
{
double pumpQ = dPumpDatas[7*j];
double pumpCon = dPumpDatas[7*j+1];
double pumpP = dPumpDatas[7*j+2];
double pumpKP = dPumpDatas[7*j + 3];
double tubeD = dPumpDatas[7*j+4];
double tubeV = dPumpDatas[7*j+5];
double tubeKS = dPumpDatas[7*j+6];
double tmp1 = pumpQ * pumpCon* 0.01 * dBaseDatas[4] * (dBaseDatas[2]-pumpP);
double temp = tmp1 / pumpKP / 101.325;
sumPump += temp;
double tmp2 = (tubeD / 0.1457) * (tubeD / 0.1457) * tubeV * pumpCon * 0.01 * (dBaseDatas[2]-pumpP);
double temp2 = tmp2 / tubeKS / 101.325;
sumTube += temp2;
//acutPrintf(_T("\n第%d台泵\t Q:%.2lf,C:%.2lf,P:%.2lf"),j+1,pumpQ,pumpCon,pumpP);
}
double ret = (dBaseDatas[1]*0.01*dBaseDatas[3] + sumPump) * 330 * 1440 * 0.0001 / dBaseDatas[0];
strPumpRet.Format(_T("%.2lf"),ret);
ret = (dBaseDatas[1]*0.01*dBaseDatas[3] + sumTube) * 330 * 1440 * 0.0001 / dBaseDatas[0];
strSysRet.Format(_T("%.2lf"),ret);
//for(int i = 0 ; i < dBaseDatas.size(); i++)
//{
// acutPrintf(_T("\n第%d个值:%.2lf"),i+1,dBaseDatas[i]);
//}
//acutPrintf(_T("\n第一个值:%.2lf\t第二个值:%.2lf\t第三个值:%.2lf"),dBaseDatas[1]*0.01*dBaseDatas[3],sumPump,330 * 1440 * 0.0001 / dBaseDatas[0]);
return true;
}
示例9: MineRateGasCacul
bool Calculate::MineRateGasCacul( const AcStringArray& datas,CString& strRet )
{
if(datas.isEmpty()) return false;
doubleVector dDatas;
StringsToNum(datas,dDatas);
if(dDatas[0] <= 0) return false;
double ret = dDatas[1] * 330 * 1440 * 0.0001 / dDatas[0];
strRet.Format(_T("%.2lf"),ret);
return true;
}
示例10: MineGasRealCacul
bool Calculate::MineGasRealCacul( const AcStringArray& datas,CString& strYearRet )
{
if(datas.isEmpty()) return false;
doubleVector dDatas;
StringsToNum(datas,dDatas);
if(dDatas[4] <= 0) return false;
double ret = (dDatas[2]*0.01*dDatas[3] + dDatas[0]/dDatas[4]/365/1440) * 330 * 1440 * 0.0001 / dDatas[1];
//acutPrintf(_T("\nQs:%.2lf,k:%.2lf"),dDatas[0],dDatas[4]);
//acutPrintf(_T("\n第一个值:%.2lf\t第二个值:%.2lf\t第三个值:%.2lf"),dDatas[2]*0.01*dDatas[3], dDatas[0]/dDatas[4]/365/1440,330 * 1440 * 0.0001 / dDatas[1]);
strYearRet.Format(_T("%.2lf"),ret);
return true;
}
示例11: AddStringList
bool StringListHelper::AddStringList( const CString& name, const AcStringArray& strList )
{
if( ( name.GetLength() == 0 ) || strList.isEmpty() ) return false;
ArxDictTool* pDictTool = ArxDictTool::GetDictTool( STRING_LIST_DICT );
bool ret = pDictTool->findKey( name );
if( !ret ) // 如果变量name已存在,则不进行修改
{
int len = strList.length();
for( int i = 0; i < len; i++ )
{
pDictTool->addEntry( name, strList[i].kACharPtr() );
}
}
delete pDictTool;
return !ret;
}
示例12: DisplayPartialPropertyDataDlg
void PropertyDataDlgHelper::DisplayPartialPropertyDataDlg( const AcDbObjectId& objId, const AcStringArray& fields )
{
if( objId.isNull() ) return;
if( fields.isEmpty() ) return;
// 切换资源
CAcModuleResourceOverride myResources;
PropertyDataDlg pdd;
pdd.showAllData( true );
pdd.setMineGE( objId );
int len = fields.length();
for( int i = 0; i < len; i++ )
{
pdd.addField( fields[i].kACharPtr() );
//acutPrintf(_T("\n字段:%s"),fields[i].kACharPtr());
}
pdd.DoModal();
}
示例13: GetAllTopParentClass
bool ArxClassHelper::GetAllTopParentClass( const CString& root, AcStringArray& types )
{
AcStringArray allGETypes;
ArxClassHelper::GetArxClassTypes( root, allGETypes, false );
if( allGETypes.isEmpty() ) return false;
int len = allGETypes.length();
for( int i = 0; i < len; i++ )
{
CString parentType;
if( !ArxClassHelper::GetTopParentClass( allGETypes[i].kACharPtr(), parentType ) ) continue;
if( allGETypes[i].compareNoCase( parentType ) != 0 ) continue;
if( !types.contains( parentType ) )
{
types.append( parentType );
}
}
return true;
}
示例14: AddIntStrList
bool IntStrListHelper::AddIntStrList( const CString& name, const AcDbIntArray& intList, const AcStringArray& strList )
{
if( ( name.GetLength() == 0 ) || strList.isEmpty() || intList.isEmpty() ) return false;
if( intList.length() != strList.length() ) return false;
ArxDictTool* pDictTool = ArxDictTool::GetDictTool( INT_LIST_DICT );
bool ret = pDictTool->findKey( name );
if( !ret )
{
int len = intList.length();
for( int i = 0; i < len; i++ )
{
CString intValue;
intValue.Format( _T( "%d" ), intList[i] );
pDictTool->addEntry( name, intValue ); // 偶数位置的元素为整数
pDictTool->addEntry( name, strList[i].kACharPtr() ); // 奇数位置的元素为字符串
}
}
delete pDictTool;
return !ret;
}
示例15: fillFieldListBox
void FieldManagerDlg::fillFieldListBox( const CString& type )
{
setLastSelIndex( LB_ERR ); // 记录listbox切换之前的索引位置
AcStringArray fields;
FieldHelper::GetAllFields( type, fields );
if( fields.isEmpty() ) return;
int len = fields.length();
for( int i = 0; i < len; i++ )
{
CString field = fields[i].kACharPtr();
m_fieldListBox.AddString( field );
// 初始为默认设置
FieldInfo* pInfo = new FieldInfo();
// 读取字段信息
FieldInfoHelper::ReadFieldInfo( type, field, *pInfo );
m_infoes.append( pInfo );
}
m_fieldListBox.SetCurSel( 0 );
}