Пример #1
0
//------------------------------------------------------------------------------
void OutputTree::OnCompareNumericValues(wxCommandEvent &event)
{
   //MessageInterface::ShowMessage("OutputTree::OnCompareNumericValues() entered\n");

   ReportFile *theReport =
      (ReportFile*) theGuiInterpreter->GetConfiguredObject(theSubscriberName.c_str());

   if (!theReport)
   {
      MessageInterface::ShowMessage
         (wxT("OutputTree::OnCompareNumericValues() The ReportFile: %s is NULL.\n"),
          theSubscriberName.c_str());
      return;
   }
   
   wxString filename1 = theReport->GetPathAndFileName();
   StringArray colTitles = theReport->GetRefObjectNameArray(Gmat::PARAMETER);
   wxString filename2 =
      wxFileSelector(wxT("Choose a file to open"), wxT(""), wxT(""), wxT("report"),
                     wxT("Report files (*.report)|*.report|")
                     wxT("Text files (*.txt)|*.txt|All files (*.*)|*.*"));
   
   if (filename2.empty())
      return;
   
   Real tol = GmatFileUtil::CompareAbsTol;
   wxString tolStr;
   tolStr.Printf(wxT("%e"), tol);
   tolStr = wxGetTextFromUser(wxT("Enter absolute tolerance to be used in flagging: "),
                              wxT("Tolerance"), tolStr, this);
   
   if (!tolStr.ToDouble(&tol))
   {
      wxMessageBox(wxT("Entered Invalid Tolerance"), wxT("Error"), wxOK, this);
      return;
   }
   
   StringArray output =
      GmatFileUtil::Compare(filename1.c_str(), filename2.c_str(), colTitles, tol);
   
   ViewTextFrame *compWindow = GmatAppData::Instance()->GetCompareWindow();
   if (compWindow == NULL)
   {
      compWindow = 
         new ViewTextFrame(GmatAppData::Instance()->GetMainFrame(),
                           wxT("Compare Utility"), 50, 50, 800, 500, wxT("Permanent"));
      GmatAppData::Instance()->SetCompareWindow(compWindow);
      wxString msg;
      msg.Printf(wxT("GMAT Build Date: %s %s\n\n"),  __DATE__, __TIME__);  
      compWindow->AppendText(msg);
   }
   
   compWindow->Show(true);
   
   for (unsigned int i=0; i<output.size(); i++)
      compWindow->AppendText(wxString(output[i].c_str()));
}
Пример #2
0
//------------------------------------------------------------------------------
void OutputTree::OnCompareTextLines(wxCommandEvent &event)
{
   #ifdef DEBUG_COMPARE
   MessageInterface::ShowMessage("OutputTree::OnCompareTextLines() entered\n");
   #endif
   
   ReportFile *theReport =
      (ReportFile*) theGuiInterpreter->GetConfiguredObject(theSubscriberName.c_str());
   
   if (!theReport)
   {
      MessageInterface::ShowMessage
         ("OutputTree::OnCompareTextLines() The ReportFile: %s is NULL.\n",
          theSubscriberName.WX_TO_C_STRING);
      return;
   }
   
   std::string basefilename = theReport->GetFullPathFileName();
   StringArray colTitles = theReport->GetRefObjectNameArray(Gmat::PARAMETER);
   wxString filename1 =
      wxFileSelector("Choose a file to open", "", "", "report",
                     "Report files (*.report)|*.report|"
                     "Text files (*.txt)|*.txt|"
                     "Text ephemeris files (*.eph)|*.eph|"
                     "All files (*.*)|*.*");
   
   if (filename1.empty())
      return;
   
   int file1DiffCount = 0;
   int file2DiffCount = 0;
   int file3DiffCount = 0;
   
   StringArray output =
      GmatFileUtil::CompareTextLines(1, basefilename.c_str(), filename1.c_str(), "", "",
                                 file1DiffCount, file2DiffCount, file3DiffCount);
   
   ViewTextFrame *compWindow = GmatAppData::Instance()->GetCompareWindow();
   if (compWindow == NULL)
   {
      compWindow =
         new ViewTextFrame(GmatAppData::Instance()->GetMainFrame(),
                           _T("Compare Utility"), 50, 50, 800, 500, "Permanent");
      GmatAppData::Instance()->SetCompareWindow(compWindow);
      wxString msg;
      msg.Printf(_T("GMAT Build Date: %s %s\n\n"),  __DATE__, __TIME__);      
      compWindow->AppendText(msg);
   }
   
   compWindow->Show(true);
   
   for (unsigned int i=0; i<output.size(); i++)
      compWindow->AppendText(wxString(output[i].c_str()));
}
Пример #3
0
//------------------------------------------------------------------------------
void OutputTree::OnCompareTextLines(wxCommandEvent &event)
{
   //MessageInterface::ShowMessage("OutputTree::OnCompareTextLines() entered\n");

   ReportFile *theReport =
      (ReportFile*) theGuiInterpreter->GetConfiguredObject(theSubscriberName.c_str());
   
   if (!theReport)
   {
      MessageInterface::ShowMessage
         (wxT("OutputTree::OnCompareTextLines() The ReportFile: %s is NULL.\n"),
          theSubscriberName.c_str());
      return;
   }
   
   wxString filename1 = theReport->GetPathAndFileName();
   StringArray colTitles = theReport->GetRefObjectNameArray(Gmat::PARAMETER);
   wxString filename2 =
      wxFileSelector(wxT("Choose a file to open"), wxT(""), wxT(""), wxT("report"),
                     wxT("Report files (*.report)|*.report|")
                     wxT("Text files (*.txt)|*.txt|All files (*.*)|*.*"));
   
   if (filename2.empty())
      return;
   
   int file1DiffCount = 0;
   int file2DiffCount = 0;
   int file3DiffCount = 0;
   
   StringArray output =
      GmatFileUtil::CompareLines(1, filename1.c_str(), filename2.c_str(), wxT(""), wxT(""),
                                 file1DiffCount, file2DiffCount, file3DiffCount);
   
   ViewTextFrame *compWindow = GmatAppData::Instance()->GetCompareWindow();
   if (compWindow == NULL)
   {
      compWindow =
         new ViewTextFrame(GmatAppData::Instance()->GetMainFrame(),
                           wxT("Compare Utility"), 50, 50, 800, 500, wxT("Permanent"));
      GmatAppData::Instance()->SetCompareWindow(compWindow);
      wxString msg;
      msg.Printf(wxT("GMAT Build Date: %s %s\n\n"),  __DATE__, __TIME__);      
      compWindow->AppendText(msg);
   }
   
   compWindow->Show(true);
   
   for (unsigned int i=0; i<output.size(); i++)
      compWindow->AppendText(wxString(output[i].c_str()));
}
Пример #4
0
//------------------------------------------------------------------------------
void OutputTree::OnCompareNumericColumns(wxCommandEvent &event)
{
   #ifdef DEBUG_COMPARE
   MessageInterface::ShowMessage("OutputTree::OnCompareNumericColumns() entered\n");
   #endif
   
   ReportFile *theReport =
      (ReportFile*) theGuiInterpreter->GetConfiguredObject(theSubscriberName.c_str());
   
   if (!theReport)
   {
      MessageInterface::ShowMessage
         ("OutputTree::OnCompareNumericColumns() The ReportFile: %s is NULL.\n",
          theSubscriberName.WX_TO_C_STRING);
      return;
   }
   
   std::string basefilename = theReport->GetFullPathFileName();
   StringArray colTitles = theReport->GetRefObjectNameArray(Gmat::PARAMETER);
   wxString filename1 =
      wxFileSelector("Choose a file to open", "", "", "report|eph|txt",
                     "Report files (*.report)|*.report|"
                     "Text files (*.txt)|*.txt|"
                     "Text ephemeris files (*.eph)|*.eph|"
                     "All files (*.*)|*.*");
   
   if (filename1.empty())
      return;
   
   Real tol = GmatFileUtil::COMPARE_TOLERANCE;
   wxString tolStr;
   tolStr.Printf("%e", tol);
   tolStr = wxGetTextFromUser("Enter absolute tolerance to be used in flagging: ",
                              "Tolerance", tolStr, this);
   
   if (!tolStr.ToDouble(&tol))
   {
      wxMessageBox("Entered Invalid Tolerance", "Error", wxOK, this);
      return;
   }
    
   StringArray output =
      GmatFileUtil::CompareNumericColumns(1, basefilename.c_str(), filename1.c_str(), "", "",
                                          tol);
   
   ViewTextFrame *compWindow = GmatAppData::Instance()->GetCompareWindow();
   if (compWindow == NULL)
   {
      compWindow = 
         new ViewTextFrame(GmatAppData::Instance()->GetMainFrame(),
                           _T("Compare Utility"), 50, 50, 800, 500, "Permanent");
      GmatAppData::Instance()->SetCompareWindow(compWindow);
      wxString msg;
      msg.Printf(_T("GMAT Build Date: %s %s\n\n"),  __DATE__, __TIME__);  
      compWindow->AppendText(msg);
   }
   
   compWindow->Show(true);
   
   for (unsigned int i=0; i<output.size(); i++)
   {
      compWindow->AppendText(wxString(output[i].c_str()));
      MessageInterface::ShowMessage(output[i].c_str());
   }
}