コード例 #1
0
ファイル: OutputTree.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
void OutputTree::UpdateOutput(bool resetTree, bool removeReports, bool removePlots)
{
   #if DEBUG_OUTPUT_TREE
   MessageInterface::ShowMessage
      ("OutputTree::UpdateOutput() resetTree=%d, removeReports=%d, removePlots=%d\n",
       resetTree, removeReports, removePlots);
   #endif
   
   // Collapse all reports. Consider ephemeris file as a report
   if (removeReports)
   {
      Collapse(mReportItem);
      Collapse(mEphemFileItem);
      if (GmatGlobal::Instance()->IsEventLocationAvailable())
         Collapse(mEventsItem);
   }
   
   // Remove all plots
   if (removePlots)
   {
      Collapse(mOrbitViewItem);
      Collapse(mGroundTrackItem);
      Collapse(mXyPlotItem);
   }
   
   // Delete all reports. Consider ephemeris file as a report
   if (removeReports)
   {
      DeleteChildren(mReportItem);
      DeleteChildren(mEphemFileItem);
      if (GmatGlobal::Instance()->IsEventLocationAvailable())
         DeleteChildren(mEventsItem);
   }
   
   // Delete all plots
   if (removePlots)
   {
      DeleteChildren(mOrbitViewItem);
      DeleteChildren(mGroundTrackItem);
      DeleteChildren(mXyPlotItem);
   }
   
   if (resetTree)    // do not load subscribers
      return;
   
   // get list of report files, ephemeris files, opengl plots, and xy plots
   StringArray listOfSubs = theGuiInterpreter->GetListOfObjects(Gmat::SUBSCRIBER);
   
   // put each subscriber in the proper folder
   for (unsigned int i=0; i<listOfSubs.size(); i++)
   {
      Subscriber *sub =
         (Subscriber*)theGuiInterpreter->GetConfiguredObject(listOfSubs[i]);
      
      wxString objName = wxString(listOfSubs[i].c_str());
      wxString objTypeName = wxString(sub->GetTypeName().c_str());
      objTypeName = objTypeName.Trim();
      
      if (objTypeName == "ReportFile")
      {
         AppendItem(mReportItem, objName, GmatTree::OUTPUT_ICON_REPORT_FILE, -1,
                    new GmatTreeItemData(objName, GmatTree::OUTPUT_REPORT));
      }
      // Removed checking for write ephemeris flag sice ephemeris file can be
      // toggled on after it is intially toggled off (LOJ: 2013.03.20)
      else if (objTypeName == "EphemerisFile")
         //&& sub->GetBooleanParameter("WriteEphemeris"))
      {
         if (sub->GetStringParameter("FileFormat") == "CCSDS-OEM")
         {
            AppendItem(mEphemFileItem, objName, GmatTree::OUTPUT_ICON_CCSDS_OEM_FILE, -1,
                       new GmatTreeItemData(objName, GmatTree::OUTPUT_CCSDS_OEM_FILE));
         }
      }
      else if (objTypeName == "OrbitView" &&
               sub->GetBooleanParameter("ShowPlot"))
      {
         AppendItem(mOrbitViewItem, objName, GmatTree::OUTPUT_ICON_ORBIT_VIEW, -1,
                    new GmatTreeItemData(objName, GmatTree::OUTPUT_ORBIT_VIEW));
      }
      else if (objTypeName == "GroundTrackPlot" &&
               sub->GetBooleanParameter("ShowPlot"))
      {
         AppendItem(mGroundTrackItem, objName, GmatTree::OUTPUT_ICON_GROUND_TRACK_PLOT, -1,
                    new GmatTreeItemData(objName, GmatTree::OUTPUT_GROUND_TRACK_PLOT));
      }
      else if (objTypeName == "XYPlot" &&
               sub->GetBooleanParameter("ShowPlot"))
      {
         AppendItem(mXyPlotItem, objName, GmatTree::OUTPUT_ICON_XY_PLOT, -1,
                    new GmatTreeItemData(objName, GmatTree::OUTPUT_XY_PLOT));
      }
   }

   // get list of Event Locators
   if (GmatGlobal::Instance()->IsEventLocationAvailable())
   {
      StringArray listOfEls = theGuiInterpreter->GetListOfObjects(Gmat::EVENT_LOCATOR);
      for (UnsignedInt i = 0; i < listOfEls.size(); ++i)
      {
         EventLocator *el =
            (EventLocator*)theGuiInterpreter->GetConfiguredObject(listOfEls[i]);
         if (el != NULL)
         {
            wxString objName = wxString(listOfEls[i].c_str());
            AppendItem(mEventsItem, objName, GmatTree::OUTPUT_ICON_REPORT_FILE, -1,
                  new GmatTreeItemData(objName, GmatTree::OUTPUT_EVENT_REPORT));
         }
      }
   }

   Expand(mReportItem);
   Expand(mEphemFileItem);
   Expand(mOrbitViewItem);
   Expand(mGroundTrackItem);
   Expand(mXyPlotItem);
   if (GmatGlobal::Instance()->IsEventLocationAvailable())
      Expand(mEventsItem);
}
コード例 #2
0
//------------------------------------------------------------------------------
void OutputTree::UpdateOutput(bool resetTree, bool removeReports)
{
   #if DEBUG_OUTPUT_TREE
   MessageInterface::ShowMessage
      (wxT("OutputTree::UpdateOutput() resetTree=%d\n"), resetTree);
   #endif
   
   if (removeReports)
   {
      Collapse(mReportItem);
      Collapse(mEventsItem);
   }
   Collapse(mOpenGlItem);
   Collapse(mXyPlotItem);
   
   // delete all old children
   if (removeReports)
   {
      DeleteChildren(mReportItem);
      DeleteChildren(mEventsItem);
   }
   DeleteChildren(mOpenGlItem);
   DeleteChildren(mXyPlotItem);
   
   if (resetTree)    // do not load subscribers
      return;
   
   // get list of report files, opengl plots, and xy plots
   StringArray listOfSubs = theGuiInterpreter->GetListOfObjects(Gmat::SUBSCRIBER);
   
   // put each subscriber in the proper folder
   for (unsigned int i=0; i<listOfSubs.size(); i++)
   {
      Subscriber *sub =
         (Subscriber*)theGuiInterpreter->GetConfiguredObject(listOfSubs[i]);
      
      wxString objName = wxString(listOfSubs[i].c_str());
      wxString objTypeName = wxString(sub->GetTypeName().c_str());
      
      if (objTypeName.Trim() == wxT("ReportFile"))
      {
         AppendItem(mReportItem, objName, GmatTree::OUTPUT_ICON_REPORTFILE, -1,
                    new GmatTreeItemData(objName, GmatTree::OUTPUT_REPORT));
      }
      else if (objTypeName.Trim() == wxT("OrbitView") &&
               sub->GetBooleanParameter(wxT("ShowPlot")))
      {
         AppendItem(mOpenGlItem, objName, GmatTree::OUTPUT_ICON_ORBITVIEW, -1,
                    new GmatTreeItemData(objName, GmatTree::OUTPUT_ORBIT_VIEW));
      }
      else if (objTypeName.Trim() == wxT("XYPlot") &&
               sub->GetBooleanParameter(wxT("ShowPlot")))
      {
         AppendItem(mXyPlotItem, objName, GmatTree::OUTPUT_ICON_XYPLOT, -1,
                    new GmatTreeItemData(objName, GmatTree::OUTPUT_XY_PLOT));
      }
   }

   // get list of Event Locators
   StringArray listOfEls = theGuiInterpreter->GetListOfObjects(Gmat::EVENT_LOCATOR);
   for (UnsignedInt i = 0; i < listOfEls.size(); ++i)
   {
      EventLocator *el =
         (EventLocator*)theGuiInterpreter->GetConfiguredObject(listOfEls[i]);
      if (el != NULL)
      {
         wxString objName = wxString(listOfEls[i].c_str());
         AppendItem(mEventsItem, objName, GmatTree::OUTPUT_ICON_REPORTFILE, -1,
               new GmatTreeItemData(objName, GmatTree::EVENT_REPORT));
      }
   }

   Expand(mReportItem);
   Expand(mOpenGlItem);
   Expand(mXyPlotItem);
   Expand(mEventsItem);
}