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/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/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/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>
|
</root>
|
||||||
</artifact>
|
</artifact>
|
||||||
</component>
|
</component>
|
||||||
25
.idea/workspace.xml
generated
25
.idea/workspace.xml
generated
@@ -7,13 +7,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<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$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" 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" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -52,9 +46,9 @@
|
|||||||
</file-type-list>
|
</file-type-list>
|
||||||
</component>
|
</component>
|
||||||
<component name="HighlightingSettingsPerFile">
|
<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/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/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" />
|
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" root0="FORCE_HIGHLIGHTING" />
|
||||||
</component>
|
</component>
|
||||||
<component name="KotlinCodeInsightWorkspaceSettings">
|
<component name="KotlinCodeInsightWorkspaceSettings">
|
||||||
@@ -64,7 +58,7 @@
|
|||||||
<option name="stateVersion" value="1" />
|
<option name="stateVersion" value="1" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProblemsViewState">
|
<component name="ProblemsViewState">
|
||||||
<option name="selectedTabId" value="ProjectErrors" />
|
<option name="selectedTabId" value="CurrentFile" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectId" id="1UqWSAGBQQNofrCLxSPPtOZrGP7" />
|
<component name="ProjectId" id="1UqWSAGBQQNofrCLxSPPtOZrGP7" />
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||||
@@ -83,6 +77,7 @@
|
|||||||
<property name="JavaClassFindUsagesOptions.isDerivedClasses" value="true" />
|
<property name="JavaClassFindUsagesOptions.isDerivedClasses" value="true" />
|
||||||
<property name="JavaClassFindUsagesOptions.isFieldsUsages" value="true" />
|
<property name="JavaClassFindUsagesOptions.isFieldsUsages" value="true" />
|
||||||
<property name="JavaClassFindUsagesOptions.isMethodsUsages" value="true" />
|
<property name="JavaClassFindUsagesOptions.isMethodsUsages" value="true" />
|
||||||
|
<property name="OverrideImplement.combined" value="false" />
|
||||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||||
<property name="SHARE_PROJECT_CONFIGURATION_FILES" 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.SHOW" value="true" />
|
||||||
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" />
|
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" />
|
||||||
<property name="extract.method.default.visibility" value="public" />
|
<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="last_opened_file_path" value="$PROJECT_DIR$/src" />
|
||||||
<property name="project.structure.last.edited" value="Libraries" />
|
<property name="project.structure.last.edited" value="Artifacts" />
|
||||||
<property name="project.structure.proportion" value="0.15" />
|
<property name="project.structure.proportion" value="0.15" />
|
||||||
<property name="project.structure.side.proportion" value="0.27322906" />
|
<property name="project.structure.side.proportion" value="0.27322906" />
|
||||||
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
|
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
|
||||||
@@ -105,18 +100,18 @@
|
|||||||
<recent name="controls.Trees" />
|
<recent name="controls.Trees" />
|
||||||
</key>
|
</key>
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<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\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\icons\Transformations" />
|
||||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\Common\icons" />
|
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\DVM\DVMTasks\UI" />
|
||||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" />
|
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveMembersDialog.RECENTS_KEY">
|
<key name="MoveMembersDialog.RECENTS_KEY">
|
||||||
|
<recent name="_VisualDVM.ComponentsServer.Component.Sapfor.Sapfor" />
|
||||||
<recent name="_VisualDVM.Constants" />
|
<recent name="_VisualDVM.Constants" />
|
||||||
<recent name="_VisualDVM.Global" />
|
<recent name="_VisualDVM.Global" />
|
||||||
<recent name="_VisualDVM.ProjectData.SapforData.Arrays.UI.ProjectArraysForm" />
|
<recent name="_VisualDVM.ProjectData.SapforData.Arrays.UI.ProjectArraysForm" />
|
||||||
<recent name="_VisualDVM.TestingSystem.SAPFOR.SapforPackage.UI.SapforPackagesForm" />
|
<recent name="_VisualDVM.TestingSystem.SAPFOR.SapforPackage.UI.SapforPackagesForm" />
|
||||||
<recent name="_VisualDVM.TestingSystem.DVM.DVMPackage.UI.DVMPackagesForm" />
|
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\SAPFOR\SapforSettingsCommand\UI" />
|
<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",
|
"ServerUserPassword": "mprit_2011",
|
||||||
"OfferRegistrationOnStart": true,
|
"OfferRegistrationOnStart": true,
|
||||||
"Workspace": "E:\\Tests",
|
"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",
|
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
||||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"AutoTestsLoad": true,
|
"AutoTestsLoad": true,
|
||||||
"ConfirmPassesStart": true,
|
"ConfirmPassesStart": true,
|
||||||
"ShowPassesDone": true,
|
"ShowPassesDone": true,
|
||||||
"FocusPassesResult": true,
|
"FocusPassesResult": false,
|
||||||
"collapseCredentials": true,
|
"collapseCredentials": true,
|
||||||
"collapseFileGraphs": false,
|
"collapseFileGraphs": false,
|
||||||
"collapseFileMessages": false,
|
"collapseFileMessages": false,
|
||||||
@@ -26,8 +26,12 @@
|
|||||||
"Kernels": 8,
|
"Kernels": 8,
|
||||||
"LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe",
|
"LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe",
|
||||||
"CheckTestingIntervalSeconds": 10,
|
"CheckTestingIntervalSeconds": 10,
|
||||||
"AutoCheckTesting": false,
|
"AutoCheckTesting": true,
|
||||||
"EmailOnTestingProgress": true,
|
"EmailOnTestingProgress": true,
|
||||||
|
"CompleteCompilationOptions": true,
|
||||||
|
"CompleteRunEnvironments": true,
|
||||||
|
"CreateEthalonTasks": true,
|
||||||
|
"ErasePackageWorkspace": true,
|
||||||
"lastMachineId": 13,
|
"lastMachineId": 13,
|
||||||
"lastUserId": 34,
|
"lastUserId": 34,
|
||||||
"lastCompilerId": 52,
|
"lastCompilerId": 52,
|
||||||
@@ -37,7 +41,7 @@
|
|||||||
"FortranWrapsOn": false,
|
"FortranWrapsOn": false,
|
||||||
"ExtensionsOn": false,
|
"ExtensionsOn": false,
|
||||||
"ComparsionDiffMergeOn": true,
|
"ComparsionDiffMergeOn": true,
|
||||||
"ShowFullArraysDeclarations": false,
|
"ShowFullArraysDeclarations": true,
|
||||||
"ShowFullTabsNames": true,
|
"ShowFullTabsNames": true,
|
||||||
"SmallScreen": false,
|
"SmallScreen": false,
|
||||||
"BugReportsAgeLimit": 1,
|
"BugReportsAgeLimit": 1,
|
||||||
|
|||||||
@@ -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) {
|
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);
|
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) {
|
public <O extends DBObject, F extends DBObject> Vector<String> getVectorStringByFK(O owner, Class<F> fk_class) {
|
||||||
Vector<String> res = new Vector<>();
|
Vector<String> res = new Vector<>();
|
||||||
@@ -318,6 +332,21 @@ public abstract class Database {
|
|||||||
prepareTablesStatements();
|
prepareTablesStatements();
|
||||||
Synchronize();
|
Synchronize();
|
||||||
}
|
}
|
||||||
|
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() {
|
public void DropUI() {
|
||||||
SaveLastSelections();
|
SaveLastSelections();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ public abstract class nDBObject extends DBObject {
|
|||||||
public Object getEmptyFK() {
|
public Object getEmptyFK() {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
public String getFKName() {
|
||||||
|
return getClass().getSimpleName().toLowerCase() + "_id";
|
||||||
|
}
|
||||||
public void genName() {
|
public void genName() {
|
||||||
id = Utils_.getDateName(getClass().getSimpleName().toLowerCase());
|
id = Utils_.getDateName(getClass().getSimpleName().toLowerCase());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import Common.Database.Objects.DBObject;
|
|||||||
import Common.Database.Tables.DBTable;
|
import Common.Database.Tables.DBTable;
|
||||||
import Common.Database.Tables.DBTableColumn;
|
import Common.Database.Tables.DBTableColumn;
|
||||||
import Common.Passes.PassException;
|
import Common.Passes.PassException;
|
||||||
|
import Common.Utils.Pair;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
import javafx.util.Pair;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
@@ -255,5 +255,4 @@ public abstract class SQLiteDatabase extends Database {
|
|||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
//https://stackoverflow.com/questions/8558099/sqlite-query-with-byte-where-clause
|
//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 Common.Database.Objects.DBObject;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.Vector;
|
||||||
public abstract class DBTable<K, D extends DBObject> extends DataSet<K, D> {
|
public abstract class DBTable<K, D extends DBObject> extends DataSet<K, D> {
|
||||||
//-
|
//-
|
||||||
public DBTableColumn PK = null;
|
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");
|
res.append(c).append("\n");
|
||||||
return res.toString();
|
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) {
|
public boolean containsKey(Object key) {
|
||||||
return Data.containsKey(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
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
getDb().Delete(target);
|
getDb().Delete(target);
|
||||||
for (Class dep : getTable().getFKDependencies().keySet()) {
|
getDb().DeleteDependencies(target);
|
||||||
switch (getTable().getFKDependencies().get(dep).data) {
|
|
||||||
case NONE:
|
|
||||||
break;
|
|
||||||
case DROP:
|
|
||||||
getDb().DropByFK(target, dep);
|
|
||||||
break;
|
|
||||||
case DELETE:
|
|
||||||
getDb().DeleteByFK(target, dep);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//тут именно на финише, чтобы в любом случае вся таблица всегда была видна.
|
//тут именно на финише, чтобы в любом случае вся таблица всегда была видна.
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,10 +22,6 @@ public class Pass<T> {
|
|||||||
//--------------
|
//--------------
|
||||||
public boolean ui_visible = true;
|
public boolean ui_visible = true;
|
||||||
public Vector<PassControl> controls = new Vector<>();
|
public Vector<PassControl> controls = new Vector<>();
|
||||||
public void addControl(PassControl control_in){
|
|
||||||
control_in.setVisible(ui_visible);
|
|
||||||
controls.add(control_in);
|
|
||||||
}
|
|
||||||
public TextLog Log; //внутренний журнал прохода.
|
public TextLog Log; //внутренний журнал прохода.
|
||||||
protected boolean interrupt;
|
protected boolean interrupt;
|
||||||
protected SwingWorker dispatcher = null;
|
protected SwingWorker dispatcher = null;
|
||||||
@@ -34,6 +30,10 @@ public class Pass<T> {
|
|||||||
private JButton button = null;
|
private JButton button = null;
|
||||||
private JButton tabButton = null;
|
private JButton tabButton = null;
|
||||||
private Exception last_error; //последнее пойманное исключение выполнения.
|
private Exception last_error; //последнее пойманное исключение выполнения.
|
||||||
|
public void addControl(PassControl control_in) {
|
||||||
|
control_in.setVisible(ui_visible);
|
||||||
|
controls.add(control_in);
|
||||||
|
}
|
||||||
//->>
|
//->>
|
||||||
public Throwable getCauseRec(Throwable ex) {
|
public Throwable getCauseRec(Throwable ex) {
|
||||||
Throwable cause = ex.getCause();
|
Throwable cause = ex.getCause();
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ import java.util.LinkedHashMap;
|
|||||||
public class Properties {
|
public class Properties {
|
||||||
protected LinkedHashMap<String, JMenuItem> controls = new LinkedHashMap<>();
|
protected LinkedHashMap<String, JMenuItem> controls = new LinkedHashMap<>();
|
||||||
private File file = null; //файл где хранятся настройки.
|
private File file = null; //файл где хранятся настройки.
|
||||||
|
public Properties() {
|
||||||
|
}
|
||||||
|
public Properties(File file_in) {
|
||||||
|
setFile(file_in);
|
||||||
|
}
|
||||||
public File getFile() {
|
public File getFile() {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
@@ -24,11 +29,6 @@ public class Properties {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public Properties() {
|
|
||||||
}
|
|
||||||
public Properties(File file_in) {
|
|
||||||
setFile(file_in);
|
|
||||||
}
|
|
||||||
public boolean updateField(String name, Object newValue) {
|
public boolean updateField(String name, Object newValue) {
|
||||||
try {
|
try {
|
||||||
Field field = getClass().getField(name);
|
Field field = getClass().getField(name);
|
||||||
|
|||||||
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;
|
package Common.Utils;
|
||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
import _VisualDVM.Visual.Windows.ReadOnlyMultilineTextForm;
|
import Common.Visual.Windows.ReadOnlyMultilineTextForm;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
@@ -35,8 +35,8 @@ public interface Loggable {
|
|||||||
ex.printStackTrace(writer);
|
ex.printStackTrace(writer);
|
||||||
writer.flush();
|
writer.flush();
|
||||||
Print(out.toString());
|
Print(out.toString());
|
||||||
Utils_.CopyToClipboard(out.toString());
|
|
||||||
if (UI.isActive()) {
|
if (UI.isActive()) {
|
||||||
|
Utils_.CopyToClipboard(out.toString());
|
||||||
ReadOnlyMultilineTextForm ff = new ReadOnlyMultilineTextForm();
|
ReadOnlyMultilineTextForm ff = new ReadOnlyMultilineTextForm();
|
||||||
ff.ShowDialog("Возникло исключение", out.toString());
|
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.CommonConstants;
|
||||||
import Common.Database.Objects.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Database.Objects.Grid.TableVisualData;
|
import Common.Database.Objects.Grid.TableVisualData;
|
||||||
import Common.Database.Objects.riDBObject;
|
|
||||||
import Common.Database.Tables.DBTable;
|
import Common.Database.Tables.DBTable;
|
||||||
import Common.Database.Tables.DataSet;
|
import Common.Database.Tables.DataSet;
|
||||||
import Common.Database.Tables.FKBehaviour;
|
import Common.Database.Tables.FKBehaviour;
|
||||||
@@ -15,7 +14,6 @@ import Common.Visual.Menus.TableMenu;
|
|||||||
import Common.Visual.Tables.*;
|
import Common.Visual.Tables.*;
|
||||||
import Common.Visual.Tables.Grid.GridAnchestor;
|
import Common.Visual.Tables.Grid.GridAnchestor;
|
||||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||||
import _VisualDVM.Global;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
@@ -42,7 +40,6 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
|
|||||||
//--
|
//--
|
||||||
Object savedCurrentKey = null;
|
Object savedCurrentKey = null;
|
||||||
Vector<Object> savedSelectedKeys = new Vector<>();
|
Vector<Object> savedSelectedKeys = new Vector<>();
|
||||||
//--
|
|
||||||
public DataSetControlForm(DataSet<?, D> dataSource_in, JPanel mountPanel_in) {
|
public DataSetControlForm(DataSet<?, D> dataSource_in, JPanel mountPanel_in) {
|
||||||
super(DataTable.class, mountPanel_in);
|
super(DataTable.class, mountPanel_in);
|
||||||
dataSource = dataSource_in;
|
dataSource = dataSource_in;
|
||||||
@@ -83,6 +80,10 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//--
|
||||||
|
public DataMenuBar getMenuBar() {
|
||||||
|
return bar;
|
||||||
|
}
|
||||||
protected boolean isPKVisible() {
|
protected boolean isPKVisible() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -577,9 +578,14 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
|
|||||||
public Object getCurrentPK(Object nanValue) {
|
public Object getCurrentPK(Object nanValue) {
|
||||||
return current == null ? nanValue : current.getPK();
|
return current == null ? nanValue : current.getPK();
|
||||||
}
|
}
|
||||||
//todo временное решение ? ->>>
|
|
||||||
public boolean canModifyCurrent(TextLog Log) {
|
public boolean canModifyCurrent(TextLog Log) {
|
||||||
return CheckCurrent(Log) && (
|
return CheckCurrent(Log);
|
||||||
!(current instanceof riDBObject) || Global.mainModule.getAccount().CheckAuthorship(((riDBObject)current).sender_address,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.MainModule_;
|
||||||
|
import Common.Utils.Pair;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.Menus.StyledPopupMenu;
|
import Common.Visual.Menus.StyledPopupMenu;
|
||||||
import Common.Visual.Menus.TextEditorMenu;
|
import Common.Visual.Menus.TextEditorMenu;
|
||||||
import Common.Visual.Themes.ThemeElement;
|
import Common.Visual.Themes.ThemeElement;
|
||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
import Common.Visual.Windows.Dialog.DialogFields;
|
import Common.Visual.Windows.Dialog.DialogFields;
|
||||||
|
import _VisualDVM.Utils;
|
||||||
import _VisualDVM.Visual.Syntax.SPFEditorTheme;
|
import _VisualDVM.Visual.Syntax.SPFEditorTheme;
|
||||||
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
|
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
|
||||||
|
|
||||||
@@ -15,8 +17,9 @@ import java.awt.*;
|
|||||||
import java.awt.event.KeyAdapter;
|
import java.awt.event.KeyAdapter;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
import java.util.Vector;
|
||||||
public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogFields {
|
public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogFields {
|
||||||
private final StyledPopupMenu menu;
|
protected final StyledPopupMenu menu;
|
||||||
// protected int changesCount = 0;
|
// protected int changesCount = 0;
|
||||||
// protected int insertsCount = 0;
|
// protected int insertsCount = 0;
|
||||||
// protected int removesCount = 0;
|
// protected int removesCount = 0;
|
||||||
@@ -128,14 +131,6 @@ public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogF
|
|||||||
changeFont(getFont().getSize() - 1);
|
changeFont(getFont().getSize() - 1);
|
||||||
}
|
}
|
||||||
@Override
|
@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() {
|
public Component getContent() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -152,4 +147,29 @@ public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogF
|
|||||||
}
|
}
|
||||||
return res;
|
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 class Viewer extends BaseEditor {
|
||||||
public Viewer() {
|
public Viewer() {
|
||||||
setLineWrap(true);
|
setLineWrap(true);
|
||||||
@@ -8,12 +8,12 @@ import java.awt.*;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
public class DataMenuBar extends VisualiserMenuBar {
|
public class DataMenuBar extends VisualiserMenuBar {
|
||||||
public JLabel countLabel = null;
|
public JLabel countLabel = null;
|
||||||
private DataSet dataSource = null;
|
|
||||||
//-
|
//-
|
||||||
public ActionListener selectAllListener = null;
|
public ActionListener selectAllListener = null;
|
||||||
public ActionListener unselectAllListener = null;
|
public ActionListener unselectAllListener = null;
|
||||||
JButton selectAllButton = null;
|
JButton selectAllButton = null;
|
||||||
JButton unselectAllButton = null;
|
JButton unselectAllButton = null;
|
||||||
|
private DataSet dataSource = null;
|
||||||
//-
|
//-
|
||||||
public DataMenuBar(String dataName, PassCode_... passes) {
|
public DataMenuBar(String dataName, PassCode_... passes) {
|
||||||
add(new JLabel(dataName + " : "));
|
add(new JLabel(dataName + " : "));
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ public class TableMenu extends StyledPopupMenu {
|
|||||||
//
|
//
|
||||||
add(value_scroll = new JScrollPane(value_view = new JTextArea()));
|
add(value_scroll = new JScrollPane(value_view = new JTextArea()));
|
||||||
value_view.setEditable(false);
|
value_view.setEditable(false);
|
||||||
value_view.setLineWrap(true);
|
//value_view.setLineWrap(true);
|
||||||
value_view.setWrapStyleWord(true);
|
//value_view.setWrapStyleWord(true);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void CheckElementsVisibility() {
|
public void CheckElementsVisibility() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package Common.Visual.Menus;
|
package Common.Visual.Menus;
|
||||||
import Common.MainModule_;
|
import Common.MainModule_;
|
||||||
|
import Common.Passes.Pass;
|
||||||
import Common.Passes.PassCode_;
|
import Common.Passes.PassCode_;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.Fonts.VisualiserFonts;
|
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) {
|
public JMenuBar addMenus(JMenu... menus) {
|
||||||
JMenuBar bar = new JMenuBar() {
|
JMenuBar bar = new JMenuBar() {
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,18 +18,28 @@ public class HeaderTextFilter<D extends DBObject> implements DBObjectFilter_<D>
|
|||||||
int columnIndex = CommonConstants.Nan; //номер столбца к которому привязан фильтр.
|
int columnIndex = CommonConstants.Nan; //номер столбца к которому привязан фильтр.
|
||||||
JTextField textField = null;
|
JTextField textField = null;
|
||||||
JPopupMenu popup = null;
|
JPopupMenu popup = null;
|
||||||
|
boolean contains = true;
|
||||||
private String filterValue = "";
|
private String filterValue = "";
|
||||||
private int offset = 0;
|
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;
|
dataSet = dataSet_in;
|
||||||
columnIndex = columnIndex_in;
|
columnIndex = columnIndex_in;
|
||||||
offset = offset_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
|
@Override
|
||||||
public boolean Validate(D object) {
|
public boolean Validate(D object) {
|
||||||
Object field = dataSet.getUI().getColumnInfo(columnIndex).getFieldAt(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) {
|
public void Mount(DataTable control) {
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package Common.Visual.Tables;
|
package Common.Visual.Tables;
|
||||||
import Common.MainModule_;
|
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.Fonts.VisualiserFonts;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.util.Date;
|
|
||||||
public class RendererMilliseconds extends RendererCell<Long> {
|
public class RendererMilliseconds extends RendererCell<Long> {
|
||||||
@Override
|
@Override
|
||||||
public Long Init(JTable table, Object value, int row, int column) {
|
public Long Init(JTable table, Object value, int row, int column) {
|
||||||
|
|||||||
@@ -4,5 +4,7 @@ public interface ThemeElement {
|
|||||||
}
|
}
|
||||||
default void FontDown() {
|
default void FontDown() {
|
||||||
}
|
}
|
||||||
void applyTheme();
|
default void applyTheme() {
|
||||||
|
}
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,12 +59,10 @@ public class UI {
|
|||||||
return Question(MainModule_.instance.getUI().getFrontWindow(), text);
|
return Question(MainModule_.instance.getUI().getFrontWindow(), text);
|
||||||
}
|
}
|
||||||
public static void Info(String message) {
|
public static void Info(String message) {
|
||||||
Utils_.CopyToClipboard(message);
|
|
||||||
if (UI.isActive())
|
if (UI.isActive())
|
||||||
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 1);
|
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 1);
|
||||||
}
|
}
|
||||||
public static void Error(String message) {
|
public static void Error(String message) {
|
||||||
Utils_.CopyToClipboard(message);
|
|
||||||
if (UI.isActive())
|
if (UI.isActive())
|
||||||
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 0);
|
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,6 @@ public class ComboTextDialog extends Dialog<String, DialogTextComboBox> {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int getDefaultHeight() {
|
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 Common.Visual.Windows.Dialog.Text.TextDialog;
|
||||||
import _VisualDVM.Visual.Editor.BaseEditor;
|
|
||||||
public class MultilineTextForm extends TextDialog<BaseEditor> {
|
public class MultilineTextForm extends TextDialog<BaseEditor> {
|
||||||
public MultilineTextForm() {
|
public MultilineTextForm() {
|
||||||
super(BaseEditor.class);
|
super(BaseEditor.class);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package _VisualDVM.Visual.Windows;
|
package Common.Visual.Windows;
|
||||||
public class ReadOnlyMultilineTextForm extends MultilineTextForm {
|
public class ReadOnlyMultilineTextForm extends MultilineTextForm {
|
||||||
public ReadOnlyMultilineTextForm() {
|
public ReadOnlyMultilineTextForm() {
|
||||||
}
|
}
|
||||||
@@ -4,11 +4,9 @@ import Common.Database.Objects.rDBObject;
|
|||||||
import Common.Utils.TextLog;
|
import Common.Utils.TextLog;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Utils.Vector_;
|
import Common.Utils.Vector_;
|
||||||
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientJson;
|
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||||
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientsJson;
|
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||||
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
|
|
||||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||||
import _VisualDVM.ComponentsServer.Recipient.Recipient;
|
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
@@ -24,10 +22,8 @@ public class BugReport extends rDBObject {
|
|||||||
public long visualiser_version = -1;
|
public long visualiser_version = -1;
|
||||||
public long sapfor_version = -1;
|
public long sapfor_version = -1;
|
||||||
public String comment = "";
|
public String comment = "";
|
||||||
@Description("DEFAULT ''")
|
public Vector<BugReportSetting> settings = null;
|
||||||
public String packedRecipientsJson = "";
|
public Vector<BugReportRecipient> recipients = null;
|
||||||
@Description("DEFAULT ''")
|
|
||||||
public String packedSettingsJson = ""; //устарело. (?)
|
|
||||||
public String executor = "";
|
public String executor = "";
|
||||||
@Description("DEFAULT ''")
|
@Description("DEFAULT ''")
|
||||||
public String executor_address = "";
|
public String executor_address = "";
|
||||||
@@ -54,7 +50,7 @@ public class BugReport extends rDBObject {
|
|||||||
project_version = version_in;
|
project_version = version_in;
|
||||||
visualiser_version = Global.visualiser.version;
|
visualiser_version = Global.visualiser.version;
|
||||||
sapfor_version = Global.components.get(ComponentType.Sapfor_F).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;
|
percentage = 0;
|
||||||
description = description_in;
|
description = description_in;
|
||||||
date = new Date().getTime();
|
date = new Date().getTime();
|
||||||
@@ -69,7 +65,6 @@ public class BugReport extends rDBObject {
|
|||||||
change_date = b.change_date;
|
change_date = b.change_date;
|
||||||
description = b.description;
|
description = b.description;
|
||||||
comment = b.comment;
|
comment = b.comment;
|
||||||
packedRecipientsJson = b.packedRecipientsJson;
|
|
||||||
state = b.state;
|
state = b.state;
|
||||||
percentage = b.percentage;
|
percentage = b.percentage;
|
||||||
//-
|
//-
|
||||||
@@ -78,8 +73,6 @@ public class BugReport extends rDBObject {
|
|||||||
project_version = b.project_version;
|
project_version = b.project_version;
|
||||||
visualiser_version = b.visualiser_version;
|
visualiser_version = b.visualiser_version;
|
||||||
sapfor_version = b.sapfor_version;
|
sapfor_version = b.sapfor_version;
|
||||||
packedSettingsJson = b.packedSettingsJson;
|
|
||||||
//-
|
|
||||||
descriptionAdditionDraft = b.descriptionAdditionDraft;
|
descriptionAdditionDraft = b.descriptionAdditionDraft;
|
||||||
commentAdditionDraft = b.commentAdditionDraft;
|
commentAdditionDraft = b.commentAdditionDraft;
|
||||||
owner = b.owner;
|
owner = b.owner;
|
||||||
@@ -132,13 +125,12 @@ public class BugReport extends rDBObject {
|
|||||||
"Версия визуализатора: " + visualiser_version,
|
"Версия визуализатора: " + visualiser_version,
|
||||||
"----------------------------------"
|
"----------------------------------"
|
||||||
);
|
);
|
||||||
if (!project_version.isEmpty()) {
|
//--
|
||||||
if (visualiser_version < 1134) {
|
Vector<BugReportSetting> settings_ = Global.componentsServer.db.getVectorByFK(this, BugReportSetting.class);
|
||||||
res.add(getSettingsJson().getSummary());
|
SapforProperties dummy = new SapforProperties();
|
||||||
} else {
|
for (BugReportSetting bugReportSetting : settings_)
|
||||||
res.add(getPropertiesJson().getSummary());
|
res.add(dummy.getFieldDescription(bugReportSetting.name) + "=" + Utils_.DQuotes(bugReportSetting.value));
|
||||||
}
|
//--
|
||||||
}
|
|
||||||
return String.join("\n", res);
|
return String.join("\n", res);
|
||||||
}
|
}
|
||||||
public String getPassport() {
|
public String getPassport() {
|
||||||
@@ -155,29 +147,16 @@ public class BugReport extends rDBObject {
|
|||||||
return project_version.isEmpty();
|
return project_version.isEmpty();
|
||||||
}
|
}
|
||||||
//--->
|
//--->
|
||||||
|
|
||||||
public void CheckRecipients() {
|
public void CheckRecipients() {
|
||||||
for (Recipient recipient : Global.componentsServer.db.recipients.Data.values())
|
Global.componentsServer.db.recipients.getUI().SelectAll(false);
|
||||||
recipient.Select(packedRecipientsJson.contains(recipient.email));
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
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) {
|
public boolean canAppend(UserAccount account, TextLog log) {
|
||||||
if (account.CheckRegistered(log)) {
|
if (account.CheckRegistered(log)) {
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
package _VisualDVM.ComponentsServer.BugReport;
|
package _VisualDVM.ComponentsServer.BugReport;
|
||||||
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Database.Tables.DBTable;
|
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 Common.Visual.DataSetControlForm;
|
||||||
import _VisualDVM.ComponentsServer.BugReport.UI.BugReportsForm;
|
import _VisualDVM.ComponentsServer.BugReport.UI.BugReportsForm;
|
||||||
|
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||||
|
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
public class BugReportsDBTable extends DBTable<String, BugReport> {
|
public class BugReportsDBTable extends DBTable<String, BugReport> {
|
||||||
@@ -25,5 +32,12 @@ public class BugReportsDBTable extends DBTable<String, BugReport> {
|
|||||||
public Vector<BugReport> getAllDrafts() throws Exception {
|
public Vector<BugReport> getAllDrafts() throws Exception {
|
||||||
return Data.values().stream().filter(bugReport -> bugReport.state.equals(BugReportState.draft)).collect(Collectors.toCollection(Vector::new));
|
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;
|
||||||
|
}
|
||||||
//-
|
//-
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 Common.Database.SQLITE.SQLiteDatabase;
|
||||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||||
import _VisualDVM.ComponentsServer.BugReport.BugReportsDBTable;
|
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.Recipient.RecipientsDataSet;
|
||||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
|
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class BugReportsDatabase extends SQLiteDatabase {
|
public class BugReportsDatabase extends SQLiteDatabase {
|
||||||
public BugReportsDBTable bugReports;
|
public BugReportsDBTable bugReports;
|
||||||
|
public BugReportSettingsDBTable bugReportSettings;
|
||||||
|
public BugReportRecipientsDBTable bugReportRecipients;
|
||||||
public RecipientsDataSet recipients = new RecipientsDataSet();
|
public RecipientsDataSet recipients = new RecipientsDataSet();
|
||||||
public BugReportsDatabase() {
|
public BugReportsDatabase() {
|
||||||
super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile());
|
super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile());
|
||||||
@@ -17,6 +21,8 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
|||||||
@Override
|
@Override
|
||||||
protected void initAllTables() throws Exception {
|
protected void initAllTables() throws Exception {
|
||||||
addTable(bugReports = new BugReportsDBTable());
|
addTable(bugReports = new BugReportsDBTable());
|
||||||
|
addTable(bugReportSettings = new BugReportSettingsDBTable());
|
||||||
|
addTable(bugReportRecipients = new BugReportRecipientsDBTable());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void Init() throws Exception {
|
public void Init() throws Exception {
|
||||||
@@ -43,4 +49,14 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
|||||||
recipients.ShowUI(); //todo временно.
|
recipients.ShowUI(); //todo временно.
|
||||||
super.ResetUI();
|
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.Database.Tables.DataSet;
|
||||||
import Common.MainModule_;
|
import Common.MainModule_;
|
||||||
import Common.Visual.DataSetControlForm;
|
import Common.Visual.DataSetControlForm;
|
||||||
import _VisualDVM.ComponentsServer.Component.PerformanceAnalyzer.PerformanceAnalyzer;
|
|
||||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor_F;
|
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor_F;
|
||||||
import _VisualDVM.ComponentsServer.Component.UI.ComponentsForm;
|
import _VisualDVM.ComponentsServer.Component.UI.ComponentsForm;
|
||||||
import _VisualDVM.Current;
|
import _VisualDVM.Current;
|
||||||
@@ -18,7 +17,7 @@ public class ComponentsSet extends DataSet<ComponentType, Component> {
|
|||||||
put(ComponentType.Visualiser, Global.visualiser = new Visualiser());
|
put(ComponentType.Visualiser, Global.visualiser = new Visualiser());
|
||||||
put(ComponentType.Sapfor_F, (Component) MainModule_.instance.set(Current.Sapfor, new Sapfor_F()));
|
put(ComponentType.Sapfor_F, (Component) MainModule_.instance.set(Current.Sapfor, new Sapfor_F()));
|
||||||
put(ComponentType.Visualizer_2, Global.visualizer_2);
|
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());
|
put(ComponentType.Instruction, new Instruction());
|
||||||
}
|
}
|
||||||
public boolean needChanges() {
|
public boolean needChanges() {
|
||||||
@@ -75,7 +74,10 @@ public class ComponentsSet extends DataSet<ComponentType, Component> {
|
|||||||
return !bad_state;
|
return !bad_state;
|
||||||
}
|
}
|
||||||
public void initialVersionsCheck() {
|
public void initialVersionsCheck() {
|
||||||
for (Component component : Data.values())
|
for (Component component : Data.values()) {
|
||||||
|
System.out.println(component.getComponentType() + " initial version checking...");
|
||||||
component.InitialVersionCheck();
|
component.InitialVersionCheck();
|
||||||
|
System.out.println("done");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package _VisualDVM.ComponentsServer.Component.Json;
|
package _VisualDVM.ComponentsServer.Component.Json;
|
||||||
|
import Common.CommonConstants;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.ComponentsServer.Component.Component;
|
import _VisualDVM.ComponentsServer.Component.Component;
|
||||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||||
@@ -13,15 +14,22 @@ public class ComponentPublicationInfoJson implements Serializable {
|
|||||||
@Expose
|
@Expose
|
||||||
public byte[] packedFile = null;
|
public byte[] packedFile = null;
|
||||||
@Expose
|
@Expose
|
||||||
|
public long versionNumber = CommonConstants.Nan;
|
||||||
|
@Expose
|
||||||
public String versionText = "";
|
public String versionText = "";
|
||||||
@Expose
|
@Expose
|
||||||
public String changeRecord = "";
|
public String changeRecord = "";
|
||||||
@Expose
|
@Expose
|
||||||
public boolean needsUpdateMinimalVersion = false;
|
public boolean needsUpdateMinimalVersion = false;
|
||||||
|
@Expose
|
||||||
|
public boolean needsEmail = false;
|
||||||
|
@Expose
|
||||||
|
public boolean needsSendFile = false;
|
||||||
public ComponentPublicationInfoJson(Component component) throws Exception {
|
public ComponentPublicationInfoJson(Component component) throws Exception {
|
||||||
componentType = component.getComponentType();
|
componentType = component.getComponentType();
|
||||||
fileName = component.getFileName();
|
fileName = component.getFileName();
|
||||||
packedFile = Utils_.fileToBytes(component.getFile());
|
packedFile = Utils_.fileToBytes(component.getFile());
|
||||||
|
versionNumber = component.version;
|
||||||
versionText = component.getVersionText();
|
versionText = component.getVersionText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package _VisualDVM.ComponentsServer.Component.Sapfor;
|
package _VisualDVM.ComponentsServer.Component.Sapfor;
|
||||||
import Common.CommonConstants;
|
import Common.CommonConstants;
|
||||||
import Common.Passes.PassException;
|
import Common.Passes.PassException;
|
||||||
|
import Common.Utils.Pair;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
import _VisualDVM.ComponentsServer.Component.OSDComponent;
|
import _VisualDVM.ComponentsServer.Component.OSDComponent;
|
||||||
@@ -11,6 +12,7 @@ import _VisualDVM.Passes.PassCode;
|
|||||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor;
|
import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor;
|
||||||
|
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||||
import _VisualDVM.Utils;
|
import _VisualDVM.Utils;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
@@ -87,7 +89,8 @@ public abstract class Sapfor extends OSDComponent {
|
|||||||
return new PassCode[]{
|
return new PassCode[]{
|
||||||
PassCode.SPF_RemoveDvmDirectivesToComments,
|
PassCode.SPF_RemoveDvmDirectivesToComments,
|
||||||
PassCode.SPF_RemoveDvmDirectives,
|
PassCode.SPF_RemoveDvmDirectives,
|
||||||
PassCode.SPF_RemoveOmpDirectives
|
PassCode.SPF_RemoveOmpDirectives,
|
||||||
|
PassCode.SPF_RemoveSpfDirectives
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public static PassCode[] getIntervalsTransformationsCodes() {
|
public static PassCode[] getIntervalsTransformationsCodes() {
|
||||||
@@ -177,6 +180,11 @@ public abstract class Sapfor extends OSDComponent {
|
|||||||
if (line.toLowerCase().contains("segmentation fault")) {
|
if (line.toLowerCase().contains("segmentation fault")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
if (line.toLowerCase().contains("error in unparse")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -213,7 +221,7 @@ public abstract class Sapfor extends OSDComponent {
|
|||||||
Charset.defaultCharset());
|
Charset.defaultCharset());
|
||||||
if (!file.setExecutable(true))
|
if (!file.setExecutable(true))
|
||||||
throw new Exception("Не удалось сделать файл скрипта " + name + " исполняемым!");
|
throw new Exception("Не удалось сделать файл скрипта " + name + " исполняемым!");
|
||||||
//--
|
//-- Windows
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
do {
|
do {
|
||||||
try {
|
try {
|
||||||
@@ -271,37 +279,7 @@ public abstract class Sapfor extends OSDComponent {
|
|||||||
result_lines
|
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) {
|
public static int readVersionFromCode(File versionFile) {
|
||||||
int res = CommonConstants.Nan;
|
int res = CommonConstants.Nan;
|
||||||
if (versionFile.exists()) {
|
if (versionFile.exists()) {
|
||||||
@@ -327,6 +305,106 @@ public abstract class Sapfor extends OSDComponent {
|
|||||||
}
|
}
|
||||||
return res;
|
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() {
|
public void refreshPid() {
|
||||||
try {
|
try {
|
||||||
// UI.Info("Calling SPF_GetCurrentPID...");
|
// UI.Info("Calling SPF_GetCurrentPID...");
|
||||||
@@ -567,26 +645,5 @@ public abstract class Sapfor extends OSDComponent {
|
|||||||
if ((UI.isActive()) && (Global.mainModule.getUI().hasMainWindow()) && (Global.mainModule.getUI().getVersionsWindow() != null))
|
if ((UI.isActive()) && (Global.mainModule.getUI().hasMainWindow()) && (Global.mainModule.getUI().getVersionsWindow() != null))
|
||||||
Global.mainModule.getUI().getVersionsWindow().BlockVariants();
|
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
|
@Override
|
||||||
public String getAssemblyCommand() {
|
public String getAssemblyCommand() {
|
||||||
return "cd Repo/sapfor/experts/Sapfor_2017/_bin\n" +
|
return "cd Repo/SAPFOR/install\n" +
|
||||||
"cmake ../\n" +
|
"cmake ../\n" +
|
||||||
"make -j 4\n";
|
"make -j 4\n";
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ public class Sapfor_F extends Sapfor {
|
|||||||
public File getAssemblyFile() {
|
public File getAssemblyFile() {
|
||||||
return Paths.get(
|
return Paths.get(
|
||||||
Global.RepoDirectory.getAbsolutePath(),
|
Global.RepoDirectory.getAbsolutePath(),
|
||||||
"sapfor/experts/Sapfor_2017/_bin/Sapfor_F").toFile();
|
"SAPFOR/install/Sapfor_F").toFile();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getUpdateCommand() {
|
public String getUpdateCommand() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package _VisualDVM.ComponentsServer.Component.UI;
|
package _VisualDVM.ComponentsServer.Component.UI;
|
||||||
|
import Common.Visual.Editor.BaseEditor;
|
||||||
import Common.Visual.Windows.Dialog.DialogFields;
|
import Common.Visual.Windows.Dialog.DialogFields;
|
||||||
import _VisualDVM.Visual.Editor.BaseEditor;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class Visualizer_2 extends OSDComponent {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getAssemblyCommand() {
|
public String getAssemblyCommand() {
|
||||||
File src_home= Paths.get(Global.RepoDirectory.getAbsolutePath(),"/sapfor/experts/Sapfor_2017/_src/Server").toFile();
|
File src_home = Paths.get(Global.RepoDirectory.getAbsolutePath(), "SAPFOR/src/Server").toFile();
|
||||||
return "cd " + Utils_.DQuotes(src_home) +
|
return "cd " + Utils_.DQuotes(src_home) +
|
||||||
"\n" +
|
"\n" +
|
||||||
"g++ -O3 -std=c++17 checkUniq.cpp server.cpp -o Visualizer_2 -lpthread -lstdc++fs\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() {
|
public File getAssemblyFile() {
|
||||||
return Paths.get(
|
return Paths.get(
|
||||||
Global.RepoDirectory.getAbsolutePath(),
|
Global.RepoDirectory.getAbsolutePath(),
|
||||||
"sapfor/experts/Sapfor_2017/_src/Server/Visualizer_2").toFile();
|
"SAPFOR/src/Server/Visualizer_2").toFile();
|
||||||
}
|
}
|
||||||
public void Connect() throws Exception {
|
public void Connect() throws Exception {
|
||||||
ClearLog();
|
ClearLog();
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
package _VisualDVM.ComponentsServer;
|
package _VisualDVM.ComponentsServer;
|
||||||
|
import Common.Database.Database;
|
||||||
import Common.Database.Objects.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Database.RepositoryRefuseException;
|
import Common.Database.RepositoryRefuseException;
|
||||||
|
import Common.Utils.Pair;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||||
import _VisualDVM.ComponentsServer.BugReport.Json.BugReportAdditionJson;
|
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.ComponentType;
|
||||||
import _VisualDVM.ComponentsServer.Component.Json.ComponentPublicationInfoJson;
|
import _VisualDVM.ComponentsServer.Component.Json.ComponentPublicationInfoJson;
|
||||||
import _VisualDVM.ComponentsServer.Component.Json.ComponentVersionsInfoJson;
|
import _VisualDVM.ComponentsServer.Component.Json.ComponentVersionsInfoJson;
|
||||||
@@ -11,96 +15,24 @@ import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
|||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Machine.Machine;
|
|
||||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
|
||||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
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.Passes.All.ZipFolderPass;
|
||||||
import _VisualDVM.ProjectData.LanguageName;
|
import _VisualDVM.ProjectData.LanguageName;
|
||||||
import _VisualDVM.Repository.EmailMessage;
|
import _VisualDVM.Repository.EmailMessage;
|
||||||
import _VisualDVM.Repository.Server.RepositoryServer;
|
import _VisualDVM.Repository.Server.RepositoryServer;
|
||||||
import _VisualDVM.Utils;
|
import _VisualDVM.Utils;
|
||||||
import javafx.util.Pair;
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.lang.RandomStringUtils;
|
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
import java.io.BufferedWriter;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||||
public CredentialsDatabase credentials_db = null;
|
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() {
|
public ComponentsServer() {
|
||||||
super(BugReportsDatabase.class);
|
super(BugReportsDatabase.class);
|
||||||
}
|
}
|
||||||
@@ -113,6 +45,16 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
return Constants.ComponentsServerPort;
|
return Constants.ComponentsServerPort;
|
||||||
}
|
}
|
||||||
@Override
|
@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 {
|
protected void beforePublishAction(DBObject object) throws Exception {
|
||||||
if (object instanceof BugReport) {
|
if (object instanceof BugReport) {
|
||||||
BugReport bugReport = (BugReport) object;
|
BugReport bugReport = (BugReport) object;
|
||||||
@@ -123,6 +65,32 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@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 {
|
protected void afterDeleteAction(DBObject object) throws Exception {
|
||||||
if (object instanceof BugReport) {
|
if (object instanceof BugReport) {
|
||||||
BugReport bugReport = (BugReport) object;
|
BugReport bugReport = (BugReport) object;
|
||||||
@@ -133,15 +101,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@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() {
|
public void ActivateDB() {
|
||||||
super.ActivateDB();
|
super.ActivateDB();
|
||||||
try {
|
try {
|
||||||
@@ -151,10 +110,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
protected void startAdditionalThreads() {
|
|
||||||
backUp.start();
|
|
||||||
}
|
|
||||||
//-
|
//-
|
||||||
void DVMConvertProject() throws Exception {
|
void DVMConvertProject() throws Exception {
|
||||||
String[] args = request.arg.split("\n");
|
String[] args = request.arg.split("\n");
|
||||||
@@ -204,14 +159,13 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
}
|
}
|
||||||
void AppendBugReportField() throws Exception {
|
void AppendBugReportField() throws Exception {
|
||||||
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
|
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
|
||||||
if (db.bugReports.containsKey(transport.id)) {
|
checkExistense(transport.id, BugReport.class);
|
||||||
BugReport actual = db.bugReports.get(transport.id);
|
BugReport actual = db.bugReports.get(transport.id);
|
||||||
Field field = BugReport.class.getField(transport.fieldName);
|
Field field = BugReport.class.getField(transport.fieldName);
|
||||||
field.set(actual, field.get(actual) + "\n" + transport.textAddition);
|
field.set(actual, field.get(actual) + "\n" + transport.textAddition);
|
||||||
actual.change_date = new Date().getTime();
|
actual.change_date = new Date().getTime();
|
||||||
db.Update(actual);
|
db.Update(actual);
|
||||||
response.object = actual;
|
response.object = actual;
|
||||||
} else throw new RepositoryRefuseException("Баг репорт с ключом " + transport.id + " не существует.");
|
|
||||||
}
|
}
|
||||||
void ReceiveAllArchives() throws Exception {
|
void ReceiveAllArchives() throws Exception {
|
||||||
ZipFolderPass zip = new ZipFolderPass();
|
ZipFolderPass zip = new ZipFolderPass();
|
||||||
@@ -230,13 +184,11 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
}
|
}
|
||||||
void UpdateBugReport() throws Exception {
|
void UpdateBugReport() throws Exception {
|
||||||
BugReport oldBugReport = (BugReport) request.object;
|
BugReport oldBugReport = (BugReport) request.object;
|
||||||
if (db.bugReports.containsKey(oldBugReport.id)) {
|
checkExistense(oldBugReport.id, BugReport.class);
|
||||||
BugReport bugReport = db.bugReports.get(oldBugReport.id);
|
BugReport bugReport = db.bugReports.get(oldBugReport.id);
|
||||||
bugReport.SynchronizeFields(oldBugReport);
|
bugReport.SynchronizeFields(oldBugReport);
|
||||||
bugReport.change_date = new Date().getTime();
|
bugReport.change_date = new Date().getTime();
|
||||||
db.Update(bugReport);
|
db.Update(bugReport);
|
||||||
} else
|
|
||||||
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
|
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
void GetComponentsBackUps() throws Exception {
|
void GetComponentsBackUps() throws Exception {
|
||||||
@@ -305,6 +257,25 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
bufferWriter_.write("Минимальная версия поднята до " + info.versionText + "\n");
|
bufferWriter_.write("Минимальная версия поднята до " + info.versionText + "\n");
|
||||||
bufferWriter_.close();
|
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 {
|
void GetComponentsVersionsInfo() throws Exception {
|
||||||
Vector<String> types = (Vector<String>) request.object;
|
Vector<String> types = (Vector<String>) request.object;
|
||||||
@@ -346,19 +317,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
void ReceiveCredentialsDatabase() throws Exception {
|
void ReceiveCredentialsDatabase() throws Exception {
|
||||||
response.object = Utils_.fileToBytes(credentials_db.getFile());
|
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
|
@Override
|
||||||
protected void UnsafeSession() throws Exception {
|
protected void UnsafeSession() throws Exception {
|
||||||
@@ -392,12 +350,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
@Override
|
@Override
|
||||||
protected void Session() throws Exception {
|
protected void Session() throws Exception {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case PublishUserAccount:
|
|
||||||
PublishUserAccount();
|
|
||||||
break;
|
|
||||||
case EditUserAccount:
|
|
||||||
EditUserAccount();
|
|
||||||
break;
|
|
||||||
case ReceiveCredentialsDatabase:
|
case ReceiveCredentialsDatabase:
|
||||||
ReceiveCredentialsDatabase();
|
ReceiveCredentialsDatabase();
|
||||||
break;
|
break;
|
||||||
@@ -419,9 +371,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
case DVMConvertProject:
|
case DVMConvertProject:
|
||||||
DVMConvertProject();
|
DVMConvertProject();
|
||||||
break;
|
break;
|
||||||
case DeleteUserAccount:
|
|
||||||
DeleteUserAccount();
|
|
||||||
break;
|
|
||||||
case CheckURLRegistered:
|
case CheckURLRegistered:
|
||||||
CheckURLRegistered();
|
CheckURLRegistered();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
package _VisualDVM.ComponentsServer;
|
package _VisualDVM.ComponentsServer;
|
||||||
import Common.Database.Objects.DBObject;
|
|
||||||
import Common.Database.SQLITE.SQLiteDatabase;
|
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 Common.Passes.PassCode_;
|
||||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
|
||||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
|
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccountsDBTable;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccountsDBTable;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
public class CredentialsDatabase extends SQLiteDatabase {
|
public class CredentialsDatabase extends SQLiteDatabase {
|
||||||
public UserAccountsDBTable userAccounts;
|
public UserAccountsDBTable userAccounts;
|
||||||
public SubscriberWorkspaceDBTable workspaces;
|
public SubscriberWorkspaceDBTable workspaces;
|
||||||
@@ -38,5 +32,4 @@ public class CredentialsDatabase extends SQLiteDatabase {
|
|||||||
userAccounts.ShowUI();
|
userAccounts.ShowUI();
|
||||||
super.ResetUI();
|
super.ResetUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
|
|||||||
public class Recipient extends DBObject {
|
public class Recipient extends DBObject {
|
||||||
public String email = "";
|
public String email = "";
|
||||||
public String name = "";
|
public String name = "";
|
||||||
|
public Recipient() {
|
||||||
|
}
|
||||||
|
public Recipient(UserAccountJson json) {
|
||||||
|
email = json.email;
|
||||||
|
name = json.name;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public Object getPK() {
|
public Object getPK() {
|
||||||
return email;
|
return email;
|
||||||
@@ -15,10 +21,4 @@ public class Recipient extends DBObject {
|
|||||||
email = src_.email;
|
email = src_.email;
|
||||||
name = src_.name;
|
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.UserAccountJson;
|
||||||
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
|
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
|
||||||
import _VisualDVM.ComponentsServer.Recipient.UI.RecipientsForm;
|
import _VisualDVM.ComponentsServer.Recipient.UI.RecipientsForm;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
|
||||||
import _VisualDVM.Constants;
|
import _VisualDVM.Constants;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package _VisualDVM.ComponentsServer.SubscriberWorkspace.UI;
|
package _VisualDVM.ComponentsServer.SubscriberWorkspace.UI;
|
||||||
import Common.Database.Tables.DataSet;
|
import Common.Database.Tables.DataSet;
|
||||||
import Common.Passes.PassCode_;
|
|
||||||
import Common.Visual.DataSetControlForm;
|
import Common.Visual.DataSetControlForm;
|
||||||
import Common.Visual.Menus.DataMenuBar;
|
import Common.Visual.Menus.DataMenuBar;
|
||||||
import Common.Visual.Tables.ColumnInfo;
|
import Common.Visual.Tables.ColumnInfo;
|
||||||
@@ -47,7 +46,7 @@ public class SubscriberWorkspacesForm extends DataSetControlForm<SubscriberWorks
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public DataMenuBar createMenuBar() {
|
public DataMenuBar createMenuBar() {
|
||||||
return new DataMenuBar(dataSource.getPluralDescription());
|
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.DeleteRemoteWorkspace);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean isObjectVisible(SubscriberWorkspace object) {
|
public boolean isObjectVisible(SubscriberWorkspace object) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import java.io.Serializable;
|
|||||||
public enum AccountRole implements Serializable {
|
public enum AccountRole implements Serializable {
|
||||||
Undefined,
|
Undefined,
|
||||||
User,
|
User,
|
||||||
|
Student,
|
||||||
Developer,
|
Developer,
|
||||||
Admin;
|
Admin;
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
@@ -11,6 +12,8 @@ public enum AccountRole implements Serializable {
|
|||||||
return "не зарегистрирован";
|
return "не зарегистрирован";
|
||||||
case User:
|
case User:
|
||||||
return "Пользователь";
|
return "Пользователь";
|
||||||
|
case Student:
|
||||||
|
return "Студент";
|
||||||
case Developer:
|
case Developer:
|
||||||
return "Разработчик";
|
return "Разработчик";
|
||||||
case Admin:
|
case Admin:
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package _VisualDVM.ComponentsServer.UserAccount.UI;
|
|||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||||
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
|
||||||
public class UserAccountDialog extends DBObjectDialog<UserAccount, UserAccountFields> {
|
public class UserAccountDialog extends DBObjectDialog<UserAccount, UserAccountFields> {
|
||||||
public UserAccountDialog() {
|
public UserAccountDialog() {
|
||||||
super(UserAccountFields.class);
|
super(UserAccountFields.class);
|
||||||
|
|||||||
@@ -6,17 +6,18 @@ import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
public class UserAccountFields implements DialogFields {
|
public class UserAccountFields implements DialogFields {
|
||||||
private JPanel content;
|
|
||||||
public JTextField tfName;
|
public JTextField tfName;
|
||||||
public JTextField tfAddress;
|
public JTextField tfAddress;
|
||||||
public JCheckBox cbMail;
|
public JCheckBox cbMail;
|
||||||
public JComboBox cbRole;
|
public JComboBox cbRole;
|
||||||
|
private JPanel content;
|
||||||
private void createUIComponents() {
|
private void createUIComponents() {
|
||||||
// TODO: place custom component creation code here
|
// TODO: place custom component creation code here
|
||||||
tfName = new StyledTextField();
|
tfName = new StyledTextField();
|
||||||
tfAddress = new StyledTextField();
|
tfAddress = new StyledTextField();
|
||||||
cbRole = new JComboBox<>();
|
cbRole = new JComboBox<>();
|
||||||
cbRole.addItem(AccountRole.User);
|
cbRole.addItem(AccountRole.User);
|
||||||
|
cbRole.addItem(AccountRole.Student);
|
||||||
cbRole.addItem(AccountRole.Developer);
|
cbRole.addItem(AccountRole.Developer);
|
||||||
cbRole.addItem(AccountRole.Admin);
|
cbRole.addItem(AccountRole.Admin);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,14 @@ public class UserAccount extends iDBObject {
|
|||||||
@Description("DEFAULT 'Undefined'")
|
@Description("DEFAULT 'Undefined'")
|
||||||
public AccountRole role = AccountRole.Undefined; //права доступа
|
public AccountRole role = AccountRole.Undefined; //права доступа
|
||||||
public UserAccount() {
|
public UserAccount() {
|
||||||
|
|
||||||
}
|
}
|
||||||
public UserAccount(UserAccount account_in) {
|
public UserAccount(UserAccount account_in) {
|
||||||
this.SynchronizeFields(account_in);
|
this.SynchronizeFields(account_in);
|
||||||
}
|
}
|
||||||
|
public UserAccount(String name_in, String email_in) {
|
||||||
|
name = name_in;
|
||||||
|
email = email_in;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void SynchronizeFields(DBObject src) {
|
public void SynchronizeFields(DBObject src) {
|
||||||
super.SynchronizeFields(src);
|
super.SynchronizeFields(src);
|
||||||
@@ -34,10 +37,6 @@ public class UserAccount extends iDBObject {
|
|||||||
subscribe_active = src_.subscribe_active;
|
subscribe_active = src_.subscribe_active;
|
||||||
role = src_.role;
|
role = src_.role;
|
||||||
}
|
}
|
||||||
public UserAccount(String name_in, String email_in){
|
|
||||||
name = name_in;
|
|
||||||
email=email_in;
|
|
||||||
}
|
|
||||||
public File getClientKeyFile() {
|
public File getClientKeyFile() {
|
||||||
return new File(Global.KeysDirectory, "key");
|
return new File(Global.KeysDirectory, "key");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
|
|||||||
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
|
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
|
||||||
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountsForm;
|
import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountsForm;
|
||||||
import _VisualDVM.Constants;
|
|
||||||
import _VisualDVM.Global;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@@ -64,17 +62,12 @@ public class UserAccountsDBTable extends iDBTable<UserAccount> {
|
|||||||
}
|
}
|
||||||
return Utils_.gson.toJson(res);
|
return Utils_.gson.toJson(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector<String> getActiveMails() {
|
public Vector<String> getActiveMails() {
|
||||||
Vector<String> res = new Vector<>();
|
Vector<String> res = new Vector<>();
|
||||||
for (UserAccount account : Data.values()) {
|
for (UserAccount account : Data.values()) {
|
||||||
if ((account.subscribe_active != 0) && !res.contains(account.email))
|
if ((account.subscribe_active != 0) && !res.contains(account.email))
|
||||||
res.add(account.email);
|
res.add(account.email);
|
||||||
}
|
}
|
||||||
for (String admin_mail : Constants.admins_mails) {
|
|
||||||
if (!res.contains(admin_mail))
|
|
||||||
res.add(admin_mail);
|
|
||||||
}
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,6 @@ import java.io.File;
|
|||||||
public class ComponentsServerProperties extends VisualDVMProperties {
|
public class ComponentsServerProperties extends VisualDVMProperties {
|
||||||
//---
|
//---
|
||||||
@Expose
|
@Expose
|
||||||
public boolean EmailAdminsOnStart = false;
|
|
||||||
@Expose
|
|
||||||
public String BackupWorkspace = "_sapfor_x64_backups";
|
|
||||||
@Expose
|
|
||||||
public int BackupHour = 5;
|
|
||||||
@Expose
|
|
||||||
public int BackupMinute = 0;
|
|
||||||
@Expose
|
|
||||||
public int ComponentsBackUpsCount = 10;
|
public int ComponentsBackUpsCount = 10;
|
||||||
@Expose
|
@Expose
|
||||||
public String default_dvm_drv = "";
|
public String default_dvm_drv = "";
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import Common.Utils.Vector_;
|
|||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class Constants {
|
public class Constants {
|
||||||
public static final int version = 1191;
|
public static final int version = 1253;
|
||||||
public static final int planner_version = 12;
|
public static final int planner_version = 24;
|
||||||
public static final int testingMaxKernels = 64; //вообще говоря, это параметр машины.
|
public static final int testingMaxKernels = 64;
|
||||||
//--
|
//--
|
||||||
public static final String ApplicationFileName = "VisualSapfor.jar";
|
public static final String ApplicationFileName = "VisualSapfor.jar";
|
||||||
//--
|
//--
|
||||||
@@ -26,11 +26,10 @@ public class Constants {
|
|||||||
public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer";
|
public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer";
|
||||||
public static final String KeyDirectoryName = "Keys";
|
public static final String KeyDirectoryName = "Keys";
|
||||||
//--
|
//--
|
||||||
//SVN vmk-post@yandex.ru
|
//GIT
|
||||||
public static final String REPOSITORY_AUTHENTICATION = "--username dvmhuser --password dvmh2013 --non-interactive";
|
public static final String DVM_TESTS_REPOSITORY = "https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm-auto-test";
|
||||||
public static final String DVM_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/dvm";
|
public static final String SAPFOR_REPOSITORY = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR.git";
|
||||||
public static final String SAPFOR_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/sapfor";
|
public static final String SAPFOR_VERSION_URL = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR/raw/branch/master/src/Utils/version.h";
|
||||||
public static final String SAPFOR_REPOSITORY_BIN = "/sapfor/experts/Sapfor_2017/_bin";
|
|
||||||
//-вывод задач
|
//-вывод задач
|
||||||
public final static String parse_out_file = "parse_out.txt";
|
public final static String parse_out_file = "parse_out.txt";
|
||||||
public final static String parse_err_file = "parse_err.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 SMTPPort = 465;
|
||||||
public static final int MailSocketPort = 465;
|
public static final int MailSocketPort = 465;
|
||||||
//
|
//
|
||||||
|
//7998 отладочный порт. теперь.
|
||||||
public static final int ComponentsServerPort = 7995; //7795
|
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 int SocketTimeout = 0;
|
||||||
//-
|
//-
|
||||||
public static final String ServerAddress = "alex-freenas.ddns.net";
|
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 package_json = "package_json";
|
||||||
public static final String results_json = "results_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;
|
public static final int compiler_group = -2;
|
||||||
// DBProjectFile
|
// DBProjectFile
|
||||||
public static final String no_data = "Нет данных";
|
public static final String no_data = "Нет данных";
|
||||||
@@ -469,7 +469,7 @@ public class Constants {
|
|||||||
};
|
};
|
||||||
public static Vector<String> admins_mails = new Vector_<>(
|
public static Vector<String> admins_mails = new Vector_<>(
|
||||||
"sapfor.tracker@internet.ru",
|
"sapfor.tracker@internet.ru",
|
||||||
"vmk-post@yandex.ru",
|
"vmk-post@yandex.ru"
|
||||||
"79854210702@ya.ru"
|
, "79854210702@ya.ru"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
|||||||
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
public class Global {
|
public class Global {
|
||||||
//todo свести большинство к содержимому mainModule
|
//todo свести большинство к содержимому mainModule
|
||||||
@@ -39,7 +38,7 @@ public class Global {
|
|||||||
public static File KeysDirectory;
|
public static File KeysDirectory;
|
||||||
public static File DataDirectory;
|
public static File DataDirectory;
|
||||||
public static File BugReportsDirectory;
|
public static File BugReportsDirectory;
|
||||||
public static File BackUpsDirectory;
|
public static File BackUpsDirectory; //бекапы компонентов на локальной машине.
|
||||||
public static File TempDirectory;
|
public static File TempDirectory;
|
||||||
public static File ProjectsDirectory;
|
public static File ProjectsDirectory;
|
||||||
public static File CompilationTasksDirectory;
|
public static File CompilationTasksDirectory;
|
||||||
@@ -48,7 +47,7 @@ public class Global {
|
|||||||
public static File RepoDirectory;
|
public static File RepoDirectory;
|
||||||
public static File TestsDirectory;
|
public static File TestsDirectory;
|
||||||
public static File PerformanceAnalyzerDirectory;
|
public static File PerformanceAnalyzerDirectory;
|
||||||
public static File DataBackUpsDirectory;
|
public static File DataBackUpsDirectory; //бекапы данных сервера.
|
||||||
public static File DVMPackagesDirectory;
|
public static File DVMPackagesDirectory;
|
||||||
public static File SapforsDirectory;
|
public static File SapforsDirectory;
|
||||||
public static File SapforPackagesDirectory;
|
public static File SapforPackagesDirectory;
|
||||||
@@ -61,8 +60,8 @@ public class Global {
|
|||||||
public static Visualiser visualiser = null;
|
public static Visualiser visualiser = null;
|
||||||
public static Visualizer_2 visualizer_2 = null;
|
public static Visualizer_2 visualizer_2 = null;
|
||||||
public static void CheckVisualiserDirectories() {
|
public static void CheckVisualiserDirectories() {
|
||||||
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
|
||||||
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
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(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
||||||
//-
|
//-
|
||||||
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||||
@@ -84,17 +83,18 @@ public class Global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void CheckServerDirectories() {
|
public static void CheckServerDirectories() {
|
||||||
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
|
||||||
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
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(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(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));
|
Utils_.CheckDirectory(KeysDirectory = new File(Utils_.getHomeDirectory(), Constants.KeyDirectoryName));
|
||||||
}
|
}
|
||||||
public static void CheckTestingSystemDirectories() {
|
public static void CheckTestingSystemDirectories() {
|
||||||
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
||||||
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
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(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName));
|
||||||
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||||
@@ -158,13 +158,17 @@ public class Global {
|
|||||||
public static void NormalMode(int port) throws Exception {
|
public static void NormalMode(int port) throws Exception {
|
||||||
//-------------------------------->>
|
//-------------------------------->>
|
||||||
mainModule = new MainModule();
|
mainModule = new MainModule();
|
||||||
|
System.out.println("main module initialization..");
|
||||||
mainModule.Init();
|
mainModule.Init();
|
||||||
|
System.out.println("DONE");
|
||||||
//--
|
//--
|
||||||
CheckVisualiserDirectories();
|
CheckVisualiserDirectories();
|
||||||
CreateLogAtComponentsPath();
|
CreateLogAtComponentsPath();
|
||||||
//-
|
//-
|
||||||
|
System.out.println("connection to visualiser_2..");
|
||||||
visualizer_2 = new Visualizer_2(port);
|
visualizer_2 = new Visualizer_2(port);
|
||||||
visualizer_2.Connect();
|
visualizer_2.Connect();
|
||||||
|
System.out.println("DONE");
|
||||||
visualizer_2.refreshPid();
|
visualizer_2.refreshPid();
|
||||||
//если делать раньше, то не удастся убить сервер.
|
//если делать раньше, то не удастся убить сервер.
|
||||||
if (Utils_.ContainsCyrillic(Utils_.getHomePath())) {
|
if (Utils_.ContainsCyrillic(Utils_.getHomePath())) {
|
||||||
@@ -173,16 +177,27 @@ public class Global {
|
|||||||
"Визуализатор завершает работу."); //
|
"Визуализатор завершает работу."); //
|
||||||
FinishApplication();
|
FinishApplication();
|
||||||
}
|
}
|
||||||
|
System.out.println("messages server starting..");
|
||||||
messagesServer = new MessagesServer();
|
messagesServer = new MessagesServer();
|
||||||
messagesServer.Start();
|
messagesServer.Start();
|
||||||
|
System.out.println("DONE");
|
||||||
components = new ComponentsSet();
|
components = new ComponentsSet();
|
||||||
|
System.out.println("component initial versions checking..");
|
||||||
components.initialVersionsCheck();
|
components.initialVersionsCheck();
|
||||||
|
System.out.println("DONE");
|
||||||
|
System.out.println("geting component actual versions..");
|
||||||
Global.mainModule.getPass(PassCode.GetComponentsActualVersions).Do();
|
Global.mainModule.getPass(PassCode.GetComponentsActualVersions).Do();
|
||||||
|
System.out.println("DONE");
|
||||||
|
System.out.println("validation component actual versions..");
|
||||||
components.validateStates();
|
components.validateStates();
|
||||||
|
System.out.println("DONE");
|
||||||
if (components.needChanges()) {
|
if (components.needChanges()) {
|
||||||
|
System.out.println("components need changes!!");
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
do {
|
do {
|
||||||
|
System.out.println("Show components window...");
|
||||||
Global.mainModule.getUI().getComponentsWindow().ShowDialog("");
|
Global.mainModule.getUI().getComponentsWindow().ShowDialog("");
|
||||||
|
System.out.println("DONE");
|
||||||
if (flag = (!components.validateStates())) {
|
if (flag = (!components.validateStates())) {
|
||||||
if (!UI.Question("Обнаружены некорректные компоненты.Работа визуализатора невозможна.\n" +
|
if (!UI.Question("Обнаружены некорректные компоненты.Работа визуализатора невозможна.\n" +
|
||||||
"Вернуться к окну компонент"
|
"Вернуться к окну компонент"
|
||||||
@@ -220,7 +235,7 @@ public class Global {
|
|||||||
}
|
}
|
||||||
public static void ServerMode() throws Exception {
|
public static void ServerMode() throws Exception {
|
||||||
CheckServerDirectories();
|
CheckServerDirectories();
|
||||||
CreateLogAtComponentsPath();
|
CreateLogAtHome();
|
||||||
componentsServer = new ComponentsServer();
|
componentsServer = new ComponentsServer();
|
||||||
componentsServer.ActivateDB();
|
componentsServer.ActivateDB();
|
||||||
componentsServer.Start();
|
componentsServer.Start();
|
||||||
@@ -228,7 +243,7 @@ public class Global {
|
|||||||
}
|
}
|
||||||
public static void TestingSystemMode() throws Exception {
|
public static void TestingSystemMode() throws Exception {
|
||||||
CheckTestingSystemDirectories();
|
CheckTestingSystemDirectories();
|
||||||
CreateLogAtComponentsPath();
|
CreateLogAtHome();
|
||||||
testingServer = new TestingServer();
|
testingServer = new TestingServer();
|
||||||
testingServer.ActivateDB();
|
testingServer.ActivateDB();
|
||||||
testingServer.Start();
|
testingServer.Start();
|
||||||
@@ -278,6 +293,10 @@ public class Global {
|
|||||||
public static void Init(String... args) {
|
public static void Init(String... args) {
|
||||||
System.out.println("VisualSapfor.jar started..");
|
System.out.println("VisualSapfor.jar started..");
|
||||||
System.out.println("home directory is" + Utils_.Brackets(Utils_.getHomePath()));
|
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 {
|
try {
|
||||||
SynchronizeProperties();
|
SynchronizeProperties();
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package _VisualDVM.GlobalData.Compiler;
|
package _VisualDVM.GlobalData.Compiler;
|
||||||
import Common.Database.Objects.iDBObject;
|
import Common.Database.Objects.iDBObject;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironmentsSet;
|
import _VisualDVM.GlobalData.CompilerEnvironment.RawCompilerEnvironmentsSet;
|
||||||
import _VisualDVM.GlobalData.CompilerOption.CompilerOptionsSet;
|
import _VisualDVM.GlobalData.CompilerOption.RawCompilerOptionsSet;
|
||||||
import _VisualDVM.GlobalData.Machine.Machine;
|
import _VisualDVM.GlobalData.Machine.Machine;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
import _VisualDVM.ProjectData.LanguageName;
|
import _VisualDVM.ProjectData.LanguageName;
|
||||||
@@ -29,8 +29,8 @@ public class Compiler extends iDBObject {
|
|||||||
@Description("IGNORE")
|
@Description("IGNORE")
|
||||||
public String versionText = "";
|
public String versionText = "";
|
||||||
//-
|
//-
|
||||||
public CompilerOptionsSet options = new CompilerOptionsSet();
|
public RawCompilerOptionsSet options = new RawCompilerOptionsSet();
|
||||||
public CompilerEnvironmentsSet environments = new CompilerEnvironmentsSet();
|
public RawCompilerEnvironmentsSet environments = new RawCompilerEnvironmentsSet();
|
||||||
//-
|
//-
|
||||||
public Compiler() {
|
public Compiler() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,12 @@ public class CompilerDialog extends DBObjectDialog<Compiler, CompilerFields> {
|
|||||||
super(CompilerFields.class);
|
super(CompilerFields.class);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public int getDefaultWidth() {
|
||||||
|
return 600;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public int getDefaultHeight() {
|
public int getDefaultHeight() {
|
||||||
return 300;
|
return 450;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void validateFields() {
|
public void validateFields() {
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<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"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="500" height="400"/>
|
<xy x="20" y="20" width="500" height="437"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children>
|
<children>
|
||||||
<component id="87831" class="javax.swing.JTextField" binding="tfHome" custom-create="true">
|
<component id="87831" class="javax.swing.JTextField" binding="tfHome" custom-create="true">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -18,21 +18,12 @@
|
|||||||
</component>
|
</component>
|
||||||
<vspacer id="44b33">
|
<vspacer id="44b33">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
</vspacer>
|
</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">
|
<component id="48916" class="javax.swing.JButton" binding="bBrowse">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<enabled value="true"/>
|
<enabled value="true"/>
|
||||||
@@ -42,29 +33,48 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="d58a0" class="javax.swing.JTextField" binding="tfCallCommand" custom-create="true">
|
<component id="d58a0" class="javax.swing.JTextField" binding="tfCallCommand" custom-create="true">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
</component>
|
</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">
|
<component id="87234" class="javax.swing.JTextField" binding="tfDescription" custom-create="true">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
</component>
|
</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">
|
<component id="d1e8b" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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"/>
|
<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="описание"/>
|
<text value="описание"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="ac56f" class="javax.swing.JTextField" binding="tfVersionCommand" custom-create="true">
|
<component id="627cc" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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">
|
<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"/>
|
||||||
<preferred-size width="150" height="-1"/>
|
|
||||||
</grid>
|
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<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>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="34097" class="javax.swing.JLabel">
|
<component id="34097" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
<font name="Times New Roman" size="16" style="2"/>
|
||||||
<text value="запрос версии"/>
|
<text value="запрос версии"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</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">
|
<component id="8982d" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
<font name="Times New Roman" size="16" style="2"/>
|
||||||
@@ -114,21 +122,13 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="19a71" class="javax.swing.JLabel">
|
<component id="19a71" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
<font name="Times New Roman" size="16" style="2"/>
|
||||||
<text value="тип"/>
|
<text value="тип"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</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>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
</form>
|
</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;
|
package _VisualDVM.GlobalData.CompilerOption;
|
||||||
import Common.Database.Objects.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
public class CompilerOption extends DBObject {
|
public class CompilerOption extends DBObject {
|
||||||
@Description("PRIMARY KEY, UNIQUE")
|
|
||||||
public String name = "";
|
public String name = "";
|
||||||
public String parameterSeparator = "";
|
public String parameterSeparator = "";
|
||||||
public String parameterName = "";
|
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>("Параметр") {
|
new ColumnInfo<CompilerOption>("Параметр") {
|
||||||
@Override
|
@Override
|
||||||
public Object getFieldAt(CompilerOption object) {
|
public Object getFieldAt(CompilerOption object) {
|
||||||
return object.parameterName + object.parameterSeparator;
|
return object.parameterName;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Class getRendererClass() {
|
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.CommonConstants;
|
||||||
import Common.Database.VisualiserDatabase;
|
import Common.Database.VisualiserDatabase;
|
||||||
import Common.MainModule_;
|
import Common.MainModule_;
|
||||||
import _VisualDVM.Current;
|
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||||
import _VisualDVM.GlobalData.Compiler.CompilersDBTable;
|
import _VisualDVM.GlobalData.Compiler.CompilersDBTable;
|
||||||
@@ -98,7 +97,6 @@ public class GlobalDatabase extends VisualiserDatabase {
|
|||||||
//--
|
//--
|
||||||
//проверить, есть ли профиль с таким же набором настроек.
|
//проверить, есть ли профиль с таким же набором настроек.
|
||||||
public SapforProfile checkProfileForCurrentSettings() {
|
public SapforProfile checkProfileForCurrentSettings() {
|
||||||
|
|
||||||
LinkedHashMap<String, String> current_values = Global.mainModule.getProject().sapforProperties.toMap();
|
LinkedHashMap<String, String> current_values = Global.mainModule.getProject().sapforProperties.toMap();
|
||||||
for (SapforProfile profile : sapforProfiles.Data.values()) {
|
for (SapforProfile profile : sapforProfiles.Data.values()) {
|
||||||
//--получить все настройки профиля
|
//--получить все настройки профиля
|
||||||
|
|||||||
@@ -8,8 +8,12 @@ public class MachineDialog extends DBObjectDialog<Machine, MachineFields> {
|
|||||||
super(MachineFields.class);
|
super(MachineFields.class);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public int getDefaultWidth() {
|
||||||
|
return 600;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public int getDefaultHeight() {
|
public int getDefaultHeight() {
|
||||||
return 250;
|
return 350;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void validateFields() {
|
public void validateFields() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<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"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="500" height="400"/>
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<children>
|
<children>
|
||||||
<component id="1bb3c" class="javax.swing.JTextField" binding="tfName" custom-create="true">
|
<component id="1bb3c" class="javax.swing.JTextField" binding="tfName" custom-create="true">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -18,12 +18,12 @@
|
|||||||
</component>
|
</component>
|
||||||
<vspacer id="aac20">
|
<vspacer id="aac20">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
</vspacer>
|
</vspacer>
|
||||||
<component id="44036" class="javax.swing.JTextField" binding="tfAddress" custom-create="true">
|
<component id="44036" class="javax.swing.JTextField" binding="tfAddress" custom-create="true">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -31,13 +31,21 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="a00bb" class="javax.swing.JSpinner" binding="sPort">
|
<component id="a00bb" class="javax.swing.JSpinner" binding="sPort">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="100" height="30"/>
|
||||||
<maximum-size width="100" height="30"/>
|
<maximum-size width="100" height="30"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
</component>
|
</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">
|
<component id="ee3e1" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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"/>
|
<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>
|
||||||
<component id="22dab" class="javax.swing.JLabel">
|
<component id="22dab" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
<font name="Times New Roman" size="16" style="2"/>
|
||||||
@@ -58,7 +66,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="2dde3" class="javax.swing.JLabel">
|
<component id="2dde3" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
<font name="Times New Roman" size="16" style="2"/>
|
||||||
@@ -67,21 +75,13 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="9d873" class="javax.swing.JLabel">
|
<component id="9d873" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
<font name="Times New Roman" size="16" style="2"/>
|
||||||
<text value="тип"/>
|
<text value="тип"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</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>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package _VisualDVM.GlobalData.Makefile.UI;
|
package _VisualDVM.GlobalData.Makefile.UI;
|
||||||
|
import Common.Visual.Editor.Viewer;
|
||||||
import Common.Visual.Windows.Dialog.Text.TextDialog;
|
import Common.Visual.Windows.Dialog.Text.TextDialog;
|
||||||
import _VisualDVM.Visual.Editor.Viewer;
|
|
||||||
public class MakefilePreviewForm extends TextDialog<Viewer> {
|
public class MakefilePreviewForm extends TextDialog<Viewer> {
|
||||||
public MakefilePreviewForm() {
|
public MakefilePreviewForm() {
|
||||||
super(Viewer.class);
|
super(Viewer.class);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import Common.Visual.UI;
|
|||||||
import Common.Visual.Windows.Dialog.DialogFields;
|
import Common.Visual.Windows.Dialog.DialogFields;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||||
|
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
|
||||||
import _VisualDVM.GlobalData.Machine.Machine;
|
import _VisualDVM.GlobalData.Machine.Machine;
|
||||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||||
import _VisualDVM.GlobalData.Module.Module;
|
import _VisualDVM.GlobalData.Module.Module;
|
||||||
@@ -39,9 +40,9 @@ public class ModuleAnchestorFields implements DialogFields {
|
|||||||
BPickOptions.addActionListener(new ActionListener() {
|
BPickOptions.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
Pass<String> pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
|
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
|
||||||
if (pass.Do(compiler)) {
|
if (pass.Do(compiler)) {
|
||||||
UI.TrySelect(cbFlags, pass.target);
|
UI.TrySelect(cbFlags, ((OptionsJson) pass.target).toLine());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,10 +14,12 @@ public enum TaskState implements StatusEnum {
|
|||||||
//-----------------------
|
//-----------------------
|
||||||
Finished,
|
Finished,
|
||||||
//--- результирующие
|
//--- результирующие
|
||||||
|
Crushed,
|
||||||
|
NaN,
|
||||||
DoneWithErrors,
|
DoneWithErrors,
|
||||||
|
DoneWithDiffs,
|
||||||
AbortedByTimeout,
|
AbortedByTimeout,
|
||||||
AbortedByUser,
|
AbortedByUser,
|
||||||
Crushed,
|
|
||||||
WrongTestFormat,
|
WrongTestFormat,
|
||||||
InternalError,
|
InternalError,
|
||||||
Done,
|
Done,
|
||||||
@@ -38,6 +40,8 @@ public enum TaskState implements StatusEnum {
|
|||||||
case WrongTestFormat:
|
case WrongTestFormat:
|
||||||
case InternalError:
|
case InternalError:
|
||||||
case Crushed:
|
case Crushed:
|
||||||
|
case DoneWithDiffs:
|
||||||
|
case NaN:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -45,6 +49,8 @@ public enum TaskState implements StatusEnum {
|
|||||||
}
|
}
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
|
case NaN:
|
||||||
|
return "NaN";
|
||||||
case Waiting:
|
case Waiting:
|
||||||
return "ожидание";
|
return "ожидание";
|
||||||
case WorkspaceCreated:
|
case WorkspaceCreated:
|
||||||
@@ -63,6 +69,8 @@ public enum TaskState implements StatusEnum {
|
|||||||
return "прервана";
|
return "прервана";
|
||||||
case Done:
|
case Done:
|
||||||
return "успешно";
|
return "успешно";
|
||||||
|
case DoneWithDiffs:
|
||||||
|
return "различия";
|
||||||
case DoneWithErrors:
|
case DoneWithErrors:
|
||||||
return "с ошибками";
|
return "с ошибками";
|
||||||
case Crushed:
|
case Crushed:
|
||||||
@@ -99,6 +107,8 @@ public enum TaskState implements StatusEnum {
|
|||||||
case WrongTestFormat:
|
case WrongTestFormat:
|
||||||
case InternalError:
|
case InternalError:
|
||||||
case Canceled:
|
case Canceled:
|
||||||
|
case DoneWithDiffs:
|
||||||
|
case NaN:
|
||||||
return VisualiserFonts.BadState;
|
return VisualiserFonts.BadState;
|
||||||
case Queued:
|
case Queued:
|
||||||
case Running:
|
case Running:
|
||||||
@@ -136,6 +146,7 @@ public enum TaskState implements StatusEnum {
|
|||||||
public boolean isComplete() {
|
public boolean isComplete() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case Done:
|
case Done:
|
||||||
|
case DoneWithDiffs:
|
||||||
case DoneWithErrors:
|
case DoneWithErrors:
|
||||||
case AbortedByTimeout:
|
case AbortedByTimeout:
|
||||||
case AbortedByUser:
|
case AbortedByUser:
|
||||||
@@ -143,6 +154,7 @@ public enum TaskState implements StatusEnum {
|
|||||||
case Crushed:
|
case Crushed:
|
||||||
case InternalError:
|
case InternalError:
|
||||||
case Canceled:
|
case Canceled:
|
||||||
|
case NaN:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -36,7 +36,11 @@ public class UserDialog extends DBObjectDialog<User, UserFields> {
|
|||||||
Result.password = new String(fields.tfPassword.getPassword());
|
Result.password = new String(fields.tfPassword.getPassword());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public int getDefaultWidth() {
|
||||||
|
return 600;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public int getDefaultHeight() {
|
public int getDefaultHeight() {
|
||||||
return 250;
|
return 400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<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"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="500" height="400"/>
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<children>
|
<children>
|
||||||
<component id="374e0" class="javax.swing.JTextField" binding="tfLogin" custom-create="true">
|
<component id="374e0" class="javax.swing.JTextField" binding="tfLogin" custom-create="true">
|
||||||
<constraints>
|
<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"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -18,21 +18,12 @@
|
|||||||
</component>
|
</component>
|
||||||
<vspacer id="9bcf9">
|
<vspacer id="9bcf9">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
</vspacer>
|
</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">
|
<tabbedpane id="936e5" binding="AuthenticationTabs">
|
||||||
<constraints>
|
<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"/>
|
<minimum-size width="-1" height="80"/>
|
||||||
<preferred-size width="200" height="80"/>
|
<preferred-size width="200" height="80"/>
|
||||||
<maximum-size width="-1" height="80"/>
|
<maximum-size width="-1" height="80"/>
|
||||||
@@ -75,15 +66,36 @@
|
|||||||
<preferred-size width="150" height="-1"/>
|
<preferred-size width="150" height="-1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties>
|
||||||
|
<editable value="true"/>
|
||||||
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
</children>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
</children>
|
</children>
|
||||||
</tabbedpane>
|
</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">
|
<component id="be99c" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
<font name="Times New Roman" size="16" style="2"/>
|
||||||
@@ -92,23 +104,13 @@
|
|||||||
<verticalTextPosition value="0"/>
|
<verticalTextPosition value="0"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</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">
|
<component id="7bee1" class="javax.swing.JLabel">
|
||||||
<constraints>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<font name="Times New Roman" size="16" style="2"/>
|
<font name="Times New Roman" size="16" style="2"/>
|
||||||
<text value="папка"/>
|
<text value="раб.пространство"/>
|
||||||
<toolTipText value="рабочая папка визуализатора"/>
|
<toolTipText value="рабочая папка визуализатора"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public class UserFields implements DialogFields {
|
|||||||
public JPanel PasswordTab;
|
public JPanel PasswordTab;
|
||||||
public JPasswordField tfPassword;
|
public JPasswordField tfPassword;
|
||||||
public JTextField tfWorkspace;
|
public JTextField tfWorkspace;
|
||||||
|
public JTextField tfRoot;
|
||||||
|
public JButton bBrowse;
|
||||||
char mask;
|
char mask;
|
||||||
char unmask = (char) 0;
|
char unmask = (char) 0;
|
||||||
boolean password_visible = false;
|
boolean password_visible = false;
|
||||||
@@ -30,6 +32,22 @@ public class UserFields implements DialogFields {
|
|||||||
bPasswordVisibility.setIcon(Utils_.getIcon("/icons/" + (password_visible ? "Show" : "Hide") + "Password.png"));
|
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
|
@Override
|
||||||
public Component getContent() {
|
public Component getContent() {
|
||||||
|
|||||||
@@ -28,10 +28,12 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
|||||||
PassCode.ShutdownComponentsServer,
|
PassCode.ShutdownComponentsServer,
|
||||||
PassCode.StartComponentsServer,
|
PassCode.StartComponentsServer,
|
||||||
PassCode.PublishComponentsServer,
|
PassCode.PublishComponentsServer,
|
||||||
|
PassCode.ComponentsServerBackUp,
|
||||||
//
|
//
|
||||||
PassCode.ShutdownTestingServer,
|
PassCode.ShutdownTestingServer,
|
||||||
PassCode.StartTestingServer,
|
PassCode.StartTestingServer,
|
||||||
PassCode.PublishTestingServer,
|
PassCode.PublishTestingServer,
|
||||||
|
PassCode.TestingServerBackUp,
|
||||||
PassCode.CreateTestsGroupFromSelectedVersions,
|
PassCode.CreateTestsGroupFromSelectedVersions,
|
||||||
PassCode.RefreshDVMPackageResults,
|
PassCode.RefreshDVMPackageResults,
|
||||||
PassCode.ConvertCorrectnessTests
|
PassCode.ConvertCorrectnessTests
|
||||||
@@ -146,6 +148,9 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
|||||||
for (PassCode code : accountRoleDependentPasses)
|
for (PassCode code : accountRoleDependentPasses)
|
||||||
getPass(code).setControlsVisible(false);
|
getPass(code).setControlsVisible(false);
|
||||||
}
|
}
|
||||||
|
public void SetStudentPassesAccess() {
|
||||||
|
SetUserPassesAccess();
|
||||||
|
}
|
||||||
public void SetDeveloperPassesAccess() {
|
public void SetDeveloperPassesAccess() {
|
||||||
SetUserPassesAccess();
|
SetUserPassesAccess();
|
||||||
getPass(PassCode.CreateTestsGroupFromSelectedVersions).setControlsVisible(true);
|
getPass(PassCode.CreateTestsGroupFromSelectedVersions).setControlsVisible(true);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package _VisualDVM;
|
package _VisualDVM;
|
||||||
import Common.CommonConstants;
|
import Common.CommonConstants;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
@@ -66,13 +65,21 @@ public class NormalProperties extends VisualDVMProperties {
|
|||||||
public int Kernels = Utils.getHalfKernels();
|
public int Kernels = Utils.getHalfKernels();
|
||||||
@Expose
|
@Expose
|
||||||
public String LocalMakePathWindows = "C:\\MinGW\\msys\\1.0\\bin\\make.exe";
|
public String LocalMakePathWindows = "C:\\MinGW\\msys\\1.0\\bin\\make.exe";
|
||||||
//--
|
//--тестирование
|
||||||
@Expose
|
@Expose
|
||||||
public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования
|
public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования
|
||||||
@Expose
|
@Expose
|
||||||
public boolean AutoCheckTesting = false; // проверять ли задачи тестирования при включенном визуализаторе.
|
public boolean AutoCheckTesting = false; // проверять ли задачи тестирования при включенном визуализаторе.
|
||||||
@Expose
|
@Expose
|
||||||
public boolean EmailOnTestingProgress = false; //включено ли оповещение по email о результатах тестирования.
|
public boolean EmailOnTestingProgress = false; //включено ли оповещение по email о результатах тестирования.
|
||||||
|
@Expose
|
||||||
|
public boolean CompleteCompilationOptions = true;
|
||||||
|
@Expose
|
||||||
|
public boolean CompleteRunEnvironments = true;
|
||||||
|
@Expose
|
||||||
|
public boolean CreateEthalonTasks = true;
|
||||||
|
@Expose
|
||||||
|
public boolean ErasePackageWorkspace = true;
|
||||||
//--
|
//--
|
||||||
@Expose
|
@Expose
|
||||||
public int lastMachineId = CommonConstants.Nan;
|
public int lastMachineId = CommonConstants.Nan;
|
||||||
@@ -116,6 +123,14 @@ public class NormalProperties extends VisualDVMProperties {
|
|||||||
@Override
|
@Override
|
||||||
public String getFieldDescription(String fieldName) {
|
public String getFieldDescription(String fieldName) {
|
||||||
switch (fieldName) {
|
switch (fieldName) {
|
||||||
|
case "ErasePackageWorkspace":
|
||||||
|
return "Очистка рабочего пространства пакета на целевой машине";
|
||||||
|
case "CompleteCompilationOptions":
|
||||||
|
return "Дополнение опций компиляции";
|
||||||
|
case "CompleteRunEnvironments":
|
||||||
|
return "Дополнение переменных окружения запуска";
|
||||||
|
case "CreateEthalonTasks":
|
||||||
|
return "Создание эталонных последовательных запусков";
|
||||||
case "OfferRegistrationOnStart":
|
case "OfferRegistrationOnStart":
|
||||||
return "Проверка регистрации";
|
return "Проверка регистрации";
|
||||||
case "Email":
|
case "Email":
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import Common.Visual.UI;
|
|||||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||||
import _VisualDVM.ComponentsServer.BugReport.BugReportState;
|
import _VisualDVM.ComponentsServer.BugReport.BugReportState;
|
||||||
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||||
import _VisualDVM.Global;
|
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -45,7 +45,6 @@ public class AddBugReport extends AddObjectPass<BugReport> {
|
|||||||
target.project_version = "";
|
target.project_version = "";
|
||||||
target.visualiser_version = Global.visualiser.version;
|
target.visualiser_version = Global.visualiser.version;
|
||||||
target.sapfor_version = Global.components.get(ComponentType.Sapfor_F).version;
|
target.sapfor_version = Global.components.get(ComponentType.Sapfor_F).version;
|
||||||
target.packedSettingsJson = "";
|
|
||||||
target.percentage = 0;
|
target.percentage = 0;
|
||||||
target.description = "Черновик отчёта об ошибке.\nЗаполните описание ошибочной ситуации, и нажмите 'Опубликовать'";
|
target.description = "Черновик отчёта об ошибке.\nЗаполните описание ошибочной ситуации, и нажмите 'Опубликовать'";
|
||||||
target.date = new Date().getTime();
|
target.date = new Date().getTime();
|
||||||
|
|||||||
@@ -31,6 +31,6 @@ public class ApplyBugReportSettings extends Pass<BugReport> {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
Global.mainModule.getProject().sapforProperties.applyPatch(target.getSettingsJson());
|
Global.mainModule.getProject().sapforProperties.applyBugReportSettings(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
import Common.Utils.Utils_;
|
|
||||||
import _VisualDVM.Global;
|
|
||||||
import _VisualDVM.GlobalData.Machine.Machine;
|
import _VisualDVM.GlobalData.Machine.Machine;
|
||||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||||
import _VisualDVM.GlobalData.User.User;
|
import _VisualDVM.GlobalData.User.User;
|
||||||
@@ -8,7 +6,6 @@ import _VisualDVM.Passes.SSH.ConnectionPass;
|
|||||||
import com.jcraft.jsch.ChannelSftp;
|
import com.jcraft.jsch.ChannelSftp;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class ArchivesBackupPass extends ConnectionPass<File> {
|
public class ArchivesBackupPass extends ConnectionPass<File> {
|
||||||
@@ -26,8 +23,7 @@ public class ArchivesBackupPass extends ConnectionPass<File> {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void ServerAction() throws Exception {
|
protected void ServerAction() throws Exception {
|
||||||
String workspace_path = Utils_.toU(Paths.get(user.connection.sftpChannel.getHome(), Global.componentsServerProperties.BackupWorkspace).toString());
|
RemoteFile workspace = new RemoteFile(user.connection.sftpChannel.getHome(), "_sapfor_x64_backups", true);
|
||||||
RemoteFile workspace = new RemoteFile(workspace_path, true);
|
|
||||||
user.connection.MKDIR(workspace);
|
user.connection.MKDIR(workspace);
|
||||||
RemoteFile dst = new RemoteFile(workspace.full_name, src.getName());
|
RemoteFile dst = new RemoteFile(workspace.full_name, src.getName());
|
||||||
user.connection.putSingleFile(src, dst);
|
user.connection.putSingleFile(src, dst);
|
||||||
|
|||||||
@@ -2,16 +2,18 @@ package _VisualDVM.Passes.All;
|
|||||||
import Common.Passes.PassException;
|
import Common.Passes.PassException;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import _VisualDVM.ComponentsServer.Component.Component;
|
import _VisualDVM.ComponentsServer.Component.Component;
|
||||||
|
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import _VisualDVM.Passes.ProcessPass;
|
import _VisualDVM.Passes.ProcessPass;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.StandardCopyOption;
|
import java.nio.file.StandardCopyOption;
|
||||||
public class BuildComponent extends ProcessPass<Component> {
|
public class BuildComponent extends ProcessPass<Component> {
|
||||||
@Override
|
@Override
|
||||||
protected PassCode necessary() {
|
protected PassCode necessary() {
|
||||||
return PassCode.DownloadRepository;
|
return PassCode.DownloadSapforRepository;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected boolean resetsNecessary() {
|
protected boolean resetsNecessary() {
|
||||||
@@ -29,6 +31,11 @@ public class BuildComponent extends ProcessPass<Component> {
|
|||||||
@Override
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
ShowMessage1("Сборка " + target.getComponentType().getDescription());
|
ShowMessage1("Сборка " + target.getComponentType().getDescription());
|
||||||
|
if (target.getComponentType().equals(ComponentType.Sapfor_F)) {
|
||||||
|
File RepoSapfor = new File(Global.RepoDirectory, "SAPFOR");
|
||||||
|
File installationDirectory = new File(RepoSapfor, "install");
|
||||||
|
Utils_.CheckAndCleanDirectory(installationDirectory);
|
||||||
|
}
|
||||||
PerformScript(target.getAssemblyCommand());
|
PerformScript(target.getAssemblyCommand());
|
||||||
if (!target.getAssemblyFile().exists())
|
if (!target.getAssemblyFile().exists())
|
||||||
throw new PassException("Сборка не найдена");
|
throw new PassException("Сборка не найдена");
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
||||||
import _VisualDVM.Repository.Server.ServerCode;
|
import _VisualDVM.Repository.Server.ServerCode;
|
||||||
@@ -11,6 +11,7 @@ import org.apache.commons.io.FileUtils;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
public class CheckAccount extends ComponentsServerPass {
|
public class CheckAccount extends ComponentsServerPass {
|
||||||
|
File keyFile;
|
||||||
@Override
|
@Override
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
return "/icons/Registry.png";
|
return "/icons/Registry.png";
|
||||||
@@ -19,9 +20,9 @@ public class CheckAccount extends ComponentsServerPass {
|
|||||||
protected boolean isSafe() {
|
protected boolean isSafe() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
File keyFile;
|
|
||||||
void confirmEmail() throws Exception {
|
void confirmEmail() throws Exception {
|
||||||
ConfirmEmail confirmEmailPass = (ConfirmEmail) Global.mainModule.getPass(PassCode.ConfirmEmail);;
|
ConfirmEmail confirmEmailPass = (ConfirmEmail) Global.mainModule.getPass(PassCode.ConfirmEmail);
|
||||||
|
;
|
||||||
if (confirmEmailPass.Do(Global.mainModule.getAccount())) {
|
if (confirmEmailPass.Do(Global.mainModule.getAccount())) {
|
||||||
//подтвердили почту. теперь проверяем ее роль на сервере. если на сервере нет акка будет создан
|
//подтвердили почту. теперь проверяем ее роль на сервере. если на сервере нет акка будет создан
|
||||||
if (SendRequest(ServerCode.GetUserAccountByEmail, "", Global.mainModule.getAccount())) {
|
if (SendRequest(ServerCode.GetUserAccountByEmail, "", Global.mainModule.getAccount())) {
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ public class CheckRemoteWorkspace extends ComponentsServerPass<SubscriberWorkspa
|
|||||||
target = (SubscriberWorkspace) request.server_response.object;
|
target = (SubscriberWorkspace) request.server_response.object;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
import Common.Utils.Utils_;
|
import Common.Utils.Utils_;
|
||||||
|
import Common.Visual.UI;
|
||||||
import Common.Visual.Windows.Dialog.Text.ComboTextDialog;
|
import Common.Visual.Windows.Dialog.Text.ComboTextDialog;
|
||||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||||
import _VisualDVM.ComponentsServer.Component.Sapfor.TransformationPermission;
|
import _VisualDVM.ComponentsServer.Component.Sapfor.TransformationPermission;
|
||||||
@@ -54,9 +55,11 @@ public class CombineFiles extends Transformation {
|
|||||||
Vector<String> result_lines = new Vector<>();
|
Vector<String> result_lines = new Vector<>();
|
||||||
Vector<String> all_includes = new Vector<>();
|
Vector<String> all_includes = new Vector<>();
|
||||||
//-----------------------------
|
//-----------------------------
|
||||||
|
|
||||||
result_lines.add("!-Found " + target.allIncludes.size() + " headers");
|
result_lines.add("!-Found " + target.allIncludes.size() + " headers");
|
||||||
for (String name : target.allIncludes.keySet()) {
|
System.out.println("found "+target.allIncludes.size()+" headers");
|
||||||
all_includes.add(" include " + Utils_.Quotes(Utils_.toU(name)));
|
for (String name : target.allIncludes) {
|
||||||
|
all_includes.add(" include " + Utils_.Quotes(Utils_.toU(name))); //---
|
||||||
result_lines.add("! include " + Utils_.Quotes(Utils_.toU(name)));
|
result_lines.add("! include " + Utils_.Quotes(Utils_.toU(name)));
|
||||||
}
|
}
|
||||||
result_lines.add("!-Collapse-" + target.files_order.size() + " files");
|
result_lines.add("!-Collapse-" + target.files_order.size() + " files");
|
||||||
@@ -75,10 +78,8 @@ public class CombineFiles extends Transformation {
|
|||||||
for (String line : file_lines) {
|
for (String line : file_lines) {
|
||||||
String header = Utils.extractHeaderName(line);
|
String header = Utils.extractHeaderName(line);
|
||||||
if (header != null) {
|
if (header != null) {
|
||||||
if (file.relativeHeaders.containsKey(header))
|
if (file.dependencies.contains(header))
|
||||||
result_lines.add(" include " + Utils_.Quotes(
|
result_lines.add(" include " + Utils_.Quotes(Utils_.toU(header)));
|
||||||
Utils_.toU(
|
|
||||||
file.relativeHeaders.get(header).name)));
|
|
||||||
} else
|
} else
|
||||||
result_lines.add(line);
|
result_lines.add(line);
|
||||||
}
|
}
|
||||||
@@ -87,6 +88,7 @@ public class CombineFiles extends Transformation {
|
|||||||
result_lines.addAll(FileUtils.readLines(target.db.files.Data.get(name).file));
|
result_lines.addAll(FileUtils.readLines(target.db.files.Data.get(name).file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FileUtils.writeLines(result, result_lines, false);
|
FileUtils.writeLines(result, result_lines, false);
|
||||||
//-------------------------------
|
//-------------------------------
|
||||||
//теперь скопировать остальные файлы
|
//теперь скопировать остальные файлы
|
||||||
|
|||||||
39
src/_VisualDVM/Passes/All/CompareDVMRunTaskToEthalon.java
Normal file
39
src/_VisualDVM/Passes/All/CompareDVMRunTaskToEthalon.java
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package _VisualDVM.Passes.All;
|
||||||
|
import Common.CommonConstants;
|
||||||
|
import Common.Passes.Pass;
|
||||||
|
import Common.Utils.Utils_;
|
||||||
|
import _VisualDVM.Global;
|
||||||
|
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||||
|
public class CompareDVMRunTaskToEthalon extends Pass<DVMRunTask> {
|
||||||
|
DVMRunTask ethalon = null;
|
||||||
|
@Override
|
||||||
|
public String getIconPath() {
|
||||||
|
return "/icons/Comparsion.png";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getButtonText() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
|
target = null;
|
||||||
|
ethalon = null;
|
||||||
|
if (Global.testingServer.db.dvmRunTasks.getUI().CheckCurrent(Log)) {
|
||||||
|
//есть ли эталон у этой задачи.
|
||||||
|
target = Global.testingServer.db.dvmRunTasks.getUI().getCurrent();
|
||||||
|
if (target.ethalon_id != CommonConstants.Nan && Global.testingServer.db.dvmRunTasks.containsKey(target.ethalon_id)) {
|
||||||
|
ethalon = Global.testingServer.db.dvmRunTasks.get(target.ethalon_id);
|
||||||
|
return true;
|
||||||
|
} else Log.Writeln_("Не найдено эталона для задачи " + Utils_.Brackets(target.id) + " !");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void body() throws Exception {
|
||||||
|
Global.mainModule.getUI().getMainWindow().getTestingWindow().CompareCurrentDVMTaskToEthalon(ethalon, target);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void showFinish() throws Exception {
|
||||||
|
Global.mainModule.getUI().getMainWindow().getTestingWindow().FocusTestingTasksComparison();
|
||||||
|
}
|
||||||
|
}
|
||||||
32
src/_VisualDVM/Passes/All/CompareSapforPackageToEthalon.java
Normal file
32
src/_VisualDVM/Passes/All/CompareSapforPackageToEthalon.java
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package _VisualDVM.Passes.All;
|
||||||
|
import Common.CommonConstants;
|
||||||
|
import Common.Utils.Utils_;
|
||||||
|
import Common.Visual.UI;
|
||||||
|
import _VisualDVM.Global;
|
||||||
|
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||||
|
public class CompareSapforPackageToEthalon extends CompareSapforPackages {
|
||||||
|
@Override
|
||||||
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
|
master = null;
|
||||||
|
slave = null;
|
||||||
|
//--
|
||||||
|
target = Global.testingServer.db.sapforPackages.getUI().getSelectedOrCurrent();
|
||||||
|
if (target.size() == 1) {
|
||||||
|
SapforPackage sapforPackage = target.get(0);
|
||||||
|
if (sapforPackage.ethalon_id == CommonConstants.Nan) {
|
||||||
|
Log.Writeln_("Не найдено эталона для пакета " + Utils_.Brackets(sapforPackage.id) + " !");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Global.testingServer.db.sapforPackages.containsKey(sapforPackage.ethalon_id)) {
|
||||||
|
Log.Writeln_("Эталон " + Utils_.Brackets(sapforPackage.ethalon_id) + " не найден!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
SapforPackage ethalon = Global.testingServer.db.sapforPackages.get(sapforPackage.ethalon_id);
|
||||||
|
master = ethalon;
|
||||||
|
slave = sapforPackage;
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
return UI.Question("Отмечено более одного пакета. Желаете сравнить их") && super.canStart(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -7,8 +7,8 @@ import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
|||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class CompareSapforPackages extends Pass<Vector<SapforPackage>> {
|
public class CompareSapforPackages extends Pass<Vector<SapforPackage>> {
|
||||||
SapforPackage master;
|
protected SapforPackage master;
|
||||||
SapforPackage slave;
|
protected SapforPackage slave;
|
||||||
@Override
|
@Override
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
return "/icons/Comparsion.png";
|
return "/icons/Comparsion.png";
|
||||||
@@ -40,11 +40,11 @@ public class CompareSapforPackages extends Pass<Vector<SapforPackage>> {
|
|||||||
} else if (target.size() == 1) {
|
} else if (target.size() == 1) {
|
||||||
master = target.get(0);
|
master = target.get(0);
|
||||||
slave = null;
|
slave = null;
|
||||||
return true; //UI.Question("Отобразить пакет " + Utils_.Brackets(master.getPK()));
|
return true;
|
||||||
} else if ((target.size() == 0) && ((Global.testingServer.db.sapforPackages.getUI().getCurrent() != null))) {
|
} else if ((target.size() == 0) && ((Global.testingServer.db.sapforPackages.getUI().getCurrent() != null))) {
|
||||||
master = Global.testingServer.db.sapforPackages.getUI().getCurrent();
|
master = Global.testingServer.db.sapforPackages.getUI().getCurrent();
|
||||||
slave = null;
|
slave = null;
|
||||||
return true;// UI.Question("Отобразить пакет " + Utils_.Brackets(master.getPK()));
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Log.Writeln_("Для сравнения требуется отметить два пакета.\nДля отображения требуется отметить один пакет,или выделить его");
|
Log.Writeln_("Для сравнения требуется отметить два пакета.\nДля отображения требуется отметить один пакет,или выделить его");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user