промежуточный. временный фикс бага с отображением ядер если оба сервера не активно

This commit is contained in:
2023-11-30 01:25:26 +03:00
parent 53fd992346
commit 10b6cc03ab
9 changed files with 69 additions and 29 deletions

22
.idea/workspace.xml generated
View File

@@ -7,15 +7,15 @@
</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 afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersionState.java" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CreateTestFromFile.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/icons/AddFile.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/TestingBar/TestingBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/TestingBar/TestingBar.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.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/TestingSystem/SAPFOR/Json/SapforVersion_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/Json/SapforVersion_json.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/ProjectData/LanguageName.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/ProjectData/LanguageName.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/PerformSapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/PerformSapforTask.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CreateTestFromDirectory.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CreateTestFromDirectory.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTask/SapforTask.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionSummary.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTasksPackage/UI/VersionSummary.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/TestingForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/TestingForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/icons/versions/TestVersion.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/icons/versions/Empty.png" 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" />
@@ -37,8 +37,8 @@
<list> <list>
<option value="FxmlFile" /> <option value="FxmlFile" />
<option value="Interface" /> <option value="Interface" />
<option value="Class" />
<option value="Enum" /> <option value="Enum" />
<option value="Class" />
</list> </list>
</option> </option>
</component> </component>
@@ -93,7 +93,7 @@
<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$/src/icons/versions" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/src/icons" />
<property name="project.structure.last.edited" value="Artifacts" /> <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.2" /> <property name="project.structure.side.proportion" value="0.2" />
@@ -106,9 +106,9 @@
<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\icons" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" /> <recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" />
<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\icons" />
<recent name="C:\Users\misha\Documents\visual_dvm_2020\src\icons" /> <recent name="C:\Users\misha\Documents\visual_dvm_2020\src\icons" />
<recent name="C:\Users\misha\Documents\visual_dvm_2020\src\icons\Transformations" /> <recent name="C:\Users\misha\Documents\visual_dvm_2020\src\icons\Transformations" />
</key> </key>

View File

