Fixed NullPointerException which occurs if you use the analysis

features and never had stored or opened a circuit file. fixes #60
This commit is contained in:
helmut.neemann 2017-10-24 12:39:04 +02:00
parent 6a29441f89
commit c79f56de42

View File

@ -462,20 +462,20 @@ public class TableDialog extends JDialog {
hardware.add(createATF150XExporterMenu("ATF1502",
new ATF1502CuplExporter(),
new ExpressionToFileExporter(new ATF1502TT2Exporter(filename.getName()))
new ExpressionToFileExporter(new ATF1502TT2Exporter(getProjectName()))
.addProcessingStep(new StartATF1502Fitter(TableDialog.this))
.addProcessingStep(new CreateCHN("ATF1502AS"))
));
hardware.add(createATF150XExporterMenu("ATF1504",
new ATF1504CuplExporter(),
new ExpressionToFileExporter(new ATF1504TT2Exporter(filename.getName()))
new ExpressionToFileExporter(new ATF1504TT2Exporter(getProjectName()))
.addProcessingStep(new StartATF1504Fitter(TableDialog.this))
.addProcessingStep(new CreateCHN("ATF1504AS"))
));
/*
hardware.add(createATF150XExporterMenu("ATF1508",
new ATF1508CuplExporter(),
new ExpressionToFileExporter(new ATF1508TT2Exporter(filename.getName()))
new ExpressionToFileExporter(new ATF1508TT2Exporter(getProjectName()))
.addProcessingStep(new StartATF1508Fitter(TableDialog.this))
.addProcessingStep(new CreateCHN("ATF1508AS"))
));*/
@ -604,6 +604,12 @@ public class TableDialog extends JDialog {
calculateExpressions();
}
private String getProjectName() {
if (filename==null)
return "unknown";
else return filename.getName();
}
private class CalculationTableModelListener implements TableModelListener {
@Override
public void tableChanged(TableModelEvent tableModelEvent) {