Compare commits

..

172 Commits

Author SHA1 Message Date
c3a669d497 no message 2025-06-13 12:40:26 +03:00
9b76409781 тест 2 2025-06-13 12:39:08 +03:00
ed3d133dcd тест ветки. 2025-06-13 12:30:14 +03:00
f2644392ad проверка на пустоту сообщений при распаковке
++
2025-06-12 13:32:49 +03:00
641ce80102 запаковка со стороны визуализатора инклудов 2025-06-06 22:59:58 +03:00
7924212fed no message 2025-06-06 22:36:49 +03:00
3090e80f72 распаковка сообщений от консольного режима. фикс подсчета ошибок,различия считались за ошибки, но для них уже давно есть отдельное поле
++
2025-06-06 14:06:29 +03:00
b418066932 распаковка сообщений от парсера 2025-05-26 00:23:09 +03:00
f5eaf3df25 принятие сообщений сапфора в json 2025-05-23 18:25:23 +03:00
bf5a648582 добавил поле типа 2025-05-23 17:10:33 +03:00
114e2ac4ad no message 2025-05-23 15:37:46 +03:00
b5e3a2c011 no message 2025-05-23 15:16:22 +03:00
b8d10a1434 сообщения в json 2025-05-22 14:11:38 +03:00
46cdd480bc no message 2025-05-20 16:34:09 +03:00
93396a00b1 ++
Перевод оценок параллельных вариантов в json формат
2025-05-20 16:31:54 +03:00
eeb57ab7c2 стата вариантов в json 2025-05-20 16:29:57 +03:00
e53f0ed939 TotalScore 2025-05-20 16:14:40 +03:00
9eede4802e стата вариантов в json 2025-05-20 14:33:28 +03:00
688f36c4c3 распаковка ссылок 2025-05-19 14:37:14 +03:00
c270429c66 объекты для ссылок 2025-05-18 19:34:05 +03:00
6135b738ba no message 2025-05-18 18:49:30 +03:00
41ce6527d5 ++
распределение в json, еще нашел внесенный переходом баг с отображением массивов текущего файла.
2025-05-18 18:12:30 +03:00
cba4425cd7 переименования в единый стиль полей массивов и регионов 2025-05-17 18:07:07 +03:00
0cb4022969 ++
fix бага со слиянием
2025-05-13 15:33:47 +03:00
0ec1ce09da ++
исправление бага с тестированием
2025-05-12 17:57:55 +03:00
ef92651552 рефакторинг. подготовка к переводу регионов на json 2025-05-12 17:18:26 +03:00
d8178fa704 no message 2025-05-10 17:16:24 +03:00
c148f62198 no message 2025-05-10 17:15:45 +03:00
e1291446c8 no message 2025-05-07 21:44:44 +03:00
1f4b736188 исправление имен файлов на виндовые слеши при распаковке 2025-05-07 20:36:14 +03:00
47a4772632 no message 2025-05-07 20:30:27 +03:00
571e2d2544 Перевод объявлений массивов в json 2025-05-07 20:29:58 +03:00
62a45fd8be no message 2025-05-06 17:28:46 +03:00
6e0956e3e5 Массивы в json 2025-05-06 16:26:47 +03:00
b46f86bebb ++
гков на джсон. добавлена проверка на отрицательный код инфы по джсон
2025-05-02 22:41:56 +03:00
d2c2f571ff ++
фикс падения при поиске зависимостей
2025-04-30 21:27:47 +03:00
70771dd0ce ++
метрику в json
2025-04-23 14:22:30 +03:00
b37e20e4a4 ++
решение проблемы совместимости с java 1.8._4xx
2025-04-21 15:27:20 +03:00
e8c748eb7e метрика json 2025-04-16 14:45:34 +03:00
da4e8b07bc ++
инклуды в json формате
2025-04-16 14:29:37 +03:00
611194be8c отображение инклудов 2025-04-16 14:16:38 +03:00
a0c45a2df0 небольшие правки с инклудами 2025-04-15 00:02:43 +03:00
8d236c99b8 no message 2025-04-14 21:58:11 +03:00
ccf20c354b no message 2025-04-14 21:44:35 +03:00
28eee09056 json для инклудов 2025-04-14 21:44:19 +03:00
cb1f19cfb7 ++
Перевод в json получаемых координат графа процедур
2025-04-13 21:39:24 +03:00
74f9a68ceb no message 2025-04-13 21:20:57 +03:00
9303839e8e no message 2025-04-13 20:14:25 +03:00
dc17b7d741 ++
граф процедур на json
2025-04-13 18:59:33 +03:00
eb86b936bc no message 2025-04-13 18:08:16 +03:00
cd86f1257a no message 2025-04-13 17:54:56 +03:00
46e1bd17f1 no message 2025-04-13 17:19:10 +03:00
7efe852bc1 граф процедур в json 2025-04-10 20:56:46 +03:00
829cd0c770 ++
убрал избыточно длинное имя в версиях пакета сапфор на панели сравнения
2025-04-09 20:34:58 +03:00
6faf06f949 ++
фикс бага с путями. визуализатор все пути к файлам переделывает на винду, для однотипности ключей в бд проекта. не было учтено при распаковке графа циклов
2025-04-09 20:19:19 +03:00
73a39681f1 ++
включил автоскролл при сравнении одинаковых пакетов
2025-04-07 19:34:32 +03:00
4c5331de55 ++
недостающие иконки
2025-04-07 18:35:24 +03:00
411e97abb8 ++
изменение отображения различий пакетов сапфора
2025-04-07 18:08:59 +03:00
fd21de489e возврат визуального бага. все же, нужно принудительно перерисовывать файл с ГПЕ,иначе шрифт все равно едет 2025-04-07 15:00:51 +03:00
aac4221a4d no message 2025-04-03 23:04:26 +03:00
f1a1ce0436 no message 2025-04-03 19:14:55 +03:00
419af0766e ++
Оптимизация анализа состояния версий пакетов сапфор
2025-04-03 19:08:17 +03:00
98ec37233a фикс бага с распаковкой сообщений при выгрузке версий тестирования сапфор как проекта 2025-04-03 16:08:36 +03:00
32e1e68d9a ++ 2025-04-01 15:46:41 +03:00
68cf40367a fix
При новой распаковке выдает имена с линуксовым слешем, для винды пришлось учесть
2025-03-31 22:25:27 +03:00
c6d2452530 граф циклов в джсоне 2025-03-31 22:12:04 +03:00
76c710b1bc распаковка с учетом интов 2025-03-31 22:01:40 +03:00
029947c793 no message 2025-03-31 21:18:15 +03:00
38f39411ad no message 2025-03-31 19:49:15 +03:00
cb7b5809f1 no message 2025-03-31 14:41:27 +03:00
ddf04c6f39 no message 2025-03-31 14:40:09 +03:00
48290ccf97 исправление енума на инт 2025-03-31 14:18:43 +03:00
e706b52b53 no message 2025-03-30 17:37:51 +03:00
c8045a5db1 no message 2025-03-30 16:38:39 +03:00
5ef516d019 no message 2025-03-30 16:00:18 +03:00
4f5a091af7 no message 2025-03-30 15:35:00 +03:00
cc21931ebe переименование/лишние поля 2025-03-30 15:30:38 +03:00
18227f565a логический тип в инт 2025-03-28 20:01:17 +03:00
ef5bd5b1a8 версия под джсон. в графе циклов временно закоммичена старая распаковка 2025-03-28 19:57:24 +03:00
41b98607cd рефакторинг объектов сапфора для подготовки к джсону 2025-03-28 18:55:54 +03:00
7178ecbc9c ++
убирание джсон запакованных полей у баг репортов
2025-03-27 15:31:26 +03:00
dcdbaa83cf рефакторинг адресатов баг репортов 2025-03-27 15:12:09 +03:00
86b582dd1f no message 2025-03-27 13:00:43 +03:00
c7a618dd25 промежуточный. перевод хранимых настроек багов из джсона в таблицу. рефакторинг публикации, был лишний проход 2025-03-27 12:55:56 +03:00
fb296a02ee no message 2025-03-27 12:45:55 +03:00
19afec4d25 утренние изменения
удаление эталона и роль студента
2025-03-26 16:12:00 +03:00
1ae4d1980a ++
роль студента
2025-03-26 14:00:46 +03:00
919e7a2e10 ++
сброс эталона пакета сапфор
2025-03-26 13:24:40 +03:00
fef75270a7 ++
доделано сравнение
2025-03-26 02:43:58 +03:00
2a30a42e77 фикс подсветки. 2025-03-26 02:07:22 +03:00
b900622e4e промежуточный. использовал невидимый символ для обозначения различий 2025-03-26 00:11:41 +03:00
a47a6705d8 ++
сравнение
2025-03-25 18:56:18 +03:00
809b1f8d14 ++
завершено избавление от  джсонов
2025-03-25 14:46:32 +03:00
23b143f916 no message 2025-03-25 14:09:11 +03:00
7ef9ee0d5c промежуточный. перевод опций и флагов из джсона в таблицы. надо еще отладить, и доделать клонирование 2025-03-25 01:56:48 +03:00
a60ed8f661 ++
показ эталонов сапфор
2025-03-24 14:50:54 +03:00
74ae6abf50 no message 2025-03-23 22:34:05 +03:00
b4d0a62d6c ++
учет только групп возможен и в конфигах сапфора
2025-03-23 22:31:50 +03:00
535053baca ++
упразднение джсон в описании конфигураций
2025-03-23 22:03:17 +03:00
af644f8f04 no message 2025-03-23 21:24:09 +03:00
dae9d58d82 no message 2025-03-23 18:44:12 +03:00
4f50c4a559 промежуточный. начало ввода индексов для пакетов 2025-03-23 16:43:19 +03:00
fcebae094f fix 2025-03-23 16:17:32 +03:00
abab3f067c ++
временне исправление эталонов тестирования сапфор
2025-03-23 15:59:28 +03:00
167ceb42a5 удаление неиспользуемых джсонов групп тестов и настроек. 2025-03-23 15:44:52 +03:00
cf9b028400 no message 2025-03-23 15:36:46 +03:00
b763c2c266 чистка лишних импортов.и фикс бага с сохранением тестов 2025-03-23 14:28:20 +03:00
811acba5a7 фикс. проверил внешние ключи новых таблиц 2025-03-23 13:20:11 +03:00
bc1faa1a06 no message 2025-03-23 13:06:44 +03:00
f6cc447481 промежуточный.привожу в порядок индексы. 2025-03-23 02:14:23 +03:00
10c213feae прмежуточный. в процесе рефакторина лишних джсон. частично в разобранном виде поэтому не сливать! 2025-03-21 23:02:53 +03:00
74146fae4c no message 2025-03-21 17:43:46 +03:00
df204b64a7 no message 2025-03-21 17:02:45 +03:00
2d0d69fd7a рефакторинг. прописал стандартную проверку существования объекта в бд сервера 2025-03-21 12:56:12 +03:00
637e9c5c0f рефакторинг взаимодействия с бд сервера. был индийский код при альтернативной базе на сервере компонент 2025-03-21 01:21:54 +03:00
78ee5bc428 ++
Удаление спф директив
2025-03-20 18:14:41 +03:00
0b5f8c6ec7 ++
рефакторинг бд файлов тестов.
2025-03-20 17:48:18 +03:00
3f4ef5f198 ++
ввод флага для конфигураций, учитывать только группы
2025-03-18 19:26:32 +03:00
afaaaba1e7 ++
отслеживание нанов в тестах
2025-03-18 15:28:00 +03:00
21a41987b4 no message 2025-03-16 15:28:04 +03:00
933638afb8 no message 2025-03-16 14:11:44 +03:00
b6b7bb3ae5 no message 2025-03-15 18:03:32 +03:00
6a3be45b1a ++
fix
2025-03-15 16:06:44 +03:00
55aa66fa18 исправил условие применения эталонов с "только корректность" на "все кроме производительности"
++
2025-03-15 13:53:23 +03:00
2ab2a79d8d фикс.. при отображении состава текущей конфигурации тестирования не снимались галочки с настроек,до этого момента 2025-03-15 13:42:16 +03:00
c8d597e9cd эталоны
работают только для тестов на корректность,и если задана соответствующая настройка( с последним можно подумать и искать их самостоятельно, если они есть)
2025-03-14 23:55:09 +03:00
9a5b84c068 рефакторинг анализа результатов запуска двм пакетов. был удвоенный код 2025-03-14 21:29:21 +03:00
174bc344a4 доработка создания эталонов, теперь отслеживается есть ли уже последовательная задача для каждого теста. прочие имеют ссылку на ее ид 2025-03-14 20:54:02 +03:00
e2b307d4f6 фикс бага с синхронизацией тестов из репозитория. забыл поменять почту со своей на серверную и они качались заново и множились.
начал внедрение эталонов
++
2025-03-14 19:13:04 +03:00
a2017f9e01 ++
добивание живых задач, отключение лишней рассылки админам, настройка удаления или не удаления пакета на машине
2025-03-14 13:48:30 +03:00
9f4eb9d88e fix.додедал этап прерывания компиляции 2025-03-14 10:35:24 +03:00
04cf5c1552 ++
исправления планировщика
2025-03-14 01:14:56 +03:00
c7626e877e no message 2025-03-13 22:52:44 +03:00
ALEXks
cb7360ae86 improved planner 2025-03-13 20:47:20 +03:00
8fc70d48ad имя пакета в имени задач планировщика. 2025-03-13 20:10:28 +03:00
4ce7190905 ++
перевод тестов на гит, рефакторинг проходов загрузки репозитория
2025-03-13 17:11:05 +03:00
dc68667b20 ++
Дополнение обновлений
2025-03-13 14:36:02 +03:00
1d97048de1 no message 2025-03-13 00:32:20 +03:00
91e40c4393 no message 2025-03-12 23:09:08 +03:00
a6e02172f8 no message 2025-03-12 21:50:13 +03:00
8a6c9804b4 сборка компонент под юниксом через гит 2025-03-12 21:47:54 +03:00
8aea85a009 сборка сапфора через гит. если версия собралась с ошибками, больше не будет попыток ее автоматической сборки.( но возможна ручная) 2025-03-12 21:04:22 +03:00
b1740da1f1 подправил бекапы. на почту шлется только бд,(иначе вложения не влезают). тестирование сохраняет только бд и тесты. 2025-03-10 01:48:41 +03:00
5653438b75 ++
ошибки в статусе пакета
2025-03-09 22:32:37 +03:00
c85661a264 назначение окружения PATH LD_LIBRARY_PATH
++
2025-03-09 21:35:34 +03:00
d2a333c7cb ++
Оптимизация рассылки при публикации.
2025-03-09 17:27:35 +03:00
f3747a359b ++
Исправлены баги с рассылкой и размножением сообщений.
2025-03-08 15:56:34 +03:00
e123600e06 no message 2025-03-08 02:47:58 +03:00
c4157fc30b рефакторинг бекапов. бекапы для тестирования. бекапы по кнопке
++
2025-03-08 02:42:21 +03:00
e428d621ac ++ 2025-03-07 17:37:30 +03:00
aa5bcc7df7 fix. журналы серверов были почему то настроены на папку компонентов 2025-03-07 17:33:28 +03:00
dec4835187 упразднение постоянного хранения тестовых архивов 2025-03-07 17:26:13 +03:00
d66fdc5e77 ++
перевод инфы о файлах в джсон. попутно задел под пользовательские типы файлов стиль язык
2025-03-07 03:10:05 +03:00
670324837d поле запаковки в json данных о файлах теста 2025-03-07 00:21:43 +03:00
ab0e0af6b3 определение размерности после замены кода теста на текущий проект. 2025-03-06 22:07:36 +03:00
b08242fed4 рефакторинг определения размерности тестов на сервере. 2025-03-06 21:48:51 +03:00
7b81a8bdd0 ++
мелочи. название p для версии общей памяти, фильтр задач по матрицам, отображение числа завершившихся задач в статусе, отображение размерности матрицы и числа процессов в таблице задач
2025-03-06 17:59:03 +03:00
20aef1f340 фикс багов с отображением тестов и внесенного бага печати исключений
++
2025-03-05 20:25:23 +03:00
39f5b99ade v++
Зачиста устаревших полей в БД тестировния
2025-03-04 17:11:17 +03:00
e8d6764563 генерация задач с обновленными параметрами. 2025-03-04 16:30:32 +03:00
9c0f3215ad no message 2025-03-04 14:19:04 +03:00
b908ddc8f1 no message 2025-03-04 13:43:31 +03:00
0b35c948ab аналогичная запаковка и распаковка окружения. осталось формирование задач и отображение в таблице 2025-03-04 13:33:46 +03:00
b79b33e232 fix 2025-03-04 03:30:39 +03:00
0e2d2abb84 удаление набора флагов 2025-03-04 02:24:27 +03:00
fe78d89a58 Merge branch 'main' of http://alex-freenas.ddns.net:3000/M/VisualSapfor 2025-03-04 02:15:32 +03:00
7f9305f02b промежуточный. внедрение наборов флагов в параметры тестирования двм. сделал добавление и редактирование. 2025-03-04 02:14:30 +03:00
ALEXks
fca5bb42bd rollback 2025-03-03 18:54:03 +03:00
ALEXks
4ae8c2f664 removed timer checking 2025-03-03 18:51:20 +03:00
ALEXks
683d5249eb fixed 2025-03-03 18:23:49 +03:00
ALEXks
278782a244 Merge branch 'main' of http://alex-freenas.ddns.net:3000/M/VisualSapfor into main 2025-03-03 18:18:57 +03:00
ALEXks
4288f83105 improved planner 2025-03-03 18:18:09 +03:00
472 changed files with 11041 additions and 4626 deletions

