• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AddError函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AddError函数的典型用法代码示例。如果您正苦于以下问题:C++ AddError函数的具体用法?C++ AddError怎么用?C++ AddError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AddError函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AddError

void THISCLASS::OnStep() {
	// Check input image
	IplImage *inputimage = mCore->mDataStructureInput.mImage;
	if (! inputimage) {
		return;
	}
	if (inputimage->nChannels != 1) {
		AddError(wxT("This component requires a grayscale input image."));
	}

	// Prepare the output image
	PrepareOutputImage(inputimage);

	// Convert
	try {
		switch (mBayerType) {
		case 0 :
			cvCvtColor(inputimage, mOutputImage, CV_BayerBG2BGR);
			break;
		case 1 :
			cvCvtColor(inputimage, mOutputImage, CV_BayerGB2BGR);
			break;
		case 2 :
			cvCvtColor(inputimage, mOutputImage, CV_BayerRG2BGR);
			break;
		case 3 :
			cvCvtColor(inputimage, mOutputImage, CV_BayerGR2BGR);
			break;
		default :
			AddError(wxT("Invalid Bayer Pattern Type"));
			return;
		}
	} catch (...) {
		AddError(wxT("Conversion from Bayer to BGR failed."));
	}

	// Set the output image on the color data structure
	mCore->mDataStructureImageColor.mImage = mOutputImage;

	// Let the Display know about our image
	DisplayEditor de(&mDisplayOutput);
	if (de.IsActive()) {
		de.SetMainImage(mCore->mDataStructureImageColor.mImage);
	}
}
开发者ID:gctronic,项目名称:swistrack,代码行数:45,代码来源:ComponentConvertBayerToColor.cpp


示例2: lua_gettop

int LuaParser::_EventEncounter(std::string package_name, QuestEventID evt, std::string encounter_name, uint32 extra_data,
							   std::vector<void*> *extra_pointers) {
	const char *sub_name = LuaEvents[evt];
	
	int start = lua_gettop(L);

	try {
		lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
		lua_getfield(L, -1, sub_name);
	
		lua_createtable(L, 0, 0);
		lua_pushstring(L, encounter_name.c_str());
		lua_setfield(L, -2, "name");

		quest_manager.StartQuest(nullptr, nullptr, nullptr);
		if(lua_pcall(L, 1, 1, 0)) {
			std::string error = lua_tostring(L, -1);
			AddError(error);
			quest_manager.EndQuest();
			return 0;
		}
		quest_manager.EndQuest();
		
		if(lua_isnumber(L, -1)) {
			int ret = static_cast<int>(lua_tointeger(L, -1));
			lua_pop(L, 2);
			return ret;
		}
		
		lua_pop(L, 2);
	} catch(std::exception &ex) {
		std::string error = "Lua Exception: ";
		error += std::string(ex.what());
		AddError(error);

		//Restore our stack to the best of our ability
		int end = lua_gettop(L);
		int n = end - start;
		if(n > 0) {
			lua_pop(L, n);
		}
	}

	return 0;
}
开发者ID:mkstarr,项目名称:Server,代码行数:45,代码来源:lua_parser.cpp


示例3: AddError

bool TParserBase::Consume(const char* text, const char* error)
{
    if (TryConsume(text))
        return true;
    else {
        AddError(error);
        return false;
    }
}
开发者ID:Frankie-666,项目名称:tomita-parser,代码行数:9,代码来源:parserbase.cpp


示例4: AddError

void THISCLASS::OnStop() {
	if (mCamera.StopImageAcquisition() != 0) {
		AddError(wxT("Could not stop image acquisition."));
		return;
	}
	if (mOutputImage) {
		cvReleaseImage(&mOutputImage);
	}
}
开发者ID:dtbinh,项目名称:swistrackplus,代码行数:9,代码来源:ComponentInputCamera1394.cpp