@@ -27,7 +27,8 @@ public class TestingBar extends VisualiserMenuBar {
sKernels.setPreferredSize(new Dimension(60, 26)); sKernels.setPreferredSize(new Dimension(60, 26));
sKernels.setMaximumSize(new Dimension(60, 26)); sKernels.setMaximumSize(new Dimension(60, 26));
sKernels.setModel(new SpinnerNumberModel(Global.properties.TestingKernels, 1, sKernels.setModel(new SpinnerNumberModel(Global.properties.TestingKernels, 1,
Utils.getTestingMaxKernels(), 1)); Utils.getTestingMaxKernels(),
1));
sKernels.setValue(Global.properties.TestingKernels); sKernels.setValue(Global.properties.TestingKernels);
UI.MakeSpinnerRapid(sKernels, e -> { UI.MakeSpinnerRapid(sKernels, e -> {
Global.properties.updateField("TestingKernels", sKernels.getValue()); Global.properties.updateField("TestingKernels", sKernels.getValue());

View File

@@ -1,6 +1,5 @@
package Common.Utils; package Common.Utils;
import Common.Constants; import Common.Constants;
import Common.Current;
import Common.Global; import Common.Global;
import Common.UI.UI; import Common.UI.UI;
import Common.Utils.Files.VDirectoryChooser; import Common.Utils.Files.VDirectoryChooser;
@@ -1056,11 +1055,9 @@ public class Utils {
} }
return false; return false;
} }
//временно.
public static int getTestingMaxKernels() { public static int getTestingMaxKernels() {
if (Current.HasAccount()) { return 64; // (Current.getAccount().isAdmin()) ? 64 : 14;
return (Current.getAccount().isAdmin()) ? 64 : 14;
}
return 1;
} }
//-- //--
public static boolean isCrushedLine(String line) { public static boolean isCrushedLine(String line) {

View File

@@ -1,5 +1,8 @@
package ProjectData; package ProjectData;
import org.fife.ui.rsyntaxtextarea.SyntaxConstants; import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
import java.util.Arrays;
import java.util.Vector;
public enum LanguageName { public enum LanguageName {
n, n,
fortran, fortran,
@@ -53,8 +56,8 @@ public enum LanguageName {
return SyntaxConstants.SYNTAX_STYLE_NONE; return SyntaxConstants.SYNTAX_STYLE_NONE;
} }
} }
public String getIcon(){ public String getIcon() {
switch (this){ switch (this) {
case fortran: case fortran:
return "/icons/Languages/Fortran.png"; return "/icons/Languages/Fortran.png";
case c: case c:
@@ -65,4 +68,25 @@ public enum LanguageName {
return ""; return "";
} }
} }
public Vector<String> getExtensions() {
String[] res;
switch (this) {
case fortran:
res = new String[]{"f", "fdv", "for", "f77", "f90", "h"};
break;
case c:
res = new String[]{"c", "cdv", "h"};
break;
case cpp:
res = new String[]{"cpp", "h"};
break;
default:
res = new String[]{};
break;
}
return new Vector<>(Arrays.asList(res));
}
public String PrintExtensions(){
return String.join(",", getExtensions());
}
} }

View File

@@ -57,7 +57,7 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
project_files = new Vector<>(); project_files = new Vector<>();
int subdirs = 0; int subdirs = 0;
int bad = 0; int bad = 0;
int fortran_programs = 0; int active_programs = 0;
int headers = 0; int headers = 0;
int other_project_files = 0; int other_project_files = 0;
//--- //---
@@ -89,16 +89,17 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
} }
if (file.isFile()) { if (file.isFile()) {
ProjectFile projectFile = new ProjectFile(file); ProjectFile projectFile = new ProjectFile(file);
project_files.add(projectFile);
switch (projectFile.fileType) { switch (projectFile.fileType) {
case program: case program:
if (projectFile.languageName.equals(group.language)) if (projectFile.languageName.equals(group.language)) {
fortran_programs++; active_programs++;
else project_files.add(projectFile);
} else
other_project_files++; other_project_files++;
break; break;
case header: case header:
headers++; headers++;
project_files.add(projectFile);
break; break;
default: default:
other_project_files++; other_project_files++;
@@ -114,15 +115,23 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
if (bad > 0) { if (bad > 0) {
return false; return false;
} }
if (fortran_programs == 0) { if (active_programs == 0) {
Log.Writeln_("Папка не содержит ни одной программы на языке " + group.language.getDescription() + "."); Log.Writeln_("Папка не содержит ни одной программы на языке " + group.language.getDescription() + ".");
return false; return false;
} }
/*
if (other_project_files > 0) { if (other_project_files > 0) {
Log.Writeln_("Папка содержит файлы, не являющиеся программами на языке " + Log.Writeln_("Папка содержит файлы, не являющиеся программами на языке " +
group.language.getDescription() + group.language.getDescription() +
", или заголовочными."); ", или заголовочными.");
return false; return false;
}
*/
if (project_files.isEmpty()){
Log.Writeln_("В папке не найдено файлов с допустимыми расширениями для языка "+
group.language.getDescription()+"\n"+
group.language.PrintExtensions()
);
} }
//----- //-----
target = new Test(); target = new Test();
@@ -136,6 +145,8 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
target.files = String.join("\n", filesNames); target.files = String.join("\n", filesNames);
return true; return true;
} }
protected void fillProjectFiles() throws Exception {
}
@Override @Override
protected void body() throws Exception { protected void body() throws Exception {
ShowMessage1(dir.getName()); ShowMessage1(dir.getName());

View File

@@ -0,0 +1,4 @@
package Visual_DVM_2021.Passes.All;
import Visual_DVM_2021.Passes.Pass_2021;
public class CreateTestFromFile extends Pass_2021 {
}

View File

@@ -301,12 +301,15 @@ public enum PassCode_2021 {
CreateTestFromDirectory, CreateTestFromDirectory,
CreateTestFromCurrentProject, CreateTestFromCurrentProject,
SPF_RemoveComments, SPF_RemoveComments,
CreateTestFromFile,
//-> //->
TestPass; TestPass;
public String getDescription() { public String getDescription() {
switch (this) { switch (this) {
case Undefined: case Undefined:
return "?"; return "?";
case CreateTestFromFile:
return "Создать тест из файла";
case SPF_RemoveComments: case SPF_RemoveComments:
return "Удаление комментариев"; return "Удаление комментариев";
case CreateTestFromCurrentProject: case CreateTestFromCurrentProject:

View File

@@ -58,8 +58,8 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
private final SapforPackagesComparisonForm sapforPackageTreeMaster; //сравнение деревьев пакетов SAPFOR. private final SapforPackagesComparisonForm sapforPackageTreeMaster; //сравнение деревьев пакетов SAPFOR.
private final SapforPackagesComparisonForm sapforPackageTreeSlave; private final SapforPackagesComparisonForm sapforPackageTreeSlave;
//-- //--
private SapforVersionsComparisonForm sapforVersionMaster; //сравнение версий тестов SAPFOR. private final SapforVersionsComparisonForm sapforVersionMaster; //сравнение версий тестов SAPFOR.
private SapforVersionsComparisonForm sapforVersionSlave; private final SapforVersionsComparisonForm sapforVersionSlave;
//-- //--
public TestingForm() { public TestingForm() {
content.add(UI.testingBar, BorderLayout.NORTH); content.add(UI.testingBar, BorderLayout.NORTH);

BIN
src/icons/AddFile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB