Beispiel #1
0
wxString GmRestFileNode::getName (void)
{
	if (_pParent->getType () != GNT_ROOT) {
		wxString  fileName = ToWxString (_pFileNode->fileName);
		fileName = GetFileName (fileName);
		return fileName;
	}

	return ToWxString (_pFileNode->fileName);
}
Beispiel #2
0
void static inline CopyDirToInfoNode (GmLeafInfo & Info, const GmUifDirEntry & entry)
{
	Info.Name		= ToWxString (entry.DirName);
	Info.Attribute	= entry.Attribute;
	Info.AccessTime	= entry.AccessTime;
	Info.CreateTime	= entry.CreateTime;
	Info.ModifyTime	= entry.ModifyTime;
}
Beispiel #3
0
wxString GmSrcEntryNode::getName (void)
{
	ubyte2 iSourceType = _pSource->sourceType;
	wxString szName;

	if (iSourceType == (ubyte2)FST_DIR_SOURCE)
		szName = ToWxString (_pSource->absolutePath);
	else if (iSourceType == (ubyte2)FST_FILE_SOURCE) {
		wxString path = ToWxString (_pSource->absolutePath);
		wxString file = ToWxString (_pSource->sourceFileName);
		szName = Combine (path, file);
	}
	else
		assert (false);

	return szName;
}
Beispiel #4
0
wxString GmRestZipDirNode::getName (void)
{
	string fileName = GetFileName (_pDirectory->dirName);
	if (fileName[fileName.length () - 1] == '/')
		fileName[fileName.length () - 1] = 0;

	return ToWxString (fileName);
}
Beispiel #5
0
//------------------------------------------------------------------------------
// void LoadData()
//------------------------------------------------------------------------------
void GroundStationPanel::LoadData()
{ 
   if (localGroundStation == NULL)
      return; 
   
   // Set object pointer for "Show Script"
   mObject = theGroundStation;

   try
   {
   // Since Groundstation is now in plugin, this no longer works:
//      stationIDTextCtrl->SetValue(ToWxString(localGroundStation->GetStringParameter(GroundStation::STATION_ID).c_str()));
      stationIDTextCtrl->SetValue(ToWxString(localGroundStation->GetStringParameter(localGroundStation->GetParameterID("Id")).c_str()));
      centralBodyComboBox->SetValue(ToWxString(localGroundStation->GetStringParameter(BodyFixedPoint::CENTRAL_BODY).c_str()));
      currentStateType = localGroundStation->GetStringParameter(BodyFixedPoint::STATE_TYPE);
      stateTypeComboBox->SetValue(ToWxString(currentStateType.c_str()));
      currentHorizonReference = localGroundStation->GetStringParameter(BodyFixedPoint::HORIZON_REFERENCE);
      horizonReferenceComboBox->SetValue(ToWxString(currentHorizonReference.c_str()));
      location1 = localGroundStation->GetRealParameter(BodyFixedPoint::LOCATION_1);
      location1TextCtrl->SetValue(ToWxString(location1));
      location2 = localGroundStation->GetRealParameter(BodyFixedPoint::LOCATION_2);
      location2TextCtrl->SetValue(ToWxString(location2));
      location3 = localGroundStation->GetRealParameter(BodyFixedPoint::LOCATION_3);
      location3TextCtrl->SetValue(ToWxString(location3));
      //hardwareTextCtrl->SetValue(ToWxString(localGroundStation->GetStringParameter(GroundStation::HARDWARE).c_str()));
      
      // update labels and tooltips based on statetype
      UpdateControls();
   }
   catch (BaseException &e)
   {
      MessageInterface::PopupMessage(Gmat::ERROR_, e.GetFullMessage());
   }
}
Beispiel #6
0
wxString GmMemoryInStream::GetString ()
{
	string str;
	ubyte4 size = GetUByte4 ();
	if (size > m_block.length ())
		throw GmException (_("IDS_BUFFER_ERROR"));

	str.assign (m_block.rd_ptr (), size);
	m_block.rd_ptr (size);
	return ToWxString (str);
}
Beispiel #7
0
void static inline CopyLeafToInfoNode (GmLeafInfo & Info, const GmLeafEntry & entry)
{
	Info.Name			= ToWxString (entry.LeafName);
	Info.Attribute		= entry.Attribute;
	Info.AccessTime		= entry.AccessTime;
	Info.CreateTime		= entry.CreateTime;
	Info.ModifyTime		= entry.ModifyTime;
	Info.CompressSize	= entry.CompressSize;
	Info.FileSize		= entry.FileSize;
	Info.StartDataSet	= entry.StartDataSet;
	Info.StartOffset	= entry.StartOffset;
	Info.Extent			= entry.Extent;
}
Beispiel #8
0
GmRootEntryNode::GmRootEntryNode (GmUifRootEntry * pNode, GmUnitedIndexFile * pCatalog)
									: _pEntryNode (pNode)
									, _pCatalog (pCatalog)
{
	assert (pNode);
	assert (pCatalog);

	_pCatalog->getTailEntry (*_pEntryNode, _tail);

	vector<GmEntryBase *> & DataSets = _tail.DataSets;
	assert (DataSets.size () == 1);

	_sZipName = ToWxString (((GmDataSetEntry *)DataSets[0])->fileName);
}
Beispiel #9
0
static GmWriter * createWriter (GmZipFileReader * pSetReader
									, GmUifSourceEntry * pEntry
									, GmRestOp option
									, GmExecUnitBase * pExecUnit
									, GmTempEvent * pEvent)
{
	GmWriter * pWriter = 0;
	wxString destPath;

	//pWriter = createWriter (FST_DIR_SOURCE, pExecUnit, option);
	destPath = ToWxString (pEntry->absolutePath);
	destPath =GetDirPath (destPath);

	assert (pWriter != 0);
	pWriter->SetDestPath (destPath);

	return pWriter;	
}
Beispiel #10
0
GmReader * createReader (GmRootEntryNode * pEntryNode
									 , GmExecUnitBase * pExecUnit
									 , GmTempEvent * pEvent)
{
	GmReader * pReader = 0;
	const vector<GmEntryBase *> & backupsets = pEntryNode->_tail.DataSets;
	assert (backupsets.size () == 1);

	GmDataSetEntry & setEntry = * (GmDataSetEntry*)backupsets[0];

	ubyte2 uiDestType = setEntry.destType;
	if (uiDestType == 	(ubyte2)DST_LOCAL) {
		pReader = new GmLocalReader (ToWxString (setEntry.absPath));
	}
	else
		assert (false);

	return pReader;
}
Beispiel #11
0
static inline wxString getAbsolutePath (GmWriter * pWriter
									, GmUifSourceEntry * pEntry
									, const wxString & szDestPath)
{
	return ToWxString (pEntry->absolutePath);
}
Beispiel #12
0
static inline wxString getSourcePath (GmWriter * pWriter, GmUifSourceEntry * pEntry, const wxString & szDestPath)
{
	wxString path = ToWxString (pEntry->absolutePath);
	return path;
}
Beispiel #13
0
//------------------------------------------------------------------------------
wxString UserInputValidator::ToWxString(Integer intVal)
{
   std::string strVal =
      GmatStringUtil::ToString(intVal, 1);
   return ToWxString(strVal);
}
Beispiel #14
0
//------------------------------------------------------------------------------
wxString UserInputValidator::ToWxString(Real realVal)
{
   std::string strVal =
      GmatStringUtil::ToString(realVal, GmatGlobal::DATA_PRECISION, false, 1);
   return ToWxString(strVal);
}
Beispiel #15
0
//------------------------------------------------------------------------------
// void OnHorizonReferenceComboBoxChange()
//------------------------------------------------------------------------------
void GroundStationPanel::OnHorizonReferenceComboBoxChange(wxCommandEvent &event)
{
   std::string horizon       = horizonReferenceComboBox->GetValue().c_str();
   std::string inputString;
   Real        location1, location2, location3;
   if (horizon != currentHorizonReference)
   {
      std::string bodyName = centralBodyComboBox->GetValue().c_str();
      // get a pointer to the celestial body
      CelestialBody *body = ss->GetBody(bodyName);
      if (!body)
      {
         std::string errmsg = "Cannot find body ";
         errmsg += bodyName + " needed for GroundStation panel update.\n";
         throw GmatBaseException(errmsg);
      }
      Real meanRadius = body->GetRealParameter(body->GetParameterID("EquatorialRadius"));
      Real flattening = body->GetRealParameter(body->GetParameterID("Flattening"));
      // Convert location values to the appropriate values
      // Location 1 (Latitude)
      inputString = location1TextCtrl->GetValue();
      CheckReal(location1, inputString, localGroundStation->GetStringParameter(BodyFixedPoint::LOCATION_LABEL_1), "Real Number");

      // Location 2 (Longitude)
      inputString = location2TextCtrl->GetValue();
      if (currentStateType != "Cartesian")
         CheckReal(location2, inputString, localGroundStation->GetStringParameter(BodyFixedPoint::LOCATION_LABEL_2), "Real Number >= 0.0", false, true, true, true);
      else
         CheckReal(location2, inputString, localGroundStation->GetStringParameter(BodyFixedPoint::LOCATION_LABEL_2), "Real Number");

      // Location 3 (Altitude)
      inputString = location3TextCtrl->GetValue();
      CheckReal(location3, inputString, localGroundStation->GetStringParameter(BodyFixedPoint::LOCATION_LABEL_3), "Real Number");

      Rvector3 locInCurrent(location1, location2, location3);
      if (currentStateType == "Spherical") // latitude and longitude need to be passed in as radians
      {
         locInCurrent[0] *= GmatMathConstants::RAD_PER_DEG;
         locInCurrent[1] *= GmatMathConstants::RAD_PER_DEG;
      }
      //MessageInterface::ShowMessage(" ... Spherical to new horizon ... loc = %12.10f  %12.10f  %12.10f\n",
      //      locInCurrent[0], locInCurrent[1], locInCurrent[2]); // *************************
      Rvector3 locInNew = BodyFixedStateConverterUtil::Convert(locInCurrent, currentStateType,
                          currentHorizonReference, currentStateType, horizon,
                          flattening, meanRadius);
      //MessageInterface::ShowMessage(" ... result =  %12.10f  %12.10f  %12.10f\n",
      //      locInNew[0], locInNew[1], locInNew[2]); // *************************
      location1 = locInNew[0];
      location2 = locInNew[1];
      location3 = locInNew[2];
      if (currentStateType == "Spherical") // need to display DEGREES for latitude and longitude
      {
         location1 *= GmatMathConstants::DEG_PER_RAD;
         location2 *= GmatMathConstants::DEG_PER_RAD;
      }
      localGroundStation->SetStringParameter(BodyFixedPoint::HORIZON_REFERENCE, horizon);
      localGroundStation->SetRealParameter(BodyFixedPoint::LOCATION_1, location1);
      localGroundStation->SetRealParameter(BodyFixedPoint::LOCATION_2, location2);
      localGroundStation->SetRealParameter(BodyFixedPoint::LOCATION_3, location3);
      location1TextCtrl->SetValue(ToWxString(location1));
      location2TextCtrl->SetValue(ToWxString(location2));
      location3TextCtrl->SetValue(ToWxString(location3));
      currentHorizonReference = horizon;
   }
   UpdateControls();
   EnableUpdate(true);
}