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

56 lines
2.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package Visual_DVM_2021.Passes.All;
import Common.CurrentAnchestor;
import Common_old.Current;
import _VisualDVM.Global;
import Common_old.UI.UI;
import TestingSystem.Common.TestingServer;
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
import Visual_DVM_2021.Passes.Server.PublishServerObject;
import java.io.File;
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 (!CurrentAnchestor.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,
Global.properties.EmailOnTestingProgress ? 1 : 0,
Log);
if (target.tasksCount == 0) {
Log.Writeln_("Не сформировано ни одной новой задачи.");
return false;
}
return (UI.Question("Будет запущено " + target.tasksCount + " задач. Продолжить"));
}
}