Skip to content

Commit

Permalink
0.1beta
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmunev committed Dec 18, 2020
1 parent 2dcbc1d commit 5b6aa25
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 10 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ manifest {

launch4j {
mainClassName = 'adda.Main'
icon = "${projectDir}/help/en/adda_logo.ico"
}

sourceSets {
Expand Down
Binary file added help/en/adda_logo.ico
Binary file not shown.
6 changes: 5 additions & 1 deletion src/main/java/adda/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ public void actionPerformed(ActionEvent e) {
openHelpSystem.addActionListener(new CSH.DisplayHelpFromSource(Context.getInstance().getHelpBroker()));

helpMenu.add(openHelpSystem);
helpMenu.add(new JMenuItem("About"));
final JMenuItem about = new JMenuItem("About");
about.addActionListener(e -> {
JOptionPane.showMessageDialog(null, "<html>Version <b>0.1beta</b>.<br> Use [email protected] to contact dev team</html>");
});
helpMenu.add(about);

menuBar.add(helpMenu);

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/adda/help/HelpProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ public static String getShortDescByClass(Class clazz) {
);
}

if (DipoleShapeModel.class.equals(clazz)) {
return StringHelper.toDisplayString(
"Use rectangular-cuboid dipoles. Three arguments are the relative dipole sizes along "+
"the corresponding axes. Absolute scale is not relevant, i.e. '1 2 2' is equivalent to '0.5 1 1'."
);
}

if (QextSaveModel.class.equals(clazz)) {
return StringHelper.toDisplayString(
"Calculate extinction cross section"
Expand Down
25 changes: 21 additions & 4 deletions src/main/java/adda/item/root/projectArea/ProjectAreaModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static java.nio.file.StandardCopyOption.*;

public class ProjectAreaModel extends ModelBase implements IModelObserver {

Expand Down Expand Up @@ -357,15 +360,29 @@ public void start() {
}
setRunning(true);
List<String> args = new ArrayList<String>();
String path = System.getProperty("user.dir");
String addaPath = path + "/win64/adda.exe";
args.add(addaPath);
String currentPath = System.getProperty("user.dir");
String binPath = currentPath + "/bin";
args.add(binPath + "/adda");
args.addAll(Arrays.asList(optionsModel.getActualCommandLine().split(" ")));
args.add("-dir");
Date now = new Date();
SimpleDateFormat pattern = new SimpleDateFormat("dd-MM-yyyy_HH_mm_ss");
args.add(Context.getInstance().getProjectTreeModel().getSelectedPath().getFolder() + "/run_" + pattern.format(now));
String path = Context.getInstance().getProjectTreeModel().getSelectedPath().getFolder() + "/run_" + pattern.format(now);
//path = path.replace("/", "\\");
args.add(path);

args.add("-so_buf");
args.add("no");

// try {
// File folder = new File(path);
// if (!folder.exists()) {
// folder.mkdir();
// }
// Files.copy(new File(String.format("%s/alldir_params.dat", binPath)).toPath(), new File(String.format("%s/alldir_params.dat", path)).toPath(), REPLACE_EXISTING);
// } catch (IOException e) {
// e.printStackTrace();
// }

ProcessBuilder builder = new ProcessBuilder(args);
builder.redirectErrorStream(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public void modelPropertyChanged(IModel sender, IModelPropertyChangeEvent event)
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
jtree.setSelectionRow(rowIndex);
jtree.expandRow(rowIndex);
}
});
break;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/adda/item/root/shortcut/ShortcutsView.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public void initFromModel(IModel model) {
panel.add( Box.createHorizontalStrut(20) );
Icon icon = IconFontSwing.buildIcon(FontAwesome.STEP_FORWARD, 25, Color.blue);
JButton button = new JButton("Prognosis",icon);
button.setEnabled(false);
// button.setBorder(new RoundedBorder(10)); //10 is the radius
panel.add(button);
prognosisButton = button;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/adda/item/tab/base/beam/BeamEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public enum BeamEnum {
@DisplayString("Gaussian beam (1st order)")
lminus,

@DisplayString("Gaussian beam (3st order)")
@DisplayString("Gaussian beam (3rd order)")
davis3,

@DisplayString("Gaussian beam (5st order)")
@DisplayString("Gaussian beam (5th order)")
barton5


Expand Down
3 changes: 1 addition & 2 deletions src/main/java/adda/item/tab/output/beam/BeamSaveModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@

public class BeamSaveModel extends BooleanFlagModel implements IModelObserver {

public static final String SAVE_BEAM = "save_beam";
public static final String SAVE_BEAM = "store_beam";

public BeamSaveModel() {
this.setLabel("Beam");//todo localization
isVisibleIfDisabled = true;
}


@Override
protected String getAddaCommand() {
return SAVE_BEAM;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected List<IAddaOption> getAddaOptionsInner() {
String file = "";
if (orientationAverageBox.getModel() != null && orientationAverageBox.getModel() instanceof OrientationAverageModel) {
file = ((OrientationAverageModel) orientationAverageBox.getModel()).getAverageFile();
file = StringHelper.isEmpty(file) ? " custom.dat" : (" " + file);
file = StringHelper.isEmpty(file) ? " avg_params.dat" : (" " + file);
}

return Arrays.asList(new AddaOption(ORIENT, commandValue + file, StringHelper.toDisplayString(enumValue) + file));
Expand Down

0 comments on commit 5b6aa25

Please sign in to comment.