mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-17 08:55:05 -04:00
improved error message if hdl code parsing failed, closes #293
This commit is contained in:
parent
bde8a3bc8f
commit
0a3dac09cf
@ -797,7 +797,8 @@ public final class EditorFactory {
|
|||||||
if (app != null) {
|
if (app != null) {
|
||||||
try {
|
try {
|
||||||
getAttributeDialog().storeEditedValues();
|
getAttributeDialog().storeEditedValues();
|
||||||
if (app.ensureConsistency(elementAttributes))
|
final boolean consistent = app.ensureConsistency(elementAttributes);
|
||||||
|
if (consistent)
|
||||||
getAttributeDialog().updateEditedValues();
|
getAttributeDialog().updateEditedValues();
|
||||||
|
|
||||||
PortDefinition ins = new PortDefinition(elementAttributes.get(Keys.EXTERNAL_INPUTS));
|
PortDefinition ins = new PortDefinition(elementAttributes.get(Keys.EXTERNAL_INPUTS));
|
||||||
@ -807,10 +808,11 @@ public final class EditorFactory {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
String message = app.checkCode(label, code, ins, outs);
|
String message = app.checkCode(label, code, ins, outs);
|
||||||
if (message != null && !message.isEmpty())
|
if (message != null && !message.isEmpty()) {
|
||||||
new ErrorMessage(Lang.get("msg_checkResult") + "\n\n" + message).show(getAttributeDialog());
|
createError(consistent, Lang.get("msg_checkResult") + "\n\n" + message).show(getAttributeDialog());
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
new ErrorMessage(Lang.get("msg_checkResult")).addCause(e).show(getAttributeDialog());
|
createError(consistent, Lang.get("msg_checkResult")).addCause(e).show(getAttributeDialog());
|
||||||
}
|
}
|
||||||
} catch (EditorParseException e) {
|
} catch (EditorParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -818,6 +820,13 @@ public final class EditorFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ErrorMessage createError(boolean consistent, String message) {
|
||||||
|
if (!consistent)
|
||||||
|
message = Lang.get("msg_codeNotConsistent") + "\n\n" + message;
|
||||||
|
return new ErrorMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
}.setToolTip(Lang.get("btn_checkCode_tt")).createJButton();
|
}.setToolTip(Lang.get("btn_checkCode_tt")).createJButton();
|
||||||
combo.addActionListener(new AbstractAction() {
|
combo.addActionListener(new AbstractAction() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1689,6 +1689,8 @@ Soll dennoch exportiert werden?</string>
|
|||||||
<string name="btn_checkCode_tt">Startet die Anwendung um zu prüfen, ob der eingegebene Code korrekt ist. Falls das
|
<string name="btn_checkCode_tt">Startet die Anwendung um zu prüfen, ob der eingegebene Code korrekt ist. Falls das
|
||||||
nicht der Fall ist, wird die Fehlermeldung der externen Anwendung angezeigt. Wenn es möglich ist, werden zudem
|
nicht der Fall ist, wird die Fehlermeldung der externen Anwendung angezeigt. Wenn es möglich ist, werden zudem
|
||||||
die Eingangs- und Ausgangsdefinitionen an den aktuellen Code angepasst.</string>
|
die Eingangs- und Ausgangsdefinitionen an den aktuellen Code angepasst.</string>
|
||||||
|
<string name="msg_codeNotConsistent">Ein- und Ausgängsdefinitionen konnten nicht automatisch erzeugt werden.
|
||||||
|
Bitte prüfen Sie die Einstellungen!</string>
|
||||||
<string name="msg_applicationFileNotFound">Ausführbare Datei "{0}" nicht gefunden!</string>
|
<string name="msg_applicationFileNotFound">Ausführbare Datei "{0}" nicht gefunden!</string>
|
||||||
<string name="msg_enterText">Text eingeben!</string>
|
<string name="msg_enterText">Text eingeben!</string>
|
||||||
<string name="btn_startATMISP">Starte ATMISP</string>
|
<string name="btn_startATMISP">Starte ATMISP</string>
|
||||||
|
@ -1669,6 +1669,8 @@
|
|||||||
<string name="btn_checkCode_tt">Starts the application to check if the entered code is correct.
|
<string name="btn_checkCode_tt">Starts the application to check if the entered code is correct.
|
||||||
If this is not the case, the error message of the external application is displayed.
|
If this is not the case, the error message of the external application is displayed.
|
||||||
If possible, the input and output definitions are also adapted to the current code.</string>
|
If possible, the input and output definitions are also adapted to the current code.</string>
|
||||||
|
<string name="msg_codeNotConsistent">Input and output definitions could not be created automatically.
|
||||||
|
Please check the settings!</string>
|
||||||
<string name="msg_applicationFileNotFound">Executable file "{0}" not found!</string>
|
<string name="msg_applicationFileNotFound">Executable file "{0}" not found!</string>
|
||||||
<string name="msg_enterText">Enter Text!</string>
|
<string name="msg_enterText">Enter Text!</string>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user