当前位置: 首页>>代码示例>>C++>>正文


C++ wxLogWarning函数代码示例

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


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

示例1: wxASSERT

bool CGMSKModemWinUSB::open()
{
	wxASSERT(m_handle == INVALID_HANDLE_VALUE);

	bool res = openModem();
	if (!res) {
		wxLogError(wxT("Cannot find the GMSK Modem with address: 0x%04X"), m_address);
		return false;
	}

	wxLogInfo(wxT("Found the GMSK Modem with address: 0x%04X"), m_address);

	wxString version;

	int ret;
	do {
		unsigned char buffer[GMSK_MODEM_DATA_LENGTH];
		ret = io(GET_VERSION, 0xC0U, 0U, buffer, GMSK_MODEM_DATA_LENGTH);
		if (ret > 0) {
			wxString text((char*)buffer, wxConvLocal, ret);
			version.Append(text);
		} else if (ret < 0) {
			wxLogError(wxT("GET_VERSION returned %d"), -ret);
			close();
			return false;
		}
	} while (ret == int(GMSK_MODEM_DATA_LENGTH));

	wxLogInfo(wxT("Firmware version: %s"), version.c_str());

	// Trap firmware version 0.1.00 of DUTCH*Star and complain loudly
	if (version.Find(wxT("DUTCH*Star")) != wxNOT_FOUND && version.Find(wxT("0.1.00")) != wxNOT_FOUND) {
		wxLogWarning(wxT("This modem firmware is not supported by the repeater"));
		wxLogWarning(wxT("Please upgrade to a newer version"));
		close();
		return false;
	}

	// DUTCH*Star firmware has a broken concept of free space
	if (version.Find(wxT("DUTCH*Star")) != wxNOT_FOUND)
		m_brokenSpace = true;

	return true;
}
开发者ID:chulochumo,项目名称:OpenDV,代码行数:44,代码来源:GMSKModemWinUSB.cpp

示例2: tis

void processManager::LogOutput(bool &hasOutput, const wxString &label,float *outputProgression)
{
    hasOutput = false;

    if ( IsInputAvailable() )
    {
        wxTextInputStream tis(*GetInputStream());

        // this assumes that the output is always line buffered
        wxString msg;
        wxString output= tis.ReadLine();
        if(!this->outlogs.empty())
        {
            for(std::vector<smart_ptr<InterfLogger> >::iterator itlogs=this->outlogs.begin(); itlogs!=this->outlogs.end(); itlogs++)
            {
                (*(*itlogs)).LogMessage(output);
            }
        }
        if(outputProgression==NULL || output.Left(1)!="#")
        {
            msg << label << output;
            msg.Replace("%","%%"); //si il y a un seul % alors un bug apparait wxString attend un format du type %s ou %i par exemple
            if(output.Left(1)=="!")
            {
                wxLogWarning(msg);
            } else {
                wxLogMessage(msg);
            }
        } else {
            wxString prog=output.Right(output.Len()-1).Strip();
            *outputProgression=Convertor::ToFloat(prog);
        }

        hasOutput = true;
    }

    while ( IsErrorAvailable() )
    {
        wxTextInputStream tis(*GetErrorStream());
        const wxString& errMsg(tis.ReadLine());
        if(!this->outlogs.empty())
        {
            for(std::vector<smart_ptr<InterfLogger> >::iterator itlogs=this->outlogs.begin(); itlogs!=this->outlogs.end(); itlogs++)
            {
                (*(*itlogs)).LogError(errMsg);
            }
        }
        // this assumes that the output is always line buffered
        wxString msg;
        msg << _("Erreur exécutable :") << errMsg;
        msg.Replace("%","%%"); //si il y a un seul % alors un bug apparait wxString attend un format du type %s ou %i par exemple
        wxLogError(msg);

        hasOutput = true;
    }
}
开发者ID:JimmyFarcy,项目名称:I-Simpa,代码行数:56,代码来源:processManager.cpp

示例3: FixPresetName

