открытие версии из дерева пакета. как проекта ( осталось соощения распаковать)

This commit is contained in:
2023-11-12 02:14:20 +03:00
parent f80904209d
commit 84f87ca957
9 changed files with 117 additions and 12 deletions

View File

@@ -4,6 +4,9 @@ import Common.Global;
import Common.Utils.Utils;
import ProjectData.Files.FileType;
import ProjectData.Files.ProjectFile;
import ProjectData.LanguageName;
import ProjectData.Project.db_project_info;
import SapforTestingSystem.SapforTask.SapforTask;
import com.google.gson.annotations.Expose;
import org.apache.commons.io.FileUtils;
@@ -27,6 +30,9 @@ public class SapforVersion_json implements Serializable {
public ProjectFile out = null;
public ProjectFile err = null;
//--
public SapforTask task = null; //родная задача. Нужна для построения дерева версий.
public db_project_info project = null;
//--
public SapforVersion_json(String version_in, String description_in) {
version = version_in;
description = description_in;
@@ -56,10 +62,10 @@ public class SapforVersion_json implements Serializable {
}
}
}
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());
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());
}
public boolean isMatch(SapforVersion_json version_json) {
if (!description.equals(version_json.description)) {
@@ -99,4 +105,17 @@ public class SapforVersion_json implements Serializable {
}
return true;
}
public void createProject(File rootHome) throws Exception {
project = null;
String version_ = Global.isWindows ? Utils.toW(version) : Utils.toU(version);
project = new db_project_info();
project.Home = Paths.get(rootHome.getAbsolutePath(), version_).toFile();
project.name = project.Home.getName();
project.description = description;
project.languageName = LanguageName.fortran;
project.creationDate = Utils.getDateNumber();
//---
FileUtils.copyDirectory(Home, project.Home);
project.CreateVisualiserData();
}
}

View File

@@ -68,6 +68,7 @@ public class SapforTask extends DBObject {
//--
for (SapforVersion_json version_json : versions) {
version_json.init(configurationRoot);
version_json.task = this;
//-
child = new VersionSummary(version_json);
if (parent == null) {
@@ -82,6 +83,7 @@ public class SapforTask extends DBObject {
if (parent != null) {
for (SapforVersion_json version_json : variants) {
version_json.init(configurationRoot);
version_json.task = this;
parent.add(new VersionSummary(version_json));
}
}
@@ -159,7 +161,7 @@ public class SapforTask extends DBObject {
System.out.println("сравнение версий.");
//--
for (String name1 : versions1.keySet()) {
System.out.println("version name="+name1);
System.out.println("version name=" + name1);
SapforVersion_json version1 = versions1.get(name1);
SapforVersion_json version2 = versions2.get(name1);
//---

View File

@@ -23,9 +23,6 @@ public class SapforTasksPackageTree extends DataTree {
return 1;
}
@Override
public void LeftMouseAction2() {
}
@Override
public TreeRenderers getRenderer() {
return TreeRenderers.RendererSapforVersion;
}