no message
This commit is contained in:
25
src/Visual_DVM_2021/Passes/All/ShowSapforCompilationErr.java
Normal file
25
src/Visual_DVM_2021/Passes/All/ShowSapforCompilationErr.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
public class ShowSapforCompilationErr extends ShowTestingServerFile{
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
return super.getTimeout();
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/CompilationErrors.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Current.Check(Log,Current.ServerSapfor)){
|
||||
return false;
|
||||
}
|
||||
return super.canStart("Поток ошибок", new RemoteFile(Current.getServerSapfor().home_path, Constants.err_file));
|
||||
}
|
||||
}
|
||||
25
src/Visual_DVM_2021/Passes/All/ShowSapforCompilationOut.java
Normal file
25
src/Visual_DVM_2021/Passes/All/ShowSapforCompilationOut.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
public class ShowSapforCompilationOut extends ShowTestingServerFile{
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
return super.getTimeout();
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/CompilationOutput.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Current.Check(Log,Current.ServerSapfor)){
|
||||
return false;
|
||||
}
|
||||
return super.canStart("Поток вывода", new RemoteFile(Current.getServerSapfor().home_path, Constants.out_file));
|
||||
}
|
||||
}
|
||||
46
src/Visual_DVM_2021/Passes/All/ShowTestingServerFile.java
Normal file
46
src/Visual_DVM_2021/Passes/All/ShowTestingServerFile.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.UI.Windows.Dialog.Text.ReadOnlyMultilineTextForm;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class ShowTestingServerFile extends TestingSystemPass<RemoteFile> {
|
||||
String title;
|
||||
File localFile;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
title = (String) args[0];
|
||||
target = (RemoteFile) args[1];
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveFile, target.full_name));
|
||||
localFile = Utils.getTempFileName(target.name);
|
||||
if (response.object != null)
|
||||
response.Unpack(localFile);
|
||||
else throw new PassException("Файл не найден");
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return localFile.exists();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
ReadOnlyMultilineTextForm ff = new ReadOnlyMultilineTextForm();
|
||||
List<String> lines = FileUtils.readLines(localFile);
|
||||
Vector<String> res = new Vector<>();
|
||||
for (int i = lines.size() - 1; i >= 0; i--)
|
||||
res.add(lines.get(i));
|
||||
ff.ShowDialog(title,
|
||||
String.join("\n", res)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -336,12 +336,21 @@ public enum PassCode_2021 {
|
||||
SPF_InsertImplicitNone,
|
||||
CompileServerSapfor,
|
||||
ActualizeServerSapfors,
|
||||
;
|
||||
ShowTestingServerFile,
|
||||
//--
|
||||
ShowSapforCompilationOut,
|
||||
ShowSapforCompilationErr;
|
||||
//--
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case Undefined:
|
||||
return "?";
|
||||
//--
|
||||
case ShowSapforCompilationOut:
|
||||
return "Отобразить поток вывода сборки SAPFOR";
|
||||
case ShowSapforCompilationErr:
|
||||
return "Отобразить поток ошибок сборки SAPFOR";
|
||||
case ShowTestingServerFile:
|
||||
return "Отобразить файл сервера тестирования";
|
||||
case ActualizeServerSapfors:
|
||||
return "Проверить собираемые версии SAPFOR";
|
||||
case CompileServerSapfor:
|
||||
|
||||
Reference in New Issue
Block a user