v++
ограничения подстановки заголовков.
This commit is contained in:
@@ -37,6 +37,9 @@ public class Constants {
|
||||
public static final String package_json = "package_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[]{
|
||||
PassCode_2021.CreateParallelVariants,
|
||||
PassCode_2021.SPF_SharedMemoryParallelization,
|
||||
|
||||
@@ -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 = 1056;
|
||||
version = 1057;
|
||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||
date_text = df.format(getClassBuildTime());
|
||||
|
||||
@@ -7,8 +7,8 @@ import Common.UI.UI;
|
||||
import Common.Utils.Index;
|
||||
import ProjectData.LanguageName;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TasksPackageState;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.SAPFOR.Json.SapforConfiguration_json;
|
||||
import TestingSystem.SAPFOR.Json.SapforTasksPackage_json;
|
||||
import TestingSystem.SAPFOR.Json.SapforTest_json;
|
||||
@@ -46,7 +46,7 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
|
||||
Vector<Integer> selectedGroupTests = new Vector<>();
|
||||
//---
|
||||
for (Test test : Global.testingServer.db.tests.Data.values()) {
|
||||
if (test.group_id==groupId) {
|
||||
if (test.group_id == groupId) {
|
||||
groupTests.add(test.id);
|
||||
if (test.isSelected())
|
||||
selectedGroupTests.add(test.id);
|
||||
@@ -90,8 +90,26 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
|
||||
}
|
||||
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) {
|
||||
int headers_count = 0;
|
||||
//1. получить список всех команд.
|
||||
Vector<PassCode_2021> codes = new Vector<>();
|
||||
//-- счетчик завершающих команд.
|
||||
@@ -99,8 +117,12 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
|
||||
for (PassCode_2021 code : Constants.terminalSapforTestingCodes)
|
||||
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()) {
|
||||
if (command.sapforconfiguration_id==sapforConfiguration.id) {
|
||||
if (command.sapforconfiguration_id == sapforConfiguration.id) {
|
||||
codes.add(command.passCode);
|
||||
//---
|
||||
for (PassCode_2021 t_code : Constants.terminalSapforTestingCodes) {
|
||||
@@ -108,6 +130,10 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
//-
|
||||
for (PassCode_2021 s_code : Constants.startingSapforTestingCodes) {
|
||||
if (!checkStartingCode(sapforConfiguration, s_code,
|
||||
startingCodesCount.get(s_code).getValue(), codes
|
||||
))
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
return true;
|
||||
}
|
||||
@@ -152,7 +183,7 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
|
||||
testsNames_lower = new Vector<>();
|
||||
testsByDescriptions = new LinkedHashMap<>();
|
||||
groupsLanguages = new Vector<>();
|
||||
testsIds =new Vector<>();
|
||||
testsIds = new Vector<>();
|
||||
configurationsIds = new Vector<>();
|
||||
//--
|
||||
if (Global.testingServer.db.sapforConfigurations.getCheckedCount() == 0) {
|
||||
@@ -234,15 +265,19 @@ public class AddSapforPackage extends AddObjectPass<SapforPackage> {
|
||||
SapforConfiguration_json configuration_json = new SapforConfiguration_json();
|
||||
configuration_json.id = configuration.id;
|
||||
configuration_json.flags = configuration.getFlags();
|
||||
configuration_json.codes.add(PassCode_2021.SPF_CorrectCodeStylePass); //всегда добавляется.
|
||||
configuration_json.codes.addAll(configuration.getPassCodes());
|
||||
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.addAll(codes);
|
||||
//--->>
|
||||
package_json.configurations.add(configuration_json);
|
||||
//-->>
|
||||
}
|
||||
package_json.sapfor_drv = Current.getServerSapfor().call_command;
|
||||
///-------------------------------
|
||||
return (UI.Question("Будет добавлено:\n"
|
||||
return (UI.Question("Будет добавлено:\n"
|
||||
+ allTasksCount + " задач\n" +
|
||||
"Продолжить"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user