no message

This commit is contained in:
2025-01-18 01:36:02 +03:00
parent 69151dd7a8
commit 18b4d58682
47 changed files with 724 additions and 532 deletions

View File

@@ -0,0 +1,24 @@
package _VisualDVM;
import com.google.gson.annotations.Expose;
import java.io.File;
public class ComponentsServerProperties extends VisualDVMProperties{
//---
@Expose
public boolean EmailAdminsOnStart = false;
@Expose
public String BackupWorkspace = "_sapfor_x64_backups";
@Expose
public int BackupHour = 5;
@Expose
public int BackupMinute = 0;
@Expose
public int ComponentsBackUpsCount = 10;
//---
public ComponentsServerProperties(){
Mode = _VisualDVM.Mode.Server;
}
public ComponentsServerProperties(File file_in){
super(_VisualDVM.Mode.Server, file_in);
}
}

View File

@@ -1,10 +1,10 @@
package _VisualDVM;
import Common.Properties;
import Common.Utils.Loggable;
import Common.Utils.Utils_;
import Common.Visual.UI;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.ProjectView;
import _VisualDVM.Repository.Component.ComponentType;
import _VisualDVM.Repository.Component.ComponentsSet;
import _VisualDVM.Repository.Component.PerformanceAnalyzer.PerformanceAnalyzer;
import _VisualDVM.Repository.Component.Sapfor.MessagesServer;
@@ -18,14 +18,16 @@ import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
import java.io.File;
import java.nio.file.Paths;
import java.util.Vector;
public class Global {
//todo свести большинство к содержимому mainModule, сделать различные типы properties, переместить туда глобальный журнал (?)
public static MainModule mainModule = null;
//Режим
public static Mode mode = Mode.Undefined;
//--------------------------------------------------
public static GlobalProperties properties = null;
public static VisualDVMProperties properties= null;
public static NormalProperties normalProperties = null;
public static ComponentsServerProperties componentsServerProperties = null;
public static TestingServerProperties testingServerProperties = null;
//---
public static boolean files_multiselection = false;
public static boolean versions_multiselection = false;
@@ -53,7 +55,6 @@ public class Global {
public static ComponentsServer componentsServer = new ComponentsServer();
public static TestingServer testingServer = new TestingServer();
public static PerformanceAnalyzer performanceAnalyzer = null;
public static void CheckVisualiserDirectories() {
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
@@ -144,21 +145,6 @@ public class Global {
}
System.exit(0);
}
/*
public static String packSapforSettings() {
Vector<String> res_ = new Vector<>();
Vector<SettingName> forbidden = new Vector<>();
forbidden.add(SettingName.GCOVLimit);
forbidden.add(SettingName.Precompilation);
forbidden.add(SettingName.DVMConvertationOptions);
forbidden.add(SettingName.SaveModifications);
for (DBSetting setting : mainModule.getDb().settings.getSettingsByOwner(ComponentType.SapforOptions)) {
if (!forbidden.contains(setting.Name))
res_.add(setting.Value);
}
return String.join("|", res_);
}
*/
//--
public static void NormalMode(int port) throws Exception {
//-------------------------------->>
@@ -183,7 +169,7 @@ public class Global {
components = new ComponentsSet();
components.initialVersionsCheck();
//-------->>
if (properties.AutoUpdateSearch)
if (normalProperties.AutoUpdateSearch)
Global.mainModule.getPass(PassCode.GetComponentsActualVersions).Do();
components.validateStates();
if (components.needChanges()) {
@@ -223,9 +209,9 @@ public class Global {
componentsServer.ActivateDB();
testingServer.ActivateDB();
//-- чисто чтобы создать таблицы. соединения на стороне клиента не предвидится.
if (Global.properties.AutoBugReportsLoad)
if (normalProperties.AutoBugReportsLoad)
Global.mainModule.getPass(PassCode.SynchronizeBugReports).Do();
if (Global.properties.AutoTestsLoad)
if (normalProperties.AutoTestsLoad)
Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
//--
Global.mainModule.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.
@@ -260,17 +246,41 @@ public class Global {
}
}
//---
public static void SynchronizeProperties() throws Exception {
File propertiesFile = new File(System.getProperty("user.dir"), "properties");
if (!propertiesFile.exists()) {
mode = Mode.Normal;
properties=normalProperties = Utils_.SynschronizeProperties(propertiesFile, NormalProperties.class);
} else {
properties = Utils_.jsonFromFile(propertiesFile, VisualDVMProperties.class);
mode = properties.Mode;
//--->>
switch (mode){
case Normal:
normalProperties = Utils_.SynschronizeProperties(propertiesFile, NormalProperties.class);
break;
case Server:
componentsServerProperties = Utils_.SynschronizeProperties(propertiesFile, ComponentsServerProperties.class);
break;
case Testing:
testingServerProperties = Utils_.SynschronizeProperties(propertiesFile, TestingServerProperties.class);
break;
case MachineQueue:
case Package:
break;
default:
break;
}
}
}
//---
public static void Init(String... args) {
System.out.println("VisualSapfor.jar started..");
System.out.println("home directory is" + Utils_.Brackets(Utils_.getHomePath()));
//--->
properties=Utils_.SynschronizeProperties(
Paths.get(System.getProperty("user.dir"), "properties").toFile(),
GlobalProperties.class);
//--->
mode = properties.Mode;
System.out.println("mode is " + mode);
try {
SynchronizeProperties();
System.out.println("mode is " + mode);
switch (mode) {
case Normal:
NormalMode(Integer.parseInt(args[1]));

View File

@@ -29,7 +29,6 @@ import _VisualDVM.Passes.PassCode;
import java.nio.file.Paths;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Vector;
public class GlobalDatabase extends VisualiserDatabase {
//---------СЕАНС----------------------------------------------
public MachinesDBTable machines;
@@ -89,19 +88,19 @@ public class GlobalDatabase extends VisualiserDatabase {
}
//todo централизованное сохранение текущих объектов в базах
public void SaveCredentials() {
Global.properties.updateField("lastMachineId", getTable(Machine.class).getUI().getCurrentPK(CommonConstants.Nan));
Global.properties.updateField("lastUserId", getTable(User.class).getUI().getCurrentPK(CommonConstants.Nan));
Global.properties.updateField("lastCompilerId", getTable(Compiler.class).getUI().getCurrentPK(CommonConstants.Nan));
Global.normalProperties.updateField("lastMachineId", getTable(Machine.class).getUI().getCurrentPK(CommonConstants.Nan));
Global.normalProperties.updateField("lastUserId", getTable(User.class).getUI().getCurrentPK(CommonConstants.Nan));
Global.normalProperties.updateField("lastCompilerId", getTable(Compiler.class).getUI().getCurrentPK(CommonConstants.Nan));
}
public void RestoreCredentials() {
if (Global.properties.lastMachineId != CommonConstants.Nan) {
getTable(Machine.class).getUI().SetCurrentByPK(Global.properties.lastMachineId);
if (Global.normalProperties.lastMachineId != CommonConstants.Nan) {
getTable(Machine.class).getUI().SetCurrentByPK(Global.normalProperties.lastMachineId);
//-
if (Global.properties.lastUserId != CommonConstants.Nan)
getTable(User.class).getUI().SetCurrentByPK(Global.properties.lastUserId);
if (Global.normalProperties.lastUserId != CommonConstants.Nan)
getTable(User.class).getUI().SetCurrentByPK(Global.normalProperties.lastUserId);
//--
if (Global.properties.lastCompilerId != CommonConstants.Nan)
getTable(Compiler.class).getUI().SetCurrentByPK(Global.properties.lastCompilerId);
if (Global.normalProperties.lastCompilerId != CommonConstants.Nan)
getTable(Compiler.class).getUI().SetCurrentByPK(Global.normalProperties.lastCompilerId);
}
}
//--

View File

@@ -17,7 +17,7 @@ public class WindowsLocalCompilationSupervisor extends WindowsLocalTaskSuperviso
}
@Override
protected String getScriptText() {
return Utils_.DQuotes(Global.properties.LocalMakePathWindows) + " 1>out.txt 2>err.txt";
return Utils_.DQuotes(Global.normalProperties.LocalMakePathWindows) + " 1>out.txt 2>err.txt";
}
//скорее всего как то выделить подготовку к компиляции как метод предка.
@Override

View File

@@ -6,51 +6,38 @@ import com.google.gson.annotations.Expose;
import javax.swing.*;
import java.io.File;
public class GlobalProperties extends Properties {
@Expose
public _VisualDVM.Mode Mode = _VisualDVM.Mode.Normal; //todo унаследовать от предка.
@Expose
public String ServerAddress = "alex-freenas.ddns.net";
@Expose
public String ServerUserName = "testuser";
@Expose
public int ServerUserSHHPort = 23;
@Expose
public int ComponentsServerPort = 7995;
@Expose
public int TestingServerPort = 7998;
@Expose
public int SocketTimeout = 5000;
@Expose
public boolean OldServer = false;
@Expose
public String SMTPHost = "smtp.mail.ru";
@Expose
public int SMTPPort = 465;
@Expose
public int MailSocketPort = 465;
@Expose
public boolean collapseCredentials = false;
@Expose
public boolean collapseFileGraphs = false;
@Expose
public boolean collapseFileMessages = false;
@Expose
public boolean collapseProjectTrees = false;
@Expose
public String BackupWorkspace = "_sapfor_x64_backups";
public class GlobalProperties extends VisualDVMProperties {
//---
@Expose
public String Workspace ="";
@Expose
public String ProjectsSearchDirectory="";
@Expose
public int EditorFontSize=14;
public String VisualiserPath = "";
@Expose
public String Sapfor_FPath = "";
@Expose
public String Visualizer_2Path = "";
@Expose
public String InstructionPath = "";
@Expose
public String PerformanceAnalyzerPath = "";
//TESTING SERVER
@Expose
public boolean eraseTestingWorkspaces = true; //удалять ли рабочее пространство пакетов тестирования после его завершения
//COMPONENTS SERVER
@Expose
public boolean EmailAdminsOnStart = false;
@Expose
public String BackupWorkspace = "_sapfor_x64_backups";
@Expose
public int BackupHour = 5;
@Expose
public int BackupMinute = 0;
@Expose
public boolean EmailAdminsOnStart = false;
public int ComponentsBackUpsCount = 10;
//NORMAL MODE
//--
@Expose
public boolean AutoUpdateSearch = true;
@Expose
@@ -63,40 +50,35 @@ public class GlobalProperties extends Properties {
public boolean ShowPassesDone = true;
@Expose
public boolean FocusPassesResult = true;
//--
@Expose
public String ProjectDBName = "new_project_base.sqlite";
public boolean collapseCredentials = false;
@Expose
public String BugReportsDBName = "bug_reports.sqlite";
public boolean collapseFileGraphs = false;
@Expose
public String TestsDBName = "tests.sqlite";
public boolean collapseFileMessages = false;
@Expose
public boolean collapseProjectTrees = false;
//--
@Expose
public int EditorFontSize=14;
@Expose
public int ComponentsWindowWidth = 650;
@Expose
public int ComponentsWindowHeight = 250;
@Expose
public String VisualiserPath = "";
@Expose
public String Sapfor_FPath = "";
@Expose
public String Visualizer_2Path = "";
@Expose
public String InstructionPath = "";
@Expose
public String PerformanceAnalyzerPath = "";
@Expose
public String LocalMakePathWindows= "C:\\MinGW\\msys\\1.0\\bin\\make.exe";
//--
@Expose
public int Kernels= Utils.getHalfKernels();
@Expose
public int ComponentsBackUpsCount = 10;
@Expose
public boolean AutoCheckTesting = false; // проверять ли задачи тестирования при включенном визуализаторе.
public String LocalMakePathWindows= "C:\\MinGW\\msys\\1.0\\bin\\make.exe";
//--
@Expose
public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования
@Expose
public boolean EmailOnTestingProgress = false; //включено ли оповещение по email о результатах тестирования.
public boolean AutoCheckTesting = false; // проверять ли задачи тестирования при включенном визуализаторе.
@Expose
public boolean eraseTestingWorkspaces = true; //удалять ли рабочее пространство пакетов тестирования после его завершения
public boolean EmailOnTestingProgress = false; //включено ли оповещение по email о результатах тестирования.
//--
@Expose
public int lastMachineId = CommonConstants.Nan;
@Expose
@@ -117,7 +99,7 @@ public class GlobalProperties extends Properties {
@Expose
public boolean ComparsionDiffMergeOn = false;
//--
//компактность
//компактность------
@Expose
public boolean ShowFullArraysDeclarations =false;
@Expose
@@ -130,19 +112,9 @@ public class GlobalProperties extends Properties {
public int FastAccessPassesCount=10;
@Expose
public int LastOpenedProjectsCount=10;
///-----------
public GlobalProperties(GlobalProperties p) {
super();
Mode = p.Mode;
ServerAddress = p.ServerAddress;
ServerUserName = p.ServerUserName;
ServerUserSHHPort = p.ServerUserSHHPort;
ComponentsServerPort = p.ComponentsServerPort;
TestingServerPort = p.TestingServerPort;
SocketTimeout = p.SocketTimeout;
OldServer = p.OldServer;
SMTPHost = p.SMTPHost;
SMTPPort = p.SMTPPort;
MailSocketPort = p.MailSocketPort;
super(p);
collapseCredentials = p.collapseCredentials;
collapseFileGraphs = p.collapseFileGraphs;
collapseFileMessages = p.collapseFileMessages;
@@ -155,9 +127,6 @@ public class GlobalProperties extends Properties {
ConfirmPassesStart = p.ConfirmPassesStart;
ShowPassesDone = p.ShowPassesDone;
FocusPassesResult = p.FocusPassesResult;
ProjectDBName = p.ProjectDBName;
BugReportsDBName = p.BugReportsDBName;
TestsDBName = p.TestsDBName;
ComponentsWindowWidth = p.ComponentsWindowWidth;
ComponentsWindowHeight = p.ComponentsWindowHeight;
VisualiserPath = p.VisualiserPath;
@@ -194,10 +163,10 @@ public class GlobalProperties extends Properties {
}
//--
public GlobalProperties(File file_in) {
super(file_in);
super(_VisualDVM.Mode.Normal, file_in);
}
public GlobalProperties(){
Mode= _VisualDVM.Mode.Normal;
}
@Override
public String getFieldDescription(String fieldName) {

View File

@@ -156,18 +156,18 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
//--
@Override
public int getFirstAccessPassesCount() {
return Global.properties.FastAccessPassesCount;
return Global.normalProperties.FastAccessPassesCount;
}
@Override
public boolean confirmPassesStart() {
return Global.properties.ConfirmPassesStart;
return Global.normalProperties.ConfirmPassesStart;
}
@Override
public boolean confirmPassesDone() {
return Global.properties.ShowPassesDone;
return Global.normalProperties.ShowPassesDone;
}
@Override
public boolean focusPassesResult() {
return Global.properties.FocusPassesResult;
return Global.normalProperties.FocusPassesResult;
}
}

View File

@@ -0,0 +1,103 @@
package _VisualDVM;
import Common.CommonConstants;
import com.google.gson.annotations.Expose;
import java.io.File;
public class NormalProperties extends VisualDVMProperties{
//---
@Expose
public String Workspace ="";
@Expose
public String ProjectsSearchDirectory="";
@Expose
public String VisualiserPath = "";
@Expose
public String Sapfor_FPath = "";
@Expose
public String Visualizer_2Path = "";
@Expose
public String InstructionPath = "";
@Expose
public String PerformanceAnalyzerPath = "";
//---
@Expose
public boolean AutoUpdateSearch = true;
@Expose
public boolean AutoBugReportsLoad = true;
@Expose
public boolean AutoTestsLoad = true;
@Expose
public boolean ConfirmPassesStart = true;
@Expose
public boolean ShowPassesDone = true;
@Expose
public boolean FocusPassesResult = true;
//--
@Expose
public boolean collapseCredentials = false;
@Expose
public boolean collapseFileGraphs = false;
@Expose
public boolean collapseFileMessages = false;
@Expose
public boolean collapseProjectTrees = false;
//--
@Expose
public int EditorFontSize=14;
@Expose
public int ComponentsWindowWidth = 650;
@Expose
public int ComponentsWindowHeight = 250;
//--
@Expose
public int Kernels= Utils.getHalfKernels();
@Expose
public String LocalMakePathWindows= "C:\\MinGW\\msys\\1.0\\bin\\make.exe";
//--
@Expose
public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования
@Expose
public boolean AutoCheckTesting = false; // проверять ли задачи тестирования при включенном визуализаторе.
@Expose
public boolean EmailOnTestingProgress = false; //включено ли оповещение по email о результатах тестирования.
//--
@Expose
public int lastMachineId = CommonConstants.Nan;
@Expose
public int lastUserId = CommonConstants.Nan;
@Expose
public int lastCompilerId = CommonConstants.Nan;
//-- сравнение
@Expose
public boolean RegisterOn = false;
@Expose
public boolean SpacesOn = false;
@Expose
public boolean EmptyLinesOn = false;
@Expose
public boolean FortranWrapsOn = false;
@Expose
public boolean ExtensionsOn = false;
@Expose
public boolean ComparsionDiffMergeOn = false;
//компактность--
@Expose
public boolean ShowFullArraysDeclarations =false;
@Expose
public boolean ShowFullTabsNames=true;
@Expose
public boolean SmallScreen = false;
@Expose
public int BugReportsAgeLimit = 2;
@Expose
public int FastAccessPassesCount=10;
@Expose
public int LastOpenedProjectsCount=10;
//--
public NormalProperties(){
Mode = _VisualDVM.Mode.Normal;
}
public NormalProperties(File file_in){
super(_VisualDVM.Mode.Normal, file_in);
}
}

View File

@@ -26,7 +26,7 @@ public class ArchivesBackupPass extends ConnectionPass<File> {
}
@Override
protected void ServerAction() throws Exception {
String workspace_path = Utils_.toU(Paths.get(user.connection.sftpChannel.getHome(), Global.properties.BackupWorkspace).toString());
String workspace_path = Utils_.toU(Paths.get(user.connection.sftpChannel.getHome(), Global.componentsServerProperties.BackupWorkspace).toString());
RemoteFile workspace = new RemoteFile(workspace_path, true);
user.connection.MKDIR(workspace);
RemoteFile dst = new RemoteFile(workspace.full_name, src.getName());

View File

@@ -21,7 +21,7 @@ public class DeleteDownloadedBugReports extends Pass<DirInfosDataSet> {
target = (DirInfosDataSet) Global.mainModule.getPass(PassCode.GetOldBugReports).target;
if (target.Data.isEmpty()) {
Log.Writeln_("Не найдено отчетов, не использовавшихся " +
Global.properties.BugReportsAgeLimit +
Global.normalProperties.BugReportsAgeLimit +
" месяцев и более!");
return false;
}
@@ -45,7 +45,7 @@ public class DeleteDownloadedBugReports extends Pass<DirInfosDataSet> {
}
};
if (dialog.ShowDialog("Найдено " + target.size() + " отчетов, не использовавшихся " +
Global.properties.BugReportsAgeLimit +
Global.normalProperties.BugReportsAgeLimit +
" месяцев и более. Удалить?")) {
return true;
}

View File

@@ -28,7 +28,7 @@ public class GetOldBugReports extends Pass<DirInfosDataSet> {
//---
Calendar c = new GregorianCalendar();
c.setTimeInMillis(System.currentTimeMillis());
c.add(Calendar.MONTH, -Global.properties.BugReportsAgeLimit);
c.add(Calendar.MONTH, -Global.normalProperties.BugReportsAgeLimit);
Date date = c.getTime();
System.out.println(date);
long border = date.getTime();

View File

@@ -1,7 +1,7 @@
package _VisualDVM.Passes.All;
import Common.Visual.Windows.Dialog.VFileChooser;
import _VisualDVM.Global;
import _VisualDVM.GlobalProperties;
import _VisualDVM.NormalProperties;
import _VisualDVM.Passes.CurrentComponentPass;
import java.io.File;
@@ -22,15 +22,15 @@ public class InstallComponentFromFolder extends CurrentComponentPass {
if (super.canStart(args)) {
VFileChooser fileChooser = target.getFileChooser();
String propertyName = target.getComponentType() + "Path";
String lastDirectory = (String) GlobalProperties.class.getField(propertyName).get(Global.properties);
String lastDirectory = (String) NormalProperties.class.getField(propertyName).get(Global.normalProperties);
if (!lastDirectory.isEmpty()) {
//настройка выставлена не впервые, устанавливаем ее как папку
fileChooser.SetCurrentDirectory(lastDirectory);
}
boolean res = (file = fileChooser.ShowDialog()) != null;
File newDirectory = fileChooser.getCurrentDirectory();
GlobalProperties.class.getField(propertyName).set(Global.properties, newDirectory.getAbsolutePath());
Global.properties.Update();
NormalProperties.class.getField(propertyName).set(Global.normalProperties, newDirectory.getAbsolutePath());
Global.normalProperties.Update();
return res;
}
return false;

View File

@@ -93,7 +93,7 @@ public class Precompilation extends Pass<db_project_info> {
target = Global.mainModule.getProject();
if (Utils_.isWindows()) {
//--
makepath = Global.properties.LocalMakePathWindows;
makepath = Global.normalProperties.LocalMakePathWindows;
if (makepath.isEmpty()) {
Log.Writeln_("Не задан путь к make.exe.\n " +
"Укажите его в меню глобальных настроек." +
@@ -184,10 +184,10 @@ public class Precompilation extends Pass<db_project_info> {
protected void body() throws Exception {
if (Utils_.isWindows()) {
name_to_kill = "make.exe";
StartProcess(Utils_.DQuotes(Global.properties.LocalMakePathWindows) + " -j " + Global.properties.Kernels,
StartProcess(Utils_.DQuotes(Global.normalProperties.LocalMakePathWindows) + " -j " + Global.normalProperties.Kernels,
target.compilation_maxtime);
} else
StartProcess("make -j " + Global.properties.Kernels, target.compilation_maxtime);
StartProcess("make -j " + Global.normalProperties.Kernels, target.compilation_maxtime);
}
protected void StartProcess(String command, int TA) throws Exception {
killed = false;

View File

@@ -62,7 +62,7 @@ public class StartSelectedDVMConfigurations extends PublishServerObject<TestingS
user,
compiler,
configurations,
Global.properties.EmailOnTestingProgress ? 1 : 0
Global.normalProperties.EmailOnTestingProgress ? 1 : 0
);
//----
if (target.tasksCount == 0) {

View File

@@ -41,7 +41,7 @@ public class StartSelectedSAPFORConfigurations extends PublishServerObject<Testi
target = new SapforPackage(Global.mainModule.getAccount(),
Global.testingServer.db.serverSapfors.getUI().getCurrent(),
configurations,
Global.properties.EmailOnTestingProgress ? 1 : 0,
Global.normalProperties.EmailOnTestingProgress ? 1 : 0,
Log);
if (target.tasksCount == 0) {
Log.Writeln_("Не сформировано ни одной новой задачи.");

View File

@@ -6,7 +6,7 @@ import Common.Visual.Windows.Dialog.SpinnerNumberForm;
import Common.Visual.Windows.Dialog.VDirectoryChooser;
import Common.Visual.Windows.Dialog.VFileChooser;
import _VisualDVM.Global;
import _VisualDVM.GlobalProperties;
import _VisualDVM.NormalProperties;
import _VisualDVM.Utils;
import javax.swing.*;
@@ -20,9 +20,9 @@ public class UpdateProperty extends Pass<Object> {
@Override
protected boolean canStart(Object... args) throws Exception {
name = (String) args[0];
String description = Global.properties.getFieldDescription(name);
field = GlobalProperties.class.getField(name);
oldValue = field.get(Global.properties);
String description = Global.normalProperties.getFieldDescription(name);
field = NormalProperties.class.getField(name);
oldValue = field.get(Global.normalProperties);
newValue = null;
SliderNumberForm sliderNumberForm = new SliderNumberForm();
VDirectoryChooser directoryChooser = new VDirectoryChooser("");
@@ -69,7 +69,8 @@ public class UpdateProperty extends Pass<Object> {
case "Workspace":
directoryChooser.setTitle(description);
directoryChooser.SetCurrentDirectory(
Global.properties.Workspace.isEmpty() ? Global.ProjectsDirectory : new File(Global.properties.Workspace));
Global.normalProperties.Workspace.isEmpty() ? Global.ProjectsDirectory :
new File(Global.normalProperties.Workspace));
File dir = directoryChooser.ShowDialog();
if (dir != null)
newValue = dir.getAbsolutePath();
@@ -82,8 +83,8 @@ public class UpdateProperty extends Pass<Object> {
}
@Override
protected void body() throws Exception {
field.set(Global.properties, newValue);
Global.properties.Update();
field.set(Global.normalProperties, newValue);
Global.normalProperties.Update();
}
@Override
protected void showDone() throws Exception {
@@ -128,8 +129,8 @@ public class UpdateProperty extends Pass<Object> {
case "SmallScreen":
if (Global.mainModule.HasProject())
Global.mainModule.getUI().getMainWindow().getProjectWindow().SwitchScreen(
Global.properties.SmallScreen);
Global.mainModule.getUI().getMainWindow().getCallbackWindow().SwitchScreen( Global.properties.SmallScreen);
Global.normalProperties.SmallScreen);
Global.mainModule.getUI().getMainWindow().getCallbackWindow().SwitchScreen( Global.normalProperties.SmallScreen);
break;
}
}

View File

@@ -28,8 +28,8 @@ public abstract class RepositoryServerSSHPass extends ConnectionPass {
userHome = null;
serverHome = null;
//--
machine = new Machine("alex", Global.properties.ServerAddress, Global.properties.ServerUserSHHPort, MachineType.Server);
user = new User(Global.properties.ServerUserName, "mprit_2011");
machine = new Machine("alex", Global.normalProperties.ServerAddress, Global.normalProperties.ServerUserSHHPort, MachineType.Server);
user = new User(Global.normalProperties.ServerUserName, "mprit_2011");
super.Connect();
//--
userHome = new RemoteFile(user.connection.sftpChannel.getHome(), true);

View File

@@ -47,7 +47,7 @@ public class SPFEditor extends BaseEditor implements SPFEditorInterface {
highlighter = (RSyntaxTextAreaHighlighter) getHighlighter();
autoComplete = new SapforAutoComplete(this);
//-------------------------
float font_size = (float) Global.properties.EditorFontSize;
float font_size = (float) Global.normalProperties.EditorFontSize;
setFont(getFont().deriveFont(font_size));
//-------------------------
setText(Utils.ReadAllText(file.file).replace("\r", " "));

View File

@@ -221,7 +221,7 @@ public class db_project_info extends DBObject {
//-
public static File get_db_file(File project_home) {
return new File(Paths.get(project_home.toString(), Constants.data,
Global.properties.ProjectDBName).toString());
"new_project_base.sqlite").toString());
}
public static String recommendAnalysis(PassCode code_in) {
return Constants.unknown_metric + " примените анализатор \"" + code_in.getDescription() + "\"";

View File

@@ -52,15 +52,15 @@ public class ProjectArraysForm extends DataSetControlForm<ProjectArray> {
@Override
public Class getRendererClass() {
//todo все настройки переделать в проперти(?)
return Global.properties.ShowFullArraysDeclarations ? RendererHyperlinks.class : RendererHiddenList.class;
return Global.normalProperties.ShowFullArraysDeclarations ? RendererHyperlinks.class : RendererHiddenList.class;
}
@Override
public Class getEditorClass() {
return Global.properties.ShowFullArraysDeclarations ? EditorFilesHyperlinks.class : null;
return Global.normalProperties.ShowFullArraysDeclarations ? EditorFilesHyperlinks.class : null;
}
@Override
public int getMaxWidth() {
return Global.properties.ShowFullArraysDeclarations ? CommonConstants.Nan : 200;
return Global.normalProperties.ShowFullArraysDeclarations ? CommonConstants.Nan : 200;
}
},
new ColumnInfo<ProjectArray>("Размерность") {

View File

@@ -14,7 +14,7 @@ public class BugReportsDatabase extends SQLiteDatabase {
public SubsribersDBTable subscribers;
public SubscriberWorkspaceDBTable workspaces; //рабочие пространства для машин.
public BugReportsDatabase() {
super(Paths.get(System.getProperty("user.dir"), "Data", Global.properties.BugReportsDBName).toFile());
super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile());
}
@Override
protected void initAllTables() throws Exception {

View File

@@ -60,7 +60,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 = 1136;
version = 1137;
String pattern = "MMM dd yyyy HH:mm:ss";
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
date_text = df.format(getClassBuildTime());
@@ -72,8 +72,8 @@ public class Visualiser extends Component {
System.exit(0);
}
public File getWorkspace() {
if (!Global.properties.Workspace.isEmpty()) {
File workspace = new File(Global.properties.Workspace);
if (!Global.normalProperties.Workspace.isEmpty()) {
File workspace = new File(Global.normalProperties.Workspace);
if (workspace.exists())
return workspace;
else

View File

@@ -67,7 +67,7 @@ public abstract class RepositoryServer<D extends Database> {
}
}
}
//------------
//-DVMTestingChecker
public abstract int getPort();
protected abstract void Session() throws Exception;
protected void startAdditionalThreads() {
@@ -87,14 +87,14 @@ public abstract class RepositoryServer<D extends Database> {
Thread thread = new Thread(() -> {
try {
Properties props = new Properties();
props.put("mail.smtp.host", Global.properties.SMTPHost);
props.put("mail.smtp.host", Global.normalProperties.SMTPHost);
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", String.valueOf(Global.properties.SMTPPort));
props.put("mail.smtp.socketFactory.port", String.valueOf(Global.properties.MailSocketPort));
props.put("mail.smtp.port", String.valueOf(Global.normalProperties.SMTPPort));
props.put("mail.smtp.socketFactory.port", String.valueOf(Global.normalProperties.MailSocketPort));
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.connectiontimeout", String.valueOf(Global.properties.SocketTimeout));
props.put("mail.smtp.timeout", String.valueOf(Global.properties.SocketTimeout));
props.put("mail.smtp.writetimeout", String.valueOf(Global.properties.SocketTimeout));
props.put("mail.smtp.connectiontimeout", String.valueOf(Global.normalProperties.SocketTimeout));
props.put("mail.smtp.timeout", String.valueOf(Global.normalProperties.SocketTimeout));
props.put("mail.smtp.writetimeout", String.valueOf(Global.normalProperties.SocketTimeout));
//------------------------------
LinkedHashMap<String, File> innerFiles = new LinkedHashMap<>();
for (String aName : message_in.files.keySet()) {

View File

@@ -1,4 +1,5 @@
package _VisualDVM.Repository.Server;
import Common.CommonConstants;
import Common.Database.Objects.DBObject;
import Common.Database.RepositoryRefuseException;
import Common.Utils.Utils_;
@@ -58,7 +59,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
int day = rightNow.get(Calendar.DAY_OF_MONTH);
int hour = rightNow.get(Calendar.HOUR_OF_DAY);
int minute = rightNow.get(Calendar.MINUTE);
if ((hour == Global.properties.BackupHour) && (minute == Global.properties.BackupMinute)) {
if ((hour == Global.componentsServerProperties.BackupHour) && (minute == Global.componentsServerProperties.BackupMinute)) {
//определить имя папки с багом.
String backUpName = year + "_" + (month + 1) + "_" + (day);
File todayBackUp = Paths.get(Global.DataBackUpsDirectory.getAbsolutePath(), backUpName).toFile();
@@ -120,12 +121,12 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
}
@Override
public void StartAction() throws Exception {
if (Global.properties.EmailAdminsOnStart) {
if (Global.componentsServerProperties.EmailAdminsOnStart) {
EmailMessage message = new EmailMessage(
"Сервер Sapfor запущен",
new Date().toString()
);
for (String address:Constants.admins_mails) {
for (String address : Constants.admins_mails) {
Email(message, address);
}
}
@@ -135,278 +136,275 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
BugReport bugReport = null;
Subscriber subscriber = null;
Account account = null;
if (!Global.properties.OldServer) {
switch (code) {
//<editor-fold desc="Регистрация">
case CheckSubscriberRole:
Print("Проверить роль пользователя");
switch (code) {
//<editor-fold desc="Регистрация">
case CheckSubscriberRole:
Print("Проверить роль пользователя");
response = new ServerExchangeUnit_2021(ServerCode.OK);
account = (Account) request.object;
if (db.subscribers.containsKey(account.email)) {
subscriber = db.subscribers.get(account.email);
} else {
subscriber = new Subscriber();
subscriber.name = account.name;
subscriber.address = account.email;
subscriber.mailOn = 1;
db.Insert(subscriber);
}
response.object = subscriber; //возвращаем информацию о подписчике.
break;
//</editor-fold>
//<editor-fold desc="БАГ РЕПОРТЫ">
case ReceiveAllArchives:
Print("Отправить клиенту архив всех архивов баг репортов");
response = new ServerExchangeUnit_2021(ServerCode.OK);
ZipFolderPass zip = new ZipFolderPass();
File archives = new File(Utils_.getDateName("Bugs"));
if (zip.Do("Bugs", archives.getAbsolutePath())) {
response.object = Utils_.fileToBytes(archives);
Print("Архив успешно запакован");
} else throw new RepositoryRefuseException("Не удалось запаковать архивы");
break;
case UpdateBugReport:
//-
BugReport oldBugReport = (BugReport) request.object;
Print("Обновить баг репорт " + oldBugReport.id);
if (db.bugReports.containsKey(oldBugReport.id)) {
bugReport = db.bugReports.get(oldBugReport.id);
bugReport.SynchronizeFields(oldBugReport);
bugReport.change_date = oldBugReport.change_date;
db.Update(bugReport);
response = new ServerExchangeUnit_2021(ServerCode.OK);
account = (Account) request.object;
if (db.subscribers.containsKey(account.email)) {
subscriber = db.subscribers.get(account.email);
} else {
subscriber = new Subscriber();
subscriber.name = account.name;
subscriber.address = account.email;
subscriber.mailOn = 1;
db.Insert(subscriber);
}
response.object = subscriber; //возвращаем информацию о подписчике.
break;
//</editor-fold>
//<editor-fold desc="БАГ РЕПОРТЫ">
case ReceiveAllArchives:
Print("Отправить клиенту архив всех архивов баг репортов");
} else
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
break;
case UpdateBugReportField: //нужно для дополнений полей
//-
BugReport oldBugReport_ = (BugReport) request.object;
Print("Обновить поле " + request.arg + " баг репорта " + oldBugReport_.id);
if (db.bugReports.containsKey(oldBugReport_.id)) {
bugReport = db.bugReports.get(oldBugReport_.id);
Object newValue = BugReport.class.getField(request.arg).get(oldBugReport_);
BugReport.class.getField(request.arg).set(bugReport, newValue);
bugReport.change_date = oldBugReport_.change_date;
db.Update(bugReport);
response = new ServerExchangeUnit_2021(ServerCode.OK);
ZipFolderPass zip = new ZipFolderPass();
File archives = new File(Utils_.getDateName("Bugs"));
if (zip.Do("Bugs", archives.getAbsolutePath())) {
response.object = Utils_.fileToBytes(archives);
Print("Архив успешно запакован");
} else throw new RepositoryRefuseException("Не удалось запаковать архивы");
break;
case UpdateBugReport:
//-
BugReport oldBugReport = (BugReport) request.object;
Print("Обновить баг репорт " + oldBugReport.id);
if (db.bugReports.containsKey(oldBugReport.id)) {
bugReport = db.bugReports.get(oldBugReport.id);
bugReport.SynchronizeFields(oldBugReport);
bugReport.change_date = oldBugReport.change_date;
db.Update(bugReport);
} else
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport_.id + " не существует.");
break;
case ReceiveBugReportsDatabase:
Print("Получить базу данных баг репортов");
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Utils_.fileToBytes(db.getFile());
break;
case ReceiveBugReport:
Print("Скачать баг репорт по ключу " + request.arg);
File bugArchive = Paths.get(Utils_.getHomePath(), "Bugs", request.arg).toFile();
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Utils_.fileToBytes(bugArchive);
break;
case SendBugReport:
Print("Отправить баг репорт " + request.arg);
File bugArchive1 = Paths.get(Utils_.getHomePath(), "Bugs", request.arg).toFile();
Utils_.bytesToFile((byte[]) request.object, bugArchive1);
response = new ServerExchangeUnit_2021(ServerCode.OK);
break;
//</editor-fold>
case GetComponentsBackups:
Print("Получить список сохраненных версий компонента " + request.arg);
File backupsDirectory = Paths.get(Utils_.getHomePath(), "Components", request.arg, "Backups").toFile();
//--
if (backupsDirectory.exists()) {
File[] files = backupsDirectory.listFiles(File::isFile);
if (files != null) {
response = new ServerExchangeUnit_2021(ServerCode.OK);
Vector<RemoteFile> res = new Vector<>();
for (File file : files)
res.add(new RemoteFile(file.getAbsolutePath(), false)); //тут всегда линух.
response.object = res;
} else
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
break;
case UpdateBugReportField: //нужно для дополнений полей
//-
BugReport oldBugReport_ = (BugReport) request.object;
Print("Обновить поле " + request.arg + " баг репорта " + oldBugReport_.id);
if (db.bugReports.containsKey(oldBugReport_.id)) {
bugReport = db.bugReports.get(oldBugReport_.id);
Object newValue = BugReport.class.getField(request.arg).get(oldBugReport_);
BugReport.class.getField(request.arg).set(bugReport, newValue);
bugReport.change_date = oldBugReport_.change_date;
db.Update(bugReport);
response = new ServerExchangeUnit_2021(ServerCode.OK);
} else
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport_.id + " не существует.");
break;
case ReceiveBugReportsDatabase:
Print("Получить базу данных баг репортов");
throw new RepositoryRefuseException("Не удалось получить список предыдущих версий");
} else {
//баги еще не создавались. штатная ситуация.
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Utils_.fileToBytes(db.getFile());
break;
case ReceiveBugReport:
Print("Скачать баг репорт по ключу " + request.arg);
File bugArchive = Paths.get(Utils_.getHomePath(), "Bugs", request.arg).toFile();
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Utils_.fileToBytes(bugArchive);
break;
case SendBugReport:
Print("Отправить баг репорт " + request.arg);
File bugArchive1 = Paths.get(Utils_.getHomePath(), "Bugs", request.arg).toFile();
Utils_.bytesToFile((byte[]) request.object, bugArchive1);
response = new ServerExchangeUnit_2021(ServerCode.OK);
break;
//</editor-fold>
case GetComponentsBackups:
Print("Получить список сохраненных версий компонента " + request.arg);
File backupsDirectory = Paths.get(Utils_.getHomePath(), "Components", request.arg, "Backups").toFile();
//--
if (backupsDirectory.exists()) {
File[] files = backupsDirectory.listFiles(File::isFile);
if (files != null) {
response = new ServerExchangeUnit_2021(ServerCode.OK);
Vector<RemoteFile> res = new Vector<>();
for (File file : files)
res.add(new RemoteFile(file.getAbsolutePath(), false)); //тут всегда линух.
response.object = res;
} else
throw new RepositoryRefuseException("Не удалось получить список предыдущих версий");
} else {
//баги еще не создавались. штатная ситуация.
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = new Vector<>();
}
break;
case PublishComponent:
String[] packed = request.arg.split("\n");
String sComponentType = packed[0];
String componentFileName = packed[1];
String sComponentVersion = packed[2];
String componentChangeRecord = request.arg.substring(
sComponentType.length() +
componentFileName.length() +
sComponentVersion.length() +
3
response.object = new Vector<>();
}
break;
case PublishComponent:
String[] packed = request.arg.split("\n");
String sComponentType = packed[0];
String componentFileName = packed[1];
String sComponentVersion = packed[2];
String componentChangeRecord = request.arg.substring(
sComponentType.length() +
componentFileName.length() +
sComponentVersion.length() +
3
);
Print("Опубликовать компонент " + sComponentType);
File componentFile = Paths.get(Utils_.getHomePath(), "Components", sComponentType, componentFileName).toFile();
File versionFile = Paths.get(Utils_.getHomePath(), "Components", sComponentType, "version.txt").toFile();
File backupsFolder = Paths.get(Utils_.getHomePath(), "Components", sComponentType, "Backups").toFile();
//0 архивация старой версии, если она есть.
if (componentFile.exists()) {
String versionText = "";
if (versionFile.exists())
versionText = Utils.ReadAllText(versionFile);
//---->>
Utils_.CheckDirectory(backupsFolder);
Utils.keepNewFiles(backupsFolder, Global.componentsServerProperties.ComponentsBackUpsCount);
//-->>
File backupFile = new File(backupsFolder, sComponentType + "_" + versionText);
if (backupFile.exists())
Utils_.forceDeleteWithCheck(backupFile);
FileUtils.moveFile(componentFile, backupFile);
}
//1 распаковка компонента
Utils_.bytesToFile((byte[]) request.object, componentFile);
//2 запись версии компонента
FileUtils.writeStringToFile(versionFile, sComponentVersion);
//3 запись в журнал компонента
File changesLog = Paths.get(Utils_.getHomePath(), "Components", sComponentType, "changes.txt").toFile();
FileWriter writer = new FileWriter(changesLog.getAbsolutePath(), true);
BufferedWriter bufferWriter = new BufferedWriter(writer);
bufferWriter.write(componentChangeRecord);
bufferWriter.close();
//-
response = new ServerExchangeUnit_2021(ServerCode.OK);
break;
case UpdateComponentMinimalVersion:
String[] packed_ = request.arg.split("\n");
String sComponentType_ = packed_[0];
String sComponentMinimalVersion = packed_[1];
Print("Поднять минимальную версию компонента " + sComponentType_);
File minimal_versionFile = Paths.get(Utils_.getHomePath(), "Components", sComponentType_, "minimal_version.txt").toFile();
FileUtils.writeStringToFile(minimal_versionFile, sComponentMinimalVersion);
//-
//3 запись в журнал компонента
File changesLog_ = Paths.get(Utils_.getHomePath(), "Components", sComponentType_, "changes.txt").toFile();
FileWriter writer_ = new FileWriter(changesLog_.getAbsolutePath(), true);
BufferedWriter bufferWriter_ = new BufferedWriter(writer_);
bufferWriter_.write("Минимальная версия поднята до " + sComponentMinimalVersion + "\n");
bufferWriter_.close();
//-
//-
response = new ServerExchangeUnit_2021(ServerCode.OK);
break;
case ReceiveComponent:
String[] packed1 = request.arg.split("\n");
//тип/имя файла
File componentFile1 = Paths.get(Utils_.getHomePath(), "Components", packed1[0], packed1[1]).toFile();
Print("Получить компонент " + packed1[0]);
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Utils_.fileToBytes(componentFile1);
break;
default:
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
case GetComponentsVersions:
Print("Получить актуальные версии компонентов (NEW)");
String[] types = request.arg.split("\n");
LinkedHashMap<ComponentType, String> response_actual_versions_ = new LinkedHashMap<>();
for (String sType : types) {
ComponentType componentType = ComponentType.valueOf(sType);
File vFile = Paths.get(Utils_.getHomePath(), "Components", sType, "version.txt").toFile();
String v_string = Utils_.removeCharacters(
Utils.ReadAllText(vFile),
"\n", "\r"
);
Print("Опубликовать компонент " + sComponentType);
File componentFile = Paths.get(Utils_.getHomePath(), "Components", sComponentType, componentFileName).toFile();
File versionFile = Paths.get(Utils_.getHomePath(), "Components", sComponentType, "version.txt").toFile();
File backupsFolder = Paths.get(Utils_.getHomePath(), "Components", sComponentType, "Backups").toFile();
//0 архивация старой версии, если она есть.
if (componentFile.exists()) {
String versionText = "";
if (versionFile.exists())
versionText = Utils.ReadAllText(versionFile);
//---->>
Utils_.CheckDirectory(backupsFolder);
Utils.keepNewFiles(backupsFolder, Global.properties.ComponentsBackUpsCount);
//-->>
File backupFile = new File(backupsFolder, sComponentType + "_" + versionText);
if (backupFile.exists())
Utils_.forceDeleteWithCheck(backupFile);
FileUtils.moveFile(componentFile, backupFile);
}
//1 распаковка компонента
Utils_.bytesToFile((byte[]) request.object, componentFile);
//2 запись версии компонента
FileUtils.writeStringToFile(versionFile, sComponentVersion);
//3 запись в журнал компонента
File changesLog = Paths.get(Utils_.getHomePath(), "Components", sComponentType, "changes.txt").toFile();
FileWriter writer = new FileWriter(changesLog.getAbsolutePath(), true);
BufferedWriter bufferWriter = new BufferedWriter(writer);
bufferWriter.write(componentChangeRecord);
bufferWriter.close();
//-
response = new ServerExchangeUnit_2021(ServerCode.OK);
break;
case UpdateComponentMinimalVersion:
String[] packed_ = request.arg.split("\n");
String sComponentType_ = packed_[0];
String sComponentMinimalVersion = packed_[1];
Print("Поднять минимальную версию компонента " + sComponentType_);
File minimal_versionFile = Paths.get(Utils_.getHomePath(), "Components", sComponentType_, "minimal_version.txt").toFile();
FileUtils.writeStringToFile(minimal_versionFile, sComponentMinimalVersion);
//-
//3 запись в журнал компонента
File changesLog_ = Paths.get(Utils_.getHomePath(), "Components", sComponentType_, "changes.txt").toFile();
FileWriter writer_ = new FileWriter(changesLog_.getAbsolutePath(), true);
BufferedWriter bufferWriter_ = new BufferedWriter(writer_);
bufferWriter_.write("Минимальная версия поднята до " + sComponentMinimalVersion + "\n");
bufferWriter_.close();
//-
//-
response = new ServerExchangeUnit_2021(ServerCode.OK);
break;
case ReceiveComponent:
String[] packed1 = request.arg.split("\n");
//тип/имя файла
File componentFile1 = Paths.get(Utils_.getHomePath(), "Components", packed1[0], packed1[1]).toFile();
Print("Получить компонент " + packed1[0]);
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Utils_.fileToBytes(componentFile1);
break;
default:
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
case GetComponentsVersions:
Print("Получить актуальные версии компонентов (NEW)");
String[] types = request.arg.split("\n");
LinkedHashMap<ComponentType, String> response_actual_versions_ = new LinkedHashMap<>();
for (String sType : types) {
ComponentType componentType = ComponentType.valueOf(sType);
File vFile = Paths.get(Utils_.getHomePath(), "Components", sType, "version.txt").toFile();
String v_string = Utils_.removeCharacters(
Utils.ReadAllText(vFile),
"\n", "\r"
);
response_actual_versions_.put(componentType, v_string);
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = response_actual_versions_;
break;
case GetComponentsMinimalVersions:
Print("Получить минимальные версии компонентов (NEW)");
String[] types_ = request.arg.split("\n");
LinkedHashMap<ComponentType, String> response_minimal_versions_ = new LinkedHashMap<>();
for (String sType : types_) {
ComponentType componentType = ComponentType.valueOf(sType);
File vFile = Paths.get(Utils_.getHomePath(), "Components", sType, "minimal_version.txt").toFile();
String mv_string = Utils_.removeCharacters(
Utils.ReadAllText(vFile),
"\n", "\r"
);
response_minimal_versions_.put(componentType, mv_string);
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = response_minimal_versions_;
break;
case GetComponentChangesLog:
Print("Получить журнал изменений компонента " + request.arg);
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Utils_.fileToBytes(Paths.get(Utils_.getHomePath(), "Components", request.arg, "changes.txt").toFile());
break;
case CheckURLRegistered:
Print("Проверить учетную запись на машине");
String[] data = request.arg.split("\n");
String email = data[0];
String machineURL = data[1];
String login = data[2];
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = db.workspaces.findWorkspace(email, machineURL, login);
break;
case DVMConvertProject:
Print("Сконвертировать проект в DVM код");
response = new ServerExchangeUnit_2021(ServerCode.OK);
String[] args = request.arg.split("\n");
//-
String projectName = args[0];
LanguageName projectLanguage = LanguageName.valueOf(args[1]);
String options = args[2];
Vector<String> filesNames = new Vector<>(Arrays.asList(args).subList(3, args.length));
//-
File workspace = Utils.getTempFileName("convertation");
FileUtils.forceMkdir(workspace);
File archive = new File(workspace, projectName + ".zip");
request.Unpack(archive);
File project = new File(workspace, projectName);
Vector<String> badFiles = new Vector<>();
if (unzip.Do(archive.getAbsolutePath(), workspace.getAbsolutePath()) && project.exists()) {
String output = "";
for (String fileName : filesNames) {
File program = Paths.get(project.getAbsolutePath(), fileName).toFile();
//--
File convertedProgram = Paths.get(program.getParent(),
Utils_.getFileNameWithoutExtension(program) + ".DVMH." +
(projectLanguage.equals(LanguageName.fortran) ? "f" : "c")
).toFile();
String command =
Utils_.DQuotes(server_dvm_drv) + " " +
projectLanguage.getDVMCompile() + "dv " +
options + " "
+ Utils_.DQuotes(program.getName());
//--
File fileWorkspace = program.getParentFile();
Process process = Utils.startScript(workspace, fileWorkspace, Utils_.getDateName("convert_script"), command);
process.waitFor();
String convertationOut = Utils.readAllOutput(process);
convertationOut = convertationOut.replace(program.getName(), fileName); //для учета пути.
if (!convertationOut.isEmpty())
output += convertationOut + "\n";
try {
if (convertedProgram.exists()) {
FileUtils.forceDelete(program);
convertedProgram.renameTo(program);
} else badFiles.add(program.getName());
} catch (Exception ex) {
ex.printStackTrace();
}
//--
}
response.arg = String.join("\n", badFiles) + "|" + output;
File resultArchive = new File(workspace, projectName + "_result.zip");
if (ComponentsServer.zip.Do(project.getAbsolutePath(), resultArchive.getAbsolutePath())) {
response.object = Utils_.fileToBytes(resultArchive);
} else
throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось запаковать версию");
response_actual_versions_.put(componentType, v_string);
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = response_actual_versions_;
break;
case GetComponentsMinimalVersions:
Print("Получить минимальные версии компонентов (NEW)");
String[] types_ = request.arg.split("\n");
LinkedHashMap<ComponentType, String> response_minimal_versions_ = new LinkedHashMap<>();
for (String sType : types_) {
ComponentType componentType = ComponentType.valueOf(sType);
File vFile = Paths.get(Utils_.getHomePath(), "Components", sType, "minimal_version.txt").toFile();
String mv_string = Utils_.removeCharacters(
Utils.ReadAllText(vFile),
"\n", "\r"
);
response_minimal_versions_.put(componentType, mv_string);
}
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = response_minimal_versions_;
break;
case GetComponentChangesLog:
Print("Получить журнал изменений компонента " + request.arg);
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = Utils_.fileToBytes(Paths.get(Utils_.getHomePath(), "Components", request.arg, "changes.txt").toFile());
break;
case CheckURLRegistered:
Print("Проверить учетную запись на машине");
String[] data = request.arg.split("\n");
String email = data[0];
String machineURL = data[1];
String login = data[2];
response = new ServerExchangeUnit_2021(ServerCode.OK);
response.object = db.workspaces.findWorkspace(email, machineURL, login);
break;
case DVMConvertProject:
Print("Сконвертировать проект в DVM код");
response = new ServerExchangeUnit_2021(ServerCode.OK);
String[] args = request.arg.split("\n");
//-
String projectName = args[0];
LanguageName projectLanguage = LanguageName.valueOf(args[1]);
String options = args[2];
Vector<String> filesNames = new Vector<>(Arrays.asList(args).subList(3, args.length));
//-
File workspace = Utils.getTempFileName("convertation");
FileUtils.forceMkdir(workspace);
File archive = new File(workspace, projectName + ".zip");
request.Unpack(archive);
File project = new File(workspace, projectName);
Vector<String> badFiles = new Vector<>();
if (unzip.Do(archive.getAbsolutePath(), workspace.getAbsolutePath()) && project.exists()) {
String output = "";
for (String fileName : filesNames) {
File program = Paths.get(project.getAbsolutePath(), fileName).toFile();
//--
File convertedProgram = Paths.get(program.getParent(),
Utils_.getFileNameWithoutExtension(program) + ".DVMH." +
(projectLanguage.equals(LanguageName.fortran) ? "f" : "c")
).toFile();
String command =
Utils_.DQuotes(server_dvm_drv) + " " +
projectLanguage.getDVMCompile() + "dv " +
options + " "
+ Utils_.DQuotes(program.getName());
//--
File fileWorkspace = program.getParentFile();
Process process = Utils.startScript(workspace, fileWorkspace, Utils_.getDateName("convert_script"), command);
process.waitFor();
String convertationOut = Utils.readAllOutput(process);
convertationOut = convertationOut.replace(program.getName(), fileName); //для учета пути.
if (!convertationOut.isEmpty())
output += convertationOut + "\n";
try {
if (convertedProgram.exists()) {
FileUtils.forceDelete(program);
convertedProgram.renameTo(program);
} else badFiles.add(program.getName());
} catch (Exception ex) {
ex.printStackTrace();
}
//--
}
response.arg = String.join("\n", badFiles) + "|" + output;
File resultArchive = new File(workspace, projectName + "_result.zip");
if (ComponentsServer.zip.Do(project.getAbsolutePath(), resultArchive.getAbsolutePath())) {
response.object = Utils_.fileToBytes(resultArchive);
} else
throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось распаковать проект");
break;
}
} else
response = new ServerExchangeUnit_2021(ServerCode.OLD);
throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось запаковать версию");
//--
} else
throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось распаковать проект");
break;
}
}
@Override
protected void startAdditionalThreads() {

View File

@@ -0,0 +1,12 @@
package _VisualDVM;
import com.google.gson.annotations.Expose;
import java.io.File;
public class TestingServerProperties extends VisualDVMProperties{
public TestingServerProperties(){
Mode = _VisualDVM.Mode.Testing;
}
public TestingServerProperties(File file_in){
super(_VisualDVM.Mode.Testing, file_in);
}
}

View File

@@ -2,11 +2,8 @@ package _VisualDVM.TestingSystem.Common.MachineProcess;
import Common.CommonConstants;
import Common.Database.Objects.DBObject;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.GlobalProperties;
import _VisualDVM.Mode;
import _VisualDVM.*;
import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
import _VisualDVM.Utils;
import org.apache.commons.io.FileUtils;
import java.io.File;
@@ -82,7 +79,7 @@ public class MachineProcess extends DBObject {
boolean local = false;
try {
InetAddress address = InetAddress.getByName(machineAddress);
InetAddress localAddress = InetAddress.getByName(Global.properties.ServerAddress);
InetAddress localAddress = InetAddress.getByName(Global.normalProperties.ServerAddress);
local = localAddress.getHostAddress().equals(address.getHostAddress());
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
@@ -99,7 +96,7 @@ public class MachineProcess extends DBObject {
File supervisor = new File(workspace, "VisualSapfor.jar");
FileUtils.copyFile(src, supervisor);
//создание настроек
GlobalProperties properties = new GlobalProperties(Global.properties);
VisualDVMProperties properties = new VisualDVMProperties();
properties.Mode = Mode.MachineQueue;
Utils_.jsonToFile(properties, new File(workspace, "properties"));
Vector<String> args = new Vector<>();

View File

@@ -46,7 +46,7 @@ public class TestingMenuBar extends VisualiserMenuBar {
});
}
public void Mark() {
setIcon(Utils_.getIcon(Global.properties.EmailOnTestingProgress ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
setIcon(Utils_.getIcon(Global.normalProperties.EmailOnTestingProgress ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
}
});
//--
@@ -57,7 +57,7 @@ public class TestingMenuBar extends VisualiserMenuBar {
Mark();
addActionListener(e -> {
Global.mainModule.getPass(PassCode.UpdateProperty).Do("AutoCheckTesting");
if (Global.properties.AutoCheckTesting)
if (Global.normalProperties.AutoCheckTesting)
TestingServer.TimerOn();
else
TestingServer.TimerOff();
@@ -66,18 +66,18 @@ public class TestingMenuBar extends VisualiserMenuBar {
});
}
public void Mark() {
setIcon(Utils_.getIcon(Global.properties.AutoCheckTesting ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
setIcon(Utils_.getIcon(Global.normalProperties.AutoCheckTesting ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
}
});
//--
add(sCheckTime = new JSpinner());
sCheckTime.setPreferredSize(new Dimension(60, 26));
sCheckTime.setMaximumSize(new Dimension(60, 26));
sCheckTime.setModel(new SpinnerNumberModel(Global.properties.CheckTestingIntervalSeconds, 10, 3600, 1));
sCheckTime.setValue(Global.properties.CheckTestingIntervalSeconds);
sCheckTime.setModel(new SpinnerNumberModel(Global.normalProperties.CheckTestingIntervalSeconds, 10, 3600, 1));
sCheckTime.setValue(Global.normalProperties.CheckTestingIntervalSeconds);
UI.MakeSpinnerRapid(sCheckTime, e -> {
Global.properties.updateField("CheckTestingIntervalSeconds", sCheckTime.getValue());
if (Global.properties.AutoCheckTesting) TestingServer.ResetTimer();
Global.normalProperties.updateField("CheckTestingIntervalSeconds", sCheckTime.getValue());
if (Global.normalProperties.AutoCheckTesting) TestingServer.ResetTimer();
});
add(new JLabel(" сек ") {
{
@@ -89,7 +89,7 @@ public class TestingMenuBar extends VisualiserMenuBar {
addPasses(PassCode.StartTestingServer, PassCode.ShutdownTestingServer, PassCode.PublishTestingServer);
}
public void ShowAutoCheckTesting() {
autorefreshButton.setIcon(Utils_.getIcon(Global.properties.AutoCheckTesting ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
autorefreshButton.setIcon(Utils_.getIcon(Global.normalProperties.AutoCheckTesting ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
}
public void showServerAdminLabel(boolean flag) {
serverAdminLabel.setVisible(flag);

View File

@@ -233,7 +233,7 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
return String.join("/", user.workspace, "modules", "planner");
}
/*
void CheckLocal() {
void CheckLocal() { загрузка результатов
local = false;
try {
InetAddress address = InetAddress.getByName(machine.address);

View File

@@ -67,7 +67,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
System.out.println("ServerName=" + Utils_.Brackets(name));
}
public static void TimerOn() {
checkTimer = new Timer(Global.properties.CheckTestingIntervalSeconds * 1000, e -> {
checkTimer = new Timer(Global.normalProperties.CheckTestingIntervalSeconds * 1000, e -> {
Global.mainModule.getPass(PassCode.ActualizePackages).Do();
});
checkTimer.start();
@@ -242,9 +242,8 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
//основа
@Override
public int getPort() {
return Global.properties.TestingServerPort;
return Global.properties.TestingServerPort;
}
//---
@Override
protected void startAdditionalThreads() {
testingThread.start();

View File

@@ -242,7 +242,7 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
unzipFolderPass.Do(results_archive.getAbsolutePath(), packageLocalWorkspace.getAbsolutePath(), false);
}
//---
if (Global.properties.eraseTestingWorkspaces && user.connection.Exists(packageRemoteWorkspace))
if (user.connection.Exists(packageRemoteWorkspace))
user.connection.RMDIR(packageRemoteWorkspace.full_name);
}
@Override

View File

@@ -91,7 +91,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
File visualiser = new File(workspace, "VisualSapfor.jar");
FileUtils.copyFile(new File(Utils_.getHomeDirectory(), "TestingSystem.jar"), visualiser);
//создание настроек
GlobalProperties properties = new GlobalProperties(Global.properties);
VisualDVMProperties properties = new VisualDVMProperties();
properties.Mode = Mode.Package;
Utils_.jsonToFile(properties, new File(workspace, "properties"));
//подготовка пакетного режима. Запустит его уже очередь.

View File

@@ -598,7 +598,7 @@ public class Utils {
return res;
}
public static void RestoreSelectedDirectory(VFileChooser_ directoryChooser) {
String last_dir_home = Global.properties.ProjectsSearchDirectory;
String last_dir_home = Global.normalProperties.ProjectsSearchDirectory;
if (!last_dir_home.isEmpty())
directoryChooser.SetCurrentDirectory(last_dir_home);
}
@@ -646,11 +646,11 @@ public class Utils {
break;
case ' ':
case '\t':
if (Global.properties.SpacesOn) line.append(c);
if (Global.normalProperties.SpacesOn) line.append(c);
v_line.append(c);
break;
case '\n': //конец строки
if (Global.properties.FortranWrapsOn) {
if (Global.normalProperties.FortranWrapsOn) {
//оракул. лезем в начало следующей строки
//и анализируем первые 5 символов
boolean hasWrap = false;
@@ -676,7 +676,7 @@ public class Utils {
break;
}
//добавление строки в результат.
if ((line.length() > 0) || Global.properties.EmptyLinesOn
if ((line.length() > 0) || Global.normalProperties.EmptyLinesOn
// Global.db.settings.get(SettingName.SpacesOn).toBoolean()
) {
lines.add(line.toString());
@@ -695,7 +695,7 @@ public class Utils {
if ((i > 0) && (c != '\n')) {
//строка оборвалась на EOF
//добавление строки в результат.
if ((line.length() > 0) || Global.properties.EmptyLinesOn
if ((line.length() > 0) || Global.normalProperties.EmptyLinesOn
// && Global.db.settings.get(SettingName.SpacesOn).toBoolean()
) {
lines.add(line.toString());
@@ -707,11 +707,11 @@ public class Utils {
public static boolean CompareLines(String line1_raw, String line2_raw) {
String line1 = line1_raw;
String line2 = line2_raw;
if (!Global.properties.RegisterOn) {
if (!Global.normalProperties.RegisterOn) {
line1 = line1.toUpperCase();
line2 = line2.toUpperCase();
}
if (!Global.properties.SpacesOn) {
if (!Global.normalProperties.SpacesOn) {
line1 = Utils_.removeCharacters(line1, " ", "\t");
line2 = Utils_.removeCharacters(line2, " ", "\t");
}

View File

@@ -31,7 +31,7 @@ public class LastOpenedProjectsMenu extends VisualiserMenu {
});
add(i);
++k;
if (k > Global.properties.LastOpenedProjectsCount)
if (k > Global.normalProperties.LastOpenedProjectsCount)
break;
}
}

View File

@@ -4,7 +4,7 @@ import _VisualDVM.Visual.Menus.PropertiesSubmenu;
public class SynchronizationSettingsMenu extends PropertiesSubmenu {
public SynchronizationSettingsMenu() {
super("Синхронизация", null,
Global.properties,
Global.normalProperties,
"AutoBugReportsLoad",
"AutoTestsLoad",
"AutoUpdateSearch");

View File

@@ -4,7 +4,7 @@ import _VisualDVM.Visual.Menus.PropertiesSubmenu;
public class VersionsComparisonMenu extends PropertiesSubmenu {
public VersionsComparisonMenu() {
super("Сравнение версий", null,
Global.properties,
Global.normalProperties,
"RegisterOn",
"SpacesOn",
"EmptyLinesOn",

View File

@@ -4,7 +4,7 @@ import _VisualDVM.Visual.Menus.PropertiesSubmenu;
public class CompactnessSettingsMenu extends PropertiesSubmenu {
public CompactnessSettingsMenu() {
super("Компактность отображения", null,
Global.properties,
Global.normalProperties,
"SmallScreen",
"ShowFullArraysDeclarations",
"ShowFullTabsNames",
@@ -12,7 +12,7 @@ public class CompactnessSettingsMenu extends PropertiesSubmenu {
"FastAccessPassesCount");
addSeparator();
addProperties(
Global.properties,
Global.normalProperties,
"collapseProjectTrees",
"collapseFileGraphs",
"collapseFileMessages");

View File

@@ -10,7 +10,7 @@ public class VisualiserSettingsMenu extends VisualiserMenu {
super("Настройки визуализатора", "/Common/icons/Settings.png");
//-
add(new PropertiesSubmenu("Подтверждения и уведомления", null,
Global.properties,
Global.normalProperties,
"ShowPassesDone",
"ConfirmPassesStart",
"FocusPassesResult"
@@ -18,21 +18,21 @@ public class VisualiserSettingsMenu extends VisualiserMenu {
add(new CompactnessSettingsMenu());
if (Utils_.isWindows()) {
add(new PropertiesSubmenu("Компиляция на локальной машине", null,
Global.properties,
Global.normalProperties,
"LocalMakePathWindows",
"Kernels"
));
}else {
add(new PropertiesSubmenu("Компиляция на локальной машине", null,
Global.properties,
Global.normalProperties,
"Kernels"
));
}
add(new SynchronizationSettingsMenu());
add(new VersionsComparisonMenu());
add(Global.properties.getMenuItem("Workspace"));
add(Global.properties.getMenuItem("BugReportsAgeLimit"));
add(Global.normalProperties.getMenuItem("Workspace"));
add(Global.normalProperties.getMenuItem("BugReportsAgeLimit"));
}
}

View File

@@ -151,7 +151,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
BugReportCommentAddition.setWrapStyleWord(true);
//----------------------------------------------
//тут развилка на то вкладки или поля.
SwitchScreen(Global.properties.SmallScreen);
SwitchScreen(Global.normalProperties.SmallScreen);
//-
Global.componentsServer.db.bugReports.mountUI(bugReportsPanel);
Global.componentsServer.db.subscribers.mountUI(subscribersPanel);

View File

@@ -14,11 +14,11 @@ public class ComponentsWindow extends Dialog<Object, ComponentsFields> {
}
@Override
public int getDefaultWidth() {
return Global.properties.ComponentsWindowWidth;
return Global.normalProperties.ComponentsWindowWidth;
}
@Override
public int getDefaultHeight() {
return Global.properties.ComponentsWindowHeight;
return Global.normalProperties.ComponentsWindowHeight;
}
@Override
public void CreateButtons() {
@@ -37,8 +37,8 @@ public class ComponentsWindow extends Dialog<Object, ComponentsFields> {
@Override
public void onClose() {
super.onClose();
Global.properties.ComponentsWindowWidth = getWidth();
Global.properties.ComponentsWindowHeight = getHeight();
Global.properties.Update();
Global.normalProperties.ComponentsWindowWidth = getWidth();
Global.normalProperties.ComponentsWindowHeight = getHeight();
Global.normalProperties.Update();
}
}

View File

@@ -96,10 +96,10 @@ public class FileForm implements FileWindow, FormWithSplitters {
ShowProperties();
Global.mainModule.getPass(PassCode.Save).setControlsEnabled(false);
//-
if (Global.properties.collapseFileGraphs)
if (Global.normalProperties.collapseFileGraphs)
CollapseGraphs();
//-
if (Global.properties.collapseFileMessages)
if (Global.normalProperties.collapseFileMessages)
CollapseMessages();
}
@Override
@@ -168,33 +168,33 @@ public class FileForm implements FileWindow, FormWithSplitters {
//----
@Override
public void ShowWarningsCount() {
messagesTabs.setTitleAt(1, (Global.properties.ShowFullTabsNames ? "Предупреждения: " : "") + file.father.db.warnings.getUI().getRowCount());
messagesTabs.setTitleAt(1, (Global.normalProperties.ShowFullTabsNames ? "Предупреждения: " : "") + file.father.db.warnings.getUI().getRowCount());
}
@Override
public void ShowErrorsCount() {
messagesTabs.setTitleAt(2, (Global.properties.ShowFullTabsNames ? "Ошибки: " : "") + file.father.db.errors.getUI().getRowCount());
messagesTabs.setTitleAt(2, (Global.normalProperties.ShowFullTabsNames ? "Ошибки: " : "") + file.father.db.errors.getUI().getRowCount());
}
@Override
public void ShowNotesCount() {
messagesTabs.setTitleAt(0, (Global.properties.ShowFullTabsNames ? "Примечания: " : "") + file.father.db.notes.getUI().getRowCount());
messagesTabs.setTitleAt(0, (Global.normalProperties.ShowFullTabsNames ? "Примечания: " : "") + file.father.db.notes.getUI().getRowCount());
}
@Override
public void ShowRecommendationsCount() {
messagesTabs.setTitleAt(3, (Global.properties.ShowFullTabsNames ? "Рекомендации: " : "") + file.father.db.recommendations.getUI().getRowCount());
messagesTabs.setTitleAt(3, (Global.normalProperties.ShowFullTabsNames ? "Рекомендации: " : "") + file.father.db.recommendations.getUI().getRowCount());
}
//---
@Override
public void RefreshTabsNames() {
UI.ShowTabsNames(graphsTabs, Global.properties.ShowFullTabsNames );
UI.ShowTabsNames(graphsTabs, Global.normalProperties.ShowFullTabsNames );
//--
ShowNotesCount();
ShowWarningsCount();
ShowErrorsCount();
ShowRecommendationsCount();
//--
messagesTabs.setTitleAt(4, (Global.properties.ShowFullTabsNames ? "Компиляция" : ""));
messagesTabs.setTitleAt(5, (Global.properties.ShowFullTabsNames ? "Запуск" : ""));
messagesTabs.setTitleAt(6, (Global.properties.ShowFullTabsNames ? "Журнал GCOV" : ""));
messagesTabs.setTitleAt(4, (Global.normalProperties.ShowFullTabsNames ? "Компиляция" : ""));
messagesTabs.setTitleAt(5, (Global.normalProperties.ShowFullTabsNames ? "Запуск" : ""));
messagesTabs.setTitleAt(6, (Global.normalProperties.ShowFullTabsNames ? "Журнал GCOV" : ""));
}
@Override
public void FocusCompilationOut() {
@@ -229,10 +229,10 @@ public class FileForm implements FileWindow, FormWithSplitters {
file.father.db.warnings.ClearUI();
file.father.db.errors.ClearUI();
file.father.db.recommendations.ClearUI();
messagesTabs.setTitleAt(0, (Global.properties.ShowFullTabsNames ? "Примечания: " : "") + "-");
messagesTabs.setTitleAt(1, (Global.properties.ShowFullTabsNames ? "Предупреждения: " : "") + "-");
messagesTabs.setTitleAt(2, (Global.properties.ShowFullTabsNames ? "Ошибки: " : "") + "-");
messagesTabs.setTitleAt(3, (Global.properties.ShowFullTabsNames ? "Рекомендации: " : "") + "-");
messagesTabs.setTitleAt(0, (Global.normalProperties.ShowFullTabsNames ? "Примечания: " : "") + "-");
messagesTabs.setTitleAt(1, (Global.normalProperties.ShowFullTabsNames ? "Предупреждения: " : "") + "-");
messagesTabs.setTitleAt(2, (Global.normalProperties.ShowFullTabsNames ? "Ошибки: " : "") + "-");
messagesTabs.setTitleAt(3, (Global.normalProperties.ShowFullTabsNames ? "Рекомендации: " : "") + "-");
}
@Override
public void ShowLoops() {

View File

@@ -72,10 +72,10 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
Global.mainModule.getUI().getDebugWindow().ShowAll();
ShowAllAnalyses();
ShowProjectView();
SwitchScreen(Global.properties.SmallScreen);
SwitchScreen(Global.normalProperties.SmallScreen);
RefreshTabsNames();
//--
if (Global.properties.collapseProjectTrees)
if (Global.normalProperties.collapseProjectTrees)
CollapseProjectTrees();
//--
}
@@ -225,7 +225,7 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
}
@Override
public void RefreshTabsNames() {
UI.ShowTabsNames(projectTabs, 1, Global.properties.ShowFullTabsNames);
UI.ShowTabsNames(projectTabs, 1, Global.normalProperties.ShowFullTabsNames);
}
@Override
public void RefreshProjectTreeAndMessages() {

View File

@@ -80,10 +80,10 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
} else {
if (isReady()) {
if (getMaster().isReady()) {
boolean ExtensionsOn = (Global.properties.ExtensionsOn);
boolean ExtensionsOn = (Global.normalProperties.ExtensionsOn);
String name1 = ExtensionsOn ? getMaster().file.file.getName() : Utils_.getFileNameWithoutExtension(getMaster().file.file);
String name2 = ExtensionsOn ? file.file.getName() : Utils_.getFileNameWithoutExtension(file.file);
if (Global.properties.ComparsionDiffMergeOn) {
if (Global.normalProperties.ComparsionDiffMergeOn) {
if (name1.equalsIgnoreCase(name2))
master.DoComparePass(true);
} else
@@ -153,7 +153,7 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
cbFile.setSelectedIndex(-1);
for (int i = 0; i < cbFile.getItemCount(); ++i) {
ProjectFile projectFile = cbFile.getItemAt(i);
if (Global.properties.ExtensionsOn) {
if (Global.normalProperties.ExtensionsOn) {
//если учитываем расширения, ищем полное совпадение
if (projectFile.file.getName().equals(file_name)) {
cbFile.setSelectedIndex(i);

View File

@@ -29,7 +29,7 @@ public abstract class TasksComparisonForm<T extends DBObject> extends Comparison
//в отличие от комбо боксов, тут события нажатия на кнопку, нет.
if (isReady()) {
if (slave.isReady()) {
if (Global.properties.ComparsionDiffMergeOn) {
if (Global.normalProperties.ComparsionDiffMergeOn) {
DoComparePass(true);
} else
DoShowPass(true);
@@ -40,7 +40,7 @@ public abstract class TasksComparisonForm<T extends DBObject> extends Comparison
} else {
if (isReady()) {
if (master.isReady()) {
if (Global.properties.ComparsionDiffMergeOn) {
if (Global.normalProperties.ComparsionDiffMergeOn) {
master.DoComparePass(true);
} else
master.DoShowPass(true);

View File

@@ -147,7 +147,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
//---
Global.mainModule.getDb().RestoreCredentials();
//---
if (Global.properties.AutoCheckTesting)
if (Global.normalProperties.AutoCheckTesting)
TestingServer.TimerOn();
}
//-

View File

@@ -27,10 +27,10 @@ public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
} else {
if (isReady()) {
if (getMaster().isReady()) {
boolean ExtensionsOn = (Global.properties.ExtensionsOn);
boolean ExtensionsOn = (Global.normalProperties.ExtensionsOn);
String name1 = ExtensionsOn ? getMaster().file.file.getName() : Utils_.getFileNameWithoutExtension(getMaster().file.file);
String name2 = ExtensionsOn ? file.file.getName() : Utils_.getFileNameWithoutExtension(file.file);
if (Global.properties.ComparsionDiffMergeOn) {
if (Global.normalProperties.ComparsionDiffMergeOn) {
if (name1.equalsIgnoreCase(name2))
master.DoComparePass(true);
} else
@@ -81,7 +81,7 @@ public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
cbFile.setSelectedIndex(-1);
for (int i = 0; i < cbFile.getItemCount(); ++i) {
ProjectFile projectFile = cbFile.getItemAt(i);
if (Global.properties.ExtensionsOn) {
if (Global.normalProperties.ExtensionsOn) {
//если учитываем расширения, ищем полное совпадение
if (projectFile.file.getName().equals(file_in.file.getName())) {
cbFile.setSelectedIndex(i);
@@ -104,6 +104,6 @@ public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
}
@Override
protected boolean fortranWrapsOn() {
return Global.properties.FortranWrapsOn;
return Global.normalProperties.FortranWrapsOn;
}
}

View File

@@ -0,0 +1,49 @@
package _VisualDVM;
import Common.Properties;
import com.google.gson.annotations.Expose;
import java.io.File;
public class VisualDVMProperties extends Properties {
@Expose
public _VisualDVM.Mode Mode = _VisualDVM.Mode.Normal;
//---
@Expose
public String ServerAddress = "alex-freenas.ddns.net";
@Expose
public String ServerUserName = "testuser";
@Expose
public int ServerUserSHHPort = 23;
@Expose
public int ComponentsServerPort = 7995;
@Expose
public int TestingServerPort = 7998;
@Expose
public int SocketTimeout = 5000;
//--email
@Expose
public String SMTPHost = "smtp.mail.ru";
@Expose
public int SMTPPort = 465;
@Expose
public int MailSocketPort = 465;
//---
public VisualDVMProperties() {
}
public VisualDVMProperties(_VisualDVM.Mode mode_in, File file_in) {
super(file_in);
Mode = mode_in;
}
//---
public VisualDVMProperties(VisualDVMProperties src) {
Mode = src.Mode;
ServerAddress = src.ServerAddress;
ServerUserName = src.ServerUserName;
ServerUserSHHPort = src.ServerUserSHHPort;
ComponentsServerPort = src.ComponentsServerPort;
TestingServerPort = src.TestingServerPort;
SocketTimeout = src.SocketTimeout;
SMTPHost = src.SMTPHost;
SMTPPort = src.SMTPPort;
MailSocketPort = src.MailSocketPort;
}
}