no message

This commit is contained in:
2025-03-13 00:32:20 +03:00
parent 91e40c4393
commit 1d97048de1
204 changed files with 984 additions and 889 deletions

View File

@@ -6,8 +6,8 @@ import Common.Visual.UI;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
import _VisualDVM.ComponentsServer.BugReport.BugReportState;
import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.Global;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import java.io.File;

View File

@@ -13,6 +13,6 @@ public class AppendBugReportComment extends AppendBugReportField {
}
@Override
protected boolean canUpdate() {
return target.canAppend(Global.mainModule.getAccount(),Log);
return target.canAppend(Global.mainModule.getAccount(), Log);
}
}

View File

@@ -1,6 +1,4 @@
package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import _VisualDVM.GlobalData.User.User;
@@ -8,7 +6,6 @@ import _VisualDVM.Passes.SSH.ConnectionPass;
import com.jcraft.jsch.ChannelSftp;
import java.io.File;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.Vector;
public class ArchivesBackupPass extends ConnectionPass<File> {
@@ -26,7 +23,7 @@ public class ArchivesBackupPass extends ConnectionPass<File> {
}
@Override
protected void ServerAction() throws Exception {
RemoteFile workspace = new RemoteFile(user.connection.sftpChannel.getHome(), "_sapfor_x64_backups", true);
RemoteFile workspace = new RemoteFile(user.connection.sftpChannel.getHome(), "_sapfor_x64_backups", true);
user.connection.MKDIR(workspace);
RemoteFile dst = new RemoteFile(workspace.full_name, src.getName());
user.connection.putSingleFile(src, dst);

View File

@@ -31,9 +31,9 @@ public class BuildComponent extends ProcessPass<Component> {
@Override
protected void body() throws Exception {
ShowMessage1("Сборка " + target.getComponentType().getDescription());
if (target.getComponentType().equals(ComponentType.Sapfor_F)){
if (target.getComponentType().equals(ComponentType.Sapfor_F)) {
File RepoSapfor = new File(Global.RepoDirectory, "SAPFOR");
File installationDirectory = new File(RepoSapfor,"install");
File installationDirectory = new File(RepoSapfor, "install");
Utils_.CheckAndCleanDirectory(installationDirectory);
}
PerformScript(target.getAssemblyCommand());

View File

@@ -1,9 +1,9 @@
package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import Common.Visual.UI;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Global;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Server.ComponentsServerPass;
import _VisualDVM.Repository.Server.ServerCode;
@@ -11,6 +11,7 @@ import org.apache.commons.io.FileUtils;
import java.io.File;
public class CheckAccount extends ComponentsServerPass {
File keyFile;
@Override
public String getIconPath() {
return "/icons/Registry.png";
@@ -19,12 +20,12 @@ public class CheckAccount extends ComponentsServerPass {
protected boolean isSafe() {
return false;
}
File keyFile;
void confirmEmail() throws Exception{
ConfirmEmail confirmEmailPass = (ConfirmEmail) Global.mainModule.getPass(PassCode.ConfirmEmail);;
void confirmEmail() throws Exception {
ConfirmEmail confirmEmailPass = (ConfirmEmail) Global.mainModule.getPass(PassCode.ConfirmEmail);
;
if (confirmEmailPass.Do(Global.mainModule.getAccount())) {
//подтвердили почту. теперь проверяем ее роль на сервере. если на сервере нет акка будет создан
if (SendRequest(ServerCode.GetUserAccountByEmail, "",Global.mainModule.getAccount())){
if (SendRequest(ServerCode.GetUserAccountByEmail, "", Global.mainModule.getAccount())) {
Global.mainModule.setAccount((UserAccount) request.server_response.object);
FileUtils.writeStringToFile(keyFile, request.server_response.arg);
}
@@ -39,19 +40,19 @@ public class CheckAccount extends ComponentsServerPass {
//1. Ищем ключ.
if (keyFile.exists()) {
//ключ есть. проверить его актуальность.
String key = FileUtils.readFileToString(keyFile);
if (SendRequest(ServerCode.GetUserAccountByKey,key)){
if (request.server_response.object!=null){
String key = FileUtils.readFileToString(keyFile);
if (SendRequest(ServerCode.GetUserAccountByKey, key)) {
if (request.server_response.object != null) {
//ключ актуальный.
Global.mainModule.setAccount((UserAccount) request.server_response.object);
}else {
} else {
//ключ неактуальный. регистрируемся по новой.
UI.Error("Текущий ключ неверен. Он будет удален.");
Utils_.forceDeleteWithCheck(keyFile);
confirmEmail();
}
}
}else {
} else {
confirmEmail();
}
return !Global.mainModule.getAccount().role.equals(AccountRole.Undefined);

View File

@@ -10,7 +10,7 @@ public class CheckRemoteWorkspace extends ComponentsServerPass<SubscriberWorkspa
@Override
protected boolean canStart(Object... args) throws Exception {
target = null;
if (Global.mainModule.getAccount().CheckRegistered(Log)){
if (Global.mainModule.getAccount().CheckRegistered(Log)) {
String email = Global.mainModule.getAccount().email;
String machineURL = MainModule_.instance.getDb().getTable(Machine.class).getUI().getCurrent().getURL();
String login = MainModule_.instance.getDb().getTable(User.class).getUI().getCurrent().login;
@@ -18,7 +18,8 @@ public class CheckRemoteWorkspace extends ComponentsServerPass<SubscriberWorkspa
target = (SubscriberWorkspace) request.server_response.object;
return true;
}
};
}
;
return false;
}
}

View File

@@ -9,6 +9,6 @@ public class ComponentsServerBackUp extends ComponentsServerPass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
return Global.mainModule.getAccount().isAdmin()&&SendRequest(ServerCode.CreateBackUp,"", true);
return Global.mainModule.getAccount().isAdmin() && SendRequest(ServerCode.CreateBackUp, "", true);
}
}

View File

@@ -3,7 +3,6 @@ import Common.Utils.Utils_;
import Common.Visual.UI;
import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountDialog;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.ComponentsServerPass;
import _VisualDVM.Repository.EmailMessage;
import _VisualDVM.Repository.Server.ServerCode;
@@ -32,7 +31,7 @@ public class ConfirmEmail extends ComponentsServerPass<UserAccount> {
return false;
}
password = String.valueOf(getRandomIntegerBetweenRange(1111, 9999));
return SendRequest(ServerCode.Email,
return SendRequest(ServerCode.Email,
target.email,
new EmailMessage("Код подтверждения визуализатора для: " + Utils_.Brackets(target.name), password));
}

View File

@@ -18,7 +18,7 @@ public class ConvertCorrectnessTests extends TestingServerPass<File> {
Log.Writeln_("Вы не являетесь администратором");
return false;
}
return UI.Warning("Загрузить полный пакет DVM тестов на корректность и производительность.")&&
return UI.Warning("Загрузить полный пакет DVM тестов на корректность и производительность.") &&
SendRequest(ServerCode.RefreshDVMTests, "", null);
}
@Override

View File

@@ -168,7 +168,7 @@ public class CreateTestFromDirectory extends Pass<Test> {
filesNames.add(projectFile.file.getName());
filesJson.values.add(new TestFileJson(projectFile));
}
target.packedFilesJson=Utils_.gson.toJson(filesJson);
target.packedFilesJson = Utils_.gson.toJson(filesJson);
return true;
}
public boolean isNotExcluded(ProjectFile projectFile) {

View File

@@ -24,8 +24,7 @@ public class CreateTestFromProject extends CreateTestFromDirectory {
return true;
}
}
}
else {
} else {
project = (db_project_info) args[0];
group = (Group) args[1];
//если проект не текущий, освежить его бд.

View File

@@ -47,7 +47,7 @@ public class CreateTestsGroupFromSelectedVersions extends PublishTests {
}
//---
return UI.Question("В группу " + Utils_.Brackets(group.description) +
"\nбудет добавлено " + target.size() + " тестов.\родолжить")&&
"\nбудет добавлено " + target.size() + " тестов.\родолжить") &&
SendRequest(ServerCode.PublishObjects, null, target);
}
}

View File

@@ -72,7 +72,7 @@ public class DVMConvertProject extends ComponentsServerPass<db_project_info> {
unit_args.add(target.languageName.toString());
unit_args.add(target.sapforProperties.DVMConvertationOptions);
unit_args.addAll(programsNames);
return SendRequest(ServerCode.DVMConvertProject, String.join("\n", unit_args),Utils_.fileToBytes(archive));
return SendRequest(ServerCode.DVMConvertProject, String.join("\n", unit_args), Utils_.fileToBytes(archive));
//--
}
return false;

View File

@@ -10,7 +10,7 @@ public class DeleteBugReport extends DeleteObjectPass<BugReport> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
return super.canStart(args) && target.canModify(Global.mainModule.getAccount(),Log);
return super.canStart(args) && target.canModify(Global.mainModule.getAccount(), Log);
}
@Override
protected void performDone() throws Exception {

View File

@@ -8,7 +8,7 @@ public class DeleteBugReportFromServer extends ComponentsServerPass<BugReport> {
@Override
protected boolean canStart(Object... args) {
target = (BugReport) args[0];
return !target.state.equals(BugReportState.draft)&&
SendRequest(ServerCode.DeleteObjectByPK, "",new Pair<>(BugReport.class, target.getPK()));
return !target.state.equals(BugReportState.draft) &&
SendRequest(ServerCode.DeleteObjectByPK, "", new Pair<>(BugReport.class, target.getPK()));
}
}

View File

@@ -6,7 +6,6 @@ import _VisualDVM.Global;
import _VisualDVM.Passes.Server.DeleteServerObject;
import _VisualDVM.Repository.Server.SafeServerExchangeUnit;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.ServerObjectsCache.VisualCaches;
import javafx.util.Pair;
public class DeleteUserAccount extends DeleteServerObject<ComponentsServer, UserAccount> {
public DeleteUserAccount() {

View File

@@ -8,7 +8,7 @@ public class DownloadBugReport extends ComponentsServerPass<BugReport> {
@Override
protected boolean canStart(Object... args) {
target = (BugReport) args[0];
return !target.getArchiveFile().exists()&&SendRequest(ServerCode.ReceiveBugReport, target.id);
return !target.getArchiveFile().exists() && SendRequest(ServerCode.ReceiveBugReport, target.id);
}
@Override
protected void performPreparation() throws Exception {

View File

@@ -13,7 +13,6 @@ public class DownloadDvmRepository extends ProcessPass {
git clone https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm /home/testuser/Repo/DVM/
git clone https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm-auto-test /home/testuser/Repo/DVM_AUTO_TEST/
*/
File dvmHome;
@Override
protected boolean canStart(Object... args) throws Exception {

View File

@@ -23,7 +23,7 @@ public class DownloadSapforPackage extends TestingServerPass<SapforPackage> {
}
int id = target.id;
loaded = new File(target.getLocalWorkspace(), CommonConstants.LOADED);
return !loaded.exists()&&SendRequest(ServerCode.DownloadSapforPackage, "", id);
return !loaded.exists() && SendRequest(ServerCode.DownloadSapforPackage, "", id);
}
@Override
protected void body() throws Exception {

View File

@@ -12,8 +12,8 @@ public class DownloadTaskTest extends DownloadTest {
target = null;
if (Global.testingServer.db.dvmRunTasks.getUI().CheckCurrent(Log)) {
DVMRunTask task = Global.testingServer.db.dvmRunTasks.getUI().getCurrent();
if (!Global.testingServer.db.tests.containsKey(task.test_id)){
Log.Writeln_("Теста с ключом "+task.test_id+" не существует!");
if (!Global.testingServer.db.tests.containsKey(task.test_id)) {
Log.Writeln_("Теста с ключом " + task.test_id + " не существует!");
return false;
}
target = Global.testingServer.db.tests.get(task.test_id);

View File

@@ -17,7 +17,7 @@ public class DownloadTest extends TestingServerPass<Test> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
testArchive= null;
testArchive = null;
if (Global.mainModule.getAccount().CheckRegistered(Log) &&
Global.testingServer.db.tests.getUI().CheckCurrent(Log)
) {
@@ -34,7 +34,7 @@ public class DownloadTest extends TestingServerPass<Test> {
}
@Override
protected void body() throws Exception {
testArchive= new File(Global.TempDirectory, Utils_.getDateName(String.valueOf(target.id)));
testArchive = new File(Global.TempDirectory, Utils_.getDateName(String.valueOf(target.id)));
request.server_response.Unpack(testArchive);
}
@Override

View File

@@ -1,15 +1,12 @@
package _VisualDVM.Passes.All;
import Common.Database.Database;
import Common.Passes.Pass;
import _VisualDVM.ComponentsServer.ComponentsServer;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.ComponentsServerPass;
import _VisualDVM.Passes.Server.EditServerObject;
import _VisualDVM.Repository.Server.SafeServerExchangeUnit;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.ServerObjectsCache.VisualCaches;
public class EditUserAccount extends EditServerObject<ComponentsServer,UserAccount> {
public class EditUserAccount extends EditServerObject<ComponentsServer, UserAccount> {
public EditUserAccount() {
super(Global.componentsServer, UserAccount.class);
}

View File

@@ -17,17 +17,16 @@ public class Email extends ComponentsServerPass<EmailMessage> {
@Override
protected boolean canStart(Object... args) throws Exception {
recipients = null;
if (args.length<=1) {
if (args.length <= 1) {
return false;
}
target = (EmailMessage) args[0];
if (args[1]instanceof Vector) {
if (args[1] instanceof Vector) {
recipients = (Vector<String>) args[1];
return true;
}
else if (args[1] instanceof String){
recipients= new Vector<>();
for (int i=1; i< args.length; ++i){
} else if (args[1] instanceof String) {
recipients = new Vector<>();
for (int i = 1; i < args.length; ++i) {
recipients.add((String) args[i]);
}
return true;

View File

@@ -13,7 +13,7 @@ public class GetComponentsBackupsFromServer extends ComponentsServerPass<Vector<
@Override
protected boolean canStart(Object... args) throws Exception {
target = new Vector<>();
return Global.components.getUI().CheckCurrent(Log)&&
return Global.components.getUI().CheckCurrent(Log) &&
SendRequest(ServerCode.GetComponentsBackups,
Global.components.getUI().getCurrent().getComponentType().toString());
}

View File

@@ -7,7 +7,7 @@ public class GetDVMPackageCredetials extends TestingServerPass<DVMPackageCredent
@Override
protected boolean canStart(Object... args) throws Exception {
target = null;
return SendRequest(ServerCode.GetDVMPackageCredentials, "", ((DVMPackage)args[0]).id);
return SendRequest(ServerCode.GetDVMPackageCredentials, "", ((DVMPackage) args[0]).id);
}
@Override
protected void performDone() throws Exception {

View File

@@ -7,22 +7,22 @@ import _VisualDVM.TestingSystem.Common.Group.Group;
import _VisualDVM.TestingSystem.Common.TasksPackageState;
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
public class JoinSapforTestingVersionsToGroup extends TestingServerPass {
Group group;
SapforPackage sapforPackage;
@Override
public String getIconPath() {
return "/Common/icons/Publish.png";
}
Group group;
SapforPackage sapforPackage;
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.testingServer.db.CheckCurrent(Log, Group.class, SapforPackage.class)){
if (Global.testingServer.db.CheckCurrent(Log, Group.class, SapforPackage.class)) {
group = Global.testingServer.db.groups.getUI().getCurrent();
sapforPackage = Global.testingServer.db.sapforPackages.getUI().getCurrent();
if (!sapforPackage.state.equals(TasksPackageState.Done)&&!sapforPackage.state.equals(TasksPackageState.DoneWithErrors)){
if (!sapforPackage.state.equals(TasksPackageState.Done) && !sapforPackage.state.equals(TasksPackageState.DoneWithErrors)) {
Log.Writeln_("Пакет не завершен!");
return false;
}
return SendRequest(ServerCode.JoinSapforVersionsToGroup, group.id+"\n"+sapforPackage.id, null);
return SendRequest(ServerCode.JoinSapforVersionsToGroup, group.id + "\n" + sapforPackage.id, null);
}
return false;
}

View File

@@ -24,8 +24,6 @@ public class OpenBugReportTestProject extends Pass<BugReport> {
(target = Global.componentsServer.db.bugReports.getUI().getCurrent()).CheckNotDraft(Log)) {
if (!target.project_version.isEmpty()) {
root = new File(Global.visualiser.getDownloadsDirectory(), target.id);
project = new File(root,
Utils_.isWindows() ? Utils_.toW(target.project_version) : Utils_.toU(target.project_version)
);
@@ -64,7 +62,7 @@ public class OpenBugReportTestProject extends Pass<BugReport> {
}
@Override
protected void performDone() throws Exception {
if (Global.mainModule.getPass(PassCode.OpenCurrentProject).Do(project)&&target.visualiser_version<1134)
if (Global.mainModule.getPass(PassCode.OpenCurrentProject).Do(project) && target.visualiser_version < 1134)
Global.mainModule.getPass(PassCode.ApplyBugReportSettings).Do();
}
}

View File

@@ -1,6 +1,5 @@
package _VisualDVM.Passes.All;
import Common.Passes.Pass;
import Common.Utils.Utils_;
import Common.Visual.Windows.Dialog.Dialog;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
@@ -9,11 +8,9 @@ import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironment;
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentJson;
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
import _VisualDVM.GlobalData.CompilerEnvironment.UI.CompilerEnvironmentsFields;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.Passes.PassCode;
import javax.swing.*;
import java.util.Vector;
public class PickCompilerEnvironmentsForTesting extends Pass<EnvironmentsJson> {
Compiler compiler = null;
//-
@@ -32,7 +29,7 @@ public class PickCompilerEnvironmentsForTesting extends Pass<EnvironmentsJson> {
if (!(compiler.helpLoaded || Global.mainModule.getPass(PassCode.ShowCompilerHelp).Do(compiler, false)))
return false;
compiler.environments.Reset();
if (args.length>1){
if (args.length > 1) {
target = (EnvironmentsJson) args[1];
compiler.environments.Synchronize(target);
}
@@ -61,7 +58,7 @@ public class PickCompilerEnvironmentsForTesting extends Pass<EnvironmentsJson> {
protected void body() throws Exception {
target.values.clear();
for (CompilerEnvironment compilerEnv : compiler.environments.Data.values()) {
if (compilerEnv.isSelected()){
if (compilerEnv.isSelected()) {
target.values.add(new EnvironmentJson(compilerEnv));
}
}

View File

@@ -29,8 +29,8 @@ public class PickCompilerOptions extends Pass<OptionsJson> {
if (!(compiler.helpLoaded || Global.mainModule.getPass(PassCode.ShowCompilerHelp).Do(compiler, false)))
return false;
compiler.options.Reset();
if (args.length>1){
target =(OptionsJson) args[1];
if (args.length > 1) {
target = (OptionsJson) args[1];
compiler.options.Synchronize(target);
}
Dialog<String, CompilerOptionsFields> dialog = new Dialog<String, CompilerOptionsFields>(CompilerOptionsFields.class) {

View File

@@ -42,8 +42,8 @@ public class PublishBugReport extends Pass<BugReport> {
}
@Override
protected void body() throws Exception {
// target.targets = BugReport.getPackedTargets();
// target.saveRecipientsAsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems());
// target.targets = BugReport.getPackedTargets();
// target.saveRecipientsAsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems());
target.change_date = new Date().getTime();
Global.componentsServer.db.Update(target);
target.state = BugReportState.active;

View File

@@ -1,5 +1,4 @@
package _VisualDVM.Passes.All;
import Common.Passes.Pass;
import Common.Utils.Utils_;
import _VisualDVM.ComponentsServer.Component.Component;
import _VisualDVM.ComponentsServer.Component.ComponentType;
@@ -10,11 +9,9 @@ import _VisualDVM.Constants;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Server.ComponentsServerPass;
import _VisualDVM.Repository.EmailMessage;
import _VisualDVM.Repository.Server.ServerCode;
import java.util.Date;
import java.util.Vector;
public class PublishComponent extends ComponentsServerPass<Component> {
String version_mail_header = "";
String version_text = "";
@@ -64,13 +61,13 @@ public class PublishComponent extends ComponentsServerPass<Component> {
Constants.separator, ""
);
//--
ComponentPublicationInfoJson info=new ComponentPublicationInfoJson(target);
ComponentPublicationInfoJson info = new ComponentPublicationInfoJson(target);
info.changeRecord = change_record;
info.needsUpdateMinimalVersion = f.fields.cbUpdateMinimalVersion.isSelected();
info.needsUpdateMinimalVersion = f.fields.cbUpdateMinimalVersion.isSelected();
info.needsEmail = f.fields.cbNeedsBroadcast.isSelected();
info.needsSendFile =f.fields.cbForceMail.isSelected();
info.needsSendFile = f.fields.cbForceMail.isSelected();
//--
return SendRequest(ServerCode.UpdateComponent, "",info);
return SendRequest(ServerCode.UpdateComponent, "", info);
}
}
return false;

View File

@@ -112,7 +112,7 @@ public class RefreshDVMPackageResults extends TestingServerPass<DVMPackage> {
}
@Override
protected void performDone() throws Exception {
SendRequest(ServerCode.ReplaceDVMPackageResults,"",
SendRequest(ServerCode.ReplaceDVMPackageResults, "",
new Pair<>(
target,
Utils_.fileToBytes(target.getJsonFile())

View File

@@ -13,7 +13,7 @@ public class ReplaceTestProject extends CreateTestFromProject {
}
@Override
protected void performDone() throws Exception {
new TestingServerPass(){
new TestingServerPass() {
@Override
public String getDescription() {
return "";

View File

@@ -15,7 +15,7 @@ public class SPF_InlineProcedure extends SapforFilesModification {
if (super.canStart(args) && (call = (args.length > 0) ? (FuncCall) args[0] : null) != null) {
addOpt1 = call.funcName + "|" + Global.mainModule.getFile().name;
addOpt2 = String.valueOf(call.parent_offset);
target.sapforProperties.PARSE_FOR_INLINE=true;
target.sapforProperties.PARSE_FOR_INLINE = true;
target.sapforProperties.Update();
SPF_ParseFilesWithOrder.silent = true;
return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do();

View File

@@ -41,7 +41,7 @@ public class SPF_InlineProcedures extends SapforTransformation {
return false;
}
Options = Utils_.toU(String.join("|", Result));
target.sapforProperties.PARSE_FOR_INLINE=true;
target.sapforProperties.PARSE_FOR_INLINE = true;
target.sapforProperties.Update();
SPF_ParseFilesWithOrder.silent = true;
return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do(false);

View File

@@ -71,7 +71,7 @@ public class SPF_InlineProceduresH extends SapforTransformation {
}
}
Options = Utils_.toU(String.join("|", Result));
target.sapforProperties.PARSE_FOR_INLINE=true;
target.sapforProperties.PARSE_FOR_INLINE = true;
target.sapforProperties.Update();
SPF_ParseFilesWithOrder.silent = true;
return Global.mainModule.getPass(PassCode.SPF_ParseFilesWithOrder).Do();

View File

@@ -172,7 +172,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
*/
@Override
protected void performFinish() throws Exception {
target.sapforProperties.PARSE_FOR_INLINE=false;
target.sapforProperties.PARSE_FOR_INLINE = false;
target.sapforProperties.Update();
super.performFinish();
}

View File

@@ -15,6 +15,5 @@ public class SaveBugReportRecipients extends UpdateBugReportField {
protected boolean canStart(Object... args) throws Exception {
return super.canStart("packedRecipientsJson",
Utils_.gson.toJson(new RecipientsJson(Global.componentsServer.db.recipients.getUI().getSelectedItems())));
}
}

View File

@@ -1,6 +1,5 @@
package _VisualDVM.Passes.All;
import Common.Passes.Pass;
import Common.Passes.PassException;
import Common.Utils.Utils_;
import Common.Visual.UI;
import Common.Visual.Windows.Dialog.VDirectoryChooser;
@@ -20,7 +19,6 @@ import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.net.URLEncoder;
import java.nio.file.Paths;
public class SaveGraph extends Pass<File> {
VDirectoryChooser directoryChooser = new VDirectoryChooser("Выбор папки для сохранения скриншота графа функций");
FunctionsGraphForm graphForm = null;
@@ -43,9 +41,9 @@ public class SaveGraph extends Pass<File> {
File dir = directoryChooser.ShowDialog();
if (dir == null) {
Log.Writeln_("Папка не выбрана.");
}else {
} else {
Global.mainModule.getPass(PassCode.UpdateProperty).Do("DocumentsDirectory", dir.getAbsolutePath());
target = new File(dir, Utils_.getDateName("Graph")+".png");
target = new File(dir, Utils_.getDateName("Graph") + ".png");
return true;
}
return false;
@@ -72,15 +70,16 @@ public class SaveGraph extends Pass<File> {
@Override
protected void showDone() throws Exception {
if (UI.Question("Изображение графа процедур успешно сохранено\n"
+ "в папке " + Utils_.Brackets(target.getParent())+"\n"
+ "под именем "+Utils_.Brackets(target.getName())+"\n"
+ "Открыть его"
)){
+ "в папке " + Utils_.Brackets(target.getParent()) + "\n"
+ "под именем " + Utils_.Brackets(target.getName()) + "\n"
+ "Открыть его"
)) {
try {
Desktop.getDesktop().open(target);
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
}
};
}
;
}
}

View File

@@ -10,7 +10,7 @@ public class SendBugReport extends ComponentsServerPass<BugReport> {
protected boolean canStart(Object... args) throws Exception {
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
if (!target.project_version.isEmpty())
target.packed_archive = Utils_.fileToBytes(target.getArchiveFile());
target.packed_archive = Utils_.fileToBytes(target.getArchiveFile());
return SendRequest(ServerCode.PublishObject, "", target);
}
@Override

View File

@@ -10,13 +10,13 @@ public class SetDefaultSapforProfile extends Pass<SapforProfile> {
@Override
protected boolean canStart(Object... args) throws Exception {
target = (SapforProfile) args[0];
return UI.Question("Назначить профиль "+ Utils_.Brackets(target.description)+" профилем по умолчанию");
return UI.Question("Назначить профиль " + Utils_.Brackets(target.description) + " профилем по умолчанию");
}
@Override
protected void body() throws Exception {
Vector<SapforProfile> toDrop = new Vector<>();
for (SapforProfile sapforProfile : Global.mainModule.getDb().sapforProfiles.Data.values()) {
if (sapforProfile.id!=target.id) {
if (sapforProfile.id != target.id) {
if (sapforProfile.isAuto != 0) {
sapforProfile.isAuto = 0;
toDrop.add(sapforProfile);

View File

@@ -28,7 +28,7 @@ public class SetSapforConfigurationEthalon extends EditSapforConfiguration {
if (configurationJson.id != target.id) {
Log.Writeln_(
"Конфигурация пакета " + Utils_.Brackets(configurationJson.description) +
"\е совпадает с текущей конфигурацией " + Utils_.Brackets(target.description) + "!");
"\е совпадает с текущей конфигурацией " + Utils_.Brackets(target.description) + "!");
return false;
}
//-

View File

@@ -1,12 +1,12 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.Pass;
import Common.Visual.Windows.ReadOnlyMultilineTextForm;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Machine.MachineType;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Visual.Windows.ReadOnlyMultilineTextForm;
public class ShowCompilerHelp extends Pass<String> {
Pass<String> subpass;
Compiler compiler;

View File

@@ -1,12 +1,12 @@
package _VisualDVM.Passes.All;
import Common.MainModule_;
import Common.Passes.Pass;
import Common.Visual.Windows.ReadOnlyMultilineTextForm;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Machine.MachineType;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Visual.Windows.ReadOnlyMultilineTextForm;
public class ShowCompilerVersion extends Pass<String> {
Pass<String> subpass;
boolean needsShow = true;

View File

@@ -1,11 +1,11 @@
package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import Common.Visual.Windows.ReadOnlyMultilineTextForm;
import _VisualDVM.ComponentsServer.Component.Component;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.ComponentsServerPass;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Utils;
import _VisualDVM.Visual.Windows.ReadOnlyMultilineTextForm;
import org.apache.commons.io.FileUtils;
import java.io.File;

View File

@@ -1,10 +1,10 @@
package _VisualDVM.Passes.All;
import Common.Passes.PassException;
import Common.Visual.Windows.ReadOnlyMultilineTextForm;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import _VisualDVM.Passes.Server.TestingServerPass;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Utils;
import _VisualDVM.Visual.Windows.ReadOnlyMultilineTextForm;
import org.apache.commons.io.FileUtils;
import java.io.File;
@@ -14,7 +14,7 @@ public class ShowTestingServerFile extends TestingServerPass<RemoteFile> {
String title;
File localFile;
@Override
protected boolean isSafe(){
protected boolean isSafe() {
return false;
}
@Override

View File

@@ -18,6 +18,10 @@ import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
import java.util.Vector;
public class StartSelectedDVMConfigurations extends PublishServerObject<TestingServer, DVMPackage> {
//--
Machine machine;
User user;
Compiler compiler;
public StartSelectedDVMConfigurations() {
super(Global.testingServer, DVMPackage.class);
}
@@ -26,16 +30,12 @@ public class StartSelectedDVMConfigurations extends PublishServerObject<TestingS
return "/Common/icons/BlueStart.png";
}
//--
Machine machine;
User user;
Compiler compiler;
//--
@Override
protected boolean canStart(Object... args) throws Exception {
//--
machine =null;
user= null;
compiler =null;
machine = null;
user = null;
compiler = null;
//--
if (!Global.mainModule.getAccount().CheckRegistered(Log)) {
return false;

View File

@@ -14,15 +14,15 @@ public class SynchronizeCredentials extends ComponentsServerPass<Object> {
}
@Override
protected boolean canStart(Object... args) throws Exception {
return Global.mainModule.getAccount().role.equals(AccountRole.Admin) && SendRequest(ServerCode.ReceiveCredentialsDatabase);
return Global.mainModule.getAccount().role.equals(AccountRole.Admin) && SendRequest(ServerCode.ReceiveCredentialsDatabase);
}
@Override
protected void showPreparation() throws Exception {
getServer().credentials_db.DropUI();
getServer().credentials_db.DropUI();
}
@Override
protected void body() throws Exception {
request.server_response.Unpack(new_db_file = Utils.getTempFileName("сdb"));
request.server_response.Unpack(new_db_file = Utils.getTempFileName("сdb"));
}
@Override
protected void performDone() throws Exception {

View File

@@ -27,7 +27,7 @@ public class SynchronizeTests extends TestingServerPass<Object> {
}
@Override
protected void showPreparation() throws Exception {
getServer().db.DropUI();
getServer().db.DropUI();
}
@Override
protected void body() throws Exception {

View File

@@ -1,6 +1,5 @@
package _VisualDVM.Passes.All;
import Common.Passes.Pass;
import _VisualDVM.Global;
import java.io.BufferedReader;
import java.io.File;
@@ -10,7 +9,7 @@ public class TestPass extends Pass {
public static String getMotherboardSN() {
String result = "";
try {
File file = File.createTempFile("realhowto",".vbs");
File file = File.createTempFile("realhowto", ".vbs");
file.deleteOnExit();
FileWriter fw = new java.io.FileWriter(file);
String vbs =
@@ -21,7 +20,6 @@ public class TestPass extends Pass {
+ " Wscript.Echo objItem.SerialNumber \n"
+ " exit for ' do the first cpu only! \n"
+ "Next \n";
fw.write(vbs);
fw.close();
Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath());
@@ -33,18 +31,17 @@ public class TestPass extends Pass {
result += line;
}
input.close();
}
catch(Exception e){
} catch (Exception e) {
e.printStackTrace();
}
return result.trim();
}
@Override
protected void body() throws Exception {
int a= 1/0;
// System.out.println(Global.componentsServer.credentials_db.userAccounts.getPackedActiveRecipients());
// String cpuId = getMotherboardSN();
// UI.Info(cpuId);
int a = 1 / 0;
// System.out.println(Global.componentsServer.credentials_db.userAccounts.getPackedActiveRecipients());
// String cpuId = getMotherboardSN();
// UI.Info(cpuId);
/*
SystemInfo systemInfo = new SystemInfo();
HardwareAbstractionLayer hardware = systemInfo.getHardware();

View File

@@ -9,6 +9,6 @@ public class TestingServerBackUp extends TestingServerPass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
return Global.mainModule.getAccount().isAdmin()&&SendRequest(ServerCode.CreateBackUp,"", true);
return Global.mainModule.getAccount().isAdmin() && SendRequest(ServerCode.CreateBackUp, "", true);
}
}

View File

@@ -20,7 +20,7 @@ public class UpdateBugReportField extends ComponentsServerPass<BugReport> {
String old_comment = "";
BugReport actual;
protected boolean canUpdate() {
return target.canModify(Global.mainModule.getAccount(),Log);
return target.canModify(Global.mainModule.getAccount(), Log);
}
@Override
protected boolean canStart(Object... args) throws Exception {
@@ -54,7 +54,7 @@ public class UpdateBugReportField extends ComponentsServerPass<BugReport> {
getServer().db.bugReports.getUI().RedrawControl();
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
} else {
if (canUpdate()&& SendRequest(ServerCode.GetObjectCopyByPK, "", new Pair<>(BugReport.class, target.id))){
if (canUpdate() && SendRequest(ServerCode.GetObjectCopyByPK, "", new Pair<>(BugReport.class, target.id))) {
actual = (BugReport) request.target;
target.SynchronizeFields(actual);
for (int i = 0; i < fieldNames.size(); ++i) {

View File

@@ -28,15 +28,15 @@ public class UpdateProperty extends Pass<Object> {
VDirectoryChooser directoryChooser = new VDirectoryChooser("");
VFileChooser fileChooser = new VFileChooser("", "exe");
//-
if (args.length==1){
if (oldValue instanceof Boolean){
newValue=!(Boolean)oldValue;
if (args.length == 1) {
if (oldValue instanceof Boolean) {
newValue = !(Boolean) oldValue;
return true;
}
switch (name){
switch (name) {
case "Kernels":
if (sliderNumberForm.ShowDialog(description, oldValue, 1, Utils.getMaxKernels()))
newValue=sliderNumberForm.Result;
newValue = sliderNumberForm.Result;
break;
case "LocalMakePathWindows":
fileChooser.setTitle(description);
@@ -46,25 +46,25 @@ public class UpdateProperty extends Pass<Object> {
break;
case "BugReportsAgeLimit":
if (sliderNumberForm.ShowDialog(description, oldValue, 1, 12))
newValue=sliderNumberForm.Result;
newValue = sliderNumberForm.Result;
break;
case "FastAccessPassesCount":
if (sliderNumberForm.ShowDialog(description, oldValue, 5, 15))
newValue=sliderNumberForm.Result;
newValue = sliderNumberForm.Result;
break;
case "LastOpenedProjectsCount":
SpinnerNumberForm spinnerNumberForm = new SpinnerNumberForm() {
@Override
public void InitFields() {
fields.setModel(new SpinnerNumberModel(
(int)oldValue,
(int) oldValue,
1,
50,
1));
}
};
if (spinnerNumberForm.ShowDialog(description, oldValue, 1, 50))
newValue=spinnerNumberForm.Result;
newValue = spinnerNumberForm.Result;
break;
case "Workspace":
directoryChooser.setTitle(description);
@@ -76,10 +76,10 @@ public class UpdateProperty extends Pass<Object> {
newValue = dir.getAbsolutePath();
break;
}
}else
} else
newValue = args[1];
//--
return newValue!=null&&!newValue.equals(oldValue);
return newValue != null && !newValue.equals(oldValue);
}
@Override
protected void body() throws Exception {
@@ -130,7 +130,7 @@ public class UpdateProperty extends Pass<Object> {
if (Global.mainModule.HasProject())
Global.mainModule.getUI().getMainWindow().getProjectWindow().SwitchScreen(
Global.normalProperties.SmallScreen);
Global.mainModule.getUI().getMainWindow().getCallbackWindow().SwitchScreen( Global.normalProperties.SmallScreen);
Global.mainModule.getUI().getMainWindow().getCallbackWindow().SwitchScreen(Global.normalProperties.SmallScreen);
break;
}
}

View File

@@ -35,7 +35,8 @@ public class UpdateSapforProperty extends Pass<Object> {
if (percentsForm.ShowDialog(description, oldValue))
newValue = percentsForm.Result;
break;
case "DVMConvertationOptions": case "ANALYSIS_OPTIONS":
case "DVMConvertationOptions":
case "ANALYSIS_OPTIONS":
TextFieldDialog textFieldDialog = new TextFieldDialog();
if (textFieldDialog.ShowDialog(description, oldValue)) {
newValue = textFieldDialog.Result;

View File

@@ -356,8 +356,7 @@ public enum PassCode implements PassCode_ {
DeleteUserAccount,
GetDVMPackageCredetials,
ComponentsServerBackUp,
TestingServerBackUp
;
TestingServerBackUp;
//--
@Override
public String getDescription() {

View File

@@ -27,7 +27,7 @@ public abstract class RepositoryServerSSHPass<S extends RepositoryServer> extend
protected boolean canStart(Object... args) throws Exception {
if (!Global.mainModule.getAccount().CheckAdmin(Log))
return false;
if (Global.normalProperties.ServerUserPassword.isEmpty()){
if (Global.normalProperties.ServerUserPassword.isEmpty()) {
Log.Writeln_("Не задан пароль");
return false;
}

View File

@@ -35,7 +35,6 @@ public abstract class OpenSapforVersionPass extends Pass<SapforVersion_json> {
SapforTask task = target.task;
ShowMessage1("Построение дерева версий и создание баз данных...");
File rootHome = new File(Global.visualiser.getDownloadsDirectory(), Utils_.getDateName(task.test_description));
for (SapforVersion_json version_json : task.versions) {
ShowMessage2(version_json.version);
version_json.createProject(rootHome);

View File

@@ -6,16 +6,16 @@ import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
import java.io.Serializable;
public abstract class ClientPass <S extends RepositoryServer,T> extends Pass<T> {
public abstract class ClientPass<S extends RepositoryServer, T> extends Pass<T> {
protected RepositoryPass request;
protected boolean isSafe(){
protected boolean isSafe() {
return true;
}
@Override
protected boolean needsAnimation() {
return false;
}
protected boolean requestNeedsAnimation(){
protected boolean requestNeedsAnimation() {
return true;
}
@Override
@@ -23,9 +23,9 @@ public abstract class ClientPass <S extends RepositoryServer,T> extends Pass<T>
return "";
}
protected abstract S getServer();
protected boolean SendRequest(ServerCode code_in, String arg_in, Serializable object_in){
protected boolean SendRequest(ServerCode code_in, String arg_in, Serializable object_in) {
request = null;
request = new RepositoryPass(getServer()) {
request = new RepositoryPass(getServer()) {
@Override
protected boolean needsAnimation() {
return requestNeedsAnimation();
@@ -41,9 +41,9 @@ public abstract class ClientPass <S extends RepositoryServer,T> extends Pass<T>
@Override
protected void ServerAction() throws Exception {
if (isSafe())
Command(new SafeServerExchangeUnit(code_in, arg_in,object_in));
Command(new SafeServerExchangeUnit(code_in, arg_in, object_in));
else
unsafe_command(new ServerExchangeUnit_2021(code_in,arg_in,object_in)); //только для отдельных команд.
unsafe_command(new ServerExchangeUnit_2021(code_in, arg_in, object_in)); //только для отдельных команд.
target = server_response.object;
}
@Override
@@ -53,10 +53,10 @@ public abstract class ClientPass <S extends RepositoryServer,T> extends Pass<T>
};
return request.Do();
}
protected boolean SendRequest(ServerCode code_in, String arg_in){
return SendRequest(code_in,arg_in,null);
protected boolean SendRequest(ServerCode code_in, String arg_in) {
return SendRequest(code_in, arg_in, null);
}
protected boolean SendRequest(ServerCode code_in){
protected boolean SendRequest(ServerCode code_in) {
return SendRequest(code_in, "", null);
}
}

View File

@@ -26,13 +26,13 @@ public abstract class CloneServerObject<S extends RepositoryServer, D extends ri
return false;
//---------
pk = null;
src= (D) server.db.getTable(currentClass()).getUI().getCurrent();
src = (D) server.db.getTable(currentClass()).getUI().getCurrent();
return true;
}
@Override
protected void ServerAction() throws Exception {
Command(new SafeServerExchangeUnit(ServerCode.CloneObjectByPK,
Global.mainModule.getAccount().name+"\n"+Global.mainModule.getAccount().email,
Global.mainModule.getAccount().name + "\n" + Global.mainModule.getAccount().email,
new Pair<>(src.getClass(), src.getPK())));
pk = server_response.object;
}

View File

@@ -1,7 +1,7 @@
package _VisualDVM.Passes.Server;
import _VisualDVM.ComponentsServer.ComponentsServer;
import _VisualDVM.Global;
public class ComponentsServerPass<T> extends ClientPass<ComponentsServer,T> {
public class ComponentsServerPass<T> extends ClientPass<ComponentsServer, T> {
@Override
protected ComponentsServer getServer() {
return Global.componentsServer;

View File

@@ -46,17 +46,17 @@ public class DeleteServerObjects<S extends RepositoryServer, D extends DBObject>
Vector<D> selected_or_current_objects = table.getUI().getSelectedOrCurrent();
Vector<Object> res = new Vector<>(); //ключи объектов после фильтрации.
Vector<Object> forbidden = new Vector<>();
for (D object: selected_or_current_objects){
if (object instanceof riDBObject){
for (D object : selected_or_current_objects) {
if (object instanceof riDBObject) {
riDBObject r = (riDBObject) object;
if (Global.mainModule.getAccount().CheckAuthorship(r.sender_address,null))
if (Global.mainModule.getAccount().CheckAuthorship(r.sender_address, null))
res.add(r.getPK());
else
forbidden.add(r.getPK());
}
}
if (!forbidden.isEmpty()){
Log.Writeln_("У вас нет прав на удаление "+forbidden.size()+" объектов!");
if (!forbidden.isEmpty()) {
Log.Writeln_("У вас нет прав на удаление " + forbidden.size() + " объектов!");
return false;
}
target = res;

View File

@@ -1,7 +1,6 @@
package _VisualDVM.Passes.Server;
import Common.Database.RepositoryRefuseException;
import Common.Passes.Pass;
import Common.Visual.UI;
import _VisualDVM.Constants;
import _VisualDVM.Repository.Server.RepositoryServer;
import _VisualDVM.Repository.Server.SafeServerExchangeUnit;
@@ -13,12 +12,12 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.*;
public abstract class RepositoryPass<S extends RepositoryServer, T> extends Pass<T> {
protected S server;
protected ObjectInputStream in = null; // поток чтения из сокета
protected ObjectOutputStream out = null; // поток записи в сокет
//-
public ServerExchangeUnit_2021 client_request;
public ServerExchangeUnit_2021 server_response;
protected S server;
protected ObjectInputStream in = null; // поток чтения из сокета
protected ObjectOutputStream out = null; // поток записи в сокет
//-
protected Socket clientSocket = null; //сокет для общения
protected ServerCode ExitCode = ServerCode.Undefined;

View File

@@ -16,6 +16,6 @@ public abstract class StartServerPass<S extends RepositoryServer> extends Reposi
}
@Override
protected void ServerAction() throws Exception {
StartServer();
StartServer();
}
}

View File

@@ -1,7 +1,7 @@
package _VisualDVM.Passes.Server;
import _VisualDVM.Global;
import _VisualDVM.TestingSystem.Common.TestingServer;
public class TestingServerPass<T> extends ClientPass<TestingServer,T> {
public class TestingServerPass<T> extends ClientPass<TestingServer, T> {
@Override
protected TestingServer getServer() {
return Global.testingServer;

View File

@@ -32,7 +32,7 @@ public abstract class ActualizeTestingPackages<P extends TestingPackage> extends
}
}
return (account.role.equals(AccountRole.Admin) || account.role.equals(AccountRole.Developer)) &&
!target.isEmpty()&&SendRequest(getCheckCode(), "", target);
!target.isEmpty() && SendRequest(getCheckCode(), "", target);
}
@Override
protected void performDone() throws Exception {