Files
VisualSapfor/src/Visual_DVM_2021/Passes/All/StartSelectedSAPFORConfigurations.java

60 lines
2.4 KiB
Java
Raw Normal View History

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;
}
target = new SapforPackage(Current.getAccount(), Current.getServerSapfor(), configurations, Log);
if (target.tasksCount==0){
Log.Writeln_("Не сформировано ни одной новой задачи.");
return false;
}
return (UI.Question("Будет запущено " + target.tasksCount + " задач. Продолжить"));
}
}