示例5: _CheckEmptyEntities

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : pEntity - 
//			pList - 
// Output : 
//-----------------------------------------------------------------------------
static BOOL _CheckEmptyEntities(CMapEntity *pEntity, CListBox *pList)
{
	if(!pEntity->IsPlaceholder() && !pEntity->GetChildCount())
	{
		AddError(pList, ErrorEmptyEntity, (DWORD)pEntity->GetClassName(), pEntity);
	}
	
	return(TRUE);
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:15,代码来源:mapcheckdlg.cpp


示例6: FindDuplicatePlanes

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : pSolid - 
//			pList - 
// Output : 
//-----------------------------------------------------------------------------
static BOOL FindDuplicatePlanes(CMapSolid *pSolid, CListBox *pList)
{
	if (DoesContainDuplicates(pSolid))
	{
		AddError(pList, ErrorDuplicatePlanes, 0, pSolid);
	}

	return(TRUE);
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:15,代码来源:mapcheckdlg.cpp


示例7: TEXT

void FWindowsNativeFeedbackContext::Serialize( const TCHAR* V, ELogVerbosity::Type Verbosity, const class FName& Category )
{
	// if we set the color for warnings or errors, then reset at the end of the function
	// note, we have to set the colors directly without using the standard SET_WARN_COLOR macro
	if( Verbosity==ELogVerbosity::Error || Verbosity==ELogVerbosity::Warning )
	{
		if( TreatWarningsAsErrors && Verbosity==ELogVerbosity::Warning )
		{
			Verbosity = ELogVerbosity::Error;
		}

		FString Prefix;
		if( Context )
		{
			Prefix = Context->GetContext() + TEXT(" : ");
		}
		FString Format = Prefix + FOutputDeviceHelper::FormatLogLine(Verbosity, Category, V);

		if(Verbosity == ELogVerbosity::Error)
		{
			// Only store off the message if running a commandlet.
			if ( IsRunningCommandlet() )
			{
				AddError(Format);
			}
		}
		else
		{
			// Only store off the message if running a commandlet.
			if ( IsRunningCommandlet() )
			{
				AddWarning(Format);
			}
		}
	}

	if( GLogConsole && IsRunningCommandlet() )
	{
		GLogConsole->Serialize( V, Verbosity, Category );
	}
	if( !GLog->IsRedirectingTo( this ) )
	{
		GLog->Serialize( V, Verbosity, Category );
	}

	// Buffer up the output during a slow task so that we can dump it all to the log console if the show log button is clicked
	if(GIsSlowTask)
	{
		FScopeLock Lock(&CriticalSection);
		if(hThread != NULL)
		{
			LogOutput += FString(V) + FString("\r\n");
			SetEvent(hUpdateEvent);
		}
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:56,代码来源:WindowsNativeFeedbackContext.cpp


示例8: AddError

void CSrScriptErrorView::AddErrors (CSrScriptErrorArray& Errors) 
{
	dword Index;

	for (Index = 0; Index < Errors.GetSize(); ++Index) 
	{
		AddError(Errors.GetAt(Index));
	}

}
开发者ID:Vuher,项目名称:skyedit,代码行数:10,代码来源:SrScriptErrorView.cpp


示例9: CANAbortCMD

void CANAbortCMD(void){
	if((can_Status==CAN_Send)||(can_Status==CAN_Pending)){
		Timer0_Stop();
		can_queue[can_queue_tail]->cmd=CMD_ABORT;
		can_cmd(can_queue[can_queue_tail]);
		AddError(ERROR_CAN_SEND);
		can_Status=CAN_Ready;
		can_queue_tail=(can_queue_tail+1)%CAN_QUEUE_SIZE;
	}
}
开发者ID:heroichornet,项目名称:dashboard,代码行数:10,代码来源:CAN.c


示例10: CANSend

void CANSend(void){
	can_queue[can_queue_tail]->cmd=CMD_TX_DATA;
	if(can_cmd(can_queue[can_queue_tail])!=CAN_CMD_ACCEPTED){
		can_Status=CAN_Ready;
		AddError(ERROR_CAN_ACCEPTED);
	}else{
		CANGIE|=(1<<ENERR);
		Timer0_Start();
	}
}
开发者ID:heroichornet,项目名称:dashboard,代码行数:10,代码来源:CAN.c


示例11: StdTitle

    void SampleErrorListing::CreateListing()
    {
        StdTitle("Sampler Setup Errors");
        SC_SetupErr sampErr;

        SampVarArray currSamp;
        if (currSamp.Size() < 1)
        {
            sampErr.SetConstantError("at least 1 variable must be sampled");
            AddError(sampErr);
        }

        for (int i = 0; i < currSamp.Size(); i++)
            if (!currSamp[i]->SampleSetupOK(sampErr))
                AddError(sampErr);

        //for FOSM or PEM - check to make sure all vars belong to same corr group
        if (!IsMonteCarlo())
        {
            int uncertCorrGroup = currSamp[0]->GetCorrGroup();
            if (!forceCorrelationsToZero)
            {
                //case where no correlations are set
                if ((currSamp[0]->GetnCorrGroup(uncertCorrGroup) > 1) && (currSamp[0]->correlations.Size() == 0))
                    AddError("correlations not set or forced to zero");
            }
            for (int i = 1; i < currSamp.Size(); i++)
            {
                int currCorrGroup = currSamp[i]->GetCorrGroup();
                if (currCorrGroup != uncertCorrGroup)
                    AddError("FOSM/PEM: all uncertain vars must belong to same correlation group");
                if (!forceCorrelationsToZero)
                {
                    //case where individual correlations are not set
                    for (int j = 0; j < currSamp[i]->correlations.Size(); j++)
                    {
                        if (RealIsNull(currSamp[i]->correlations[j].correlationValue))
                            AddError("correlations not set or forced to zero");
                    }
                }
            }
        }
    }
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:43,代码来源:G_Sample.cpp


示例12: GetResultTypeOf

void SecondPass::outNode(StmtIfThenElse* n, bool last){
	auto exprType = GetResultTypeOf(n->GetExpr());

	if (exprType == nullptr)
		return;

	if (exprType->name != "bool"){
		AddError(n->GetToken(), "Result type of if-else-condition must be 'bool' but is '%s'.", exprType->name.c_str());
	}
}
开发者ID:JuBan1,项目名称:ScriptSlave2,代码行数:10,代码来源:SecondPass.cpp


示例13: StdTitle

void DataCaptureErrorListing::CreateListing()
{
  StdTitle("Simulation Results Setup Errors");

  SC_SetupErr dcErr;

  if (dataCaptureData.IsEmpty())
    AddError("no output data specified");


  for (int i = 0; i < dataCaptureData.Size(); i++)
    if (dataCaptureData.IsNotValid(i))
    {
      AddError("Null capture spec found");
    }
    else
    {
      if (!dataCaptureData.GetRef(i).SetupOK(dcErr))
      {
        AddError(dcErr);
      }
    }

  if (productionRestartTimes.Size() > 0)
  {
    double prev = productionRestartTimes[0];
    for (int i = 1; i < productionRestartTimes.Size(); i++)
    {
      double next = productionRestartTimes[i];
      if (RealIsNull(prev) || RealIsNull(next))
      {
        AddError("Null production restart time found");
        break;
      }
      if (prev >= next)
      {
        AddError("Production restart times must be ascending");
        break;
      }
    }
  }

}
开发者ID:nsights,项目名称:nSIGHTS,代码行数:43,代码来源:G_DataCapture.cpp


示例14: AddError

bool LWOFile::LoadUVMap(unsigned int iChunkSize)
{
  Layer *pLayer=GetLastLayer();

  const char *pChunkEndPos=m_pData+iChunkSize-4;

  unsigned short iDimension=0;
  if(!ReadU2(iDimension))
  {
    return false;
  }

  // not 2 floats per vertex
  if(iDimension!=2)
  {
    // just skip
    m_pData+=iChunkSize-4-2;
    AddError("Warning: UVMap has "+ConvertToString(iDimension)+" floats per vertex (2 expected)");
    return true;
  }

  unsigned int iStrBytes=0;
  std::string strName;
  if(!ReadS0(strName,iStrBytes))
  {
    return false;
  }


  // VMAP { type[ID4], dimension[U2], name[S0],
  //  ( vert[VX], value[F4] # dimension )* }

  UVMap *pUVMap=new UVMap();
  pUVMap->m_strName=strName;
  pUVMap->m_Values.resize(2*pLayer->m_iPoints);
  pLayer->m_UVMaps.push_back(pUVMap);

  float *pValues=&(pUVMap->m_Values[0]);
  memset(pValues,0,sizeof(float)*2*pLayer->m_iPoints);

  while(m_pData<pChunkEndPos)
  {
    unsigned int iVertexID=0;
    if(!ReadVX(iVertexID)) return false;
    if(iVertexID>=pLayer->m_iPoints) return false;

    if(!ReadF4(pValues[iVertexID*2+0])) return false;
    if(!ReadF4(pValues[iVertexID*2+1])) return false;

    // flip v coordinate
    pValues[iVertexID*2+1]=1-pValues[iVertexID*2+1];
  }

  return true;
}
开发者ID:DanielNeander,项目名称:my-3d-engine,代码行数:55,代码来源:LWOFile.cpp


示例15: check

bool FBlueprintReparentTest::RunTest(const FString& BlueprintAssetPath)
{
	bool bTestFailed = false;

	UBlueprint * const BlueprintTemplate = Cast<UBlueprint>(StaticLoadObject(UBlueprint::StaticClass(), NULL, *BlueprintAssetPath));
	if (BlueprintTemplate != NULL)
	{
		// want to explicitly test switching from actors->objects, and vise versa (objects->actors), 
		// also could cover the case of changing non-native parents to native ones
		TArray<UClass*> TestParentClasses;
		if (!BlueprintTemplate->ParentClass->IsChildOf(AActor::StaticClass()))
		{
			TestParentClasses.Add(AActor::StaticClass());
		}
		else
		{
			// not many engine level Blueprintable classes that aren't Actors
			TestParentClasses.Add(USaveGame::StaticClass());
		}

		TArray<FAssetData> Assets;
		FBlueprintAutomationTestUtilities::GetAssetListingFromConfig(TEXT("ReparentTest.ParentsPackagePaths"), Assets, UBlueprint::StaticClass());
		// additionally gather up any blueprints that we explicitly specify though the config
		for (FAssetData const& AssetData : Assets)
		{
			UClass* AssetClass = FindObject<UClass>(ANY_PACKAGE, *AssetData.AssetClass.ToString());
			TestParentClasses.Add(AssetClass);
		}

		for (UClass* Class : TestParentClasses)
		{		 
			UBlueprint* BlueprintObj = FBlueprintAutomationTestUtilities::DuplicateBlueprint(BlueprintTemplate);
			check(BlueprintObj != NULL);
			BlueprintObj->ParentClass = Class;

			if (!FBlueprintAutomationTestUtilities::TestSaveBlueprint(BlueprintObj))
			{
				AddError(FString::Printf(TEXT("Failed to save blueprint after reparenting with %s: '%s'"), *Class->GetName(), *BlueprintAssetPath));
				bTestFailed = true;
			}

			FBlueprintAutomationTestUtilities::UnloadBlueprint(BlueprintObj);
		}

#if WITH_EDITOR
		// clear undo history to ensure that the transaction buffer isn't 
		// holding onto any references to the blueprints we want unloaded
		GEditor->Trans->Reset(NSLOCTEXT("BpAutomation", "ReparentTest", "Reparent Blueprint Test"));
#endif // #if WITH_EDITOR
		// make sure the unloaded blueprints are properly flushed (for future tests)
		CollectGarbage(RF_Native);
	}

	return !bTestFailed;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:55,代码来源:BlueprintAutomationTests.cpp


示例16: while

Stack<Error>* Corrector::CheckExpression(Lexema *input) {
	int i = 0;
	int count_bracket = 0;
	while (input[i].GetType() != Type_Lexems::terminal) {
		if (IsDigit(input[i])) {
			if(IsDigitRight(input[i]) == false){
				AddError(input[i].GetPosition(), "Ошибка в числе. Позиция ошибки: ");
			}
		}
		if (IsBinaryOperaion(input[i]))
		{
			if (input[i+1].GetType() == Type_Lexems::terminal)
			{
				AddError(input[i].GetPosition(), "Ошибка в бинарной операции. Позиция ошибки: ");
			}
			if (input[i + 1].GetType() != Type_Lexems::terminal && IsBinaryOperaion(input[i+1])) {
				AddError(input[i].GetPosition(), "Ошибка в повторе бинарной операций. Позиция ошибки: ");
			}
			if (input[i + 1].GetType() != Type_Lexems::terminal && input[i + 1].GetType() == Type_Lexems::close_bracket) {
				AddError(input[i].GetPosition(), "Ошибка в бинарной операции, пропущен аргумент. Позиция ошибки: ");
			}
		}
		if (IsOperationUnary(input[i]))
		{
			if (input[i + 1].GetType() == Type_Lexems::terminal) {
				AddError(input[i].GetPosition(), "Ошибка в унарной операции. Позиция ошибки: ");
			}
			if (input[i + 1].GetType() != Type_Lexems::terminal && input[i + 1].GetType() == Type_Lexems::close_bracket)
			{
				AddError(input[i].GetPosition(), "Ошибка в унарной операции, пропущен аргумент. Позиция ошибки: ");
			}
		}
		if (IsOpenBracket(input[i]))
		{
			count_bracket++;
		}
		if (IsCloseBracket(input[i]))
		{
			count_bracket--;
			if (count_bracket<0)
			{
				AddError(input[i].GetPosition(), "Ошибка в закрывающей скобке. Позиция ошибки: ");
			}
		}
		i++;
	}
	if (count_bracket != 0)
	{
		AddError("Ошибка в скобках.");
	}
	return &errors;
}
开发者ID:SemenBevzuk,项目名称:mp2-lab3-arithmetic,代码行数:52,代码来源:corrector.cpp


示例17: GetConfigurationInt

void THISCLASS::OnReloadConfiguration() {
	mMinArea = GetConfigurationInt(wxT("MinArea"), 1);
	mMaxArea = GetConfigurationInt(wxT("MaxArea"), 1000);
	mMaxNumber = GetConfigurationInt(wxT("MaxNumber"), 10);
	mAreaSelection = GetConfigurationBool(wxT("AreaBool"), false);
	mMinCompactness = GetConfigurationDouble(wxT("MinCompactness"), 1);
	mMaxCompactness = GetConfigurationDouble(wxT("MaxCompactness"), 1000);
	mCompactnessSelection = GetConfigurationBool(wxT("CompactnessBool"), false);
	mMinOrientation = GetConfigurationDouble(wxT("MinOrientation"), -90);
	mMaxOrientation = GetConfigurationDouble(wxT("MaxOrientation"), 90);
	mOrientationSelection = GetConfigurationBool(wxT("OrientationBool"), false);
	// Check for stupid configurations
	if (mMaxNumber < 1) {
		AddError(wxT("Max number of particles must be greater or equal to 1"));
	}

	if (mMinArea > mMaxArea) {
		AddError(wxT("The min area must be smaller than the max area."));
	}
}
开发者ID:dtbinh,项目名称:swistrackplus,代码行数:20,代码来源:ComponentBlobDetectionMinMax.cpp


示例18: ClearError

///////////////////////////////////////////////////
//      GetValue
///////////////////////////////////////////////////
float CAnalogIO::GetValue(bool updateFirst )
{
    float retVal = ANALOG_ERRVAL;

    if (!updateFirst)
    {
        return m_LastVal;
    }
    
    if (m_IsInput)
    {
        if (m_ReadCurrent)
        {
            int currentRegister;
            
            //Read current
            currentRegister = ((CDS2438*)(m_InDevice))->ReadCurrentRegister();
            //Con i ritaratori serie CLIMA vado fuori scala
            if (currentRegister > 1023)
            {
                currentRegister = 1023;
            }
            
            retVal = (float)(currentRegister/(4096.0*m_ResistorValue));
            
        }
        else
        {
            //The maximum range of the NTH-AFO-AI is 0-5V so we have to scale the value
            retVal = ((CDS2438*)(m_InDevice))->ReadVoltage( false )*2.0;
        }
    }
    else
    {
        retVal = (float)( ((CDS2890*)(m_InDevice))->ReadPosition() );
        
        //Transform the position in volts
        retVal = (255.0 - retVal)/25.5;
    }
    
    if (retVal >= 0)
    {
        //Scalo il valore
        retVal = retVal*m_ScaleFactor+m_OffsetValue;
        m_LastVal = retVal;
        ClearError();
    }
    else
    {
        AddError();
    }
    
    return retVal;
}
开发者ID:embeddedspecialist,项目名称:RaspyMonitor,代码行数:57,代码来源:analogIO.cpp


示例19: CANAddSendData

void CANAddSendData(st_cmd_t* Tx){
	if((can_queue_head+1)%CAN_QUEUE_SIZE!=can_queue_tail){
		can_queue[can_queue_head]=Tx;
		can_queue_head=(can_queue_head+1)%CAN_QUEUE_SIZE;
	}else{
		AddError(ERROR_CANQUEUE_FULL);
	}
	if(can_Status==CAN_Ready){
		CANSendData();
	}
}
开发者ID:heroichornet,项目名称:dashboard,代码行数:11,代码来源:CAN.c


示例20: GetConfigurationString

void THISCLASS::OnStart() {
	wxString filename_string = GetConfigurationString(wxT("BackgroundImage"), wxT(""));
	wxFileName filename = mCore->GetProjectFileName(filename_string);
	if (filename.IsOk()) {
		mBackgroundImage = cvLoadImage(filename.GetFullPath().mb_str(wxConvFile), CV_LOAD_IMAGE_ANYDEPTH | CV_LOAD_IMAGE_ANYCOLOR);
	}
	if (! mBackgroundImage) {
		AddError(wxT("Cannot open background image."));
		return;
	}

	if (mBackgroundImage->nChannels != 3)
	{
		AddError(wxT("Background Image has not 3 channels"));
		return;
	}

	// load other parameters:
	OnReloadConfiguration();
}
开发者ID:dtbinh,项目名称:swistrackplus,代码行数:20,代码来源:ComponentBackgroundSubtractionColor.cpp



注:本文中的AddError函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AddEscortState函数代码示例发布时间:2022-05-30
下一篇:
C++ AddEnum函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap