Исправление недочета с spf директивами. Пустые версии пакета отображаются серым. v++

This commit is contained in:
2023-11-29 14:25:10 +03:00
parent ac3024a2d4
commit bc9c19b14c
13 changed files with 56 additions and 33 deletions

15
.idea/workspace.xml generated
View File

@@ -7,8 +7,15 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersionState.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Sapfor/Sapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Sapfor/Sapfor.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/PerformSapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/PerformSapforTask.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionSummary.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionSummary.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/icons/versions/TestVersion.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/icons/versions/Empty.png" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -30,8 +37,8 @@
<list> <list>
<option value="FxmlFile" /> <option value="FxmlFile" />
<option value="Interface" /> <option value="Interface" />
<option value="Enum" />
<option value="Class" /> <option value="Class" />
<option value="Enum" />
</list> </list>
</option> </option>
</component> </component>
@@ -86,7 +93,7 @@
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.SHOW" value="true" /> <property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.SHOW" value="true" />
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" /> <property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" />
<property name="extract.method.default.visibility" value="public" /> <property name="extract.method.default.visibility" value="public" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/icons/Transformations" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/src/icons/versions" />
<property name="project.structure.last.edited" value="Artifacts" /> <property name="project.structure.last.edited" value="Artifacts" />
<property name="project.structure.proportion" value="0.15" /> <property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.2" />
@@ -99,8 +106,8 @@
<recent name="controls.Trees" /> <recent name="controls.Trees" />
</key> </key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\Transformations" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" /> <recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\Transformations" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons" /> <recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons" />
<recent name="C:\Users\misha\Documents\visual_dvm_2020\src\icons" /> <recent name="C:\Users\misha\Documents\visual_dvm_2020\src\icons" />
<recent name="C:\Users\misha\Documents\visual_dvm_2020\src\icons\Transformations" /> <recent name="C:\Users\misha\Documents\visual_dvm_2020\src\icons\Transformations" />

View File

