From 7d789b22d3784e2dda70fed4ced8b89b3fb81382 Mon Sep 17 00:00:00 2001 From: 02090095 Date: Tue, 15 Oct 2024 20:25:51 +0300 Subject: [PATCH] no message --- .gitignore | 3 +- .idea/workspace.xml | 148 ++------------------------------ debug_properties/properties | 37 ++++++++ normal_properties/properties | 37 ++++++++ src/Common/ApplicationMode.java | 3 + src/Common/Module.java | 4 + src/Common/Utils/Utils_.java | 13 +++ 7 files changed, 100 insertions(+), 145 deletions(-) create mode 100644 debug_properties/properties create mode 100644 normal_properties/properties create mode 100644 src/Common/ApplicationMode.java create mode 100644 src/Common/Module.java diff --git a/.gitignore b/.gitignore index 0ee329cf..fb2f033f 100644 --- a/.gitignore +++ b/.gitignore @@ -48,5 +48,4 @@ Makefiles/* Repo/* Sts/* Tests/* -debug.log -properties \ No newline at end of file +debug.log \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index a93c4325..ebcf556b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,148 +7,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/debug_properties/properties b/debug_properties/properties new file mode 100644 index 00000000..d5052f4a --- /dev/null +++ b/debug_properties/properties @@ -0,0 +1,37 @@ +{ + "Mode": "Normal", + "ServerAddress": "alex-freenas.ddns.net", + "ServerUserName": "testuser", + "ServerUserSHHPort": 23, + "ComponentsServerPort": 7995, + "TestingServerPort": 7996, + "SocketTimeout": 5000, + "OldServer": false, + "SMTPHost": "smtp.mail.ru", + "SMTPPort": 465, + "MailSocketPort": 465, + "BackupWorkspace": "_sapfor_x64_backups", + "BackupHour": 5, + "BackupMinute": 0, + "EmailAdminsOnStart": false, + "AutoUpdateSearch": false, + "ConfirmPassesStart": true, + "ShowPassesDone": true, + "FocusPassesResult": true, + "GlobalDBName": "db7.sqlite", + "ProjectDBName": "new_project_base.sqlite", + "BugReportsDBName": "bug_reports.sqlite", + "TestsDBName": "tests.sqlite", + "ComponentsWindowWidth": 843, + "ComponentsWindowHeight": 250, + "VisualiserPath": "C:\\Users\\misha\\Downloads", + "Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F", + "Visualizer_2Path": "C:\\Users\\misha\\Documents", + "InstructionPath": "", + "PerformanceAnalyzerPath": "", + "ComponentsBackUpsCount": 10, + "TestingKernels": 28, + "AutoCheckTesting": false, + "CheckTestingIntervalSeconds": 10, + "EmailOnTestingProgress": false +} \ No newline at end of file diff --git a/normal_properties/properties b/normal_properties/properties new file mode 100644 index 00000000..e46897e5 --- /dev/null +++ b/normal_properties/properties @@ -0,0 +1,37 @@ +{ + "Mode": "Normal", + "ServerAddress": "alex-freenas.ddns.net", + "ServerUserName": "testuser", + "ServerUserSHHPort": 2000, + "ComponentsServerPort": 7995, + "TestingServerPort": 7998, + "SocketTimeout": 5000, + "OldServer": false, + "SMTPHost": "smtp.mail.ru", + "SMTPPort": 465, + "MailSocketPort": 465, + "BackupWorkspace": "_sapfor_x64_backups", + "BackupHour": 5, + "BackupMinute": 0, + "EmailAdminsOnStart": false, + "AutoUpdateSearch": false, + "ConfirmPassesStart": true, + "ShowPassesDone": true, + "FocusPassesResult": true, + "GlobalDBName": "db7.sqlite", + "ProjectDBName": "new_project_base.sqlite", + "BugReportsDBName": "bug_reports.sqlite", + "TestsDBName": "tests.sqlite", + "ComponentsWindowWidth": 843, + "ComponentsWindowHeight": 250, + "VisualiserPath": "C:\\Users\\misha\\Downloads", + "Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F", + "Visualizer_2Path": "C:\\Users\\misha\\Documents", + "InstructionPath": "", + "PerformanceAnalyzerPath": "", + "ComponentsBackUpsCount": 10, + "TestingKernels": 28, + "AutoCheckTesting": true, + "CheckTestingIntervalSeconds": 10, + "EmailOnTestingProgress": false +} \ No newline at end of file diff --git a/src/Common/ApplicationMode.java b/src/Common/ApplicationMode.java new file mode 100644 index 00000000..3eb3edba --- /dev/null +++ b/src/Common/ApplicationMode.java @@ -0,0 +1,3 @@ +package Common; +public interface ApplicationMode { +} diff --git a/src/Common/Module.java b/src/Common/Module.java new file mode 100644 index 00000000..0b97d6a1 --- /dev/null +++ b/src/Common/Module.java @@ -0,0 +1,4 @@ +package Common; +public class Module { + +} diff --git a/src/Common/Utils/Utils_.java b/src/Common/Utils/Utils_.java index 8eb5f0a8..fddfb68e 100644 --- a/src/Common/Utils/Utils_.java +++ b/src/Common/Utils/Utils_.java @@ -3,6 +3,8 @@ import Common.CommonConstants; import Common.Passes.PassException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; import org.apache.commons.io.FileUtils; import javax.swing.*; @@ -64,6 +66,17 @@ public class Utils_ { public static void jsonToFile(Object json_object, File file) throws Exception { FileUtils.writeStringToFile(file, gson.toJson(json_object)); } + public static JsonObject getPropertiesAsJsonObject() throws Exception{ + File propertiesFile = new File(System.getProperty("user.dir"), "properties"); + if (!propertiesFile.exists()){ + System.out.println("Файл properties не найден!"); + return null; + } + String packed = FileUtils.readFileToString(propertiesFile, Charset.defaultCharset()); + JsonParser parser = new JsonParser(); + JsonObject json = parser.parse(packed).getAsJsonObject(); + return json; + } //БУФЕР ОБМЕНА public static void CopyToClipboard(String text) { Toolkit.getDefaultToolkit()