void CNBSelectDeviceDlg::OnOK(UINT /*wNotifyCode*/, int /*wID*/, HWND /*hwndCtl*/)
{
	if(!IsOK())
		return;

	m_listDevicesSelected.clear();
	m_listDevicesSelected = m_wndListSingle.GetSelectedDiskObjectList();

	EndDialog(IDOK);
}
void KVSimReader_MMM_asym::ReadFile(){

	while (IsOK()){
		while (ReadEvent()){
			if (nevt%1000==0) Info("ReadFile","%d evts lus",nevt);
			if (HasToFill()) FillTree();
		}
	}	
	
}
Beispiel #3
0
void DIALOG_EDITOR_DATA::OnOKClick( wxCommandEvent& event )
{
    if( !IsOK() )
    {
        wxMessageBox( _("Bad or missing parameters!") );
        return;
    }

    EndModal( wxID_OK );
}
Beispiel #4
0
wxString CVolume::_GetFilePath(const wxChar *pFileName) const
{
  wxString sRtn;
  if(IsOK() && m_sPath.Len())
  {
    sRtn = GetPathPrefix(m_sPath);
    sRtn.Append(pFileName);
  }
  return sRtn;
}
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::DeleteAllFootprintFilter( wxCommandEvent& event )
{
    if( IsOK( this, _( "OK to delete the footprint filter list ?" ) ) )
    {
        m_FootprintFilterListBox->Clear();
        m_ButtonDeleteAllFootprintFilter->Enable( false );
        m_ButtonDeleteOneFootprintFilter->Enable( false );
        m_buttonEditOneFootprintFilter->Enable( false );
    }
}
void PCB_EDIT_FRAME::Delete_Drawings_All_Layer( LAYER_ID aLayer )
{
    if( IsCopperLayer( aLayer ) )
    {
        DisplayError( this, _( "Copper layer global delete not allowed!" ) );
        return;
    }

    wxString msg = wxString::Format(
        _( "Delete everything on layer %s?" ),
        GetChars( GetBoard()->GetLayerName( aLayer ) ) );

    if( !IsOK( this, msg ) )
        return;

    PICKED_ITEMS_LIST   pickList;
    ITEM_PICKER         picker( NULL, UR_DELETED );
    BOARD_ITEM*         PtNext;

    for( BOARD_ITEM* item = GetBoard()->m_Drawings;  item;  item = PtNext )
    {
        PtNext = item->Next();

        switch( item->Type() )
        {
        case PCB_LINE_T:
        case PCB_TEXT_T:
        case PCB_DIMENSION_T:
        case PCB_TARGET_T:
            if( item->GetLayer() == aLayer )
            {
                item->UnLink();
                picker.SetItem( item );
                pickList.PushItem( picker );
            }

            break;

        default:
        {
            wxString msg;
            msg.Printf( wxT("Delete_Drawings_All_Layer() error: unknown type %d"),
                        item->Type() );
            wxMessageBox( msg );
            break;
        }
        }
    }

    if( pickList.GetCount() )
    {
        OnModify();
        SaveCopyInUndoList(pickList, UR_DELETED);
    }
}
Beispiel #7
0
//_____________________________________________________________________________
Int_t THaTotalShower::Decode( const THaEvData& evdata )
{
  // Decode total shower detector. Calls Decode() of fPreShower and fShower.
  // Return the return value of fShower->Decode().

  if( !IsOK() ) 
    return -1;

  fPreShower->Decode( evdata );
  return fShower->Decode( evdata );
}
void SCH_EDIT_FRAME::OnAppendProject( wxCommandEvent& event )
{
    wxString msg = _( "This operation cannot be undone. "
            "Besides, take into account that hierarchical sheets will not be appended.\n\n"
            "Do you want to save the current document before proceeding?" );

    if( IsOK( this, msg ) )
        OnSaveProject( event );

    AppendOneEEProject();
}
void DIALOG_BOM_EDITOR::OnRevertFieldChanges( wxCommandEvent& event )
{
    if( m_bom->HaveFieldsChanged() )
    {
        if( IsOK( this, _( "Revert all component table changes?" ) ) )
        {
            m_bom->RevertFieldChanges();
            Update();
        }
    }
}
void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
{
    wxFileName fn = GetWksFileName();
    wxString name = GetWksFileName();
    wxString path;

    if( fn.IsAbsolute() )
    {
        path = fn.GetPath();
        name = fn.GetFullName();
    }
    else
    {
        path = m_projectPath;
    }

    // Display a file picker dialog
    wxFileDialog fileDialog( this, _( "Select Page Layout Description File" ),
                             path, name, PageLayoutDescrFileWildcard(),
                             wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );

    if( fileDialog.ShowModal() != wxID_OK )
        return;

    wxString fileName = fileDialog.GetPath();

    // Try to remove the path, if the path is the current working dir,
    // or the dir of kicad.pro (template), and use a relative path
    wxString shortFileName = WORKSHEET_LAYOUT::MakeShortFileName( fileName, m_projectPath );

    // For Win/Linux/macOS compatibility, a relative path is a good idea
    if( shortFileName != GetWksFileName() && shortFileName != fileName )
    {
        wxString msg = wxString::Format( _(
                "The page layout description file name has changed.\n"
                "Do you want to use the relative path:\n"
                "\"%s\"\n"
                "instead of\n"
                "\"%s\"?" ), GetChars( shortFileName ), GetChars( fileName ) );

        if( !IsOK( this, msg ) )
            shortFileName = fileName;
    }

    SetWksFileName( shortFileName );

    if( m_pagelayout == NULL )
        m_pagelayout = new WORKSHEET_LAYOUT;

    m_pagelayout->SetPageLayout( fileName );

    GetPageLayoutInfoFromDialog();
    UpdatePageLayoutExample();
}
void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event )
{
    wxString netlistFileName = m_NetlistFilenameCtrl->GetValue();
    wxFileName fn = netlistFileName;

    if( !fn.IsOk() )
    {
        wxMessageBox( _("Please, choose a valid netlist file") );
        return;
    }

    if( !fn.FileExists() )
    {
        wxMessageBox( _("The netlist file does not exist") );
        return;
    }

    // Give the user a chance to bail out when making changes from a netlist.
    if( !m_checkDryRun->GetValue() && !m_silentMode
            && !m_parent->GetBoard()->IsEmpty()
            && !IsOK( NULL, _( "The changes made by reading the netlist cannot be undone.  Are you "
                               "sure you want to read the netlist?" ) ) )
        return;

    m_MessageWindow->Clear();
    REPORTER& reporter = m_MessageWindow->Reporter();

    wxBusyCursor busy;

    wxString msg;
    msg.Printf( _( "Reading netlist file \"%s\".\n" ), GetChars( netlistFileName ) );
    reporter.Report( msg, REPORTER::RPT_INFO );

    if( m_Select_By_Timestamp->GetSelection() == 1 )
        msg = _( "Using time stamps to match components and footprints.\n" );
    else
        msg = _( "Using references to match components and footprints.\n" );

    reporter.Report( msg, REPORTER::RPT_INFO );
    m_MessageWindow->SetLazyUpdate( true ); // use a "lazy" update to speed up the creation of the report
    // (The window is not updated for each message)

    m_parent->ReadPcbNetlist( netlistFileName, wxEmptyString, &reporter,
                              m_ChangeExistingFootprintCtrl->GetSelection() == 1,
                              m_DeleteBadTracks->GetSelection() == 1,
                              m_RemoveExtraFootprintsCtrl->GetSelection() == 1,
                              m_Select_By_Timestamp->GetSelection() == 1,
                              m_rbSingleNets->GetSelection() == 1,
                              m_checkDryRun->GetValue() );
    // The creation of the report was made without window update:
    // the full page must be displayed
    m_MessageWindow->Flush();
}
Beispiel #12
0
//_____________________________________________________________________________
Int_t THaTotalShower::FineProcess( TClonesArray& tracks )
{
  // Fine processing. 
  // Call fPreShower->FineProcess() and fShower->FineProcess() in turn.
  // Return return value of fShower->FineProcess().

  if( !IsOK() )
    return -1;

  fPreShower->FineProcess( tracks );
  return fShower->FineProcess( tracks );
}
Beispiel #13
0
bool WinEDA_PcbFrame::Delete_Module(MODULE * module, wxDC * DC)
/**************************************************************/
/*
Commande Delete Module :
	Suppression d'une empreinte
	les pointeurs divers sont mis a jour
*/
{
EDA_BaseStruct * PtBack, *PtNext;
wxString msg;
	/* Si l'empreinte est selectee , on ne peut pas l'effacer ! */
	if ( module == NULL ) return FALSE;

	/* Confirmation de l'effacement */
	module->Display_Infos(this);

	msg << _("Delete Module") << wxT(" ") << module->m_Reference->m_Text
			<< wxT("  (") << _("Value ") << module->m_Value->m_Text
			<< wxT(") ?");
	if( !IsOK(this, msg ) )
	{
		return FALSE;
	}

	m_CurrentScreen->SetModify();

	/* Erase rastnest if needed */
	if(g_Show_Ratsnest) DrawGeneralRatsnest(DC);

	/* Effacement du module a l'ecran */
	if ( DC ) module->Draw(DrawPanel, DC, wxPoint(0,0), GR_XOR);

	/* Suppression du chainage */
	PtBack = module->Pback;
	PtNext = module->Pnext;
	if( PtBack == (EDA_BaseStruct*) m_Pcb )
		{
		m_Pcb->m_Modules = (MODULE*)PtNext;
		}
	else
		{
		PtBack->Pnext = PtNext;
		}
	if(PtNext) PtNext->Pback = PtBack;

	/* Sauvegarde en buffer des undelete */
	SaveItemEfface( module, 1);

	m_Pcb->m_Status_Pcb = 0 ;
	build_liste_pads() ;
	ReCompile_Ratsnest_After_Changes( DC );
	return TRUE;
}
Beispiel #14
0
   void 
   AxisRenderable::renderAxisText()
   {
       for(int i=0;i<3;i++)
       {
           // Project the sphere onto the camera
           Ogre::Real left, right, top, bottom;

           Ogre::Vector3 offPos(0,0,0);
           offPos[i] = mLength;
           Ogre::Vector3 textPos = getWorldPosition() + offPos;
           Ogre::Sphere sphere(textPos,AxisTextSize);

           Ogre::Vector2 mCenterPosSC;
           if (mCamera->projectSphere(sphere, &left, &top, &right, &bottom))
           {
               int iLeft, iTop, iWidth, iHeight;
               mViewport->getActualDimensions(iLeft, iTop, iWidth, iHeight);
               size_t szLeft, szRight, szTop, szBottom;

               szLeft = (size_t)(iLeft + ((left + 1) * 0.5 * iWidth));
               szRight = (size_t)(iLeft + ((right + 1) * 0.5 * iWidth));
               szTop = (size_t)(iTop + ((-top + 1) * 0.5 * iHeight));
               szBottom = (size_t)(iTop + ((-bottom + 1) * 0.5 * iHeight));

               mCenterPosSC.x = ( szLeft + szRight ) / 2;
               mCenterPosSC.y = ( szTop + szBottom ) / 2; 
           }

           int nTop = mCenterPosSC.y  - AxisTextSize/2;
           int nLeft = mCenterPosSC.x  - AxisTextSize/2;
           
           mTextRect[i]->setLeft(nLeft);
           mTextRect[i]->setTop(nTop); 

           mTextRect[i]->setWidth(AxisTextSize);
           mTextRect[i]->setHeight(AxisTextSize);
           mTextRect[i]->setCaption(axisText[i]);

   
       }

       for(int i=0;i<3;i++)
       {
           mTextRect[i]->setParameter("colour_top", "0.5 0.7 0.5");
           mTextRect[i]->setParameter("colour_bottom", "0.5 0.7 0.5");
       }
       if(mAxisGizmoSelAxis != 1 && IsOK())
       {
           mTextRect[mAxisGizmoSelAxis]->setParameter("colour_top", "1 1 1");
           mTextRect[mAxisGizmoSelAxis]->setParameter("colour_bottom", "1 1 1");
       }
   }