View File

@@ -23,6 +23,7 @@
<element id="extracted-dir" path="$PROJECT_DIR$/libs/log4j-1.2.17.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/libs/xmlbeans-2.6.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/libs/commons-lang-2.6.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/libs/java-diff-utils.jar" path-in-jar="/" />
</root>
</artifact>
</component>

25
.idea/workspace.xml generated
View File

@@ -7,13 +7,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Loggable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Loggable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Utils_.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Utils_.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Visual/Tables/RendererMilliseconds.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Visual/Tables/RendererMilliseconds.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -52,9 +46,9 @@
</file-type-list>
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/ConvertCorrectnessTests.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishGroup.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishTest.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/ConvertCorrectnessTests.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" root0="FORCE_HIGHLIGHTING" />
</component>
<component name="KotlinCodeInsightWorkspaceSettings">
@@ -64,7 +58,7 @@
<option name="stateVersion" value="1" />
</component>
<component name="ProblemsViewState">
<option name="selectedTabId" value="ProjectErrors" />
<option name="selectedTabId" value="CurrentFile" />
</component>
<component name="ProjectId" id="1UqWSAGBQQNofrCLxSPPtOZrGP7" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
@@ -83,6 +77,7 @@
<property name="JavaClassFindUsagesOptions.isDerivedClasses" value="true" />
<property name="JavaClassFindUsagesOptions.isFieldsUsages" value="true" />
<property name="JavaClassFindUsagesOptions.isMethodsUsages" value="true" />
<property name="OverrideImplement.combined" value="false" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
@@ -92,8 +87,8 @@
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.SHOW" value="true" />
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" />
<property name="extract.method.default.visibility" value="public" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/libs/commons-lang-2.6.0.jar" />
<property name="project.structure.last.edited" value="Libraries" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src" />
<property name="project.structure.last.edited" value="Artifacts" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.27322906" />
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
@@ -105,18 +100,18 @@
<recent name="controls.Trees" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_dif_utils" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\libs" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\Transformations" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\Common\icons" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\DVM\DVMTasks\UI" />
</key>
<key name="MoveMembersDialog.RECENTS_KEY">
<recent name="_VisualDVM.ComponentsServer.Component.Sapfor.Sapfor" />
<recent name="_VisualDVM.Constants" />
<recent name="_VisualDVM.Global" />
<recent name="_VisualDVM.ProjectData.SapforData.Arrays.UI.ProjectArraysForm" />
<recent name="_VisualDVM.TestingSystem.SAPFOR.SapforPackage.UI.SapforPackagesForm" />
<recent name="_VisualDVM.TestingSystem.DVM.DVMPackage.UI.DVMPackagesForm" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\SAPFOR\SapforSettingsCommand\UI" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

View File

@@ -4,7 +4,7 @@
"ServerUserPassword": "mprit_2011",
"OfferRegistrationOnStart": true,
"Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1740738431",
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1749652835\\tmp_influxsys\\v3",
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
@@ -15,7 +15,7 @@
"AutoTestsLoad": true,
"ConfirmPassesStart": true,
"ShowPassesDone": true,
"FocusPassesResult": true,
"FocusPassesResult": false,
"collapseCredentials": true,
"collapseFileGraphs": false,
"collapseFileMessages": false,
@@ -26,8 +26,12 @@
"Kernels": 8,
"LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe",
"CheckTestingIntervalSeconds": 10,
"AutoCheckTesting": false,
"AutoCheckTesting": true,
"EmailOnTestingProgress": true,
"CompleteCompilationOptions": true,
"CompleteRunEnvironments": true,
"CreateEthalonTasks": true,
"ErasePackageWorkspace": true,
"lastMachineId": 13,
"lastUserId": 34,
"lastCompilerId": 52,
@@ -37,7 +41,7 @@
"FortranWrapsOn": false,
"ExtensionsOn": false,
"ComparsionDiffMergeOn": true,
"ShowFullArraysDeclarations": false,
"ShowFullArraysDeclarations": true,
"ShowFullTabsNames": true,
"SmallScreen": false,
"BugReportsAgeLimit": 1,

View File

