Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ tmp/
local.properties
.loadpath
.metadata
workspace.xml
workspace.xml
settings.json
4 changes: 2 additions & 2 deletions src/com/pesterenan/MechPeste.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private static boolean filterVessels(Vessel vessel, String search) {
if (search == "all") {
return true;
}
double TWO_KILOMETERS = 2000.0;
double TEN_KILOMETERS = 10000.0;
try {
Vessel active = MechPeste.getSpaceCenter().getActiveVessel();
if (vessel.getOrbit().getBody().getName().equals(active.getOrbit().getBody().getName())) {
Expand All @@ -83,7 +83,7 @@ private static boolean filterVessels(Vessel vessel, String search) {
final double distance = Vector.distance(activePos, vesselPos);
switch (search) {
case "closest":
if (distance < TWO_KILOMETERS) {
if (distance < TEN_KILOMETERS) {
return true;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion src/com/pesterenan/controllers/LiftoffController.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void finalizeCurve() throws RPCException, StreamException, InterruptedEx
private void circularizeOrbitOnApoapsis() {
setCurrentStatus(Bundle.getString("status_planning_orbit"));
Map<String, String> commands = new HashMap<>();
commands.put(Modulos.MODULO.get(), Modulos.MODULO_MANOBRAS.get());
commands.put(Modulos.MODULO.get(), Modulos.MODULO_EXEC_MANOBRAS.get());
commands.put(Modulos.FUNCAO.get(), Modulos.APOASTRO.get());
commands.put(Modulos.AJUSTE_FINO.get(), String.valueOf(false));
MechPeste.newInstance().startModule(commands);
Expand Down
4 changes: 1 addition & 3 deletions src/com/pesterenan/controllers/ManeuverController.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,19 +334,17 @@ public void executeBurn(Node noDeManobra, double duracaoDaQueima) {
Stream<Triplet<Double, Double, Double>> queimaRestante = getConnection().addStream(noDeManobra,
"remainingBurnVector", noDeManobra.getReferenceFrame());
setCurrentStatus(Bundle.getString("status_maneuver_executing"));
double remainingBurnTime = duracaoDaQueima + 0.5;
while (noDeManobra != null) {
if (Thread.interrupted()) {
throw new InterruptedException();
}
if (remainingBurnTime < 0.0 || queimaRestante.get().getValue1() < (fineAdjustment ? 2 : 0.5)) {
if (queimaRestante.get().getValue1() < (fineAdjustment ? 2 : 0.5)) {
throttle(0.0f);
break;
}
navigation.aimAtManeuver(noDeManobra);
throttle(ctrlManeuver.calcPID((noDeManobra.getDeltaV() - Math.floor(queimaRestante.get().getValue1())) /
noDeManobra.getDeltaV() * 1000, 1000));
remainingBurnTime -= 0.05;
Thread.sleep(50);
}
throttle(0.0f);
Expand Down
2 changes: 1 addition & 1 deletion src/com/pesterenan/model/ActiveVessel.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void startModule(Map<String, String> commands) {
controller = new LandingController(commands);
runningModule = true;
}
if (currentFunction.equals(Modulos.MODULO_MANOBRAS.get())) {
if (currentFunction.equals(Modulos.MODULO_EXEC_MANOBRAS.get())) {
controller = new ManeuverController(commands);
runningModule = true;
}
Expand Down
3 changes: 2 additions & 1 deletion src/com/pesterenan/resources/MechPesteBundle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
btn_func_landing = Auto Landing
btn_func_liftoff = Orbital Liftoff
btn_func_maneuvers = Exec. Maneuvers
btn_func_create_maneuver = Create Maneuvers
btn_func_exec_maneuver = Exec. Maneuvers
btn_func_rover = Drive Rover
btn_stat_connect = Connect
installer_dialog_btn_browse = Browse...
Expand Down
3 changes: 2 additions & 1 deletion src/com/pesterenan/resources/MechPesteBundle_pt.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
btn_func_landing = Pouso Autom\u00E1tico
btn_func_liftoff = Decolagem Orbital
btn_func_maneuvers = Exec. Manobras
btn_func_create_maneuver = Criar Manobras
btn_func_exec_maneuver = Exec. Manobras
btn_func_rover = Pilotar Rover
btn_stat_connect = Conectar
installer_dialog_btn_browse = Escolher...
Expand Down
47 changes: 24 additions & 23 deletions src/com/pesterenan/utils/Modulos.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,40 @@

public enum Modulos {

APOASTRO("Apoastro"),
PERIASTRO("Periastro"),
EXECUTAR("Executar"),
ABRIR_PAINEIS("Abrir Painéis"),
AJUSTAR("Ajustar"),
AJUSTE_FINO("Ajuste Fino"),
ALTITUDE_SOBREVOO("Altitude Sobrevoo"),
APOASTRO("Apoastro"),
CIRCULAR("Circular"),
CUBICA("Cúbica"),
DIRECAO("Direção"),
MODULO("Módulo"),
EXECUTAR("Executar"),
EXPONENCIAL("Exponencial"),
FUNCAO("Função"),
INCLINACAO("Inclinação"),
MARCADOR_MAPA("Marcador no mapa"),
MAX_TWR("Max_TWR"),
MODULO_CRIAR_MANOBRAS("CRIAR_MANOBRAS"),
MODULO_DECOLAGEM("LIFTOFF"),
MODULO_MANOBRAS("MANEUVER"),
MODULO_EXEC_MANOBRAS("MANEUVER"),
MODULO_POUSO_SOBREVOAR("HOVER"),
MODULO_POUSO("LANDING"),
MODULO_ROVER("ROVER"),
MODULO_TELEMETRIA("TELEMETRY"),
MODULO_POUSO_SOBREVOAR("HOVER"),
ALTITUDE_SOBREVOO("Altitude Sobrevoo"),
INCLINACAO("Inclinação"),
CIRCULAR("Circular"),
QUADRATICA("Quadrática"),
CUBICA("Cúbica"),
SINUSOIDAL("Sinusoidal"),
EXPONENCIAL("Exponencial"),
ROLAGEM("Rolagem"),
USAR_ESTAGIOS("Usar Estágios"),
ABRIR_PAINEIS("Abrir Painéis"),
AJUSTE_FINO("Ajuste Fino"),
TIPO_ALVO_ROVER("Tipo de Alvo do Rover"),
MODULO("Módulo"),
NAVE_ALVO("Nave alvo"),
MARCADOR_MAPA("Marcador no mapa"),
NOME_MARCADOR("Nome do marcador"),
VELOCIDADE_MAX("Velocidade Máxima"),
POUSAR("Pousar nave"),
MAX_TWR("Max_TWR"),
ORBITA_BAIXA("ÓRBITA BAIXA"),
SOBREVOO_POS_POUSO("SOBREVOO PÓS POUSO");
PERIASTRO("Periastro"),
POUSAR("Pousar nave"),
QUADRATICA("Quadrática"),
ROLAGEM("Rolagem"),
SINUSOIDAL("Sinusoidal"),
SOBREVOO_POS_POUSO("SOBREVOO PÓS POUSO"),
TIPO_ALVO_ROVER("Tipo de Alvo do Rover"),
USAR_ESTAGIOS("Usar Estágios"),
VELOCIDADE_MAX("Velocidade Máxima");

final String t;

Expand Down
2 changes: 1 addition & 1 deletion src/com/pesterenan/views/ChangeVesselDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void initComponents() {

// Buttons:
btnChangeToVessel = new JButton("Mudar para");
rbClosestVessels = new JRadioButton("Naves próximas (2km)");
rbClosestVessels = new JRadioButton("Naves próximas (10km)");
rbOnSameBody = new JRadioButton("No mesmo corpo celeste");
rbAllVessels = new JRadioButton("Todas as naves");

Expand Down
24 changes: 16 additions & 8 deletions src/com/pesterenan/views/FunctionsAndTelemetryJPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FunctionsAndTelemetryJPanel extends JPanel implements UIMethods {
private static final long serialVersionUID = 0L;

private final Dimension btnFuncDimension = new Dimension(140, 25);
private JButton btnLiftoff, btnLanding, btnManeuver, btnRover, btnCancel;
private JButton btnLiftoff, btnLanding, btnExecManeuver, btnRover, btnCancel, btnCreateManeuver;
private static JLabel lblAltitude, lblSurfaceAlt, lblApoapsis, lblPeriapsis, lblVertSpeed, lblHorzSpeed;
private static JLabel lblAltitudeValue, lblSurfaceAltValue, lblApoapsisValue;
private static JLabel lblPeriapsisValue, lblVertSpeedValue, lblHorzSpeedValue;
Expand Down Expand Up @@ -51,7 +51,8 @@ public void initComponents() {
// Buttons:
btnLiftoff = new JButton(Bundle.getString("btn_func_liftoff"));
btnLanding = new JButton(Bundle.getString("btn_func_landing"));
btnManeuver = new JButton(Bundle.getString("btn_func_maneuvers"));
btnCreateManeuver = new JButton(Bundle.getString("btn_func_create_maneuver"));
btnExecManeuver = new JButton(Bundle.getString("btn_func_exec_maneuver"));
btnRover = new JButton(Bundle.getString("btn_func_rover"));
btnCancel = new JButton(Bundle.getString("pnl_tel_btn_cancel"));
}
Expand All @@ -75,10 +76,15 @@ public void setupComponents() {
btnLiftoff.setActionCommand(Modulos.MODULO_DECOLAGEM.get());
btnLiftoff.setMaximumSize(btnFuncDimension);
btnLiftoff.setPreferredSize(btnFuncDimension);
btnManeuver.addActionListener(this::changeFunctionPanel);
btnManeuver.setActionCommand(Modulos.MODULO_MANOBRAS.get());
btnManeuver.setMaximumSize(btnFuncDimension);
btnManeuver.setPreferredSize(btnFuncDimension);
btnCreateManeuver.addActionListener(this::changeFunctionPanel);
btnCreateManeuver.setActionCommand(Modulos.MODULO_CRIAR_MANOBRAS.get());
btnCreateManeuver.setMaximumSize(btnFuncDimension);
btnCreateManeuver.setPreferredSize(btnFuncDimension);
btnCreateManeuver.setEnabled(false);
btnExecManeuver.addActionListener(this::changeFunctionPanel);
btnExecManeuver.setActionCommand(Modulos.MODULO_EXEC_MANOBRAS.get());
btnExecManeuver.setMaximumSize(btnFuncDimension);
btnExecManeuver.setPreferredSize(btnFuncDimension);
btnRover.addActionListener(this::changeFunctionPanel);
btnRover.setActionCommand(Modulos.MODULO_ROVER.get());
btnRover.setMaximumSize(btnFuncDimension);
Expand All @@ -93,8 +99,10 @@ public void layoutComponents() {
pnlFunctionControls.add(MainGui.createMarginComponent(0, 4));
pnlFunctionControls.add(btnLiftoff);
pnlFunctionControls.add(btnLanding);
pnlFunctionControls.add(btnManeuver);
pnlFunctionControls.add(btnRover);
pnlFunctionControls.add(MainGui.createMarginComponent(0, 20));
pnlFunctionControls.add(btnCreateManeuver);
pnlFunctionControls.add(btnExecManeuver);
pnlFunctionControls.add(Box.createVerticalGlue());

JPanel pnlLeftPanel = new JPanel();
Expand Down Expand Up @@ -159,7 +167,7 @@ public void layoutComponents() {
}

private void changeFunctionPanel(ActionEvent e) {
MainGui.getCardJPanels().firePropertyChange(e.getActionCommand(), false, true);
MainGui.changeToPage(e);
}

public static void updateTelemetry(Map<Telemetry, Double> telemetryData) {
Expand Down
2 changes: 1 addition & 1 deletion src/com/pesterenan/views/LiftoffJPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void initComponents() {
txfFinalApoapsis = new JTextField("80000");
txfFinalApoapsis.setToolTipText(Bundle.getString("pnl_lift_txf_final_apo_tooltip"));
txfHeading = new JTextField("90");
txfLimitTWR = new JTextField("1.5");
txfLimitTWR = new JTextField("2.2");

// Buttons:
btnLiftoff = new JButton(Bundle.getString("pnl_lift_btn_liftoff"));
Expand Down
Loading