Beispiel #15
0
bool CArchiver7ZIP::Extract(LPCTSTR ArcFileName,CConfigManager&,const CConfigExtract& Config,bool bSafeArchive,LPCTSTR OutputDir,CString &strLog)
{
	if(!IsOK()){
		return false;
	}
	if(!bSafeArchive){
		strLog.Format(IDS_ERROR_DANGEROUS_ARCHIVE,ArcFileName);
		return false;
	}

	//出力先移動
	CCurrentDirManager currentDir(OutputDir);

	//===========================
	// DLLに渡すオプションの設定
	//===========================
	TRACE(_T("DLLに渡すオプションの設定\n"));

	CString Param;//コマンドライン パラメータ バッファ

	//解凍パラメータ
	Param+=_T("x ");			//解凍
	if(Config.ForceOverwrite){
		//強制上書き
		Param+=_T("-aoa ");
	}

	Param+=_T("-scsUTF-8 ");	//レスポンスファイルのコードページ指定

	//作業ディレクトリ
	Param+=_T("\"-w");
	Param+=UtilGetTempPath();
	Param+=_T("\" ");

	//アーカイブファイル名指定
	Param+=_T("\"");
	Param+=ArcFileName;
	Param+=_T("\" ");

	ASSERT(!Param.IsEmpty());
	TRACE(_T("ArchiveHandler Commandline Parameter:%s\n"),Param);

	TRACE(_T("ArchiveHandler呼び出し\n"));
	std::vector<BYTE> szLog(LOG_BUFFER_SIZE);
	szLog[0]='\0';
	int Ret=ArchiveHandler(NULL,C2UTF8(Param),(LPSTR)&szLog[0],LOG_BUFFER_SIZE-1);
	CString strTmp;
	UtilToUNICODE(strTmp,&szLog[0],szLog.size()-1,UTILCP_UTF8);
	//strLog=&szLog[0];
	strLog=strTmp;

	return 0==Ret;
}
Beispiel #16
0
void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
    if( GetScreen()->IsModify() )
    {
        if( !IsOK( this, _( "Module Editor: Module modified! Continue?" ) ) )
        {
            Event.Veto(); return;
        }
    }

    SaveSettings();
    Destroy();
}
/*-----------------------------------------------------------------------------
Function Name: Start()
Arugments: void
Returns:   bool, true if we start our thread
Access:    Public
Purpose:   public interface to start the work
Created:   3/4/04 p.faby
Modified:
-------------------------------------------------------------------------------*/
bool WinMXThreadedLauncher::StartLaunch()
{ 
  bool result = false;
  m_currentProcToFix=0;
  m_numberOfProcsLaunched= 0;

  if(IsOK())
  {
    result = StartThread();
  }

  return result;
}
Beispiel #18
0
const wxString &CILSLadderInfo::FindDisplayName
  (const wxString &sLSname) const
{
  if(IsOK() && !m_mapNameToDisplay.size())
  {
    _BuildNameToDisplay();
  }
  std::map<const wxString ,const wxString &>::const_iterator itr =
    m_mapNameToDisplay.find(sLSname);
  const wxString &sRtn = (itr == m_mapNameToDisplay.end())
    ? mainApp::EMPTY_STRING : itr->second;
  return sRtn;
}
Beispiel #19
0
bool CDirList::Traverse(
  const wxString &sDirInput, 
  const wxString &sDirOutput,
  int nFileType)
{
  INITMAP();
  Cleanup();
  if(!nFileType)
  {
    nFileType = FILE_ANY;
  }
  m_nFileType = nFileType;
  if(!wxDir::Exists(sDirInput)) //wxFileName::Mkdir(sDirInput,0755,wxPATH_MKDIR_FULL))
  {
    m_nStatus = DIRLIST_INPUT_NOT_EXIST;
  }
  else if(!wxFileName::Mkdir(sDirOutput,0755,wxPATH_MKDIR_FULL))
  {
    m_nStatus = DIRLIST_OUTPUT_NOT_EXIST;
  }
  else
  {
    wxFileName fnIn(sDirInput);
    wxFileName fnOut(sDirOutput);
    m_sDirInput = fnIn.GetFullPath();
    m_sDirOutput = fnOut.GetFullPath();
    m_sDirSave.Empty();
    m_sDirLoad.Empty();

    // for each input file, remove base input and last dir
    // append to output dir
    nwxFileUtil::EndWithSeparator(&m_sDirOutput);
    nwxFileUtil::NoEndWithSeparator(&m_sDirInput);
    m_sDirInputBase = fnIn.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
    nwxFileUtil::EndWithSeparator(&m_sDirInputBase);
    if(m_parmOsiris.GetTimeStampSubDir())
    {
      CreateFileName(true);
    }
    else
    {
      ClearTimeStamp();
    }
    wxDir dirIn(sDirInput);
    OnDir(sDirInput);
    dirIn.Traverse(*this,wxEmptyString,wxDIR_DIRS);
    m_nStatus = m_vpDir->empty() ? DIRLIST_EMPTY : DIRLIST_OK;
    m_setDirs.clear();
  }
  return IsOK();
};
/* Export data in Pcbnew format
 * remember Pcbnew uses a Y reversed axis, so we must negate all Y coordinates
 */
