Compare commits
170 Commits
278782a244
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| c3a669d497 | |||
| 9b76409781 | |||
| ed3d133dcd | |||
| f2644392ad | |||
| 641ce80102 | |||
| 7924212fed | |||
| 3090e80f72 | |||
| b418066932 | |||
| f5eaf3df25 | |||
| bf5a648582 | |||
| 114e2ac4ad | |||
| b5e3a2c011 | |||
| b8d10a1434 | |||
| 46cdd480bc | |||
| 93396a00b1 | |||
| eeb57ab7c2 | |||
| e53f0ed939 | |||
| 9eede4802e | |||
| 688f36c4c3 | |||
| c270429c66 | |||
| 6135b738ba | |||
| 41ce6527d5 | |||
| cba4425cd7 | |||
| 0cb4022969 | |||
| 0ec1ce09da | |||
| ef92651552 | |||
| d8178fa704 | |||
| c148f62198 | |||
| e1291446c8 | |||
| 1f4b736188 | |||
| 47a4772632 | |||
| 571e2d2544 | |||
| 62a45fd8be | |||
| 6e0956e3e5 | |||
| b46f86bebb | |||
| d2c2f571ff | |||
| 70771dd0ce | |||
| b37e20e4a4 | |||
| e8c748eb7e | |||
| da4e8b07bc | |||
| 611194be8c | |||
| a0c45a2df0 | |||
| 8d236c99b8 | |||
| ccf20c354b | |||
| 28eee09056 | |||
| cb1f19cfb7 | |||
| 74f9a68ceb | |||
| 9303839e8e | |||
| dc17b7d741 | |||
| eb86b936bc | |||
| cd86f1257a | |||
| 46e1bd17f1 | |||
| 7efe852bc1 | |||
| 829cd0c770 | |||
| 6faf06f949 | |||
| 73a39681f1 | |||
| 4c5331de55 | |||
| 411e97abb8 | |||
| fd21de489e | |||
| aac4221a4d | |||
| f1a1ce0436 | |||
| 419af0766e | |||
| 98ec37233a | |||
| 32e1e68d9a | |||
| 68cf40367a | |||
| c6d2452530 | |||
| 76c710b1bc | |||
| 029947c793 | |||
| 38f39411ad | |||
| cb7b5809f1 | |||
| ddf04c6f39 | |||
| 48290ccf97 | |||
| e706b52b53 | |||
| c8045a5db1 | |||
| 5ef516d019 | |||
| 4f5a091af7 | |||
| cc21931ebe | |||
| 18227f565a | |||
| ef5bd5b1a8 | |||
| 41b98607cd | |||
| 7178ecbc9c | |||
| dcdbaa83cf | |||
| 86b582dd1f | |||
| c7a618dd25 | |||
| fb296a02ee | |||
| 19afec4d25 | |||
| 1ae4d1980a | |||
| 919e7a2e10 | |||
| fef75270a7 | |||
| 2a30a42e77 | |||
| b900622e4e | |||
| a47a6705d8 | |||
| 809b1f8d14 | |||
| 23b143f916 | |||
| 7ef9ee0d5c | |||
| a60ed8f661 | |||
| 74ae6abf50 | |||
| b4d0a62d6c | |||
| 535053baca | |||
| af644f8f04 | |||
| dae9d58d82 | |||
| 4f50c4a559 | |||
| fcebae094f | |||
| abab3f067c | |||
| 167ceb42a5 | |||
| cf9b028400 | |||
| b763c2c266 | |||
| 811acba5a7 | |||
| bc1faa1a06 | |||
| f6cc447481 | |||
| 10c213feae | |||
| 74146fae4c | |||
| df204b64a7 | |||
| 2d0d69fd7a | |||
| 637e9c5c0f | |||
| 78ee5bc428 | |||
| 0b5f8c6ec7 | |||
| 3f4ef5f198 | |||
| afaaaba1e7 | |||
| 21a41987b4 | |||
| 933638afb8 | |||
| b6b7bb3ae5 | |||
| 6a3be45b1a | |||
| 55aa66fa18 | |||
| 2ab2a79d8d | |||
| c8d597e9cd | |||
| 9a5b84c068 | |||
| 174bc344a4 | |||
| e2b307d4f6 | |||
| a2017f9e01 | |||
| 9f4eb9d88e | |||
| 04cf5c1552 | |||
| c7626e877e | |||
|
|
cb7360ae86 | ||
| 8fc70d48ad | |||
| 4ce7190905 | |||
| dc68667b20 | |||
| 1d97048de1 | |||
| 91e40c4393 | |||
| a6e02172f8 | |||
| 8a6c9804b4 | |||
| 8aea85a009 | |||
| b1740da1f1 | |||
| 5653438b75 | |||
| c85661a264 | |||
| d2a333c7cb | |||
| f3747a359b | |||
| e123600e06 | |||
| c4157fc30b | |||
| e428d621ac | |||
| aa5bcc7df7 | |||
| dec4835187 | |||
| d66fdc5e77 | |||
| 670324837d | |||
| ab0e0af6b3 | |||
| b08242fed4 | |||
| 7b81a8bdd0 | |||
| 20aef1f340 | |||
| 39f5b99ade | |||
| e8d6764563 | |||
| 9c0f3215ad | |||
| b908ddc8f1 | |||
| 0b35c948ab | |||
| b79b33e232 | |||
| 0e2d2abb84 | |||
| fe78d89a58 | |||
| 7f9305f02b | |||
|
|
fca5bb42bd | ||
|
|
4ae8c2f664 | ||
|
|
683d5249eb |
1
.idea/artifacts/VisualSapfor_jar.xml
generated
1
.idea/artifacts/VisualSapfor_jar.xml
generated
@@ -23,6 +23,7 @@
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/libs/log4j-1.2.17.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/libs/xmlbeans-2.6.0.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/libs/commons-lang-2.6.0.jar" path-in-jar="/" />
|
||||
<element id="extracted-dir" path="$PROJECT_DIR$/libs/java-diff-utils.jar" path-in-jar="/" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
25
.idea/workspace.xml
generated
25
.idea/workspace.xml
generated
@@ -7,13 +7,7 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Loggable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Loggable.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Utils_.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Utils_.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/Visual/Tables/RendererMilliseconds.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Visual/Tables/RendererMilliseconds.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -52,9 +46,9 @@
|
||||
</file-type-list>
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/ConvertCorrectnessTests.java" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishGroup.java" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishTest.java" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/ConvertCorrectnessTests.java" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" root0="FORCE_HIGHLIGHTING" />
|
||||
</component>
|
||||
<component name="KotlinCodeInsightWorkspaceSettings">
|
||||
@@ -64,7 +58,7 @@
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="ProblemsViewState">
|
||||
<option name="selectedTabId" value="ProjectErrors" />
|
||||
<option name="selectedTabId" value="CurrentFile" />
|
||||
</component>
|
||||
<component name="ProjectId" id="1UqWSAGBQQNofrCLxSPPtOZrGP7" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||
@@ -83,6 +77,7 @@
|
||||
<property name="JavaClassFindUsagesOptions.isDerivedClasses" value="true" />
|
||||
<property name="JavaClassFindUsagesOptions.isFieldsUsages" value="true" />
|
||||
<property name="JavaClassFindUsagesOptions.isMethodsUsages" value="true" />
|
||||
<property name="OverrideImplement.combined" value="false" />
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
||||
@@ -92,8 +87,8 @@
|
||||
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.SHOW" value="true" />
|
||||
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" />
|
||||
<property name="extract.method.default.visibility" value="public" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/libs/commons-lang-2.6.0.jar" />
|
||||
<property name="project.structure.last.edited" value="Libraries" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/src" />
|
||||
<property name="project.structure.last.edited" value="Artifacts" />
|
||||
<property name="project.structure.proportion" value="0.15" />
|
||||
<property name="project.structure.side.proportion" value="0.27322906" />
|
||||
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
|
||||
@@ -105,18 +100,18 @@
|
||||
<recent name="controls.Trees" />
|
||||
</key>
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_dif_utils" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\libs" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\Transformations" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\Common\icons" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\DVM\DVMTasks\UI" />
|
||||
</key>
|
||||
<key name="MoveMembersDialog.RECENTS_KEY">
|
||||
<recent name="_VisualDVM.ComponentsServer.Component.Sapfor.Sapfor" />
|
||||
<recent name="_VisualDVM.Constants" />
|
||||
<recent name="_VisualDVM.Global" />
|
||||
<recent name="_VisualDVM.ProjectData.SapforData.Arrays.UI.ProjectArraysForm" />
|
||||
<recent name="_VisualDVM.TestingSystem.SAPFOR.SapforPackage.UI.SapforPackagesForm" />
|
||||
<recent name="_VisualDVM.TestingSystem.DVM.DVMPackage.UI.DVMPackagesForm" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\SAPFOR\SapforSettingsCommand\UI" />
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 163 KiB |
12
properties
12
properties
@@ -4,7 +4,7 @@
|
||||
"ServerUserPassword": "mprit_2011",
|
||||
"OfferRegistrationOnStart": true,
|
||||
"Workspace": "E:\\Tests",
|
||||
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1740738431",
|
||||
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1749652835\\tmp_influxsys\\v3",
|
||||
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||
@@ -15,7 +15,7 @@
|
||||
"AutoTestsLoad": true,
|
||||
"ConfirmPassesStart": true,
|
||||
"ShowPassesDone": true,
|
||||
"FocusPassesResult": true,
|
||||
"FocusPassesResult": false,
|
||||
"collapseCredentials": true,
|
||||
"collapseFileGraphs": false,
|
||||
"collapseFileMessages": false,
|
||||
@@ -26,8 +26,12 @@
|
||||
"Kernels": 8,
|
||||
"LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe",
|
||||
"CheckTestingIntervalSeconds": 10,
|
||||
"AutoCheckTesting": false,
|
||||
"AutoCheckTesting": true,
|
||||
"EmailOnTestingProgress": true,
|
||||
"CompleteCompilationOptions": true,
|
||||
"CompleteRunEnvironments": true,
|
||||
"CreateEthalonTasks": true,
|
||||
"ErasePackageWorkspace": true,
|
||||
"lastMachineId": 13,
|
||||
"lastUserId": 34,
|
||||
"lastCompilerId": 52,
|
||||
@@ -37,7 +41,7 @@
|
||||
"FortranWrapsOn": false,
|
||||
"ExtensionsOn": false,
|
||||
"ComparsionDiffMergeOn": true,
|
||||
"ShowFullArraysDeclarations": false,
|
||||
"ShowFullArraysDeclarations": true,
|
||||
"ShowFullTabsNames": true,
|
||||
"SmallScreen": false,
|
||||
"BugReportsAgeLimit": 1,
|
||||
|
||||
@@ -34,7 +34,7 @@ public abstract class Database {
|
||||
// UI.Print(DebugPrintLevel.Database, "соединение с базой данных " + file.getAbsolutePath());
|
||||
connect();
|
||||
}
|
||||
public void Activate() throws Exception{
|
||||
public void Activate() throws Exception {
|
||||
Connect();
|
||||
CreateAllTables();
|
||||
prepareTablesStatements();
|
||||
@@ -224,6 +224,20 @@ public abstract class Database {
|
||||
public <O extends DBObject, F extends iDBObject> LinkedHashMap<Integer, F> getMapByFKi(O owner, Class<F> fk_class) {
|
||||
return getMapByFK(owner, fk_class, java.lang.Integer.class);
|
||||
}
|
||||
public <O extends iDBObject, F extends iDBObject> Vector<Integer> getFKi(
|
||||
Integer owner_pk, Class<O> owner_class, Class<F> fk_class) {
|
||||
String fk_name = owner_class.getSimpleName().toLowerCase() + "_id";
|
||||
Vector<Integer> res = new Vector<>();
|
||||
try {
|
||||
for (Object o : tables.get(fk_class).Data.values()) {
|
||||
F f = (F) o;
|
||||
if (fk_class.getField(fk_name).get(f).equals(owner_pk)) res.add((Integer) f.getPK());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//-
|
||||
public <O extends DBObject, F extends DBObject> Vector<String> getVectorStringByFK(O owner, Class<F> fk_class) {
|
||||
Vector<String> res = new Vector<>();
|
||||
@@ -310,7 +324,7 @@ public abstract class Database {
|
||||
}
|
||||
public abstract PassCode_ getSynchronizePassCode(); //если бд есть на сервере.
|
||||
//--
|
||||
public void ReplaceFileAndReconnect(File file_in) throws Exception{
|
||||
public void ReplaceFileAndReconnect(File file_in) throws Exception {
|
||||
Disconnect();
|
||||
Utils_.forceDeleteWithCheck(getFile());
|
||||
FileUtils.moveFile(file_in, getFile());
|
||||
@@ -318,10 +332,25 @@ public abstract class Database {
|
||||
prepareTablesStatements();
|
||||
Synchronize();
|
||||
}
|
||||
public void DropUI(){
|
||||
public void DeleteDependencies(DBObject object) throws Exception {
|
||||
DBTable object_table = getTable(object.getClass());
|
||||
for (Class dep : object_table.getFKDependencies().keySet()) {
|
||||
switch (object_table.getFKDependencies().get(dep).data) {
|
||||
case NONE:
|
||||
break;
|
||||
case DROP:
|
||||
DropByFK(object, dep);
|
||||
break;
|
||||
case DELETE:
|
||||
DeleteByFK(object, dep);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void DropUI() {
|
||||
SaveLastSelections();
|
||||
}
|
||||
public void ResetUI(){
|
||||
public void ResetUI() {
|
||||
RestoreLastSelections();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@ public abstract class nDBObject extends DBObject {
|
||||
public Object getEmptyFK() {
|
||||
return "";
|
||||
}
|
||||
public String getFKName() {
|
||||
return getClass().getSimpleName().toLowerCase() + "_id";
|
||||
}
|
||||
public void genName() {
|
||||
id = Utils_.getDateName(getClass().getSimpleName().toLowerCase());
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.DBTableColumn;
|
||||
import Common.Passes.PassException;
|
||||
import Common.Utils.Pair;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.*;
|
||||
@@ -255,5 +255,4 @@ public abstract class SQLiteDatabase extends Database {
|
||||
}
|
||||
//--
|
||||
//https://stackoverflow.com/questions/8558099/sqlite-query-with-byte-where-clause
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import Common.Database.Database;
|
||||
import Common.Database.Objects.DBObject;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Vector;
|
||||
public abstract class DBTable<K, D extends DBObject> extends DataSet<K, D> {
|
||||
//-
|
||||
public DBTableColumn PK = null;
|
||||
@@ -34,4 +35,31 @@ public abstract class DBTable<K, D extends DBObject> extends DataSet<K, D> {
|
||||
res.append(c).append("\n");
|
||||
return res.toString();
|
||||
}
|
||||
boolean vectorContains(D object, Vector<D> vector) {
|
||||
for (D v_object : vector) {
|
||||
if (isEqual(object, v_object))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public void ActualizeData(Vector<D> old, Vector<D> actual) throws Exception {
|
||||
//привести данные вектора old в соответствие с вектором new
|
||||
//те, что в нем появились вставить, те что отсутствуют но есть в old удалить
|
||||
Vector<D> to_delete = new Vector<>();
|
||||
Vector<D> to_insert = new Vector<>();
|
||||
for (D object : old) {
|
||||
if (!vectorContains(object, actual))
|
||||
to_delete.add(object);
|
||||
}
|
||||
for (D object : actual) {
|
||||
if (!vectorContains(object, old))
|
||||
to_insert.add(object);
|
||||
}
|
||||
db.BeginTransaction();
|
||||
for (D object : to_delete)
|
||||
db.Delete(object);
|
||||
for (D object : to_insert)
|
||||
db.Insert(object);
|
||||
db.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,4 +87,8 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
public boolean containsKey(Object key) {
|
||||
return Data.containsKey(key);
|
||||
}
|
||||
//--
|
||||
public boolean isEqual(D o1, D o2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,18 +35,7 @@ public abstract class DeleteObjectPass<D extends DBObject> extends ObjectPass<D>
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
getDb().Delete(target);
|
||||
for (Class dep : getTable().getFKDependencies().keySet()) {
|
||||
switch (getTable().getFKDependencies().get(dep).data) {
|
||||
case NONE:
|
||||
break;
|
||||
case DROP:
|
||||
getDb().DropByFK(target, dep);
|
||||
break;
|
||||
case DELETE:
|
||||
getDb().DeleteByFK(target, dep);
|
||||
break;
|
||||
}
|
||||
}
|
||||
getDb().DeleteDependencies(target);
|
||||
}
|
||||
//тут именно на финише, чтобы в любом случае вся таблица всегда была видна.
|
||||
@Override
|
||||
|
||||
@@ -22,10 +22,6 @@ public class Pass<T> {
|
||||
//--------------
|
||||
public boolean ui_visible = true;
|
||||
public Vector<PassControl> controls = new Vector<>();
|
||||
public void addControl(PassControl control_in){
|
||||
control_in.setVisible(ui_visible);
|
||||
controls.add(control_in);
|
||||
}
|
||||
public TextLog Log; //внутренний журнал прохода.
|
||||
protected boolean interrupt;
|
||||
protected SwingWorker dispatcher = null;
|
||||
@@ -34,6 +30,10 @@ public class Pass<T> {
|
||||
private JButton button = null;
|
||||
private JButton tabButton = null;
|
||||
private Exception last_error; //последнее пойманное исключение выполнения.
|
||||
public void addControl(PassControl control_in) {
|
||||
control_in.setVisible(ui_visible);
|
||||
controls.add(control_in);
|
||||
}
|
||||
//->>
|
||||
public Throwable getCauseRec(Throwable ex) {
|
||||
Throwable cause = ex.getCause();
|
||||
@@ -79,7 +79,7 @@ public class Pass<T> {
|
||||
control.setEnabled(flag);
|
||||
}
|
||||
public void setControlsVisible(boolean flag) {
|
||||
ui_visible =flag;
|
||||
ui_visible = flag;
|
||||
for (PassControl control : controls)
|
||||
control.setVisible(ui_visible);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,11 @@ import java.util.LinkedHashMap;
|
||||
public class Properties {
|
||||
protected LinkedHashMap<String, JMenuItem> controls = new LinkedHashMap<>();
|
||||
private File file = null; //файл где хранятся настройки.
|
||||
public Properties() {
|
||||
}
|
||||
public Properties(File file_in) {
|
||||
setFile(file_in);
|
||||
}
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
@@ -24,11 +29,6 @@ public class Properties {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public Properties() {
|
||||
}
|
||||
public Properties(File file_in) {
|
||||
setFile(file_in);
|
||||
}
|
||||
public boolean updateField(String name, Object newValue) {
|
||||
try {
|
||||
Field field = getClass().getField(name);
|
||||
@@ -50,7 +50,7 @@ public class Properties {
|
||||
return "?";
|
||||
}
|
||||
public boolean controlAction(String fieldName, JMenuItem control
|
||||
){
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
public JMenuItem getMenuItem(String fieldName) {
|
||||
@@ -86,8 +86,8 @@ public class Properties {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void setControlVisible(String settingName, boolean flag){
|
||||
if (controls.containsKey(settingName)){
|
||||
public void setControlVisible(String settingName, boolean flag) {
|
||||
if (controls.containsKey(settingName)) {
|
||||
controls.get(settingName).setVisible(flag);
|
||||
}
|
||||
}
|
||||
|
||||
20
src/Common/Utils/IntegerPairJson.java
Normal file
20
src/Common/Utils/IntegerPairJson.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package Common.Utils;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class IntegerPairJson {
|
||||
@Expose
|
||||
public int key;
|
||||
@Expose
|
||||
public int value;
|
||||
public int getKey() {
|
||||
return key;
|
||||
}
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
public IntegerPairJson(int key_in, int value_in) {
|
||||
key = key_in;
|
||||
value = value_in;
|
||||
}
|
||||
public IntegerPairJson() {
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Utils;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Visual.Windows.ReadOnlyMultilineTextForm;
|
||||
import Common.Visual.Windows.ReadOnlyMultilineTextForm;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
@@ -35,8 +35,8 @@ public interface Loggable {
|
||||
ex.printStackTrace(writer);
|
||||
writer.flush();
|
||||
Print(out.toString());
|
||||
Utils_.CopyToClipboard(out.toString());
|
||||
if (UI.isActive()) {
|
||||
Utils_.CopyToClipboard(out.toString());
|
||||
ReadOnlyMultilineTextForm ff = new ReadOnlyMultilineTextForm();
|
||||
ff.ShowDialog("Возникло исключение", out.toString());
|
||||
}
|
||||
|
||||
95
src/Common/Utils/Pair.java
Normal file
95
src/Common/Utils/Pair.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package Common.Utils;
|
||||
import java.io.Serializable;
|
||||
public class Pair<K, V> implements Serializable {
|
||||
/**
|
||||
* Key of this <code>Pair</code>.
|
||||
*/
|
||||
private K key;
|
||||
/**
|
||||
* Value of this this <code>Pair</code>.
|
||||
*/
|
||||
private V value;
|
||||
/**
|
||||
* Creates a new pair
|
||||
*
|
||||
* @param key The key for this pair
|
||||
* @param value The value to use for this pair
|
||||
*/
|
||||
public Pair(K key, V value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
/**
|
||||
* Gets the key for this pair.
|
||||
*
|
||||
* @return key for this pair
|
||||
*/
|
||||
public K getKey() {
|
||||
return key;
|
||||
}
|
||||
/**
|
||||
* Gets the value for this pair.
|
||||
*
|
||||
* @return value for this pair
|
||||
*/
|
||||
public V getValue() {
|
||||
return value;
|
||||
}
|
||||
/**
|
||||
* <p><code>String</code> representation of this
|
||||
* <code>Pair</code>.</p>
|
||||
*
|
||||
* <p>The default name/value delimiter '=' is always used.</p>
|
||||
*
|
||||
* @return <code>String</code> representation of this <code>Pair</code>
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return key + "=" + value;
|
||||
}
|
||||
/**
|
||||
* <p>Generate a hash code for this <code>Pair</code>.</p>
|
||||
*
|
||||
* <p>The hash code is calculated using both the name and
|
||||
* the value of the <code>Pair</code>.</p>
|
||||
*
|
||||
* @return hash code for this <code>Pair</code>
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
// name's hashCode is multiplied by an arbitrary prime number (13)
|
||||
// in order to make sure there is a difference in the hashCode between
|
||||
// these two parameters:
|
||||
// name: a value: aa
|
||||
// name: aa value: a
|
||||
return key.hashCode() * 13 + (value == null ? 0 : value.hashCode());
|
||||
}
|
||||
/**
|
||||
* <p>Test this <code>Pair</code> for equality with another
|
||||
* <code>Object</code>.</p>
|
||||
*
|
||||
* <p>If the <code>Object</code> to be tested is not a
|
||||
* <code>Pair</code> or is <code>null</code>, then this method
|
||||
* returns <code>false</code>.</p>
|
||||
*
|
||||
* <p>Two <code>Pair</code>s are considered equal if and only if
|
||||
* both the names and values are equal.</p>
|
||||
*
|
||||
* @param o the <code>Object</code> to test for
|
||||
* equality with this <code>Pair</code>
|
||||
* @return <code>true</code> if the given <code>Object</code> is
|
||||
* equal to this <code>Pair</code> else <code>false</code>
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o instanceof Pair) {
|
||||
Pair pair = (Pair) o;
|
||||
if (key != null ? !key.equals(pair.key) : pair.key != null) return false;
|
||||
if (value != null ? !value.equals(pair.value) : pair.value != null) return false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package Common.Visual;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.Grid.TableVisualData;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
@@ -15,7 +14,6 @@ import Common.Visual.Menus.TableMenu;
|
||||
import Common.Visual.Tables.*;
|
||||
import Common.Visual.Tables.Grid.GridAnchestor;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.TableColumn;
|
||||
@@ -42,7 +40,6 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
|
||||
//--
|
||||
Object savedCurrentKey = null;
|
||||
Vector<Object> savedSelectedKeys = new Vector<>();
|
||||
//--
|
||||
public DataSetControlForm(DataSet<?, D> dataSource_in, JPanel mountPanel_in) {
|
||||
super(DataTable.class, mountPanel_in);
|
||||
dataSource = dataSource_in;
|
||||
@@ -70,7 +67,7 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
|
||||
//--
|
||||
counter_ui = (count -> bar.countLabel.setText(String.valueOf(count)));
|
||||
//--фильтры всегда в конец бара.
|
||||
// bar.add(new JSeparator());
|
||||
// bar.add(new JSeparator());
|
||||
for (FilterFlag filter : getFilters(FilterFlag.class)) {
|
||||
bar.add(filter.getControl());
|
||||
}
|
||||
@@ -83,6 +80,10 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
|
||||
}
|
||||
}
|
||||
}
|
||||
//--
|
||||
public DataMenuBar getMenuBar() {
|
||||
return bar;
|
||||
}
|
||||
protected boolean isPKVisible() {
|
||||
return true;
|
||||
}
|
||||
@@ -574,12 +575,17 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
|
||||
public PassCode_ getDeletePassCode() {
|
||||
return null;
|
||||
}
|
||||
public Object getCurrentPK(Object nanValue){
|
||||
return current==null? nanValue: current.getPK();
|
||||
public Object getCurrentPK(Object nanValue) {
|
||||
return current == null ? nanValue : current.getPK();
|
||||
}
|
||||
//todo временное решение ? ->>>
|
||||
public boolean canModifyCurrent(TextLog Log){
|
||||
return CheckCurrent(Log) && (
|
||||
!(current instanceof riDBObject) || Global.mainModule.getAccount().CheckAuthorship(((riDBObject)current).sender_address,Log));
|
||||
public boolean canModifyCurrent(TextLog Log) {
|
||||
return CheckCurrent(Log);
|
||||
}
|
||||
public void SelectKeys(Vector<?> keys_in) {
|
||||
SelectAll(false);
|
||||
for (Object key_ : keys_in)
|
||||
dataSource.get(key_).Select(true);
|
||||
if (!keys_in.isEmpty())
|
||||
Show(keys_in.lastElement());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package _VisualDVM.Visual.Editor;
|
||||
package Common.Visual.Editor;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Pair;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.TextEditorMenu;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Visual.Syntax.SPFEditorTheme;
|
||||
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
|
||||
|
||||
@@ -15,8 +17,9 @@ import java.awt.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.net.URI;
|
||||
import java.util.Vector;
|
||||
public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogFields {
|
||||
private final StyledPopupMenu menu;
|
||||
protected final StyledPopupMenu menu;
|
||||
// protected int changesCount = 0;
|
||||
// protected int insertsCount = 0;
|
||||
// protected int removesCount = 0;
|
||||
@@ -128,14 +131,6 @@ public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogF
|
||||
changeFont(getFont().getSize() - 1);
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
float font_size = (float) getFont().getSize();
|
||||
((SPFEditorTheme) MainModule_.instance.getUI().getTheme()).getEditorTheme().apply(this);
|
||||
setFont(getFont().deriveFont(font_size));
|
||||
menu.applyTheme();
|
||||
//меню связано с редактором. поэтому тема меняется только вместе с ним.
|
||||
}
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return this;
|
||||
}
|
||||
@@ -152,4 +147,29 @@ public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogF
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//todo как то вывести из коммон.
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
float font_size = (float) getFont().getSize();
|
||||
((SPFEditorTheme) MainModule_.instance.getUI().getTheme()).getEditorTheme().apply(this);
|
||||
setFont(getFont().deriveFont(font_size));
|
||||
menu.applyTheme();
|
||||
//меню связано с редактором. поэтому тема меняется только вместе с ним.
|
||||
}
|
||||
//--
|
||||
public Vector<Pair<Integer, Integer>> getErrorsForHightlight() {
|
||||
Vector<Pair<Integer, Integer>> res = new Vector<>();
|
||||
for (int i = 0; i < this.getLineCount(); ++i) {
|
||||
try {
|
||||
int start = getLineStartOffset(i);
|
||||
int end = getLineEndOffset(i);
|
||||
String line = this.getText(start, end);
|
||||
if (Utils.isCrushedLine(line))
|
||||
res.add(new Pair<>(start, end));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package _VisualDVM.Visual.Editor;
|
||||
package Common.Visual.Editor;
|
||||
public class Viewer extends BaseEditor {
|
||||
public Viewer() {
|
||||
setLineWrap(true);
|
||||
@@ -8,12 +8,12 @@ import java.awt.*;
|
||||
import java.awt.event.ActionListener;
|
||||
public class DataMenuBar extends VisualiserMenuBar {
|
||||
public JLabel countLabel = null;
|
||||
private DataSet dataSource = null;
|
||||
//-
|
||||
public ActionListener selectAllListener = null;
|
||||
public ActionListener unselectAllListener = null;
|
||||
JButton selectAllButton = null;
|
||||
JButton unselectAllButton = null;
|
||||
private DataSet dataSource = null;
|
||||
//-
|
||||
public DataMenuBar(String dataName, PassCode_... passes) {
|
||||
add(new JLabel(dataName + " : "));
|
||||
|
||||
@@ -21,10 +21,10 @@ public class TableMenu extends StyledPopupMenu {
|
||||
mcopy.addActionListener(e -> Utils_.CopyToClipboard(target.toString()));
|
||||
add(mcopy);
|
||||
//
|
||||
add(value_scroll= new JScrollPane(value_view = new JTextArea()));
|
||||
add(value_scroll = new JScrollPane(value_view = new JTextArea()));
|
||||
value_view.setEditable(false);
|
||||
value_view.setLineWrap(true);
|
||||
value_view.setWrapStyleWord(true);
|
||||
//value_view.setLineWrap(true);
|
||||
//value_view.setWrapStyleWord(true);
|
||||
}
|
||||
@Override
|
||||
public void CheckElementsVisibility() {
|
||||
@@ -33,13 +33,13 @@ public class TableMenu extends StyledPopupMenu {
|
||||
if ((row >= 0) && (column >= 0)) {
|
||||
target = owner.getValueAt(row, column);
|
||||
mcopy.setVisible(true);
|
||||
Dimension d= new Dimension(Math.max(mcopy.getWidth(), 300),100);
|
||||
Dimension d = new Dimension(Math.max(mcopy.getWidth(), 300), 100);
|
||||
value_view.setVisible(true);
|
||||
String res = target.toString();
|
||||
if (target instanceof Vector){
|
||||
if (target instanceof Vector) {
|
||||
Vector<Object> v = (Vector<Object>) target;
|
||||
Vector<String> res_ = new Vector<>();
|
||||
for (Object o: v){
|
||||
for (Object o : v) {
|
||||
res_.add(o.toString());
|
||||
}
|
||||
res = String.join("\n", res_);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.MainModule_;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
@@ -20,6 +21,10 @@ public class VisualiserMenuBar extends JToolBar {
|
||||
}
|
||||
}
|
||||
}
|
||||
public void addPasses(Pass... passes) {
|
||||
for (Pass pass : passes)
|
||||
add(pass.createButton());
|
||||
}
|
||||
public JMenuBar addMenus(JMenu... menus) {
|
||||
JMenuBar bar = new JMenuBar() {
|
||||
{
|
||||
|
||||
@@ -18,18 +18,28 @@ public class HeaderTextFilter<D extends DBObject> implements DBObjectFilter_<D>
|
||||
int columnIndex = CommonConstants.Nan; //номер столбца к которому привязан фильтр.
|
||||
JTextField textField = null;
|
||||
JPopupMenu popup = null;
|
||||
boolean contains = true;
|
||||
private String filterValue = "";
|
||||
private int offset = 0;
|
||||
//при одиночном клике, показать поверх заголовка столбца выпавшее меню с полем фильтра.
|
||||
public HeaderTextFilter(DataSet dataSet_in, int columnIndex_in, int offset_in) {
|
||||
public HeaderTextFilter(DataSet dataSet_in, int columnIndex_in, int offset_in, boolean contains_in) {
|
||||
dataSet = dataSet_in;
|
||||
columnIndex = columnIndex_in;
|
||||
offset = offset_in;
|
||||
contains = contains_in;
|
||||
}
|
||||
public HeaderTextFilter(DataSet dataSet_in, int columnIndex_in, int offset_in) {
|
||||
this(dataSet_in, columnIndex_in, offset_in, true);
|
||||
}
|
||||
@Override
|
||||
public boolean Validate(D object) {
|
||||
Object field = dataSet.getUI().getColumnInfo(columnIndex).getFieldAt(object);
|
||||
return (field instanceof String) && field.toString().toLowerCase().contains(filterValue);
|
||||
if (field instanceof String) {
|
||||
String s = field.toString().toLowerCase();
|
||||
return contains ? s.contains(filterValue) :
|
||||
(filterValue.isEmpty() || s.equals(filterValue)) || (filterValue.trim().isEmpty() && s.isEmpty());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//---
|
||||
public void Mount(DataTable control) {
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Date;
|
||||
public class RendererMilliseconds extends RendererCell<Long>{
|
||||
public class RendererMilliseconds extends RendererCell<Long> {
|
||||
@Override
|
||||
public Long Init(JTable table, Object value, int row, int column) {
|
||||
return (Long) value;
|
||||
|
||||
@@ -4,5 +4,7 @@ public interface ThemeElement {
|
||||
}
|
||||
default void FontDown() {
|
||||
}
|
||||
void applyTheme();
|
||||
default void applyTheme() {
|
||||
}
|
||||
;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,6 @@ public class TreeForm<C extends StyledTree> extends ControlForm<C> {
|
||||
}
|
||||
@Override
|
||||
protected void redrawControl() {
|
||||
((DefaultTreeModel)getTree().getModel()).reload();
|
||||
((DefaultTreeModel) getTree().getModel()).reload();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,12 +59,10 @@ public class UI {
|
||||
return Question(MainModule_.instance.getUI().getFrontWindow(), text);
|
||||
}
|
||||
public static void Info(String message) {
|
||||
Utils_.CopyToClipboard(message);
|
||||
if (UI.isActive())
|
||||
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 1);
|
||||
}
|
||||
public static void Error(String message) {
|
||||
Utils_.CopyToClipboard(message);
|
||||
if (UI.isActive())
|
||||
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 0);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
}
|
||||
getContentPane().add(buttonsPane, BorderLayout.SOUTH);
|
||||
}
|
||||
public void BlockButtons(){
|
||||
public void BlockButtons() {
|
||||
btnOK.setVisible(false);
|
||||
btnCancel.setVisible(false);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ public class ComboTextDialog extends Dialog<String, DialogTextComboBox> {
|
||||
}
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 135;
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
package Common.Visual.Windows;
|
||||
import Common.Visual.Editor.BaseEditor;
|
||||
import Common.Visual.Windows.Dialog.Text.TextDialog;
|
||||
import _VisualDVM.Visual.Editor.BaseEditor;
|
||||
public class MultilineTextForm extends TextDialog<BaseEditor> {
|
||||
public MultilineTextForm() {
|
||||
super(BaseEditor.class);
|
||||
@@ -1,4 +1,4 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
package Common.Visual.Windows;
|
||||
public class ReadOnlyMultilineTextForm extends MultilineTextForm {
|
||||
public ReadOnlyMultilineTextForm() {
|
||||
}
|
||||
@@ -4,11 +4,9 @@ import Common.Database.Objects.rDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Vector_;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientJson;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientsJson;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Recipient;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
@@ -24,10 +22,8 @@ public class BugReport extends rDBObject {
|
||||
public long visualiser_version = -1;
|
||||
public long sapfor_version = -1;
|
||||
public String comment = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedRecipientsJson = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedSettingsJson = ""; //устарело. (?)
|
||||
public Vector<BugReportSetting> settings = null;
|
||||
public Vector<BugReportRecipient> recipients = null;
|
||||
public String executor = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String executor_address = "";
|
||||
@@ -54,7 +50,7 @@ public class BugReport extends rDBObject {
|
||||
project_version = version_in;
|
||||
visualiser_version = Global.visualiser.version;
|
||||
sapfor_version = Global.components.get(ComponentType.Sapfor_F).version;
|
||||
packedSettingsJson = Utils_.gson.toJson(Global.mainModule.getProject().sapforProperties);
|
||||
settings = Global.mainModule.getProject().sapforProperties.toBugReportSettings();
|
||||
percentage = 0;
|
||||
description = description_in;
|
||||
date = new Date().getTime();
|
||||
@@ -69,7 +65,6 @@ public class BugReport extends rDBObject {
|
||||
change_date = b.change_date;
|
||||
description = b.description;
|
||||
comment = b.comment;
|
||||
packedRecipientsJson = b.packedRecipientsJson;
|
||||
state = b.state;
|
||||
percentage = b.percentage;
|
||||
//-
|
||||
@@ -78,8 +73,6 @@ public class BugReport extends rDBObject {
|
||||
project_version = b.project_version;
|
||||
visualiser_version = b.visualiser_version;
|
||||
sapfor_version = b.sapfor_version;
|
||||
packedSettingsJson = b.packedSettingsJson;
|
||||
//-
|
||||
descriptionAdditionDraft = b.descriptionAdditionDraft;
|
||||
commentAdditionDraft = b.commentAdditionDraft;
|
||||
owner = b.owner;
|
||||
@@ -132,13 +125,12 @@ public class BugReport extends rDBObject {
|
||||
"Версия визуализатора: " + visualiser_version,
|
||||
"----------------------------------"
|
||||
);
|
||||
if (!project_version.isEmpty()) {
|
||||
if (visualiser_version < 1134) {
|
||||
res.add(getSettingsJson().getSummary());
|
||||
} else {
|
||||
res.add(getPropertiesJson().getSummary());
|
||||
}
|
||||
}
|
||||
//--
|
||||
Vector<BugReportSetting> settings_ = Global.componentsServer.db.getVectorByFK(this, BugReportSetting.class);
|
||||
SapforProperties dummy = new SapforProperties();
|
||||
for (BugReportSetting bugReportSetting : settings_)
|
||||
res.add(dummy.getFieldDescription(bugReportSetting.name) + "=" + Utils_.DQuotes(bugReportSetting.value));
|
||||
//--
|
||||
return String.join("\n", res);
|
||||
}
|
||||
public String getPassport() {
|
||||
@@ -155,29 +147,16 @@ public class BugReport extends rDBObject {
|
||||
return project_version.isEmpty();
|
||||
}
|
||||
//--->
|
||||
|
||||
public void CheckRecipients() {
|
||||
for (Recipient recipient : Global.componentsServer.db.recipients.Data.values())
|
||||
recipient.Select(packedRecipientsJson.contains(recipient.email));
|
||||
}
|
||||
|
||||
public void saveRecipientsAsJson(Vector<Recipient> recipients) {
|
||||
packedRecipientsJson = Utils_.gson.toJson(new RecipientsJson(recipients));
|
||||
}
|
||||
public Vector<String> getRecipients() {
|
||||
Vector<String> res = new Vector<>();
|
||||
if (packedRecipientsJson.isEmpty()) return res;
|
||||
RecipientsJson recipients = Utils_.gson.fromJson(packedRecipientsJson, RecipientsJson.class);
|
||||
for (RecipientJson recipientJson : recipients.array) {
|
||||
res.add(recipientJson.address);
|
||||
Global.componentsServer.db.recipients.getUI().SelectAll(false);
|
||||
Vector<BugReportRecipient> recipients_ = state.equals(BugReportState.draft) ?
|
||||
recipients : Global.componentsServer.db.getVectorByFK(this, BugReportRecipient.class);
|
||||
if (recipients_ != null) {
|
||||
for (BugReportRecipient bugReportRecipient : recipients_) {
|
||||
if (Global.componentsServer.db.recipients.containsKey(bugReportRecipient.email))
|
||||
Global.componentsServer.db.recipients.get(bugReportRecipient.email).Select(true);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public VisualiserSettingsJson getSettingsJson() {
|
||||
return packedSettingsJson.isEmpty() ? new VisualiserSettingsJson() : Utils_.gson.fromJson(packedSettingsJson, VisualiserSettingsJson.class);
|
||||
}
|
||||
public SapforProperties getPropertiesJson() {
|
||||
return packedSettingsJson.isEmpty() ? new SapforProperties() : Utils_.gson.fromJson(packedSettingsJson, SapforProperties.class);
|
||||
}
|
||||
public boolean canAppend(UserAccount account, TextLog log) {
|
||||
if (account.CheckRegistered(log)) {
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.ComponentsServer.BugReport.UI.BugReportsForm;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
public class BugReportsDBTable extends DBTable<String, BugReport> {
|
||||
@@ -25,5 +32,12 @@ public class BugReportsDBTable extends DBTable<String, BugReport> {
|
||||
public Vector<BugReport> getAllDrafts() throws Exception {
|
||||
return Data.values().stream().filter(bugReport -> bugReport.state.equals(BugReportState.draft)).collect(Collectors.toCollection(Vector::new));
|
||||
}
|
||||
@Override
|
||||
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
||||
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
||||
res.put(BugReportSetting.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.PASSIVE));
|
||||
res.put(BugReportRecipient.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.PASSIVE));
|
||||
return res;
|
||||
}
|
||||
//-
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ public class BugReportAdditionJson implements Serializable {
|
||||
@Expose
|
||||
public String fieldName = "";
|
||||
@Expose
|
||||
public String textAddition ="";
|
||||
public BugReportAdditionJson(BugReport bugReport, String fieldName_in, String addition_in){
|
||||
public String textAddition = "";
|
||||
public BugReportAdditionJson(BugReport bugReport, String fieldName_in, String addition_in) {
|
||||
id = bugReport.id;
|
||||
fieldName = fieldName_in;
|
||||
textAddition = addition_in;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class RecipientJson {
|
||||
@Expose
|
||||
public String address;
|
||||
public RecipientJson(String addres_in) {
|
||||
address= addres_in;
|
||||
}
|
||||
public RecipientJson() {
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Recipient;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class RecipientsJson {
|
||||
@Expose
|
||||
public List<RecipientJson> array = new Vector<>();
|
||||
public RecipientsJson() {
|
||||
}
|
||||
public RecipientsJson(Vector<? extends Recipient> recipients) {
|
||||
array = new Vector<>();
|
||||
for (Recipient recipient : recipients)
|
||||
array.add(new RecipientJson(recipient.email));
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class VisualiserSettingJson {
|
||||
@Expose
|
||||
public String name;
|
||||
@Expose
|
||||
public String value;
|
||||
public VisualiserSettingJson(){
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import _VisualDVM.ProjectData.SapforData.SapforProperties;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class VisualiserSettingsJson {
|
||||
@Expose
|
||||
public List<VisualiserSettingJson> array = new Vector<>();
|
||||
public String getSummary() {
|
||||
SapforProperties properties = new SapforProperties(); //только для извлечения описаний.
|
||||
Vector<String> res = new Vector<>();
|
||||
for (VisualiserSettingJson setting : array) {
|
||||
try {
|
||||
res.add(properties.getFieldDescription(setting.name) + "=" + setting.value);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
return String.join("\n", res);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package _VisualDVM.ComponentsServer.BugReportRecipient;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
public class BugReportRecipient extends iDBObject {
|
||||
public String bugreport_id = "";
|
||||
public String email = "";
|
||||
public BugReportRecipient() {
|
||||
}
|
||||
public BugReportRecipient(BugReport bugReport, String email_in) {
|
||||
bugreport_id = bugReport.id;
|
||||
email = email_in;
|
||||
}
|
||||
public BugReportRecipient(String email_in) {
|
||||
email = email_in;
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
BugReportRecipient src_ = (BugReportRecipient) src;
|
||||
bugreport_id = src_.bugreport_id;
|
||||
email = src_.email;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package _VisualDVM.ComponentsServer.BugReportRecipient;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
public class BugReportRecipientsDBTable extends iDBTable<BugReportRecipient> {
|
||||
public BugReportRecipientsDBTable() {
|
||||
super(BugReportRecipient.class);
|
||||
}
|
||||
@Override
|
||||
public boolean isEqual(BugReportRecipient o1, BugReportRecipient o2) {
|
||||
return o1.bugreport_id.equals(o2.bugreport_id) && o1.email.equals(o2.email);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package _VisualDVM.ComponentsServer.BugReportSetting;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
public class BugReportSetting extends iDBObject {
|
||||
public String bugreport_id = "";
|
||||
public String name = "";
|
||||
public String value = "";
|
||||
public BugReportSetting() {
|
||||
}
|
||||
public BugReportSetting(BugReport bugReport, String name_in, Object value_in) {
|
||||
this(name_in, value_in);
|
||||
bugreport_id = bugReport.id;
|
||||
}
|
||||
public BugReportSetting(String name_in, Object value_in) {
|
||||
name = name_in;
|
||||
value = (value_in instanceof Boolean) ? ((boolean) value_in ? "1" : "0") : value_in.toString();
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
BugReportSetting src_ = (BugReportSetting) src;
|
||||
bugreport_id = src_.bugreport_id;
|
||||
name = src_.name;
|
||||
value = src_.value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package _VisualDVM.ComponentsServer.BugReportSetting;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
public class BugReportSettingsDBTable extends iDBTable<BugReportSetting> {
|
||||
public BugReportSettingsDBTable() {
|
||||
super(BugReportSetting.class);
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,18 @@ package _VisualDVM.ComponentsServer;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReportsDBTable;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipientsDBTable;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSettingsDBTable;
|
||||
import _VisualDVM.ComponentsServer.Recipient.RecipientsDataSet;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Vector;
|
||||
public class BugReportsDatabase extends SQLiteDatabase {
|
||||
public BugReportsDBTable bugReports;
|
||||
public BugReportSettingsDBTable bugReportSettings;
|
||||
public BugReportRecipientsDBTable bugReportRecipients;
|
||||
public RecipientsDataSet recipients = new RecipientsDataSet();
|
||||
public BugReportsDatabase() {
|
||||
super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile());
|
||||
@@ -17,6 +21,8 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
@Override
|
||||
protected void initAllTables() throws Exception {
|
||||
addTable(bugReports = new BugReportsDBTable());
|
||||
addTable(bugReportSettings = new BugReportSettingsDBTable());
|
||||
addTable(bugReportRecipients = new BugReportRecipientsDBTable());
|
||||
}
|
||||
@Override
|
||||
public void Init() throws Exception {
|
||||
@@ -43,4 +49,14 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
recipients.ShowUI(); //todo временно.
|
||||
super.ResetUI();
|
||||
}
|
||||
public void saveBugreportRecipients(BugReport bugReport) throws Exception {
|
||||
if (bugReport.recipients != null) {
|
||||
for (BugReportRecipient recipient : bugReport.recipients) {
|
||||
recipient.bugreport_id = bugReport.id;
|
||||
Insert(recipient);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Patch() throws Exception {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package _VisualDVM.ComponentsServer.Component;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.ComponentsServer.Component.PerformanceAnalyzer.PerformanceAnalyzer;
|
||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor_F;
|
||||
import _VisualDVM.ComponentsServer.Component.UI.ComponentsForm;
|
||||
import _VisualDVM.Current;
|
||||
@@ -18,7 +17,7 @@ public class ComponentsSet extends DataSet<ComponentType, Component> {
|
||||
put(ComponentType.Visualiser, Global.visualiser = new Visualiser());
|
||||
put(ComponentType.Sapfor_F, (Component) MainModule_.instance.set(Current.Sapfor, new Sapfor_F()));
|
||||
put(ComponentType.Visualizer_2, Global.visualizer_2);
|
||||
put(ComponentType.PerformanceAnalyzer, Global.performanceAnalyzer = new PerformanceAnalyzer());
|
||||
// put(ComponentType.PerformanceAnalyzer, Global.performanceAnalyzer = new PerformanceAnalyzer());
|
||||
put(ComponentType.Instruction, new Instruction());
|
||||
}
|
||||
public boolean needChanges() {
|
||||
@@ -75,7 +74,10 @@ public class ComponentsSet extends DataSet<ComponentType, Component> {
|
||||
return !bad_state;
|
||||
}
|
||||
public void initialVersionsCheck() {
|
||||
for (Component component : Data.values())
|
||||
for (Component component : Data.values()) {
|
||||
System.out.println(component.getComponentType() + " initial version checking...");
|
||||
component.InitialVersionCheck();
|
||||
System.out.println("done");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package _VisualDVM.ComponentsServer.Component.Json;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ComponentsServer.Component.Component;
|
||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||
@@ -13,15 +14,22 @@ public class ComponentPublicationInfoJson implements Serializable {
|
||||
@Expose
|
||||
public byte[] packedFile = null;
|
||||
@Expose
|
||||
public long versionNumber = CommonConstants.Nan;
|
||||
@Expose
|
||||
public String versionText = "";
|
||||
@Expose
|
||||
public String changeRecord = "";
|
||||
@Expose
|
||||
public boolean needsUpdateMinimalVersion = false;
|
||||
public ComponentPublicationInfoJson(Component component) throws Exception{
|
||||
@Expose
|
||||
public boolean needsEmail = false;
|
||||
@Expose
|
||||
public boolean needsSendFile = false;
|
||||
public ComponentPublicationInfoJson(Component component) throws Exception {
|
||||
componentType = component.getComponentType();
|
||||
fileName = component.getFileName();
|
||||
packedFile = Utils_.fileToBytes(component.getFile());
|
||||
versionNumber = component.version;
|
||||
versionText = component.getVersionText();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public class ComponentVersionsInfoJson implements Serializable {
|
||||
public String minimal_version = "";
|
||||
@Expose
|
||||
public String actual_version = "";
|
||||
public ComponentVersionsInfoJson(ComponentType componentType_in){
|
||||
componentType=componentType_in;
|
||||
public ComponentVersionsInfoJson(ComponentType componentType_in) {
|
||||
componentType = componentType_in;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package _VisualDVM.ComponentsServer.Component.Sapfor;
|
||||
import Common.CommonConstants;
|
||||
import Common.Passes.PassException;
|
||||
import Common.Utils.Pair;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.ComponentsServer.Component.OSDComponent;
|
||||
@@ -11,6 +12,7 @@ import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.Utils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@@ -87,7 +89,8 @@ public abstract class Sapfor extends OSDComponent {
|
||||
return new PassCode[]{
|
||||
PassCode.SPF_RemoveDvmDirectivesToComments,
|
||||
PassCode.SPF_RemoveDvmDirectives,
|
||||
PassCode.SPF_RemoveOmpDirectives
|
||||
PassCode.SPF_RemoveOmpDirectives,
|
||||
PassCode.SPF_RemoveSpfDirectives
|
||||
};
|
||||
}
|
||||
public static PassCode[] getIntervalsTransformationsCodes() {
|
||||
@@ -177,6 +180,11 @@ public abstract class Sapfor extends OSDComponent {
|
||||
if (line.toLowerCase().contains("segmentation fault")) {
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
if (line.toLowerCase().contains("error in unparse")) {
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -213,7 +221,7 @@ public abstract class Sapfor extends OSDComponent {
|
||||
Charset.defaultCharset());
|
||||
if (!file.setExecutable(true))
|
||||
throw new Exception("Не удалось сделать файл скрипта " + name + " исполняемым!");
|
||||
//--
|
||||
//-- Windows
|
||||
boolean flag = false;
|
||||
do {
|
||||
try {
|
||||
@@ -271,37 +279,7 @@ public abstract class Sapfor extends OSDComponent {
|
||||
result_lines
|
||||
);
|
||||
}
|
||||
public static File getTempCopy(File src) throws Exception {
|
||||
if (temp_copy == null || !temp_copy.exists()) {
|
||||
temp_copy = Utils.getTempFileName("SAPFOR" + (Utils_.isWindows() ? ".exe" : ""));
|
||||
FileUtils.copyFile(src, temp_copy);
|
||||
temp_copy.setExecutable(true);
|
||||
}
|
||||
return temp_copy;
|
||||
}
|
||||
//--
|
||||
public static boolean getMinMaxDim(File sapfor_drv, File workspace, Test test) throws Exception {
|
||||
File sapfor = Sapfor.getTempCopy(sapfor_drv);
|
||||
String flags = "-noLogo";
|
||||
if (Sapfor.parse(sapfor, workspace, flags)
|
||||
) {
|
||||
Vector<String> outputLines = new Vector<>();
|
||||
if (Sapfor.analysis(sapfor, workspace, PassCode.SPF_GetMaxMinBlockDistribution, flags, outputLines)) {
|
||||
//---
|
||||
for (String line : outputLines) {
|
||||
String prefix = "GET_MIN_MAX_BLOCK_DIST: ";
|
||||
if (line.startsWith(prefix)) {
|
||||
String s = line.substring(prefix.length());
|
||||
String[] data = s.split(" ");
|
||||
test.min_dim = Math.max(Integer.parseInt(data[0]), 0);
|
||||
test.max_dim = Math.max(Integer.parseInt(data[1]), 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static int readVersionFromCode(File versionFile) {
|
||||
int res = CommonConstants.Nan;
|
||||
if (versionFile.exists()) {
|
||||
@@ -327,6 +305,106 @@ public abstract class Sapfor extends OSDComponent {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//--
|
||||
public static int getFileMaxDim_C(File file) {
|
||||
int fileMax = 0;
|
||||
final String prefix = "#pragma dvm array distribute";
|
||||
int n = 0;
|
||||
try {
|
||||
for (String line : FileUtils.readLines(file, Charset.defaultCharset())) {
|
||||
// #pragma dvm array distribute[block][block], не важно
|
||||
String packedLine = Utils_.removeCharacters(Utils_.removeRedundantSpaces(line).toLowerCase(), "\n", "\r", "\t");
|
||||
if (packedLine.startsWith(prefix)) {
|
||||
packedLine = packedLine.substring(prefix.length());
|
||||
boolean bracketOpen = false;
|
||||
int pragmaMax = 0;
|
||||
String distr = "";
|
||||
for (int i = packedLine.indexOf('['); i < packedLine.length(); ++i) {
|
||||
char c = packedLine.charAt(i);
|
||||
if (bracketOpen) {
|
||||
if (c == ']') {
|
||||
bracketOpen = false;
|
||||
if (distr.equals("block"))
|
||||
pragmaMax++;
|
||||
distr = "";
|
||||
} else {
|
||||
distr += c;
|
||||
}
|
||||
} else {
|
||||
if (c == '[') {
|
||||
bracketOpen = true;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fileMax = Math.max(fileMax, pragmaMax);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return fileMax;
|
||||
}
|
||||
public static int getProjectMinMaxDim_C(db_project_info project) {
|
||||
int res = 0;
|
||||
for (DBProjectFile file : project.db.files.Data.values()) {
|
||||
if (file.isActiveProgram())
|
||||
res = Math.max(res, Sapfor.getFileMaxDim_C(file.file));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static Pair<Integer, Integer> getProjectFolderMinMaxDim_F(File sapfor_drv, File projectPath) {
|
||||
String flags = "-noLogo";
|
||||
Pair<Integer, Integer> res = new Pair<>(0, 0);
|
||||
try {
|
||||
if (Sapfor.parse(sapfor_drv, projectPath, flags)
|
||||
) {
|
||||
Vector<String> outputLines = new Vector<>();
|
||||
if (Sapfor.analysis(sapfor_drv, projectPath, PassCode.SPF_GetMaxMinBlockDistribution, flags, outputLines)) {
|
||||
//---
|
||||
for (String line : outputLines) {
|
||||
String prefix = "GET_MIN_MAX_BLOCK_DIST: ";
|
||||
if (line.startsWith(prefix)) {
|
||||
String s = line.substring(prefix.length());
|
||||
String[] data = s.split(" ");
|
||||
res = new Pair<>(Math.max(Integer.parseInt(data[0]), 0), Math.max(Integer.parseInt(data[1]), 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
Utils.deleteFilesByExtensions(projectPath,
|
||||
"proj", "dep", "jar"
|
||||
);
|
||||
File visualiser_data = new File(projectPath, Constants.data);
|
||||
if (visualiser_data.exists())
|
||||
FileUtils.forceDelete(visualiser_data);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static void getTestMinMaxDim_F(File sapfor_drv, Test test) {
|
||||
Pair<Integer, Integer> res = getProjectFolderMinMaxDim_F(sapfor_drv, test.getServerPath());
|
||||
test.min_dim = res.getKey();
|
||||
test.max_dim = res.getValue();
|
||||
}
|
||||
public static void getTestMinMaxDime_C(Test test) {
|
||||
int min_dim = 0;
|
||||
int max_dim = 0;
|
||||
for (File file : test.getServerFiles()) {
|
||||
max_dim = Math.max(max_dim, getFileMaxDim_C(file));
|
||||
}
|
||||
test.min_dim = min_dim;
|
||||
test.max_dim = max_dim;
|
||||
}
|
||||
public void refreshPid() {
|
||||
try {
|
||||
// UI.Info("Calling SPF_GetCurrentPID...");
|
||||
@@ -366,7 +444,7 @@ public abstract class Sapfor extends OSDComponent {
|
||||
"SPF_OpenDvmStatistic",
|
||||
-Global.messagesServer.getPort(),
|
||||
"",
|
||||
// Global.packSapforSettings(),
|
||||
// Global.packSapforSettings(),
|
||||
src);
|
||||
return result;
|
||||
}
|
||||
@@ -567,26 +645,5 @@ public abstract class Sapfor extends OSDComponent {
|
||||
if ((UI.isActive()) && (Global.mainModule.getUI().hasMainWindow()) && (Global.mainModule.getUI().getVersionsWindow() != null))
|
||||
Global.mainModule.getUI().getVersionsWindow().BlockVariants();
|
||||
}
|
||||
//--------------------------------------------------------------------------->>
|
||||
//временный (?) проход, по тихому получить размерность теста, предварительно выполнив тихий парс.
|
||||
//тут все одноразовое. считаем что таблицы бд уже заполнены как надо.
|
||||
/*
|
||||
public LanguageStyle getStyle() throws Exception {
|
||||
return (Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed;
|
||||
}
|
||||
*/
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
public String getConsoleFlags() throws Exception {
|
||||
Vector<String> res = new Vector<>();
|
||||
if ((Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean())
|
||||
res.add("-f90");
|
||||
if ((Global.mainModule.getDb()).settings.get(SettingName.STATIC_SHADOW_ANALYSIS).toBoolean())
|
||||
res.add("-sh");
|
||||
res.add("-shwidth " + (Global.mainModule.getDb()).settings.get(SettingName.MAX_SHADOW_WIDTH));
|
||||
if ((Global.mainModule.getDb()).settings.get(SettingName.KEEP_SPF_DIRECTIVES).toBoolean())
|
||||
res.add("-keepSPF");
|
||||
return String.join(" ", res);
|
||||
}
|
||||
*/
|
||||
//--
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public class Sapfor_F extends Sapfor {
|
||||
}
|
||||
@Override
|
||||
public String getAssemblyCommand() {
|
||||
return "cd Repo/sapfor/experts/Sapfor_2017/_bin\n" +
|
||||
return "cd Repo/SAPFOR/install\n" +
|
||||
"cmake ../\n" +
|
||||
"make -j 4\n";
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class Sapfor_F extends Sapfor {
|
||||
public File getAssemblyFile() {
|
||||
return Paths.get(
|
||||
Global.RepoDirectory.getAbsolutePath(),
|
||||
"sapfor/experts/Sapfor_2017/_bin/Sapfor_F").toFile();
|
||||
"SAPFOR/install/Sapfor_F").toFile();
|
||||
}
|
||||
@Override
|
||||
public String getUpdateCommand() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.ComponentsServer.Component.UI;
|
||||
import Common.Visual.Editor.BaseEditor;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Visual.Editor.BaseEditor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
@@ -85,7 +85,7 @@ public class Visualiser extends Component {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public File getDownloadsDirectory(){
|
||||
public File getDownloadsDirectory() {
|
||||
File res = new File(getWorkspace(), Constants.DownloadsDirectoryName);
|
||||
Utils_.CheckDirectory(res);
|
||||
return res;
|
||||
|
||||
@@ -73,8 +73,8 @@ public class Visualizer_2 extends OSDComponent {
|
||||
}
|
||||
@Override
|
||||
public String getAssemblyCommand() {
|
||||
File src_home= Paths.get(Global.RepoDirectory.getAbsolutePath(),"/sapfor/experts/Sapfor_2017/_src/Server").toFile();
|
||||
return "cd " +Utils_.DQuotes(src_home)+
|
||||
File src_home = Paths.get(Global.RepoDirectory.getAbsolutePath(), "SAPFOR/src/Server").toFile();
|
||||
return "cd " + Utils_.DQuotes(src_home) +
|
||||
"\n" +
|
||||
"g++ -O3 -std=c++17 checkUniq.cpp server.cpp -o Visualizer_2 -lpthread -lstdc++fs\n";
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class Visualizer_2 extends OSDComponent {
|
||||
public File getAssemblyFile() {
|
||||
return Paths.get(
|
||||
Global.RepoDirectory.getAbsolutePath(),
|
||||
"sapfor/experts/Sapfor_2017/_src/Server/Visualizer_2").toFile();
|
||||
"SAPFOR/src/Server/Visualizer_2").toFile();
|
||||
}
|
||||
public void Connect() throws Exception {
|
||||
ClearLog();
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package _VisualDVM.ComponentsServer;
|
||||
import Common.Database.Database;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.RepositoryRefuseException;
|
||||
import Common.Utils.Pair;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.BugReportAdditionJson;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||
import _VisualDVM.ComponentsServer.Component.Json.ComponentPublicationInfoJson;
|
||||
import _VisualDVM.ComponentsServer.Component.Json.ComponentVersionsInfoJson;
|
||||
@@ -11,96 +15,24 @@ import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.Passes.All.ArchivesBackupPass;
|
||||
import _VisualDVM.Passes.All.UnzipFolderPass;
|
||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
import _VisualDVM.Repository.Server.RepositoryServer;
|
||||
import _VisualDVM.Utils;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.RandomStringUtils;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Vector;
|
||||
public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
public CredentialsDatabase credentials_db = null;
|
||||
//--
|
||||
public static ZipFolderPass zip = new ZipFolderPass();
|
||||
public static UnzipFolderPass unzip = new UnzipFolderPass();
|
||||
public static ArchivesBackupPass backupSession = new ArchivesBackupPass();
|
||||
//-
|
||||
public static Vector<Pair<Machine, User>> storages = new Vector<>(
|
||||
Arrays.asList(new Pair<>(new Machine("titan",
|
||||
"dvmh.keldysh.ru",
|
||||
22, MachineType.Server),
|
||||
new User("dvmuser1", "mprit_2011")) // todo с этим паролем что-то сделать.
|
||||
));
|
||||
//-
|
||||
protected Thread backUp = new Thread(() -> {
|
||||
while (true) {
|
||||
try {
|
||||
//-------------------------------------
|
||||
Calendar rightNow = Calendar.getInstance();
|
||||
int year = rightNow.get(Calendar.YEAR);
|
||||
int month = rightNow.get(Calendar.MONTH);
|
||||
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.componentsServerProperties.BackupHour) && (minute == Global.componentsServerProperties.BackupMinute)) {
|
||||
//определить имя папки с багом.
|
||||
String backUpName = year + "_" + (month + 1) + "_" + (day);
|
||||
File todayBackUp = Paths.get(Global.DataBackUpsDirectory.getAbsolutePath(), backUpName).toFile();
|
||||
File todayBackUpArchive = Paths.get(Global.DataBackUpsDirectory.getAbsolutePath(), backUpName + ".zip").toFile();
|
||||
//-
|
||||
File bugsDBBackUp = Paths.get(todayBackUp.getAbsolutePath(), db.getFile().getName()).toFile();
|
||||
File bugsArchives = Paths.get(todayBackUp.getAbsolutePath(), "Bugs.zip").toFile();
|
||||
//-
|
||||
// Чистка старых бекапов на самом сервере.
|
||||
Utils.keepNewFiles(todayBackUp.getParentFile(), 2);
|
||||
if (!todayBackUpArchive.exists()) {
|
||||
FileUtils.forceMkdir(todayBackUp);
|
||||
Files.copy(db.getFile().toPath(), bugsDBBackUp.toPath());
|
||||
//-
|
||||
zip.Do("Bugs", bugsArchives.getAbsolutePath());
|
||||
zip.Do(todayBackUp.getAbsolutePath(), todayBackUpArchive.getAbsolutePath());
|
||||
Utils_.forceDeleteWithCheck(todayBackUp);
|
||||
//-
|
||||
for (Pair<Machine, User> cred : storages) {
|
||||
backupSession.Do(cred.getKey(), cred.getValue(), todayBackUpArchive);
|
||||
}
|
||||
//bonus backup
|
||||
//todo оформить как у планировщика, так как это нить, напрямую сервер трогать нельзя.
|
||||
if (rightNow.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
|
||||
EmailMessage message = new EmailMessage("db backup", "копия баз данных журнала ошибок");
|
||||
message.addAttachement(db.getFile());
|
||||
for (String address : Constants.admins_mails) {
|
||||
Email(message, address);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------
|
||||
Thread.sleep(60000);
|
||||
} catch (Exception ex) {
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
public ComponentsServer() {
|
||||
super(BugReportsDatabase.class);
|
||||
}
|
||||
@@ -113,6 +45,16 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
return Constants.ComponentsServerPort;
|
||||
}
|
||||
@Override
|
||||
protected void extraBackup(File todayBackUp) {
|
||||
zip.Do("Bugs", new File(todayBackUp, "Bugs.zip").getAbsolutePath());
|
||||
}
|
||||
@Override
|
||||
public Database getDb() {
|
||||
if (request.arg.equals("credentials"))
|
||||
return credentials_db;
|
||||
return super.getDb();
|
||||
}
|
||||
@Override
|
||||
protected void beforePublishAction(DBObject object) throws Exception {
|
||||
if (object instanceof BugReport) {
|
||||
BugReport bugReport = (BugReport) object;
|
||||
@@ -123,25 +65,42 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void afterPublishAction(DBObject object) throws Exception {
|
||||
if (object instanceof BugReport) {
|
||||
BugReport bugReport = (BugReport) object;
|
||||
if (bugReport.settings != null) {
|
||||
for (BugReportSetting setting : bugReport.settings) {
|
||||
setting.bugreport_id = bugReport.id;
|
||||
db.Insert(setting);
|
||||
}
|
||||
}
|
||||
if (bugReport.recipients != null) {
|
||||
db.saveBugreportRecipients(bugReport);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void afterEditAction(DBObject object) throws Exception {
|
||||
if (object instanceof BugReport) {
|
||||
BugReport bugReport = (BugReport) object;
|
||||
if (bugReport.recipients != null) {
|
||||
db.bugReportRecipients.ActualizeData(
|
||||
db.getVectorByFK(bugReport, BugReportRecipient.class),
|
||||
bugReport.recipients);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void afterDeleteAction(DBObject object) throws Exception {
|
||||
if (object instanceof BugReport) {
|
||||
BugReport bugReport = (BugReport) object;
|
||||
if (!bugReport.project_version.isEmpty()) Utils_.forceDeleteWithCheck(bugReport.getArchiveFile());
|
||||
}else if (object instanceof UserAccount){
|
||||
} else if (object instanceof UserAccount) {
|
||||
UserAccount account = (UserAccount) object;
|
||||
Utils_.forceDeleteWithCheck(account.getServerKeyFile());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void StartAction() throws Exception {
|
||||
if (Global.componentsServerProperties.EmailAdminsOnStart) {
|
||||
EmailMessage message = new EmailMessage("Сервер Sapfor запущен", new Date().toString());
|
||||
for (String address : Constants.admins_mails) {
|
||||
Email(message, address);
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void ActivateDB() {
|
||||
super.ActivateDB();
|
||||
try {
|
||||
@@ -151,10 +110,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void startAdditionalThreads() {
|
||||
backUp.start();
|
||||
}
|
||||
//-
|
||||
void DVMConvertProject() throws Exception {
|
||||
String[] args = request.arg.split("\n");
|
||||
@@ -204,14 +159,13 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
}
|
||||
void AppendBugReportField() throws Exception {
|
||||
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
|
||||
if (db.bugReports.containsKey(transport.id)) {
|
||||
BugReport actual = db.bugReports.get(transport.id);
|
||||
Field field = BugReport.class.getField(transport.fieldName);
|
||||
field.set(actual, field.get(actual) + "\n" + transport.textAddition);
|
||||
actual.change_date = new Date().getTime();
|
||||
db.Update(actual);
|
||||
response.object = actual;
|
||||
} else throw new RepositoryRefuseException("Баг репорт с ключом " + transport.id + " не существует.");
|
||||
checkExistense(transport.id, BugReport.class);
|
||||
BugReport actual = db.bugReports.get(transport.id);
|
||||
Field field = BugReport.class.getField(transport.fieldName);
|
||||
field.set(actual, field.get(actual) + "\n" + transport.textAddition);
|
||||
actual.change_date = new Date().getTime();
|
||||
db.Update(actual);
|
||||
response.object = actual;
|
||||
}
|
||||
void ReceiveAllArchives() throws Exception {
|
||||
ZipFolderPass zip = new ZipFolderPass();
|
||||
@@ -230,13 +184,11 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
}
|
||||
void UpdateBugReport() throws Exception {
|
||||
BugReport oldBugReport = (BugReport) request.object;
|
||||
if (db.bugReports.containsKey(oldBugReport.id)) {
|
||||
BugReport bugReport = db.bugReports.get(oldBugReport.id);
|
||||
bugReport.SynchronizeFields(oldBugReport);
|
||||
bugReport.change_date = new Date().getTime();
|
||||
db.Update(bugReport);
|
||||
} else
|
||||
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
|
||||
checkExistense(oldBugReport.id, BugReport.class);
|
||||
BugReport bugReport = db.bugReports.get(oldBugReport.id);
|
||||
bugReport.SynchronizeFields(oldBugReport);
|
||||
bugReport.change_date = new Date().getTime();
|
||||
db.Update(bugReport);
|
||||
}
|
||||
//--
|
||||
void GetComponentsBackUps() throws Exception {
|
||||
@@ -305,6 +257,25 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
bufferWriter_.write("Минимальная версия поднята до " + info.versionText + "\n");
|
||||
bufferWriter_.close();
|
||||
}
|
||||
//-рассылка об изменениях.
|
||||
if (info.needsEmail) {
|
||||
String version_mail_header = String.join(" ",
|
||||
"Опубликована версия",
|
||||
Utils_.DQuotes(info.versionNumber),
|
||||
"компонента",
|
||||
Utils_.DQuotes(info.componentType.getDescription()));
|
||||
//-
|
||||
EmailMessage message =
|
||||
new EmailMessage(version_mail_header,
|
||||
info.changeRecord
|
||||
);
|
||||
if (info.needsSendFile)
|
||||
message.addAttachement(componentFile);
|
||||
//--
|
||||
for (String address : credentials_db.userAccounts.getActiveMails()) {
|
||||
EmailMessagesQueue.add(new Pair<>(address, message));
|
||||
}
|
||||
}
|
||||
}
|
||||
void GetComponentsVersionsInfo() throws Exception {
|
||||
Vector<String> types = (Vector<String>) request.object;
|
||||
@@ -346,19 +317,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
void ReceiveCredentialsDatabase() throws Exception {
|
||||
response.object = Utils_.fileToBytes(credentials_db.getFile());
|
||||
}
|
||||
void PublishUserAccount() throws Exception {
|
||||
DBObject dbObject = (DBObject) request.object;
|
||||
response.object = (Serializable) credentials_db.InsertS(dbObject).getPK();
|
||||
credentials_db.userAccounts.get(response.object).generateKey();
|
||||
}
|
||||
void EditUserAccount() throws Exception {
|
||||
UserAccount new_object = (UserAccount) request.object;
|
||||
credentials_db.UpdateWithCheck(new_object);
|
||||
}
|
||||
void DeleteUserAccount() throws Exception {
|
||||
Pair<Class, Object> to_delete = (Pair<Class, Object>) request.object;
|
||||
afterDeleteAction(credentials_db.DeleteByPK(to_delete.getKey(), to_delete.getValue()));
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
protected void UnsafeSession() throws Exception {
|
||||
@@ -392,12 +350,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
@Override
|
||||
protected void Session() throws Exception {
|
||||
switch (code) {
|
||||
case PublishUserAccount:
|
||||
PublishUserAccount();
|
||||
break;
|
||||
case EditUserAccount:
|
||||
EditUserAccount();
|
||||
break;
|
||||
case ReceiveCredentialsDatabase:
|
||||
ReceiveCredentialsDatabase();
|
||||
break;
|
||||
@@ -419,9 +371,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
case DVMConvertProject:
|
||||
DVMConvertProject();
|
||||
break;
|
||||
case DeleteUserAccount:
|
||||
DeleteUserAccount();
|
||||
break;
|
||||
case CheckURLRegistered:
|
||||
CheckURLRegistered();
|
||||
break;
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
package _VisualDVM.ComponentsServer;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Passes.PassCode_;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccountsDBTable;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.LinkedHashMap;
|
||||
public class CredentialsDatabase extends SQLiteDatabase {
|
||||
public UserAccountsDBTable userAccounts;
|
||||
public SubscriberWorkspaceDBTable workspaces;
|
||||
@@ -38,5 +32,4 @@ public class CredentialsDatabase extends SQLiteDatabase {
|
||||
userAccounts.ShowUI();
|
||||
super.ResetUI();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ public class UserAccountJson {
|
||||
public String email;
|
||||
@Expose
|
||||
public String name;
|
||||
public UserAccountJson(String email_in, String name_in){
|
||||
public UserAccountJson(String email_in, String name_in) {
|
||||
email = email_in;
|
||||
name = name_in;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,12 @@ import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
|
||||
public class Recipient extends DBObject {
|
||||
public String email = "";
|
||||
public String name = "";
|
||||
public Recipient() {
|
||||
}
|
||||
public Recipient(UserAccountJson json) {
|
||||
email = json.email;
|
||||
name = json.name;
|
||||
}
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return email;
|
||||
@@ -15,10 +21,4 @@ public class Recipient extends DBObject {
|
||||
email = src_.email;
|
||||
name = src_.name;
|
||||
}
|
||||
public Recipient() {
|
||||
}
|
||||
public Recipient(UserAccountJson json) {
|
||||
email = json.email;
|
||||
name = json.name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
|
||||
import _VisualDVM.ComponentsServer.Recipient.UI.RecipientsForm;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
@@ -15,16 +14,16 @@ public class RecipientsDataSet extends DataSet<String, Recipient> {
|
||||
public RecipientsDataSet() {
|
||||
super(String.class, Recipient.class);
|
||||
}
|
||||
public void Unpack(String packed){
|
||||
public void Unpack(String packed) {
|
||||
clear();
|
||||
UserAccountsJson jsons = Utils_.gson.fromJson(packed, UserAccountsJson.class);
|
||||
for (UserAccountJson userAccountJson: jsons.values){
|
||||
for (UserAccountJson userAccountJson : jsons.values) {
|
||||
Global.componentsServer.db.recipients.put(userAccountJson.email, new Recipient(userAccountJson));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new RecipientsForm(this,mountPanel);
|
||||
return new RecipientsForm(this, mountPanel);
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
@@ -34,11 +33,11 @@ public class RecipientsDataSet extends DataSet<String, Recipient> {
|
||||
public String getSingleDescription() {
|
||||
return "адресат";
|
||||
}
|
||||
public Vector<String> getSelectedMails(){
|
||||
public Vector<String> getSelectedMails() {
|
||||
//баг текущий. значит адресаты уже активные и правильные. дополняем их админами и автором.
|
||||
Vector<String> res = new Vector<>();
|
||||
for (Recipient recipient:Data.values()){
|
||||
if (recipient.isSelected()&& !res.contains(recipient.email))
|
||||
for (Recipient recipient : Data.values()) {
|
||||
if (recipient.isSelected() && !res.contains(recipient.email))
|
||||
res.add(recipient.email);
|
||||
}
|
||||
//--
|
||||
|
||||
@@ -26,7 +26,7 @@ public class RecipientsForm extends DataSetControlForm<Recipient> {
|
||||
}
|
||||
@Override
|
||||
protected DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.SaveBugReportExecutor,PassCode.SaveBugReportRecipients);
|
||||
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.SaveBugReportExecutor, PassCode.SaveBugReportRecipients);
|
||||
}
|
||||
@Override
|
||||
protected ColumnInfo<Recipient> createPKColumn() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package _VisualDVM.ComponentsServer.SubscriberWorkspace.UI;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.ColumnInfo;
|
||||
@@ -47,7 +46,7 @@ public class SubscriberWorkspacesForm extends DataSetControlForm<SubscriberWorks
|
||||
}
|
||||
@Override
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(dataSource.getPluralDescription());
|
||||
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.DeleteRemoteWorkspace);
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(SubscriberWorkspace object) {
|
||||
|
||||
@@ -3,6 +3,7 @@ import java.io.Serializable;
|
||||
public enum AccountRole implements Serializable {
|
||||
Undefined,
|
||||
User,
|
||||
Student,
|
||||
Developer,
|
||||
Admin;
|
||||
public String getDescription() {
|
||||
@@ -11,6 +12,8 @@ public enum AccountRole implements Serializable {
|
||||
return "не зарегистрирован";
|
||||
case User:
|
||||
return "Пользователь";
|
||||
case Student:
|
||||
return "Студент";
|
||||
case Developer:
|
||||
return "Разработчик";
|
||||
case Admin:
|
||||
|
||||
@@ -2,9 +2,9 @@ package _VisualDVM.ComponentsServer.UserAccount.UI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||
public class UserAccountDialog extends DBObjectDialog<UserAccount, UserAccountFields> {
|
||||
public UserAccountDialog() {
|
||||
super(UserAccountFields.class);
|
||||
|
||||
@@ -6,17 +6,18 @@ import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class UserAccountFields implements DialogFields {
|
||||
private JPanel content;
|
||||
public JTextField tfName;
|
||||
public JTextField tfAddress;
|
||||
public JCheckBox cbMail;
|
||||
public JComboBox cbRole;
|
||||
private JPanel content;
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
tfAddress = new StyledTextField();
|
||||
cbRole = new JComboBox<>();
|
||||
cbRole.addItem(AccountRole.User);
|
||||
cbRole.addItem(AccountRole.Student);
|
||||
cbRole.addItem(AccountRole.Developer);
|
||||
cbRole.addItem(AccountRole.Admin);
|
||||
}
|
||||
|
||||
@@ -13,38 +13,37 @@ public class UserAccount extends iDBObject {
|
||||
public String name = "";
|
||||
public String email = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String telegram_name="";
|
||||
public String telegram_name = "";
|
||||
@Description("DEFAULT 1")
|
||||
public int subscribe_active = 1;
|
||||
@Description("DEFAULT 'Undefined'")
|
||||
public AccountRole role = AccountRole.Undefined; //права доступа
|
||||
public UserAccount(){
|
||||
|
||||
public UserAccount() {
|
||||
}
|
||||
public UserAccount(UserAccount account_in) {
|
||||
this.SynchronizeFields(account_in);
|
||||
}
|
||||
public UserAccount(String name_in, String email_in) {
|
||||
name = name_in;
|
||||
email = email_in;
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
UserAccount src_ = (UserAccount) src;
|
||||
name = src_.name;
|
||||
email = src_.email;
|
||||
telegram_name=src_.telegram_name;
|
||||
subscribe_active=src_.subscribe_active;
|
||||
telegram_name = src_.telegram_name;
|
||||
subscribe_active = src_.subscribe_active;
|
||||
role = src_.role;
|
||||
}
|
||||
public UserAccount(String name_in, String email_in){
|
||||
name = name_in;
|
||||
email=email_in;
|
||||
public File getClientKeyFile() {
|
||||
return new File(Global.KeysDirectory, "key");
|
||||
}
|
||||
public File getClientKeyFile(){
|
||||
return new File(Global.KeysDirectory,"key");
|
||||
public File getServerKeyFile() {
|
||||
return new File(Global.KeysDirectory, String.valueOf(id));
|
||||
}
|
||||
public File getServerKeyFile(){
|
||||
return new File(Global.KeysDirectory,String.valueOf(id));
|
||||
}
|
||||
public String getKey() throws Exception{
|
||||
public String getKey() throws Exception {
|
||||
return FileUtils.readFileToString(getServerKeyFile());
|
||||
}
|
||||
public void generateKey() throws Exception {
|
||||
|
||||
@@ -10,8 +10,6 @@ import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
|
||||
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
|
||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
||||
import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountsForm;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -20,15 +18,15 @@ public class UserAccountsDBTable extends iDBTable<UserAccount> {
|
||||
public UserAccountsDBTable() {
|
||||
super(UserAccount.class);
|
||||
}
|
||||
public UserAccount getByKey(String key_in) throws Exception{
|
||||
for (UserAccount userAccount: Data.values()){
|
||||
public UserAccount getByKey(String key_in) throws Exception {
|
||||
for (UserAccount userAccount : Data.values()) {
|
||||
if (userAccount.getKey().equals(key_in))
|
||||
return userAccount;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public UserAccount getByEmail(String email_in){
|
||||
for (UserAccount userAccount: Data.values()){
|
||||
public UserAccount getByEmail(String email_in) {
|
||||
for (UserAccount userAccount : Data.values()) {
|
||||
if (userAccount.email.equals(email_in))
|
||||
return userAccount;
|
||||
}
|
||||
@@ -53,28 +51,23 @@ public class UserAccountsDBTable extends iDBTable<UserAccount> {
|
||||
res.put(SubscriberWorkspace.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
return res;
|
||||
}
|
||||
public String getPackedActiveRecipients(){
|
||||
UserAccountsJson res = new UserAccountsJson();
|
||||
public String getPackedActiveRecipients() {
|
||||
UserAccountsJson res = new UserAccountsJson();
|
||||
Vector<String> active = new Vector<>();
|
||||
for (UserAccount userAccount: Data.values()){
|
||||
if ((userAccount.subscribe_active!=0) && !active.contains(userAccount.email)){
|
||||
for (UserAccount userAccount : Data.values()) {
|
||||
if ((userAccount.subscribe_active != 0) && !active.contains(userAccount.email)) {
|
||||
active.add(userAccount.email);
|
||||
res.values.add(new UserAccountJson(userAccount.email, userAccount.name));
|
||||
}
|
||||
}
|
||||
return Utils_.gson.toJson(res);
|
||||
}
|
||||
|
||||
public Vector<String> getActiveMails(){
|
||||
public Vector<String> getActiveMails() {
|
||||
Vector<String> res = new Vector<>();
|
||||
for (UserAccount account: Data.values()){
|
||||
if ((account.subscribe_active!=0)&& !res.contains(account.email))
|
||||
for (UserAccount account : Data.values()) {
|
||||
if ((account.subscribe_active != 0) && !res.contains(account.email))
|
||||
res.add(account.email);
|
||||
}
|
||||
for (String admin_mail : Constants.admins_mails) {
|
||||
if (!res.contains(admin_mail))
|
||||
res.add(admin_mail);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,25 +2,17 @@ package _VisualDVM;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.File;
|
||||
public class ComponentsServerProperties extends VisualDVMProperties{
|
||||
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;
|
||||
@Expose
|
||||
public String default_dvm_drv="";
|
||||
public String default_dvm_drv = "";
|
||||
//---
|
||||
public ComponentsServerProperties(){
|
||||
public ComponentsServerProperties() {
|
||||
Mode = _VisualDVM.Mode.Server;
|
||||
}
|
||||
public ComponentsServerProperties(File file_in){
|
||||
public ComponentsServerProperties(File file_in) {
|
||||
super(_VisualDVM.Mode.Server, file_in);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ import Common.Utils.Vector_;
|
||||
|
||||
import java.util.Vector;
|
||||
public class Constants {
|
||||
public static final int version = 1191;
|
||||
public static final int planner_version = 12;
|
||||
public static final int testingMaxKernels = 64; //вообще говоря, это параметр машины.
|
||||
public static final int version = 1253;
|
||||
public static final int planner_version = 24;
|
||||
public static final int testingMaxKernels = 64;
|
||||
//--
|
||||
public static final String ApplicationFileName = "VisualSapfor.jar";
|
||||
//--
|
||||
@@ -26,11 +26,10 @@ public class Constants {
|
||||
public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer";
|
||||
public static final String KeyDirectoryName = "Keys";
|
||||
//--
|
||||
//SVN vmk-post@yandex.ru
|
||||
public static final String REPOSITORY_AUTHENTICATION = "--username dvmhuser --password dvmh2013 --non-interactive";
|
||||
public static final String DVM_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/dvm";
|
||||
public static final String SAPFOR_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/sapfor";
|
||||
public static final String SAPFOR_REPOSITORY_BIN = "/sapfor/experts/Sapfor_2017/_bin";
|
||||
//GIT
|
||||
public static final String DVM_TESTS_REPOSITORY = "https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm-auto-test";
|
||||
public static final String SAPFOR_REPOSITORY = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR.git";
|
||||
public static final String SAPFOR_VERSION_URL = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR/raw/branch/master/src/Utils/version.h";
|
||||
//-вывод задач
|
||||
public final static String parse_out_file = "parse_out.txt";
|
||||
public final static String parse_err_file = "parse_err.txt";
|
||||
@@ -47,8 +46,9 @@ public class Constants {
|
||||
public static final int SMTPPort = 465;
|
||||
public static final int MailSocketPort = 465;
|
||||
//
|
||||
//7998 отладочный порт. теперь.
|
||||
public static final int ComponentsServerPort = 7995; //7795
|
||||
public static final int TestingServerPort = 7998; //7998
|
||||
public static final int TestingServerPort = 7996; //7996
|
||||
public static final int SocketTimeout = 0;
|
||||
//-
|
||||
public static final String ServerAddress = "alex-freenas.ddns.net";
|
||||
@@ -58,7 +58,7 @@ public class Constants {
|
||||
public static final String package_json = "package_json";
|
||||
public static final String results_json = "results_json";
|
||||
//--
|
||||
public static final int parser_group = -1;
|
||||
public static final int parser_group = 6000;
|
||||
public static final int compiler_group = -2;
|
||||
// DBProjectFile
|
||||
public static final String no_data = "Нет данных";
|
||||
@@ -469,7 +469,7 @@ public class Constants {
|
||||
};
|
||||
public static Vector<String> admins_mails = new Vector_<>(
|
||||
"sapfor.tracker@internet.ru",
|
||||
"vmk-post@yandex.ru",
|
||||
"79854210702@ya.ru"
|
||||
"vmk-post@yandex.ru"
|
||||
, "79854210702@ya.ru"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
||||
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
public class Global {
|
||||
//todo свести большинство к содержимому mainModule
|
||||
@@ -39,7 +38,7 @@ public class Global {
|
||||
public static File KeysDirectory;
|
||||
public static File DataDirectory;
|
||||
public static File BugReportsDirectory;
|
||||
public static File BackUpsDirectory;
|
||||
public static File BackUpsDirectory; //бекапы компонентов на локальной машине.
|
||||
public static File TempDirectory;
|
||||
public static File ProjectsDirectory;
|
||||
public static File CompilationTasksDirectory;
|
||||
@@ -48,7 +47,7 @@ public class Global {
|
||||
public static File RepoDirectory;
|
||||
public static File TestsDirectory;
|
||||
public static File PerformanceAnalyzerDirectory;
|
||||
public static File DataBackUpsDirectory;
|
||||
public static File DataBackUpsDirectory; //бекапы данных сервера.
|
||||
public static File DVMPackagesDirectory;
|
||||
public static File SapforsDirectory;
|
||||
public static File SapforPackagesDirectory;
|
||||
@@ -61,8 +60,8 @@ public class Global {
|
||||
public static Visualiser visualiser = null;
|
||||
public static Visualizer_2 visualizer_2 = null;
|
||||
public static void CheckVisualiserDirectories() {
|
||||
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
//-
|
||||
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||
@@ -84,17 +83,18 @@ public class Global {
|
||||
}
|
||||
}
|
||||
public static void CheckServerDirectories() {
|
||||
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
//-
|
||||
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils_.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
|
||||
//--
|
||||
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils_.CheckDirectory(KeysDirectory = new File(Utils_.getHomeDirectory(), Constants.KeyDirectoryName));
|
||||
}
|
||||
public static void CheckTestingSystemDirectories() {
|
||||
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
Utils_.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
|
||||
//-
|
||||
Utils_.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName));
|
||||
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||
@@ -158,13 +158,17 @@ public class Global {
|
||||
public static void NormalMode(int port) throws Exception {
|
||||
//-------------------------------->>
|
||||
mainModule = new MainModule();
|
||||
System.out.println("main module initialization..");
|
||||
mainModule.Init();
|
||||
System.out.println("DONE");
|
||||
//--
|
||||
CheckVisualiserDirectories();
|
||||
CreateLogAtComponentsPath();
|
||||
//-
|
||||
System.out.println("connection to visualiser_2..");
|
||||
visualizer_2 = new Visualizer_2(port);
|
||||
visualizer_2.Connect();
|
||||
System.out.println("DONE");
|
||||
visualizer_2.refreshPid();
|
||||
//если делать раньше, то не удастся убить сервер.
|
||||
if (Utils_.ContainsCyrillic(Utils_.getHomePath())) {
|
||||
@@ -173,16 +177,27 @@ public class Global {
|
||||
"Визуализатор завершает работу."); //
|
||||
FinishApplication();
|
||||
}
|
||||
System.out.println("messages server starting..");
|
||||
messagesServer = new MessagesServer();
|
||||
messagesServer.Start();
|
||||
System.out.println("DONE");
|
||||
components = new ComponentsSet();
|
||||
System.out.println("component initial versions checking..");
|
||||
components.initialVersionsCheck();
|
||||
System.out.println("DONE");
|
||||
System.out.println("geting component actual versions..");
|
||||
Global.mainModule.getPass(PassCode.GetComponentsActualVersions).Do();
|
||||
System.out.println("DONE");
|
||||
System.out.println("validation component actual versions..");
|
||||
components.validateStates();
|
||||
System.out.println("DONE");
|
||||
if (components.needChanges()) {
|
||||
System.out.println("components need changes!!");
|
||||
boolean flag = true;
|
||||
do {
|
||||
System.out.println("Show components window...");
|
||||
Global.mainModule.getUI().getComponentsWindow().ShowDialog("");
|
||||
System.out.println("DONE");
|
||||
if (flag = (!components.validateStates())) {
|
||||
if (!UI.Question("Обнаружены некорректные компоненты.Работа визуализатора невозможна.\n" +
|
||||
"Вернуться к окну компонент"
|
||||
@@ -220,7 +235,7 @@ public class Global {
|
||||
}
|
||||
public static void ServerMode() throws Exception {
|
||||
CheckServerDirectories();
|
||||
CreateLogAtComponentsPath();
|
||||
CreateLogAtHome();
|
||||
componentsServer = new ComponentsServer();
|
||||
componentsServer.ActivateDB();
|
||||
componentsServer.Start();
|
||||
@@ -228,7 +243,7 @@ public class Global {
|
||||
}
|
||||
public static void TestingSystemMode() throws Exception {
|
||||
CheckTestingSystemDirectories();
|
||||
CreateLogAtComponentsPath();
|
||||
CreateLogAtHome();
|
||||
testingServer = new TestingServer();
|
||||
testingServer.ActivateDB();
|
||||
testingServer.Start();
|
||||
@@ -278,6 +293,10 @@ public class Global {
|
||||
public static void Init(String... args) {
|
||||
System.out.println("VisualSapfor.jar started..");
|
||||
System.out.println("home directory is" + Utils_.Brackets(Utils_.getHomePath()));
|
||||
System.out.println("args size = " + args.length);
|
||||
for (int i = 0; i < args.length; ++i)
|
||||
System.out.println("args[" + i + "]=" + Utils_.DQuotes(args[i]));
|
||||
System.out.println("====");
|
||||
//--->
|
||||
try {
|
||||
SynchronizeProperties();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.GlobalData.Compiler;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironmentsSet;
|
||||
import _VisualDVM.GlobalData.CompilerOption.CompilerOptionsSet;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.RawCompilerEnvironmentsSet;
|
||||
import _VisualDVM.GlobalData.CompilerOption.RawCompilerOptionsSet;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
@@ -29,8 +29,8 @@ public class Compiler extends iDBObject {
|
||||
@Description("IGNORE")
|
||||
public String versionText = "";
|
||||
//-
|
||||
public CompilerOptionsSet options = new CompilerOptionsSet();
|
||||
public CompilerEnvironmentsSet environments = new CompilerEnvironmentsSet();
|
||||
public RawCompilerOptionsSet options = new RawCompilerOptionsSet();
|
||||
public RawCompilerEnvironmentsSet environments = new RawCompilerEnvironmentsSet();
|
||||
//-
|
||||
public Compiler() {
|
||||
}
|
||||
|
||||
@@ -13,8 +13,12 @@ public class CompilerDialog extends DBObjectDialog<Compiler, CompilerFields> {
|
||||
super(CompilerFields.class);
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 600;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 300;
|
||||
return 450;
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.GlobalData.Compiler.UI.CompilerFields">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="13" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="500" height="400"/>
|
||||
<xy x="20" y="20" width="500" height="437"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="87831" class="javax.swing.JTextField" binding="tfHome" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -18,21 +18,12 @@
|
||||
</component>
|
||||
<vspacer id="44b33">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="12" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="627cc" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="расположение"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="48916" class="javax.swing.JButton" binding="bBrowse">
|
||||
<constraints>
|
||||
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="true"/>
|
||||
@@ -42,29 +33,48 @@
|
||||
</component>
|
||||
<component id="d58a0" class="javax.swing.JTextField" binding="tfCallCommand" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="f3f87" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="команда вызова"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="87234" class="javax.swing.JTextField" binding="tfDescription" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="ac56f" class="javax.swing.JTextField" binding="tfVersionCommand" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="b2235" class="javax.swing.JTextField" binding="tfHelpCommand" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="673a2" class="javax.swing.JComboBox" binding="cbCompilerType" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="11" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<toolTipText value="выберите тип компилятора"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d1e8b" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
@@ -74,38 +84,36 @@
|
||||
<text value="описание"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="ac56f" class="javax.swing.JTextField" binding="tfVersionCommand" custom-create="true">
|
||||
<component id="627cc" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="расположение"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f3f87" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="команда вызова"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="34097" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="запрос версии"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="b2235" class="javax.swing.JTextField" binding="tfHelpCommand" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8982d" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
@@ -114,21 +122,13 @@
|
||||
</component>
|
||||
<component id="19a71" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="10" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="тип"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="673a2" class="javax.swing.JComboBox" binding="cbCompilerType" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<toolTipText value="выберите тип компилятора"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.UI.CompilerEnvironmentsForm;
|
||||
|
||||
import javax.swing.*;
|
||||
public class CompilerEnvironmentsSet extends DataSet<String, CompilerEnvironment> {
|
||||
public CompilerEnvironmentsSet() {
|
||||
super(String.class, CompilerEnvironment.class);
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new CompilerEnvironmentsForm(this, mountPanel);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
|
||||
public class EnvironmentsLine extends iDBObject {
|
||||
public EnvironmentsJson json;
|
||||
public EnvironmentsLine(EnvironmentsJson json_in) {
|
||||
json = json_in;
|
||||
}
|
||||
@Override
|
||||
public String getBDialogName() {
|
||||
return Utils_.Brackets(json.toLine());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsSetJson;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.UI.EnvironmentsLinesForm;
|
||||
|
||||
import javax.swing.*;
|
||||
public class EnvironmentsLinesSet extends DataSet<Integer, EnvironmentsLine> {
|
||||
public int maxId = 1;
|
||||
public EnvironmentsLinesSet() {
|
||||
super(Integer.class, EnvironmentsLine.class);
|
||||
}
|
||||
public EnvironmentsLinesSet(EnvironmentsSetJson json) {
|
||||
super(Integer.class, EnvironmentsLine.class);
|
||||
for (EnvironmentsJson environmentsJson : json.values) {
|
||||
EnvironmentsLine environmentsLine = new EnvironmentsLine(environmentsJson);
|
||||
environmentsLine.id = maxId++;
|
||||
put(environmentsLine.id, environmentsLine);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "набор переменных окружения";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "наборы переменных окружения";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new EnvironmentsLinesForm(this, mountPanel);
|
||||
}
|
||||
public EnvironmentsSetJson toJson() {
|
||||
EnvironmentsSetJson res = new EnvironmentsSetJson();
|
||||
for (EnvironmentsLine environmentsLine : Data.values()) {
|
||||
res.values.add(environmentsLine.json);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment.Json;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironment;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class EnvironmentJson {
|
||||
@Expose
|
||||
public String name; //в том числе и с разделителем если есть. поиск по startswith
|
||||
@Expose
|
||||
public String value; //значение без кавычек
|
||||
public EnvironmentJson(CompilerEnvironment src) {
|
||||
name = src.name;
|
||||
value = src.value;
|
||||
}
|
||||
public EnvironmentJson(String name_in, String value_in) {
|
||||
name = name_in;
|
||||
value = value_in;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment.Json;
|
||||
import Common.Utils.Utils_;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class EnvironmentsJson {
|
||||
@Expose
|
||||
public List<EnvironmentJson> values = new Vector<>();
|
||||
public String toLine() {
|
||||
Vector<String> res = new Vector<>();
|
||||
for (EnvironmentJson environmentJson : values) {
|
||||
res.add(environmentJson.name + "=" + Utils_.DQuotes(environmentJson.value));
|
||||
}
|
||||
return String.join(" ", res);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class EnvironmentsSetJson {
|
||||
@Expose
|
||||
public List<EnvironmentsJson> values = new Vector<>();
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentJson;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.UI.CompilerEnvironmentsForm;
|
||||
|
||||
import javax.swing.*;
|
||||
public class RawCompilerEnvironmentsSet extends DataSet<String, CompilerEnvironment> {
|
||||
public RawCompilerEnvironmentsSet() {
|
||||
super(String.class, CompilerEnvironment.class);
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new CompilerEnvironmentsForm(this, mountPanel);
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "переменные окружения";
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "переменная окружения";
|
||||
}
|
||||
public CompilerEnvironment findByJson(EnvironmentJson json) {
|
||||
for (CompilerEnvironment compilerEnvironment : Data.values()) {
|
||||
if (json.name.equals(compilerEnvironment.name))
|
||||
return compilerEnvironment;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void Reset() {
|
||||
for (CompilerEnvironment environment : Data.values()) {
|
||||
environment.select(false);
|
||||
environment.value = "";
|
||||
}
|
||||
}
|
||||
public void Synchronize(EnvironmentsJson json) {
|
||||
for (EnvironmentJson environmentJson : json.values) {
|
||||
CompilerEnvironment compilerEnvironment = findByJson(environmentJson);
|
||||
if (compilerEnvironment != null) {
|
||||
compilerEnvironment.select(true);
|
||||
compilerEnvironment.value = environmentJson.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package _VisualDVM.GlobalData.CompilerEnvironment.UI;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.ColumnInfo;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.EnvironmentsLine;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.EnvironmentsLinesSet;
|
||||
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
public class EnvironmentsLinesForm extends DataSetControlForm<EnvironmentsLine> {
|
||||
public EnvironmentsLinesForm(DataSet<?, EnvironmentsLine> dataSource_in, JPanel mountPanel_in) {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean isPKVisible() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void createColumns() {
|
||||
AddColumns(new ColumnInfo<EnvironmentsLine>("") {
|
||||
@Override
|
||||
public Object getFieldAt(EnvironmentsLine object) {
|
||||
return object.json.toLine();
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected DataMenuBar createMenuBar() {
|
||||
DataMenuBar res = super.createMenuBar();
|
||||
res.addPasses(
|
||||
new Pass<EnvironmentsLine>() {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/RedAdd.png";
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Добавление набора переменных окружения";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerEnvironmentsForTesting);
|
||||
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent())) {
|
||||
target = new EnvironmentsLine((EnvironmentsJson) pass.target);
|
||||
target.id = ((EnvironmentsLinesSet) dataSource).maxId++;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
dataSource.put(target.getPK(), target);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
dataSource.ShowUI(target.getPK());
|
||||
}
|
||||
},
|
||||
new Pass<EnvironmentsLine>() {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/Edit.png";
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Редактирование набора переменных окружения";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (dataSource.getUI().CheckCurrent(Log)) {
|
||||
target = dataSource.getUI().getCurrent();
|
||||
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerEnvironmentsForTesting);
|
||||
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent(), target.json)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
dataSource.ShowUI(target.getPK());
|
||||
}
|
||||
},
|
||||
new Pass<EnvironmentsLine>() {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Удаление набора переменных окружения";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (dataSource.getUI().CheckCurrent(Log)) {
|
||||
target = dataSource.getUI().getCurrent();
|
||||
return dataSource.getUI().ShowDeleteObjectDialog(target);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
dataSource.ClearUI();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
dataSource.Data.remove(target.getPK());
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
dataSource.ShowUI();
|
||||
}
|
||||
}
|
||||
);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Vector;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
public class CompilerOption extends DBObject {
|
||||
@Description("PRIMARY KEY, UNIQUE")
|
||||
public String name = "";
|
||||
public String parameterSeparator = "";
|
||||
public String parameterName = "";
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.GlobalData.CompilerOption.UI.CompilerOptionsForm;
|
||||
|
||||
import javax.swing.*;
|
||||
public class CompilerOptionsSet extends DataSet<String, CompilerOption> {
|
||||
public CompilerOptionsSet() {
|
||||
super(String.class, CompilerOption.class);
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new CompilerOptionsForm(this, mountPanel);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption.Json;
|
||||
import _VisualDVM.GlobalData.CompilerOption.CompilerOption;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class OptionJson {
|
||||
@Expose
|
||||
public String name; //в том числе и с разделителем если есть. поиск по startswith
|
||||
@Expose
|
||||
public String value; //значение без кавычек
|
||||
public OptionJson(CompilerOption src) {
|
||||
this(src.name + src.parameterSeparator, src.parameterValue);
|
||||
}
|
||||
public OptionJson(String name_in, String value_in) {
|
||||
name = name_in;
|
||||
value = value_in;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption.Json;
|
||||
import Common.Utils.Utils_;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class OptionsJson {
|
||||
@Expose
|
||||
public List<OptionJson> values = new Vector<>();
|
||||
public String toLine() {
|
||||
Vector<String> res = new Vector<>();
|
||||
for (OptionJson optionJson : values) {
|
||||
res.add(optionJson.name +
|
||||
(optionJson.value.contains(" ") ? Utils_.DQuotes(optionJson.value) : optionJson.value));
|
||||
}
|
||||
return String.join(" ", res);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class OptionsSetJson {
|
||||
@Expose
|
||||
public List<OptionsJson> values = new Vector<>();
|
||||
public OptionsSetJson() {
|
||||
}
|
||||
}
|
||||
14
src/_VisualDVM/GlobalData/CompilerOption/OptionsLine.java
Normal file
14
src/_VisualDVM/GlobalData/CompilerOption/OptionsLine.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
|
||||
public class OptionsLine extends iDBObject {
|
||||
public OptionsJson json;
|
||||
public OptionsLine(OptionsJson json_in) {
|
||||
json = json_in;
|
||||
}
|
||||
@Override
|
||||
public String getBDialogName() {
|
||||
return Utils_.Brackets(json.toLine());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
|
||||
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsSetJson;
|
||||
import _VisualDVM.GlobalData.CompilerOption.UI.OptionsLinesForm;
|
||||
|
||||
import javax.swing.*;
|
||||
public class OptionsLinesSet extends DataSet<Integer, OptionsLine> {
|
||||
public int maxId = 1;
|
||||
public OptionsLinesSet() {
|
||||
super(Integer.class, OptionsLine.class);
|
||||
}
|
||||
public OptionsLinesSet(OptionsSetJson json) {
|
||||
super(Integer.class, OptionsLine.class);
|
||||
for (OptionsJson optionsJson : json.values) {
|
||||
OptionsLine optionsLine = new OptionsLine(optionsJson);
|
||||
optionsLine.id = maxId++;
|
||||
put(optionsLine.id, optionsLine);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "набор опций компиляции";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "наборы опций компиляции";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new OptionsLinesForm(this, mountPanel);
|
||||
}
|
||||
public OptionsSetJson toJson() {
|
||||
OptionsSetJson res = new OptionsSetJson();
|
||||
for (OptionsLine optionsLine : Data.values()) {
|
||||
res.values.add(optionsLine.json);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.GlobalData.CompilerOption.Json.OptionJson;
|
||||
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
|
||||
import _VisualDVM.GlobalData.CompilerOption.UI.CompilerOptionsForm;
|
||||
|
||||
import javax.swing.*;
|
||||
//нужно для опций компиляции получаемых из хелпа
|
||||
public class RawCompilerOptionsSet extends DataSet<String, CompilerOption> {
|
||||
public RawCompilerOptionsSet() {
|
||||
super(String.class, CompilerOption.class);
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new CompilerOptionsForm(this, mountPanel);
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "опции компиляции";
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "опция компиляции";
|
||||
}
|
||||
public CompilerOption findByJson(OptionJson json) {
|
||||
for (CompilerOption compilerOption : Data.values()) {
|
||||
if (json.name.equals(compilerOption.name + compilerOption.parameterSeparator))
|
||||
return compilerOption;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void Reset() {
|
||||
for (CompilerOption option : Data.values()) {
|
||||
option.select(false);
|
||||
option.parameterValue = "";
|
||||
}
|
||||
}
|
||||
public void Synchronize(OptionsJson json) {
|
||||
for (OptionJson option_json : json.values) {
|
||||
// найти опцию по началу
|
||||
CompilerOption compilerOption = findByJson(option_json);
|
||||
if (compilerOption != null) {
|
||||
compilerOption.select(true);
|
||||
compilerOption.parameterValue = option_json.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public class CompilerOptionsForm extends DataSetControlForm<CompilerOption> {
|
||||
new ColumnInfo<CompilerOption>("Параметр") {
|
||||
@Override
|
||||
public Object getFieldAt(CompilerOption object) {
|
||||
return object.parameterName + object.parameterSeparator;
|
||||
return object.parameterName;
|
||||
}
|
||||
@Override
|
||||
public Class getRendererClass() {
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
package _VisualDVM.GlobalData.CompilerOption.UI;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.ColumnInfo;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
|
||||
import _VisualDVM.GlobalData.CompilerOption.OptionsLine;
|
||||
import _VisualDVM.GlobalData.CompilerOption.OptionsLinesSet;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
public class OptionsLinesForm extends DataSetControlForm<OptionsLine> {
|
||||
public OptionsLinesForm(OptionsLinesSet dataSource_in, JPanel mountPanel_in) {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected void createColumns() {
|
||||
AddColumns(new ColumnInfo<OptionsLine>("") {
|
||||
@Override
|
||||
public Object getFieldAt(OptionsLine object) {
|
||||
return object.json.toLine();
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected boolean hasCheckBox() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected boolean isPKVisible() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected DataMenuBar createMenuBar() {
|
||||
DataMenuBar res = super.createMenuBar();
|
||||
res.addPasses(
|
||||
new Pass<OptionsLine>() {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/RedAdd.png";
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Добавление набора опций компиляции";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
|
||||
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent())) {
|
||||
target = new OptionsLine((OptionsJson) pass.target);
|
||||
target.id = ((OptionsLinesSet) dataSource).maxId++;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
dataSource.put(target.getPK(), target);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
dataSource.ShowUI(target.getPK());
|
||||
}
|
||||
},
|
||||
new Pass<OptionsLine>() {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/Edit.png";
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Редактирование набора опций компиляции";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (dataSource.getUI().CheckCurrent(Log)) {
|
||||
target = dataSource.getUI().getCurrent();
|
||||
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
|
||||
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent(), target.json)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
dataSource.ShowUI(target.getPK());
|
||||
}
|
||||
},
|
||||
new Pass<OptionsLine>() {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Удаление набора опций компиляции";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (dataSource.getUI().CheckCurrent(Log)) {
|
||||
target = dataSource.getUI().getCurrent();
|
||||
return dataSource.getUI().ShowDeleteObjectDialog(target);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
dataSource.ClearUI();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
dataSource.Data.remove(target.getPK());
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
dataSource.ShowUI();
|
||||
}
|
||||
}
|
||||
);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package _VisualDVM.GlobalData;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.VisualiserDatabase;
|
||||
import Common.MainModule_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilersDBTable;
|
||||
@@ -98,7 +97,6 @@ public class GlobalDatabase extends VisualiserDatabase {
|
||||
//--
|
||||
//проверить, есть ли профиль с таким же набором настроек.
|
||||
public SapforProfile checkProfileForCurrentSettings() {
|
||||
|
||||
LinkedHashMap<String, String> current_values = Global.mainModule.getProject().sapforProperties.toMap();
|
||||
for (SapforProfile profile : sapforProfiles.Data.values()) {
|
||||
//--получить все настройки профиля
|
||||
@@ -152,9 +150,9 @@ public class GlobalDatabase extends VisualiserDatabase {
|
||||
Insert(profile);
|
||||
insertProfileSettings(profile);
|
||||
}
|
||||
public SapforProfile getDefaultSapforProfile(){
|
||||
for (SapforProfile sapforProfile: sapforProfiles.Data.values()){
|
||||
if (sapforProfile.isAuto!=0)
|
||||
public SapforProfile getDefaultSapforProfile() {
|
||||
for (SapforProfile sapforProfile : sapforProfiles.Data.values()) {
|
||||
if (sapforProfile.isAuto != 0)
|
||||
return sapforProfile;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -8,8 +8,12 @@ public class MachineDialog extends DBObjectDialog<Machine, MachineFields> {
|
||||
super(MachineFields.class);
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 600;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 250;
|
||||
return 350;
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.GlobalData.Machine.UI.MachineFields">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="9" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="500" height="400"/>
|
||||
@@ -10,7 +10,7 @@
|
||||
<children>
|
||||
<component id="1bb3c" class="javax.swing.JTextField" binding="tfName" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -18,12 +18,12 @@
|
||||
</component>
|
||||
<vspacer id="aac20">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="44036" class="javax.swing.JTextField" binding="tfAddress" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -31,13 +31,21 @@
|
||||
</component>
|
||||
<component id="a00bb" class="javax.swing.JSpinner" binding="sPort">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="30"/>
|
||||
<maximum-size width="100" height="30"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="7aab4" class="javax.swing.JComboBox" binding="cbMachineType" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<toolTipText value="выберите тип машины"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="ee3e1" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
@@ -49,7 +57,7 @@
|
||||
</component>
|
||||
<component id="22dab" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
@@ -58,7 +66,7 @@
|
||||
</component>
|
||||
<component id="2dde3" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
@@ -67,21 +75,13 @@
|
||||
</component>
|
||||
<component id="9d873" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="тип"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="7aab4" class="javax.swing.JComboBox" binding="cbMachineType" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<toolTipText value="выберите тип машины"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -33,8 +33,8 @@ public class MachineFields implements DialogFields {
|
||||
//-
|
||||
cbMachineType = new JComboBox<>();
|
||||
cbMachineType.addItem(MachineType.Server);
|
||||
// cbMachineType.addItem(MachineType.MVS_cluster);
|
||||
// cbMachineType.addItem(MachineType.Local);
|
||||
// cbMachineType.addItem(MachineType.MVS_cluster);
|
||||
// cbMachineType.addItem(MachineType.Local);
|
||||
}
|
||||
@Override
|
||||
public Component getContent() {
|
||||
|
||||
@@ -24,7 +24,7 @@ public class MachinesForm extends DataSetControlForm<Machine> {
|
||||
return object.name;
|
||||
}
|
||||
},
|
||||
new ColumnInfo<Machine>("URL") {
|
||||
new ColumnInfo<Machine>("URL") {
|
||||
@Override
|
||||
public Object getFieldAt(Machine object) {
|
||||
return object.getURL();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.GlobalData.Makefile.UI;
|
||||
import Common.Visual.Editor.Viewer;
|
||||
import Common.Visual.Windows.Dialog.Text.TextDialog;
|
||||
import _VisualDVM.Visual.Editor.Viewer;
|
||||
public class MakefilePreviewForm extends TextDialog<Viewer> {
|
||||
public MakefilePreviewForm() {
|
||||
super(Viewer.class);
|
||||
|
||||
@@ -6,6 +6,7 @@ import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
import _VisualDVM.GlobalData.Module.Module;
|
||||
@@ -39,9 +40,9 @@ public class ModuleAnchestorFields implements DialogFields {
|
||||
BPickOptions.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass<String> pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
|
||||
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
|
||||
if (pass.Do(compiler)) {
|
||||
UI.TrySelect(cbFlags, pass.target);
|
||||
UI.TrySelect(cbFlags, ((OptionsJson) pass.target).toLine());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -59,7 +60,7 @@ public class ModuleAnchestorFields implements DialogFields {
|
||||
((Module) target).language;
|
||||
cbCompilers.addActionListener(e -> {
|
||||
if (cbCompilers.getSelectedItem() instanceof Compiler) {
|
||||
Compiler compiler = ((Compiler) cbCompilers.getSelectedItem());
|
||||
Compiler compiler = ((Compiler) cbCompilers.getSelectedItem());
|
||||
UI.TrySelect(cbCommands,
|
||||
linker ? compiler.getSpecialLinkCommand(languageName) : compiler.getSpecialCompilationCommand(languageName));
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ public abstract class LinuxLocalTaskSupervisor<T extends Task> extends LocalTask
|
||||
@Override
|
||||
public void WaitForTask() throws Exception {
|
||||
if (isTaskActive()) {
|
||||
// if (task.PID.isEmpty())
|
||||
// throw new PassException("Ошибка при старте : идентификатор задачи не определен.");
|
||||
// if (task.PID.isEmpty())
|
||||
// throw new PassException("Ошибка при старте : идентификатор задачи не определен.");
|
||||
task.StartDate = (new Date()).getTime();
|
||||
pass.ShowMessage1("Задача активна, идентификатор " + Utils_.Brackets(task.PID));
|
||||
RefreshProgress();
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ServerRunSupervisor extends RemoteTaskSupervisor<RunTask> {
|
||||
String env = String.join(" ", MainModule_.instance.getDb().getTable(RunConfiguration.class).getUI().getCurrent().getEnvList());
|
||||
if (!env.isEmpty()) res = env + " " + res;
|
||||
//--
|
||||
// task.PID =
|
||||
// task.PID =
|
||||
pass.user.connection.startShellProcess(getRemoteProject(), "PID", res);
|
||||
task.state = TaskState.Running;
|
||||
}
|
||||
|
||||
@@ -113,8 +113,8 @@ public abstract class TaskSupervisor<T extends Task, P extends Pass> {
|
||||
}
|
||||
public void WaitForTask() throws Exception {
|
||||
if (isTaskActive()) {
|
||||
// if (task.PID.isEmpty())
|
||||
// throw new PassException("Ошибка при старте : идентификатор задачи не определен.");
|
||||
// if (task.PID.isEmpty())
|
||||
// throw new PassException("Ошибка при старте : идентификатор задачи не определен.");
|
||||
task.StartDate = (new Date()).getTime();
|
||||
pass.ShowMessage1("Задача активна");//, идентификатор " + Utils_.Brackets(task.PID));
|
||||
RefreshProgress();
|
||||
|
||||
@@ -14,10 +14,12 @@ public enum TaskState implements StatusEnum {
|
||||
//-----------------------
|
||||
Finished,
|
||||
//--- результирующие
|
||||
Crushed,
|
||||
NaN,
|
||||
DoneWithErrors,
|
||||
DoneWithDiffs,
|
||||
AbortedByTimeout,
|
||||
AbortedByUser,
|
||||
Crushed,
|
||||
WrongTestFormat,
|
||||
InternalError,
|
||||
Done,
|
||||
@@ -38,6 +40,8 @@ public enum TaskState implements StatusEnum {
|
||||
case WrongTestFormat:
|
||||
case InternalError:
|
||||
case Crushed:
|
||||
case DoneWithDiffs:
|
||||
case NaN:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -45,6 +49,8 @@ public enum TaskState implements StatusEnum {
|
||||
}
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case NaN:
|
||||
return "NaN";
|
||||
case Waiting:
|
||||
return "ожидание";
|
||||
case WorkspaceCreated:
|
||||
@@ -63,6 +69,8 @@ public enum TaskState implements StatusEnum {
|
||||
return "прервана";
|
||||
case Done:
|
||||
return "успешно";
|
||||
case DoneWithDiffs:
|
||||
return "различия";
|
||||
case DoneWithErrors:
|
||||
return "с ошибками";
|
||||
case Crushed:
|
||||
@@ -99,6 +107,8 @@ public enum TaskState implements StatusEnum {
|
||||
case WrongTestFormat:
|
||||
case InternalError:
|
||||
case Canceled:
|
||||
case DoneWithDiffs:
|
||||
case NaN:
|
||||
return VisualiserFonts.BadState;
|
||||
case Queued:
|
||||
case Running:
|
||||
@@ -136,6 +146,7 @@ public enum TaskState implements StatusEnum {
|
||||
public boolean isComplete() {
|
||||
switch (this) {
|
||||
case Done:
|
||||
case DoneWithDiffs:
|
||||
case DoneWithErrors:
|
||||
case AbortedByTimeout:
|
||||
case AbortedByUser:
|
||||
@@ -143,6 +154,7 @@ public enum TaskState implements StatusEnum {
|
||||
case Crushed:
|
||||
case InternalError:
|
||||
case Canceled:
|
||||
case NaN:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@@ -36,7 +36,11 @@ public class UserDialog extends DBObjectDialog<User, UserFields> {
|
||||
Result.password = new String(fields.tfPassword.getPassword());
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 600;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 250;
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.GlobalData.User.UI.UserFields">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="7" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="500" height="400"/>
|
||||
@@ -10,7 +10,7 @@
|
||||
<children>
|
||||
<component id="374e0" class="javax.swing.JTextField" binding="tfLogin" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -18,21 +18,12 @@
|
||||
</component>
|
||||
<vspacer id="9bcf9">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="33ebe" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="логин"/>
|
||||
</properties>
|
||||
</component>
|
||||
<tabbedpane id="936e5" binding="AuthenticationTabs">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="-1" height="80"/>
|
||||
<preferred-size width="200" height="80"/>
|
||||
<maximum-size width="-1" height="80"/>
|
||||
@@ -75,15 +66,36 @@
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<properties>
|
||||
<editable value="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</tabbedpane>
|
||||
<component id="e064b" class="javax.swing.JTextField" binding="tfWorkspace" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="33ebe" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="логин"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="be99c" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
@@ -92,23 +104,13 @@
|
||||
<verticalTextPosition value="0"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="e064b" class="javax.swing.JTextField" binding="tfWorkspace" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<editable value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="7bee1" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<font name="Times New Roman" size="16" style="2"/>
|
||||
<text value="папка"/>
|
||||
<text value="раб.пространство"/>
|
||||
<toolTipText value="рабочая папка визуализатора"/>
|
||||
</properties>
|
||||
</component>
|
||||
|
||||
@@ -16,6 +16,8 @@ public class UserFields implements DialogFields {
|
||||
public JPanel PasswordTab;
|
||||
public JPasswordField tfPassword;
|
||||
public JTextField tfWorkspace;
|
||||
public JTextField tfRoot;
|
||||
public JButton bBrowse;
|
||||
char mask;
|
||||
char unmask = (char) 0;
|
||||
boolean password_visible = false;
|
||||
@@ -30,6 +32,22 @@ public class UserFields implements DialogFields {
|
||||
bPasswordVisibility.setIcon(Utils_.getIcon("/icons/" + (password_visible ? "Show" : "Hide") + "Password.png"));
|
||||
}
|
||||
});
|
||||
/*
|
||||
bBrowse.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String dst;
|
||||
if (Global.mainModule.getPass(PassCode.SelectRemoteFile).Do(true)) {
|
||||
String root= Global.mainModule.getRemoteFile().full_name;
|
||||
tfRoot.setText(root);
|
||||
if (!tfWorkspace.getText().isEmpty()){
|
||||
RemoteFile workspace=new RemoteFile(tfWorkspace.getText(), true);
|
||||
tfWorkspace.setText(root+"/"+workspace.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
public Component getContent() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user