创建工程:
KICAD_MANAGER_ACTIONS::newProject
KICAD_MANAGER_ACTIONS::openProject
newProject和OpenProject事件响应具体实现,在KICAD_MANAGER_CONTROL类中实现:
Go( &KICAD_MANAGER_CONTROL::NewProject, KICAD_MANAGER_ACTIONS::newProject.MakeEvent() );
KICAD_MANAGER_CONTROL::NewProject中的具体实现中调用了KICAD_MANAGER_FRAME的CreateNewProject和LoadProject。
KICAD_MANAGER_FRAME* m_frame;
m_frame->CreateNewProject( pro );
m_frame->LoadProject( pro );
ProjectTree页面创建
创建ProjectTree在kiaca/kicad_manager_frame.cpp中是实现,
m_leftWin = new PROJECT_TREE_PANE( this );
void PROJECT_TREE_PANE::ReCreateTreePrj()
void PROJECT_TREE_PANE::onRight( wxTreeEvent& Event )
void BTDABS_MANAGER_FRAME::CreateSchFile(const wxFileName& aProjectFileName)
{
wxFileName fn( aProjectFileName.GetFullPath() );
fn.SetExt( BTDSchematicFileExtension );
// If a <project>.btd_sch file does not exist, create a "stub" file ( minimal schematic
// file ).
if( !fn.FileExists() )
{
wxFFile file( fn.GetFullPath(), "wb" );
if( file.IsOpened() )
file.Write( wxString::Format( "(btd_sch (version %d) (generator eeschema)n"
" (paper "A4")n (lib_symbols)n"
" (symbol_instances)n)n",
SEXPR_SCHEMATIC_FILE_VERSION ) );
// wxFFile dtor will close the file
}
}
int KICAD_MANAGER_CONTROL::CreateSch( const TOOL_EVENT& aEvent )
{
auto fileName = Prj().GetProjectFullName();
if(false == fileName.IsEmpty())
{
m_frame->CreateSchFile(fileName);
}
return 0;
}
FlowManager
/kicad/FLOW_MANAGER_MODEL类:
void FLOW_MANAGER_MODEL::RebuildFlow()
{
CreateFlowNode( wxID_ANY, _("Create"), "", false, parentNode, &KICAD_MANAGER_ACTIONS::createSch );
KICAD_MANAGER_ACTIONS::createSch
Go( &KICAD_MANAGER_CONTROL::CreateSch, KICAD_MANAGER_ACTIONS::createSch.MakeEvent() );
wxString absWorkDir;
wxFileName dirName( absWorkDir + wxFileName::GetPathSeparator());
if( !dirName.DirExists() )
{
if( !dirName.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL | wxPATH_RMDIR_RECURSIVE ) )
{
wxLogMessage( "Failed to create directory: %s", absWorkDir );
return "";
}
}
原文地址:https://blog.csdn.net/haimianjie2012/article/details/134782819
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_43338.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。