void GERBVIEW_FRAME::ExportDataInPcbnewFormat( wxCommandEvent& event )
{
    int layercount = 0;

    // Count the Gerber layers which are actually currently used
    for( LAYER_NUM ii = FIRST_LAYER; ii < NB_GERBER_LAYERS; ++ii )
    {
        if( g_GERBER_List[ii] != NULL )
            layercount++;
    }

    if( layercount == 0 )
    {
        DisplayInfoMessage( this,
                            _( "None of the Gerber layers contain any data" ) );
        return;
    }

    wxString        fileName;
    wxString        path = wxGetCwd();;

    wxFileDialog    filedlg( this, _( "Board file name:" ),
                             path, fileName, LegacyPcbFileWildcard,
                             wxFD_SAVE );

    if( filedlg.ShowModal() == wxID_CANCEL )
        return;

    fileName = filedlg.GetPath();

    /* Install a dialog frame to choose the mapping
     * between gerber layers and Pcbnew layers
     */
    LAYERS_MAP_DIALOG* layerdlg = new LAYERS_MAP_DIALOG( this );
    int ok = layerdlg->ShowModal();
    layerdlg->Destroy();

    if( ok != wxID_OK )
        return;

    if( wxFileExists( fileName ) )
    {
        if( !IsOK( this, _( "OK to change the existing file ?" ) ) )
            return;
    }

    GBR_TO_PCB_EXPORTER gbr_exporter( this, fileName );

    gbr_exporter.ExportPcb( layerdlg->GetLayersLookUpTable(),
                            layerdlg->GetCopperLayersCount() );
}
/*
 * Change the number of parts per package.
 */
bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit )
{
    LIB_PART*      part = m_Parent->GetCurPart();

    if( !part || part->GetUnitCount() == MaxUnit || MaxUnit < 1 )
        return false;

    if( MaxUnit < part->GetUnitCount()
        && !IsOK( this, _( "Delete extra parts from component?" ) ) )
        return false;

    part->SetUnitCount( MaxUnit );
    return true;
}
Beispiel #22
0
void WinEDA_GerberFrame::Erase_Zones(wxDC * DC, bool query)
/*********************************************************/
{

	if( query && !IsOK(this, _("Delete zones ?") ) ) return ;

	if( m_Pcb->m_Zone )
		{
		DeleteStructList(m_Pcb->m_Zone);
		m_Pcb->m_Zone = NULL;
		m_Pcb->m_NbSegmZone = 0;
		}
	ScreenPcb->SetModify();
}
Beispiel #23
0
bool WinEDA_App::OnInit(void)
{
wxString FFileName;

	EDA_Appl = this;
	InitEDA_Appl( wxT("gerbview") );

	if(argc > 1) FFileName = MakeFileName(wxEmptyString, argv[1], g_PhotoFilenameExt);

	ScreenPcb = new PCB_SCREEN(NULL, m_GerberFrame, PCB_FRAME);
	ActiveScreen = ScreenPcb;
	GetSettings();
    if ( m_Checker && m_Checker->IsAnotherRunning() )
    {
        if ( ! IsOK(NULL, _("Gerbview is already running, Continue?") ) )
			return false;
    }


	g_DrawBgColor = BLACK;

	m_GerberFrame = new WinEDA_GerberFrame(NULL, this, wxT("GerbView"),
				 wxPoint(0,0), wxSize(600,400) );
	m_GerberFrame->SetTitle(Main_Title);
	ScreenPcb->SetParentFrame(m_GerberFrame);
	m_GerberFrame->m_Pcb = new BOARD(NULL, m_GerberFrame);

	SetTopWindow(m_GerberFrame);
	m_GerberFrame->Show(TRUE);

	m_GerberFrame->m_Pcb = new BOARD(NULL, m_GerberFrame);
	m_GerberFrame->Zoom_Automatique(TRUE);

	/* Load file specified in the command line. */
	if( ! FFileName.IsEmpty() )
	{
		wxString path = wxPathOnly(FFileName);
		wxSetWorkingDirectory(path);
		Read_Config();
		if ( wxFileExists(FFileName) )
		{
			wxClientDC dc(m_GerberFrame->DrawPanel);
			m_GerberFrame->DrawPanel->PrepareGraphicContext(&dc);
			m_GerberFrame->LoadOneGerberFile(FFileName, &dc, FALSE);
		}
	}
	else Read_Config();

	return TRUE;
}
/*
 * Change the number of parts per package.
 */
bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::ChangeNbUnitsPerPackage( int MaxUnit )
{
    LIB_COMPONENT* component = m_Parent->GetComponent();

    if( component == NULL || component->GetPartCount() == MaxUnit || MaxUnit < 1 )
        return false;

    if( MaxUnit < component->GetPartCount()
        && !IsOK( this, _( "Delete extra parts from component?" ) ) )
        return false;

    component->SetPartCount( MaxUnit );
    return true;
}
Beispiel #25
0
bool CVolume::InitNewVolume(const wxString &s)
{
  bool bRtn = false;
  m_bIgnoreReadLock = true;
  if(IsOK() && !IsReadOnly() && Lock())
  {
    CLabSettingsInfo *pInfo = m_lab.GetLabSettingsInfo();
    pInfo->SetNotes("");
    pInfo->SetVolumeName(s);
    bRtn = Save();
    m_bNewVolume = bRtn;
  }
  return bRtn;
}
Beispiel #26
0
void KVSimReader_SMF_asym::ReadFile(){

	while (IsOK()){
		if (ReadHeader()){
			for (Int_t nd=0; nd<nv->GetIntValue("ndes"); nd+=1){
				if (ReadEvent()){
					if (nevt%1000==0) Info("ReadFile","%d evts lus",nevt);
					if (HasToFill()) FillTree();
				}
			}
		}
	}
	
}
Beispiel #27
0
bool WinEDA_App::OnInit(void)
{
wxString FFileName;
	EDA_Appl = this;

	g_DebugLevel = 0;	// Debug level */

	InitEDA_Appl( wxT("eeschema") );

    if ( m_Checker && m_Checker->IsAnotherRunning() )
    {
        if ( ! IsOK(NULL, _("Eeschema is already running, Continue?") ) )
			return false;
    }

	if(argc > 1 ) FFileName = argv[1];

	CreateScreens();

	/* init EESCHEMA */
	GetSettings();			// read current setup
	SeedLayers();

	// Create main frame (schematic frame) :
	SchematicFrame = new WinEDA_SchematicFrame(NULL, this,
					 wxT("EESchema"), wxPoint(0,0), wxSize(600,400) );
	ScreenSch->SetParentFrame(SchematicFrame);
	SchematicFrame->Show(TRUE);
	SetTopWindow(SchematicFrame);

	SchematicFrame->Zoom_Automatique(TRUE);

	/* Load file specified in the command line. */
	if( ! FFileName.IsEmpty() )
	{
		ChangeFileNameExt(FFileName, g_SchExtBuffer);
		wxSetWorkingDirectory( wxPathOnly(FFileName) );
		if ( SchematicFrame->LoadOneEEProject(FFileName, FALSE) <= 0 )
			SchematicFrame->DrawPanel->Refresh(TRUE);	// File not found or error
	}

	else
	{
		Read_Config(wxEmptyString, TRUE); // Read config file ici si pas de fichier a charger
		SchematicFrame->DrawPanel->Refresh(TRUE);
	}

	return TRUE;
}
Beispiel #28
0
void CAhnLab::UpdateAhnLab()
{		
	if ( FALSE == IsOK()) 	return;
	if ( NULL == m_pBasePointer) return;
	if ( g_globalTime < m_NextSendTime )	
		return;

	int nSendCount = 0;
	for (int nIdx = 0; nIdx < MAX_PCS ; nIdx++, m_CheckPcIdx++)	
	{
		playerCharacter_t* pPlayer = NULL;
		if ( m_CheckPcIdx >= MAX_PCS) m_CheckPcIdx = 0;			
		pPlayer =gcpTools->GetPlayerRecordPointer(m_CheckPcIdx);
		if(NULL == pPlayer) continue;
		if(FALSE == gcpTools->isReady(pPlayer)) continue;		

		
		if ( pPlayer->m_AhnLabMsg.MessageSend == TRUE)
			continue;		


		playerCharacter_t::sUserHackAckMsg* Msg = NULL;	
		Msg = &(pPlayer->m_AhnLabMsg);
		if ( NULL == Msg ) return;
		
		memset(Msg->byReqInfo, 0, ANTICPSVRREQLEN);
		memset(Msg->byReqMsg,  0, ANTICPSVRREQLEN);
		memset(Msg->byAckMsg,  0, ANTICPCNTACKLEN);	
		
		DWORD dwRet = _AntiCpSvr_MakeReqMsg(m_pBasePointer, m_dmMemSize, 
			Msg->byReqMsg, Msg->byReqInfo);
		
		if ( dwRet != ERROR_SUCCESS )
			continue;	
		
		GTH_SendMessageAhnLabMessage(pPlayer);
		pPlayer->m_AhnLabMsg.MessageSend = TRUE;
		pPlayer->m_AhnLabMsg.SendTime = g_globalTime;		
		pPlayer->m_AhnLabMsg.SendCount += 1;

		nSendCount++;
		
		if ( nSendCount > PROCESSNUMperFRAME)
			break;
	}	
	
	m_NextSendTime = g_globalTime + SEND_DELAY;	

}
Beispiel #29
0
bool CArchiverUNGCA::Extract(LPCTSTR ArcFileName,CConfigManager&,const CConfigExtract &Config,bool bSafeArchive,LPCTSTR OutputDir,CString &strLog)
{
	if(!IsOK()){
		return false;
	}
	if(!bSafeArchive){
		strLog.Format(IDS_ERROR_DANGEROUS_ARCHIVE,ArcFileName);
		return false;
	}

	//出力先移動
	CCurrentDirManager currentDir(OutputDir);
	//===========================
	// DLLに渡すオプションの設定
	//===========================
	TRACE(_T("DLLに渡すオプションの設定\n"));

	CString Param;//コマンドライン パラメータ バッファ

	//解凍パラメータ
	Param+=
		_T("e ")			//解凍
		_T("-sx1 ")			//進捗ダイアログ表示
	;
	if(Config.ForceOverwrite){
		//強制上書き
		Param+=_T("-yx0 ");
	}else{
		Param+=_T("-yx1 ");
	}

	//アーカイブファイル名指定
	Param+=_T("\"");
	Param+=ArcFileName;
	Param+=_T("\" ");

	ASSERT(!Param.IsEmpty());
	TRACE(_T("ArchiveHandler Commandline Parameter:%s\n"),Param);

	TRACE(_T("ArchiveHandler呼び出し\n"));
	//char szLog[LOG_BUFFER_SIZE]={0};
	std::vector<char> szLog(LOG_BUFFER_SIZE);
	szLog[0]='\0';
	int Ret=ArchiveHandler(NULL,CT2A(Param),&szLog[0],LOG_BUFFER_SIZE-1);
	strLog=&szLog[0];


	return 0==Ret;
}
/**
 * Function AskSaveBoardFileName
 * puts up a wxFileDialog asking for a BOARD filename to save.
 *
 * @param aParent is a wxFrame passed to wxFileDialog.
 * @param aFileName on entry is a probable choice, on return is the
 *  chosen full filename (includes path).
 *
 * @return bool - true if chosen, else false if user aborted.
 */
