Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c3a669d497 | |||
| 9b76409781 | |||
| ed3d133dcd |
12
.idea/workspace.xml
generated
12
.idea/workspace.xml
generated
@@ -7,13 +7,7 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMTasks/DVMCompilationTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMTasks/DVMCompilationTask.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMTasks/DVMRunTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMTasks/DVMRunTask.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMTasks/DVMTask.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMTasks/DVMTask.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/RemoteDVMTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/RemoteDVMTestingPlanner.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/json/RunTask_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/json/RunTask_json.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -93,7 +87,7 @@
|
||||
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.SHOW" value="true" />
|
||||
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" />
|
||||
<property name="extract.method.default.visibility" value="public" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/icons/Transformations" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/src" />
|
||||
<property name="project.structure.last.edited" value="Artifacts" />
|
||||
<property name="project.structure.proportion" value="0.15" />
|
||||
<property name="project.structure.side.proportion" value="0.27322906" />
|
||||
@@ -106,10 +100,10 @@
|
||||
<recent name="controls.Trees" />
|
||||
</key>
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\Transformations" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_dif_utils" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\libs" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\Transformations" />
|
||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\DVM\DVMTasks\UI" />
|
||||
</key>
|
||||
<key name="MoveMembersDialog.RECENTS_KEY">
|
||||
|
||||
11
properties
11
properties
@@ -4,7 +4,7 @@
|
||||
"ServerUserPassword": "mprit_2011",
|
||||
"OfferRegistrationOnStart": true,
|
||||
"Workspace": "E:\\Tests",
|
||||
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\1331\\EP\\v1\\v1\\v4",
|
||||
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1749652835\\tmp_influxsys\\v3",
|
||||
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||
@@ -25,17 +25,16 @@
|
||||
"ComponentsWindowHeight": 250,
|
||||
"Kernels": 8,
|
||||
"LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe",
|
||||
"PrecompilationFlags": " ",
|
||||
"CheckTestingIntervalSeconds": 10,
|
||||
"AutoCheckTesting": true,
|
||||
"EmailOnTestingProgress": true,
|
||||
"CompleteCompilationOptions": true,
|
||||
"CompleteRunEnvironments": true,
|
||||
"CreateEthalonTasks": true,
|
||||
"ErasePackageWorkspace": false,
|
||||
"lastMachineId": 1,
|
||||
"lastUserId": 17,
|
||||
"lastCompilerId": 15,
|
||||
"ErasePackageWorkspace": true,
|
||||
"lastMachineId": 13,
|
||||
"lastUserId": 34,
|
||||
"lastCompilerId": 52,
|
||||
"RegisterOn": false,
|
||||
"SpacesOn": false,
|
||||
"EmptyLinesOn": false,
|
||||
|
||||
32
src/Common/Database/Objects/rDBObject.java
Normal file
32
src/Common/Database/Objects/rDBObject.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package Common.Database.Objects;
|
||||
import java.util.Date;
|
||||
//объект репозитория. ключ имя, и есть данные отправителя.
|
||||
public class rDBObject extends nDBObject {
|
||||
public String sender_name = "";
|
||||
public String sender_address = "";
|
||||
public String description = "";
|
||||
//-
|
||||
public long date = 0;
|
||||
public long change_date;
|
||||
public rDBObject(rDBObject src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
public rDBObject() {
|
||||
}
|
||||
public Date getDate() {
|
||||
return new Date(date);
|
||||
}
|
||||
public Date getChangeDate() {
|
||||
return new Date(change_date);
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
rDBObject r = (rDBObject) src;
|
||||
sender_name = r.sender_name;
|
||||
sender_address = r.sender_address;
|
||||
description = r.description;
|
||||
date = r.date;
|
||||
change_date = r.change_date;
|
||||
}
|
||||
}
|
||||
@@ -5,16 +5,16 @@ public class IntegerPairJson {
|
||||
public int key;
|
||||
@Expose
|
||||
public int value;
|
||||
public IntegerPairJson(int key_in, int value_in) {
|
||||
key = key_in;
|
||||
value = value_in;
|
||||
}
|
||||
public IntegerPairJson() {
|
||||
}
|
||||
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,5 +1,6 @@
|
||||
package Common.Visual;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import Common.Database.Objects.rDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Vector_;
|
||||
@@ -18,8 +17,7 @@ import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Date;
|
||||
import java.util.Vector;
|
||||
public class BugReport extends riDBObject {
|
||||
//---
|
||||
public class BugReport extends rDBObject {
|
||||
public String project_version = "";
|
||||
public long visualiser_version = -1;
|
||||
public long sapfor_version = -1;
|
||||
@@ -40,17 +38,13 @@ public class BugReport extends riDBObject {
|
||||
public File owner = null;
|
||||
@Description("IGNORE")
|
||||
public byte[] packed_archive = null;
|
||||
//--
|
||||
public long date = 0;
|
||||
public long change_date;
|
||||
//--
|
||||
public BugReport() {
|
||||
}
|
||||
public BugReport(BugReport src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
public BugReport(String sender_name_in, String sender_address_in, String description_in, String version_in) {
|
||||
id = CommonConstants.Nan;
|
||||
genName();
|
||||
sender_name = sender_name_in;
|
||||
sender_address = sender_address_in;
|
||||
project_version = version_in;
|
||||
@@ -82,16 +76,11 @@ public class BugReport extends riDBObject {
|
||||
descriptionAdditionDraft = b.descriptionAdditionDraft;
|
||||
commentAdditionDraft = b.commentAdditionDraft;
|
||||
owner = b.owner;
|
||||
change_date = b.change_date;
|
||||
}
|
||||
//--
|
||||
public File getHome() {
|
||||
return Utils_.getFile(System.getProperty("user.dir"), "BugReports", String.valueOf(id));
|
||||
}
|
||||
public File getArchiveFile() {
|
||||
return new File(getHome(),id + ".zip");
|
||||
return Paths.get(System.getProperty("user.dir"), "Bugs", id + ".zip").toFile();
|
||||
}
|
||||
//--
|
||||
public String getDescriptionHeader() {
|
||||
if (description != null) {
|
||||
String[] data = description.split("\n");
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.ComponentsServer.BugReport.UI.BugReportsForm;
|
||||
import _VisualDVM.ComponentsServer.BugReportFile.BugReportFile;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
|
||||
@@ -14,9 +13,9 @@ import javax.swing.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
public class BugReportsDBTable extends iDBTable<BugReport> {
|
||||
public class BugReportsDBTable extends DBTable<String, BugReport> {
|
||||
public BugReportsDBTable() {
|
||||
super(BugReport.class);
|
||||
super(String.class, BugReport.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
@@ -38,7 +37,6 @@ public class BugReportsDBTable extends iDBTable<BugReport> {
|
||||
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));
|
||||
res.put(BugReportFile.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
||||
return res;
|
||||
}
|
||||
//-
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package _VisualDVM.ComponentsServer.BugReport.Json;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.Serializable;
|
||||
public class BugReportAdditionJson implements Serializable {
|
||||
@Expose
|
||||
public int id = CommonConstants.Nan;
|
||||
public String id = "";
|
||||
@Expose
|
||||
public String fieldName = "";
|
||||
@Expose
|
||||
|
||||
@@ -101,14 +101,6 @@ public class BugReportsForm extends DataSetControlForm<BugReport> {
|
||||
return RendererStatusEnum.class;
|
||||
}
|
||||
}
|
||||
/*,
|
||||
new ColumnInfo<BugReport>("id_") {
|
||||
@Override
|
||||
public Object getFieldAt(BugReport object) {
|
||||
return object.id_;
|
||||
}
|
||||
}
|
||||
*/
|
||||
);
|
||||
}
|
||||
@Override
|
||||
@@ -151,7 +143,7 @@ public class BugReportsForm extends DataSetControlForm<BugReport> {
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(dataSource.getPluralDescription(),
|
||||
PassCode.SynchronizeBugReports,
|
||||
// PassCode.DownloadAllBugReportsArchives,
|
||||
PassCode.DownloadAllBugReportsArchives,
|
||||
PassCode.AddBugReport,
|
||||
PassCode.PublishBugReport,
|
||||
PassCode.OpenBugReportTestProject,
|
||||
@@ -162,14 +154,13 @@ public class BugReportsForm extends DataSetControlForm<BugReport> {
|
||||
}
|
||||
@Override
|
||||
protected Comparator<BugReport> getDefaultComparator() {
|
||||
|
||||
return (o1, o2) -> -Long.compare(o1.date, o2.date);
|
||||
return (o1, o2) -> -(o1.getDate().compareTo(o2.getDate()));
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(BugReport object) {
|
||||
return super.isObjectVisible(object) && (
|
||||
object.state.equals(BugReportState.draft) ||
|
||||
(String.valueOf(object.id)).toUpperCase().contains(filterKey.toUpperCase())
|
||||
object.id.toUpperCase().contains(filterKey.toUpperCase())
|
||||
&& object.sender_name.toUpperCase().contains(filterSenderName.toUpperCase())
|
||||
&& object.description.toUpperCase().contains(filterDescription.toUpperCase())
|
||||
&& object.comment.toUpperCase().contains(filterComment.toUpperCase())
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReportFile;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class BugReportFile extends riDBObject {
|
||||
@Description("DEFAULT -1")
|
||||
public int bugreport_id = CommonConstants.Nan;
|
||||
@Description("DEFAULT ''")
|
||||
public String name = "";
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
BugReportFile f = (BugReportFile) src;
|
||||
bugreport_id = f.bugreport_id;
|
||||
name = f.name;
|
||||
}
|
||||
//-
|
||||
public BugReportFile(BugReportFile src) {
|
||||
SynchronizeFields(src);
|
||||
}
|
||||
public BugReportFile() {
|
||||
}
|
||||
//-
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReportFile;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.ComponentsServer.BugReportFile.UI.BugReportFilesForm;
|
||||
|
||||
import javax.swing.*;
|
||||
public class BugReportFilesDBTable extends iDBTable<BugReportFile> {
|
||||
public BugReportFilesDBTable() {
|
||||
super(BugReportFile.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "файл";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "файлы";
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new BugReportFilesForm(this, mountPanel);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.BugReportFile.UI;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Tables.ColumnInfo;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReportFile.BugReportFile;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import javax.swing.*;
|
||||
public class BugReportFilesForm extends DataSetControlForm<BugReportFile> {
|
||||
public BugReportFilesForm(DataSet<?, BugReportFile> dataSource_in, JPanel mountPanel_in) {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
protected void createColumns() {
|
||||
AddColumns(
|
||||
new ColumnInfo<BugReportFile>("имя") {
|
||||
@Override
|
||||
public Object getFieldAt(BugReportFile object) {
|
||||
return object.name;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(BugReportFile object) {
|
||||
return super.isObjectVisible(object)&&Global.componentsServer.db.getTable(BugReport.class).getUI().matchCurrentID(object.bugreport_id);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
package _VisualDVM.ComponentsServer.BugReportRecipient;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class BugReportRecipient extends iDBObject {
|
||||
public String bugreport_id = "";
|
||||
public String email = "";
|
||||
@Description("DEFAULT '-1'")
|
||||
public int bugreport_id = CommonConstants.Nan;
|
||||
public BugReportRecipient() {
|
||||
}
|
||||
public BugReportRecipient(BugReport bugReport, String email_in) {
|
||||
|
||||
@@ -6,6 +6,6 @@ public class BugReportRecipientsDBTable extends iDBTable<BugReportRecipient> {
|
||||
}
|
||||
@Override
|
||||
public boolean isEqual(BugReportRecipient o1, BugReportRecipient o2) {
|
||||
return o1.bugreport_id==o2.bugreport_id && o1.email.equals(o2.email);
|
||||
return o1.bugreport_id.equals(o2.bugreport_id) && o1.email.equals(o2.email);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package _VisualDVM.ComponentsServer.BugReportSetting;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class BugReportSetting extends iDBObject {
|
||||
public String bugreport_id = "";
|
||||
public String name = "";
|
||||
public String value = "";
|
||||
@Description("DEFAULT '-1'")
|
||||
public int bugreport_id = CommonConstants.Nan;
|
||||
public BugReportSetting() {
|
||||
}
|
||||
public BugReportSetting(BugReport bugReport, String name_in, Object value_in) {
|
||||
|
||||
@@ -2,7 +2,6 @@ package _VisualDVM.ComponentsServer;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReportsDBTable;
|
||||
import _VisualDVM.ComponentsServer.BugReportFile.BugReportFilesDBTable;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipientsDBTable;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSettingsDBTable;
|
||||
@@ -15,7 +14,6 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
public BugReportsDBTable bugReports;
|
||||
public BugReportSettingsDBTable bugReportSettings;
|
||||
public BugReportRecipientsDBTable bugReportRecipients;
|
||||
public BugReportFilesDBTable bugReportsFiles;
|
||||
public RecipientsDataSet recipients = new RecipientsDataSet();
|
||||
public BugReportsDatabase() {
|
||||
super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile());
|
||||
@@ -25,13 +23,10 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
addTable(bugReports = new BugReportsDBTable());
|
||||
addTable(bugReportSettings = new BugReportSettingsDBTable());
|
||||
addTable(bugReportRecipients = new BugReportRecipientsDBTable());
|
||||
addTable(bugReportsFiles = new BugReportFilesDBTable());
|
||||
}
|
||||
@Override
|
||||
public void Init() throws Exception {
|
||||
DeleteDrafts();
|
||||
//--
|
||||
Patch();
|
||||
}
|
||||
@Override
|
||||
public PassCode getSynchronizePassCode() {
|
||||
@@ -63,72 +58,5 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
}
|
||||
}
|
||||
public void Patch() throws Exception {
|
||||
/*
|
||||
int i = 0;
|
||||
Vector<BugReport> sortedBugs = new Vector<>(bugReports.Data.values());
|
||||
sortedBugs.sort(new Comparator<BugReport>() {
|
||||
@Override
|
||||
public int compare(BugReport o1, BugReport o2) {
|
||||
return Long.compare(o1.date,o2.date);
|
||||
}
|
||||
});
|
||||
//--
|
||||
for (BugReport bugReport: sortedBugs){
|
||||
bugReport.id_ = i;
|
||||
++i;
|
||||
//--
|
||||
Update(bugReport);
|
||||
}
|
||||
//--
|
||||
for (BugReport bugReport: sortedBugs){
|
||||
Vector<BugReportSetting> bugSettings = getVectorByFK(bugReport, BugReportSetting.class);
|
||||
Vector<BugReportRecipient> bugReportRecipients = getVectorByFK(bugReport, BugReportRecipient.class);
|
||||
for (BugReportSetting setting: bugSettings){
|
||||
setting.bugreport_id_ = bugReport.id_;
|
||||
Update(setting);
|
||||
}
|
||||
for (BugReportRecipient recipient: bugReportRecipients){
|
||||
recipient.bugreport_id_ = bugReport.id_;
|
||||
Update(recipient);
|
||||
}
|
||||
}
|
||||
//перенос архивов
|
||||
for (BugReport bugReport: sortedBugs){
|
||||
System.out.println("bugreport_id="+bugReport.id+"/"+bugReport.id_);
|
||||
File new_home = new File(Global.BugReportsDirectory,String.valueOf(bugReport.id_));
|
||||
//--
|
||||
if (!new_home.exists())
|
||||
FileUtils.forceMkdir(new_home);
|
||||
//--
|
||||
Utils.CleanDirectory(new_home);
|
||||
//--
|
||||
File old_archive = new File(Global.BugReportsDirectory_OLD, bugReport.id);
|
||||
File new_archive = new File(new_home,String.valueOf(bugReport.id_)+".zip");
|
||||
if (old_archive.exists()) {
|
||||
FileUtils.copyFile(old_archive, new_archive);
|
||||
}
|
||||
}
|
||||
//--
|
||||
//упоминания других багов.
|
||||
for (BugReport bugReport: sortedBugs){
|
||||
//--
|
||||
Vector<String> mentioned_keys = new Vector<>();
|
||||
for (String id: bugReports.Data.keySet()){
|
||||
if ((bugReport.description.contains(id) || bugReport.comment.contains(id)) && !mentioned_keys.contains(id)){
|
||||
mentioned_keys.add(id);
|
||||
}
|
||||
}
|
||||
//--
|
||||
for (String id: mentioned_keys){
|
||||
BugReport owner = bugReports.get(id);
|
||||
if (owner!=null) {
|
||||
bugReport.comment = bugReport.comment.replace(id, String.valueOf(owner.id_));
|
||||
bugReport.description = bugReport.description.replace(id, String.valueOf(owner.id_));
|
||||
Update(bugReport);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package _VisualDVM.ComponentsServer.Component.Json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class VersionInfo_json {
|
||||
@Expose
|
||||
public int version;
|
||||
@Expose
|
||||
public String build_date;
|
||||
@Expose
|
||||
public String build_time;
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import Common.Passes.PassException;
|
||||
import Common.Utils.Pair;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.ComponentsServer.Component.Json.VersionInfo_json;
|
||||
import _VisualDVM.ComponentsServer.Component.OSDComponent;
|
||||
import _VisualDVM.ComponentsServer.Component.Visualizer_2;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
@@ -13,16 +13,16 @@ import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.ProjectData.SapforData.ModifiedFile_json;
|
||||
import _VisualDVM.ProjectData.SapforData.SapforResult_json;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.Utils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public abstract class Sapfor extends OSDComponent {
|
||||
public static final int empty_code = -100;
|
||||
public static final int canceled_code = -99;
|
||||
@@ -33,6 +33,8 @@ public abstract class Sapfor extends OSDComponent {
|
||||
public Vector<String> Intrinsics = new Vector<>();
|
||||
public LinkedHashMap<String, String> ModifiedFiles = new LinkedHashMap<>();
|
||||
public LinkedHashMap<String, String> OldFiles = new LinkedHashMap<>();
|
||||
int size;
|
||||
int[] sizes;
|
||||
String PID = "";
|
||||
private int errorCode;
|
||||
private String result;
|
||||
@@ -72,8 +74,7 @@ public abstract class Sapfor extends OSDComponent {
|
||||
PassCode.SPF_PrivateShrinking,
|
||||
PassCode.SPF_PrivateExpansion,
|
||||
PassCode.SPF_PrivateRemoving,
|
||||
PassCode.SPF_InsertPrivateFromGUI,
|
||||
PassCode.SPF_InsertPrivateArrayDirectives
|
||||
PassCode.SPF_InsertPrivateFromGUI
|
||||
};
|
||||
}
|
||||
public static PassCode[] getProceduresTransformationsCodes() {
|
||||
@@ -107,10 +108,9 @@ public abstract class Sapfor extends OSDComponent {
|
||||
}
|
||||
public static PassCode[] getPreparationTransformationsCodes() {
|
||||
return new PassCode[]{
|
||||
PassCode.SPF_CorrectCodeStylePass,
|
||||
PassCode.SPF_MoveOperators,
|
||||
PassCode.SPF_RenameIncludes,
|
||||
PassCode.SPF_InsertIncludesPass,
|
||||
PassCode.SPF_CorrectCodeStylePass,
|
||||
PassCode.SPF_ConvertStructures,
|
||||
PassCode.SPF_CreateCheckpoints,
|
||||
PassCode.SPF_InitDeclsWithZero,
|
||||
@@ -152,7 +152,6 @@ public abstract class Sapfor extends OSDComponent {
|
||||
res.add(PassCode.SPF_PrivateShrinking);//+
|
||||
res.add(PassCode.SPF_PrivateExpansion);//+
|
||||
res.add(PassCode.SPF_PrivateRemoving);//+
|
||||
res.add(PassCode.SPF_InsertPrivateArrayDirectives);
|
||||
//--
|
||||
res.add(PassCode.SPF_RemoveUnusedFunctions);//+
|
||||
res.add(PassCode.SPF_DuplicateFunctionChains);//+
|
||||
@@ -164,7 +163,6 @@ public abstract class Sapfor extends OSDComponent {
|
||||
res.add(PassCode.SPF_InsertDvmhRegions);//+
|
||||
res.add(PassCode.SPF_SharedMemoryParallelization);//+
|
||||
res.add(PassCode.SPF_InsertImplicitNone);//+
|
||||
res.add(PassCode.SPF_MoveOperators);
|
||||
res.add(PassCode.CreateParallelVariants); //?
|
||||
return res;
|
||||
}
|
||||
@@ -207,10 +205,8 @@ public abstract class Sapfor extends OSDComponent {
|
||||
Utils_.CheckDirectory(data_workspace);
|
||||
File outputFile = new File(data_workspace, outName);
|
||||
File errorsFile = new File(data_workspace, errName);
|
||||
// File logFile = new File(data_workspace, "log.txt");
|
||||
Utils_.forceDeleteWithCheck(outputFile);
|
||||
Utils_.forceDeleteWithCheck(errorsFile);
|
||||
// Utils_.forceDeleteWithCheck(logFile);
|
||||
//---
|
||||
File file = new File(data_workspace, name + (Utils_.isWindows() ? ".bat" : ".sh"));
|
||||
FileUtils.write(file,
|
||||
@@ -226,36 +222,20 @@ public abstract class Sapfor extends OSDComponent {
|
||||
if (!file.setExecutable(true))
|
||||
throw new Exception("Не удалось сделать файл скрипта " + name + " исполняемым!");
|
||||
//-- Windows
|
||||
//запустить процесс
|
||||
boolean process_started = false;
|
||||
boolean flag = false;
|
||||
do {
|
||||
try {
|
||||
ProcessBuilder procBuilder = new ProcessBuilder(file.getAbsolutePath());
|
||||
procBuilder.directory(workspace);
|
||||
process = procBuilder.start();
|
||||
process_started = true;
|
||||
exit_code = process.waitFor();
|
||||
flag = true;
|
||||
} catch (Exception ex) {
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
Utils_.sleep(1000);
|
||||
}
|
||||
}
|
||||
while (!process_started);
|
||||
//--
|
||||
for (int i=0; i<40; ++i){
|
||||
if (process.waitFor(1, TimeUnit.SECONDS)){
|
||||
//дождались. все хорошо.
|
||||
exit_code=0;
|
||||
// FileUtils.writeStringToFile(logFile,sapfor_drv.getName()+" done for "+i+" seconds");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (exit_code!=0){
|
||||
// FileUtils.writeStringToFile(logFile,sapfor_drv.getName()+" timeout");
|
||||
//-
|
||||
Process killer = Runtime.getRuntime().exec("pkill -SIGKILL -f "+sapfor_drv.getName());
|
||||
killer.waitFor();
|
||||
//-
|
||||
}
|
||||
while (!flag);
|
||||
process = null;
|
||||
//---
|
||||
Vector<String> outputLines = new Vector<>(FileUtils.readLines(outputFile));
|
||||
@@ -440,9 +420,7 @@ public abstract class Sapfor extends OSDComponent {
|
||||
public void GetVersionInfo() {
|
||||
try {
|
||||
RunAnalysis("SPF_GetVersionAndBuildDate", -1, "", "");
|
||||
VersionInfo_json versionInfo_json = Utils_.gson.fromJson(getResult(),VersionInfo_json.class);
|
||||
version = versionInfo_json.version;
|
||||
date_text = versionInfo_json.build_date+" "+ versionInfo_json.build_time;
|
||||
Visualizer_2.UnpackVersionInfo(this, getResult());
|
||||
} catch (Exception e) {
|
||||
Utils_.MainLog.PrintException(e);
|
||||
UI.Error("Не удалось получить версию компонента " + Utils_.DQuotes(getComponentType().getDescription()));
|
||||
@@ -524,21 +502,6 @@ public abstract class Sapfor extends OSDComponent {
|
||||
this.predictorStats = predictorStats;
|
||||
}
|
||||
public void decodeString(String runResult) throws Exception {
|
||||
SapforResult_json resultJson = Utils_.gson.fromJson(runResult, SapforResult_json.class);
|
||||
//---
|
||||
setErrorCode(resultJson.errorCode);
|
||||
setOutput(resultJson.output);
|
||||
setResult(resultJson.result);
|
||||
setOutputMessage(resultJson.outputMessage);
|
||||
setPredictorStats(resultJson.predictorStats);
|
||||
//--
|
||||
if (resultJson.files!=null && !resultJson.files.isEmpty()){
|
||||
for (ModifiedFile_json file: resultJson.files){
|
||||
ModifiedFiles.put(Utils_.toW(file.name), file.text);
|
||||
}
|
||||
}
|
||||
//--
|
||||
/*
|
||||
int codeIdx = runResult.indexOf(' ');
|
||||
if (codeIdx == -1) throw new PassException("Wrong input parameter");
|
||||
setErrorCode(Integer.parseInt(runResult.substring(0, codeIdx)));
|
||||
@@ -582,12 +545,13 @@ public abstract class Sapfor extends OSDComponent {
|
||||
}
|
||||
codeIdx += count;
|
||||
}
|
||||
*/
|
||||
}
|
||||
//-
|
||||
public void Command(String request_in) throws Exception {
|
||||
setErrorCode(empty_code);
|
||||
outputMessage = output = result = predictorStats = "";
|
||||
size = 0;
|
||||
sizes = null;
|
||||
ModifiedFiles.clear();
|
||||
//модификации.-------------------------------------------------------------->>>>
|
||||
decodeString(Global.visualizer_2.Command(request_in).replace((char) 1, '\n'));
|
||||
@@ -608,17 +572,15 @@ public abstract class Sapfor extends OSDComponent {
|
||||
String addOpts) throws Exception {
|
||||
Command("transformation:" + pack(transformName, options, projName, folderName, addOpts) + winHandler);
|
||||
}
|
||||
public void RunModification(String modifyName, int winHandler, String options, String projName,
|
||||
String folderName, String addOpt1, String addOpt2) throws Exception {
|
||||
Command("modification:" + pack(modifyName, options, projName, folderName, addOpt1, addOpt2) + winHandler);
|
||||
}
|
||||
//--
|
||||
/*
|
||||
/*
|
||||
Модификации:
|
||||
SPF_ModifyArrayDistribution (addOpt1_c -> regId, addOpt2_c-> int64_t arrArrs, '|' as delimiter)
|
||||
SPF_InlineProcedure (addOpt1_c -> name | file, addOpt2_c-> line)
|
||||
*/
|
||||
//--
|
||||
public void RunModification(String modifyName, int winHandler, String options, String projName,
|
||||
String folderName, String addOpt1, String addOpt2) throws Exception {
|
||||
Command("modification:" + pack(modifyName, options, projName, folderName, addOpt1, addOpt2) + winHandler);
|
||||
}
|
||||
public void GetIntrinsics() throws Exception {
|
||||
Intrinsics.clear();
|
||||
if (RunAnalysis("SPF_GetIntrinsics", -1, "", "") >= 0) {
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.io.PrintWriter;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Date;
|
||||
public class Visualizer_2 extends OSDComponent {
|
||||
public String PID = "";
|
||||
//</editor-fold>
|
||||
@@ -28,15 +27,11 @@ public class Visualizer_2 extends OSDComponent {
|
||||
port = port_in;
|
||||
}
|
||||
public static void UnpackVersionInfo(Component component, String packed) {
|
||||
|
||||
String[] data = packed.split("\\|");
|
||||
//лишний пробел.
|
||||
String text = data[0].substring(0, data[0].length() - 1);
|
||||
component.date_text = data[1] + data[2] + data[3];
|
||||
component.version = Long.parseLong(text);
|
||||
|
||||
// component.version = 6666;
|
||||
// component.date_text = new Date().toString();
|
||||
}
|
||||
//<editor-fold desc="компонент">
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
}
|
||||
@Override
|
||||
protected void extraBackup(File todayBackUp) {
|
||||
zip.Do("BugReports", new File(todayBackUp, "BugReports.zip").getAbsolutePath());
|
||||
zip.Do("Bugs", new File(todayBackUp, "Bugs.zip").getAbsolutePath());
|
||||
}
|
||||
@Override
|
||||
public Database getDb() {
|
||||
@@ -55,9 +55,18 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
return super.getDb();
|
||||
}
|
||||
@Override
|
||||
protected void beforePublishAction(DBObject object) throws Exception {
|
||||
if (object instanceof BugReport) {
|
||||
BugReport bugReport = (BugReport) object;
|
||||
if (bugReport.packed_archive != null) {
|
||||
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", bugReport.id);
|
||||
Utils_.bytesToFile(bugReport.packed_archive, bugArchive);
|
||||
}
|
||||
}
|
||||
}
|
||||
@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) {
|
||||
@@ -68,14 +77,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
if (bugReport.recipients != null) {
|
||||
db.saveBugreportRecipients(bugReport);
|
||||
}
|
||||
//-->
|
||||
Utils_.CheckAndCleanDirectory(bugReport.getHome());
|
||||
//-->
|
||||
if (bugReport.packed_archive != null) {
|
||||
File bugArchive = bugReport.getArchiveFile();
|
||||
Utils_.bytesToFile(bugReport.packed_archive, bugArchive);
|
||||
bugReport.packed_archive = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@@ -93,7 +94,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
protected void afterDeleteAction(DBObject object) throws Exception {
|
||||
if (object instanceof BugReport) {
|
||||
BugReport bugReport = (BugReport) object;
|
||||
Utils_.forceDeleteWithCheck(bugReport.getHome());
|
||||
if (!bugReport.project_version.isEmpty()) Utils_.forceDeleteWithCheck(bugReport.getArchiveFile());
|
||||
} else if (object instanceof UserAccount) {
|
||||
UserAccount account = (UserAccount) object;
|
||||
Utils_.forceDeleteWithCheck(account.getServerKeyFile());
|
||||
@@ -169,7 +170,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
void ReceiveAllArchives() throws Exception {
|
||||
ZipFolderPass zip = new ZipFolderPass();
|
||||
File archives = new File(Utils_.getDateName("Bugs"));
|
||||
if (zip.Do("BugReports", archives.getAbsolutePath())) {
|
||||
if (zip.Do("Bugs", archives.getAbsolutePath())) {
|
||||
response.object = Utils_.fileToBytes(archives);
|
||||
} else throw new RepositoryRefuseException("Не удалось запаковать архивы");
|
||||
}
|
||||
@@ -178,7 +179,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
response.arg = credentials_db.userAccounts.getPackedActiveRecipients();
|
||||
}
|
||||
void ReceiveBugReport() throws Exception {
|
||||
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "BugReports", request.arg, request.arg + ".zip");
|
||||
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", request.arg);
|
||||
response.object = Utils_.fileToBytes(bugArchive);
|
||||
}
|
||||
void UpdateBugReport() throws Exception {
|
||||
|
||||
@@ -2,6 +2,7 @@ package _VisualDVM.ComponentsServer.UserAccount;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.Global;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@@ -74,6 +75,20 @@ public class UserAccount extends iDBObject {
|
||||
public boolean CheckAccessRights(String address_in, TextLog log) {
|
||||
return (CheckRegistered(log) && CheckAuthorship(address_in, log));
|
||||
}
|
||||
public boolean ExtendedCheckAccessRights(BugReport bugReport, TextLog log) {
|
||||
if (CheckRegistered(log)) {
|
||||
if (email.equals(bugReport.executor_address)) {
|
||||
//метод вывести как нерабочий.когда будет изменена схема админства.
|
||||
return true;
|
||||
} else {
|
||||
if (!isAdmin() && (!email.equals(bugReport.sender_address))) {
|
||||
log.Writeln_("Вы не являетесь автором, исполнителем, или администратором");
|
||||
return false;
|
||||
} else return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean isAdmin() {
|
||||
return role.equals(AccountRole.Admin);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ import Common.Utils.Vector_;
|
||||
|
||||
import java.util.Vector;
|
||||
public class Constants {
|
||||
public static final int version = 1266;
|
||||
public static final int planner_version = 26;
|
||||
public static final int version = 1253;
|
||||
public static final int planner_version = 24;
|
||||
public static final int testingMaxKernels = 64;
|
||||
//--
|
||||
public static final String ApplicationFileName = "VisualSapfor.jar";
|
||||
@@ -105,7 +105,6 @@ public class Constants {
|
||||
"starter.cpp",
|
||||
"launcher.cpp",
|
||||
//--
|
||||
"json.hpp",
|
||||
"Array.h",
|
||||
"CompilationSupervisor.h",
|
||||
"CompilationTask.h",
|
||||
|
||||
@@ -65,7 +65,7 @@ public class Global {
|
||||
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
//-
|
||||
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), "BugReports"));
|
||||
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils_.CheckDirectory(BackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.BackUpsDirectoryName));
|
||||
Utils_.CheckDirectory(ProjectsDirectory = new File(Utils_.getHomeDirectory(), Constants.ProjectsDirectoryName));
|
||||
Utils_.CheckDirectory(CompilationTasksDirectory = new File(Utils_.getHomeDirectory(), Constants.CompilationTasksDirectoryName));
|
||||
@@ -88,7 +88,7 @@ public class Global {
|
||||
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
Utils_.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
|
||||
//--
|
||||
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), "BugReports"));
|
||||
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils_.CheckDirectory(KeysDirectory = new File(Utils_.getHomeDirectory(), Constants.KeyDirectoryName));
|
||||
}
|
||||
public static void CheckTestingSystemDirectories() {
|
||||
|
||||
@@ -65,8 +65,6 @@ public class NormalProperties extends VisualDVMProperties {
|
||||
public int Kernels = Utils.getHalfKernels();
|
||||
@Expose
|
||||
public String LocalMakePathWindows = "C:\\MinGW\\msys\\1.0\\bin\\make.exe";
|
||||
@Expose
|
||||
public String PrecompilationFlags = "";
|
||||
//--тестирование
|
||||
@Expose
|
||||
public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования
|
||||
@@ -125,8 +123,6 @@ public class NormalProperties extends VisualDVMProperties {
|
||||
@Override
|
||||
public String getFieldDescription(String fieldName) {
|
||||
switch (fieldName) {
|
||||
case "PrecompilationFlags":
|
||||
return "Опции предварительной компиляции";
|
||||
case "ErasePackageWorkspace":
|
||||
return "Очистка рабочего пространства пакета на целевой машине";
|
||||
case "CompleteCompilationOptions":
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Database;
|
||||
import Common.Passes.AddObjectPass;
|
||||
import Common.Utils.Utils_;
|
||||
@@ -31,10 +30,6 @@ public class AddBugReport extends AddObjectPass<BugReport> {
|
||||
Log.Writeln_("Для создания отчёта требуется регистрация");
|
||||
return false;
|
||||
}
|
||||
if (getDb().getTable(BugReport.class).containsKey(CommonConstants.Nan)){
|
||||
Log.Writeln_("Может существовать не более одного черновика одновременно!");
|
||||
return false;
|
||||
}
|
||||
if (Global.mainModule.HasProject()) {
|
||||
String version = Global.mainModule.getProject().Home.getAbsolutePath().substring(Global.mainModule.getRoot().Home.getParent().length());
|
||||
if (version.toCharArray()[0] == '\\') version = version.substring(1);
|
||||
@@ -44,7 +39,7 @@ public class AddBugReport extends AddObjectPass<BugReport> {
|
||||
} else {
|
||||
if (UI.Warning("Создать отчёт об ошибке без прикрепления проекта.")) {
|
||||
target = new BugReport();
|
||||
target.id = CommonConstants.Nan;
|
||||
target.genName();
|
||||
target.sender_name = Global.mainModule.getAccount().name;
|
||||
target.sender_address = Global.mainModule.getAccount().email;
|
||||
target.project_version = "";
|
||||
@@ -67,12 +62,10 @@ public class AddBugReport extends AddObjectPass<BugReport> {
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
//--
|
||||
Utils_.CheckAndCleanDirectory(target.getHome());
|
||||
//--
|
||||
super.body();
|
||||
if (!target.project_version.isEmpty()) {
|
||||
Global.mainModule.getRoot().cleanDepAndGCOVR(); //удаление депов и гкова
|
||||
//логи во вложения. todo переделать в полноценные вложения.
|
||||
//логи во вложения.
|
||||
File attachementsDir = Global.mainModule.getProject().getAttachmentsDirectory();
|
||||
Vector<File> logs = new Vector<>();
|
||||
logs.add(Utils_.MainLog.getLogFile());
|
||||
@@ -87,7 +80,6 @@ public class AddBugReport extends AddObjectPass<BugReport> {
|
||||
Global.mainModule.getPass(PassCode.ZipFolderPass).Do(Global.mainModule.getRoot().Home.getAbsolutePath(),
|
||||
target.getArchiveFile().getAbsolutePath());
|
||||
}
|
||||
getDb().getTable(BugReport.class).put(target.id, target);
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
|
||||
@@ -76,7 +76,6 @@ public class AppendBugReportField extends ComponentsServerPass<BugReport> {
|
||||
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
|
||||
message_text
|
||||
);
|
||||
|
||||
Global.mainModule.getPass(PassCode.Email).Do(
|
||||
message,
|
||||
Global.componentsServer.db.recipients.getSelectedMails());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.Text.ComboTextDialog;
|
||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.ComponentsServer.Component.Sapfor.TransformationPermission;
|
||||
@@ -54,8 +55,9 @@ public class CombineFiles extends Transformation {
|
||||
Vector<String> result_lines = new Vector<>();
|
||||
Vector<String> all_includes = new Vector<>();
|
||||
//-----------------------------
|
||||
|
||||
result_lines.add("!-Found " + target.allIncludes.size() + " headers");
|
||||
System.out.println("found " + target.allIncludes.size() + " headers");
|
||||
System.out.println("found "+target.allIncludes.size()+" headers");
|
||||
for (String name : target.allIncludes) {
|
||||
all_includes.add(" include " + Utils_.Quotes(Utils_.toU(name))); //---
|
||||
result_lines.add("! include " + Utils_.Quotes(Utils_.toU(name)));
|
||||
@@ -86,6 +88,7 @@ public class CombineFiles extends Transformation {
|
||||
result_lines.addAll(FileUtils.readLines(target.db.files.Data.get(name).file));
|
||||
}
|
||||
}
|
||||
|
||||
FileUtils.writeLines(result, result_lines, false);
|
||||
//-------------------------------
|
||||
//теперь скопировать остальные файлы
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Passes.DeleteObjectPass;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
@@ -16,7 +15,6 @@ public class DeleteBugReport extends DeleteObjectPass<BugReport> {
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
Utils_.forceDeleteWithCheck(target.getHome());
|
||||
Global.mainModule.getPass(PassCode.DeleteBugReportFromServer).Do(target);
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
@@ -11,7 +10,6 @@ import org.apache.commons.io.FileUtils;
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class DownloadAllBugReportsArchives extends ComponentsServerPass<File> {
|
||||
//упраздненный временно проход.
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/DownloadAll.png";
|
||||
@@ -46,12 +44,10 @@ public class DownloadAllBugReportsArchives extends ComponentsServerPass<File> {
|
||||
//теперь скопировать это в папку Bugs, с нормальными именами через zip
|
||||
File t2 = Paths.get(tempFolder.getAbsolutePath(), "Bugs").toFile();
|
||||
File[] archives = t2.listFiles();
|
||||
/*
|
||||
if (archives != null) {
|
||||
for (File file : archives) {
|
||||
FileUtils.moveFile(file, Paths.get(Global.BugReportsDirectory_OLD.getAbsolutePath(), file.getName() + ".zip").toFile());
|
||||
FileUtils.moveFile(file, Paths.get(Global.BugReportsDirectory.getAbsolutePath(), file.getName() + ".zip").toFile());
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ public class DownloadBugReport extends ComponentsServerPass<BugReport> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
target = (BugReport) args[0];
|
||||
return !target.getArchiveFile().exists() && SendRequest(ServerCode.ReceiveBugReport, String.valueOf(target.id));
|
||||
return !target.getArchiveFile().exists() && SendRequest(ServerCode.ReceiveBugReport, target.id);
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
@@ -16,7 +16,6 @@ public class DownloadBugReport extends ComponentsServerPass<BugReport> {
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Utils_.CheckAndCleanDirectory(target.getHome());
|
||||
Utils_.bytesToFile((byte[]) request.server_response.object, target.getArchiveFile());
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@ public class OpenBugReportTestProject extends Pass<BugReport> {
|
||||
if (Global.componentsServer.db.CheckCurrent(Log, BugReport.class) &&
|
||||
(target = Global.componentsServer.db.bugReports.getUI().getCurrent()).CheckNotDraft(Log)) {
|
||||
if (!target.project_version.isEmpty()) {
|
||||
root = new File(Global.visualiser.getDownloadsDirectory(), String.valueOf(target.id));
|
||||
root = new File(Global.visualiser.getDownloadsDirectory(), target.id);
|
||||
project = new File(root,
|
||||
Utils_.isWindows() ? Utils_.toW(target.project_version) : Utils_.toU(target.project_version)
|
||||
);
|
||||
|
||||
@@ -121,7 +121,7 @@ public class Precompilation extends Pass<db_project_info> {
|
||||
return "";
|
||||
}
|
||||
protected String getFortranFlags() {
|
||||
return Global.normalProperties.PrecompilationFlags;
|
||||
return "";
|
||||
}
|
||||
protected void prepareForParse() throws Exception {
|
||||
target.CleanAnalyses();
|
||||
@@ -212,11 +212,7 @@ public class Precompilation extends Pass<db_project_info> {
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return outputLines.stream().noneMatch(
|
||||
line -> (line.toLowerCase().startsWith("error")
|
||||
|| line.toLowerCase().startsWith("gfortran.exe: error:")
|
||||
|| line.toLowerCase().startsWith("gfortran: error:")
|
||||
));
|
||||
return outputLines.stream().noneMatch(line -> line.toLowerCase().startsWith("error"));
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class PublishBugReport extends PublishServerObject<ComponentsServer, BugR
|
||||
protected void performDone() throws Exception {
|
||||
//3- рассылка
|
||||
EmailMessage message = new EmailMessage(
|
||||
"Обнаружена ошибка " + Utils_.Brackets(pk),
|
||||
"Обнаружена ошибка " + Utils_.Brackets(target.id),
|
||||
target.getNewMailText()
|
||||
);
|
||||
Global.mainModule.getPass(PassCode.Email).Do(
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Index;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ArrayDecl;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ArraysJson;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.ProjectArray;
|
||||
|
||||
import javax.rmi.CORBA.Util;
|
||||
import java.math.BigInteger;
|
||||
public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
|
||||
@Override
|
||||
public String phase() {
|
||||
@@ -27,11 +32,11 @@ public class SPF_GetAllDeclaratedArrays extends SapforAnalysis {
|
||||
@Override
|
||||
public void unpack(String packed) throws Exception {
|
||||
ArraysJson arraysJson = Utils_.gson.fromJson(packed, ArraysJson.class);
|
||||
for (ProjectArray array : arraysJson.allArrays) {
|
||||
for (ProjectArray array: arraysJson.allArrays){
|
||||
array.Init();
|
||||
target.declaratedArrays.put(array.id, array);
|
||||
//--
|
||||
for (ArrayDecl decl : array.declPlaces) {
|
||||
for (ArrayDecl decl: array.declPlaces){
|
||||
DBProjectFile projectFile = target.db.files.get(decl.file);
|
||||
projectFile.array_decls.add(decl);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Index;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Vector_;
|
||||
import Common.Visual.Controls.PassControl;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||
@@ -25,7 +27,7 @@ public class SPF_GetArrayDistributionOnlyAnalysis extends SapforAnalysis {
|
||||
@Override
|
||||
protected void unpack(String packed) throws Exception {
|
||||
RegionsJson regionsJson = Utils_.gson.fromJson(packed, RegionsJson.class);
|
||||
for (ParallelRegion parallelRegion : regionsJson.allRegions) {
|
||||
for (ParallelRegion parallelRegion: regionsJson.allRegions){
|
||||
parallelRegion.Init();
|
||||
target.parallelRegions.put(parallelRegion.regionId, parallelRegion);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Index;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
|
||||
@@ -12,7 +13,7 @@ public class SPF_GetArrayDistributionOnlyRegions extends SapforAnalysis {
|
||||
@Override
|
||||
protected void unpack(String packed) throws Exception {
|
||||
RegionsJson regionsJson = Utils_.gson.fromJson(packed, RegionsJson.class);
|
||||
for (ParallelRegion parallelRegion : regionsJson.allRegions) {
|
||||
for (ParallelRegion parallelRegion: regionsJson.allRegions){
|
||||
parallelRegion.Init();
|
||||
target.parallelRegions.put(parallelRegion.regionId, parallelRegion);
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@ public class SPF_GetArrayLinks extends SilentSapforPass {
|
||||
id_2|number_2|link_id1|link_id2|link_id3
|
||||
*/
|
||||
//эту инфу суем в список объявленных массивов, чтобы не плодить лишних таблиц.
|
||||
System.out.println("packed=" + Utils_.Brackets(packed));
|
||||
System.out.println("packed="+ Utils_.Brackets(packed));
|
||||
ProjectArray current_array = null;
|
||||
ArrayLinksJson links = Utils_.gson.fromJson(packed, ArrayLinksJson.class);
|
||||
for (ArrayLinkJson link : links.allLinks) {
|
||||
for (ArrayLinkJson link: links.allLinks){
|
||||
current_array = target.declaratedArrays.get(link.id);
|
||||
current_array.links.clear();
|
||||
for (long link_id : link.links) {
|
||||
for (long link_id: link.links){
|
||||
current_array.links.put(link_id, target.declaratedArrays.get(link_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,16 +55,17 @@ public class SPF_GetGCovInfo extends SilentSapforPass {
|
||||
}
|
||||
protected void unpack(String packed) throws Exception {
|
||||
GCOVJson allJson = Utils_.gson.fromJson(packed, GCOVJson.class);
|
||||
for (FileGCOVJson fileJson : allJson.allGCov) {
|
||||
for (FileGCOVJson fileJson: allJson.allGCov){
|
||||
fileJson.file = Utils_.toW(fileJson.file);
|
||||
//--
|
||||
DBProjectFile projectFile = target.db.files.get(fileJson.file);
|
||||
for (LineGCOVJson lineJson : fileJson.lines) {
|
||||
for (LineGCOVJson lineJson: fileJson.lines){
|
||||
if (lineJson.line > 0) {
|
||||
int v_line = lineJson.line - 1;
|
||||
long v_execution = (lineJson.execution >= 0) ? lineJson.execution : 0;
|
||||
if (!projectFile.gcov_info.line_info.containsKey(v_line)) {
|
||||
projectFile.gcov_info.add_line(v_line, v_execution);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,9 +44,9 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
||||
FileInfo fileInfo = new FileInfo(fileIncludesJson.file);
|
||||
//---
|
||||
DBProjectFile file = target.db.files.get(fileIncludesJson.file);
|
||||
System.out.println("addicted file = " + Utils_.Brackets(fileIncludesJson.file));
|
||||
System.out.println("found dependencies :" + fileIncludesJson.includes.size());
|
||||
/// UI.Info("+");
|
||||
System.out.println("addicted file = "+Utils_.Brackets(fileIncludesJson.file));
|
||||
System.out.println("found dependencies :"+fileIncludesJson.includes.size());
|
||||
/// UI.Info("+");
|
||||
for (Include include : fileIncludesJson.includes) {
|
||||
//--
|
||||
System.out.println(include.dependencyFileName);
|
||||
@@ -56,7 +56,7 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
||||
fileInfo.dependencies.add(include);
|
||||
if (!target.allIncludes.contains(include.dependencyFileName))
|
||||
target.allIncludes.add(include.dependencyFileName);
|
||||
if (target.db.files.containsKey(include.dependencyFileName)) {
|
||||
if (target.db.files.containsKey(include.dependencyFileName)){
|
||||
//- определение типов языков инклудов по файлу куда они цепляютс.
|
||||
if (!file.dependencies.contains(include.dependencyFileName)) {
|
||||
file.dependencies.add(include.dependencyFileName);
|
||||
@@ -70,8 +70,9 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
||||
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(include_file.name))
|
||||
update_current = true;
|
||||
}
|
||||
} else {
|
||||
System.out.println(Utils_.Brackets(include.dependencyFileName) + " не существует!");
|
||||
|
||||
}else {
|
||||
System.out.println(Utils_.Brackets(include.dependencyFileName)+" не существует!");
|
||||
}
|
||||
}
|
||||
//----
|
||||
@@ -89,7 +90,7 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
||||
}
|
||||
target.numAddicted += target.addictedFiles.size();
|
||||
target.UpdateAddictedCount();
|
||||
// UI.Info("unpack includes done");
|
||||
// UI.Info("unpack includes done");
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
|
||||
@@ -6,6 +6,8 @@ import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SapforTransformation;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Analysis.FileInfo;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Analysis.Include;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Transformation.IncludeToInsertJson;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Transformation.IncludesToInsertJson;
|
||||
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -21,52 +23,26 @@ public class SPF_InsertIncludesPass extends SapforTransformation {
|
||||
Log.Writeln_("Не найдено файлов, имеющих зависимости по включению.");
|
||||
return false;
|
||||
}
|
||||
Vector<String> Result = new Vector<>();
|
||||
IncludesToInsertJson includes = new IncludesToInsertJson();
|
||||
for (FileInfo fileInfo : target.addictedFiles.values()) {
|
||||
Vector<Include> selected_children = fileInfo.dependencies.stream().filter(Selectable::isSelected).collect(Collectors.toCollection(Vector::new));
|
||||
if (!selected_children.isEmpty()) {
|
||||
Result.add(fileInfo.file);
|
||||
Result.add(String.valueOf(selected_children.size()));
|
||||
for (Include di : selected_children) {
|
||||
Result.add(String.valueOf(di.line));
|
||||
Result.add(di.dependencyFileName);
|
||||
}
|
||||
}
|
||||
if (!selected_children.isEmpty())
|
||||
for (Include di : selected_children)
|
||||
includes.allIncludes.add(new IncludeToInsertJson(di.dependencyFileName,fileInfo.file, di.line));
|
||||
}
|
||||
if (Result.isEmpty()) {
|
||||
if (includes.allIncludes.isEmpty()) {
|
||||
Log.Writeln_("Не отмечено ни одного заголовка для подстановки");
|
||||
return false;
|
||||
}
|
||||
Options = Utils_.toU(String.join("|", Result));
|
||||
Options = Utils_.gson.toJson(includes);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
if (super.canStart(args)) {
|
||||
if (target.numAddicted <= 0) {
|
||||
Log.Writeln_("Не найдено файлов, имеющих зависимости по включению.");
|
||||
return false;
|
||||
}
|
||||
IncludesToInsertJson includes = new IncludesToInsertJson();
|
||||
for (FileInfo fileInfo : target.addictedFiles.values()) {
|
||||
Vector<Include> selected_children = fileInfo.dependencies.stream().filter(Selectable::isSelected).collect(Collectors.toCollection(Vector::new));
|
||||
if (!selected_children.isEmpty())
|
||||
for (Include di : selected_children)
|
||||
includes.allIncludes.add(new IncludeToInsertJson(di.dependencyFileName,fileInfo.file, di.line));
|
||||
}
|
||||
if (includes.allIncludes.isEmpty()) {
|
||||
Log.Writeln_("Не отмечено ни одного заголовка для подстановки");
|
||||
return false;
|
||||
}
|
||||
Options = Utils_.gson.toJson(includes);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
*/
|
||||
@Override
|
||||
protected void FocusBeforeStart() {
|
||||
Global.mainModule.getUI().getMainWindow().getProjectWindow().FocusDependencies();
|
||||
}
|
||||
//test 2
|
||||
//test 3
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.Passes.Sapfor.SapforTransformation;
|
||||
public class SPF_InsertPrivateArrayDirectives extends SapforTransformation {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.Passes.Sapfor.SapforTransformation;
|
||||
public class SPF_MoveOperators extends SapforTransformation {
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
|
||||
}
|
||||
@Override
|
||||
protected void unpackMessages() throws Exception {
|
||||
System.out.println("packed=" + sapfor.getOutputMessage());
|
||||
System.out.println("packed="+sapfor.getOutputMessage());
|
||||
for (DBProjectFile f : target.db.files.Data.values())
|
||||
if (f.isActive()) f.state = FileState.OK;
|
||||
super.unpackMessages();
|
||||
@@ -67,7 +67,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
|
||||
badCount = 0;
|
||||
for (DBProjectFile f : target.db.files.Data.values()) {
|
||||
if (f.isActive()) {
|
||||
System.out.println("file=" + f.name + ":" + f.state);
|
||||
System.out.println("file="+f.name+":"+f.state);
|
||||
switch (f.state) {
|
||||
case OK:
|
||||
case HasNotes:
|
||||
@@ -105,7 +105,7 @@ public class SPF_ParseFilesWithOrder extends SapforAnalysis {
|
||||
@Override
|
||||
protected void unpack(String packed) throws Exception {
|
||||
FilesOrderJson filesOrderJson = Utils_.gson.fromJson(packed, FilesOrderJson.class);
|
||||
for (String fileName_ : filesOrderJson.allFiles)
|
||||
for (String fileName_ :filesOrderJson.allFiles)
|
||||
target.files_order.add(Utils_.toW(fileName_));
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -124,7 +124,6 @@ public class UpdateBugReportField extends ComponentsServerPass<BugReport> {
|
||||
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
|
||||
message_text
|
||||
);
|
||||
|
||||
Global.mainModule.getPass(PassCode.Email).Do(
|
||||
message,
|
||||
Global.componentsServer.db.recipients.getSelectedMails());
|
||||
|
||||
@@ -3,7 +3,6 @@ import Common.MainModule_;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.Windows.Dialog.SliderNumberForm;
|
||||
import Common.Visual.Windows.Dialog.SpinnerNumberForm;
|
||||
import Common.Visual.Windows.Dialog.Text.TextFieldDialog;
|
||||
import Common.Visual.Windows.Dialog.VDirectoryChooser;
|
||||
import Common.Visual.Windows.Dialog.VFileChooser;
|
||||
import _VisualDVM.Global;
|
||||
@@ -45,14 +44,6 @@ public class UpdateProperty extends Pass<Object> {
|
||||
if (file != null)
|
||||
newValue = file.getAbsolutePath();
|
||||
break;
|
||||
case "PrecompilationFlags":
|
||||
TextFieldDialog textFieldDialog = new TextFieldDialog();
|
||||
if (textFieldDialog.ShowDialog(description, oldValue)) {
|
||||
newValue = textFieldDialog.Result;
|
||||
if (newValue.toString().isEmpty())
|
||||
newValue = " ";
|
||||
}
|
||||
break;
|
||||
case "BugReportsAgeLimit":
|
||||
if (sliderNumberForm.ShowDialog(description, oldValue, 1, 12))
|
||||
newValue = sliderNumberForm.Result;
|
||||
|
||||
@@ -301,7 +301,6 @@ public enum PassCode implements PassCode_ {
|
||||
//->
|
||||
TestPass,
|
||||
SPF_InsertPrivateFromGUI,
|
||||
SPF_InsertPrivateArrayDirectives,
|
||||
SPF_RemoveSpfDirectives,
|
||||
SPF_RemoveDeadCode,
|
||||
ReplaceTestProject,
|
||||
@@ -362,17 +361,11 @@ public enum PassCode implements PassCode_ {
|
||||
TestingServerBackUp,
|
||||
CompareDVMRunTaskToEthalon,
|
||||
DropSapforConfigurationEthalon,
|
||||
RefreshSapforPackageResults,
|
||||
SPF_MoveOperators
|
||||
;
|
||||
RefreshSapforPackageResults;
|
||||
//--
|
||||
@Override
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case SPF_MoveOperators:
|
||||
return "Оптимальный порядок операторов";
|
||||
case SPF_InsertPrivateArrayDirectives:
|
||||
return "Анализ и вставка директив приватизации массивов";
|
||||
case CompareSapforPackageToEthalon:
|
||||
return "Сравнить пакет тестирования SAPFOR с эталоном";
|
||||
case SPF_RemoveSpfDirectives:
|
||||
@@ -906,9 +899,6 @@ public enum PassCode implements PassCode_ {
|
||||
case SPF_PrivateRemoving://+
|
||||
name = "PRIVATE_REMOVING";
|
||||
break;
|
||||
case SPF_InsertPrivateArrayDirectives:
|
||||
name="FIND_PRIVATE_ARRAYS";
|
||||
break;
|
||||
//-
|
||||
case SPF_ResolveParallelRegionConflicts://+
|
||||
name = "RESOLVE_PAR_REGIONS";
|
||||
@@ -960,9 +950,6 @@ public enum PassCode implements PassCode_ {
|
||||
case SPF_RemoveDistArraysFromIO:
|
||||
name = "REMOVE_DIST_ARRAYS_FROM_IO";
|
||||
break;
|
||||
case SPF_MoveOperators:
|
||||
name = "MOVE_OPERATORS";
|
||||
break;
|
||||
}
|
||||
return p + " " + name;
|
||||
}
|
||||
|
||||
@@ -257,8 +257,9 @@ public class DBProjectFile extends ProjectFile {
|
||||
break;
|
||||
}
|
||||
}
|
||||
public void AddNewMessage(Message message) throws Exception {
|
||||
switch (message.type) {
|
||||
|
||||
public void AddNewMessage(Message message) throws Exception{
|
||||
switch (message.type){
|
||||
case 0:
|
||||
MessageWarning warning = new MessageWarning(name, message.line, message.value, message.group);
|
||||
father.db.Insert(warning);
|
||||
@@ -281,6 +282,8 @@ public class DBProjectFile extends ProjectFile {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public DefaultMutableTreeNode show_loop_graph_r(FileObjectWithMessages element) {
|
||||
DefaultMutableTreeNode res = new DefaultMutableTreeNode(element);
|
||||
if (element instanceof Loop) {
|
||||
|
||||
@@ -26,6 +26,18 @@ public class Message extends iDBObject {
|
||||
//--
|
||||
@Description("DEFAULT ''")
|
||||
public String file = "";
|
||||
public String getGroup_s() {
|
||||
switch (group) {
|
||||
case 0:
|
||||
return "#m0000";
|
||||
case Constants.parser_group: //сообщения от парсера.
|
||||
return "#parser";
|
||||
case Constants.compiler_group:
|
||||
return "#compiler";
|
||||
default:
|
||||
return "#"+group;
|
||||
}
|
||||
}
|
||||
//--
|
||||
public Message() {
|
||||
}
|
||||
@@ -33,7 +45,7 @@ public class Message extends iDBObject {
|
||||
) throws Exception {
|
||||
file = file_in;
|
||||
line = line_in;
|
||||
group = group_in;
|
||||
group=group_in;
|
||||
if ((group == Constants.parser_group) ||
|
||||
(group == Constants.compiler_group) ||
|
||||
(Global.mode != Mode.Normal)) {
|
||||
@@ -443,16 +455,4 @@ public class Message extends iDBObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
public String getGroup_s() {
|
||||
switch (group) {
|
||||
case 0:
|
||||
return "#m0000";
|
||||
case Constants.parser_group: //сообщения от парсера.
|
||||
return "#parser";
|
||||
case Constants.compiler_group:
|
||||
return "#compiler";
|
||||
default:
|
||||
return "#" + group;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,14 @@ public class AlignRule {
|
||||
alignRuleWith.add(new AlignRuleWidthJson(dimNum, a, b));
|
||||
}
|
||||
}
|
||||
public void Init(){
|
||||
//--
|
||||
alignArray_address = new BigInteger(packedAlignArrayAddress);
|
||||
alignWith_address = new BigInteger(packedAlignWithAddress);
|
||||
//--
|
||||
packedAlignArrayAddress = null;
|
||||
packedAlignWithAddress = null;
|
||||
}
|
||||
private static Pair<String, String> convertDigitToPositive(int digit) {
|
||||
String buf = "";
|
||||
String sign = " + ";
|
||||
@@ -50,14 +58,6 @@ public class AlignRule {
|
||||
buf += String.valueOf(digit);
|
||||
return new Pair<>(sign, buf);
|
||||
}
|
||||
public void Init() {
|
||||
//--
|
||||
alignArray_address = new BigInteger(packedAlignArrayAddress);
|
||||
alignWith_address = new BigInteger(packedAlignWithAddress);
|
||||
//--
|
||||
packedAlignArrayAddress = null;
|
||||
packedAlignWithAddress = null;
|
||||
}
|
||||
public ProjectArray getAlignArray() {
|
||||
return parent_region.arraysMap.get(alignArray_address);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public class AlignRule {
|
||||
retVal += getAlignArray().TypeString() + " ";
|
||||
arrayString += getAlignArray().shortName + "(";
|
||||
for (int i = 0; i < alignRule.size(); ++i) {
|
||||
arrayString += genStringExpr(ProjectArray.alignNames[i], alignRule.get(i).getKey(), alignRule.get(i).getValue());
|
||||
arrayString += genStringExpr(ProjectArray.alignNames[i], alignRule.get(i).getKey(),alignRule.get(i).getValue() );
|
||||
if (i != alignRule.size() - 1)
|
||||
arrayString += ",";
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public class AlignRule {
|
||||
for (int i = 0; i < alignRuleWith.size(); ++i) {
|
||||
if (alignRuleWith.get(i).getDimNum() != -1) {
|
||||
alignEachDim.set(alignRuleWith.get(i).getDimNum(),
|
||||
genStringExpr(ProjectArray.alignNames[i], alignRuleWith.get(i).getA(), alignRuleWith.get(i).getB()));
|
||||
genStringExpr(ProjectArray.alignNames[i], alignRuleWith.get(i).getA(),alignRuleWith.get(i).getB() ));
|
||||
//коэццициенты находятся здесь!!------------------------------------------------------------------->>
|
||||
getAlignArray().ac_current.put(i,
|
||||
new Dimension(i,
|
||||
|
||||
@@ -7,21 +7,22 @@ public class AlignRuleWidthJson {
|
||||
public int a;
|
||||
@Expose
|
||||
public int b;
|
||||
public AlignRuleWidthJson() {
|
||||
//dim -> a * dim_t + b
|
||||
public int getDimNum(){
|
||||
return dimNum;
|
||||
}
|
||||
public AlignRuleWidthJson(int i_in, int a_in, int b_in) {
|
||||
public int getA(){
|
||||
return a;
|
||||
}
|
||||
public int getB(){
|
||||
return b;
|
||||
}
|
||||
public AlignRuleWidthJson(){
|
||||
|
||||
}
|
||||
public AlignRuleWidthJson(int i_in, int a_in, int b_in){
|
||||
dimNum = i_in;
|
||||
a = a_in;
|
||||
b = b_in;
|
||||
}
|
||||
//dim -> a * dim_t + b
|
||||
public int getDimNum() {
|
||||
return dimNum;
|
||||
}
|
||||
public int getA() {
|
||||
return a;
|
||||
}
|
||||
public int getB() {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class ArraysJson {
|
||||
@Expose
|
||||
public List<ProjectArray> allArrays = new Vector<>();
|
||||
public List<ProjectArray> allArrays=new Vector<>();
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Arrays;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.Index;
|
||||
import Common.Utils.IntegerPairJson;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.DBArray.DBArray;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimension;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateDimensionState;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.Templates.TemplateLink;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
|
||||
import _VisualDVM.ProjectData.SapforData.Regions.UI.ArrayAlignmentBar;
|
||||
import com.google.gson.annotations.Expose;
|
||||
@@ -18,9 +21,6 @@ import java.util.List;
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
public class ProjectArray extends DBObject {
|
||||
//--
|
||||
//----------------------------------------------------------------------
|
||||
public static final String[] alignNames = {"i", "j", "k", "l", "m", "n", "q", "r", "s", "t", "u", "w", "x", "y", "z"};
|
||||
@Expose
|
||||
public long id;
|
||||
@Expose
|
||||
@@ -34,6 +34,10 @@ public class ProjectArray extends DBObject {
|
||||
@Expose
|
||||
public int typeSize;
|
||||
@Expose
|
||||
int state;
|
||||
@Expose
|
||||
int location;
|
||||
@Expose
|
||||
public String locName;
|
||||
@Expose
|
||||
public int isTemplFlag;
|
||||
@@ -41,6 +45,17 @@ public class ProjectArray extends DBObject {
|
||||
public int isLoopArrayFlag;
|
||||
@Expose
|
||||
public Vector<ArrayDecl> declPlaces = new Vector<>();
|
||||
@Expose
|
||||
List<Integer> deprecateToDist = new Vector<>();
|
||||
@Expose
|
||||
List<Integer> mappedDims = new Vector<>();
|
||||
@Expose
|
||||
Vector<IntegerPairJson> sizes = new Vector<>();
|
||||
@Expose
|
||||
Vector<String> regions = new Vector<>();
|
||||
//--
|
||||
//----------------------------------------------------------------------
|
||||
public static final String[] alignNames = {"i", "j", "k", "l", "m", "n", "q", "r", "s", "t", "u", "w", "x", "y", "z"};
|
||||
public String UniqKey;
|
||||
public BigInteger address;
|
||||
//только для шаблонов. для ФИЛЬТРА управления распределением измерений.
|
||||
@@ -58,33 +73,6 @@ public class ProjectArray extends DBObject {
|
||||
public LinkedHashMap<Integer, Dimension> ac_new;
|
||||
//https://stackoverflow.com/questions/4941372/how-to-insert-image-into-jtable-cell
|
||||
public ArrayAlignmentBar bar = null;
|
||||
@Expose
|
||||
int state;
|
||||
@Expose
|
||||
int location;
|
||||
@Expose
|
||||
List<Integer> deprecateToDist = new Vector<>();
|
||||
@Expose
|
||||
List<Integer> mappedDims = new Vector<>();
|
||||
@Expose
|
||||
Vector<IntegerPairJson> sizes = new Vector<>();
|
||||
@Expose
|
||||
Vector<String> regions = new Vector<>();
|
||||
public static String fill_binary(int d, String binary) {
|
||||
int delta = Math.abs(binary.length() - d);
|
||||
String res = binary;
|
||||
for (int i = 0; i < delta; ++i) {
|
||||
res = ("0" + res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//длина должна быть равной, ищем есть ли совпадающие позиции с единицами
|
||||
public static boolean mask(String banned, String variant) {
|
||||
for (int i = 0; i < variant.length(); ++i)
|
||||
if ((variant.toCharArray()[i] == '1') && (banned.toCharArray()[i] == '1')) //попался, масконосец!
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
//------
|
||||
public void print() {
|
||||
Vector<String> res = new Vector<>();
|
||||
@@ -131,6 +119,21 @@ public class ProjectArray extends DBObject {
|
||||
ac_new = new LinkedHashMap<>();
|
||||
//--FileForm
|
||||
}
|
||||
public static String fill_binary(int d, String binary) {
|
||||
int delta = Math.abs(binary.length() - d);
|
||||
String res = binary;
|
||||
for (int i = 0; i < delta; ++i) {
|
||||
res = ("0" + res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//длина должна быть равной, ищем есть ли совпадающие позиции с единицами
|
||||
public static boolean mask(String banned, String variant) {
|
||||
for (int i = 0; i < variant.length(); ++i)
|
||||
if ((variant.toCharArray()[i] == '1') && (banned.toCharArray()[i] == '1')) //попался, масконосец!
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
public String printLinks() {
|
||||
Vector<String> res = links.keySet().stream().map(Object::toString).collect(Collectors.toCollection(Vector::new));
|
||||
return String.join(" ", res);
|
||||
|
||||
@@ -5,5 +5,5 @@ import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class GCOVJson {
|
||||
@Expose
|
||||
public List<FileGCOVJson> allGCov = new Vector<>();
|
||||
public List<FileGCOVJson> allGCov= new Vector<>();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Includes.Analysis;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ProjectData.SapforData.FileObject;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Analysis.Include;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package _VisualDVM.ProjectData.SapforData;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class ModifiedFile_json {
|
||||
@Expose
|
||||
public String name;
|
||||
@Expose
|
||||
public String text;
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Regions;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.Index;
|
||||
import Common.Utils.IntegerPairJson;
|
||||
import Common.Utils.Pair;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.SapforData.Arrays.AlignRule;
|
||||
@@ -28,21 +30,6 @@ public class ParallelRegion extends DBObject {
|
||||
public Vector<AlignRule> alignRules;
|
||||
//----
|
||||
public Vector<String> rules;
|
||||
//--
|
||||
public BigInteger regionId;
|
||||
//name in program
|
||||
// file -> <start, end> lines
|
||||
public LinkedHashMap<String, List<IntegerPairJson>> lines; //+
|
||||
//ключ - адрес. меняем
|
||||
public LinkedHashMap<BigInteger, ProjectArray> arraysMap; //+
|
||||
//for directive creating
|
||||
public int maxdim = 0;
|
||||
public Vector<String> fragments; //+
|
||||
public int lines_count = 0;
|
||||
public int loops_count = 0;
|
||||
public int arrays_count = 0;
|
||||
public int fd_count = 0;
|
||||
public int fc_count = 0;
|
||||
public void genRules(LinkedHashMap<BigInteger, ProjectArray> Arrays) {
|
||||
rules.clear();
|
||||
int maxLen = 0;
|
||||
@@ -61,11 +48,26 @@ public class ParallelRegion extends DBObject {
|
||||
for (String r : v)
|
||||
rules.add(r);
|
||||
}
|
||||
//--
|
||||
public BigInteger regionId;
|
||||
//name in program
|
||||
// file -> <start, end> lines
|
||||
public LinkedHashMap<String, List<IntegerPairJson>> lines; //+
|
||||
//ключ - адрес. меняем
|
||||
public LinkedHashMap<BigInteger, ProjectArray> arraysMap; //+
|
||||
//for directive creating
|
||||
public int maxdim = 0;
|
||||
public Vector<String> fragments; //+
|
||||
public int lines_count = 0;
|
||||
public int loops_count = 0;
|
||||
public int arrays_count = 0;
|
||||
public int fd_count = 0;
|
||||
public int fc_count = 0;
|
||||
public void Init() {
|
||||
arraysMap = new LinkedHashMap<>();
|
||||
lines = new LinkedHashMap<>();
|
||||
fragments = new Vector<>();
|
||||
rules = new Vector<>();
|
||||
rules=new Vector<>();
|
||||
//--
|
||||
if (packedRegionId != null)
|
||||
regionId = new BigInteger(packedRegionId);
|
||||
@@ -73,20 +75,19 @@ public class ParallelRegion extends DBObject {
|
||||
for (ProjectArray array : packedArrays) {
|
||||
array.Init();//имена и адреса.
|
||||
arraysMap.put(array.address, array);
|
||||
if (array.isTemplFlag == 1) {
|
||||
if (array.isTemplFlag==1){
|
||||
maxdim = Math.max(maxdim, array.dimSize);
|
||||
Global.mainModule.getProject().templates.add(array);
|
||||
array.regIDs.add(regionId);
|
||||
} else if (array.isLoopArrayFlag != 1) arrays_count++;
|
||||
}
|
||||
//---
|
||||
for (AlignRule rule : alignRules) {
|
||||
for (AlignRule rule: alignRules) {
|
||||
rule.Init();
|
||||
rule.parent_region = this;
|
||||
}
|
||||
//---
|
||||
for (FileRegionLinesJson fr : regionsLines) {
|
||||
fr.file = Utils_.toW(fr.file);
|
||||
lines.put(fr.file, fr.lines);
|
||||
for (IntegerPairJson l : fr.lines) {
|
||||
fragments.add(fr.file + ": " + l.getKey() + "-" + l.getKey());
|
||||
@@ -102,7 +103,6 @@ public class ParallelRegion extends DBObject {
|
||||
for (IntegerPairJson L : lines.get(FKey)) {
|
||||
lines_count += (L.getValue() - L.getKey());
|
||||
DBProjectFile f = Global.mainModule.getProject().db.files.Data.get(FKey);
|
||||
|
||||
loops_count += f.FragmentLoopCount(L.getKey(), L.getValue());
|
||||
fc_count += f.FragmentFunctionCallsCount(L.getKey(), L.getValue());
|
||||
fd_count += f.FragmentFunctionDeclsCount(L.getKey(), L.getValue());
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package _VisualDVM.ProjectData.SapforData;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
public class SapforResult_json {
|
||||
@Expose
|
||||
public int errorCode;
|
||||
@Expose
|
||||
public String result; //запаковка результата конкретного прохода в json
|
||||
@Expose
|
||||
public String output; //журнал
|
||||
@Expose
|
||||
public String outputMessage; //запаковка сообщений в json
|
||||
@Expose
|
||||
public String predictorStats; //запаковка оценок вариантов в json если есть для их построения и оценки.
|
||||
@Expose
|
||||
public List<ModifiedFile_json> files; //запаковка имен файлов в json если есть для модификации
|
||||
//--
|
||||
public void Print(){
|
||||
System.out.println("------------------------------");
|
||||
System.out.println("codeIdx="+ errorCode );
|
||||
System.out.println("result="+result);
|
||||
System.out.println("output="+output);
|
||||
System.out.println("outputMessage="+outputMessage);
|
||||
System.out.println("predictorStats="+predictorStats);
|
||||
System.out.println("-------------------------------");
|
||||
}
|
||||
}
|
||||
@@ -673,7 +673,7 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
Vector<DVMCompilationOptionsSet> optionsSets = getVectorByFK(dvmSettings_in, DVMCompilationOptionsSet.class);
|
||||
Vector<DVMEnvironmentsSet> environmentsSets = getVectorByFK(dvmSettings_in, DVMEnvironmentsSet.class);
|
||||
//----
|
||||
if (optionsSets.isEmpty() && environmentsSets.isEmpty()) {
|
||||
if (optionsSets.isEmpty() && environmentsSets.isEmpty()){
|
||||
return res;
|
||||
}
|
||||
int size_ = Math.min(optionsSets.size(), environmentsSets.size());
|
||||
@@ -687,14 +687,14 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
environmentsLine));
|
||||
}
|
||||
//дополнения
|
||||
if (optionsSets.size() < environmentsSets.size()) {
|
||||
if (optionsSets.size()<environmentsSets.size()){
|
||||
for (int i = optionsSets.size(); i < environmentsSets.size(); ++i) {
|
||||
res.add(new Pair<>(
|
||||
"",
|
||||
printEnvironmentsLine(getVectorByFK(environmentsSets.get(i), DVMEnvironment.class))
|
||||
));
|
||||
}
|
||||
} else {
|
||||
}else {
|
||||
if (optionsSets.size() > environmentsSets.size()) {
|
||||
for (int i = environmentsSets.size(); i < optionsSets.size(); ++i) {
|
||||
res.add(new Pair<>(
|
||||
|
||||
@@ -200,18 +200,13 @@ public class DVMPackage extends TestingPackage<DVMPackage_json> {
|
||||
return flags_in;
|
||||
}
|
||||
public static String completeEnvironments(String environmentsSet_in) {
|
||||
if (environmentsSet_in.isEmpty()){
|
||||
return "DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1")+" "+ "DVMH_SET_AFFINITY="+Utils_.DQuotes("0");
|
||||
}
|
||||
//-
|
||||
String res = environmentsSet_in;
|
||||
if (!environmentsSet_in.contains("DVMH_NO_DIRECT_COPY")){
|
||||
res+=" DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1");
|
||||
}
|
||||
if (!environmentsSet_in.contains("DVMH_SET_AFFINITY")){
|
||||
res+=" DVMH_SET_AFFINITY=" + Utils_.DQuotes("0");
|
||||
}
|
||||
return res;
|
||||
if (!environmentsSet_in.contains("DVMH_NO_DIRECT_COPY")) {
|
||||
if (environmentsSet_in.isEmpty())
|
||||
return "DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1");
|
||||
else
|
||||
return environmentsSet_in + " " + "DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1");
|
||||
} else
|
||||
return environmentsSet_in;
|
||||
}
|
||||
@Override
|
||||
public Class getJsonClass() {
|
||||
|
||||
@@ -19,4 +19,13 @@ public class DVMCompilationTask extends DVMTask {
|
||||
maxtime = configuration.c_maxtime;
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public Vector<String> pack(Object arg) {
|
||||
Vector<String> res = new Vector<>();
|
||||
res.add(String.valueOf(id)); //1
|
||||
res.add(String.valueOf(maxtime)); //2
|
||||
res.add(String.valueOf(test_id)); //3
|
||||
res.add(arg.toString().replace("\n", "|")); //4
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,19 @@ public class DVMRunTask extends DVMTask {
|
||||
args = rt.args;
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
public Vector<String> pack(Object arg) {
|
||||
Vector<String> res = new Vector<>();
|
||||
res.add(String.valueOf(id)); //1
|
||||
res.add(String.valueOf(maxtime)); //2
|
||||
res.add(String.valueOf(dvmcompilationtask_id)); //3
|
||||
res.add(matrix); //4
|
||||
res.add(environments); //5
|
||||
res.add(usr_par.replace("\n", "|")); //6
|
||||
res.add(args); //7
|
||||
res.add(String.valueOf(kernels)); //8
|
||||
return res;
|
||||
}
|
||||
public String getEnvironments() {
|
||||
return environments.replace("\n", ";");
|
||||
}
|
||||
|
||||
@@ -83,6 +83,9 @@ public class DVMTask extends iDBObject {
|
||||
"results",
|
||||
String.valueOf(id)).toFile();
|
||||
}
|
||||
public Vector<String> pack(Object arg) {
|
||||
return null;
|
||||
}
|
||||
public String getResultFile(File resultFile) {
|
||||
String res = "";
|
||||
if (dvm_package_id == CommonConstants.Nan) res = "задача ещё не выполнялась";
|
||||
|
||||
@@ -7,10 +7,6 @@ import _VisualDVM.Passes.All.UnzipFolderPass;
|
||||
import _VisualDVM.TestingSystem.Common.TasksPackageState;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||
import _VisualDVM.TestingSystem.DVM.json.DVMCompilationPackage_json;
|
||||
import _VisualDVM.TestingSystem.DVM.json.CompilationTask_json;
|
||||
import _VisualDVM.TestingSystem.DVM.json.DVMRunPackage_json;
|
||||
import _VisualDVM.TestingSystem.DVM.json.RunTask_json;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
@@ -75,26 +71,19 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
||||
//создать папку для пакета.
|
||||
user.connection.RMDIR(packageRemoteWorkspace.full_name);
|
||||
user.connection.sftpChannel.mkdir(packageRemoteWorkspace.full_name);
|
||||
//--
|
||||
DVMCompilationPackage_json compilationPackage_json = new DVMCompilationPackage_json();
|
||||
DVMRunPackage_json runPackage_json = new DVMRunPackage_json();
|
||||
//положить туда запакованные тексты задач.
|
||||
Vector<String> compilationLines = new Vector<>();
|
||||
Vector<String> runLines = new Vector<>();
|
||||
for (DVMCompilationTask compilationTask : testingPackage.package_json.compilationTasks) {
|
||||
String makefileText = generateMakefile(tests.get(compilationTask.test_id), compilationTask.language, testingPackage.drv, compilationTask.flags);
|
||||
//--
|
||||
compilationPackage_json.tasks.add(new CompilationTask_json(compilationTask, makefileText));
|
||||
//--
|
||||
for (DVMRunTask runTask : compilationTask.runTasks) {
|
||||
//--
|
||||
runPackage_json.tasks.add(new RunTask_json(runTask));
|
||||
}
|
||||
compilationLines.addAll(compilationTask.pack(makefileText));
|
||||
for (DVMRunTask runTask : compilationTask.runTasks)
|
||||
runLines.addAll(runTask.pack(null));
|
||||
}
|
||||
//--
|
||||
RemoteFile compilationFile_json = new RemoteFile(packageRemoteWorkspace, "compilationTasks.json");
|
||||
RemoteFile runFile_json = new RemoteFile(packageRemoteWorkspace, "runTasks.json");
|
||||
//--
|
||||
user.connection.writeToFile(Utils_.gson.toJson(compilationPackage_json),compilationFile_json);
|
||||
user.connection.writeToFile(Utils_.gson.toJson(runPackage_json), runFile_json);
|
||||
RemoteFile compilationPackage = new RemoteFile(packageRemoteWorkspace, "compilationTasks");
|
||||
RemoteFile runPackage = new RemoteFile(packageRemoteWorkspace, "runTasks");
|
||||
user.connection.writeToFile(String.join("\n", compilationLines) + "\n", compilationPackage);
|
||||
user.connection.writeToFile(String.join("\n", runLines) + "\n", runPackage);
|
||||
// --
|
||||
user.connection.MKDIR(new RemoteFile(packageRemoteWorkspace, "state"));
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package _VisualDVM.TestingSystem.DVM.json;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class CompilationTask_json extends Task_json {
|
||||
@Expose
|
||||
public String test_name; //-
|
||||
@Expose
|
||||
public String makefile_text; //res.add(arg.toString().replace("\n", "|")); //4 todo в планировщике убрать шифровку
|
||||
//--
|
||||
public CompilationTask_json(DVMCompilationTask task, String makefile_text_in){
|
||||
super(task);
|
||||
test_name = String.valueOf(task.test_id);
|
||||
makefile_text = makefile_text_in;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package _VisualDVM.TestingSystem.DVM.json;
|
||||
public class DVMCompilationPackage_json extends DVMPackage_json<CompilationTask_json> {
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package _VisualDVM.TestingSystem.DVM.json;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class DVMPackage_json<T extends Task_json> {
|
||||
@Expose
|
||||
public List<T> tasks = new Vector<>();
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package _VisualDVM.TestingSystem.DVM.json;
|
||||
public class DVMRunPackage_json extends DVMPackage_json<RunTask_json>{
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package _VisualDVM.TestingSystem.DVM.json;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class RunTask_json extends Task_json {
|
||||
@Expose
|
||||
public int cores;
|
||||
@Expose
|
||||
public int compilation_task_id;
|
||||
@Expose
|
||||
public String matrix;
|
||||
@Expose
|
||||
public String args;
|
||||
@Expose
|
||||
public String environments;
|
||||
@Expose
|
||||
public String usr_par; //- usr_par.replace("\n", "|") todo в планировщике убрать шифровку.
|
||||
public RunTask_json(DVMRunTask task){
|
||||
super(task);
|
||||
cores = task.kernels;
|
||||
compilation_task_id = task.dvmcompilationtask_id;
|
||||
matrix = task.matrix;
|
||||
args = task.args;
|
||||
environments = task.environments;
|
||||
usr_par = task.usr_par;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package _VisualDVM.TestingSystem.DVM.json;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMTask;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class Task_json {
|
||||
@Expose
|
||||
public int id; //-
|
||||
@Expose
|
||||
public int maxtime;
|
||||
public Task_json(DVMTask task){
|
||||
id = task.id;
|
||||
maxtime = task.maxtime;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.Constants;
|
||||
@@ -6,11 +7,13 @@ import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.Files.FileType;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.ProjectData.Messages.Errors.MessageError;
|
||||
import _VisualDVM.ProjectData.Messages.FileMessagesJson;
|
||||
import _VisualDVM.ProjectData.Messages.Message;
|
||||
import _VisualDVM.ProjectData.Messages.MessagesJson;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import _VisualDVM.Utils;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -20,6 +23,8 @@ import java.nio.charset.Charset;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import static java.lang.Character.isDigit;
|
||||
public class SapforVersion_json implements Serializable {
|
||||
@Expose
|
||||
public String version = "";
|
||||
@@ -150,8 +155,41 @@ public class SapforVersion_json implements Serializable {
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (!text1.equalsIgnoreCase(text2))
|
||||
if (!Utils.compareFortranTexts(text1, text2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean isMatchServer(SapforVersion_json version_json) {
|
||||
if (!description.equals(version_json.description)) {
|
||||
return false;
|
||||
}
|
||||
if (files.size() != version_json.files.size()) {
|
||||
return false;
|
||||
}
|
||||
for (String name1 : files.keySet()) {
|
||||
if (!version_json.files.containsKey(name1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (String name1 : files.keySet()) {
|
||||
ProjectFile file1 = files.get(name1);
|
||||
ProjectFile file2 = version_json.files.get(name1);
|
||||
//---
|
||||
String text1 = "";
|
||||
String text2 = "";
|
||||
try {
|
||||
text1 = FileUtils.readFileToString(file1.file, Charset.defaultCharset());
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
try {
|
||||
text2 = FileUtils.readFileToString(file2.file, Charset.defaultCharset());
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return text1.equalsIgnoreCase(text2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -191,25 +229,26 @@ public class SapforVersion_json implements Serializable {
|
||||
if (err.exists())
|
||||
project.Log += "\n" + FileUtils.readFileToString(err);
|
||||
//--
|
||||
if (messages_dump.exists()) {
|
||||
if (messages_dump.exists()){
|
||||
try {
|
||||
String packed = FileUtils.readFileToString(messages_dump);
|
||||
messagesJson = Utils_.gson.fromJson(packed, MessagesJson.class);
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
project.Open();
|
||||
project.Update(); //Журнал
|
||||
//а так же, убрать dep и txt
|
||||
if (messagesJson != null) {
|
||||
if (messagesJson!=null){
|
||||
project.db.BeginTransaction();
|
||||
//-
|
||||
for (FileMessagesJson fileMessagesJson : messagesJson.allMessages) {
|
||||
for (FileMessagesJson fileMessagesJson: messagesJson.allMessages){
|
||||
fileMessagesJson.file = Utils_.toW(fileMessagesJson.file);
|
||||
//--
|
||||
DBProjectFile file = project.db.files.Data.get(fileMessagesJson.file);
|
||||
for (Message message : fileMessagesJson.messages) {
|
||||
for (Message message: fileMessagesJson.messages) {
|
||||
file.CreateAndAddNewMessage(1, message.value, message.line, message.group);
|
||||
}
|
||||
//update file
|
||||
|
||||
@@ -11,32 +11,29 @@ import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Date;
|
||||
public class PackageModeSupervisor extends ThreadsPlanner {
|
||||
SapforPackage_json package_json = null;
|
||||
// File sapfor_drv = null;
|
||||
File sapfor_drv = null;
|
||||
public PackageModeSupervisor() throws Exception {
|
||||
super(2000);
|
||||
package_json = (SapforPackage_json) Utils_.jsonFromFile(new File(Constants.package_json), SapforPackage_json.class);
|
||||
//--
|
||||
File sapfor_src = new File(package_json.sapfor_drv);
|
||||
//--
|
||||
String pid_prefix = Utils_.getDateName("SAPFOR_F");
|
||||
//--
|
||||
sapfor_drv = new File(Utils_.getHomeDirectory(), Utils_.getDateName("SAPFOR_F"));
|
||||
FileUtils.copyFile(sapfor_src, sapfor_drv);
|
||||
if (!sapfor_drv.setExecutable(true))
|
||||
throw new Exception("Не удалось сделать файл " + sapfor_drv.getName() + " исполняемым!");
|
||||
File PID = new File("PID");
|
||||
FileUtils.writeStringToFile(PID, pid_prefix, Charset.defaultCharset());
|
||||
FileUtils.writeStringToFile(PID, sapfor_drv.getName(), Charset.defaultCharset());
|
||||
//---
|
||||
Date startDate = new Date();
|
||||
File started = new File(CommonConstants.STARTED);
|
||||
FileUtils.writeStringToFile(started, String.valueOf(startDate));
|
||||
//формирование списка задач.
|
||||
setMaxKernels(package_json.kernels);
|
||||
for (SapforTask task : package_json.tasks) {
|
||||
File task_drv = new File(Utils_.getHomeDirectory(),pid_prefix+"_"+task.id);
|
||||
Files.createSymbolicLink(task_drv.toPath(), sapfor_src.toPath());
|
||||
addThread(new TaskThread(task, task_drv));
|
||||
}
|
||||
for (SapforTask task : package_json.tasks)
|
||||
addThread(new TaskThread(task, sapfor_drv));
|
||||
interruptThread.start();
|
||||
}
|
||||
@Override
|
||||
@@ -58,8 +55,8 @@ public class PackageModeSupervisor extends ThreadsPlanner {
|
||||
// ,"sh", "exe", "bat"
|
||||
);
|
||||
//удаление сапфора exception
|
||||
// if (sapfor_drv.exists())
|
||||
// FileUtils.forceDelete(sapfor_drv);
|
||||
if (sapfor_drv.exists())
|
||||
FileUtils.forceDelete(sapfor_drv);
|
||||
} catch (Exception e) {
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
|
||||
@@ -178,6 +178,46 @@ public class SapforTask extends DBObject {
|
||||
task2.comparisonState = ComparisonState.Match;
|
||||
}
|
||||
}
|
||||
public void checkMatchServer(SapforTask task2) {
|
||||
if (!state.equals(task2.state)) {
|
||||
comparisonState = ComparisonState.NotMatch;
|
||||
task2.comparisonState = ComparisonState.NotMatch;
|
||||
}
|
||||
if ((versions.size() != task2.versions.size()) || (variants.size() != task2.variants.size())) {
|
||||
comparisonState = ComparisonState.NotMatch;
|
||||
task2.comparisonState = ComparisonState.NotMatch;
|
||||
}
|
||||
LinkedHashMap<String, SapforVersion_json> versions1 = getSortedVersions();
|
||||
LinkedHashMap<String, SapforVersion_json> versions2 = task2.getSortedVersions();
|
||||
//---
|
||||
for (String name1 : versions1.keySet()) {
|
||||
if (versions2.containsKey(name1)) {
|
||||
SapforVersion_json version1 = versions1.get(name1);
|
||||
SapforVersion_json version2 = versions2.get(name1);
|
||||
//---
|
||||
if (!version1.isMatchServer(version2)) {
|
||||
comparisonState = ComparisonState.NotMatch;
|
||||
task2.comparisonState = ComparisonState.NotMatch;
|
||||
version1.comparisonState = VersionComparisonState.NotMatch;
|
||||
version2.comparisonState = VersionComparisonState.NotMatch;
|
||||
//-
|
||||
} else {
|
||||
version1.comparisonState = VersionComparisonState.Match;
|
||||
version2.comparisonState = VersionComparisonState.Match;
|
||||
//-
|
||||
}
|
||||
} else {
|
||||
comparisonState = ComparisonState.NotMatch;
|
||||
task2.comparisonState = ComparisonState.NotMatch;
|
||||
//--
|
||||
}
|
||||
}
|
||||
//--
|
||||
if (comparisonState.equals(ComparisonState.Unknown)) {
|
||||
comparisonState = ComparisonState.Match;
|
||||
task2.comparisonState = ComparisonState.Match;
|
||||
}
|
||||
}
|
||||
public Date getStartDate() {
|
||||
return new Date(StartDate);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
@@ -149,7 +148,6 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
}
|
||||
@Override
|
||||
protected void DownloadResults() throws Exception {
|
||||
//-
|
||||
UpdatePackageState(TasksPackageState.Analysis);
|
||||
}
|
||||
@Override
|
||||
@@ -157,16 +155,6 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
//не требуется.
|
||||
testingPackage.progress = 100;
|
||||
testingPackage.checkFinishState();
|
||||
//--
|
||||
File workspace = testingPackage.getLocalWorkspace();
|
||||
File[] links = workspace.listFiles();
|
||||
if (links!=null){
|
||||
Print("files found: "+links.length);
|
||||
for (File file: links) {
|
||||
if (file.isFile() && file.getName().startsWith("SAPFOR"))
|
||||
FileUtils.forceDelete(file);
|
||||
}
|
||||
}
|
||||
//--для эталона
|
||||
if (testingPackage.ethalon_id != CommonConstants.Nan) {
|
||||
TextLog log = new TextLog();
|
||||
@@ -199,7 +187,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
//--
|
||||
for (SapforTask task1 : ethalon.package_json.tasks) {
|
||||
SapforTask task2 = testingPackage.package_json.getTaskByKey(task1.getUniqueKey());
|
||||
task1.checkMatch(task2); //тексты сравниваются просто посимвольно.
|
||||
task1.checkMatchServer(task2); //тексты сравниваются просто посимвольно.
|
||||
if (task1.comparisonState.equals(ComparisonState.NotMatch)) {
|
||||
testingPackage.mismatchesCount++;
|
||||
}
|
||||
@@ -207,7 +195,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
Print("сравнение завершено");
|
||||
log.Writeln_("Различий с эталоном: " + testingPackage.mismatchesCount);
|
||||
if (testingPackage.mismatchesCount > 0) {
|
||||
// testingPackage.doneTasksCount -= testingPackage.mismatchesCount;
|
||||
// testingPackage.doneTasksCount -= testingPackage.mismatchesCount;
|
||||
testingPackage.state = TasksPackageState.DoneWithErrors;
|
||||
}
|
||||
return;
|
||||
@@ -230,8 +218,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
Thread.sleep(1000);
|
||||
} while (!aborted_file.exists());
|
||||
Print("coup de grace..");
|
||||
// String kill_command = "killall -SIGKILL " + testingPackage.PID;
|
||||
String kill_command = "pkill -SIGKILL -f " + testingPackage.PID;
|
||||
String kill_command = "killall -SIGKILL " + testingPackage.PID;
|
||||
Print(kill_command);
|
||||
Process killer = Runtime.getRuntime().exec(kill_command);
|
||||
killer.waitFor();
|
||||
|
||||
@@ -14,7 +14,6 @@ import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.URL;
|
||||
import java.nio.file.*;
|
||||
import java.nio.file.attribute.PosixFilePermission;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -598,7 +597,6 @@ public class Utils {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
/*
|
||||
public static Pair<Vector<String>, Vector<String>> getFortranLines(String text) {
|
||||
Vector<String> lines = new Vector<>();
|
||||
Vector<String> visible_lines = new Vector<>();
|
||||
@@ -676,8 +674,6 @@ public class Utils {
|
||||
}
|
||||
return new Pair<>(lines, visible_lines);
|
||||
}
|
||||
*/
|
||||
/* Pair
|
||||
public static boolean CompareLines(String line1_raw, String line2_raw) {
|
||||
String line1 = line1_raw;
|
||||
String line2 = line2_raw;
|
||||
@@ -697,7 +693,19 @@ public class Utils {
|
||||
if (CompareLines(list.get(i), line)) last_index = i;
|
||||
return (last_index >= max_index);
|
||||
}
|
||||
*/
|
||||
public static boolean compareFortranTexts(String text1, String text2) {
|
||||
Pair<Vector<String>, Vector<String>> p1 = getFortranLines(text1);
|
||||
Pair<Vector<String>, Vector<String>> p2 = getFortranLines(text2);
|
||||
Vector<String> lines1 = p1.getKey();
|
||||
Vector<String> lines2 = p2.getKey();
|
||||
if (lines1.size() != lines2.size())
|
||||
return false;
|
||||
for (int i = 0; i < lines1.size(); ++i) {
|
||||
if (!CompareLines(lines1.get(i), lines2.get(i)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//--
|
||||
private static void get_newest_file_date_r(File dir, Vector<Long> dates) {
|
||||
Vector<File> files = new Vector(Arrays.asList(dir.listFiles(new FileFilter() {
|
||||
@@ -736,15 +744,5 @@ public class Utils {
|
||||
}
|
||||
return dates.firstElement();
|
||||
}
|
||||
public static void chmod777(File file) throws Exception{
|
||||
if (!Utils_.isWindows()) {
|
||||
//не в правах дело..
|
||||
Set<PosixFilePermission> newPermissions = new HashSet<>();
|
||||
for (PosixFilePermission permission: PosixFilePermission.values()){
|
||||
newPermissions.add(permission);
|
||||
}
|
||||
Files.setPosixFilePermissions(file.toPath(), newPermissions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.Menus.PropertiesSubmenu;
|
||||
public class VersionsComparisonMenu extends PropertiesSubmenu {
|
||||
public VersionsComparisonMenu() {
|
||||
super("Сравнение текстов", null,
|
||||
super("Сравнение версий", null,
|
||||
Global.normalProperties,
|
||||
// "RegisterOn",
|
||||
"SpacesOn",
|
||||
// "SpacesOn",
|
||||
// "EmptyLinesOn",
|
||||
// "FortranWrapsOn",
|
||||
"ExtensionsOn",
|
||||
|
||||
@@ -18,13 +18,11 @@ public class VisualiserSettingsMenu extends VisualiserMenu {
|
||||
add(new PropertiesSubmenu("Компиляция на локальной машине", null,
|
||||
Global.normalProperties,
|
||||
"LocalMakePathWindows",
|
||||
"PrecompilationFlags",
|
||||
"Kernels"
|
||||
));
|
||||
} else {
|
||||
add(new PropertiesSubmenu("Компиляция на локальной машине", null,
|
||||
Global.normalProperties,
|
||||
"PrecompilationFlags",
|
||||
"Kernels"
|
||||
));
|
||||
}
|
||||
|
||||
@@ -19,9 +19,7 @@ public class RendererTestingPackageStatus extends RendererCell<TestingPackage> {
|
||||
String text_ = state.getDescription();
|
||||
switch (state) {
|
||||
case DoneWithErrors:
|
||||
if (value.tasksCount>value.doneTasksCount) {
|
||||
text_ += " " + Utils_.Brackets((value.tasksCount - value.doneTasksCount) + "/" + value.tasksCount);
|
||||
}
|
||||
text_ += " " + Utils_.Brackets((value.tasksCount - value.doneTasksCount) + "/" + value.tasksCount);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<properties>
|
||||
<font name="Times New Roman" size="14" style="2"/>
|
||||
<foreground color="-16777216"/>
|
||||
<text value="id"/>
|
||||
<text value="bug_"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="a9e5" class="javax.swing.JTextField" binding="BugReportsKeyFilter" custom-create="true">
|
||||
@@ -426,41 +426,6 @@
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="58b74" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<tabbedpane title="Вложения"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<splitpane id="4276b" binding="SC91">
|
||||
<constraints border-constraint="Center"/>
|
||||
<properties>
|
||||
<dividerLocation value="300"/>
|
||||
<dividerSize value="3"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="a0a40" binding="bugRepotsFilesPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<splitpane position="left"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</grid>
|
||||
<grid id="13d" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<splitpane position="right"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</grid>
|
||||
</children>
|
||||
</splitpane>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</tabbedpane>
|
||||
</children>
|
||||
|
||||
@@ -32,7 +32,6 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
public DescriptionInterface descriptionInterface;
|
||||
public CommentInterface commentInterface;
|
||||
public JSplitPane SC6;
|
||||
public JSplitPane SC91;
|
||||
DocumentListener descriptionAdditionListener = new DocumentListener() {
|
||||
@Override
|
||||
public void removeUpdate(DocumentEvent e) {
|
||||
@@ -124,7 +123,6 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
private JTextField BugReportsCommentFilter;
|
||||
private JPanel workspacesPanel;
|
||||
private JLabel adminLabel;
|
||||
private JPanel bugRepotsFilesPanel;
|
||||
private Viewer BugReportSettings;
|
||||
public CallbackForm() {
|
||||
LoadSplitters();
|
||||
@@ -155,7 +153,6 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
SwitchScreen(Global.normalProperties.SmallScreen);
|
||||
//-
|
||||
Global.componentsServer.db.bugReports.mountUI(bugReportsPanel);
|
||||
Global.componentsServer.db.bugReportsFiles.mountUI(bugRepotsFilesPanel);
|
||||
Global.componentsServer.db.recipients.mountUI(recipientsPanel);
|
||||
//-
|
||||
if (!Global.mainModule.getPass(PassCode.CheckAccount).isDone()) {
|
||||
|
||||
@@ -8,7 +8,6 @@ import Common.Visual.Controls.ShortLabel;
|
||||
import Common.Visual.Editor.BaseEditor;
|
||||
import Common.Visual.Menus.VisualiserMenuBar;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor;
|
||||
import _VisualDVM.Utils;
|
||||
import com.github.difflib.text.DiffRow;
|
||||
@@ -19,7 +18,6 @@ import javax.swing.*;
|
||||
import javax.swing.text.Highlighter;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public abstract class ComparisonForm<T> {
|
||||
@@ -27,6 +25,7 @@ public abstract class ComparisonForm<T> {
|
||||
final char cseparator = '\u200B';
|
||||
public Class<T> t; //класс объектов.
|
||||
//-->>
|
||||
public Vector<String> lines = new Vector<>(); //строки с учетом/неучетом пробелов. для сравнения
|
||||
public Vector<String> visible_lines = new Vector<>(); //строки с нетронутыми пробелами. для отображения
|
||||
protected JToolBar tools;
|
||||
protected JLabel lObjectName;
|
||||
@@ -160,8 +159,12 @@ public abstract class ComparisonForm<T> {
|
||||
showObject();
|
||||
}
|
||||
private void getLines() {
|
||||
lines.clear();
|
||||
visible_lines.clear();
|
||||
visible_lines = new Vector<String>(Arrays.asList(getText().split("\n")));
|
||||
//--
|
||||
Pair<Vector<String>, Vector<String>> p = Utils.getFortranLines(getText());
|
||||
lines = p.getKey();
|
||||
visible_lines = p.getValue();
|
||||
}
|
||||
protected void ClearText() {
|
||||
events_on = false;
|
||||
@@ -186,7 +189,7 @@ public abstract class ComparisonForm<T> {
|
||||
DiffRowGenerator generator = DiffRowGenerator.create()
|
||||
.showInlineDiffs(true)
|
||||
.inlineDiffByWord(true)
|
||||
.ignoreWhiteSpaces(!Global.normalProperties.SpacesOn)
|
||||
.ignoreWhiteSpaces(true)
|
||||
.oldTag(f -> separator)
|
||||
.newTag(f -> separator)
|
||||
.build();
|
||||
@@ -271,9 +274,9 @@ public abstract class ComparisonForm<T> {
|
||||
t2.addAll(slave.visible_lines);
|
||||
//просто выясняем кто из них длиннее, и короткий дополняем пустыми строками.]
|
||||
int delta = Math.abs(t1.size() - t2.size());
|
||||
if (visible_lines.size() > slave.visible_lines.size()) {
|
||||
if (lines.size() > slave.lines.size()) {
|
||||
Utils.addEmptyLines(t2, delta);
|
||||
} else if (visible_lines.size() < slave.visible_lines.size()) {
|
||||
} else if (lines.size() < slave.lines.size()) {
|
||||
Utils.addEmptyLines(t1, delta);
|
||||
}
|
||||
///----------------
|
||||
|
||||
@@ -23,11 +23,11 @@ public:
|
||||
elements.push_back(new_line);
|
||||
}
|
||||
|
||||
int getLength() const {
|
||||
return (int)elements.size();
|
||||
long getLength() const {
|
||||
return (long)elements.size();
|
||||
}
|
||||
|
||||
T* get(int i) {
|
||||
T* get(long i) {
|
||||
return elements[i];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
class CompilationSupervisor : public Supervisor<CompilationTask> {
|
||||
public:
|
||||
CompilationSupervisor() {
|
||||
this->init("compilationTasks.json");
|
||||
this->init("compilationTasks", 4);
|
||||
}
|
||||
|
||||
CompilationTask* getTaskById(int task_id) {
|
||||
for (int i = 0; i < getLength(); ++i) {
|
||||
CompilationTask* getTaskById(long task_id) {
|
||||
for (long i = 0; i < getLength(); ++i) {
|
||||
CompilationTask* task = get(i);
|
||||
if (task->getId() == task_id)
|
||||
return task;
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
|
||||
#include "Task.h"
|
||||
#include "Text.h"
|
||||
#include "json.hpp"
|
||||
|
||||
class CompilationTask : public Task {
|
||||
String test_name;
|
||||
String test_id;
|
||||
String makefile_text;
|
||||
public:
|
||||
void setTestName(String* test_name_in) {
|
||||
test_name = String(test_name_in->getCharArray());
|
||||
void setTestId(String* test_id_in) {
|
||||
test_id = String(test_id_in->getCharArray());
|
||||
}
|
||||
|
||||
void setMakefileText(String* makefile_text_in) {
|
||||
@@ -17,30 +16,22 @@ public:
|
||||
}
|
||||
|
||||
virtual void print() const {
|
||||
printf("id=%ld; maxtime=%d; test_name=%s\n", id, maxtime, test_name.getCharArray());
|
||||
printf("id=%ld; maxtime=%d; test_id=%s\n", id, maxtime, test_id.getCharArray());
|
||||
printf("makefile_text=%s\n", makefile_text.getCharArray());
|
||||
}
|
||||
|
||||
CompilationTask(Text* lines, int offset) : Task(lines, offset) {
|
||||
setTestName(lines->get(offset + 2));
|
||||
CompilationTask(Text* lines, int offset) :Task(lines, offset) {
|
||||
setTestId(lines->get(offset + 2));
|
||||
setMakefileText(lines->get(offset + 3));
|
||||
setState(Waiting);
|
||||
kernels = 1;
|
||||
}
|
||||
|
||||
CompilationTask(const nlohmann::json& data) : Task(data) {
|
||||
test_name = Utils::getValue<string>(data, "test_name");
|
||||
makefile_text = Utils::getValue<string>(data, "makefile_text");
|
||||
|
||||
setState(Waiting);
|
||||
kernels = 1;
|
||||
}
|
||||
|
||||
virtual void prepareWorkspace() {
|
||||
String makeFilePath = String(id) + "/Makefile";
|
||||
File makeFileFile = File(makeFilePath, this->makefile_text);
|
||||
String tests = userWorkspace + "/projects";
|
||||
String testPath = tests + "/" + test_name;
|
||||
String testPath = tests + "/" + test_id;
|
||||
Utils::CopyDirectory_L(testPath, workspace);
|
||||
}
|
||||
virtual String getLaunchScriptText() {
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
class RunSupervisor : public Supervisor<RunTask> {
|
||||
public:
|
||||
RunSupervisor(CompilationSupervisor* compilationSupervisor) {
|
||||
this->init("runTasks.json");
|
||||
|
||||
this->init("runTasks", 8);
|
||||
//проверить отмененные задачи.
|
||||
for (int i = 0; i < getLength(); ++i) {
|
||||
for (long i = 0; i < getLength(); ++i) {
|
||||
RunTask* task = this->get(i);
|
||||
CompilationTask* parent = compilationSupervisor->getTaskById(task->getTestCompilationTaskId());
|
||||
task->setState((parent->getState() == Done) ? Waiting : Canceled);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "CompilationTask.h"
|
||||
|
||||
class RunTask : public Task {
|
||||
int testcompilationtask_id;
|
||||
long testcompilationtask_id;
|
||||
String binary_name;
|
||||
String matrix;
|
||||
String environments;
|
||||
@@ -23,23 +23,34 @@ public:
|
||||
kernels
|
||||
);
|
||||
}
|
||||
|
||||
void setKernels(String* kernels_s) { kernels = atoi(kernels_s->getCharArray()); }
|
||||
void setTestCompilationTaskId(String* id_s) { testcompilationtask_id = strtol(id_s->getCharArray(), NULL, 10); }
|
||||
|
||||
int getTestCompilationTaskId() { return testcompilationtask_id; }
|
||||
|
||||
void setMatrix(String* matrix_in) { matrix = String(matrix_in->getCharArray()); }
|
||||
void setEnvironments(String* environments_in) { environments = String(environments_in->getCharArray()); }
|
||||
void setUsrPar(String* usr_par_in) { usr_par = String(usr_par_in->getCharArray(), '|'); }
|
||||
void setArgs(String* args_in) { args = String(args_in->getCharArray()); }
|
||||
void setParent(CompilationTask* parent_in) {
|
||||
int setKernels(String* kernels_s) {
|
||||
return kernels = atoi(kernels_s->getCharArray());
|
||||
}
|
||||
long setTestCompilationTaskId(String* id_s) {
|
||||
return testcompilationtask_id = strtol(id_s->getCharArray(), NULL, 10);
|
||||
}
|
||||
long getTestCompilationTaskId() {
|
||||
return testcompilationtask_id;
|
||||
}
|
||||
void setMatrix(String* matrix_in) {
|
||||
matrix = String(matrix_in->getCharArray());
|
||||
}
|
||||
void setEnvironments(String* environments_in) {
|
||||
environments = String(environments_in->getCharArray());
|
||||
}
|
||||
void setUsrPar(String* usr_par_in) {
|
||||
usr_par = String(usr_par_in->getCharArray(), '|');
|
||||
}
|
||||
void setArgs(String* args_in) {
|
||||
args = String(args_in->getCharArray());
|
||||
}
|
||||
void setParent(CompilationTask* parent_in) {
|
||||
parent = parent_in;
|
||||
binary_name = "spf_" + packageId+"_"+String(id) + "_" + matrix.Replace(' ', '_');
|
||||
}
|
||||
|
||||
CompilationTask* getParent() { return parent; }
|
||||
|
||||
CompilationTask* getParent() {
|
||||
return parent;
|
||||
}
|
||||
RunTask(Text* lines, int offset) :Task(lines, offset) {
|
||||
setTestCompilationTaskId(lines->get(offset + 2));
|
||||
setMatrix(lines->get(offset + 3));
|
||||
@@ -50,16 +61,6 @@ public:
|
||||
//todo setStartCommand
|
||||
}
|
||||
|
||||
RunTask(const nlohmann::json& data) : Task(data) {
|
||||
testcompilationtask_id = Utils::getValue<int>(data, "compilation_task_id");
|
||||
matrix = Utils::getValue<string>(data, "matrix");
|
||||
environments = Utils::getValue<string>(data, "environments");
|
||||
usr_par = Utils::getValue<string>(data, "usr_par");
|
||||
args = Utils::getValue<string>(data, "args");
|
||||
kernels = Utils::getValue<int>(data, "cores");
|
||||
//todo setStartCommand
|
||||
}
|
||||
|
||||
String getLaunchScriptText() override {
|
||||
String modules = userWorkspace + "/modules";
|
||||
String starterCall = modules + "/starter";
|
||||
|
||||
@@ -16,11 +16,13 @@ public:
|
||||
|
||||
String(const char* s, char ps) {
|
||||
body = s;
|
||||
for (int i = 0; i < getLength(); ++i)
|
||||
for (long i = 0; i < getLength(); ++i)
|
||||
body[i] = (s[i] == ps) ? '\n' : s[i];
|
||||
}
|
||||
|
||||
String(int s) { body = to_string(s); }
|
||||
String(long s) { body = to_string(s); }
|
||||
String(long long s) { body = to_string(s); }
|
||||
String (string s){ body = s;}
|
||||
|
||||
void println() const { printf("[%s]\n", body.c_str()); }
|
||||
|
||||
@@ -4,22 +4,18 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <math.h>
|
||||
#include <thread>
|
||||
#include <time.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "File.h"
|
||||
#include "Task.h"
|
||||
#include "Array.h"
|
||||
#include "Utils.h"
|
||||
#include "json.hpp"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
enum SupervisorState {
|
||||
WorkspacesCreation, //0
|
||||
@@ -62,13 +58,12 @@ public:
|
||||
for (auto& elem : this->getElements())
|
||||
elem->print();
|
||||
}
|
||||
|
||||
void init(const char* fileName, int recordSize) {
|
||||
state = WorkspacesCreation;
|
||||
File* packedTasks = new File(fileName);
|
||||
Text* lines = packedTasks->readLines();
|
||||
|
||||
const int length = lines->getLength() / recordSize;
|
||||
const long length = lines->getLength() / recordSize;
|
||||
int offset = 0;
|
||||
for (int i = 0; i < length; ++i) {
|
||||
this->add(new T(lines, offset));
|
||||
@@ -77,31 +72,6 @@ public:
|
||||
delete packedTasks;
|
||||
delete lines;
|
||||
}
|
||||
|
||||
void init(const char* fileName) {
|
||||
state = WorkspacesCreation;
|
||||
|
||||
std::ifstream file(fileName);
|
||||
if (!file.is_open()) {
|
||||
printf("can not open file %s\n", fileName);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
nlohmann::json data = nlohmann::json::parse(file);
|
||||
file.close();
|
||||
|
||||
if (data.contains("tasks")) {
|
||||
auto tasks = data["tasks"];
|
||||
int length = tasks.size();
|
||||
for (size_t i = 0; i < tasks.size(); ++i)
|
||||
this->add(new T(tasks[i]));
|
||||
}
|
||||
else {
|
||||
printf("can not fine object 'tasks'\n");
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
void changeState() {
|
||||
switch (this->state) {
|
||||
case WorkspacesCreation:
|
||||
@@ -200,7 +170,7 @@ public:
|
||||
killed = false;
|
||||
|
||||
while (activeTasks) {
|
||||
int oldActiveTasks = activeTasks;
|
||||
long oldActiveTasks = activeTasks;
|
||||
emptyKeys.clear();
|
||||
toDel.clear();
|
||||
|
||||
@@ -309,7 +279,7 @@ public:
|
||||
void saveState() {
|
||||
saveState(getStatePrefix() + printState());
|
||||
}
|
||||
void saveProgress(size_t persentDone) {
|
||||
void saveProgress(long long persentDone) {
|
||||
FILE* f = fopen("progress", "w");
|
||||
if (f) {
|
||||
fprintf(f, "%lld", persentDone);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "File.h"
|
||||
#include "Utils.h"
|
||||
@@ -40,7 +38,7 @@ enum TestType {
|
||||
|
||||
class Task {
|
||||
protected:
|
||||
int id;
|
||||
long id;
|
||||
|
||||
int maxtime;
|
||||
int kernels; //получение зависит от типа задачи.
|
||||
@@ -103,32 +101,22 @@ public:
|
||||
void setStart() { start_time = std::chrono::system_clock::now(); }
|
||||
double getTotalTime() const { return total_time; }
|
||||
|
||||
int getId() { return id; }
|
||||
int setId(String* id_s) {
|
||||
long getId() { return id; }
|
||||
long setId(String* id_s) {
|
||||
return id = strtol(id_s->getCharArray(), NULL, 10);
|
||||
}
|
||||
|
||||
int getMaxtime() { return maxtime; }
|
||||
int setMaxtime(String* maxtime_s) { return maxtime = atoi(maxtime_s->getCharArray()); }
|
||||
|
||||
int setMaxtime(String* maxtime_s) {
|
||||
return maxtime = atoi(maxtime_s->getCharArray());
|
||||
}
|
||||
const String& getWorkspace() { return workspace; }
|
||||
|
||||
TaskState getState() { return state; }
|
||||
TaskState setState(TaskState state_in) { return state = state_in; }
|
||||
|
||||
Task(Text* lines, int offset) {
|
||||
setId(lines->get(offset));
|
||||
setMaxtime(lines->get(offset + 1));
|
||||
workspace = packageWorkspace + "/" + String(id);
|
||||
}
|
||||
|
||||
Task(const nlohmann::json& data) {
|
||||
this->id = Utils::getValue<int>(data, "id");
|
||||
this->maxtime = Utils::getValue<int>(data, "maxtime");
|
||||
|
||||
workspace = packageWorkspace + "/" + String(id);
|
||||
}
|
||||
|
||||
virtual void print() const = 0;
|
||||
//-
|
||||
virtual void prepareWorkspace() {}
|
||||
@@ -228,5 +216,5 @@ public:
|
||||
}
|
||||
}
|
||||
//--
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ public:
|
||||
printf("text length=%ld\n", this->getLength());
|
||||
|
||||
auto elems = this->getElements();
|
||||
for (int i = 0; i < elems.size(); ++i) {
|
||||
for (long i = 0; i < elems.size(); ++i) {
|
||||
printf("i=%ld; [%s]\n", i, elems[i]->getCharArray());
|
||||
// elements[i]->println();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <time.h>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include "json.hpp"
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <filesystem>
|
||||
@@ -113,24 +112,11 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
static String getFileName(const String& path){
|
||||
static String getFileName(const String& path){
|
||||
int start_i = path.getBody().find_last_of('/');
|
||||
if (start_i != string::npos){
|
||||
return String(path.getBody().substr(start_i+1));
|
||||
}
|
||||
return String();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static T getValue(const nlohmann::json& data, const string& obj) {
|
||||
T retval;
|
||||
if (data.contains(obj))
|
||||
retval = data[obj];
|
||||
else {
|
||||
printf("can not fine object '%s'\n", obj.c_str());
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
};
|
||||
|
||||
22874
src/files/json.hpp
22874
src/files/json.hpp
File diff suppressed because it is too large
Load Diff
@@ -115,7 +115,7 @@ int main(int argc, char ** argv)
|
||||
("PATH="+PATH).println();
|
||||
("LD_LIBRARY_PATH="+LD_LIBRARY_PATH).println();
|
||||
//--
|
||||
packageId = Utils::getFileName(packageWorkspace);
|
||||
packageId =Utils::getFileName(packageWorkspace);
|
||||
#if __cplusplus >= 201703L
|
||||
std::filesystem::current_path(packageWorkspace.getCharArray());
|
||||
#else
|
||||
|
||||
@@ -1 +1 @@
|
||||
27
|
||||
24
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 502 B |
Binary file not shown.
|
Before Width: | Height: | Size: 843 B |
Reference in New Issue
Block a user