@@ -34,7 +34,7 @@ public abstract class Database {
// UI.Print(DebugPrintLevel.Database, "соединение с базой данных " + file.getAbsolutePath());
connect();
}
public void Activate() throws Exception{
public void Activate() throws Exception {
Connect();
CreateAllTables();
prepareTablesStatements();
@@ -224,6 +224,20 @@ public abstract class Database {
public <O extends DBObject, F extends iDBObject> LinkedHashMap<Integer, F> getMapByFKi(O owner, Class<F> fk_class) {
return getMapByFK(owner, fk_class, java.lang.Integer.class);
}
public <O extends iDBObject, F extends iDBObject> Vector<Integer> getFKi(
Integer owner_pk, Class<O> owner_class, Class<F> fk_class) {
String fk_name = owner_class.getSimpleName().toLowerCase() + "_id";
Vector<Integer> res = new Vector<>();
try {
for (Object o : tables.get(fk_class).Data.values()) {
F f = (F) o;
if (fk_class.getField(fk_name).get(f).equals(owner_pk)) res.add((Integer) f.getPK());
}
} catch (Exception e) {
Utils_.MainLog.PrintException(e);
}
return res;
}
//-
public <O extends DBObject, F extends DBObject> Vector<String> getVectorStringByFK(O owner, Class<F> fk_class) {
Vector<String> res = new Vector<>();
@@ -310,7 +324,7 @@ public abstract class Database {
}
public abstract PassCode_ getSynchronizePassCode(); //если бд есть на сервере.
//--
public void ReplaceFileAndReconnect(File file_in) throws Exception{
public void ReplaceFileAndReconnect(File file_in) throws Exception {
Disconnect();
Utils_.forceDeleteWithCheck(getFile());
FileUtils.moveFile(file_in, getFile());
@@ -318,10 +332,25 @@ public abstract class Database {
prepareTablesStatements();
Synchronize();
}
public void DropUI(){
public void DeleteDependencies(DBObject object) throws Exception {
DBTable object_table = getTable(object.getClass());
for (Class dep : object_table.getFKDependencies().keySet()) {
switch (object_table.getFKDependencies().get(dep).data) {
case NONE:
break;
case DROP:
DropByFK(object, dep);
break;
case DELETE:
DeleteByFK(object, dep);
break;
}
}
}
public void DropUI() {
SaveLastSelections();
}
public void ResetUI(){
public void ResetUI() {
RestoreLastSelections();
}
}

View File

@@ -17,6 +17,9 @@ public abstract class nDBObject extends DBObject {
public Object getEmptyFK() {
return "";
}
public String getFKName() {
return getClass().getSimpleName().toLowerCase() + "_id";
}
public void genName() {
id = Utils_.getDateName(getClass().getSimpleName().toLowerCase());
}

View File

@@ -4,9 +4,9 @@ import Common.Database.Objects.DBObject;
import Common.Database.Tables.DBTable;
import Common.Database.Tables.DBTableColumn;
import Common.Passes.PassException;
import Common.Utils.Pair;
import Common.Utils.Utils_;
import Common.Visual.UI;
import javafx.util.Pair;
import java.io.File;
import java.sql.*;
@@ -255,5 +255,4 @@ public abstract class SQLiteDatabase extends Database {
}
//--
//https://stackoverflow.com/questions/8558099/sqlite-query-with-byte-where-clause
}

View File

@@ -3,6 +3,7 @@ import Common.Database.Database;
import Common.Database.Objects.DBObject;
import java.lang.reflect.Field;
import java.util.Vector;
public abstract class DBTable<K, D extends DBObject> extends DataSet<K, D> {
//-
public DBTableColumn PK = null;
@@ -34,4 +35,31 @@ public abstract class DBTable<K, D extends DBObject> extends DataSet<K, D> {
res.append(c).append("\n");
return res.toString();
}
boolean vectorContains(D object, Vector<D> vector) {
for (D v_object : vector) {
if (isEqual(object, v_object))
return true;
}
return false;
}
public void ActualizeData(Vector<D> old, Vector<D> actual) throws Exception {
//привести данные вектора old в соответствие с вектором new
//те, что в нем появились вставить, те что отсутствуют но есть в old удалить
Vector<D> to_delete = new Vector<>();
Vector<D> to_insert = new Vector<>();
for (D object : old) {
if (!vectorContains(object, actual))
to_delete.add(object);
}
for (D object : actual) {
if (!vectorContains(object, old))
to_insert.add(object);
}
db.BeginTransaction();
for (D object : to_delete)
db.Delete(object);
for (D object : to_insert)
db.Insert(object);
db.Commit();
}
}

View File

@@ -87,4 +87,8 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
public boolean containsKey(Object key) {
return Data.containsKey(key);
}
//--
public boolean isEqual(D o1, D o2) {
return false;
}
}

View File

@@ -35,18 +35,7 @@ public abstract class DeleteObjectPass<D extends DBObject> extends ObjectPass<D>
@Override
protected void body() throws Exception {
getDb().Delete(target);
for (Class dep : getTable().getFKDependencies().keySet()) {
switch (getTable().getFKDependencies().get(dep).data) {
case NONE:
break;
case DROP:
getDb().DropByFK(target, dep);
break;
case DELETE:
getDb().DeleteByFK(target, dep);
break;
}
}
getDb().DeleteDependencies(target);
}
//тут именно на финише, чтобы в любом случае вся таблица всегда была видна.
@Override

View File

@@ -22,10 +22,6 @@ public class Pass<T> {
//--------------
public boolean ui_visible = true;
public Vector<PassControl> controls = new Vector<>();
public void addControl(PassControl control_in){
control_in.setVisible(ui_visible);
controls.add(control_in);
}
public TextLog Log; //внутренний журнал прохода.
protected boolean interrupt;
protected SwingWorker dispatcher = null;
@@ -34,6 +30,10 @@ public class Pass<T> {
private JButton button = null;
private JButton tabButton = null;
private Exception last_error; //последнее пойманное исключение выполнения.
public void addControl(PassControl control_in) {
control_in.setVisible(ui_visible);
controls.add(control_in);
}
//->>
public Throwable getCauseRec(Throwable ex) {
Throwable cause = ex.getCause();
@@ -79,7 +79,7 @@ public class Pass<T> {
control.setEnabled(flag);
}
public void setControlsVisible(boolean flag) {
ui_visible =flag;
ui_visible = flag;
for (PassControl control : controls)
control.setVisible(ui_visible);
}

View File

@@ -11,6 +11,11 @@ import java.util.LinkedHashMap;
public class Properties {
protected LinkedHashMap<String, JMenuItem> controls = new LinkedHashMap<>();
private File file = null; //файл где хранятся настройки.
public Properties() {
}
public Properties(File file_in) {
setFile(file_in);
}
public File getFile() {
return file;
}
@@ -24,11 +29,6 @@ public class Properties {
e.printStackTrace();
}
}
public Properties() {
}
public Properties(File file_in) {
setFile(file_in);
}
public boolean updateField(String name, Object newValue) {
try {
Field field = getClass().getField(name);
@@ -50,7 +50,7 @@ public class Properties {
return "?";
}
public boolean controlAction(String fieldName, JMenuItem control
){
) {
return false;
}
public JMenuItem getMenuItem(String fieldName) {
@@ -86,8 +86,8 @@ public class Properties {
ex.printStackTrace();
}
}
public void setControlVisible(String settingName, boolean flag){
if (controls.containsKey(settingName)){
public void setControlVisible(String settingName, boolean flag) {
if (controls.containsKey(settingName)) {
controls.get(settingName).setVisible(flag);
}
}

View File

@@ -0,0 +1,20 @@
package Common.Utils;
import com.google.gson.annotations.Expose;
public class IntegerPairJson {
@Expose
public int key;
@Expose
public int value;
public int getKey() {
return key;
}
public int getValue() {
return value;
}
public IntegerPairJson(int key_in, int value_in) {
key = key_in;
value = value_in;
}
public IntegerPairJson() {
}
}

View File

@@ -1,6 +1,6 @@
package Common.Utils;
import Common.Visual.UI;
import _VisualDVM.Visual.Windows.ReadOnlyMultilineTextForm;
import Common.Visual.Windows.ReadOnlyMultilineTextForm;
import java.io.File;
import java.io.FileWriter;
@@ -35,8 +35,8 @@ public interface Loggable {
ex.printStackTrace(writer);
writer.flush();
Print(out.toString());
Utils_.CopyToClipboard(out.toString());
if (UI.isActive()) {
Utils_.CopyToClipboard(out.toString());
ReadOnlyMultilineTextForm ff = new ReadOnlyMultilineTextForm();
ff.ShowDialog("Возникло исключение", out.toString());
}

View File

@@ -0,0 +1,95 @@
package Common.Utils;
import java.io.Serializable;
public class Pair<K, V> implements Serializable {
/**
* Key of this <code>Pair</code>.
*/
private K key;
/**
* Value of this this <code>Pair</code>.
*/
private V value;
/**
* Creates a new pair
*
* @param key The key for this pair
* @param value The value to use for this pair
*/
public Pair(K key, V value) {
this.key = key;
this.value = value;
}
/**
* Gets the key for this pair.
*
* @return key for this pair
*/
public K getKey() {
return key;
}
/**
* Gets the value for this pair.
*
* @return value for this pair
*/
public V getValue() {
return value;
}
/**
* <p><code>String</code> representation of this
* <code>Pair</code>.</p>
*
* <p>The default name/value delimiter '=' is always used.</p>
*
* @return <code>String</code> representation of this <code>Pair</code>
*/
@Override
public String toString() {
return key + "=" + value;
}
/**
* <p>Generate a hash code for this <code>Pair</code>.</p>
*
* <p>The hash code is calculated using both the name and
* the value of the <code>Pair</code>.</p>
*
* @return hash code for this <code>Pair</code>
*/
@Override
public int hashCode() {
// name's hashCode is multiplied by an arbitrary prime number (13)
// in order to make sure there is a difference in the hashCode between
// these two parameters:
// name: a value: aa
// name: aa value: a
return key.hashCode() * 13 + (value == null ? 0 : value.hashCode());
}
/**
* <p>Test this <code>Pair</code> for equality with another
* <code>Object</code>.</p>
*
* <p>If the <code>Object</code> to be tested is not a
* <code>Pair</code> or is <code>null</code>, then this method
* returns <code>false</code>.</p>
*
* <p>Two <code>Pair</code>s are considered equal if and only if
* both the names and values are equal.</p>
*
* @param o the <code>Object</code> to test for
* equality with this <code>Pair</code>
* @return <code>true</code> if the given <code>Object</code> is
* equal to this <code>Pair</code> else <code>false</code>
*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof Pair) {
Pair pair = (Pair) o;
if (key != null ? !key.equals(pair.key) : pair.key != null) return false;
if (value != null ? !value.equals(pair.value) : pair.value != null) return false;
return true;
}
return false;
}
}

View File

@@ -2,7 +2,6 @@ package Common.Visual;
import Common.CommonConstants;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.Grid.TableVisualData;
import Common.Database.Objects.riDBObject;
import Common.Database.Tables.DBTable;
import Common.Database.Tables.DataSet;
import Common.Database.Tables.FKBehaviour;
@@ -15,7 +14,6 @@ import Common.Visual.Menus.TableMenu;
import Common.Visual.Tables.*;
import Common.Visual.Tables.Grid.GridAnchestor;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.Global;
import javax.swing.*;
import javax.swing.table.TableColumn;
@@ -42,7 +40,6 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
//--
Object savedCurrentKey = null;
Vector<Object> savedSelectedKeys = new Vector<>();
//--
public DataSetControlForm(DataSet<?, D> dataSource_in, JPanel mountPanel_in) {
super(DataTable.class, mountPanel_in);
dataSource = dataSource_in;
@@ -83,6 +80,10 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
}
}
}
//--
public DataMenuBar getMenuBar() {
return bar;
}
protected boolean isPKVisible() {
return true;
}
@@ -574,12 +575,17 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
public PassCode_ getDeletePassCode() {
return null;
}
public Object getCurrentPK(Object nanValue){
return current==null? nanValue: current.getPK();
public Object getCurrentPK(Object nanValue) {
return current == null ? nanValue : current.getPK();
}
//todo временное решение ? ->>>
public boolean canModifyCurrent(TextLog Log){
return CheckCurrent(Log) && (
!(current instanceof riDBObject) || Global.mainModule.getAccount().CheckAuthorship(((riDBObject)current).sender_address,Log));
public boolean canModifyCurrent(TextLog Log) {
return CheckCurrent(Log);
}
public void SelectKeys(Vector<?> keys_in) {
SelectAll(false);
for (Object key_ : keys_in)
dataSource.get(key_).Select(true);
if (!keys_in.isEmpty())
Show(keys_in.lastElement());
}
}

View File

@@ -1,11 +1,13 @@
package _VisualDVM.Visual.Editor;
package Common.Visual.Editor;
import Common.MainModule_;
import Common.Utils.Pair;
import Common.Utils.Utils_;
import Common.Visual.Menus.StyledPopupMenu;
import Common.Visual.Menus.TextEditorMenu;
import Common.Visual.Themes.ThemeElement;
import Common.Visual.UI;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Utils;
import _VisualDVM.Visual.Syntax.SPFEditorTheme;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
@@ -15,8 +17,9 @@ import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.net.URI;
import java.util.Vector;
public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogFields {
private final StyledPopupMenu menu;
protected final StyledPopupMenu menu;
// protected int changesCount = 0;
// protected int insertsCount = 0;
// protected int removesCount = 0;
@@ -128,14 +131,6 @@ public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogF
changeFont(getFont().getSize() - 1);
}
@Override
public void applyTheme() {
float font_size = (float) getFont().getSize();
((SPFEditorTheme) MainModule_.instance.getUI().getTheme()).getEditorTheme().apply(this);
setFont(getFont().deriveFont(font_size));
menu.applyTheme();
//меню связано с редактором. поэтому тема меняется только вместе с ним.
}
@Override
public Component getContent() {
return this;
}
@@ -152,4 +147,29 @@ public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogF
}
return res;
}
//todo как то вывести из коммон.
@Override
public void applyTheme() {
float font_size = (float) getFont().getSize();
((SPFEditorTheme) MainModule_.instance.getUI().getTheme()).getEditorTheme().apply(this);
setFont(getFont().deriveFont(font_size));
menu.applyTheme();
//меню связано с редактором. поэтому тема меняется только вместе с ним.
}
//--
public Vector<Pair<Integer, Integer>> getErrorsForHightlight() {
Vector<Pair<Integer, Integer>> res = new Vector<>();
for (int i = 0; i < this.getLineCount(); ++i) {
try {
int start = getLineStartOffset(i);
int end = getLineEndOffset(i);
String line = this.getText(start, end);
if (Utils.isCrushedLine(line))
res.add(new Pair<>(start, end));
} catch (Exception ex) {
ex.printStackTrace();
}
}
return res;
}
}

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Visual.Editor;
package Common.Visual.Editor;
public class Viewer extends BaseEditor {
public Viewer() {
setLineWrap(true);

View File

@@ -8,12 +8,12 @@ import java.awt.*;
import java.awt.event.ActionListener;
public class DataMenuBar extends VisualiserMenuBar {
public JLabel countLabel = null;
private DataSet dataSource = null;
//-
public ActionListener selectAllListener = null;
public ActionListener unselectAllListener = null;
JButton selectAllButton = null;
JButton unselectAllButton = null;
private DataSet dataSource = null;
//-
public DataMenuBar(String dataName, PassCode_... passes) {
add(new JLabel(dataName + " : "));

View File

@@ -21,10 +21,10 @@ public class TableMenu extends StyledPopupMenu {
mcopy.addActionListener(e -> Utils_.CopyToClipboard(target.toString()));
add(mcopy);
//
add(value_scroll= new JScrollPane(value_view = new JTextArea()));
add(value_scroll = new JScrollPane(value_view = new JTextArea()));
value_view.setEditable(false);
value_view.setLineWrap(true);
value_view.setWrapStyleWord(true);
//value_view.setLineWrap(true);
//value_view.setWrapStyleWord(true);
}
@Override
public void CheckElementsVisibility() {
@@ -33,13 +33,13 @@ public class TableMenu extends StyledPopupMenu {
if ((row >= 0) && (column >= 0)) {
target = owner.getValueAt(row, column);
mcopy.setVisible(true);
Dimension d= new Dimension(Math.max(mcopy.getWidth(), 300),100);
Dimension d = new Dimension(Math.max(mcopy.getWidth(), 300), 100);
value_view.setVisible(true);
String res = target.toString();
if (target instanceof Vector){
if (target instanceof Vector) {
Vector<Object> v = (Vector<Object>) target;
Vector<String> res_ = new Vector<>();
for (Object o: v){
for (Object o : v) {
res_.add(o.toString());
}
res = String.join("\n", res_);

View File

@@ -1,5 +1,6 @@
package Common.Visual.Menus;
import Common.MainModule_;
import Common.Passes.Pass;
import Common.Passes.PassCode_;
import Common.Utils.Utils_;
import Common.Visual.Fonts.VisualiserFonts;
@@ -20,6 +21,10 @@ public class VisualiserMenuBar extends JToolBar {
}
}
}
public void addPasses(Pass... passes) {
for (Pass pass : passes)
add(pass.createButton());
}
public JMenuBar addMenus(JMenu... menus) {
JMenuBar bar = new JMenuBar() {
{

View File

@@ -18,18 +18,28 @@ public class HeaderTextFilter<D extends DBObject> implements DBObjectFilter_<D>
int columnIndex = CommonConstants.Nan; //номер столбца к которому привязан фильтр.
JTextField textField = null;
JPopupMenu popup = null;
boolean contains = true;
private String filterValue = "";
private int offset = 0;
//при одиночном клике, показать поверх заголовка столбца выпавшее меню с полем фильтра.
public HeaderTextFilter(DataSet dataSet_in, int columnIndex_in, int offset_in) {
public HeaderTextFilter(DataSet dataSet_in, int columnIndex_in, int offset_in, boolean contains_in) {
dataSet = dataSet_in;
columnIndex = columnIndex_in;
offset = offset_in;
contains = contains_in;
}
public HeaderTextFilter(DataSet dataSet_in, int columnIndex_in, int offset_in) {
this(dataSet_in, columnIndex_in, offset_in, true);
}
@Override
public boolean Validate(D object) {
Object field = dataSet.getUI().getColumnInfo(columnIndex).getFieldAt(object);
return (field instanceof String) && field.toString().toLowerCase().contains(filterValue);
if (field instanceof String) {
String s = field.toString().toLowerCase();
return contains ? s.contains(filterValue) :
(filterValue.isEmpty() || s.equals(filterValue)) || (filterValue.trim().isEmpty() && s.isEmpty());
}
return false;
}
//---
public void Mount(DataTable control) {

View File

@@ -1,11 +1,8 @@
package Common.Visual.Tables;
import Common.MainModule_;
import Common.Utils.Utils_;
import Common.Visual.Fonts.VisualiserFonts;
import javax.swing.*;
import java.util.Date;
public class RendererMilliseconds extends RendererCell<Long>{
public class RendererMilliseconds extends RendererCell<Long> {
@Override
public Long Init(JTable table, Object value, int row, int column) {
return (Long) value;

View File

@@ -4,5 +4,7 @@ public interface ThemeElement {
}
default void FontDown() {
}
void applyTheme();
default void applyTheme() {
}
;
}

View File

@@ -13,6 +13,6 @@ public class TreeForm<C extends StyledTree> extends ControlForm<C> {
}
@Override
protected void redrawControl() {
((DefaultTreeModel)getTree().getModel()).reload();
((DefaultTreeModel) getTree().getModel()).reload();
}
}

View File

@@ -59,12 +59,10 @@ public class UI {
return Question(MainModule_.instance.getUI().getFrontWindow(), text);
}
public static void Info(String message) {
Utils_.CopyToClipboard(message);
if (UI.isActive())
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 1);
}
public static void Error(String message) {
Utils_.CopyToClipboard(message);
if (UI.isActive())
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 0);
}

View File

@@ -108,7 +108,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
}
getContentPane().add(buttonsPane, BorderLayout.SOUTH);
}
public void BlockButtons(){
public void BlockButtons() {
btnOK.setVisible(false);
btnCancel.setVisible(false);
}

View File

@@ -30,6 +30,6 @@ public class ComboTextDialog extends Dialog<String, DialogTextComboBox> {
}
@Override
public int getDefaultHeight() {
return 135;
return 200;
}
}

View File

@@ -1,6 +1,6 @@
package _VisualDVM.Visual.Windows;
package Common.Visual.Windows;
import Common.Visual.Editor.BaseEditor;
import Common.Visual.Windows.Dialog.Text.TextDialog;
import _VisualDVM.Visual.Editor.BaseEditor;
public class MultilineTextForm extends TextDialog<BaseEditor> {
public MultilineTextForm() {
super(BaseEditor.class);

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Visual.Windows;
package Common.Visual.Windows;
public class ReadOnlyMultilineTextForm extends MultilineTextForm {
public ReadOnlyMultilineTextForm() {
}

View File

@@ -4,11 +4,9 @@ import Common.Database.Objects.rDBObject;
import Common.Utils.TextLog;
import Common.Utils.Utils_;
import Common.Utils.Vector_;
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientJson;
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientsJson;
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.ComponentsServer.Recipient.Recipient;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Constants;
import _VisualDVM.Global;
@@ -24,10 +22,8 @@ public class BugReport extends rDBObject {
public long visualiser_version = -1;
public long sapfor_version = -1;
public String comment = "";
@Description("DEFAULT ''")
public String packedRecipientsJson = "";
@Description("DEFAULT ''")
public String packedSettingsJson = ""; //устарело. (?)
public Vector<BugReportSetting> settings = null;
public Vector<BugReportRecipient> recipients = null;
public String executor = "";
@Description("DEFAULT ''")
public String executor_address = "";
@@ -54,7 +50,7 @@ public class BugReport extends rDBObject {
project_version = version_in;
visualiser_version = Global.visualiser.version;
sapfor_version = Global.components.get(ComponentType.Sapfor_F).version;
packedSettingsJson = Utils_.gson.toJson(Global.mainModule.getProject().sapforProperties);
settings = Global.mainModule.getProject().sapforProperties.toBugReportSettings();
percentage = 0;
description = description_in;
date = new Date().getTime();
@@ -69,7 +65,6 @@ public class BugReport extends rDBObject {
change_date = b.change_date;
description = b.description;
comment = b.comment;
packedRecipientsJson = b.packedRecipientsJson;
state = b.state;
percentage = b.percentage;
//-
@@ -78,8 +73,6 @@ public class BugReport extends rDBObject {
project_version = b.project_version;
visualiser_version = b.visualiser_version;
sapfor_version = b.sapfor_version;
packedSettingsJson = b.packedSettingsJson;
//-
descriptionAdditionDraft = b.descriptionAdditionDraft;
commentAdditionDraft = b.commentAdditionDraft;
owner = b.owner;
@@ -132,13 +125,12 @@ public class BugReport extends rDBObject {
"Версия визуализатора: " + visualiser_version,
"----------------------------------"
);
if (!project_version.isEmpty()) {
if (visualiser_version < 1134) {
res.add(getSettingsJson().getSummary());
} else {
res.add(getPropertiesJson().getSummary());
}
}
//--
Vector<BugReportSetting> settings_ = Global.componentsServer.db.getVectorByFK(this, BugReportSetting.class);
SapforProperties dummy = new SapforProperties();
for (BugReportSetting bugReportSetting : settings_)
res.add(dummy.getFieldDescription(bugReportSetting.name) + "=" + Utils_.DQuotes(bugReportSetting.value));
//--
return String.join("\n", res);
}
public String getPassport() {
@@ -155,29 +147,16 @@ public class BugReport extends rDBObject {
return project_version.isEmpty();
}
//--->
public void CheckRecipients() {
for (Recipient recipient : Global.componentsServer.db.recipients.Data.values())
recipient.Select(packedRecipientsJson.contains(recipient.email));
Global.componentsServer.db.recipients.getUI().SelectAll(false);
Vector<BugReportRecipient> recipients_ = state.equals(BugReportState.draft) ?
recipients : Global.componentsServer.db.getVectorByFK(this, BugReportRecipient.class);
if (recipients_ != null) {
for (BugReportRecipient bugReportRecipient : recipients_) {
if (Global.componentsServer.db.recipients.containsKey(bugReportRecipient.email))
Global.componentsServer.db.recipients.get(bugReportRecipient.email).Select(true);
}
public void saveRecipientsAsJson(Vector<Recipient> recipients) {
packedRecipientsJson = Utils_.gson.toJson(new RecipientsJson(recipients));
}
public Vector<String> getRecipients() {
Vector<String> res = new Vector<>();
if (packedRecipientsJson.isEmpty()) return res;
RecipientsJson recipients = Utils_.gson.fromJson(packedRecipientsJson, RecipientsJson.class);
for (RecipientJson recipientJson : recipients.array) {
res.add(recipientJson.address);
}
return res;
}
public VisualiserSettingsJson getSettingsJson() {
return packedSettingsJson.isEmpty() ? new VisualiserSettingsJson() : Utils_.gson.fromJson(packedSettingsJson, VisualiserSettingsJson.class);
}
public SapforProperties getPropertiesJson() {
return packedSettingsJson.isEmpty() ? new SapforProperties() : Utils_.gson.fromJson(packedSettingsJson, SapforProperties.class);
}
public boolean canAppend(UserAccount account, TextLog log) {
if (account.CheckRegistered(log)) {

View File

@@ -1,9 +1,16 @@
package _VisualDVM.ComponentsServer.BugReport;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.DBTable;
import Common.Database.Tables.FKBehaviour;
import Common.Database.Tables.FKCurrentObjectBehaviuor;
import Common.Database.Tables.FKDataBehaviour;
import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.BugReport.UI.BugReportsForm;
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
import javax.swing.*;
import java.util.LinkedHashMap;
import java.util.Vector;
import java.util.stream.Collectors;
public class BugReportsDBTable extends DBTable<String, BugReport> {
@@ -25,5 +32,12 @@ public class BugReportsDBTable extends DBTable<String, BugReport> {
public Vector<BugReport> getAllDrafts() throws Exception {
return Data.values().stream().filter(bugReport -> bugReport.state.equals(BugReportState.draft)).collect(Collectors.toCollection(Vector::new));
}
@Override
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
res.put(BugReportSetting.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.PASSIVE));
res.put(BugReportRecipient.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.PASSIVE));
return res;
}
//-
}

View File

@@ -9,8 +9,8 @@ public class BugReportAdditionJson implements Serializable {
@Expose
public String fieldName = "";
@Expose
public String textAddition ="";
public BugReportAdditionJson(BugReport bugReport, String fieldName_in, String addition_in){
public String textAddition = "";
public BugReportAdditionJson(BugReport bugReport, String fieldName_in, String addition_in) {
id = bugReport.id;
fieldName = fieldName_in;
textAddition = addition_in;

View File

@@ -1,11 +0,0 @@
package _VisualDVM.ComponentsServer.BugReport.Json;
import com.google.gson.annotations.Expose;
public class RecipientJson {
@Expose
public String address;
public RecipientJson(String addres_in) {
address= addres_in;
}
public RecipientJson() {
}
}

View File

@@ -1,17 +0,0 @@
package _VisualDVM.ComponentsServer.BugReport.Json;
import _VisualDVM.ComponentsServer.Recipient.Recipient;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class RecipientsJson {
@Expose
public List<RecipientJson> array = new Vector<>();
public RecipientsJson() {
}
public RecipientsJson(Vector<? extends Recipient> recipients) {
array = new Vector<>();
for (Recipient recipient : recipients)
array.add(new RecipientJson(recipient.email));
}
}

View File

@@ -1,10 +0,0 @@
package _VisualDVM.ComponentsServer.BugReport.Json;
import com.google.gson.annotations.Expose;
public class VisualiserSettingJson {
@Expose
public String name;
@Expose
public String value;
public VisualiserSettingJson(){
}
}

View File

@@ -1,22 +0,0 @@
package _VisualDVM.ComponentsServer.BugReport.Json;
import _VisualDVM.ProjectData.SapforData.SapforProperties;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class VisualiserSettingsJson {
@Expose
public List<VisualiserSettingJson> array = new Vector<>();
public String getSummary() {
SapforProperties properties = new SapforProperties(); //только для извлечения описаний.
Vector<String> res = new Vector<>();
for (VisualiserSettingJson setting : array) {
try {
res.add(properties.getFieldDescription(setting.name) + "=" + setting.value);
} catch (Exception ex) {
ex.printStackTrace();
}
}
return String.join("\n", res);
}
}

View File

@@ -0,0 +1,24 @@
package _VisualDVM.ComponentsServer.BugReportRecipient;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.iDBObject;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
public class BugReportRecipient extends iDBObject {
public String bugreport_id = "";
public String email = "";
public BugReportRecipient() {
}
public BugReportRecipient(BugReport bugReport, String email_in) {
bugreport_id = bugReport.id;
email = email_in;
}
public BugReportRecipient(String email_in) {
email = email_in;
}
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
BugReportRecipient src_ = (BugReportRecipient) src;
bugreport_id = src_.bugreport_id;
email = src_.email;
}
}

View File

@@ -0,0 +1,11 @@
package _VisualDVM.ComponentsServer.BugReportRecipient;
import Common.Database.Tables.iDBTable;
public class BugReportRecipientsDBTable extends iDBTable<BugReportRecipient> {
public BugReportRecipientsDBTable() {
super(BugReportRecipient.class);
}
@Override
public boolean isEqual(BugReportRecipient o1, BugReportRecipient o2) {
return o1.bugreport_id.equals(o2.bugreport_id) && o1.email.equals(o2.email);
}
}

View File

@@ -0,0 +1,27 @@
package _VisualDVM.ComponentsServer.BugReportSetting;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.iDBObject;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
public class BugReportSetting extends iDBObject {
public String bugreport_id = "";
public String name = "";
public String value = "";
public BugReportSetting() {
}
public BugReportSetting(BugReport bugReport, String name_in, Object value_in) {
this(name_in, value_in);
bugreport_id = bugReport.id;
}
public BugReportSetting(String name_in, Object value_in) {
name = name_in;
value = (value_in instanceof Boolean) ? ((boolean) value_in ? "1" : "0") : value_in.toString();
}
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
BugReportSetting src_ = (BugReportSetting) src;
bugreport_id = src_.bugreport_id;
name = src_.name;
value = src_.value;
}
}

View File

@@ -0,0 +1,7 @@
package _VisualDVM.ComponentsServer.BugReportSetting;
import Common.Database.Tables.iDBTable;
public class BugReportSettingsDBTable extends iDBTable<BugReportSetting> {
public BugReportSettingsDBTable() {
super(BugReportSetting.class);
}
}

View File

@@ -2,14 +2,18 @@ package _VisualDVM.ComponentsServer;
import Common.Database.SQLITE.SQLiteDatabase;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
import _VisualDVM.ComponentsServer.BugReport.BugReportsDBTable;
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipientsDBTable;
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSettingsDBTable;
import _VisualDVM.ComponentsServer.Recipient.RecipientsDataSet;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
import _VisualDVM.Passes.PassCode;
import java.nio.file.Paths;
import java.util.Vector;
public class BugReportsDatabase extends SQLiteDatabase {
public BugReportsDBTable bugReports;
public BugReportSettingsDBTable bugReportSettings;
public BugReportRecipientsDBTable bugReportRecipients;
public RecipientsDataSet recipients = new RecipientsDataSet();
public BugReportsDatabase() {
super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile());
@@ -17,6 +21,8 @@ public class BugReportsDatabase extends SQLiteDatabase {
@Override
protected void initAllTables() throws Exception {
addTable(bugReports = new BugReportsDBTable());
addTable(bugReportSettings = new BugReportSettingsDBTable());
addTable(bugReportRecipients = new BugReportRecipientsDBTable());
}
@Override
public void Init() throws Exception {
@@ -43,4 +49,14 @@ public class BugReportsDatabase extends SQLiteDatabase {
recipients.ShowUI(); //todo временно.
super.ResetUI();
}
public void saveBugreportRecipients(BugReport bugReport) throws Exception {
if (bugReport.recipients != null) {
for (BugReportRecipient recipient : bugReport.recipients) {
recipient.bugreport_id = bugReport.id;
Insert(recipient);
}
}
}
public void Patch() throws Exception {
}
}

View File

@@ -2,7 +2,6 @@ package _VisualDVM.ComponentsServer.Component;
import Common.Database.Tables.DataSet;
import Common.MainModule_;
import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.Component.PerformanceAnalyzer.PerformanceAnalyzer;
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor_F;
import _VisualDVM.ComponentsServer.Component.UI.ComponentsForm;
import _VisualDVM.Current;
@@ -18,7 +17,7 @@ public class ComponentsSet extends DataSet<ComponentType, Component> {
put(ComponentType.Visualiser, Global.visualiser = new Visualiser());
put(ComponentType.Sapfor_F, (Component) MainModule_.instance.set(Current.Sapfor, new Sapfor_F()));
put(ComponentType.Visualizer_2, Global.visualizer_2);
put(ComponentType.PerformanceAnalyzer, Global.performanceAnalyzer = new PerformanceAnalyzer());
// put(ComponentType.PerformanceAnalyzer, Global.performanceAnalyzer = new PerformanceAnalyzer());
put(ComponentType.Instruction, new Instruction());
}
public boolean needChanges() {
@@ -75,7 +74,10 @@ public class ComponentsSet extends DataSet<ComponentType, Component> {
return !bad_state;
}
public void initialVersionsCheck() {
for (Component component : Data.values())
for (Component component : Data.values()) {
System.out.println(component.getComponentType() + " initial version checking...");
component.InitialVersionCheck();
System.out.println("done");
}
}
}

View File

@@ -1,4 +1,5 @@
package _VisualDVM.ComponentsServer.Component.Json;
import Common.CommonConstants;
import Common.Utils.Utils_;
import _VisualDVM.ComponentsServer.Component.Component;
import _VisualDVM.ComponentsServer.Component.ComponentType;
@@ -13,15 +14,22 @@ public class ComponentPublicationInfoJson implements Serializable {
@Expose
public byte[] packedFile = null;
@Expose
public long versionNumber = CommonConstants.Nan;
@Expose
public String versionText = "";
@Expose
public String changeRecord = "";
@Expose
public boolean needsUpdateMinimalVersion = false;
public ComponentPublicationInfoJson(Component component) throws Exception{
@Expose
public boolean needsEmail = false;
@Expose
public boolean needsSendFile = false;
public ComponentPublicationInfoJson(Component component) throws Exception {
componentType = component.getComponentType();
fileName = component.getFileName();
packedFile = Utils_.fileToBytes(component.getFile());
versionNumber = component.version;
versionText = component.getVersionText();
}
}

View File

@@ -10,7 +10,7 @@ public class ComponentVersionsInfoJson implements Serializable {
public String minimal_version = "";
@Expose
public String actual_version = "";
public ComponentVersionsInfoJson(ComponentType componentType_in){
componentType=componentType_in;
public ComponentVersionsInfoJson(ComponentType componentType_in) {
componentType = componentType_in;
}
}

View File

@@ -1,6 +1,7 @@
package _VisualDVM.ComponentsServer.Component.Sapfor;
import Common.CommonConstants;
import Common.Passes.PassException;
import Common.Utils.Pair;
import Common.Utils.Utils_;
import Common.Visual.UI;
import _VisualDVM.ComponentsServer.Component.OSDComponent;
@@ -11,6 +12,7 @@ import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor;
import _VisualDVM.ProjectData.Project.db_project_info;
import _VisualDVM.TestingSystem.Common.Test.Test;
import _VisualDVM.Utils;
import org.apache.commons.io.FileUtils;
@@ -87,7 +89,8 @@ public abstract class Sapfor extends OSDComponent {
return new PassCode[]{
PassCode.SPF_RemoveDvmDirectivesToComments,
PassCode.SPF_RemoveDvmDirectives,
PassCode.SPF_RemoveOmpDirectives
PassCode.SPF_RemoveOmpDirectives,
PassCode.SPF_RemoveSpfDirectives
};
}
public static PassCode[] getIntervalsTransformationsCodes() {
@@ -177,6 +180,11 @@ public abstract class Sapfor extends OSDComponent {
if (line.toLowerCase().contains("segmentation fault")) {
return false;
}
/*
if (line.toLowerCase().contains("error in unparse")) {
return false;
}
*/
}
return true;
}
@@ -213,7 +221,7 @@ public abstract class Sapfor extends OSDComponent {
Charset.defaultCharset());
if (!file.setExecutable(true))
throw new Exception("Не удалось сделать файл скрипта " + name + " исполняемым!");
//--
//-- Windows
boolean flag = false;
do {
try {
@@ -271,37 +279,7 @@ public abstract class Sapfor extends OSDComponent {
result_lines
);
}
public static File getTempCopy(File src) throws Exception {
if (temp_copy == null || !temp_copy.exists()) {
temp_copy = Utils.getTempFileName("SAPFOR" + (Utils_.isWindows() ? ".exe" : ""));
FileUtils.copyFile(src, temp_copy);
temp_copy.setExecutable(true);
}
return temp_copy;
}
//--
public static boolean getMinMaxDim(File sapfor_drv, File workspace, Test test) throws Exception {
File sapfor = Sapfor.getTempCopy(sapfor_drv);
String flags = "-noLogo";
if (Sapfor.parse(sapfor, workspace, flags)
) {
Vector<String> outputLines = new Vector<>();
if (Sapfor.analysis(sapfor, workspace, PassCode.SPF_GetMaxMinBlockDistribution, flags, outputLines)) {
//---
for (String line : outputLines) {
String prefix = "GET_MIN_MAX_BLOCK_DIST: ";
if (line.startsWith(prefix)) {
String s = line.substring(prefix.length());
String[] data = s.split(" ");
test.min_dim = Math.max(Integer.parseInt(data[0]), 0);
test.max_dim = Math.max(Integer.parseInt(data[1]), 0);
return true;
}
}
}
}
return false;
}
public static int readVersionFromCode(File versionFile) {
int res = CommonConstants.Nan;
if (versionFile.exists()) {
@@ -327,6 +305,106 @@ public abstract class Sapfor extends OSDComponent {
}
return res;
}
//--
public static int getFileMaxDim_C(File file) {
int fileMax = 0;
final String prefix = "#pragma dvm array distribute";
int n = 0;
try {
for (String line : FileUtils.readLines(file, Charset.defaultCharset())) {
// #pragma dvm array distribute[block][block], не важно
String packedLine = Utils_.removeCharacters(Utils_.removeRedundantSpaces(line).toLowerCase(), "\n", "\r", "\t");
if (packedLine.startsWith(prefix)) {
packedLine = packedLine.substring(prefix.length());
boolean bracketOpen = false;
int pragmaMax = 0;
String distr = "";
for (int i = packedLine.indexOf('['); i < packedLine.length(); ++i) {
char c = packedLine.charAt(i);
if (bracketOpen) {
if (c == ']') {
bracketOpen = false;
if (distr.equals("block"))
pragmaMax++;
distr = "";
} else {
distr += c;
}
} else {
if (c == '[') {
bracketOpen = true;
} else {
break;
}
}
}
fileMax = Math.max(fileMax, pragmaMax);
}
++n;
}
} catch (Exception ex) {
ex.printStackTrace();
}
return fileMax;
}
public static int getProjectMinMaxDim_C(db_project_info project) {
int res = 0;
for (DBProjectFile file : project.db.files.Data.values()) {
if (file.isActiveProgram())
res = Math.max(res, Sapfor.getFileMaxDim_C(file.file));
}
return res;
}
public static Pair<Integer, Integer> getProjectFolderMinMaxDim_F(File sapfor_drv, File projectPath) {
String flags = "-noLogo";
Pair<Integer, Integer> res = new Pair<>(0, 0);
try {
if (Sapfor.parse(sapfor_drv, projectPath, flags)
) {
Vector<String> outputLines = new Vector<>();
if (Sapfor.analysis(sapfor_drv, projectPath, PassCode.SPF_GetMaxMinBlockDistribution, flags, outputLines)) {
//---
for (String line : outputLines) {
String prefix = "GET_MIN_MAX_BLOCK_DIST: ";
if (line.startsWith(prefix)) {
String s = line.substring(prefix.length());
String[] data = s.split(" ");
res = new Pair<>(Math.max(Integer.parseInt(data[0]), 0), Math.max(Integer.parseInt(data[1]), 0));
break;
}
}
}
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
try {
Utils.deleteFilesByExtensions(projectPath,
"proj", "dep", "jar"
);
File visualiser_data = new File(projectPath, Constants.data);
if (visualiser_data.exists())
FileUtils.forceDelete(visualiser_data);
} catch (Exception ex) {
ex.printStackTrace();
}
}
return res;
}
public static void getTestMinMaxDim_F(File sapfor_drv, Test test) {
Pair<Integer, Integer> res = getProjectFolderMinMaxDim_F(sapfor_drv, test.getServerPath());
test.min_dim = res.getKey();
test.max_dim = res.getValue();
}
public static void getTestMinMaxDime_C(Test test) {
int min_dim = 0;
int max_dim = 0;
for (File file : test.getServerFiles()) {
max_dim = Math.max(max_dim, getFileMaxDim_C(file));
}
test.min_dim = min_dim;
test.max_dim = max_dim;
}
public void refreshPid() {
try {
// UI.Info("Calling SPF_GetCurrentPID...");
@@ -567,26 +645,5 @@ public abstract class Sapfor extends OSDComponent {
if ((UI.isActive()) && (Global.mainModule.getUI().hasMainWindow()) && (Global.mainModule.getUI().getVersionsWindow() != null))
Global.mainModule.getUI().getVersionsWindow().BlockVariants();
}
//--------------------------------------------------------------------------->>
//временный (?) проход, по тихому получить размерность теста, предварительно выполнив тихий парс.
//тут все одноразовое. считаем что таблицы бд уже заполнены как надо.
/*
public LanguageStyle getStyle() throws Exception {
return (Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed;
}
*/
//------------------------------------------------------------------------------------------------------------------
/*
public String getConsoleFlags() throws Exception {
Vector<String> res = new Vector<>();
if ((Global.mainModule.getDb()).settings.get(SettingName.FREE_FORM).toBoolean())
res.add("-f90");
if ((Global.mainModule.getDb()).settings.get(SettingName.STATIC_SHADOW_ANALYSIS).toBoolean())
res.add("-sh");
res.add("-shwidth " + (Global.mainModule.getDb()).settings.get(SettingName.MAX_SHADOW_WIDTH));
if ((Global.mainModule.getDb()).settings.get(SettingName.KEEP_SPF_DIRECTIVES).toBoolean())
res.add("-keepSPF");
return String.join(" ", res);
}
*/
//--
}

View File

@@ -11,7 +11,7 @@ public class Sapfor_F extends Sapfor {
}
@Override
public String getAssemblyCommand() {
return "cd Repo/sapfor/experts/Sapfor_2017/_bin\n" +
return "cd Repo/SAPFOR/install\n" +
"cmake ../\n" +
"make -j 4\n";
}
@@ -19,7 +19,7 @@ public class Sapfor_F extends Sapfor {
public File getAssemblyFile() {
return Paths.get(
Global.RepoDirectory.getAbsolutePath(),
"sapfor/experts/Sapfor_2017/_bin/Sapfor_F").toFile();
"SAPFOR/install/Sapfor_F").toFile();
}
@Override
public String getUpdateCommand() {

View File

@@ -1,6 +1,6 @@
package _VisualDVM.ComponentsServer.Component.UI;
import Common.Visual.Editor.BaseEditor;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Visual.Editor.BaseEditor;
import javax.swing.*;
import java.awt.*;

View File

@@ -85,7 +85,7 @@ public class Visualiser extends Component {
}
return res;
}
public File getDownloadsDirectory(){
public File getDownloadsDirectory() {
File res = new File(getWorkspace(), Constants.DownloadsDirectoryName);
Utils_.CheckDirectory(res);
return res;

View File

@@ -73,8 +73,8 @@ public class Visualizer_2 extends OSDComponent {
}
@Override
public String getAssemblyCommand() {
File src_home= Paths.get(Global.RepoDirectory.getAbsolutePath(),"/sapfor/experts/Sapfor_2017/_src/Server").toFile();
return "cd " +Utils_.DQuotes(src_home)+
File src_home = Paths.get(Global.RepoDirectory.getAbsolutePath(), "SAPFOR/src/Server").toFile();
return "cd " + Utils_.DQuotes(src_home) +
"\n" +
"g++ -O3 -std=c++17 checkUniq.cpp server.cpp -o Visualizer_2 -lpthread -lstdc++fs\n";
}
@@ -82,7 +82,7 @@ public class Visualizer_2 extends OSDComponent {
public File getAssemblyFile() {
return Paths.get(
Global.RepoDirectory.getAbsolutePath(),
"sapfor/experts/Sapfor_2017/_src/Server/Visualizer_2").toFile();
"SAPFOR/src/Server/Visualizer_2").toFile();
}
public void Connect() throws Exception {
ClearLog();

View File

@@ -1,9 +1,13 @@
package _VisualDVM.ComponentsServer;
import Common.Database.Database;
import Common.Database.Objects.DBObject;
import Common.Database.RepositoryRefuseException;
import Common.Utils.Pair;
import Common.Utils.Utils_;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
import _VisualDVM.ComponentsServer.BugReport.Json.BugReportAdditionJson;
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.ComponentsServer.Component.Json.ComponentPublicationInfoJson;
import _VisualDVM.ComponentsServer.Component.Json.ComponentVersionsInfoJson;
@@ -11,96 +15,24 @@ import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Machine.MachineType;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.Passes.All.ArchivesBackupPass;
import _VisualDVM.Passes.All.UnzipFolderPass;
import _VisualDVM.Passes.All.ZipFolderPass;
import _VisualDVM.ProjectData.LanguageName;
import _VisualDVM.Repository.EmailMessage;
import _VisualDVM.Repository.Server.RepositoryServer;
import _VisualDVM.Utils;
import javafx.util.Pair;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.RandomStringUtils;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Vector;
public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
public CredentialsDatabase credentials_db = null;
//--
public static ZipFolderPass zip = new ZipFolderPass();
public static UnzipFolderPass unzip = new UnzipFolderPass();
public static ArchivesBackupPass backupSession = new ArchivesBackupPass();
//-
public static Vector<Pair<Machine, User>> storages = new Vector<>(
Arrays.asList(new Pair<>(new Machine("titan",
"dvmh.keldysh.ru",
22, MachineType.Server),
new User("dvmuser1", "mprit_2011")) // todo с этим паролем что-то сделать.
));
//-
protected Thread backUp = new Thread(() -> {
while (true) {
try {
//-------------------------------------
Calendar rightNow = Calendar.getInstance();
int year = rightNow.get(Calendar.YEAR);
int month = rightNow.get(Calendar.MONTH);
int day = rightNow.get(Calendar.DAY_OF_MONTH);
int hour = rightNow.get(Calendar.HOUR_OF_DAY);
int minute = rightNow.get(Calendar.MINUTE);
if ((hour == Global.componentsServerProperties.BackupHour) && (minute == Global.componentsServerProperties.BackupMinute)) {
//определить имя папки с багом.
String backUpName = year + "_" + (month + 1) + "_" + (day);
File todayBackUp = Paths.get(Global.DataBackUpsDirectory.getAbsolutePath(), backUpName).toFile();
File todayBackUpArchive = Paths.get(Global.DataBackUpsDirectory.getAbsolutePath(), backUpName + ".zip").toFile();
//-
File bugsDBBackUp = Paths.get(todayBackUp.getAbsolutePath(), db.getFile().getName()).toFile();
File bugsArchives = Paths.get(todayBackUp.getAbsolutePath(), "Bugs.zip").toFile();
//-
// Чистка старых бекапов на самом сервере.
Utils.keepNewFiles(todayBackUp.getParentFile(), 2);
if (!todayBackUpArchive.exists()) {
FileUtils.forceMkdir(todayBackUp);
Files.copy(db.getFile().toPath(), bugsDBBackUp.toPath());
//-
zip.Do("Bugs", bugsArchives.getAbsolutePath());
zip.Do(todayBackUp.getAbsolutePath(), todayBackUpArchive.getAbsolutePath());
Utils_.forceDeleteWithCheck(todayBackUp);
//-
for (Pair<Machine, User> cred : storages) {
backupSession.Do(cred.getKey(), cred.getValue(), todayBackUpArchive);
}
//bonus backup
//todo оформить как у планировщика, так как это нить, напрямую сервер трогать нельзя.
if (rightNow.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
EmailMessage message = new EmailMessage("db backup", "копия баз данных журнала ошибок");
message.addAttachement(db.getFile());
for (String address : Constants.admins_mails) {
Email(message, address);
}
}
}
}
//-------------------------------------
Thread.sleep(60000);
} catch (Exception ex) {
Utils_.MainLog.PrintException(ex);
}
}
});
public ComponentsServer() {
super(BugReportsDatabase.class);
}
@@ -113,6 +45,16 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
return Constants.ComponentsServerPort;
}
@Override
protected void extraBackup(File todayBackUp) {
zip.Do("Bugs", new File(todayBackUp, "Bugs.zip").getAbsolutePath());
}
@Override
public Database getDb() {
if (request.arg.equals("credentials"))
return credentials_db;
return super.getDb();
}
@Override
protected void beforePublishAction(DBObject object) throws Exception {
if (object instanceof BugReport) {
BugReport bugReport = (BugReport) object;
@@ -123,25 +65,42 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
}
}
@Override
protected void afterPublishAction(DBObject object) throws Exception {
if (object instanceof BugReport) {
BugReport bugReport = (BugReport) object;
if (bugReport.settings != null) {
for (BugReportSetting setting : bugReport.settings) {
setting.bugreport_id = bugReport.id;
db.Insert(setting);
}
}
if (bugReport.recipients != null) {
db.saveBugreportRecipients(bugReport);
}
}
}
@Override
protected void afterEditAction(DBObject object) throws Exception {
if (object instanceof BugReport) {
BugReport bugReport = (BugReport) object;
if (bugReport.recipients != null) {
db.bugReportRecipients.ActualizeData(
db.getVectorByFK(bugReport, BugReportRecipient.class),
bugReport.recipients);
}
}
}
@Override
protected void afterDeleteAction(DBObject object) throws Exception {
if (object instanceof BugReport) {
BugReport bugReport = (BugReport) object;
if (!bugReport.project_version.isEmpty()) Utils_.forceDeleteWithCheck(bugReport.getArchiveFile());
}else if (object instanceof UserAccount){
} else if (object instanceof UserAccount) {
UserAccount account = (UserAccount) object;
Utils_.forceDeleteWithCheck(account.getServerKeyFile());
}
}
@Override
public void StartAction() throws Exception {
if (Global.componentsServerProperties.EmailAdminsOnStart) {
EmailMessage message = new EmailMessage("Сервер Sapfor запущен", new Date().toString());
for (String address : Constants.admins_mails) {
Email(message, address);
}
}
}
@Override
public void ActivateDB() {
super.ActivateDB();
try {
@@ -151,10 +110,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
ex.printStackTrace();
}
}
@Override
protected void startAdditionalThreads() {
backUp.start();
}
//-
void DVMConvertProject() throws Exception {
String[] args = request.arg.split("\n");
@@ -204,14 +159,13 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
}
void AppendBugReportField() throws Exception {
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
if (db.bugReports.containsKey(transport.id)) {
checkExistense(transport.id, BugReport.class);
BugReport actual = db.bugReports.get(transport.id);
Field field = BugReport.class.getField(transport.fieldName);
field.set(actual, field.get(actual) + "\n" + transport.textAddition);
actual.change_date = new Date().getTime();
db.Update(actual);
response.object = actual;
} else throw new RepositoryRefuseException("Баг репорт с ключом " + transport.id + " не существует.");
}
void ReceiveAllArchives() throws Exception {
ZipFolderPass zip = new ZipFolderPass();
@@ -230,13 +184,11 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
}
void UpdateBugReport() throws Exception {
BugReport oldBugReport = (BugReport) request.object;
if (db.bugReports.containsKey(oldBugReport.id)) {
checkExistense(oldBugReport.id, BugReport.class);
BugReport bugReport = db.bugReports.get(oldBugReport.id);
bugReport.SynchronizeFields(oldBugReport);
bugReport.change_date = new Date().getTime();
db.Update(bugReport);
} else
throw new RepositoryRefuseException("Баг репорт с ключом " + oldBugReport.id + " не существует.");
}
//--
void GetComponentsBackUps() throws Exception {
@@ -305,6 +257,25 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
bufferWriter_.write("Минимальная версия поднята до " + info.versionText + "\n");
bufferWriter_.close();
}
//-рассылка об изменениях.
if (info.needsEmail) {
String version_mail_header = String.join(" ",
"Опубликована версия",
Utils_.DQuotes(info.versionNumber),
"компонента",
Utils_.DQuotes(info.componentType.getDescription()));
//-
EmailMessage message =
new EmailMessage(version_mail_header,
info.changeRecord
);
if (info.needsSendFile)
message.addAttachement(componentFile);
//--
for (String address : credentials_db.userAccounts.getActiveMails()) {
EmailMessagesQueue.add(new Pair<>(address, message));
}
}
}
void GetComponentsVersionsInfo() throws Exception {
Vector<String> types = (Vector<String>) request.object;
@@ -346,19 +317,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
void ReceiveCredentialsDatabase() throws Exception {
response.object = Utils_.fileToBytes(credentials_db.getFile());
}
void PublishUserAccount() throws Exception {
DBObject dbObject = (DBObject) request.object;
response.object = (Serializable) credentials_db.InsertS(dbObject).getPK();
credentials_db.userAccounts.get(response.object).generateKey();
}
void EditUserAccount() throws Exception {
UserAccount new_object = (UserAccount) request.object;
credentials_db.UpdateWithCheck(new_object);
}
void DeleteUserAccount() throws Exception {
Pair<Class, Object> to_delete = (Pair<Class, Object>) request.object;
afterDeleteAction(credentials_db.DeleteByPK(to_delete.getKey(), to_delete.getValue()));
}
//--
@Override
protected void UnsafeSession() throws Exception {
@@ -392,12 +350,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
@Override
protected void Session() throws Exception {
switch (code) {
case PublishUserAccount:
PublishUserAccount();
break;
case EditUserAccount:
EditUserAccount();
break;
case ReceiveCredentialsDatabase:
ReceiveCredentialsDatabase();
break;
@@ -419,9 +371,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
case DVMConvertProject:
DVMConvertProject();
break;
case DeleteUserAccount:
DeleteUserAccount();
break;
case CheckURLRegistered:
CheckURLRegistered();
break;

View File

@@ -1,17 +1,11 @@
package _VisualDVM.ComponentsServer;
import Common.Database.Objects.DBObject;
import Common.Database.SQLITE.SQLiteDatabase;
import Common.Database.Tables.FKBehaviour;
import Common.Database.Tables.FKCurrentObjectBehaviuor;
import Common.Database.Tables.FKDataBehaviour;
import Common.Passes.PassCode_;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
import _VisualDVM.ComponentsServer.UserAccount.UserAccountsDBTable;
import _VisualDVM.Passes.PassCode;
import java.nio.file.Paths;
import java.util.LinkedHashMap;
public class CredentialsDatabase extends SQLiteDatabase {
public UserAccountsDBTable userAccounts;
public SubscriberWorkspaceDBTable workspaces;
@@ -38,5 +32,4 @@ public class CredentialsDatabase extends SQLiteDatabase {
userAccounts.ShowUI();
super.ResetUI();
}
}

View File

@@ -5,7 +5,7 @@ public class UserAccountJson {
public String email;
@Expose
public String name;
public UserAccountJson(String email_in, String name_in){
public UserAccountJson(String email_in, String name_in) {
email = email_in;
name = name_in;
}

View File

@@ -4,6 +4,12 @@ import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
public class Recipient extends DBObject {
public String email = "";
public String name = "";
public Recipient() {
}
public Recipient(UserAccountJson json) {
email = json.email;
name = json.name;
}
@Override
public Object getPK() {
return email;
@@ -15,10 +21,4 @@ public class Recipient extends DBObject {
email = src_.email;
name = src_.name;
}
public Recipient() {
}
public Recipient(UserAccountJson json) {
email = json.email;
name = json.name;
}
}

View File

@@ -5,7 +5,6 @@ import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
import _VisualDVM.ComponentsServer.Recipient.UI.RecipientsForm;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Constants;
import _VisualDVM.Global;
@@ -15,16 +14,16 @@ public class RecipientsDataSet extends DataSet<String, Recipient> {
public RecipientsDataSet() {
super(String.class, Recipient.class);
}
public void Unpack(String packed){
public void Unpack(String packed) {
clear();
UserAccountsJson jsons = Utils_.gson.fromJson(packed, UserAccountsJson.class);
for (UserAccountJson userAccountJson: jsons.values){
for (UserAccountJson userAccountJson : jsons.values) {
Global.componentsServer.db.recipients.put(userAccountJson.email, new Recipient(userAccountJson));
}
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new RecipientsForm(this,mountPanel);
return new RecipientsForm(this, mountPanel);
}
@Override
public String getPluralDescription() {
@@ -34,11 +33,11 @@ public class RecipientsDataSet extends DataSet<String, Recipient> {
public String getSingleDescription() {
return "адресат";
}
public Vector<String> getSelectedMails(){
public Vector<String> getSelectedMails() {
//баг текущий. значит адресаты уже активные и правильные. дополняем их админами и автором.
Vector<String> res = new Vector<>();
for (Recipient recipient:Data.values()){
if (recipient.isSelected()&& !res.contains(recipient.email))
for (Recipient recipient : Data.values()) {
if (recipient.isSelected() && !res.contains(recipient.email))
res.add(recipient.email);
}
//--

View File

@@ -26,7 +26,7 @@ public class RecipientsForm extends DataSetControlForm<Recipient> {
}
@Override
protected DataMenuBar createMenuBar() {
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.SaveBugReportExecutor,PassCode.SaveBugReportRecipients);
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.SaveBugReportExecutor, PassCode.SaveBugReportRecipients);
}
@Override
protected ColumnInfo<Recipient> createPKColumn() {

View File

@@ -1,6 +1,5 @@
package _VisualDVM.ComponentsServer.SubscriberWorkspace.UI;
import Common.Database.Tables.DataSet;
import Common.Passes.PassCode_;
import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo;
@@ -47,7 +46,7 @@ public class SubscriberWorkspacesForm extends DataSetControlForm<SubscriberWorks
}
@Override
public DataMenuBar createMenuBar() {
return new DataMenuBar(dataSource.getPluralDescription());
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.DeleteRemoteWorkspace);
}
@Override
public boolean isObjectVisible(SubscriberWorkspace object) {

View File

@@ -3,6 +3,7 @@ import java.io.Serializable;
public enum AccountRole implements Serializable {
Undefined,
User,
Student,
Developer,
Admin;
public String getDescription() {
@@ -11,6 +12,8 @@ public enum AccountRole implements Serializable {
return "не зарегистрирован";
case User:
return "Пользователь";
case Student:
return "Студент";
case Developer:
return "Разработчик";
case Admin:

View File

@@ -2,9 +2,9 @@ package _VisualDVM.ComponentsServer.UserAccount.UI;
import Common.Utils.Utils_;
import Common.Visual.UI;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Global;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
public class UserAccountDialog extends DBObjectDialog<UserAccount, UserAccountFields> {
public UserAccountDialog() {
super(UserAccountFields.class);

View File

@@ -6,17 +6,18 @@ import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import javax.swing.*;
import java.awt.*;
public class UserAccountFields implements DialogFields {
private JPanel content;
public JTextField tfName;
public JTextField tfAddress;
public JCheckBox cbMail;
public JComboBox cbRole;
private JPanel content;
private void createUIComponents() {
// TODO: place custom component creation code here
tfName = new StyledTextField();
tfAddress = new StyledTextField();
cbRole = new JComboBox<>();
cbRole.addItem(AccountRole.User);
cbRole.addItem(AccountRole.Student);
cbRole.addItem(AccountRole.Developer);
cbRole.addItem(AccountRole.Admin);
}

View File

@@ -13,38 +13,37 @@ public class UserAccount extends iDBObject {
public String name = "";
public String email = "";
@Description("DEFAULT ''")
public String telegram_name="";
public String telegram_name = "";
@Description("DEFAULT 1")
public int subscribe_active = 1;
@Description("DEFAULT 'Undefined'")
public AccountRole role = AccountRole.Undefined; //права доступа
public UserAccount(){
public UserAccount() {
}
public UserAccount(UserAccount account_in) {
this.SynchronizeFields(account_in);
}
public UserAccount(String name_in, String email_in) {
name = name_in;
email = email_in;
}
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
UserAccount src_ = (UserAccount) src;
name = src_.name;
email = src_.email;
telegram_name=src_.telegram_name;
subscribe_active=src_.subscribe_active;
telegram_name = src_.telegram_name;
subscribe_active = src_.subscribe_active;
role = src_.role;
}
public UserAccount(String name_in, String email_in){
name = name_in;
email=email_in;
public File getClientKeyFile() {
return new File(Global.KeysDirectory, "key");
}
public File getClientKeyFile(){
return new File(Global.KeysDirectory,"key");
public File getServerKeyFile() {
return new File(Global.KeysDirectory, String.valueOf(id));
}
public File getServerKeyFile(){
return new File(Global.KeysDirectory,String.valueOf(id));
}
public String getKey() throws Exception{
public String getKey() throws Exception {
return FileUtils.readFileToString(getServerKeyFile());
}
public void generateKey() throws Exception {

View File

@@ -10,8 +10,6 @@ import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountsForm;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import javax.swing.*;
import java.util.LinkedHashMap;
@@ -20,15 +18,15 @@ public class UserAccountsDBTable extends iDBTable<UserAccount> {
public UserAccountsDBTable() {
super(UserAccount.class);
}
public UserAccount getByKey(String key_in) throws Exception{
for (UserAccount userAccount: Data.values()){
public UserAccount getByKey(String key_in) throws Exception {
for (UserAccount userAccount : Data.values()) {
if (userAccount.getKey().equals(key_in))
return userAccount;
}
return null;
}
public UserAccount getByEmail(String email_in){
for (UserAccount userAccount: Data.values()){
public UserAccount getByEmail(String email_in) {
for (UserAccount userAccount : Data.values()) {
if (userAccount.email.equals(email_in))
return userAccount;
}
@@ -53,28 +51,23 @@ public class UserAccountsDBTable extends iDBTable<UserAccount> {
res.put(SubscriberWorkspace.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
return res;
}
public String getPackedActiveRecipients(){
public String getPackedActiveRecipients() {
UserAccountsJson res = new UserAccountsJson();
Vector<String> active = new Vector<>();
for (UserAccount userAccount: Data.values()){
if ((userAccount.subscribe_active!=0) && !active.contains(userAccount.email)){
for (UserAccount userAccount : Data.values()) {
if ((userAccount.subscribe_active != 0) && !active.contains(userAccount.email)) {
active.add(userAccount.email);
res.values.add(new UserAccountJson(userAccount.email, userAccount.name));
}
}
return Utils_.gson.toJson(res);
}
public Vector<String> getActiveMails(){
public Vector<String> getActiveMails() {
Vector<String> res = new Vector<>();
for (UserAccount account: Data.values()){
if ((account.subscribe_active!=0)&& !res.contains(account.email))
for (UserAccount account : Data.values()) {
if ((account.subscribe_active != 0) && !res.contains(account.email))
res.add(account.email);
}
for (String admin_mail : Constants.admins_mails) {
if (!res.contains(admin_mail))
res.add(admin_mail);
}
return res;
}
}

View File

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

View File

@@ -3,9 +3,9 @@ import Common.Utils.Vector_;
import java.util.Vector;
public class Constants {
public static final int version = 1191;
public static final int planner_version = 12;
public static final int testingMaxKernels = 64; //вообще говоря, это параметр машины.
public static final int version = 1253;
public static final int planner_version = 24;
public static final int testingMaxKernels = 64;
//--
public static final String ApplicationFileName = "VisualSapfor.jar";
//--
@@ -26,11 +26,10 @@ public class Constants {
public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer";
public static final String KeyDirectoryName = "Keys";
//--
//SVN vmk-post@yandex.ru
public static final String REPOSITORY_AUTHENTICATION = "--username dvmhuser --password dvmh2013 --non-interactive";
public static final String DVM_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/dvm";
public static final String SAPFOR_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/sapfor";
public static final String SAPFOR_REPOSITORY_BIN = "/sapfor/experts/Sapfor_2017/_bin";
//GIT
public static final String DVM_TESTS_REPOSITORY = "https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm-auto-test";
public static final String SAPFOR_REPOSITORY = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR.git";
public static final String SAPFOR_VERSION_URL = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR/raw/branch/master/src/Utils/version.h";
//-вывод задач
public final static String parse_out_file = "parse_out.txt";
public final static String parse_err_file = "parse_err.txt";
@@ -47,8 +46,9 @@ public class Constants {
public static final int SMTPPort = 465;
public static final int MailSocketPort = 465;
//
//7998 отладочный порт. теперь.
public static final int ComponentsServerPort = 7995; //7795
public static final int TestingServerPort = 7998; //7998
public static final int TestingServerPort = 7996; //7996
public static final int SocketTimeout = 0;
//-
public static final String ServerAddress = "alex-freenas.ddns.net";
@@ -58,7 +58,7 @@ public class Constants {
public static final String package_json = "package_json";
public static final String results_json = "results_json";
//--
public static final int parser_group = -1;
public static final int parser_group = 6000;
public static final int compiler_group = -2;
// DBProjectFile
public static final String no_data = "Нет данных";
@@ -469,7 +469,7 @@ public class Constants {
};
public static Vector<String> admins_mails = new Vector_<>(
"sapfor.tracker@internet.ru",
"vmk-post@yandex.ru",
"79854210702@ya.ru"
"vmk-post@yandex.ru"
, "79854210702@ya.ru"
);
}

View File

@@ -17,7 +17,6 @@ import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Global {
//todo свести большинство к содержимому mainModule
@@ -39,7 +38,7 @@ public class Global {
public static File KeysDirectory;
public static File DataDirectory;
public static File BugReportsDirectory;
public static File BackUpsDirectory;
public static File BackUpsDirectory; //бекапы компонентов на локальной машине.
public static File TempDirectory;
public static File ProjectsDirectory;
public static File CompilationTasksDirectory;
@@ -48,7 +47,7 @@ public class Global {
public static File RepoDirectory;
public static File TestsDirectory;
public static File PerformanceAnalyzerDirectory;
public static File DataBackUpsDirectory;
public static File DataBackUpsDirectory; //бекапы данных сервера.
public static File DVMPackagesDirectory;
public static File SapforsDirectory;
public static File SapforPackagesDirectory;
@@ -61,8 +60,8 @@ public class Global {
public static Visualiser visualiser = null;
public static Visualizer_2 visualizer_2 = null;
public static void CheckVisualiserDirectories() {
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
//-
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
@@ -84,17 +83,18 @@ public class Global {
}
}
public static void CheckServerDirectories() {
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
//-
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
Utils_.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
//--
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
Utils_.CheckDirectory(KeysDirectory = new File(Utils_.getHomeDirectory(), Constants.KeyDirectoryName));
}
public static void CheckTestingSystemDirectories() {
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
Utils_.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
//-
Utils_.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName));
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
@@ -158,13 +158,17 @@ public class Global {
public static void NormalMode(int port) throws Exception {
//-------------------------------->>
mainModule = new MainModule();
System.out.println("main module initialization..");
mainModule.Init();
System.out.println("DONE");
//--
CheckVisualiserDirectories();
CreateLogAtComponentsPath();
//-
System.out.println("connection to visualiser_2..");
visualizer_2 = new Visualizer_2(port);
visualizer_2.Connect();
System.out.println("DONE");
visualizer_2.refreshPid();
//если делать раньше, то не удастся убить сервер.
if (Utils_.ContainsCyrillic(Utils_.getHomePath())) {
@@ -173,16 +177,27 @@ public class Global {
"Визуализатор завершает работу."); //
FinishApplication();
}
System.out.println("messages server starting..");
messagesServer = new MessagesServer();
messagesServer.Start();
System.out.println("DONE");
components = new ComponentsSet();
System.out.println("component initial versions checking..");
components.initialVersionsCheck();
System.out.println("DONE");
System.out.println("geting component actual versions..");
Global.mainModule.getPass(PassCode.GetComponentsActualVersions).Do();
System.out.println("DONE");
System.out.println("validation component actual versions..");
components.validateStates();
System.out.println("DONE");
if (components.needChanges()) {
System.out.println("components need changes!!");
boolean flag = true;
do {
System.out.println("Show components window...");
Global.mainModule.getUI().getComponentsWindow().ShowDialog("");
System.out.println("DONE");
if (flag = (!components.validateStates())) {
if (!UI.Question("Обнаружены некорректные компоненты.Работа визуализатора невозможна.\n" +
"Вернуться к окну компонент"
@@ -220,7 +235,7 @@ public class Global {
}
public static void ServerMode() throws Exception {
CheckServerDirectories();
CreateLogAtComponentsPath();
CreateLogAtHome();
componentsServer = new ComponentsServer();
componentsServer.ActivateDB();
componentsServer.Start();
@@ -228,7 +243,7 @@ public class Global {
}
public static void TestingSystemMode() throws Exception {
CheckTestingSystemDirectories();
CreateLogAtComponentsPath();
CreateLogAtHome();
testingServer = new TestingServer();
testingServer.ActivateDB();
testingServer.Start();
@@ -278,6 +293,10 @@ public class Global {
public static void Init(String... args) {
System.out.println("VisualSapfor.jar started..");
System.out.println("home directory is" + Utils_.Brackets(Utils_.getHomePath()));
System.out.println("args size = " + args.length);
for (int i = 0; i < args.length; ++i)
System.out.println("args[" + i + "]=" + Utils_.DQuotes(args[i]));
System.out.println("====");
//--->
try {
SynchronizeProperties();

View File

@@ -1,8 +1,8 @@
package _VisualDVM.GlobalData.Compiler;
import Common.Database.Objects.iDBObject;
import Common.Utils.Utils_;
import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironmentsSet;
import _VisualDVM.GlobalData.CompilerOption.CompilerOptionsSet;
import _VisualDVM.GlobalData.CompilerEnvironment.RawCompilerEnvironmentsSet;
import _VisualDVM.GlobalData.CompilerOption.RawCompilerOptionsSet;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.LanguageName;
@@ -29,8 +29,8 @@ public class Compiler extends iDBObject {
@Description("IGNORE")
public String versionText = "";
//-
public CompilerOptionsSet options = new CompilerOptionsSet();
public CompilerEnvironmentsSet environments = new CompilerEnvironmentsSet();
public RawCompilerOptionsSet options = new RawCompilerOptionsSet();
public RawCompilerEnvironmentsSet environments = new RawCompilerEnvironmentsSet();
//-
public Compiler() {
}

View File

@@ -13,8 +13,12 @@ public class CompilerDialog extends DBObjectDialog<Compiler, CompilerFields> {
super(CompilerFields.class);
}
@Override
public int getDefaultWidth() {
return 600;
}
@Override
public int getDefaultHeight() {
return 300;
return 450;
}
@Override
public void validateFields() {

View File

@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.GlobalData.Compiler.UI.CompilerFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="13" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
<xy x="20" y="20" width="500" height="437"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="87831" class="javax.swing.JTextField" binding="tfHome" custom-create="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -18,21 +18,12 @@
</component>
<vspacer id="44b33">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="12" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="627cc" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="расположение"/>
</properties>
</component>
<component id="48916" class="javax.swing.JButton" binding="bBrowse">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="true"/>
@@ -42,29 +33,48 @@
</component>
<component id="d58a0" class="javax.swing.JTextField" binding="tfCallCommand" custom-create="true">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="f3f87" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="команда вызова"/>
</properties>
</component>
<component id="87234" class="javax.swing.JTextField" binding="tfDescription" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="ac56f" class="javax.swing.JTextField" binding="tfVersionCommand" custom-create="true">
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="b2235" class="javax.swing.JTextField" binding="tfHelpCommand" custom-create="true">
<constraints>
<grid row="9" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="673a2" class="javax.swing.JComboBox" binding="cbCompilerType" custom-create="true">
<constraints>
<grid row="11" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<toolTipText value="выберите тип компилятора"/>
</properties>
</component>
<component id="d1e8b" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
@@ -74,38 +84,36 @@
<text value="описание"/>
</properties>
</component>
<component id="ac56f" class="javax.swing.JTextField" binding="tfVersionCommand" custom-create="true">
<component id="627cc" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<editable value="false"/>
<font name="Times New Roman" size="16" style="2"/>
<text value="расположение"/>
</properties>
</component>
<component id="f3f87" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="команда вызова"/>
</properties>
</component>
<component id="34097" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="запрос версии"/>
</properties>
</component>
<component id="b2235" class="javax.swing.JTextField" binding="tfHelpCommand" custom-create="true">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="8982d" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
@@ -114,21 +122,13 @@
</component>
<component id="19a71" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="10" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="тип"/>
</properties>
</component>
<component id="673a2" class="javax.swing.JComboBox" binding="cbCompilerType" custom-create="true">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<toolTipText value="выберите тип компилятора"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -1,15 +0,0 @@
package _VisualDVM.GlobalData.CompilerEnvironment;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.GlobalData.CompilerEnvironment.UI.CompilerEnvironmentsForm;
import javax.swing.*;
public class CompilerEnvironmentsSet extends DataSet<String, CompilerEnvironment> {
public CompilerEnvironmentsSet() {
super(String.class, CompilerEnvironment.class);
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new CompilerEnvironmentsForm(this, mountPanel);
}
}

View File

@@ -0,0 +1,14 @@
package _VisualDVM.GlobalData.CompilerEnvironment;
import Common.Database.Objects.iDBObject;
import Common.Utils.Utils_;
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
public class EnvironmentsLine extends iDBObject {
public EnvironmentsJson json;
public EnvironmentsLine(EnvironmentsJson json_in) {
json = json_in;
}
@Override
public String getBDialogName() {
return Utils_.Brackets(json.toLine());
}
}

View File

@@ -0,0 +1,41 @@
package _VisualDVM.GlobalData.CompilerEnvironment;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsSetJson;
import _VisualDVM.GlobalData.CompilerEnvironment.UI.EnvironmentsLinesForm;
import javax.swing.*;
public class EnvironmentsLinesSet extends DataSet<Integer, EnvironmentsLine> {
public int maxId = 1;
public EnvironmentsLinesSet() {
super(Integer.class, EnvironmentsLine.class);
}
public EnvironmentsLinesSet(EnvironmentsSetJson json) {
super(Integer.class, EnvironmentsLine.class);
for (EnvironmentsJson environmentsJson : json.values) {
EnvironmentsLine environmentsLine = new EnvironmentsLine(environmentsJson);
environmentsLine.id = maxId++;
put(environmentsLine.id, environmentsLine);
}
}
@Override
public String getSingleDescription() {
return "набор переменных окружения";
}
@Override
public String getPluralDescription() {
return "наборы переменных окружения";
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new EnvironmentsLinesForm(this, mountPanel);
}
public EnvironmentsSetJson toJson() {
EnvironmentsSetJson res = new EnvironmentsSetJson();
for (EnvironmentsLine environmentsLine : Data.values()) {
res.values.add(environmentsLine.json);
}
return res;
}
}

View File

@@ -0,0 +1,17 @@
package _VisualDVM.GlobalData.CompilerEnvironment.Json;
import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironment;
import com.google.gson.annotations.Expose;
public class EnvironmentJson {
@Expose
public String name; //в том числе и с разделителем если есть. поиск по startswith
@Expose
public String value; //значение без кавычек
public EnvironmentJson(CompilerEnvironment src) {
name = src.name;
value = src.value;
}
public EnvironmentJson(String name_in, String value_in) {
name = name_in;
value = value_in;
}
}

View File

@@ -0,0 +1,17 @@
package _VisualDVM.GlobalData.CompilerEnvironment.Json;
import Common.Utils.Utils_;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class EnvironmentsJson {
@Expose
public List<EnvironmentJson> values = new Vector<>();
public String toLine() {
Vector<String> res = new Vector<>();
for (EnvironmentJson environmentJson : values) {
res.add(environmentJson.name + "=" + Utils_.DQuotes(environmentJson.value));
}
return String.join(" ", res);
}
}

View File

@@ -0,0 +1,9 @@
package _VisualDVM.GlobalData.CompilerEnvironment.Json;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class EnvironmentsSetJson {
@Expose
public List<EnvironmentsJson> values = new Vector<>();
}

View File

@@ -0,0 +1,47 @@
package _VisualDVM.GlobalData.CompilerEnvironment;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentJson;
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
import _VisualDVM.GlobalData.CompilerEnvironment.UI.CompilerEnvironmentsForm;
import javax.swing.*;
public class RawCompilerEnvironmentsSet extends DataSet<String, CompilerEnvironment> {
public RawCompilerEnvironmentsSet() {
super(String.class, CompilerEnvironment.class);
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new CompilerEnvironmentsForm(this, mountPanel);
}
@Override
public String getPluralDescription() {
return "переменные окружения";
}
@Override
public String getSingleDescription() {
return "переменная окружения";
}
public CompilerEnvironment findByJson(EnvironmentJson json) {
for (CompilerEnvironment compilerEnvironment : Data.values()) {
if (json.name.equals(compilerEnvironment.name))
return compilerEnvironment;
}
return null;
}
public void Reset() {
for (CompilerEnvironment environment : Data.values()) {
environment.select(false);
environment.value = "";
}
}
public void Synchronize(EnvironmentsJson json) {
for (EnvironmentJson environmentJson : json.values) {
CompilerEnvironment compilerEnvironment = findByJson(environmentJson);
if (compilerEnvironment != null) {
compilerEnvironment.select(true);
compilerEnvironment.value = environmentJson.value;
}
}
}
}

View File

@@ -0,0 +1,140 @@
package _VisualDVM.GlobalData.CompilerEnvironment.UI;
import Common.Database.Tables.DataSet;
import Common.Passes.Pass;
import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.CompilerEnvironment.EnvironmentsLine;
import _VisualDVM.GlobalData.CompilerEnvironment.EnvironmentsLinesSet;
import _VisualDVM.GlobalData.CompilerEnvironment.Json.EnvironmentsJson;
import _VisualDVM.Passes.PassCode;
import javax.swing.*;
public class EnvironmentsLinesForm extends DataSetControlForm<EnvironmentsLine> {
public EnvironmentsLinesForm(DataSet<?, EnvironmentsLine> dataSource_in, JPanel mountPanel_in) {
super(dataSource_in, mountPanel_in);
}
@Override
protected boolean hasCheckBox() {
return false;
}
@Override
protected boolean isPKVisible() {
return false;
}
@Override
protected void createColumns() {
AddColumns(new ColumnInfo<EnvironmentsLine>("") {
@Override
public Object getFieldAt(EnvironmentsLine object) {
return object.json.toLine();
}
});
}
@Override
protected DataMenuBar createMenuBar() {
DataMenuBar res = super.createMenuBar();
res.addPasses(
new Pass<EnvironmentsLine>() {
@Override
public String getIconPath() {
return "/Common/icons/RedAdd.png";
}
@Override
public String getDescription() {
return "Добавление набора переменных окружения";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerEnvironmentsForTesting);
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent())) {
target = new EnvironmentsLine((EnvironmentsJson) pass.target);
target.id = ((EnvironmentsLinesSet) dataSource).maxId++;
return true;
}
return false;
}
@Override
protected void body() throws Exception {
dataSource.put(target.getPK(), target);
}
@Override
protected void showDone() throws Exception {
dataSource.ShowUI(target.getPK());
}
},
new Pass<EnvironmentsLine>() {
@Override
public String getIconPath() {
return "/Common/icons/Edit.png";
}
@Override
public String getDescription() {
return "Редактирование набора переменных окружения";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (dataSource.getUI().CheckCurrent(Log)) {
target = dataSource.getUI().getCurrent();
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerEnvironmentsForTesting);
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent(), target.json)) {
return true;
}
}
return false;
}
@Override
protected void body() throws Exception {
}
@Override
protected void showFinish() throws Exception {
dataSource.ShowUI(target.getPK());
}
},
new Pass<EnvironmentsLine>() {
@Override
public String getIconPath() {
return "/Common/icons/Delete.png";
}
@Override
public String getDescription() {
return "Удаление набора переменных окружения";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (dataSource.getUI().CheckCurrent(Log)) {
target = dataSource.getUI().getCurrent();
return dataSource.getUI().ShowDeleteObjectDialog(target);
}
return false;
}
@Override
protected void showPreparation() throws Exception {
dataSource.ClearUI();
}
@Override
protected void body() throws Exception {
dataSource.Data.remove(target.getPK());
}
@Override
protected void showFinish() throws Exception {
dataSource.ShowUI();
}
}
);
return res;
}
}

View File

@@ -1,14 +1,12 @@
package _VisualDVM.GlobalData.CompilerOption;
import Common.Database.Objects.DBObject;
import Common.Utils.Utils_;
import com.sun.org.glassfish.gmbal.Description;
import java.util.Arrays;
import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CompilerOption extends DBObject {
@Description("PRIMARY KEY, UNIQUE")
public String name = "";
public String parameterSeparator = "";
public String parameterName = "";

View File

@@ -1,15 +0,0 @@
package _VisualDVM.GlobalData.CompilerOption;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.GlobalData.CompilerOption.UI.CompilerOptionsForm;
import javax.swing.*;
public class CompilerOptionsSet extends DataSet<String, CompilerOption> {
public CompilerOptionsSet() {
super(String.class, CompilerOption.class);
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new CompilerOptionsForm(this, mountPanel);
}
}

View File

@@ -0,0 +1,16 @@
package _VisualDVM.GlobalData.CompilerOption.Json;
import _VisualDVM.GlobalData.CompilerOption.CompilerOption;
import com.google.gson.annotations.Expose;
public class OptionJson {
@Expose
public String name; //в том числе и с разделителем если есть. поиск по startswith
@Expose
public String value; //значение без кавычек
public OptionJson(CompilerOption src) {
this(src.name + src.parameterSeparator, src.parameterValue);
}
public OptionJson(String name_in, String value_in) {
name = name_in;
value = value_in;
}
}

View File

@@ -0,0 +1,18 @@
package _VisualDVM.GlobalData.CompilerOption.Json;
import Common.Utils.Utils_;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class OptionsJson {
@Expose
public List<OptionJson> values = new Vector<>();
public String toLine() {
Vector<String> res = new Vector<>();
for (OptionJson optionJson : values) {
res.add(optionJson.name +
(optionJson.value.contains(" ") ? Utils_.DQuotes(optionJson.value) : optionJson.value));
}
return String.join(" ", res);
}
}

View File

@@ -0,0 +1,11 @@
package _VisualDVM.GlobalData.CompilerOption.Json;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class OptionsSetJson {
@Expose
public List<OptionsJson> values = new Vector<>();
public OptionsSetJson() {
}
}

View File

@@ -0,0 +1,14 @@
package _VisualDVM.GlobalData.CompilerOption;
import Common.Database.Objects.iDBObject;
import Common.Utils.Utils_;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
public class OptionsLine extends iDBObject {
public OptionsJson json;
public OptionsLine(OptionsJson json_in) {
json = json_in;
}
@Override
public String getBDialogName() {
return Utils_.Brackets(json.toLine());
}
}

View File

@@ -0,0 +1,41 @@
package _VisualDVM.GlobalData.CompilerOption;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsSetJson;
import _VisualDVM.GlobalData.CompilerOption.UI.OptionsLinesForm;
import javax.swing.*;
public class OptionsLinesSet extends DataSet<Integer, OptionsLine> {
public int maxId = 1;
public OptionsLinesSet() {
super(Integer.class, OptionsLine.class);
}
public OptionsLinesSet(OptionsSetJson json) {
super(Integer.class, OptionsLine.class);
for (OptionsJson optionsJson : json.values) {
OptionsLine optionsLine = new OptionsLine(optionsJson);
optionsLine.id = maxId++;
put(optionsLine.id, optionsLine);
}
}
@Override
public String getSingleDescription() {
return "набор опций компиляции";
}
@Override
public String getPluralDescription() {
return "наборы опций компиляции";
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new OptionsLinesForm(this, mountPanel);
}
public OptionsSetJson toJson() {
OptionsSetJson res = new OptionsSetJson();
for (OptionsLine optionsLine : Data.values()) {
res.values.add(optionsLine.json);
}
return res;
}
}

View File

@@ -0,0 +1,49 @@
package _VisualDVM.GlobalData.CompilerOption;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionJson;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.GlobalData.CompilerOption.UI.CompilerOptionsForm;
import javax.swing.*;
//нужно для опций компиляции получаемых из хелпа
public class RawCompilerOptionsSet extends DataSet<String, CompilerOption> {
public RawCompilerOptionsSet() {
super(String.class, CompilerOption.class);
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new CompilerOptionsForm(this, mountPanel);
}
@Override
public String getPluralDescription() {
return "опции компиляции";
}
@Override
public String getSingleDescription() {
return "опция компиляции";
}
public CompilerOption findByJson(OptionJson json) {
for (CompilerOption compilerOption : Data.values()) {
if (json.name.equals(compilerOption.name + compilerOption.parameterSeparator))
return compilerOption;
}
return null;
}
public void Reset() {
for (CompilerOption option : Data.values()) {
option.select(false);
option.parameterValue = "";
}
}
public void Synchronize(OptionsJson json) {
for (OptionJson option_json : json.values) {
// найти опцию по началу
CompilerOption compilerOption = findByJson(option_json);
if (compilerOption != null) {
compilerOption.select(true);
compilerOption.parameterValue = option_json.value;
}
}
}
}

View File

@@ -16,7 +16,7 @@ public class CompilerOptionsForm extends DataSetControlForm<CompilerOption> {
new ColumnInfo<CompilerOption>("Параметр") {
@Override
public Object getFieldAt(CompilerOption object) {
return object.parameterName + object.parameterSeparator;
return object.parameterName;
}
@Override
public Class getRendererClass() {

View File

@@ -0,0 +1,139 @@
package _VisualDVM.GlobalData.CompilerOption.UI;
import Common.Passes.Pass;
import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.GlobalData.CompilerOption.OptionsLine;
import _VisualDVM.GlobalData.CompilerOption.OptionsLinesSet;
import _VisualDVM.Passes.PassCode;
import javax.swing.*;
public class OptionsLinesForm extends DataSetControlForm<OptionsLine> {
public OptionsLinesForm(OptionsLinesSet dataSource_in, JPanel mountPanel_in) {
super(dataSource_in, mountPanel_in);
}
@Override
protected void createColumns() {
AddColumns(new ColumnInfo<OptionsLine>("") {
@Override
public Object getFieldAt(OptionsLine object) {
return object.json.toLine();
}
});
}
@Override
protected boolean hasCheckBox() {
return false;
}
@Override
protected boolean isPKVisible() {
return false;
}
@Override
protected DataMenuBar createMenuBar() {
DataMenuBar res = super.createMenuBar();
res.addPasses(
new Pass<OptionsLine>() {
@Override
public String getIconPath() {
return "/Common/icons/RedAdd.png";
}
@Override
public String getDescription() {
return "Добавление набора опций компиляции";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent())) {
target = new OptionsLine((OptionsJson) pass.target);
target.id = ((OptionsLinesSet) dataSource).maxId++;
return true;
}
return false;
}
@Override
protected void body() throws Exception {
dataSource.put(target.getPK(), target);
}
@Override
protected void showDone() throws Exception {
dataSource.ShowUI(target.getPK());
}
},
new Pass<OptionsLine>() {
@Override
public String getIconPath() {
return "/Common/icons/Edit.png";
}
@Override
public String getDescription() {
return "Редактирование набора опций компиляции";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (dataSource.getUI().CheckCurrent(Log)) {
target = dataSource.getUI().getCurrent();
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
if (pass.Do(Global.mainModule.getDb().compilers.getUI().getCurrent(), target.json)) {
return true;
}
}
return false;
}
@Override
protected void body() throws Exception {
}
@Override
protected void showFinish() throws Exception {
dataSource.ShowUI(target.getPK());
}
},
new Pass<OptionsLine>() {
@Override
public String getIconPath() {
return "/Common/icons/Delete.png";
}
@Override
public String getDescription() {
return "Удаление набора опций компиляции";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (dataSource.getUI().CheckCurrent(Log)) {
target = dataSource.getUI().getCurrent();
return dataSource.getUI().ShowDeleteObjectDialog(target);
}
return false;
}
@Override
protected void showPreparation() throws Exception {
dataSource.ClearUI();
}
@Override
protected void body() throws Exception {
dataSource.Data.remove(target.getPK());
}
@Override
protected void showFinish() throws Exception {
dataSource.ShowUI();
}
}
);
return res;
}
}

View File

@@ -2,7 +2,6 @@ package _VisualDVM.GlobalData;
import Common.CommonConstants;
import Common.Database.VisualiserDatabase;
import Common.MainModule_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Compiler.CompilersDBTable;
@@ -98,7 +97,6 @@ public class GlobalDatabase extends VisualiserDatabase {
//--
//проверить, есть ли профиль с таким же набором настроек.
public SapforProfile checkProfileForCurrentSettings() {
LinkedHashMap<String, String> current_values = Global.mainModule.getProject().sapforProperties.toMap();
for (SapforProfile profile : sapforProfiles.Data.values()) {
//--получить все настройки профиля
@@ -152,9 +150,9 @@ public class GlobalDatabase extends VisualiserDatabase {
Insert(profile);
insertProfileSettings(profile);
}
public SapforProfile getDefaultSapforProfile(){
for (SapforProfile sapforProfile: sapforProfiles.Data.values()){
if (sapforProfile.isAuto!=0)
public SapforProfile getDefaultSapforProfile() {
for (SapforProfile sapforProfile : sapforProfiles.Data.values()) {
if (sapforProfile.isAuto != 0)
return sapforProfile;
}
return null;

View File

@@ -8,8 +8,12 @@ public class MachineDialog extends DBObjectDialog<Machine, MachineFields> {
super(MachineFields.class);
}
@Override
public int getDefaultWidth() {
return 600;
}
@Override
public int getDefaultHeight() {
return 250;
return 350;
}
@Override
public void validateFields() {

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.GlobalData.Machine.UI.MachineFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="9" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
@@ -10,7 +10,7 @@
<children>
<component id="1bb3c" class="javax.swing.JTextField" binding="tfName" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -18,12 +18,12 @@
</component>
<vspacer id="aac20">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="44036" class="javax.swing.JTextField" binding="tfAddress" custom-create="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -31,13 +31,21 @@
</component>
<component id="a00bb" class="javax.swing.JSpinner" binding="sPort">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="100" height="30"/>
<maximum-size width="100" height="30"/>
</grid>
</constraints>
<properties/>
</component>
<component id="7aab4" class="javax.swing.JComboBox" binding="cbMachineType" custom-create="true">
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<toolTipText value="выберите тип машины"/>
</properties>
</component>
<component id="ee3e1" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
@@ -49,7 +57,7 @@
</component>
<component id="22dab" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
@@ -58,7 +66,7 @@
</component>
<component id="2dde3" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
@@ -67,21 +75,13 @@
</component>
<component id="9d873" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="тип"/>
</properties>
</component>
<component id="7aab4" class="javax.swing.JComboBox" binding="cbMachineType" custom-create="true">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<toolTipText value="выберите тип машины"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -1,6 +1,6 @@
package _VisualDVM.GlobalData.Makefile.UI;
import Common.Visual.Editor.Viewer;
import Common.Visual.Windows.Dialog.Text.TextDialog;
import _VisualDVM.Visual.Editor.Viewer;
public class MakefilePreviewForm extends TextDialog<Viewer> {
public MakefilePreviewForm() {
super(Viewer.class);

View File

@@ -6,6 +6,7 @@ import Common.Visual.UI;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.CompilerOption.Json.OptionsJson;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Makefile.Makefile;
import _VisualDVM.GlobalData.Module.Module;
@@ -39,9 +40,9 @@ public class ModuleAnchestorFields implements DialogFields {
BPickOptions.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Pass<String> pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
if (pass.Do(compiler)) {
UI.TrySelect(cbFlags, pass.target);
UI.TrySelect(cbFlags, ((OptionsJson) pass.target).toLine());
}
}
});

View File

@@ -14,10 +14,12 @@ public enum TaskState implements StatusEnum {
//-----------------------
Finished,
//--- результирующие
Crushed,
NaN,
DoneWithErrors,
DoneWithDiffs,
AbortedByTimeout,
AbortedByUser,
Crushed,
WrongTestFormat,
InternalError,
Done,
@@ -38,6 +40,8 @@ public enum TaskState implements StatusEnum {
case WrongTestFormat:
case InternalError:
case Crushed:
case DoneWithDiffs:
case NaN:
return true;
default:
return false;
@@ -45,6 +49,8 @@ public enum TaskState implements StatusEnum {
}
public String getDescription() {
switch (this) {
case NaN:
return "NaN";
case Waiting:
return "ожидание";
case WorkspaceCreated:
@@ -63,6 +69,8 @@ public enum TaskState implements StatusEnum {
return "прервана";
case Done:
return "успешно";
case DoneWithDiffs:
return "различия";
case DoneWithErrors:
return "с ошибками";
case Crushed:
@@ -99,6 +107,8 @@ public enum TaskState implements StatusEnum {
case WrongTestFormat:
case InternalError:
case Canceled:
case DoneWithDiffs:
case NaN:
return VisualiserFonts.BadState;
case Queued:
case Running:
@@ -136,6 +146,7 @@ public enum TaskState implements StatusEnum {
public boolean isComplete() {
switch (this) {
case Done:
case DoneWithDiffs:
case DoneWithErrors:
case AbortedByTimeout:
case AbortedByUser:
@@ -143,6 +154,7 @@ public enum TaskState implements StatusEnum {
case Crushed:
case InternalError:
case Canceled:
case NaN:
return true;
default:
return false;

View File

@@ -36,7 +36,11 @@ public class UserDialog extends DBObjectDialog<User, UserFields> {
Result.password = new String(fields.tfPassword.getPassword());
}
@Override
public int getDefaultWidth() {
return 600;
}
@Override
public int getDefaultHeight() {
return 250;
return 400;
}
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.GlobalData.User.UI.UserFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="7" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
@@ -10,7 +10,7 @@
<children>
<component id="374e0" class="javax.swing.JTextField" binding="tfLogin" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -18,21 +18,12 @@
</component>
<vspacer id="9bcf9">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="33ebe" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="логин"/>
</properties>
</component>
<tabbedpane id="936e5" binding="AuthenticationTabs">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<minimum-size width="-1" height="80"/>
<preferred-size width="200" height="80"/>
<maximum-size width="-1" height="80"/>
@@ -75,15 +66,36 @@
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
<properties>
<editable value="true"/>
</properties>
</component>
</children>
</grid>
</children>
</tabbedpane>
<component id="e064b" class="javax.swing.JTextField" binding="tfWorkspace" custom-create="true">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="33ebe" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="логин"/>
</properties>
</component>
<component id="be99c" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="2" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
@@ -92,23 +104,13 @@
<verticalTextPosition value="0"/>
</properties>
</component>
<component id="e064b" class="javax.swing.JTextField" binding="tfWorkspace" custom-create="true">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="7bee1" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="папка"/>
<text value="раб.пространство"/>
<toolTipText value="рабочая папка визуализатора"/>
</properties>
</component>

View File

@@ -16,6 +16,8 @@ public class UserFields implements DialogFields {
public JPanel PasswordTab;
public JPasswordField tfPassword;
public JTextField tfWorkspace;
public JTextField tfRoot;
public JButton bBrowse;
char mask;
char unmask = (char) 0;
boolean password_visible = false;
@@ -30,6 +32,22 @@ public class UserFields implements DialogFields {
bPasswordVisibility.setIcon(Utils_.getIcon("/icons/" + (password_visible ? "Show" : "Hide") + "Password.png"));
}
});
/*
bBrowse.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String dst;
if (Global.mainModule.getPass(PassCode.SelectRemoteFile).Do(true)) {
String root= Global.mainModule.getRemoteFile().full_name;
tfRoot.setText(root);
if (!tfWorkspace.getText().isEmpty()){
RemoteFile workspace=new RemoteFile(tfWorkspace.getText(), true);
tfWorkspace.setText(root+"/"+workspace.name);
}
}
}
});
*/
}
@Override
public Component getContent() {

View File

@@ -28,10 +28,12 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
PassCode.ShutdownComponentsServer,
PassCode.StartComponentsServer,
PassCode.PublishComponentsServer,
PassCode.ComponentsServerBackUp,
//
PassCode.ShutdownTestingServer,
PassCode.StartTestingServer,
PassCode.PublishTestingServer,
PassCode.TestingServerBackUp,
PassCode.CreateTestsGroupFromSelectedVersions,
PassCode.RefreshDVMPackageResults,
PassCode.ConvertCorrectnessTests
@@ -146,6 +148,9 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
for (PassCode code : accountRoleDependentPasses)
getPass(code).setControlsVisible(false);
}
public void SetStudentPassesAccess() {
SetUserPassesAccess();
}
public void SetDeveloperPassesAccess() {
SetUserPassesAccess();
getPass(PassCode.CreateTestsGroupFromSelectedVersions).setControlsVisible(true);

View File

@@ -1,7 +1,6 @@
package _VisualDVM;
import Common.CommonConstants;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.Passes.PassCode;
import com.google.gson.annotations.Expose;
@@ -14,9 +13,9 @@ public class NormalProperties extends VisualDVMProperties {
@Expose
public String Name = "";
@Expose
public String ServerUserPassword="";
public String ServerUserPassword = "";
@Expose
public boolean OfferRegistrationOnStart=true;
public boolean OfferRegistrationOnStart = true;
//--->
@Expose
public String Workspace = ""; // место хранения проектов, и загруженных проектов
@@ -66,13 +65,21 @@ public class NormalProperties extends VisualDVMProperties {
public int Kernels = Utils.getHalfKernels();
@Expose
public String LocalMakePathWindows = "C:\\MinGW\\msys\\1.0\\bin\\make.exe";
//--
//--тестирование
@Expose
public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования
@Expose
public boolean AutoCheckTesting = false; // проверять ли задачи тестирования при включенном визуализаторе.
@Expose
public boolean EmailOnTestingProgress = false; //включено ли оповещение по email о результатах тестирования.
@Expose
public boolean CompleteCompilationOptions = true;
@Expose
public boolean CompleteRunEnvironments = true;
@Expose
public boolean CreateEthalonTasks = true;
@Expose
public boolean ErasePackageWorkspace = true;
//--
@Expose
public int lastMachineId = CommonConstants.Nan;
@@ -116,6 +123,14 @@ public class NormalProperties extends VisualDVMProperties {
@Override
public String getFieldDescription(String fieldName) {
switch (fieldName) {
case "ErasePackageWorkspace":
return "Очистка рабочего пространства пакета на целевой машине";
case "CompleteCompilationOptions":
return "Дополнение опций компиляции";
case "CompleteRunEnvironments":
return "Дополнение переменных окружения запуска";
case "CreateEthalonTasks":
return "Создание эталонных последовательных запусков";
case "OfferRegistrationOnStart":
return "Проверка регистрации";
case "Email":
@@ -176,7 +191,7 @@ public class NormalProperties extends VisualDVMProperties {
public boolean controlAction(String fieldName, JMenuItem control) {
return (Global.mainModule.getPass(PassCode.UpdateProperty).Do(fieldName));
}
public void SynchronizeAccount(UserAccount account){
public void SynchronizeAccount(UserAccount account) {
Name = account.name;
Email = account.email;
Update();

View File

@@ -6,8 +6,8 @@ import Common.Visual.UI;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
import _VisualDVM.ComponentsServer.BugReport.BugReportState;
import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.Global;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import java.io.File;
@@ -45,7 +45,6 @@ public class AddBugReport extends AddObjectPass<BugReport> {
target.project_version = "";
target.visualiser_version = Global.visualiser.version;
target.sapfor_version = Global.components.get(ComponentType.Sapfor_F).version;
target.packedSettingsJson = "";
target.percentage = 0;
target.description = "Черновик отчёта об ошибке.\nЗаполните описание ошибочной ситуации, и нажмите 'Опубликовать'";
target.date = new Date().getTime();

View File

@@ -13,6 +13,6 @@ public class AppendBugReportComment extends AppendBugReportField {
}
@Override
protected boolean canUpdate() {
return target.canAppend(Global.mainModule.getAccount(),Log);
return target.canAppend(Global.mainModule.getAccount(), Log);
}
}

View File

@@ -31,6 +31,6 @@ public class ApplyBugReportSettings extends Pass<BugReport> {
}
@Override
protected void body() throws Exception {
Global.mainModule.getProject().sapforProperties.applyPatch(target.getSettingsJson());
Global.mainModule.getProject().sapforProperties.applyBugReportSettings(target);
}
}

Some files were not shown because too many files have changed in this diff Show More