bool IBattle::LoadOptionsPreset( const std::string& name )
{
	const std::string preset = FixPresetName(name);
	if (preset.empty()) return false; //preset not found
	m_preset = preset;

	for ( unsigned int i = 0; i < LSL::OptionsWrapper::LastOption; i++) {
		std::map<wxString,wxString> options = sett().GetHostingPreset( TowxString(m_preset), i );
		if ( (LSL::OptionsWrapper::GameOption)i != LSL::OptionsWrapper::PrivateOptions ) {
			for ( std::map<wxString,wxString>::const_iterator itor = options.begin(); itor != options.end(); ++itor ) {
				wxLogWarning( itor->first + _T(" ::: ") + itor->second );
				CustomBattleOptions().setSingleOption( STD_STRING(itor->first),
								       STD_STRING(itor->second),
								       (LSL::OptionsWrapper::GameOption)i );
			}
		} else {
			if ( !options[_T("mapname")].IsEmpty() ) {
				if (LSL::usync().MapExists(STD_STRING(options[_T("mapname")]))) {
					SetLocalMap( STD_STRING(options[_T("mapname")]) );
					SendHostInfo( HI_Map );
				} else if ( !ui().OnPresetRequiringMap( options[_T("mapname")] ) ) {
					//user didn't want to download the missing map, so set to empty to not have it tried to be loaded again
					options[_T("mapname")] = wxEmptyString;
					sett().SetHostingPreset( TowxString(m_preset), i, options );
				}
			}

			for( unsigned int j = 0; j <= GetLastRectIdx(); ++j ) {
				if ( GetStartRect( j ).IsOk() )
					RemoveStartRect(j); // remove all rects that might come from map presets
			}
			SendHostInfo( IBattle::HI_StartRects );

			unsigned int rectcount = s2l( options[_T("numrects")] );
			for ( unsigned int loadrect = 0; loadrect < rectcount; loadrect++) {
				int ally = s2l(options[_T("rect_") + TowxString(loadrect) + _T("_ally")]);
				if ( ally == 0 ) continue;
				AddStartRect( ally - 1, s2l(options[_T("rect_") + TowxString(loadrect) + _T("_left")]), s2l(options[_T("rect_") + TowxString(loadrect) + _T("_top")]), s2l(options[_T("rect_") + TowxString(loadrect) + _T("_right")]), s2l(options[_T("rect_") + TowxString(loadrect) + _T("_bottom")]) );
			}
			SendHostInfo( HI_StartRects );

			wxStringTokenizer tkr( options[_T("restrictions")], _T('\t') );
			m_restricted_units.clear();
			while( tkr.HasMoreTokens() ) {
				wxString unitinfo = tkr.GetNextToken();
				RestrictUnit( STD_STRING(unitinfo.BeforeLast(_T('='))), s2l( unitinfo.AfterLast(_T('=')) ) );
			}
			SendHostInfo( HI_Restrictions );
			Update( wxFormat( _T("%d_restrictions") ) % LSL::OptionsWrapper::PrivateOptions );

		}
	}
	SendHostInfo( HI_Send_All_opts );
	ui().ReloadPresetList();
	return true;
}
开发者ID:cleanrock,项目名称:springlobby,代码行数:56,代码来源:ibattle.cpp

示例4: wxLogWarning

bool CMMDVMController::writeHeader(const CHeaderData& header)
{
	bool ret = m_txData.hasSpace(46U);
	if (!ret) {
		wxLogWarning(wxT("No space to write the header"));
		return false;
	}

	unsigned char buffer[50U];

	buffer[0U] = MMDVM_FRAME_START;
	buffer[1U] = RADIO_HEADER_LENGTH_BYTES + 3U;
	buffer[2U] = MMDVM_DSTAR_HEADER;

	::memset(buffer + 3U, ' ', RADIO_HEADER_LENGTH_BYTES);

	buffer[3U] = header.getFlag1();
	buffer[4U] = header.getFlag2();
	buffer[5U] = header.getFlag3();

	wxString rpt2 = header.getRptCall2();
	for (unsigned int i = 0U; i < rpt2.Len() && i < LONG_CALLSIGN_LENGTH; i++)
		buffer[i + 6U]  = rpt2.GetChar(i);

	wxString rpt1 = header.getRptCall1();
	for (unsigned int i = 0U; i < rpt1.Len() && i < LONG_CALLSIGN_LENGTH; i++)
		buffer[i + 14U] = rpt1.GetChar(i);

	wxString your = header.getYourCall();
	for (unsigned int i = 0U; i < your.Len() && i < LONG_CALLSIGN_LENGTH; i++)
		buffer[i + 22U] = your.GetChar(i);

	wxString my1 = header.getMyCall1();
	for (unsigned int i = 0U; i < my1.Len() && i < LONG_CALLSIGN_LENGTH; i++)
		buffer[i + 30U] = my1.GetChar(i);

	wxString my2 = header.getMyCall2();
	for (unsigned int i = 0U; i < my2.Len() && i < SHORT_CALLSIGN_LENGTH; i++)
		buffer[i + 38U] = my2.GetChar(i);

	CCCITTChecksumReverse cksum1;
	cksum1.update(buffer + 3U, RADIO_HEADER_LENGTH_BYTES - 2U);
	cksum1.result(buffer + 42U);

	wxMutexLocker locker(m_mutex);

	unsigned char type = DSMTT_HEADER;
	m_txData.addData(&type, 1U);

	unsigned char len = RADIO_HEADER_LENGTH_BYTES + 3U;
	m_txData.addData(&len, 1U);

	m_txData.addData(buffer, RADIO_HEADER_LENGTH_BYTES + 3U);

	return true;
}
开发者ID:remcovz,项目名称:OpenDV,代码行数:56,代码来源:MMDVMController.cpp