@@ -450,7 +450,7 @@ public abstract class Sapfor extends OSDComponent {
FileUtils.write(file, FileUtils.write(file,
Utils.DQuotes(sapfor_drv) Utils.DQuotes(sapfor_drv)
+ (flags.isEmpty() ? "" : (" " + flags)) + (flags.isEmpty() ? "" : (" " + flags))
+ " -noLogo -spf" + " -noLogo"
+ " " + command + + " " + command +
" 1>" + " 1>" +
Utils.DQuotes(outputFile.getAbsolutePath()) + Utils.DQuotes(outputFile.getAbsolutePath()) +
@@ -500,7 +500,7 @@ public abstract class Sapfor extends OSDComponent {
"parse", "parse",
sapfor_drv, sapfor_drv,
workspace, workspace,
"-parse *.f *.for *.fdv *.f90 *.f77", "-parse -spf *.f *.for *.fdv *.f90 *.f77",
flags, flags,
Constants.parse_out_file, Constants.parse_out_file,
Constants.parse_err_file) Constants.parse_err_file)

View File

@@ -62,7 +62,7 @@ public class Visualiser extends Component {
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html //http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
@Override @Override
public void GetVersionInfo() { public void GetVersionInfo() {
version = 1040; version = 1041;
String pattern = "MMM dd yyyy HH:mm:ss"; String pattern = "MMM dd yyyy HH:mm:ss";
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH); DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
date_text = df.format(getClassBuildTime()); date_text = df.format(getClassBuildTime());

View File

@@ -488,7 +488,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
test.sender_name = account.name; test.sender_name = account.name;
test.sender_address = account.email; test.sender_address = account.email;
test.group_id = group.id; test.group_id = group.id;
test.files=file.getName(); test.files = file.getName();
db.Insert(test); db.Insert(test);
testsIds.add(test); testsIds.add(test);
//->> //->>
@@ -512,8 +512,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
//-- //--
if (Sapfor.getMinMaxDim(Sapfor.getTempCopy(new File(sapfor.call_command)), tempProject, test)) { if (Sapfor.getMinMaxDim(Sapfor.getTempCopy(new File(sapfor.call_command)), tempProject, test)) {
db.Update(test); db.Update(test);
} } else
else
throw new RepositoryRefuseException("Не удалось определить размерность теста " + Utils.Brackets(test.description)); throw new RepositoryRefuseException("Не удалось определить размерность теста " + Utils.Brackets(test.description));
break; break;
case c: case c:

View File

@@ -0,0 +1,6 @@
package TestingSystem.SAPFOR.Json;
public enum SapforVersionState {
Empty, //версия оказалась пуста.
Normal, //версия построена
HasErrors //в журнале версии есть ошибки. то есть, не удалось построить следующую версию.
}

View File

@@ -25,7 +25,6 @@ public class SapforVersion_json implements Serializable {
public String version = ""; public String version = "";
@Expose @Expose
public String description = ""; public String description = "";
public boolean success = true;
//поля для отображения деревьев. //поля для отображения деревьев.
public File Home = null; public File Home = null;
public LinkedHashMap<String, ProjectFile> files = new LinkedHashMap<>(); public LinkedHashMap<String, ProjectFile> files = new LinkedHashMap<>();
@@ -50,7 +49,8 @@ public class SapforVersion_json implements Serializable {
public String toString() { public String toString() {
return Home.getName() + " : " + Utils.Brackets(description); 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; String relativePath = Global.isWindows ? Utils.toW(version) : version;
Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile(); Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile();
files = new LinkedHashMap<>(); 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_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()); 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()); 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()); err = new ProjectFile(Paths.get(Home.getAbsolutePath(), Constants.data, Constants.err_file).toFile());
return state;
} }
public boolean isMatch(SapforVersion_json version_json) { public boolean isMatch(SapforVersion_json version_json) {
if (!description.equals(version_json.description)) { if (!description.equals(version_json.description)) {

View File

@@ -29,6 +29,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
//-- //--
File sapfor_drv; File sapfor_drv;
SapforConfiguration_json sapforConfiguration_json; SapforConfiguration_json sapforConfiguration_json;
SapforVersion_json version_json;
//----- //-----
File root; File root;
File parentTask; File parentTask;
@@ -39,6 +40,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
sapfor_drv = (File) args[0]; sapfor_drv = (File) args[0];
sapforConfiguration_json = (SapforConfiguration_json) args[1]; sapforConfiguration_json = (SapforConfiguration_json) args[1];
target = (SapforTask) args[2]; target = (SapforTask) args[2];
version_json = null;
//--->> //--->>
parentTask = Paths.get(Global.Home, String.valueOf(sapforConfiguration_json.id), target.test_description).toFile(); parentTask = Paths.get(Global.Home, String.valueOf(sapforConfiguration_json.id), target.test_description).toFile();
root = new File(Global.Home, String.valueOf(sapforConfiguration_json.id)); root = new File(Global.Home, String.valueOf(sapforConfiguration_json.id));
@@ -47,9 +49,9 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
return true; return true;
} }
protected boolean parse() throws Exception { protected boolean parse() throws Exception {
if (Sapfor.parse(sapfor_drv, parentTask, target.flags)){ if (Sapfor.parse(sapfor_drv, parentTask, target.flags)) {
return true; return true;
}else { } else {
target.state = TaskState.DoneWithErrors; target.state = TaskState.DoneWithErrors;
return false; return false;
} }
@@ -59,7 +61,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
task = new File(parentTask, "v1"); task = new File(parentTask, "v1");
Utils.CheckAndCleanDirectory(task); //папка для преобразования. Utils.CheckAndCleanDirectory(task); //папка для преобразования.
//если версия пустая, это тоже результат тестирования. Поэтому должна учитываться в древе. //если версия пустая, это тоже результат тестирования. Поэтому должна учитываться в древе.
target.versions.add(new SapforVersion_json( target.versions.add(version_json =new SapforVersion_json(
root.getAbsolutePath(), root.getAbsolutePath(),
task.getAbsolutePath(), code.getDescription())); task.getAbsolutePath(), code.getDescription()));
//--- //---
@@ -97,7 +99,6 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
files.sort(Comparator.comparingInt(o -> Integer.parseInt(o.getName().substring(1)))); files.sort(Comparator.comparingInt(o -> Integer.parseInt(o.getName().substring(1))));
for (File file : files) for (File file : files)
target.variants.add( target.variants.add(
new SapforVersion_json( new SapforVersion_json(
root.getAbsolutePath(), root.getAbsolutePath(),
file.getAbsolutePath(), PassCode_2021.SPF_CreateParallelVariant.getDescription())); file.getAbsolutePath(), PassCode_2021.SPF_CreateParallelVariant.getDescription()));
@@ -107,7 +108,7 @@ public class PerformSapforTask extends Pass_2021<SapforTask> {
@Override @Override
protected void body() throws Exception { protected void body() throws Exception {
target.StartDate = new Date().getTime(); 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) { for (PassCode_2021 code : sapforConfiguration_json.codes) {
if (parse()) { if (parse()) {
if (code.equals(PassCode_2021.CreateParallelVariants)) if (code.equals(PassCode_2021.CreateParallelVariants))

View File

@@ -4,6 +4,7 @@ import Common.Current;
import Common.Database.DBObject; import Common.Database.DBObject;
import Common.Utils.Utils; import Common.Utils.Utils;
import GlobalData.Tasks.TaskState; import GlobalData.Tasks.TaskState;
import TestingSystem.SAPFOR.Json.SapforVersionState;
import TestingSystem.SAPFOR.Json.SapforVersion_json; import TestingSystem.SAPFOR.Json.SapforVersion_json;
import TestingSystem.SAPFOR.SapforTasksPackage.UI.VersionSummary; import TestingSystem.SAPFOR.SapforTasksPackage.UI.VersionSummary;
import Visual_DVM_2021.Passes.PassCode_2021; import Visual_DVM_2021.Passes.PassCode_2021;
@@ -75,29 +76,31 @@ public class SapforTask extends DBObject {
public SapforTask() { public SapforTask() {
} }
public DefaultMutableTreeNode getVersionsTree(File configurationRoot) { public DefaultMutableTreeNode getVersionsTree(File configurationRoot) {
DefaultMutableTreeNode root = null; VersionSummary root = null;
DefaultMutableTreeNode child = null; VersionSummary child = null;
DefaultMutableTreeNode parent = null; VersionSummary parent = null;
//-- //--
for (SapforVersion_json version_json : versions) { for (SapforVersion_json version_json : versions) {
version_json.init(configurationRoot);
version_json.task = this; version_json.task = this;
//- //-
child = new VersionSummary(version_json); child = new VersionSummary(version_json, version_json.init(configurationRoot));
if (parent == null) { if (parent == null) {
root = child; root = child;
parent = child; parent = child;
} else { } else {
if (!child.state.equals(SapforVersionState.Empty)) {
parent.add(child); parent.add(child);
parent = child; parent = child;
} }
}
//- //-
} }
if (parent != null) { if (parent != null) {
for (SapforVersion_json version_json : variants) { for (SapforVersion_json version_json : variants) {
version_json.init(configurationRoot);
version_json.task = this; 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)));
}
} }
} }
//-- //--

View File

@@ -1,20 +1,22 @@
package TestingSystem.SAPFOR.SapforTasksPackage.UI; package TestingSystem.SAPFOR.SapforTasksPackage.UI;
import TestingSystem.SAPFOR.Json.SapforVersionState;
import TestingSystem.SAPFOR.Json.SapforVersion_json; import TestingSystem.SAPFOR.Json.SapforVersion_json;
public class VersionSummary extends SapforPackageTreeNode{ public class VersionSummary extends SapforPackageTreeNode {
public String version_name = ""; public String version_name = "";
public String version_description = ""; 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); setUserObject(version_json);
version_name = version_json.Home.getName(); version_name = version_json.Home.getName();
version_description = version_json.description; version_description = version_json.description;
state = state_in;
} }
@Override @Override
public String getImageKey() { public String getImageKey() {
return "TestVersion"; return state.toString();
} }
@Override @Override
public String toString() { public String toString() {
return version_name+ " : " +version_description; return version_name + " : " + version_description;
} }
} }

View File

@@ -169,7 +169,9 @@ public class SapforTasksPackageSupervisor {
//Очистка //Очистка
//очистка служебных файлов. //очистка служебных файлов.
Utils.deleteFilesByExtensions(new File(sapforTasksPackage.workspace), Utils.deleteFilesByExtensions(new File(sapforTasksPackage.workspace),
"proj", "dep", "jar", "sh", "exe", "bat"); "proj", "dep", "jar"
// ,"sh", "exe", "bat"
);
} }
public void Perform() throws Exception { public void Perform() throws Exception {
if (packageNeedsKill()) { if (packageNeedsKill()) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

View File

Before

Width:  |  Height:  |  Size: 829 B

After

Width:  |  Height:  |  Size: 829 B