Exemplo n.º 1
0
//------------------------------------------------------------------------------
// void OnButtonClick()
//------------------------------------------------------------------------------
void BurnThrusterPanel::OnButtonClick(wxCommandEvent &event)
{  
   bool isModified = false;
   if (event.GetEventObject() == cCoefButton)
   {
      ThrusterCoefficientDialog tcDlg(this, -1, "ThrusterCoefficientDialog", theObject, "C", cCoefs);
      tcDlg.ShowModal();
      isModified = tcDlg.AreCoefsSaved();
      if (isModified)
      {
         cCoefs.clear();
         cCoefs      = tcDlg.GetCoefValues();

         EnableUpdate(true);
      }
      areCCoefsChanged = areCCoefsChanged || isModified;
   }
   else if (event.GetEventObject() == kCoefButton)
   {
      ThrusterCoefficientDialog tcDlg(this, -1, "ImpulseCoefficientDialog", theObject, "K", kCoefs);
      tcDlg.ShowModal();
      isModified = tcDlg.AreCoefsSaved();
      if (isModified)
      {
         kCoefs.clear();
         kCoefs      = tcDlg.GetCoefValues();

         EnableUpdate(true);
      }
      areKCoefsChanged = areKCoefsChanged || isModified;
   }
}
void CWeapon::NetUpdateFireMode(SEntityUpdateContext& ctx)
{
    // CGunTurret and CVehicleWeapon overide NetAllowUpdate to perform their own checks.
    if(NetAllowUpdate(true))
    {
        m_netNextShot -= ctx.fFrameTime;

        if(IsReloading())
            return;	// reloading, bail

        if((!m_isFiringStarted) && (m_isFiring || m_shootCounter > 0))
        {
            m_isFiringStarted = true;
            m_netNextShot = 0.f;
            NetStartFire();
            EnableUpdate(true, eIUS_FireMode);
        }

        if(m_fm)
        {
            if(m_shootCounter > 0 && m_netNextShot <= 0.0f)
            {
                // Aside from the prediction handle, needed for the server, NetShoot/Ex parameters
                // are no longer used, these will need removing when the client->server RMI's are tided up
                m_fm->NetShoot(Vec3(0.f, 0.f, 0.f), 0);
                m_shootCounter--;

                //if fireRate == 0.0f, set m_netNextShot to 0.0f, otherwise increment by 60.f / fireRate.
                //	fres used to avoid microcoded instructions, fsel to avoid branching - Rich S
                const float fRawFireRate		= m_fm->GetFireRate();
                const float fFireRateSelect = -fabsf(fRawFireRate);
                const float fFireRateForDiv = (float)__fsel(fFireRateSelect, 1.0f, fRawFireRate);
                const float fNextShot				= (float)__fsel(fFireRateSelect, 0.0f, m_netNextShot + (60.f * __fres(fFireRateForDiv)));
                m_netNextShot = fNextShot;
            }
        }

        if(m_isFiringStarted && !m_isFiring && m_shootCounter <= 0)
        {
            m_isFiringStarted = false;
            NetStopFire();
            EnableUpdate(false, eIUS_FireMode);
        }

        // this needs to happen here, or NetStopFire interrupts the animation
        if(m_doMelee && m_melee)
        {
            m_melee->NetAttack();
            m_doMelee= false;
        }
    }

}
Exemplo n.º 3
0
//------------------------------------------------------------------------------
// void OnComboBoxChange()
//------------------------------------------------------------------------------
void BurnThrusterPanel::OnComboBoxChange(wxCommandEvent &event)
{
   if (event.GetEventObject() == coordSysComboBox)
   {
      UpdateOriginAxes();      
      isCoordSysChanged =  true;
      coordSysName = coordSysComboBox->GetStringSelection().c_str();
      EnableUpdate(true);
   }
   else if (event.GetEventObject() == tankComboBox)
   {
      isTankChanged = true;
      tankName = tankComboBox->GetStringSelection().WX_TO_STD_STRING;
      if (tankName == "No Fuel Tank Selected")
         tankName = "";
      
      // remove "No Tank Selected" once tank is selected
      int pos = tankComboBox->FindString("No Fuel Tank Selected");
      if (pos != wxNOT_FOUND)
         tankComboBox->Delete(pos);
      
      EnableUpdate(true);
   }
   else if (event.GetEventObject() == axesComboBox)
   {
      std::string csName = coordSysComboBox->GetStringSelection().WX_TO_STD_STRING;
      
      if (csName == "Local")
      {
         std::string axisValue = axesComboBox->GetValue().WX_TO_STD_STRING;
         if ((axisValue == "MJ2000Eq") || (axisValue == "SpacecraftBody"))
         {
            originLabel->Disable();
            originComboBox->Disable();
         }
         else
         {
            originLabel->Enable();
            originComboBox->Enable();
         }
      }
   }
   // thrustModelCB will be NULL if the thruster is not Electric
   else if (event.GetEventObject() == thrustModelCB)
   {
      thrustModel = thrustModelCB->GetStringSelection().c_str();
      EnableDataForThrustModel(thrustModel);
      isThrustModelChanged =  true;
      EnableUpdate(true);
   }
}
Exemplo n.º 4
0
//------------------------------------------------------------------------------
// void OnRadioButtonChange()
//------------------------------------------------------------------------------
void DragInputsDialog::OnRadioButtonChange(wxCommandEvent& event)
{
   if (event.GetEventObject() == userInputRadioButton)  
   {       
      useFile = false;
      Update();
      EnableUpdate(true);
   }
   else if (event.GetEventObject() == fileInputRadioButton)
   {       
      useFile = true;
      Update();
      EnableUpdate(true);
   }
}
Exemplo n.º 5
0
//------------------------------------------------------------------------------
void ForPanel::GetNewValue(Integer row, Integer col)
{
   bool settableOnly = (col == INDEX_COL);
   ParameterSelectDialog paramDlg(this, mObjectTypeList,
         GuiItemManager::SHOW_PLOTTABLE,0, false, false,
         true, true, true, true, "Spacecraft", true, settableOnly);
   paramDlg.ShowModal();
   
   if (paramDlg.IsParamSelected())
   {
      wxString newParamName = paramDlg.GetParamName();
      
      if (newParamName == conditionGrid->GetCellValue(row, col))
         return;
      
      conditionGrid->SetCellValue(row, col, newParamName);
      
      if (col == INDEX_COL)
         mIndexString = newParamName;
      else if (col == START_COL)
         mStartString = newParamName;
      else if (col == INCR_COL)
         mIncrString = newParamName;
      else if (col == END_COL)
         mEndString = newParamName;
      
      EnableUpdate(true);
   }  
}
Exemplo n.º 6
0
//------------------------------------------------------------------------------
// void OnComboBoxChange(wxCommandEvent& event)
//------------------------------------------------------------------------------
void GroundTrackPlotPanel::OnComboBoxChange(wxCommandEvent& event)
{    
   if (event.GetEventObject() == mSolverIterComboBox)
   {
      mHasDataOptionChanged = true;
   }
   else if (event.GetEventObject() == mCentralBodyComboBox)
   {
      mHasCentralBodyChanged = true;
      wxString bodyTexture;
      if (mCentralBodyComboBox->GetValue() == mCentralBody)
      {
         bodyTexture = mTextureFile;
      }
      else
      {
         // Update texture map to corresponding body
         CelestialBody *body = (CelestialBody*)
            theGuiInterpreter->GetConfiguredObject(mCentralBodyComboBox->GetValue().c_str());
         Integer id = body->GetParameterID("TextureMapFileName");
         bodyTexture = body->GetStringParameter(id).c_str();
      }
      #ifdef DEBUG_CENTRAL_BODY
      MessageInterface::ShowMessage
         ("OnComboBoxChange(), bodyTexture = '%s'\n", bodyTexture.c_str());
      #endif
      mTextureMapTextCtrl->SetValue(bodyTexture);
      mTextureMapTextCtrl->SetInsertionPointEnd();
   }
   EnableUpdate(true);
}
Exemplo n.º 7
0
//------------------------------------------------------------------------
void CFists::Select(bool select)
{
	CWeapon::Select(select);
	SetActionSuffix("");

	if(select)
	{
		EnableUpdate(true, eIUS_General);
		RequestAnimState(eFAS_FIGHT);
	}
	else
	{
		EnableUpdate(false, eIUS_General);
		RequestAnimState(eFAS_NOSTATE);
	}
}
Exemplo n.º 8
0
//------------------------------------------------------------------------------
void CoordSystemConfigPanel::OnComboUpdate(wxCommandEvent& event)
{
   if (event.GetEventObject() == originComboBox)
   {
      mOriginChanged = true;
   }
   else if (event.GetEventObject() == typeComboBox)
   {
      mCoordPanel->EnableOptions();
      mObjRefChanged = true;
   }
   else if (event.GetEventObject() == primaryComboBox ||
            event.GetEventObject() == secondaryComboBox)
   {
      mObjRefChanged = true;
   }
   else if (event.GetEventObject() == refObjectComboBox)
   {
      mObjRefChanged = true;
   }
   else if (event.GetEventObject() == constraintCSComboBox)
   {
      mObjRefChanged = true;
   }
   else if (event.GetEventObject() == xComboBox ||
            event.GetEventObject() == yComboBox ||
            event.GetEventObject() == zComboBox)
   {
      mObjRefChanged = true;
   }
   
   EnableUpdate(true);
}
Exemplo n.º 9
0
//------------------------------------------------------------------------------
void SubscriberSetupPanel::LoadData()
{
   // load data from the core engine
   try
   {
      mObject = theSubscriber;

      wxString label;
      Integer propertyCount = theSubscriber->GetParameterCount();

      for (Integer i = 0; i < propertyCount; ++i)
      {
         if (mObject->IsParameterReadOnly(i) == false)
         {
            label = mObject->GetParameterText(i);
            LoadControl(label);
         }
      }
   }
   catch (BaseException &e)
   {
      MessageInterface::ShowMessage
         (wxT("SubscriberSetupPanel:LoadData() error occurred!\n%s\n"),
          e.GetFullMessage().c_str());
   }

   // explicitly disable apply button
   // it is turned on in each of the panels
   EnableUpdate(false);
}
Exemplo n.º 10
0
//------------------------------------------------------------------------
void CVehicleWeapon::StartUse(EntityId userId)
{
	if (m_ownerId && userId != m_ownerId)
		return; 

  if (GetEntity()->GetParent())
  { 
    m_pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(GetEntity()->GetParent()->GetId());
    assert(m_pVehicle && "Using VehicleWeapons on non-vehicles may lead to unexpected behavior.");

    if (m_pVehicle)
    {   
      m_pPart = m_pVehicle->GetWeaponParentPart(GetEntityId()); 
      m_pOwnerSeat = m_pVehicle->GetWeaponParentSeat(GetEntityId());
      m_pSeatUser = m_pVehicle->GetSeatForPassenger(userId);
    }
  }
  
	SetOwnerId(userId);
  Select(true);	
	m_stats.used = true;

	EnableUpdate(true, eIUS_General);
	RequireUpdate(eIUS_General);

  if (OutOfAmmo(false))
    Reload(false);

  UseManualBlending(true);

	LowerWeapon(false);

	SendMusicLogicEvent(eMUSICLOGICEVENT_WEAPON_MOUNT);

}
Exemplo n.º 11
0
//------------------------------------------------------------------------------
// void SaveData()
//------------------------------------------------------------------------------
void TargetPanel::SaveData()
{
   try
   {
      std::string solverName = mSolverComboBox->GetValue().WX_TO_STD_STRING;
      std::string solverMode = mSolverModeComboBox->GetValue().WX_TO_STD_STRING;
      std::string exitMode   = mExitModeComboBox->GetValue().WX_TO_STD_STRING;

      theCommand->SetStringParameter(theCommand->GetParameterID("Targeter"),
                                     solverName);
      theCommand->SetStringParameter(theCommand->GetParameterID("SolveMode"), 
            solverMode);
      theCommand->SetStringParameter(theCommand->GetParameterID("ExitMode"), 
            exitMode);

      if (mProgressWindowCheckBox->IsChecked())
         theCommand->SetBooleanParameter("ShowProgressWindow", true);
      else
         theCommand->SetBooleanParameter("ShowProgressWindow", false);

      EnableUpdate(false);
   }
   catch (BaseException &e)
   {
      MessageInterface::PopupMessage(Gmat::ERROR_, e.GetFullMessage());
   }
}
Exemplo n.º 12
0
//------------------------------------------------------------------------------
// void OnCheckBoxChange(wxCommandEvent& event)
//------------------------------------------------------------------------------
void BurnThrusterPanel::OnCheckBoxChange(wxCommandEvent& event)
{
   if (decMassCheckBox->IsChecked())
   {
      tankLabel->Enable();
      tankComboBox->Enable();
      if (theObject->GetType() == Gmat::IMPULSIVE_BURN)
      {
         ispLabel->Enable();
         ispTextCtrl->Enable();
         ispUnit->Enable();
      }
   }
   else
   {
      tankLabel->Disable();
      tankComboBox->Disable();
      if (theObject->GetType() == Gmat::IMPULSIVE_BURN)
      {
         ispLabel->Disable();
         ispTextCtrl->Disable();
         ispUnit->Disable();
      }
   }
   
   EnableUpdate(true);
}
Exemplo n.º 13
0
//------------------------------------------------------------------------------
// void VaryPanel::OnButton(wxCommandEvent& event)
//------------------------------------------------------------------------------
void VaryPanel::OnButton(wxCommandEvent& event)
{
   if (event.GetEventObject() == mViewVarButton)  
   {
      wxString objType = "ImpulsiveBurn";
      if (theGuiManager->GetNumImpulsiveBurn() == 0)
          objType = "Spacecraft";
      
      ParameterSelectDialog paramDlg(this, mObjectTypeList,
                                     GuiItemManager::SHOW_PLOTTABLE, 0, false,
                                     false, true, true, true, true, objType,
                                     true, true, true);
      
      paramDlg.ShowModal();
      
      if (paramDlg.IsParamSelected())
      {
         wxString newParamName = paramDlg.GetParamName();
         mVarNameTextCtrl->SetValue(newParamName);
         variableName = newParamName.c_str();
         variableChanged = true;
         EnableUpdate(true);
      }
   }
   else
      event.Skip();
}
Exemplo n.º 14
0
//------------------------------------------------------------------------------
// void VaryPanel::OnSolverSelection(wxCommandEvent &event)
//------------------------------------------------------------------------------
void VaryPanel::OnSolverSelection(wxCommandEvent &event)
{
   #ifdef DEBUG_VARYPANEL_SOLVER
   MessageInterface::ShowMessage("VaryPanel::OnSolverSelection() entered\n");
   #endif
   
   solverName = mSolverComboBox->GetStringSelection().c_str();
   
   GmatBase *slvr = theGuiInterpreter->GetConfiguredObject(solverName);
   
   #ifdef DEBUG_VARYPANEL_SOLVER
   MessageInterface::ShowMessage
      ("   solverName='%s', solver=<%p>'%s'\n", solverName.c_str(), slvr,
       slvr ? slvr->GetName().c_str() : "NULL");
   #endif
   
   if (slvr == NULL)
   {
      MessageInterface::PopupMessage(Gmat::ERROR_, "The solver " + solverName + " is NULL");
   }
   else
   {
      solverChanged = true;
      SetControlEnabling(slvr);
      EnableUpdate(true);
   }
}
Exemplo n.º 15
0
//------------------------------------------------------------------------------
VaryPanel::VaryPanel(wxWindow *parent, GmatCommand *cmd, bool inOptimize)
   : GmatPanel(parent)
{
   #ifdef DEBUG_VARYPANEL
   MessageInterface::ShowMessage
      ("VaryPanel::VaryPanel() entered, cmd=<%p><%s>, inOptimize=%d\n",
       cmd, cmd ? cmd->GetTypeName().c_str() : "NULL", inOptimize);
   #endif
   
   mVaryCommand = (Vary *)cmd;
   inOptimizeCmd = inOptimize;
   
   mObjectTypeList.Add("Spacecraft");
   mObjectTypeList.Add("ImpulsiveBurn");
   
   Create();
   Show();
   
   solverChanged = false;
   variableChanged = false;
   EnableUpdate(false);
   
   #ifdef DEBUG_VARYPANEL
   MessageInterface::ShowMessage("VaryPanel::VaryPanel() leaving\n");
   #endif
}
Exemplo n.º 16
0
//------------------------------------------------------------------------------
// void AchievePanel::OnButtonClick(wxCommandEvent& event)
//------------------------------------------------------------------------------
void AchievePanel::OnButtonClick(wxCommandEvent& event)
{
   // show dialog to select parameter
   ParameterSelectDialog paramDlg(this, mObjectTypeList);
   paramDlg.ShowModal();
      
   if (paramDlg.IsParamSelected())
   {
      wxString newParamName = paramDlg.GetParamName();
      if (event.GetEventObject() == mViewGoalButton)
      {
         mGoalNameTextCtrl->SetValue(newParamName);
         mGoalName = newParamName;
         mIsTextModified = true;
      }
      else if (event.GetEventObject() == mViewGoalValueButton)
      {
         mGoalValueTextCtrl->SetValue(newParamName);
         mGoalValue = newParamName;
         mIsTextModified = true;
      }
      else if (event.GetEventObject() == mViewToleranceButton)
      {
         mToleranceTextCtrl->SetValue(newParamName);
         mTolerance = newParamName;
         mIsTextModified = true;
      }
      
      EnableUpdate(true);
   }
}
Exemplo n.º 17
0
//------------------------------------------------------------------------------
// void OnTextUpdate(wxCommandEvent& event)
//------------------------------------------------------------------------------
void ParameterSetupPanel::OnTextUpdate(wxCommandEvent& event)
{
   if (mValueTextCtrl->IsModified())
   {
      mIsValueChanged = true;
      EnableUpdate(true);
   }
}
Exemplo n.º 18
0
//------------------------------------------------------------------------------
// void OnTextChange()
//------------------------------------------------------------------------------
void DragInputsDialog::OnTextChange(wxCommandEvent &event)
{
   if (((wxTextCtrl*)event.GetEventObject())->IsModified())
   {
      EnableUpdate(true);
      isTextModified = true;
   }
}
Exemplo n.º 19
0
//------------------------------------------------------------------------
void CGunTurret::OnReset()
{
	if(IScriptTable *pScriptTable = GetEntity()->GetScriptTable())
	{
		SmartScriptTable props;

		if(pScriptTable->GetValue("Properties", props))
			ReadProperties(props);
	}

	CItem::OnReset();

	Matrix34 tm = GetEntity()->GetSlotLocalTM(eIGS_Aux0,false);

	tm.SetTranslation(GetSlotHelperPos(eIGS_Aux0,m_radarHelper.c_str(),false));
	GetEntity()->SetSlotLocalTM(eIGS_ThirdPerson,tm);

	if(GetEntity()->IsSlotValid(eIGS_Aux1))
	{
		tm.SetTranslation(GetSlotHelperPos(eIGS_ThirdPerson,m_barrelHelper.c_str(),false));
		GetEntity()->SetSlotLocalTM(eIGS_Aux1,tm);
	}

	m_targetId = 0;
	m_destinationId = 0;
	m_updateTargetTimer = 0.0f;
	m_abandonTargetTimer = 0.0f;
	m_goalYaw = 0.0f;
	m_goalPitch = 0.0f;
	m_burstTimer = 0.0f;
	m_pauseTimer = 0.0f;
	m_searchHint = 0;
	m_fireHint = 1;
	m_deviationPos.zero();

	m_randoms[eRV_UpdateTarget].Range(m_turretparams.update_target_time * m_fireparams.randomness);
	m_randoms[eRV_AbandonTarget].Range(m_turretparams.abandon_target_time * m_fireparams.randomness);
	m_randoms[eRV_BurstTime].Range(m_turretparams.burst_time * m_fireparams.randomness);
	m_randoms[eRV_BurstPause].Range(m_turretparams.burst_pause * m_fireparams.randomness);

	m_lightId = AttachLight(eIGS_ThirdPerson, m_lightId, false);
	StopSound(m_lightSound);
	m_lightSound = INVALID_SOUNDID;

	if(m_turretparams.light_fov > 0.f)
	{
		m_lightId = AttachLight(eIGS_ThirdPerson, 0, true, m_turretparams.mg_range, m_searchparams.light_color*m_searchparams.light_diffuse_mul, 1.f/m_searchparams.light_diffuse_mul, m_searchparams.light_texture, m_turretparams.light_fov, m_searchparams.light_helper, Vec3(0,0,0), Vec3(-1,0,0), m_searchparams.light_material, m_searchparams.light_hdr_dyn);
		m_lightSound = PlayAction(g_pItemStrings->use_light);
	}

	SetFiringLocator(this);

	if(m_fm2)
		m_fm2->Activate(true);

	EnableUpdate(true, eIUS_General);
}
Exemplo n.º 20
0
//------------------------------------------------------------------------------
// void OnTextUpdate(wxCommandEvent& event)
//------------------------------------------------------------------------------
void FunctionSetupPanel::OnTextUpdate(wxCommandEvent& event)
{
   if (event.GetEventObject() == mFileContentsTextCtrl)
   {
      mEnableSave = true;
      EnableUpdate(true);
      theOkButton->Enable();
   }
}
Exemplo n.º 21
0
//------------------------------------------------------------------------------
// void OnColorPickerChange(wxColourPickerEvent& event)
//------------------------------------------------------------------------------
void GroundTrackPlotPanel::OnColorPickerChange(wxColourPickerEvent& event)
{
   #ifdef DEBUG_PANEL_COLOR
   MessageInterface::ShowMessage("GroundTrackPlotPanel::OnColorPickerChange() entered\n");
   #endif
   
   wxObject *obj = event.GetEventObject();
   std::string selObjName = mObjectCheckListBox->GetStringSelection().c_str();
   
   if (obj == mOrbitColorCtrl)
   {
      mOrbitColor = mOrbitColorCtrl->GetColour();
      mOrbitColorMap[selObjName].Set(mOrbitColor.Red(),
                                     mOrbitColor.Green(),
                                     mOrbitColor.Blue(), 0);
      
      #ifdef DEBUG_PANEL_COLOR
      MessageInterface::ShowMessage("   Orbit color changed\n");
      MessageInterface::ShowMessage
         ("   red=%u, green=%u, blue=%u, alpha=%u\n", mOrbitColor.Red(),
          mOrbitColor.Green(), mOrbitColor.Blue(), mOrbitColor.Alpha());
      UnsignedInt intColor = mOrbitColorMap[selObjName].GetIntColor();
      MessageInterface::ShowMessage
         ("   mOrbitColorMap[%s]=%u<%08X>\n", selObjName.c_str(), intColor, intColor);
      #endif
      
      mHasOrbitColorChanged = true;
   }
   else if (obj == mTargetColorCtrl)
   {
      mTargetColor = mTargetColorCtrl->GetColour();
      mTargetColorMap[selObjName].Set(mTargetColor.Red(),
                                      mTargetColor.Green(),
                                      mTargetColor.Blue(), 0);
      
      #ifdef DEBUG_PANEL_COLOR
      MessageInterface::ShowMessage("   Target color changed\n");
      MessageInterface::ShowMessage
         ("   red=%u, green=%u, blue=%u, alpha=%u\n", mTargetColor.Red(),
          mTargetColor.Green(), mTargetColor.Blue(), mTargetColor.Alpha());
      UnsignedInt intColor = mTargetColorMap[selObjName].GetIntColor();
      MessageInterface::ShowMessage
         ("   mTargetColorMap[%s]=%u<%08X>\n", selObjName.c_str(), intColor, intColor);
      #endif
      
      mHasTargetColorChanged = true;
   }
   
   EnableUpdate(true);
   
   #ifdef DEBUG_PANEL_COLOR
   MessageInterface::ShowMessage("GroundTrackPlotPanel::OnColorPickerChange() entered\n");
   #endif
}
Exemplo n.º 22
0
//------------------------------------------------------------------------------
// void OnButtonClick(wxCommandEvent& event)
//------------------------------------------------------------------------------
void NonlinearConstraintPanel::OnButtonClick(wxCommandEvent& event)
{
   if (event.GetEventObject() == mLeftChooseButton)
   {      
      // show dialog to select parameter
      ParameterSelectDialog paramDlg(this, mObjectTypeList);
      paramDlg.ShowModal();

      if (paramDlg.IsParamSelected())
      {
         wxString newParamName = paramDlg.GetParamName();
         if (event.GetEventObject() == mLeftChooseButton)
         {
            mLHSTextCtrl->SetValue(newParamName);
         }
         
         EnableUpdate(true);
      }
   }
   else if (event.GetEventObject() == mRightChooseButton)
   {      
      // show dialog to select parameter
      ParameterSelectDialog paramDlg(this, mObjectTypeList);
      paramDlg.ShowModal();

      if (paramDlg.IsParamSelected())
      {
         wxString newParamName = paramDlg.GetParamName();
         if (event.GetEventObject() == mRightChooseButton)
         {
            mRHSTextCtrl->SetValue(newParamName);
         }
         
         EnableUpdate(true);
      }
   }
   else
   {
      event.Skip();
   }
}
Exemplo n.º 23
0
//------------------------------------------------------------------------------
// void OnCheckBoxChange(wxCommandEvent& event)
//------------------------------------------------------------------------------
void GroundTrackPlotPanel::OnCheckBoxChange(wxCommandEvent& event)
{
   if (event.GetEventObject() == mShowPlotCheckBox)
   {
      mHasDataOptionChanged = true;
   }
   else
   {
   }
   
   EnableUpdate(true);
}
Exemplo n.º 24
0
//------------------------------------------------------------------------------
void CoordSystemConfigPanel::OnTextUpdate(wxCommandEvent& event)
{
   mObjRefChanged = true;
   EnableUpdate(true);
   if (mCoordPanel->GetEpochTextCtrl()->IsModified() )
   {
      mEpochChanged = true;
      #ifdef DEBUG_COORD_PANEL_TEXT
         MessageInterface::ShowMessage("Text has been updated and epoch has been changed!!!\n");
      #endif
   }
}
Exemplo n.º 25
0
//------------------------------------------------------------------------------
// NonlinearConstraintPanel(wxWindow *parent, GmatCommand *cmd)
//------------------------------------------------------------------------------
NonlinearConstraintPanel::NonlinearConstraintPanel(wxWindow *parent, GmatCommand *cmd)
   : GmatPanel(parent)
{
   mNonlinearConstraintCommand = (NonlinearConstraint *)cmd;      
   mObjectTypeList.Add(wxT("Spacecraft"));
   theGuiManager = GuiItemManager::GetInstance();
   
   Create();
   Show();
   
   EnableUpdate(false);
}
Exemplo n.º 26
0
void CJaw::Update(SEntityUpdateContext& ctx, int slot)
{
	CWeapon::Update(ctx, slot);

	if (!IsSelected())
		return;

	if(slot == eIUS_Zooming)
	{
		UpdateLaser(ctx);
	}

	if (slot != eIUS_General)
		return;

	UpdatePendingShot();

	if (!IsInputFlagSet(CWeapon::eWeaponAction_Zoom) && IsInputFlagSet(CWeapon::eWeaponAction_Fire) && !IsZoomingIn())
		AutoZoomOut();

	if (m_controllingRocket && !IsZoomed() && !m_zoomTriggerDown)
		DoAutoDrop();

	if (m_autoDropping)
	{
		m_autoDropPendingTimer += ctx.fFrameTime;
		if (CanAutoDrop())
		{
			m_autoDropping = false;
			DoAutoDrop();
		}
	}

	if (m_dropped)
	{
		m_dropTime += ctx.fFrameTime;
		if (m_dropTime > g_hideTimeAfterDrop)
		{
			if(gEnv->bServer)
			{
				if(gEnv->IsEditor())
					Hide(true);
				else
					gEnv->pEntitySystem->RemoveEntity(GetEntity()->GetId());	
			}
			EnableUpdate(false);
		}
		else
		{
			RequireUpdate();
		}
	}
}
Exemplo n.º 27
0
//------------------------------------------------------------------------------
void CelestialBodyPanel::SaveData()
{
   #if DEBUG_CELESBODY_SAVE
      MessageInterface::ShowMessage("in CBPanel, origBody = %p, theBody = %p\n",
            origCelestialBody, theCelestialBody);
   #endif
   
   canClose = true;
   
   if (properties->IsDataChanged())
   {
      properties->SaveData();
      canClose = canClose && properties->CanClosePanel();
   }
   if (orbit->IsDataChanged())
   {
      orbit->SaveData();
      canClose = canClose && orbit->CanClosePanel();
   }
   if (orientation->IsDataChanged())
   {
      orientation->SaveData();
      canClose = canClose && orientation->CanClosePanel();
   }
   if (visualization->IsDataChanged())
   {
      visualization->SaveData();
      canClose = canClose && visualization->CanClosePanel();
   }
   
   if (!canClose)   // why do this???? spacecraft panel did this ....
   {
      EnableUpdate(true);
      return;
   }
   // copy the current info into origCelestialBody
   origCelestialBody->Copy(theCelestialBody);
   EnableUpdate(false);

}
Exemplo n.º 28
0
//------------------------------------------------------------------------------
// void OnBrowse()
//------------------------------------------------------------------------------
void DragInputsDialog::OnBrowse(wxCommandEvent &event)
{
   wxFileDialog dialog(this, _T("Choose a file"), _T(""), _T(""), _T("*.*"));
    
   if (dialog.ShowModal() == wxID_OK)
   {
      wxString filename;
        
      filename = dialog.GetPath().c_str();
   }
   
   EnableUpdate(true);
}
Exemplo n.º 29
0
IMPLEMENT_RMI(CHeavyMountedWeapon, ClDropped)
{
	if(!m_rippedOff)
	{
		SetUnMountedConfiguration();
		UnlinkMountedGun();
		FinishRipOff();
		EnableUpdate(false);
		BaseClass::Drop(5.0f);
	}

	return true;
}
Exemplo n.º 30
0
//------------------------------------------------------------------------
void CItem::OnRepaired()
{
    for (int i=0; i<eIGS_Last; i++)
    {
        ICharacterInstance *pCharacter = GetEntity()->GetCharacter(i);
        if (pCharacter)
            pCharacter->SetAnimationSpeed(1.0f);
    }

    DestroyedGeometry(false);

    EnableUpdate(true);
}