示例5: wxLogWarning

void ConfigEntry::SetLine(LineList *pLine)
{
  if ( m_pLine != NULL ) {
    wxLogWarning(_("entry '%s' appears more than once in group '%s'"),
                 Name().c_str(), m_pParent->GetFullName().c_str());
  }

  m_pLine = pLine;
  Group()->SetLastEntry(this);
}
开发者ID:TimofonicJunkRoom,项目名称:plucker,代码行数:10,代码来源:fileconf.cpp

示例6: WXUNUSED

void MyFrame::OnAuiDemoToolOrMenuCommand(wxCommandEvent& WXUNUSED(event))
{
#if wxUSE_AUI
    wxDialog dlg;
    wxXmlResource::Get()->LoadDialog(&dlg, this, wxS("aui_dialog"));
    dlg.ShowModal();
#else
    wxLogWarning("wxUSE_AUI must be set to 1 in 'setup.h' to view the AUI demo.");
#endif
}
开发者ID:utelle,项目名称:wxWidgets,代码行数:10,代码来源:myframe.cpp

示例7: wxLogWarning

wxBitmap& IconsCollection::GetFractionBmp(const std::string& gameName, size_t fractionId)
{

	if (gameName.empty() || !LSL::usync().GameExists(gameName)) {
		wxLogWarning("SideIcon %zu for game %s not found!", fractionId, gameName.c_str());
		// game doesn't exist, dl needed?!
		return BMP_EMPTY;
	}

	const auto sides = LSL::usync().GetSides(gameName);

	//This can happen whenever in time, so must be caught in release build too
	if (sides.empty()) {
		wxLogWarning("IconsCollection::GetFractionBmp(): sides.empty()");
		return BMP_EMPTY;
	}

	if (fractionId >= sides.size()) {
		wxLogWarning("Invalid side requested: %s:%d", gameName.c_str(), fractionId);
		return BMP_EMPTY;
	}

	std::string sideName;

	sideName = sides[fractionId];

	const std::string cacheString = gameName + "_" + sideName;

	//Check if image already in cache
	if (m_cachedFractionBmps.find(cacheString) != m_cachedFractionBmps.end()) {
		return m_cachedFractionBmps[cacheString];
		//Create one and add to cache
	} else {
		try {
			const LSL::UnitsyncImage img = LSL::usync().GetSidePicture(gameName, sideName);
			m_cachedFractionBmps[cacheString] = img.wxbitmap();
		} catch (...) {
			//unitsync can fail!
			ASSERT_LOGIC(false, "LSL::usync().GetSidePicture() failed!");
		}
		return m_cachedFractionBmps[cacheString];
	}
}
开发者ID:abma,项目名称:springlobby,代码行数:43,代码来源:iconscollection.cpp

示例8: wxLogWarning

void NickListCtrl::RemoveUser(const User& user)
{
	const auto it = m_real_users_list.find(user.GetNick());
	if (it == m_real_users_list.end()) {
		wxLogWarning(_T( "Didn't find the user to remove." ));
		return;
	}
	m_real_users_list.erase(it);
	RemoveItem(&user);
}
开发者ID:UdjinM6,项目名称:springlobby,代码行数:10,代码来源:nicklistctrl.cpp

示例9: wxLogWarning

void BattleRoomTab::OnHostNew(wxCommandEvent& /*event*/)
{
	if (!ui().IsConnected()) {
		wxLogWarning(_T( "Trying to host while offline" ));
		customMessageBoxNoModal(SL_MAIN_ICON, _("You cannot host a game while being offline. Please connect to a lobby server."), _("Not Online."), wxOK);
		ui().ShowConnectWindow();
		return;
	}
	SL::RunHostBattleDialog(this);
}
开发者ID:spike-spb,项目名称:springlobby,代码行数:10,代码来源:battleroomtab.cpp

示例10: SilentBlockFile

