промежуточный. перенос настроек в проект. есть баги. завтра доделываю, версия не вполне рабочая
This commit is contained in:
@@ -11,7 +11,6 @@ import _VisualDVM.Constants;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.DBLastProject.DBLastProject;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.DBArray.DBArray;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
@@ -33,6 +32,7 @@ import _VisualDVM.ProjectData.SapforData.Functions.UI.Graph.GraphInfo;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.FileInfo;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegionsSet;
|
||||
import _VisualDVM.ProjectData.SapforData.SapforProperties;
|
||||
import _VisualDVM.ProjectData.SapforData.Variants.ParallelVariant;
|
||||
import _VisualDVM.ProjectData.SapforData.Variants.ParallelVariantsSet;
|
||||
import _VisualDVM.TestingSystem.Common.Test.ProjectFiles_json;
|
||||
@@ -145,23 +145,14 @@ public class db_project_info extends DBObject {
|
||||
public ProjectDatabase db = null;
|
||||
public LinkedHashMap<String, DBProjectFile> allIncludes = new LinkedHashMap<>();
|
||||
DBLastProject info = null; //обновляется при открытии проекта.
|
||||
public SapforProperties sapforProperties=null;
|
||||
public void SynchronizeSapforProperties() {
|
||||
System.out.println("Syncronize Sapfor Properties...");
|
||||
sapforProperties = Utils_.SynschronizeProperties(new File(getDataDirectory(), "properties"), SapforProperties.class);
|
||||
}
|
||||
public db_project_info() {
|
||||
}
|
||||
//----------------------------------
|
||||
// в случае восстановления после полной очистки
|
||||
//восстановление при полной очистке.
|
||||
public db_project_info(db_project_info to_restore) throws Exception {
|
||||
Home = to_restore.Home;
|
||||
name = to_restore.name;
|
||||
description = to_restore.description;
|
||||
original = to_restore.original;
|
||||
fgIterations = to_restore.fgIterations;
|
||||
fgResistance = to_restore.fgResistance;
|
||||
fgScreen = to_restore.fgScreen;
|
||||
creationDate = to_restore.creationDate;
|
||||
//-
|
||||
CreateVisualiserData();
|
||||
}
|
||||
//конструктор для пустой версии (cо структурой папок)
|
||||
public db_project_info(db_project_info parent_in,
|
||||
String letter_in,
|
||||
@@ -170,7 +161,10 @@ public class db_project_info extends DBObject {
|
||||
parent = parent_in;
|
||||
name = parent.GenerateVersionName(letter_in);
|
||||
languageName = parent.languageName;
|
||||
style = ((Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed);
|
||||
// style = ((Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed);
|
||||
style = (parent_in.sapforProperties.FREE_FORM ? LanguageStyle.free : LanguageStyle.fixed);
|
||||
|
||||
|
||||
description = description_in;
|
||||
original = original_in;
|
||||
Home = Paths.get(parent_in.Home.getAbsolutePath(), name).toFile();
|
||||
@@ -181,18 +175,11 @@ public class db_project_info extends DBObject {
|
||||
parent.AddVersion(this);
|
||||
//если это делать раньше, папка версии учтется как подпапка.
|
||||
parent.CopySubdirectories(Home);
|
||||
//-- наследование настроек от предка.
|
||||
this.sapforProperties=new SapforProperties(parent.sapforProperties);
|
||||
SynchronizeSapforProperties();
|
||||
}
|
||||
//------------------------------
|
||||
//если бд не существует. только для конверсии тестов на корректность.
|
||||
public db_project_info(File Directory, String description_, boolean create_data) throws Exception {
|
||||
Home = Directory;
|
||||
name = Home.getName();
|
||||
description = description_;
|
||||
if (create_data) {
|
||||
creationDate = Utils_.getDateNumber(); //----------------------------------------------------------------------------->>>
|
||||
CreateVisualiserData();
|
||||
}
|
||||
}
|
||||
//обычное открытие.
|
||||
public db_project_info(File dir) throws Exception {
|
||||
Home = dir;
|
||||
@@ -206,7 +193,7 @@ public class db_project_info extends DBObject {
|
||||
if (stored_info == null) {
|
||||
name = Home.getName();
|
||||
description = "";
|
||||
creationDate = Utils_.getDateNumber(); //----------------------------------------------------------------------------->>>
|
||||
creationDate = Utils_.getDateNumber();
|
||||
db.Insert(this);
|
||||
} else
|
||||
ExtractStoredInfo(stored_info);
|
||||
@@ -243,6 +230,7 @@ public class db_project_info extends DBObject {
|
||||
db.Connect();
|
||||
db.prepareTablesStatements();
|
||||
db.Synchronize();
|
||||
SynchronizeSapforProperties();
|
||||
}
|
||||
public void Close() throws Exception {
|
||||
db.Disconnect();
|
||||
@@ -257,11 +245,8 @@ public class db_project_info extends DBObject {
|
||||
db.prepareTablesStatements();
|
||||
db.Insert(this);
|
||||
db.Disconnect();
|
||||
//--
|
||||
}
|
||||
/*
|
||||
public boolean isGCOVDone() {
|
||||
return gcov_is_done != 0;
|
||||
}*/
|
||||
//------------------------------------
|
||||
public void UpdatefgIterations(int iterations_in) {
|
||||
fgIterations = iterations_in;
|
||||
@@ -916,14 +901,14 @@ public class db_project_info extends DBObject {
|
||||
}
|
||||
}
|
||||
public void createEmptyVersion(String versionLetter, String versionDescription) throws Exception {
|
||||
boolean needsM = (Global.mainModule.getDb()).settings.get(SettingName.SaveModifications).toBoolean();
|
||||
if (needsM)
|
||||
//boolean needsM = (Global.mainModule.getDb()).settings.get(SettingName.SaveModifications).toBoolean();
|
||||
if (sapforProperties.SaveModifications)
|
||||
createModification();
|
||||
last_version = new db_project_info(
|
||||
this,
|
||||
versionLetter,
|
||||
versionDescription,
|
||||
needsM ? last_modification.name : ""
|
||||
sapforProperties.SaveModifications ? last_modification.name : ""
|
||||
);
|
||||
}
|
||||
public void joinExistingVersion(File versionDirectory, String description_in) throws Exception {
|
||||
@@ -936,6 +921,9 @@ public class db_project_info extends DBObject {
|
||||
last_version.Home = versionDirectory;
|
||||
last_version.creationDate = Utils_.getDateNumber(); //----------------------------------------------------------------------------->>>
|
||||
last_version.CreateVisualiserData();
|
||||
//наследование от предка
|
||||
last_version.sapforProperties =new SapforProperties(last_version.parent.sapforProperties);
|
||||
last_version.SynchronizeSapforProperties();
|
||||
this.AddVersion(last_version);
|
||||
}
|
||||
//не является ли текущая версия последней модификацией
|
||||
@@ -1120,10 +1108,6 @@ public class db_project_info extends DBObject {
|
||||
to_restore.name = name;
|
||||
to_restore.description = description;
|
||||
to_restore.original = original;
|
||||
// to_restore.fgIterations = fgIterations;
|
||||
// to_restore.fgResistance = fgResistance;
|
||||
// to_restore.fgScreen = fgScreen;
|
||||
//-
|
||||
CheckVisualiserDirectories();
|
||||
db.Connect();
|
||||
db.CreateAllTables();
|
||||
|
||||
Reference in New Issue
Block a user