From bc9c19b14ce7a487563f3c3e9074b1e2915d0317 Mon Sep 17 00:00:00 2001 From: 02090095 Date: Wed, 29 Nov 2023 14:25:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B5=D0=B4=D0=BE=D1=87=D0=B5?= =?UTF-8?q?=D1=82=D0=B0=20=D1=81=20spf=20=D0=B4=D0=B8=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=B8=D0=B2=D0=B0=D0=BC=D0=B8.=20=D0=9F=D1=83=D1=81?= =?UTF-8?q?=D1=82=D1=8B=D0=B5=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=B0=D0=BA=D0=B5=D1=82=D0=B0=20=D0=BE=D1=82=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B6=D0=B0=D1=8E=D1=82=D1=81=D1=8F=20=D1=81=D0=B5?= =?UTF-8?q?=D1=80=D1=8B=D0=BC.=20v++?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 15 +++++++++---- src/Repository/Component/Sapfor/Sapfor.java | 4 ++-- src/Repository/Component/Visualiser.java | 2 +- src/TestingSystem/Common/TestingServer.java | 5 ++--- .../SAPFOR/Json/SapforVersionState.java | 6 +++++ .../SAPFOR/Json/SapforVersion_json.java | 7 ++++-- .../SAPFOR/PerformSapforTask.java | 13 ++++++----- .../SAPFOR/SapforTask/SapforTask.java | 21 ++++++++++-------- .../SapforTasksPackage/UI/VersionSummary.java | 12 +++++----- .../SapforTasksPackageSupervisor.java | 4 +++- src/icons/versions/Empty.png | Bin 0 -> 653 bytes src/icons/versions/HasErrors.png | Bin 0 -> 690 bytes .../versions/{TestVersion.png => Normal.png} | Bin 13 files changed, 56 insertions(+), 33 deletions(-) create mode 100644 src/TestingSystem/SAPFOR/Json/SapforVersionState.java create mode 100644 src/icons/versions/Empty.png create mode 100644 src/icons/versions/HasErrors.png rename src/icons/versions/{TestVersion.png => Normal.png} (100%) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b781c6b9..37565620 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -7,8 +7,15 @@ + - + + + + + + + @@ -86,7 +93,7 @@ - + @@ -99,8 +106,8 @@ - + diff --git a/src/Repository/Component/Sapfor/Sapfor.java b/src/Repository/Component/Sapfor/Sapfor.java index a1b0b319..5d7c22d2 100644 --- a/src/Repository/Component/Sapfor/Sapfor.java +++ b/src/Repository/Component/Sapfor/Sapfor.java @@ -450,7 +450,7 @@ public abstract class Sapfor extends OSDComponent { FileUtils.write(file, Utils.DQuotes(sapfor_drv) + (flags.isEmpty() ? "" : (" " + flags)) - + " -noLogo -spf" + + " -noLogo" + " " + command + " 1>" + Utils.DQuotes(outputFile.getAbsolutePath()) + @@ -500,7 +500,7 @@ public abstract class Sapfor extends OSDComponent { "parse", sapfor_drv, workspace, - "-parse *.f *.for *.fdv *.f90 *.f77", + "-parse -spf *.f *.for *.fdv *.f90 *.f77", flags, Constants.parse_out_file, Constants.parse_err_file) diff --git a/src/Repository/Component/Visualiser.java b/src/Repository/Component/Visualiser.java index ed2314fe..2478d0e6 100644 --- a/src/Repository/Component/Visualiser.java +++ b/src/Repository/Component/Visualiser.java @@ -62,7 +62,7 @@ public class Visualiser extends Component { //http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html @Override public void GetVersionInfo() { - version = 1040; + version = 1041; String pattern = "MMM dd yyyy HH:mm:ss"; DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH); date_text = df.format(getClassBuildTime()); diff --git a/src/TestingSystem/Common/TestingServer.java b/src/TestingSystem/Common/TestingServer.java index dcf625a7..b4f29082 100644 --- a/src/TestingSystem/Common/TestingServer.java +++ b/src/TestingSystem/Common/TestingServer.java @@ -488,7 +488,7 @@ public class TestingServer extends RepositoryServer { test.sender_name = account.name; test.sender_address = account.email; test.group_id = group.id; - test.files=file.getName(); + test.files = file.getName(); db.Insert(test); testsIds.add(test); //->> @@ -512,8 +512,7 @@ public class TestingServer extends RepositoryServer { //-- if (Sapfor.getMinMaxDim(Sapfor.getTempCopy(new File(sapfor.call_command)), tempProject, test)) { db.Update(test); - } - else + } else throw new RepositoryRefuseException("Не удалось определить размерность теста " + Utils.Brackets(test.description)); break; case c: diff --git a/src/TestingSystem/SAPFOR/Json/SapforVersionState.java b/src/TestingSystem/SAPFOR/Json/SapforVersionState.java new file mode 100644 index 00000000..3c7cc084 --- /dev/null +++ b/src/TestingSystem/SAPFOR/Json/SapforVersionState.java @@ -0,0 +1,6 @@ +package TestingSystem.SAPFOR.Json; +public enum SapforVersionState { + Empty, //версия оказалась пуста. + Normal, //версия построена + HasErrors //в журнале версии есть ошибки. то есть, не удалось построить следующую версию. +} diff --git a/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java b/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java index 8dcd7c1d..b54cf881 100644 --- a/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java +++ b/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java @@ -25,7 +25,6 @@ public class SapforVersion_json implements Serializable { public String version = ""; @Expose public String description = ""; - public boolean success = true; //поля для отображения деревьев. public File Home = null; public LinkedHashMap files = new LinkedHashMap<>(); @@ -50,7 +49,8 @@ public class SapforVersion_json implements Serializable { public String toString() { return Home.getName() + " : " + Utils.Brackets(description); } - public void init(File configurationRoot) { + public SapforVersionState init(File configurationRoot) { + SapforVersionState state = SapforVersionState.Empty; String relativePath = Global.isWindows ? Utils.toW(version) : version; Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile(); files = new LinkedHashMap<>(); @@ -66,11 +66,14 @@ public class SapforVersion_json implements Serializable { } } } + if (!files.isEmpty()) + state = SapforVersionState.Normal; } parse_out = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_out_file).toFile()); parse_err = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.parse_err_file).toFile()); out = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.out_file).toFile()); err = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.err_file).toFile()); + return state; } public boolean isMatch(SapforVersion_json version_json) { if (!description.equals(version_json.description)) { diff --git a/src/TestingSystem/SAPFOR/PerformSapforTask.java b/src/TestingSystem/SAPFOR/PerformSapforTask.java index f6e4c2e7..c0039566 100644 --- a/src/TestingSystem/SAPFOR/PerformSapforTask.java +++ b/src/TestingSystem/SAPFOR/PerformSapforTask.java @@ -20,7 +20,7 @@ public class PerformSapforTask extends Pass_2021 { @Override public String getDescription() { return ""; - // "Запуск задачи SAPFOR"; Оставляем пустое описание чтобы не засорять журнал. + // "Запуск задачи SAPFOR"; Оставляем пустое описание чтобы не засорять журнал. } @Override protected boolean needsAnimation() { @@ -29,6 +29,7 @@ public class PerformSapforTask extends Pass_2021 { //-- File sapfor_drv; SapforConfiguration_json sapforConfiguration_json; + SapforVersion_json version_json; //----- File root; File parentTask; @@ -39,6 +40,7 @@ public class PerformSapforTask extends Pass_2021 { sapfor_drv = (File) args[0]; sapforConfiguration_json = (SapforConfiguration_json) args[1]; target = (SapforTask) args[2]; + version_json = null; //--->> parentTask = Paths.get(Global.Home, String.valueOf(sapforConfiguration_json.id), target.test_description).toFile(); root = new File(Global.Home, String.valueOf(sapforConfiguration_json.id)); @@ -47,9 +49,9 @@ public class PerformSapforTask extends Pass_2021 { return true; } protected boolean parse() throws Exception { - if (Sapfor.parse(sapfor_drv, parentTask, target.flags)){ + if (Sapfor.parse(sapfor_drv, parentTask, target.flags)) { return true; - }else { + } else { target.state = TaskState.DoneWithErrors; return false; } @@ -59,7 +61,7 @@ public class PerformSapforTask extends Pass_2021 { task = new File(parentTask, "v1"); Utils.CheckAndCleanDirectory(task); //папка для преобразования. //если версия пустая, это тоже результат тестирования. Поэтому должна учитываться в древе. - target.versions.add(new SapforVersion_json( + target.versions.add(version_json =new SapforVersion_json( root.getAbsolutePath(), task.getAbsolutePath(), code.getDescription())); //--- @@ -97,7 +99,6 @@ public class PerformSapforTask extends Pass_2021 { files.sort(Comparator.comparingInt(o -> Integer.parseInt(o.getName().substring(1)))); for (File file : files) target.variants.add( - new SapforVersion_json( root.getAbsolutePath(), file.getAbsolutePath(), PassCode_2021.SPF_CreateParallelVariant.getDescription())); @@ -107,7 +108,7 @@ public class PerformSapforTask extends Pass_2021 { @Override protected void body() throws Exception { target.StartDate = new Date().getTime(); - target.versions.add(new SapforVersion_json(target.test_description, "")); + target.versions.add(version_json = new SapforVersion_json(target.test_description, "")); for (PassCode_2021 code : sapforConfiguration_json.codes) { if (parse()) { if (code.equals(PassCode_2021.CreateParallelVariants)) diff --git a/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java b/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java index 3e84b41e..94b0b3c4 100644 --- a/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java +++ b/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java @@ -4,6 +4,7 @@ import Common.Current; import Common.Database.DBObject; import Common.Utils.Utils; import GlobalData.Tasks.TaskState; +import TestingSystem.SAPFOR.Json.SapforVersionState; import TestingSystem.SAPFOR.Json.SapforVersion_json; import TestingSystem.SAPFOR.SapforTasksPackage.UI.VersionSummary; import Visual_DVM_2021.Passes.PassCode_2021; @@ -75,29 +76,31 @@ public class SapforTask extends DBObject { public SapforTask() { } public DefaultMutableTreeNode getVersionsTree(File configurationRoot) { - DefaultMutableTreeNode root = null; - DefaultMutableTreeNode child = null; - DefaultMutableTreeNode parent = null; + VersionSummary root = null; + VersionSummary child = null; + VersionSummary parent = null; //-- for (SapforVersion_json version_json : versions) { - version_json.init(configurationRoot); version_json.task = this; //- - child = new VersionSummary(version_json); + child = new VersionSummary(version_json, version_json.init(configurationRoot)); if (parent == null) { root = child; parent = child; } else { - parent.add(child); - parent = child; + if (!child.state.equals(SapforVersionState.Empty)) { + parent.add(child); + parent = child; + } } //- } if (parent != null) { for (SapforVersion_json version_json : variants) { - version_json.init(configurationRoot); version_json.task = this; - parent.add(new VersionSummary(version_json)); + if (!child.state.equals(SapforVersionState.Empty)) { + parent.add(new VersionSummary(version_json, version_json.init(configurationRoot))); + } } } //-- diff --git a/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionSummary.java b/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionSummary.java index 308aba34..bd0739b5 100644 --- a/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionSummary.java +++ b/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionSummary.java @@ -1,20 +1,22 @@ package TestingSystem.SAPFOR.SapforTasksPackage.UI; +import TestingSystem.SAPFOR.Json.SapforVersionState; import TestingSystem.SAPFOR.Json.SapforVersion_json; -public class VersionSummary extends SapforPackageTreeNode{ - +public class VersionSummary extends SapforPackageTreeNode { public String version_name = ""; public String version_description = ""; - public VersionSummary(SapforVersion_json version_json) { + public SapforVersionState state = SapforVersionState.Empty; + public VersionSummary(SapforVersion_json version_json, SapforVersionState state_in) { setUserObject(version_json); version_name = version_json.Home.getName(); version_description = version_json.description; + state = state_in; } @Override public String getImageKey() { - return "TestVersion"; + return state.toString(); } @Override public String toString() { - return version_name+ " : " +version_description; + return version_name + " : " + version_description; } } diff --git a/src/TestingSystem/SAPFOR/SapforTasksPackageSupervisor/SapforTasksPackageSupervisor.java b/src/TestingSystem/SAPFOR/SapforTasksPackageSupervisor/SapforTasksPackageSupervisor.java index beb51db5..a439a674 100644 --- a/src/TestingSystem/SAPFOR/SapforTasksPackageSupervisor/SapforTasksPackageSupervisor.java +++ b/src/TestingSystem/SAPFOR/SapforTasksPackageSupervisor/SapforTasksPackageSupervisor.java @@ -169,7 +169,9 @@ public class SapforTasksPackageSupervisor { //Очистка //очистка служебных файлов. Utils.deleteFilesByExtensions(new File(sapforTasksPackage.workspace), - "proj", "dep", "jar", "sh", "exe", "bat"); + "proj", "dep", "jar" + // ,"sh", "exe", "bat" + ); } public void Perform() throws Exception { if (packageNeedsKill()) { diff --git a/src/icons/versions/Empty.png b/src/icons/versions/Empty.png new file mode 100644 index 0000000000000000000000000000000000000000..cfbb7f310798a70b5b73d9a194b56f5e6cbbb732 GIT binary patch literal 653 zcmV;80&@L{P)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ;6G=otRCwBaQA0((IMFEwR;HJkzVDrLv)Lt)t2LjpR%ID8oU`gn5p^IpH#f&>fmKxiBx8(iSXzVW>=Gc!vMfkC zf+?jeqN*fsM!WG0s*x&2#fmW|f^Z7-eb-0)AF5h7fvO|Xwjs1a8UX)N0R&VPBvb*Y z77D0?YTtLUuM3;Wm5!i7`PT<9Cf8}93I|2%mgQ*O@9Za)oKh6cS+ap6v#1jb}~=nW!H5{l2BD?=#2H=`hgXJwsln>tEvMKV{?3ZcD`J<)}*YINQe?p z()vMJj>)iE#+$tffIkBOzu87h2K3QB00000NkvXXu0mjfmZBc^ literal 0 HcmV?d00001 diff --git a/src/icons/versions/HasErrors.png b/src/icons/versions/HasErrors.png new file mode 100644 index 0000000000000000000000000000000000000000..61747e727d0fe442cfe1dbd615b40e68706d0651 GIT binary patch literal 690 zcmV;j0!{siP)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ;I7vi7RCwAax<34oZ{ z+u7mA4;I*Zvg>BncTeZPj+9QIB$O6Xf+#Gc+0z%zzeyd9$ocjK*3q?2kLyU~}VvNg)&$ z#jHP=l@k?1(5;s21SV2~=5-z0ZFg}YgU8)0Ng5{0f@cWfjRCVF678ksG-iVUAi9PIh8EDK0fuPsB&;XzS_;M z7b*sz5INeb;nrrkv+KaYdmmzmF$9j014r*;tljF_!Tm{}7>dB&+kR*Dug=Fl)D%1c zlA%cnsg=}HQSF4CZq_GshP$;wNPRdZUnEH&*+NvZO8@7