void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap )
{
    UpdateConfig();     // set params and Save drill options

    m_parent->ClearMsgPanel();
    wxString defaultPath = Prj().AbsolutePath( m_plotOpts.GetOutputDirectory() );
    WX_TEXT_CTRL_REPORTER reporter( m_messagesBox );

    const PlotFormat filefmt[6] =
    {   // Keep these format ids in the same order than m_Choice_Drill_Map choices
        PLOT_FORMAT_HPGL, PLOT_FORMAT_POST, PLOT_FORMAT_GERBER,
        PLOT_FORMAT_DXF, PLOT_FORMAT_SVG, PLOT_FORMAT_PDF
    };

    unsigned choice = (unsigned) m_Choice_Drill_Map->GetSelection();

    if( choice >= DIM( filefmt ) )
        choice = 1;

    EXCELLON_WRITER excellonWriter( m_parent->GetBoard() );
    excellonWriter.SetFormat( !m_UnitDrillIsInch, (EXCELLON_WRITER::ZEROS_FMT) m_ZerosFormat,
                              m_Precision.m_lhs, m_Precision.m_rhs );
    excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset, m_Merge_PTH_NPTH );
    excellonWriter.SetMapFileFormat( filefmt[choice] );

    excellonWriter.CreateDrillandMapFilesSet( defaultPath, aGenDrill, aGenMap, &reporter );
}
예제 #2
0
파일: config.c 프로젝트: VCCE/VCC
void LoadConfig(SystemState *LCState)
{
	HANDLE hr=NULL;

	buildTransDisp2ScanTable();

	LoadString(NULL, IDS_APP_TITLE,AppName, MAX_LOADSTRING);
	GetModuleFileName(NULL,ExecDirectory,MAX_PATH);
	PathRemoveFileSpec(ExecDirectory);
	strcpy(CurrentConfig.PathtoExe,ExecDirectory);
	strcpy(IniFilePath,ExecDirectory);
	strcat(IniFilePath,"\\");
	strcat(IniFilePath,IniFileName);
	LCState->ScanLines=0;
	NumberOfSoundCards=GetSoundCardList(SoundCards);
	ReadIniFile();
	CurrentConfig.RebootNow=0;
	UpdateConfig();
	RefreshJoystickStatus();
	SoundInit(EmuState.WindowHandle,SoundCards[CurrentConfig.SndOutDev].Guid,CurrentConfig.AudioRate);
	hr=CreateFile(IniFilePath,NULL,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
	if (hr==INVALID_HANDLE_VALUE) //No Ini File go create it
		WriteIniFile();
	else
		CloseHandle(hr);
}
//-----------------------------------------------------------------------------
//! Set the table data for display
//-----------------------------------------------------------------------------
void tHeelCorrectionGraphicWidget::SetData( tBandGCalibrationTable* pTableData, int currentRow )
{
    m_pTableData = pTableData;
    m_CurrentRow = currentRow;

    m_TableDataSet = true;
    UpdateConfig();

    // Start the update timer to update the graph after a time
    m_pUpdateTimer->start();
}
예제 #4
0
void CInputStream::CheckConfig()
{
    bool hasConfig = false;

    {
        CSingleLock lock(m_parentSection);
        auto it = m_configMap.find(ID());
        hasConfig = it != m_configMap.end();
    }

    if (!m_bIsChild && !hasConfig)
        UpdateConfig();
}
예제 #5
0
void CSnapperOptions::OnBnClickedUpdate()
{
	UpdateData(TRUE);
	m_bUpdateHotlists = TRUE;
	UpdateData(FALSE);

	// if we've enabled shortcuts then warn the user it may take a while...
	if (m_bIncludeShares)
		MessageBox(_T("This may take a minute if any shortcuts point to inaccessible folders/sections."), _T("Starting Update"));

	// update the folder/section lists, following network paths.
	UpdateConfig(TRUE);
	// just in case we've loaded a new config file...
	InitDialog();
	UpdateData(FALSE);
	MessageBox(_T("Folder/section lists updated to match Notebook."), _T("Updated!"));
}
예제 #6
0
CInputStream::CInputStream(AddonProps props, std::string name, std::string listitemprops, std::string extensions)
: InputStreamDll(std::move(props))
{
  m_fileItemProps = StringUtils::Tokenize(listitemprops, "|");
  for (auto &key : m_fileItemProps)
  {
    StringUtils::Trim(key);
    key = name + "." + key;
  }

  m_extensionsList = StringUtils::Tokenize(extensions, "|");
  for (auto &ext : m_extensionsList)
  {
    StringUtils::Trim(ext);
  }

  if (!m_bIsChild && !m_hasConfig)
    UpdateConfig();
}
예제 #7
0
void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event )
{
    UpdateConfig(); // set params and Save drill options

    wxFileName fn = m_parent->GetBoard()->GetFileName();

    fn.SetName( fn.GetName() + wxT( "-drl" ) );
    fn.SetExt( ReportFileExtension );

    wxString defaultPath = m_plotOpts.GetOutputDirectory();

    if( defaultPath.IsEmpty() )
        defaultPath = ::wxGetCwd();

    wxFileDialog dlg( this, _( "Save Drill Report File" ), defaultPath,
                      fn.GetFullName(), wxGetTranslation( ReportFileWildcard ),
                      wxFD_SAVE );

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

    EXCELLON_WRITER excellonWriter( m_parent->GetBoard(),
                                    m_FileDrillOffset );
    excellonWriter.SetFormat( !m_UnitDrillIsInch,
                              (EXCELLON_WRITER::zeros_fmt) m_ZerosFormat,
                              m_Precision.m_lhs, m_Precision.m_rhs );
    excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset, m_Merge_PTH_NPTH );

    bool success = excellonWriter.GenDrillReportFile( dlg.GetPath() );

    wxString   msg;

    if( ! success )
    {
        msg.Printf(  _( "** Unable to create %s **\n" ), GetChars( dlg.GetPath() ) );
        m_messagesBox->AppendText( msg );
    }
    else
    {
        msg.Printf( _( "Report file %s created\n" ), GetChars( dlg.GetPath() ) );
        m_messagesBox->AppendText( msg );
    }
}
예제 #8
0
LyricManager::LyricManager() : m_Seconds(0)
{
	static_api_ptr_t<play_callback_manager> pcm;
	pcm->register_callback(this, flag_on_playback_all, false);

	// Initialize lyric source
	std::vector<GUID> enabledsources = cfg_enabledlyricsource.get_value();
	for(std::vector<GUID>::iterator it = enabledsources.begin(); it != enabledsources.end(); it ++)
	{
		boost::shared_ptr<LyricSource> src = LyricSourceManager::Get(*it);
		if(src)
		{
			src->SetConfig(cfg_lyricsourcecfg.get_value(*it));
			m_lyricSources.push_back(src);
		}
	}

	std::vector<GUID> savesources = cfg_enabledlyricsave.get_value();
	for(std::vector<GUID>::iterator it = savesources.begin(); it != savesources.end(); it ++)
	{
		boost::shared_ptr<LyricSource> src = LyricSourceManager::Get(*it);
		if(src)
		{
			src->SetConfig(cfg_lyricsourcecfg.get_value(*it));
			m_lyricSaveSources.push_back(src);
		}
	}

	if(m_lyricSources.empty())
	{
		//default
		std::vector<boost::shared_ptr<LyricSource> > list = LyricSourceManager::List();
		for(std::vector<boost::shared_ptr<LyricSource> >::iterator it = list.begin(); it != list.end(); it ++)
			if((*it)->GetName() == "Alsong Lyric")
				cfg_enabledlyricsource.add((*it)->GetGUID());
		UpdateConfig();
	}
}
예제 #9
0
void CInputStream::SaveSettings()
{
  CAddon::SaveSettings();
  if (!m_bIsChild)
    UpdateConfig();
}
DIALOG_GENDRILL::~DIALOG_GENDRILL()
{
    UpdateConfig();
}
void DIALOG_GENDRILL::OnCancelClick( wxCommandEvent& event )
{
    UpdateConfig();                 // Save drill options:
    EndModal( wxID_CANCEL );        // Process the default cancel event (close dialog)
}
예제 #12
0
void CSnapperOptions::OnBnClickedApply()
{
	UpdateConfig();
	InitDialog();
	UpdateData(FALSE);
}
예제 #13
0
void CSnapperOptions::OnBnClickedOk()
{
	UpdateConfig();
	OnOK();
}
예제 #14
0
MouseHandling::MouseHandling(Config* pConfig)
: m_nMouseX(SCREEN_WIDTH/2), m_nMouseY(SCREEN_HEIGHT/2), m_nMouseCenterX(-1), m_nMouseCenterY(-1), m_eMouseButton(NoButton), m_eCurrentButton(NoButton)
{
   UpdateConfig(pConfig);
}
예제 #15
0
/**
 * Function GenDrillAndMapFiles
 * Calls the functions to create EXCELLON drill files and/or drill map files
 * >When all holes are through holes, only one excellon file is created.
 * >When there are some partial holes (some blind or buried vias),
 *  one excellon file is created, for all plated through holes,
 *  and one file per layer pair, which have one or more holes, excluding
 *  through holes, already in the first file.
 *  one file for all Not Plated through holes
 */