bool AskSaveBoardFileName( wxWindow* aParent, wxString* aFileName )
{
    wxString    wildcard =  wxGetTranslation( PcbFileWildcard );
    wxFileName  fn = *aFileName;

    fn.SetExt( KiCadPcbFileExtension );

    wxFileDialog dlg( aParent,
            _( "Save Board File As" ),
            fn.GetPath(),
            fn.GetFullName(),
            wildcard,
            wxFD_SAVE
            /* wxFileDialog is not equipped to handle multiple wildcards and
               wxFD_OVERWRITE_PROMPT both together.
               | wxFD_OVERWRITE_PROMPT
            */
            );

    if( dlg.ShowModal() != wxID_OK )
        return false;

    fn = dlg.GetPath();

    // always enforce filename extension, user may not have entered it.
    fn.SetExt( KiCadPcbFileExtension );

    // Since the file overwrite test was removed from wxFileDialog because it doesn't work
    // when multiple wildcards are defined, we have to check it ourselves to prevent an
    // existing board file from silently being over written.
    if( fn.FileExists() )
    {
        wxString ask = wxString::Format( _(
                "The file '%s' already exists.\n\n"
                "Do you want to overwrite it?" ),
                 GetChars( fn.GetFullPath() )
                 );

        if( !IsOK( aParent, ask ) )
        {
            return false;
        }
    }

    *aFileName = fn.GetFullPath();

    return true;
}