void Sequence::HandleXMLEndTag(const wxChar *tag)
{
   if (wxStrcmp(tag, wxT("sequence")) != 0)
      return;

   // Make sure that the sequence is valid
   // First, replace missing blockfiles with SilentBlockFiles
   unsigned int b;
   for (b = 0; b < mBlock->Count(); b++) {
      if (!mBlock->Item(b)->f) {
         sampleCount len;

         if (b < mBlock->Count()-1)
            len = mBlock->Item(b+1)->start - mBlock->Item(b)->start;
         else
            len = mNumSamples - mBlock->Item(b)->start;

         if (len > mMaxSamples) 
         	// This could be why the blockfile failed, so limit 
         	// the silent replacement to mMaxSamples.
            len = mMaxSamples;
         mBlock->Item(b)->f = new SilentBlockFile(len);
         wxLogWarning(_("Gap detected in project file\n"));
         mErrorOpening = true;
      }
   }

   // Next, make sure that start times and lengths are consistent
   sampleCount numSamples = 0;
   for (b = 0; b < mBlock->Count(); b++) {
      if (mBlock->Item(b)->start != numSamples) {
         mBlock->Item(b)->start = numSamples;
         wxLogWarning(_("Gap detected in project file\n"));
         mErrorOpening = true;         
      }
      numSamples += mBlock->Item(b)->f->GetLength();
   }
   if (mNumSamples != numSamples) {
      mNumSamples = numSamples;
      wxLogWarning(_("Gap detected in project file\n"));
      mErrorOpening = true;
   }
}
开发者ID:Kirushanr,项目名称:audacity,代码行数:43,代码来源:Sequence.cpp

示例11: wxLogWarning

void CONTEXT_MENU::Add( const wxString& aLabel, int aId )
{
#ifdef DEBUG

    if( m_menu.FindItem( aId ) != NULL )
        wxLogWarning( wxT( "Adding more than one menu entry with the same ID may result in"
                "undefined behaviour" ) );
#endif
    m_menu.Append( new wxMenuItem( &m_menu, aId, aLabel, wxEmptyString, wxITEM_NORMAL ) );
}
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:10,代码来源:context_menu.cpp

示例12: slLogDebugFunc

void ServerEvents::OnBattleInfoUpdated(int battleid)
{
	slLogDebugFunc("");
	try {
		IBattle& battle = m_serv.GetBattle(battleid);
		ui().OnBattleInfoUpdated(battle, wxEmptyString);
	} catch (assert_exception) {
		wxLogWarning("Exception in OnBattleInfoUpdated(%d)", battleid);
	}
}
开发者ID:OursDesCavernes,项目名称:springlobby,代码行数:10,代码来源:serverevents.cpp

示例13: icons

void BattleroomListCtrl::AddUser( User& user )
{
	//first time setting is necessary to have color in replay/savegame used controls
	if ( !user.BattleStatus().spectator )
		icons().SetColourIcon( user.BattleStatus().colour );
    if ( AddItem( &user ) )
        return;

    wxLogWarning( _T("user already in battleroom list.") );
}
开发者ID:tizbac,项目名称:springlobby,代码行数:10,代码来源:battleroomlistctrl.cpp

示例14: wxLogWarning

bool MyFrame::CheckNonVirtual() const
{
    if ( !m_listCtrl->HasFlag(wxLC_VIRTUAL) )
        return true;

    // "this" == whatever
    wxLogWarning(_T("Can't do this in virtual view, sorry."));

    return false;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:10,代码来源:listtest.cpp

示例15: Length

off_t wxUtfFile::Read(wxString &str, off_t nCount)
{
	if (nCount == (off_t) - 1)
		nCount = Length() - Tell();
	if (!nCount)
		return 0;

	char *buffer = new char[nCount + 4];
	// on some systems, len returned from wxFile::read might not reflect the number of bytes written
	// to the buffer, but the bytes read from file. In case of CR/LF translation, this is not the same.
	memset(buffer, 0, nCount + 4);
	off_t len = wxFile::Read(buffer, nCount);

	if (len >= 0)
	{
		memset(buffer + len, 0, 4);

		if (m_conversion)
		{
			int decr;
			size_t nLen = 0;


			// We are trying 4 times to convert, in case the last utf char
			// was truncated.
			for (decr = 0 ; len > 0 && decr < 4 ; decr++)
			{
				nLen = m_conversion->MB2WC(NULL, buffer, 0);
				if ( nLen != (size_t) - 1 )
					break;
				len--;
				buffer[len] = 0;
			}

			if (nLen == (size_t) - 1)
			{
				if (!m_strFileName.IsEmpty())
				{
					wxLogWarning(_("The file \"%s\" could not be opened because it contains characters that could not be interpreted."), m_strFileName.c_str());
				}
				Seek(decr - nLen, wxFromCurrent);
				return (size_t) - 1;
			}
			if (decr)
				Seek(-decr, wxFromCurrent);

			m_conversion->MB2WC((wchar_t *)(wxChar *)wxStringBuffer(str, nLen + 1), (const char *)buffer, (size_t)(nLen + 1));
		}
		else
			str = (wxChar *)buffer;
	}

	delete[] buffer;
	return len;
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:55,代码来源:utffile.cpp


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