Files
VisualSapfor/src/_VisualDVM/Passes/All/StartSelectedSAPFORConfigurations.java
2024-10-25 00:50:19 +03:00

53 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 _VisualDVM.Passes.All;
import Common.Visual.UI;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.PublishServerObject;
import _VisualDVM.TestingSystem.Common.TestingServer;
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
import java.io.File;
import java.util.Vector;
public class StartSelectedSAPFORConfigurations extends PublishServerObject<TestingServer, SapforPackage> {
protected File sapfor = null;
Vector<SapforConfiguration> configurations;
//--
public StartSelectedSAPFORConfigurations() {
super(Global.testingServer, SapforPackage.class);
}
@Override
public String getIconPath() {
return "/Common/icons/BlueStart.png";
}
@Override
protected boolean canStart(Object... args) throws Exception {
//--
if (!Global.mainModule.getAccount().CheckRegistered(Log)) {
return false;
}
if (!Global.testingServer.db.serverSapfors.getUI().CheckCurrent(Log)) {
return false;
}
if (!Global.testingServer.db.serverSapfors.getUI().getCurrent().state.equals(ServerSapforState.Done)) {
Log.Writeln_("Выбранная версия SAPFOR не собрана!");
return false;
}
//--
if (!Global.testingServer.db.sapforConfigurations.getUI().CheckSelectedOrCurrent(Log)) {
return false;
}
configurations = Global.testingServer.db.sapforConfigurations.getUI().getSelectedOrCurrent();
target = new SapforPackage(Global.mainModule.getAccount(),
Global.testingServer.db.serverSapfors.getUI().getCurrent(),
configurations,
Global.properties.EmailOnTestingProgress ? 1 : 0,
Log);
if (target.tasksCount == 0) {
Log.Writeln_("Не сформировано ни одной новой задачи.");
return false;
}
return (UI.Question("Будет запущено " + target.tasksCount + " задач. Продолжить"));
}
}