ограничения подстановки заголовков.
This commit is contained in:
2023-12-24 02:19:34 +03:00
parent 9e571d33a8
commit d6246429f3
4 changed files with 51 additions and 16 deletions

7
.idea/workspace.xml generated
View File

@@ -9,11 +9,8 @@
<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 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/Common/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Constants.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingPlanner.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMTestingPlanner.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddSapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddSapforPackage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/UserConnection.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/UserConnection.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" 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" />

View File

@@ -37,6 +37,9 @@ public class Constants {
public static final String package_json = "package_json"; public static final String package_json = "package_json";
public static final String results_json = "results_json"; public static final String results_json = "results_json";
//-- //--
public static final PassCode_2021[] startingSapforTestingCodes = new PassCode_2021[]{
PassCode_2021.SPF_InsertIncludesPass
};
public static final PassCode_2021[] terminalSapforTestingCodes = new PassCode_2021[]{ public static final PassCode_2021[] terminalSapforTestingCodes = new PassCode_2021[]{
PassCode_2021.CreateParallelVariants, PassCode_2021.CreateParallelVariants,
PassCode_2021.SPF_SharedMemoryParallelization, PassCode_2021.SPF_SharedMemoryParallelization,

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 = 1056; version = 1057;
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

@@ -7,8 +7,8 @@ import Common.UI.UI;
import Common.Utils.Index; import Common.Utils.Index;
import ProjectData.LanguageName; import ProjectData.LanguageName;
import TestingSystem.Common.Group.Group; import TestingSystem.Common.Group.Group;
import TestingSystem.Common.Test.Test;
import TestingSystem.Common.TasksPackageState; import TestingSystem.Common.TasksPackageState;
import TestingSystem.Common.Test.Test;
import TestingSystem.SAPFOR.Json.SapforConfiguration_json; import TestingSystem.SAPFOR.Json.SapforConfiguration_json;
import TestingSystem.SAPFOR.Json.SapforTasksPackage_json; import TestingSystem.SAPFOR.Json.SapforTasksPackage_json;
import TestingSystem.SAPFOR.Json.SapforTest_json; import TestingSystem.SAPFOR.Json.SapforTest_json;
@@ -46,7 +46,7 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
Vector<Integer> selectedGroupTests = new Vector<>(); Vector<Integer> selectedGroupTests = new Vector<>();
//--- //---
for (Test test : Global.testingServer.db.tests.Data.values()) { for (Test test : Global.testingServer.db.tests.Data.values()) {
if (test.group_id==groupId) { if (test.group_id == groupId) {
groupTests.add(test.id); groupTests.add(test.id);
if (test.isSelected()) if (test.isSelected())
selectedGroupTests.add(test.id); selectedGroupTests.add(test.id);
@@ -90,8 +90,26 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
} }
return true; return true;
} }
boolean checkStartingCode(SapforConfiguration sapforConfiguration, PassCode_2021 code, int count, Vector<PassCode_2021> codes) {
if (count > 2) {
Log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": " +
code.getDescription() +
" возможно только один раз.");
return false;
}
//--
if ((count == 1) && codes.size() > 1) {
if (!codes.firstElement().equals(code)) {
Log.Writeln_("Неверная конфигурация:" + sapforConfiguration.id + ": " +
code.getDescription() +
" может быть только первой командой!");
return false;
}
}
return true;
}
//--
public boolean getConfigurationCommands(SapforConfiguration sapforConfiguration) { public boolean getConfigurationCommands(SapforConfiguration sapforConfiguration) {
int headers_count = 0;
//1. получить список всех команд. //1. получить список всех команд.
Vector<PassCode_2021> codes = new Vector<>(); Vector<PassCode_2021> codes = new Vector<>();
//-- счетчик завершающих команд. //-- счетчик завершающих команд.
@@ -99,8 +117,12 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
for (PassCode_2021 code : Constants.terminalSapforTestingCodes) for (PassCode_2021 code : Constants.terminalSapforTestingCodes)
terminalCodesCount.put(code, new Index()); terminalCodesCount.put(code, new Index());
//-- //--
LinkedHashMap<PassCode_2021, Index> startingCodesCount = new LinkedHashMap<>();
for (PassCode_2021 code : Constants.startingSapforTestingCodes)
startingCodesCount.put(code, new Index());
//--
for (SapforConfigurationCommand command : Global.testingServer.db.sapforConfigurationCommands.Data.values()) { for (SapforConfigurationCommand command : Global.testingServer.db.sapforConfigurationCommands.Data.values()) {
if (command.sapforconfiguration_id==sapforConfiguration.id) { if (command.sapforconfiguration_id == sapforConfiguration.id) {
codes.add(command.passCode); codes.add(command.passCode);
//--- //---
for (PassCode_2021 t_code : Constants.terminalSapforTestingCodes) { for (PassCode_2021 t_code : Constants.terminalSapforTestingCodes) {
@@ -108,6 +130,10 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
terminalCodesCount.get(t_code).Inc(); terminalCodesCount.get(t_code).Inc();
} }
//--- //---
for (PassCode_2021 s_code : Constants.startingSapforTestingCodes) {
if (command.passCode.equals(s_code))
startingCodesCount.get(s_code).Inc();
}
} }
} }
//-- //--
@@ -121,8 +147,13 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
)) ))
return false; return false;
} }
//-
for (PassCode_2021 s_code : Constants.startingSapforTestingCodes) {
if (!checkStartingCode(sapforConfiguration, s_code,
startingCodesCount.get(s_code).getValue(), codes
))
return false;
}
//-- //--
return true; return true;
} }
@@ -152,7 +183,7 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
testsNames_lower = new Vector<>(); testsNames_lower = new Vector<>();
testsByDescriptions = new LinkedHashMap<>(); testsByDescriptions = new LinkedHashMap<>();
groupsLanguages = new Vector<>(); groupsLanguages = new Vector<>();
testsIds =new Vector<>(); testsIds = new Vector<>();
configurationsIds = new Vector<>(); configurationsIds = new Vector<>();
//-- //--
if (Global.testingServer.db.sapforConfigurations.getCheckedCount() == 0) { if (Global.testingServer.db.sapforConfigurations.getCheckedCount() == 0) {
@@ -234,8 +265,12 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
SapforConfiguration_json configuration_json = new SapforConfiguration_json(); SapforConfiguration_json configuration_json = new SapforConfiguration_json();
configuration_json.id = configuration.id; configuration_json.id = configuration.id;
configuration_json.flags = configuration.getFlags(); configuration_json.flags = configuration.getFlags();
Vector<PassCode_2021> codes = configuration.getPassCodes();
//--- коррекцию кода нельзя вызвать если инклуды есть. в общем случае.
if (!codes.firstElement().equals(PassCode_2021.SPF_InsertIncludesPass))
configuration_json.codes.add(PassCode_2021.SPF_CorrectCodeStylePass); //всегда добавляется. configuration_json.codes.add(PassCode_2021.SPF_CorrectCodeStylePass); //всегда добавляется.
configuration_json.codes.addAll(configuration.getPassCodes()); //--
configuration_json.codes.addAll(codes);
//--->> //--->>
package_json.configurations.add(configuration_json); package_json.configurations.add(configuration_json);
//-->> //-->>