2024-09-19 17:37:34 +03:00
|
|
|
|
package Visual_DVM_2021.Passes.All;
|
|
|
|
|
|
import Common.Current;
|
|
|
|
|
|
import Common.Global;
|
|
|
|
|
|
import Common.UI.UI;
|
|
|
|
|
|
import Common.UI.VisualCache.ConfigurationCache;
|
|
|
|
|
|
import Common.UI.VisualCache.VisualCaches;
|
|
|
|
|
|
import TestingSystem.Common.Test.Test;
|
|
|
|
|
|
import TestingSystem.Common.TestingServer;
|
|
|
|
|
|
import TestingSystem.SAPFOR.Json.SapforConfiguration_json;
|
|
|
|
|
|
import TestingSystem.SAPFOR.Json.SapforTest_json;
|
|
|
|
|
|
import TestingSystem.SAPFOR.Json.SapforTestingSet_json;
|
|
|
|
|
|
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
|
|
|
|
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
|
|
|
|
|
import TestingSystem.SAPFOR.SapforTask.SapforTask;
|
|
|
|
|
|
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
|
|
|
|
|
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
|
|
|
|
import Visual_DVM_2021.Passes.Server.PublishServerObject;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
|
public class StartSelectedSAPFORConfigurations extends PublishServerObject<TestingServer, SapforPackage> {
|
|
|
|
|
|
Vector<SapforConfiguration> configurations;
|
|
|
|
|
|
protected File sapfor = null;
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getIconPath() {
|
|
|
|
|
|
return "/icons/Start.png";
|
|
|
|
|
|
}
|
|
|
|
|
|
//--
|
|
|
|
|
|
public StartSelectedSAPFORConfigurations() {
|
|
|
|
|
|
super(Global.testingServer, SapforPackage.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
|
|
|
|
|
//--
|
|
|
|
|
|
if (!Current.getAccount().CheckRegistered(Log)) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!Current.Check(Log, Current.ServerSapfor)) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!Current.getServerSapfor().state.equals(ServerSapforState.Done)) {
|
|
|
|
|
|
Log.Writeln_("Выбранная версия SAPFOR не собрана!");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
//--
|
|
|
|
|
|
configurations = Global.testingServer.db.sapforConfigurations.getCheckedOrCurrent();
|
|
|
|
|
|
if (configurations.isEmpty()) {
|
|
|
|
|
|
Log.Writeln_("Не отмечено ни одной конфигурации, или отсутствует текущая конфигурация.");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2024-09-24 00:24:28 +03:00
|
|
|
|
target = new SapforPackage(Current.getAccount(), Current.getServerSapfor(), configurations, Log);
|
|
|
|
|
|
if (target.tasksCount==0){
|
|
|
|
|
|
Log.Writeln_("Не сформировано ни одной новой задачи.");
|
2024-09-19 17:37:34 +03:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2024-09-24 00:24:28 +03:00
|
|
|
|
return (UI.Question("Будет запущено " + target.tasksCount + " задач. Продолжить"));
|
2024-09-19 17:37:34 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|