no message
This commit is contained in:
@@ -1,91 +0,0 @@
|
||||
package Common.ModesSupervisors;
|
||||
import Common.Global;
|
||||
import Common.Utils.InterruptThread;
|
||||
import Common.Utils.Utils;
|
||||
import SapforTestingSystem.Json.SapforScenario_json;
|
||||
import SapforTestingSystem.SapforTest.SapforTest;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Stack;
|
||||
import java.util.Vector;
|
||||
|
||||
//рудимент.
|
||||
public class PackageModeSupervisor {
|
||||
Thread interruptThread = new InterruptThread(5000, () -> {
|
||||
System.exit(0);
|
||||
return null;
|
||||
});
|
||||
//--->>
|
||||
int kernels = 4;
|
||||
//--->>
|
||||
SapforScenario_json scenario;
|
||||
//--->>
|
||||
File packageWorkspace;
|
||||
//--->>
|
||||
File sapfor_drv;
|
||||
File scenarioFile;
|
||||
//--->>
|
||||
LinkedHashMap<String, SapforTest> allTests = new LinkedHashMap<>();
|
||||
//--->>>
|
||||
Vector<String> activeTests = new Vector<>();
|
||||
Stack<String> waitingTests = new Stack<>();
|
||||
//--->>
|
||||
public void init() throws Exception {
|
||||
packageWorkspace = new File(Global.Home);
|
||||
scenarioFile = new File(packageWorkspace, "scenario.txt");
|
||||
sapfor_drv = new File(packageWorkspace, "SAPFOR_F.exe");
|
||||
String packed = FileUtils.readFileToString(scenarioFile, Charset.defaultCharset());
|
||||
scenario = Utils.gson.fromJson(packed, SapforScenario_json.class);
|
||||
//--->>
|
||||
for (String test : scenario.tests) {
|
||||
allTests.put(test, new SapforTest(Global.Home, test));
|
||||
waitingTests.push(test);
|
||||
}
|
||||
}
|
||||
public boolean isFinished(String test) {
|
||||
return true;
|
||||
}
|
||||
//--->>
|
||||
public boolean checkActiveTests() throws Exception {
|
||||
/*
|
||||
Vector<String> finishedTests = new Vector<>();
|
||||
for (String test: activeTests){
|
||||
if (isFinished(test))
|
||||
finishedTests.add(test);
|
||||
}
|
||||
for (String test: finishedTests){
|
||||
activeTests.remove(test);
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
public boolean startWaitingTests() throws Exception {
|
||||
return false;
|
||||
}
|
||||
public void finalize(){
|
||||
Global.Log.Print("END");
|
||||
}
|
||||
//--->>
|
||||
public void Do() {
|
||||
try {
|
||||
Global.Log.Print("START");
|
||||
interruptThread.start();
|
||||
//--->>
|
||||
init();
|
||||
//--->>
|
||||
while (checkActiveTests() && startWaitingTests()) {
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
finalize();
|
||||
//--->>
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
finally {
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package Common.ModesSupervisors;
|
||||
import Common.Global;
|
||||
public class TestThread extends Thread{
|
||||
public TestThread(int num){
|
||||
super(() -> {
|
||||
try {
|
||||
while (true) {
|
||||
Global.Log.Print("Test thread " +num+ "action");
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import Common.UI.Menus_2023.MenuBarButton;
|
||||
import Common.UI.Menus_2023.VisualiserMenuBar;
|
||||
import Common.UI.UI;
|
||||
import Repository.Component.PerformanceAnalyzer.PerformanceAnalyzer;
|
||||
import SapforTestingSystem.SapforTestingPlaner.SapforTestingPlanner;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
@@ -53,7 +52,7 @@ public class MainMenuBar extends VisualiserMenuBar {
|
||||
//-
|
||||
setPreferredSize(new Dimension(0, 30));
|
||||
//---
|
||||
|
||||
/*
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setIcon("/icons/Apply.png");
|
||||
@@ -64,6 +63,8 @@ public class MainMenuBar extends VisualiserMenuBar {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
*/
|
||||
//---
|
||||
ShowProject(false);
|
||||
}
|
||||
@@ -83,7 +84,7 @@ public class MainMenuBar extends VisualiserMenuBar {
|
||||
Pass_2021.passes.get(PassCode_2021.DeleteDebugResults),
|
||||
Pass_2021.passes.get(PassCode_2021.ResetCurrentProject)
|
||||
};
|
||||
for (Pass_2021 pass: cleaningPasses){
|
||||
for (Pass_2021 pass : cleaningPasses) {
|
||||
pass.setControlsEnabled(flag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
public class Utils {
|
||||
public static final Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
||||
public static Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
||||
public static Object jsonFromFile(File file, Class json_class) throws Exception {
|
||||
String packed = FileUtils.readFileToString(file, Charset.defaultCharset());
|
||||
return Utils.gson.fromJson(packed, json_class);
|
||||
|
||||
Reference in New Issue
Block a user