From 1643562e75f81eb4a5e42ae221632eaf4724275d Mon Sep 17 00:00:00 2001 From: jwansek Date: Mon, 13 Dec 2021 13:29:47 +0000 Subject: fixed bug with gui --- src/PythonIDE/src/esotericFORTRANIDE.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/PythonIDE/src/esotericFORTRANIDE.py b/src/PythonIDE/src/esotericFORTRANIDE.py index 721e629..190484d 100644 --- a/src/PythonIDE/src/esotericFORTRANIDE.py +++ b/src/PythonIDE/src/esotericFORTRANIDE.py @@ -185,7 +185,7 @@ class ApplicationMenu(tk.Menu): self.add_cascade(label = "Run", menu = self.run_menu) self.run_menu.add_command( label = "Clear results", - command = self.parent.results_pane.clear_results(), + command = self.parent.results_pane.clear_results, accelerator = "F4" ) self.run_menu.add_command( -- cgit v1.2.3 From 4f4fb2772afa9d77bc4063373ac3e83d20be06a4 Mon Sep 17 00:00:00 2001 From: "chris.sutcliffe" Date: Mon, 13 Dec 2021 17:05:17 +0000 Subject: fix maths linker error --- src/Compiler/ExecuteC.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Compiler/ExecuteC.java b/src/Compiler/ExecuteC.java index 128f541..ede9bd6 100644 --- a/src/Compiler/ExecuteC.java +++ b/src/Compiler/ExecuteC.java @@ -70,14 +70,15 @@ public class ExecuteC { public Boolean compileC(){ try{ Process p; + // -lm to links maths library that is not included by default if (System.getProperty("os.name").equals("Linux")) { p = Runtime.getRuntime().exec(String.format( - "gcc %s/%s.c -o %s/%s", + "gcc %s/%s.c -o %s/%s -lm", buildToDir.toString(), filename, buildToDir.toString(), filename )); } else { p = Runtime.getRuntime().exec(String.format( - "cmd /C gcc %s -o %s", + "cmd /C gcc %s -o %s -lm", Paths.get(buildToDir.toString(), String.format("%s.c", filename)).toString(), Paths.get(buildToDir.toString(), String.format("%s.exe", filename)).toString() )); @@ -121,5 +122,9 @@ public class ExecuteC { } System.out.println(); return null; - } + } + + public static void main(String[] args) { + System.out.println("ExecuteC class testing"); + } } -- cgit v1.2.3 From 587c5fdc3eb3a6985c38908150c32e46623ffa26 Mon Sep 17 00:00:00 2001 From: "chris.sutcliffe" Date: Mon, 13 Dec 2021 22:32:24 +0000 Subject: add very simple utils testing --- src/Compiler/Utils.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Compiler/Utils.java b/src/Compiler/Utils.java index d0206c1..b19320e 100644 --- a/src/Compiler/Utils.java +++ b/src/Compiler/Utils.java @@ -27,10 +27,17 @@ public class Utils { public static void main(String[] args) throws Exception { String currentPath = new java.io.File(".").getCanonicalPath(); - System.out.println("Current dir:" + currentPath); - String helpfile = readFile("Compiler/helpfile.txt"); - System.out.println(helpfile); + System.out.println("Util class testing"); + + try { + String helpfile = readFile("Compiler/helpfile.txt"); + System.out.println("File read success"); + } + catch (Exception e) { + System.out.println("File read failure"); + } + } -- cgit v1.2.3 From 70444a3c067fd72d7580d6c483ffad28c6c24f6a Mon Sep 17 00:00:00 2001 From: "chris.sutcliffe" Date: Mon, 13 Dec 2021 22:44:22 +0000 Subject: ass basic test file (to be expanded) --- src/testing/fortran_test_src/basic_tests.ft | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/testing/fortran_test_src/basic_tests.ft (limited to 'src') diff --git a/src/testing/fortran_test_src/basic_tests.ft b/src/testing/fortran_test_src/basic_tests.ft new file mode 100644 index 0000000..1529dc2 --- /dev/null +++ b/src/testing/fortran_test_src/basic_tests.ft @@ -0,0 +1,3 @@ +character (len=11)::test +test = "hello world" +print*,test -- cgit v1.2.3 From 659e0e2c125772600079854bef65806f65a5a358 Mon Sep 17 00:00:00 2001 From: "chris.sutcliffe" Date: Tue, 14 Dec 2021 01:40:58 +0000 Subject: add file reload from disk feature, correct typo in comments --- src/PythonIDE/src/esotericFORTRANIDE.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/PythonIDE/src/esotericFORTRANIDE.py b/src/PythonIDE/src/esotericFORTRANIDE.py index 190484d..054d131 100644 --- a/src/PythonIDE/src/esotericFORTRANIDE.py +++ b/src/PythonIDE/src/esotericFORTRANIDE.py @@ -44,6 +44,7 @@ class Application(tk.Tk): self.bind('', lambda a: self.open_file()) self.bind('', lambda a: self.save_file()) self.bind('', lambda a: self.save_file_as()) + self.bind('', lambda a: self.reload_file()) self.bind('', lambda a: self.results_pane.clear_results()) self.bind('', lambda a: self.execute()) self.protocol("WM_DELETE_WINDOW", self.exit) @@ -54,7 +55,7 @@ class Application(tk.Tk): def open_file(self): """Called when the user selects the button to open a file or the - nessicary keyboard shortcuts. File is opened and inserted into the tk.Text + necessary keyboard shortcuts. File is opened and inserted into the tk.Text """ dia = filedialogue.askopenfilename( initialdir = self.__get_initial_dir(), @@ -84,6 +85,10 @@ class Application(tk.Tk): self.current_file = f.name self.title("esotericFORTRAN IDE - %s" % str(f.name)) + def reload_file(self): + with open(self.current_file, "r") as f: + self.fortran_frame.replace_text_with("".join(f.readlines())) + def exit(self): print("exit") exit() @@ -174,6 +179,11 @@ class ApplicationMenu(tk.Menu): accelerator = "Ctrl+Shift+S", command = self.parent.save_file_as ) + self.file_menu.add_command( + label = "Reload File From Disk", + accelerator = "F3", + command = self.parent.reload_file + ) self.file_menu.add_separator() self.file_menu.add_command( label = "Exit", -- cgit v1.2.3