コード例 #1
0
void DIALOG_ERC::OnErcCmpClick( wxCommandEvent& event )
{
    wxBusyCursor();
    m_MarkersList->Clear();
    m_MessagesList->Clear();
    wxSafeYield();      // m_MarkersList must be redraw
    wxArrayString messageList;
    TestErc( &messageList );

    for( unsigned ii = 0; ii < messageList.GetCount(); ii++ )
        m_MessagesList->AppendText( messageList[ii] );
}
コード例 #2
0
ファイル: clean.cpp プロジェクト: Th0rN13/kicad-source-mirror
/* Install the cleanup dialog frame to know what should be cleaned
*/
void PCB_EDIT_FRAME::Clean_Pcb()
{
    DIALOG_CLEANING_OPTIONS dlg( this );

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

    wxBusyCursor( dummy );
    TRACKS_CLEANER cleaner( GetBoard() );

    cleaner.CleanupBoard( this, dlg.m_cleanVias, dlg.m_mergeSegments,
                          dlg.m_deleteUnconnectedSegm );
    m_canvas->Refresh( true );
}
コード例 #3
0
ファイル: clean.cpp プロジェクト: barrem/kicad-source-mirror
/* Install the cleanup dialog frame to know what should be cleaned
*/
void PCB_EDIT_FRAME::Clean_Pcb()
{
    DIALOG_CLEANING_OPTIONS dlg( this );

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

    wxBusyCursor( dummy );
    TRACKS_CLEANER cleaner( GetBoard() );
    cleaner.SetdeleteUnconnectedTracksOpt( dlg.m_deleteUnconnectedSegm );
    cleaner.SetMergeSegmentsOpt( dlg.m_mergeSegments );
    cleaner.SetCleanViasOpt( dlg.m_cleanVias );

    if( cleaner.CleanupBoard() )
    {
        // Clear undo and redo lists to avoid inconsistencies between lists
        GetScreen()->ClearUndoRedoList();
        SetCurItem( NULL );
        Compile_Ratsnest( NULL, true );
        OnModify();
    }

    m_canvas->Refresh( true );
}
コード例 #4
0
// Get the annotation list
CAnnotationList* AnnotateDialog::GetAnnotationList(wxWindow* parent)
{
    TDEBUG_ENTER("GetAnnotationList");
    wxBusyCursor();

   // We do not want any progress dialog here
   CVSAction glue(parent);
   glue.SetCloseIfOK(true);
   glue.SetHideStdout();
   wxString title = Printf(_("Annotate %s"), wxText(myFilename).c_str());
   glue.SetProgressCaption(title);

   MakeArgs args;
   args.add_option("annotate");
   // Avoid truncating user names
   args.add_option("-w");
   args.add_option("30");       // Ought to be enough
   // If revision is given, specify it
   if (!myRevision.empty())
   {
      args.add_option("-r");
      args.add_option(myRevision);
   }
   // If we are working on a branch, specify the branch using -r
   else if (CVSStatus::HasStickyTag(myFilename))
   {
      args.add_option("-r");
      args.add_option(CVSStatus::GetStickyTag(myFilename));
   }
   args.add_arg(ExtractLastPart(myFilename));
   bool ok = glue.Command(StripLastPart(myFilename), args);
   if (!ok)
   {
      return 0;
   }
   
   std::string out = glue.GetOutputText();
#if 0
   // Debugging
   std::ifstream in("C:\\cvs-log-output.txt");
   out.clear();
   while (true)
   {
      std::string line;
      std::getline(in, line);
      if (line.empty() && in.eof())
         break;
      out += line;
      out += "\n";
   }
   in.close();
#endif
   FindAndReplace<std::string>(out, "\r\n", "\n");

   if (out.empty())
   {
      wxString s(_("This file is new and has never been committed to the server or is an empty file on the server."));
      s += wxT("\n\n");
      s += wxText(myFilename);
      DoMessageDialog(0, s);
      return 0;
   }

   CAnnotationList* annotationList = new CAnnotationList();

   std::stringstream ifs(out.c_str());

   // Parsing the annotations
   while (true)
   {
      std::string line;
      if (!std::getline(ifs, line) && line.empty())
         break;

      // We need to skip any text which comes before the actual annotations.  A valid
      // annotation starts with the revision number, so we do a simple check to see if
      // the first character is a digit.  This may need to be revised if this assumption
      // is not valid.
      if (!isdigit(line[0]))
         continue;

      annotationList->AddAnnotation(line);
   }
   return annotationList;
}