mirror of
https://github.com/nasa/trick.git
synced 2025-06-17 06:38:27 +00:00
Added code to trick_dp that will check if fxplot exists. If it does then it will
add a radio button for it. If it doesn't exist, it will not show up in the plot menu.
This commit is contained in:
@ -2,8 +2,11 @@
|
|||||||
|
|
||||||
# trick_dp that determines trick_home based on execution location of this script.
|
# trick_dp that determines trick_home based on execution location of this script.
|
||||||
|
|
||||||
|
use FindBin qw($Bin);
|
||||||
|
use lib "$Bin/pm" ;
|
||||||
use File::Basename ;
|
use File::Basename ;
|
||||||
use Cwd 'abs_path';
|
use Cwd 'abs_path';
|
||||||
|
use gte ;
|
||||||
|
|
||||||
if ( ! exists $ENV{TRICK_HOME} ) {
|
if ( ! exists $ENV{TRICK_HOME} ) {
|
||||||
$trick_bin = dirname(abs_path($0)) ;
|
$trick_bin = dirname(abs_path($0)) ;
|
||||||
@ -12,6 +15,9 @@ if ( ! exists $ENV{TRICK_HOME} ) {
|
|||||||
# set TRICK_HOME based on the value of trick_home
|
# set TRICK_HOME based on the value of trick_home
|
||||||
$ENV{TRICK_HOME} = $trick_home ;
|
$ENV{TRICK_HOME} = $trick_home ;
|
||||||
}
|
}
|
||||||
|
$host_cpu = gte("TRICK_HOST_CPU") ;
|
||||||
|
chomp($host_cpu) ;
|
||||||
|
$ENV{TRICK_HOST_CPU} = $host_cpu ;
|
||||||
|
|
||||||
if ( $^O eq "darwin" ) {
|
if ( $^O eq "darwin" ) {
|
||||||
$command = "java -classpath $ENV{TRICK_HOME}/bin/java/dist/*:$ENV{TRICK_HOME}/bin/java/lib/*:$ENV{TRICK_HOME}/bin/java/lib/ \\
|
$command = "java -classpath $ENV{TRICK_HOME}/bin/java/dist/*:$ENV{TRICK_HOME}/bin/java/lib/*:$ENV{TRICK_HOME}/bin/java/lib/ \\
|
||||||
|
@ -98,6 +98,7 @@ public abstract class DataProductsApplication extends TrickApplication {
|
|||||||
protected static String TEMP_DP_FILE = "/tmp/DP_" + System.getenv("USER") + ".xml";
|
protected static String TEMP_DP_FILE = "/tmp/DP_" + System.getenv("USER") + ".xml";
|
||||||
protected static String TEMP_SESSION_FILE = "/tmp/Session_" + System.getenv("USER") + ".xml";
|
protected static String TEMP_SESSION_FILE = "/tmp/Session_" + System.getenv("USER") + ".xml";
|
||||||
|
|
||||||
|
protected boolean fermiExists ;
|
||||||
|
|
||||||
//========================================
|
//========================================
|
||||||
// Private Data
|
// Private Data
|
||||||
@ -110,6 +111,7 @@ public abstract class DataProductsApplication extends TrickApplication {
|
|||||||
// Options are: "Plot", "Table".
|
// Options are: "Plot", "Table".
|
||||||
private String displayMode;
|
private String displayMode;
|
||||||
|
|
||||||
|
|
||||||
//========================================
|
//========================================
|
||||||
// Constructors
|
// Constructors
|
||||||
//========================================
|
//========================================
|
||||||
@ -239,7 +241,11 @@ public abstract class DataProductsApplication extends TrickApplication {
|
|||||||
} else {
|
} else {
|
||||||
gnuplotButton.setIcon(resourceMap.getIcon("gnuplot.off.icon"));
|
gnuplotButton.setIcon(resourceMap.getIcon("gnuplot.off.icon"));
|
||||||
if (gnuplotRadioButton.isSelected()) {
|
if (gnuplotRadioButton.isSelected()) {
|
||||||
|
if ( fermiExists ) {
|
||||||
fermiRadioButton.setSelected(true);
|
fermiRadioButton.setSelected(true);
|
||||||
|
} else {
|
||||||
|
javaRadioButton.setSelected(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
getAction("selectGnuplotTerminal").setEnabled(false);
|
getAction("selectGnuplotTerminal").setEnabled(false);
|
||||||
}
|
}
|
||||||
@ -360,15 +366,26 @@ public abstract class DataProductsApplication extends TrickApplication {
|
|||||||
|
|
||||||
fermiRadioButton = new JRadioButtonMenuItem();
|
fermiRadioButton = new JRadioButtonMenuItem();
|
||||||
fermiRadioButton.setAction(getAction("selectFermi"));
|
fermiRadioButton.setAction(getAction("selectFermi"));
|
||||||
fermiRadioButton.setSelected(true);
|
|
||||||
|
|
||||||
javaRadioButton = new JRadioButtonMenuItem(getAction("selectJavaPlot"));
|
javaRadioButton = new JRadioButtonMenuItem(getAction("selectJavaPlot"));
|
||||||
|
|
||||||
|
String fermi_exe = UIUtils.getTrickHome() + "/trick_source/data_products/DPX/APPS/FXPLOT/object_" + UIUtils.getTrickHostCPU() + "/fxplot" ;
|
||||||
|
File f = new File(fermi_exe) ;
|
||||||
|
fermiExists = f.exists() ;
|
||||||
|
|
||||||
|
if ( fermiExists ) {
|
||||||
|
fermiRadioButton.setSelected(true);
|
||||||
|
} else {
|
||||||
|
javaRadioButton.setSelected(true);
|
||||||
|
}
|
||||||
|
|
||||||
gnuplotRadioButton = new JRadioButtonMenuItem();
|
gnuplotRadioButton = new JRadioButtonMenuItem();
|
||||||
gnuplotRadioButton.setAction(getAction("selectGnuplot"));
|
gnuplotRadioButton.setAction(getAction("selectGnuplot"));
|
||||||
|
|
||||||
radioButtonGroup = new ButtonGroup();
|
radioButtonGroup = new ButtonGroup();
|
||||||
|
if ( fermiExists ) {
|
||||||
radioButtonGroup.add(fermiRadioButton);
|
radioButtonGroup.add(fermiRadioButton);
|
||||||
|
}
|
||||||
radioButtonGroup.add(javaRadioButton);
|
radioButtonGroup.add(javaRadioButton);
|
||||||
radioButtonGroup.add(gnuplotRadioButton);
|
radioButtonGroup.add(gnuplotRadioButton);
|
||||||
|
|
||||||
|
@ -772,7 +772,11 @@ public class TrickDPApplication extends DataProductsApplication {
|
|||||||
settingsMenu.addSeparator();
|
settingsMenu.addSeparator();
|
||||||
|
|
||||||
settingsMenu.add(new JLabel("Plot Utility"));
|
settingsMenu.add(new JLabel("Plot Utility"));
|
||||||
|
if ( fermiExists ) {
|
||||||
addRadioButtonMenuItems(settingsMenu, new JRadioButtonMenuItem[]{fermiRadioButton, javaRadioButton, gnuplotRadioButton});
|
addRadioButtonMenuItems(settingsMenu, new JRadioButtonMenuItem[]{fermiRadioButton, javaRadioButton, gnuplotRadioButton});
|
||||||
|
} else {
|
||||||
|
addRadioButtonMenuItems(settingsMenu, new JRadioButtonMenuItem[]{javaRadioButton, gnuplotRadioButton});
|
||||||
|
}
|
||||||
|
|
||||||
settingsMenu.addSeparator();
|
settingsMenu.addSeparator();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user