void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
{
    wxString   layer_extend;              /* added to the  Board FileName to
                                           * create FullFileName (= Board
                                           * FileName + layer pair names) */
    wxString   msg;
    bool       hasBuriedVias = false;  /* If true, drill files are created
                                        * layer pair by layer pair for
                                        * buried vias */
    int        layer1 = LAYER_N_BACK;
    int        layer2 = LAYER_N_FRONT;
    bool       gen_through_holes = true;
    bool       gen_NPTH_holes    = false;

    wxString   currentWD = ::wxGetCwd();

    UpdateConfig(); // set params and Save drill options

    m_parent->ClearMsgPanel();

    if( m_microViasCount || m_blindOrBuriedViasCount )
        hasBuriedVias = true;

    EXCELLON_WRITER excellonWriter( m_parent->GetBoard(),
                                    m_FileDrillOffset );
    excellonWriter.SetFormat( !m_UnitDrillIsInch,
                              (EXCELLON_WRITER::zeros_fmt) m_ZerosFormat,
                              m_Precision.m_lhs, m_Precision.m_rhs );
    excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset );

    wxFileName fn;

    for( ; ; )
    {
        excellonWriter.BuildHolesList( layer1, layer2,
                          gen_through_holes ? false : true, gen_NPTH_holes );

        if( excellonWriter.GetHolesCount() > 0 ) // has holes?
        {
            fn = m_parent->GetBoard()->GetFileName();
            layer_extend.Empty();

            if( gen_NPTH_holes )
            {
                layer_extend << wxT( "-NPTH" );
            }
            else if( !gen_through_holes )
            {
                if( layer1 == LAYER_N_BACK )
                    layer_extend << wxT( "-back" );
                else
                    layer_extend << wxT( "-inner" ) << layer1;
                if( layer2 == LAYER_N_FRONT )
                    layer_extend << wxT( "-front" );
                else
                    layer_extend << wxT( "-inner" ) << layer2;
            }

            fn.SetName( fn.GetName() + layer_extend );
            wxString defaultPath = m_plotOpts.GetOutputDirectory();
            if( defaultPath.IsEmpty() )
                defaultPath = ::wxGetCwd();

            fn.SetPath( defaultPath );

            if( aGenDrill )
            {
                fn.SetExt( DrillFileExtension );
                wxString fullFilename = fn.GetFullPath();

                FILE* file = wxFopen( fullFilename, wxT( "w" ) );

                if( file == 0 )
                {
                    msg.Printf( _( "** Unable to create %s **\n" ),
                                GetChars( fullFilename ) );
                    m_messagesBox->AppendText( msg );
                    break;
                }
                else
                {
                    msg.Printf( _( "Plot: %s OK\n" ), GetChars( fullFilename ) );
                    m_messagesBox->AppendText( msg );
                }

                excellonWriter.CreateDrillFile( file );
            }

            if( aGenMap )
            {
                const PlotFormat filefmt[6] =
                {   // Keep these format ids in the same order than m_Choice_Drill_Map choices
                    PLOT_FORMAT_HPGL, PLOT_FORMAT_POST, PLOT_FORMAT_GERBER,
                    PLOT_FORMAT_DXF, PLOT_FORMAT_SVG, PLOT_FORMAT_PDF
                };
                unsigned choice = (unsigned) m_Choice_Drill_Map->GetSelection();

                if( choice >= m_Choice_Drill_Map->GetCount() )
                    choice = 1;

                fn.SetExt( wxEmptyString ); // Will be modified by GenDrillMap

                GenDrillMap( fn.GetFullPath(), excellonWriter, filefmt[choice] );
            }
        }

        if( gen_NPTH_holes )    // The last drill file was created
            break;

        if( !hasBuriedVias )
            gen_NPTH_holes = true;
        else
        {
            if(  gen_through_holes )
                layer2 = layer1 + 1;    // prepare generation of first layer pair
            else
            {
                if( layer2 >= LAYER_N_FRONT )    // no more layer pair to consider
                {
                    layer1 = LAYER_N_BACK;
                    layer2 = LAYER_N_FRONT;
                    gen_NPTH_holes = true;
                    continue;
                }
                layer1++;
                layer2++;                      // use next layer pair

                if( layer2 == m_parent->GetBoard()->GetCopperLayerCount() - 1 )
                    layer2 = LAYER_N_FRONT;         // the last layer is always the
                                                    // Front layer
            }

            gen_through_holes = false;
        }
    }

    ::wxSetWorkingDirectory( currentWD );
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tHeelCorrectionGraphicWidget::resizeEvent( QResizeEvent* pEvent )
{
    QWidget::resizeEvent( pEvent );
    UpdateConfig();
}