Добавил анимацию распаковки пакета сапфор после его скачивания.

This commit is contained in:
2023-11-01 19:06:07 +03:00
parent b4635ae8a0
commit 7972fe5dc2
9 changed files with 59 additions and 18 deletions

View File

@@ -245,7 +245,7 @@ public class UI {
});
menuBars.put(VariantsSet.class, new VariantsMenuBar());
menuBars.put(SubsribersDBTable.class, new SubscribersMenuBar());
menuBars.put(SapforProfilesDBTable.class, new DataMenuBar("профили", PassCode_2021.SaveProfile, PassCode_2021.EditProfile, PassCode_2021.ApplyProfile,PassCode_2021.DeleteProfile));
menuBars.put(SapforProfilesDBTable.class, new DataMenuBar("профили", PassCode_2021.SaveProfile, PassCode_2021.EditProfile, PassCode_2021.ApplyProfile, PassCode_2021.DeleteProfile));
menuBars.put(ServerSapforsDBTable.class, new ServerSapforsBar());
menuBars.put(SapforTasksDBTable.class, new SapforTasksMenuBar());
//---->>
@@ -437,7 +437,7 @@ public class UI {
versionsWindow = new VersionsForm(Current.getRoot());
}
public static DebugWindow getDebugWindow() {
if (debugWindow==null)
if (debugWindow == null)
debugWindow = new DebugForm();
return debugWindow;
}

View File

@@ -2,6 +2,7 @@ package ProjectData.Messages;
import Common.Constants;
import Common.Current;
import Common.Global;
import Common.Utils.Utils;
import GlobalData.Settings.SettingName;
import ProjectData.SapforData.FileObject;
import ProjectData.SapforData.FileObjectWithMessages;
@@ -388,8 +389,12 @@ public class Message extends FileObject {
idx += 2;
}
} while (idx != -1);
if (sum != splited.length && !message.equals(""))
throw new PassException("Ошибка при декодировании сообщений на русском языке");
if (sum != splited.length && !message.equals("")) {
System.out.println("message="+ Utils.Brackets(message));
Utils.CopyToClipboard(message);
throw new PassException("Ошибка при декодировании сообщений на русском языке\n" +
"message=" + Utils.Brackets(message));
}
idx = 0;
String result = "";
for (int z = 0; z < sum; ++z) {

View File

@@ -62,7 +62,7 @@ public class Visualiser extends Component {
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
@Override
public void GetVersionInfo() {
version = 1024;
version = 1025;
String pattern = "MMM dd yyyy HH:mm:ss";
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
date_text = df.format(getClassBuildTime());

View File

@@ -1,6 +1,5 @@
package Visual_DVM_2021.Passes.All;
import Common.Current;
import Common.Global;
import Common.Utils.Utils;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
@@ -9,10 +8,8 @@ import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
import TestingSystem.TasksPackage.TasksPackageState;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.TestingSystemPass;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.Date;
public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPackage> {
@Override
public String getIconPath() {
@@ -55,14 +52,7 @@ public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPac
@Override
protected void performDone() throws Exception {
super.performDone();
File packageWorkspace = SapforTasksPackageInterface.getLocalWorkspace(target);
Utils.forceDeleteWithCheck(packageWorkspace);
if (passes.get(PassCode_2021.UnzipFolderPass).Do(
tmpArchive.getAbsolutePath(),
Global.SapforPackagesDirectory.getAbsolutePath(), false
)) {
FileUtils.writeStringToFile(SapforTasksPackageInterface.getLoadedSign(target), new Date().toString());
}
passes.get(PassCode_2021.UnpackSapforTasksPackage).Do(tmpArchive, target);
}
}

View File

@@ -0,0 +1,32 @@
package Visual_DVM_2021.Passes.All;
import Common.Global;
import Common.Utils.Utils;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.Date;
public class UnpackSapforTasksPackage extends UnzipFolderPass<SapforTasksPackage> {
@Override
protected boolean needsAnimation() {
return true;
}
@Override
protected boolean canStart(Object... args) {
File tmpArchive = (File) args[0];
target = (SapforTasksPackage) args[1];
return super.canStart(tmpArchive.getAbsolutePath(),Global.SapforPackagesDirectory.getAbsolutePath(), false);
}
@Override
protected void performPreparation() throws Exception {
super.performPreparation();
File packageWorkspace = SapforTasksPackageInterface.getLocalWorkspace(target);
Utils.forceDeleteWithCheck(packageWorkspace);
}
@Override
protected void body() throws Exception {
super.body();
FileUtils.writeStringToFile(SapforTasksPackageInterface.getLoadedSign(target), new Date().toString());
}
}

View File

@@ -5,6 +5,7 @@ public enum PassCode_2021 {
ShowAllParallelVariants,
ShowParallelVariantsCoverage,
AbortSapforTaskPackage,
UnpackSapforTasksPackage,
//-
DeleteServerSapfor,
StartSapforTests,
@@ -311,6 +312,8 @@ public enum PassCode_2021 {
switch (this) {
case Undefined:
return "?";
case UnpackSapforTasksPackage:
return "Распаковка пакета задач SAPFOR";
case ShowSapforTaskPackage:
return "Отобразить пакет задач SAPFOR";
case DownloadSapforTasksPackage:

View File

@@ -10,7 +10,12 @@ public class SapforPass extends SilentSapforPass {
@Override
protected void performFinish() throws Exception {
target.db.BeginTransaction();
unpackMessages();
try {
unpackMessages();
}
catch (PassException ex){
Log.Writeln_(ex.getMessage());
}
target.db.Commit();
}
protected void unpackMessages() throws Exception {

View File

@@ -8,6 +8,7 @@ import Common.Utils.TextLog;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageTree;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import javax.swing.*;
@@ -52,7 +53,9 @@ public class SapforPackagesComparisonForm {
TextLog log = new TextLog();
if (Current.Check(log, Current.SapforTasksPackage)) {
object = Current.getSapforTasksPackage();
if (SapforTasksPackageInterface.isLoaded(object)||(Pass_2021.passes.get(PassCode_2021.DownloadSapforTasksPackage).Do(object)))
showObject();
else UI.Info("Пакет не закружен");
} else
UI.Info(log.toString());
}