Compare commits

...

268 Commits

Author SHA1 Message Date
c7a2e80f1e no message 2025-06-16 13:32:40 +03:00
83d48d4db1 подстановка инклудов — передача параметров 2025-06-13 14:45:18 +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
ALEXks
242719e7a7 improved planner 2025-03-03 18:16:46 +03:00
4da5f4bc03 v++ 2025-03-03 17:11:13 +03:00
cba10bef14 Merge branch 'main' of http://alex-freenas.ddns.net:3000/M/VisualSapfor 2025-03-03 16:49:44 +03:00
7728ddbf23 небольшой баг. у незарегистрированного пользователя могли проверяться пакеты. 2025-03-03 16:21:32 +03:00
d455c21b9c no message 2025-03-03 16:09:58 +03:00
ALEXks
b8751d9b67 version updated 2025-03-03 15:04:58 +03:00
ALEXks
74f4be7027 rollback 2025-03-03 15:04:31 +03:00
eb7c0ffbc5 v++ 2025-03-03 13:40:24 +03:00
b4808bcd7c no message 2025-03-03 13:39:32 +03:00
ALEXks
90b45fc806 improved planner 2025-03-03 13:38:26 +03:00
ALEXks
9b02a5c9ea improved planner 2025-03-03 13:36:20 +03:00
e98127880b символические ссылки при копировании экземпляров визуализатора на сервере ( для нитей и пакетов сапфора)
v++
2025-03-02 18:32:45 +03:00
1ee8256885 просмотр текста ячеек по пкм.
v++
2025-03-02 15:19:37 +03:00
c9a013a17b расширенный просмотр содержимого ячейки таблицы по ПКМ 2025-03-02 14:26:16 +03:00
6413f2340a уменьшил шрифт в столбцах со временем 2025-03-02 13:43:59 +03:00
3c9bc3f9b7 v++
время выполнения пакетов
2025-02-28 23:31:53 +03:00
d019beff5f реализовал сохранение пути при экспорте в эксель, и при сохранении изображения графа функций. 2025-02-28 22:54:37 +03:00
4441864b6f v++
убирание недоступных пользователю вкладок, и настроек
2025-02-28 21:48:51 +03:00
33f3d615da сокрытие настроек от пользователей если недостаточно прав. например синхронизация тестирования не видима ролям ниже разрабов 2025-02-28 19:12:32 +03:00
61d8670416 рефактиринг интерфейса при отображении полномочий роли пользователя. ввод настройки отменяющей приглашение регистрации при запуске приложения. 2025-02-28 17:46:57 +03:00
c551fdd2c9 опечатка в имени функции 2025-02-28 16:18:37 +03:00
d7ea2f862e Закрытие уязвимости с именами тестов
v++
2025-02-25 14:17:23 +03:00
d81abc226c исправление бага с инициализацией нового пользователя.
v++
2025-02-23 15:11:05 +03:00
2f4f841dcc v++
Авторство тестов из репозитория серверу и серверной почте. На будущее введем акк сервер
2025-02-22 16:48:19 +03:00
c83cfd9eff fix
Устранены пропущенные уязвимости в некоторых проходах
v++
2025-02-22 16:10:21 +03:00
f7973e0991 промежуточный. нашел еще несколько уязвимостей в редактировнии чужих объектов. 2025-02-22 15:18:22 +03:00
8701c8ba36 Завершение обновления безопасности.
v++
2025-02-21 01:57:15 +03:00
49f0a56c4f путь к двм для конвертации в настройки сервера 2025-02-20 15:21:41 +03:00
ed61eb2ae0 v++ 2025-02-20 14:13:13 +03:00
25fc55c03e no message 2025-02-20 13:51:27 +03:00
a8244bf872 v++
Авторизация по ключам
2025-02-20 13:47:50 +03:00
daa53d9d73 no message 2025-02-20 01:02:44 +03:00
b445e3e879 сохранение адресатов и исполнителя.восстановление 2025-02-20 00:49:30 +03:00
f1440dd1e2 no message 2025-02-20 00:39:59 +03:00
4e3597ba7a промежуточный. загрузка адресатов для багов без наличия их в бд. 2025-02-19 22:47:56 +03:00
7a9c70f396 удаление учетной записи с сервера 2025-02-19 14:34:42 +03:00
8215388bc6 Добавление учетных записей администратором 2025-02-19 02:05:07 +03:00
39595d849e fix 2025-02-19 01:16:47 +03:00
024f274360 ключ теперь не поле бд а отдельный файл на сервере. 2025-02-19 01:10:25 +03:00
7eba13370d промежуточный. проход редактирования учетной записи админом 2025-02-19 00:41:55 +03:00
5046d84b86 no message 2025-02-18 23:45:24 +03:00
073bbfd544 промежуточный.заложил вкладку для админа 2025-02-18 21:52:25 +03:00
1b4b375f39 упразднение старого объекта аккаунта 2025-02-18 20:14:14 +03:00
794097f81f no message 2025-02-18 19:11:29 +03:00
9d11ebb653 промежуточный. проверка пользователя по ключу 2025-02-18 18:13:50 +03:00
0a123988b3 рефакторинг 2025-02-18 16:21:20 +03:00
9c0ed53d52 fix столбы конфигурация сапфор
v++
2025-02-16 22:37:26 +03:00
77179789f5 v++ 2025-02-15 23:30:48 +03:00
68bd1ef6b4 fix
отключение проверки версии при регистрации
v++
2025-02-14 13:32:38 +03:00
c76908ad58 no message 2025-02-14 03:16:43 +03:00
209bb2455d no message 2025-02-14 02:17:56 +03:00
a86a5b1e6b промежуточный.безопасность на стороне сервера. Утром доделаю на стороне клиента 2025-02-14 02:09:55 +03:00
05b49a842e no message 2025-02-14 01:24:49 +03:00
6d9bd4bc9b no message 2025-02-14 01:22:50 +03:00
245ed7c5f0 включение цепочки преобразований в описание теста при его импорте из пакета сапфор
v++
2025-02-14 00:13:00 +03:00
f2b2acb49f v++
Исправлен таймаут на скачивание пакетов.Разрешено добавлять в группу завершенный с ошибками пакет( только успешные задачи)
2025-02-13 23:07:18 +03:00
36438e5b20 рефакторинг кода тестового сервера 2025-02-13 22:43:04 +03:00
5e6719412d рефакторинг кода сервера компонент 2025-02-13 22:25:54 +03:00
0bdc870a72 удаление устаревших кодов для сервера 2025-02-13 20:45:51 +03:00
54ec1fee99 промежуточный. рефакторинг объекта сервера. 2025-02-13 20:27:01 +03:00
91f4ed4a17 fix умножения сапфоровских задач
v++
2025-02-13 18:40:53 +03:00
dd1f7f8040 Рефакторинг проходов запуска, остановки,публикации серверов
v++
2025-02-13 16:20:48 +03:00
016e51dbe5 v++
Массовое определение размерности тестов
2025-02-13 01:43:23 +03:00
90b6f3648e fix 2025-02-12 23:24:54 +03:00
57baa6c9c1 v++ 2025-02-12 23:02:46 +03:00
74fcc2150d внутренний проход на обновление результатов анализа пакетов двм системы. пока только по заявкам, в обычной версии никому его не видно. Возможно и не понадобится больше. 2025-02-12 22:49:20 +03:00
b80bea4c1b no message 2025-02-12 14:22:11 +03:00
ede6438fbf v++
fix
2025-02-11 23:32:28 +03:00
62de67ccb7 fix 2025-02-11 23:08:27 +03:00
c69e7194bc промежуточный. определение размерности тестов на сервере через консоль. но есть баг. почему то один и тот же пакет повторно нельзя сконвертировать в тесты. 2025-02-11 23:03:18 +03:00
25eabf6852 промежуточный. на стороне сервера реализовано создание тестов на основе версий. 2025-02-11 21:28:35 +03:00
4ef8d4b52c v++ 2025-02-10 22:49:30 +03:00
0049409cdf Отображение текущей задачи тестирования ДВМ 2025-02-10 22:38:42 +03:00
7eecdf8f4d убрал возможность задавать тип машины как кластера 2025-02-10 16:14:48 +03:00
bc750f8db0 в массовых фильтрах по умолчанию убрал галки. чтобы посмотреть раздел нужен лишний клик это не очень удобно 2025-02-08 21:46:16 +03:00
75abb0ae46 удаление распакованных результатов после анализа 2025-02-08 21:28:25 +03:00
a27ab3acef исправление бага с неуведомлением о запуске пакета двм 2025-02-08 20:48:16 +03:00
950b47d145 фильтр задач двм по языку 2025-02-08 20:21:24 +03:00
2eca19cad4 Добавление фильтров по имени в - группы, тесты, параметры, конфигурации, задачи двм системы 2025-02-08 20:06:43 +03:00
b8f1ad56ed убирание портов в константы внутри кода 2025-02-08 19:19:26 +03:00
7dd3069445 v++ 2025-02-06 22:54:06 +03:00
407294c6ae показ имени машины 2025-02-06 21:39:19 +03:00
0c2b716368 символьные ссылки в планировщике 2025-02-06 21:23:55 +03:00
bd2e8643fd защита групп и тестов от редактирования не-авторами 2025-02-06 21:10:58 +03:00
dcdd392e95 укорачивание поля выбора порта 2025-02-06 20:56:22 +03:00
fa31d5570c дополнение безопасности. не везде был сделан режим чтения 2025-02-06 20:44:51 +03:00
16c307103f запрет на удаление чужих объектов тестирования 2025-02-06 19:44:59 +03:00
467c9b5b31 no message 2025-02-06 19:20:15 +03:00
305b607c24 запрет с правами ниже разработчика во владку тестирования 2025-02-06 18:45:30 +03:00
20e82075b7 исправление безопасности. промежуточный. 2025-02-06 18:31:18 +03:00
6e0e51beff пауза тестирования. перенос фильтров влево. v++ 2025-02-06 17:26:14 +03:00
63b923e33b отключение проверок на сбой связи 2025-02-06 14:07:46 +03:00
775526b5e3 пустой файл вывода как признак падения (авост) теста двм 2025-02-06 14:04:08 +03:00
82fbe8a751 флаг 2025-02-05 20:07:14 +03:00
19bcc13048 ++ версии планировщика 2025-02-05 19:53:21 +03:00
ALEXks
d5aabbace7 Merge branch 'main' of http://alex-freenas.ddns.net:3000/M/VisualSapfor into main 2025-02-05 19:50:33 +03:00
ALEXks
fa12c4b672 fixed 2025-02-05 19:50:28 +03:00
581 changed files with 14098 additions and 6366 deletions

2
.gitignore vendored
View File

@@ -49,4 +49,6 @@ Makefiles/*
Repo/* Repo/*
Sts/* Sts/*
Tests/* Tests/*
Keys/*
debug.log debug.log
properties

View File

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

9
.idea/libraries/commons_lang_2_6_0.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="commons-lang-2.6.0">
<CLASSES>
<root url="jar://$PROJECT_DIR$/libs/commons-lang-2.6.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

26
.idea/workspace.xml generated
View File

@@ -7,7 +7,8 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -46,9 +47,9 @@
</file-type-list> </file-type-list>
</component> </component>
<component name="HighlightingSettingsPerFile"> <component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/ConvertCorrectnessTests.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishGroup.java" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishGroup.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishTest.java" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishTest.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/ConvertCorrectnessTests.java" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" root0="FORCE_HIGHLIGHTING" /> <setting file="file://$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" root0="FORCE_HIGHLIGHTING" />
</component> </component>
<component name="KotlinCodeInsightWorkspaceSettings"> <component name="KotlinCodeInsightWorkspaceSettings">
@@ -58,7 +59,7 @@
<option name="stateVersion" value="1" /> <option name="stateVersion" value="1" />
</component> </component>
<component name="ProblemsViewState"> <component name="ProblemsViewState">
<option name="selectedTabId" value="ProjectErrors" /> <option name="selectedTabId" value="CurrentFile" />
</component> </component>
<component name="ProjectId" id="1UqWSAGBQQNofrCLxSPPtOZrGP7" /> <component name="ProjectId" id="1UqWSAGBQQNofrCLxSPPtOZrGP7" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true"> <component name="ProjectLevelVcsManager" settingsEditedManually="true">
@@ -77,6 +78,7 @@
<property name="JavaClassFindUsagesOptions.isDerivedClasses" value="true" /> <property name="JavaClassFindUsagesOptions.isDerivedClasses" value="true" />
<property name="JavaClassFindUsagesOptions.isFieldsUsages" value="true" /> <property name="JavaClassFindUsagesOptions.isFieldsUsages" value="true" />
<property name="JavaClassFindUsagesOptions.isMethodsUsages" value="true" /> <property name="JavaClassFindUsagesOptions.isMethodsUsages" value="true" />
<property name="OverrideImplement.combined" value="false" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" /> <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" /> <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
@@ -86,10 +88,10 @@
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.SHOW" value="true" /> <property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.SHOW" value="true" />
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" /> <property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" />
<property name="extract.method.default.visibility" value="public" /> <property name="extract.method.default.visibility" value="public" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/icons/Transformations" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/src" />
<property name="project.structure.last.edited" value="Modules" /> <property name="project.structure.last.edited" value="Artifacts" />
<property name="project.structure.proportion" value="0.15" /> <property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.27322906" />
<property name="run.code.analysis.last.selected.profile" value="pProject Default" /> <property name="run.code.analysis.last.selected.profile" value="pProject Default" />
<property name="settings.editor.selected.configurable" value="reference.settings.project.statistic.project.settings" /> <property name="settings.editor.selected.configurable" value="reference.settings.project.statistic.project.settings" />
</component> </component>
@@ -99,18 +101,18 @@
<recent name="controls.Trees" /> <recent name="controls.Trees" />
</key> </key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_dif_utils" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\libs" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\Transformations" /> <recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\Transformations" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\Common\icons" /> <recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\DVM\DVMTasks\UI" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\files" />
</key> </key>
<key name="MoveMembersDialog.RECENTS_KEY"> <key name="MoveMembersDialog.RECENTS_KEY">
<recent name="_VisualDVM.ComponentsServer.Component.Sapfor.Sapfor" />
<recent name="_VisualDVM.Constants" />
<recent name="_VisualDVM.Global" /> <recent name="_VisualDVM.Global" />
<recent name="_VisualDVM.ProjectData.SapforData.Arrays.UI.ProjectArraysForm" /> <recent name="_VisualDVM.ProjectData.SapforData.Arrays.UI.ProjectArraysForm" />
<recent name="_VisualDVM.TestingSystem.SAPFOR.SapforPackage.UI.SapforPackagesForm" /> <recent name="_VisualDVM.TestingSystem.SAPFOR.SapforPackage.UI.SapforPackagesForm" />
<recent name="_VisualDVM.TestingSystem.DVM.DVMPackage.UI.DVMPackagesForm" />
<recent name="_VisualDVM.TestingSystem.Common.Group.UI.GroupsForm" />
</key> </key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\SAPFOR\SapforSettingsCommand\UI" /> <recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\SAPFOR\SapforSettingsCommand\UI" />

View File

@@ -94,5 +94,6 @@
<SOURCES /> <SOURCES />
</library> </library>
</orderEntry> </orderEntry>
<orderEntry type="library" name="commons-lang-2.6.0" level="project" />
</component> </component>
</module> </module>

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

View File

@@ -1,18 +1,22 @@
{ {
"Email": "vmk-post@yandex.ru",
"Name": "M",
"ServerUserPassword": "mprit_2011",
"OfferRegistrationOnStart": true,
"Workspace": "E:\\Tests", "Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "E:\\Tests\\Downloads", "ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1701089001",
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads", "VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F", "Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
"Visualizer_2Path": "C:\\Users\\misha\\Documents", "Visualizer_2Path": "C:\\Users\\misha\\Documents",
"InstructionPath": "C:\\Users\\misha\\Documents", "InstructionPath": "C:\\Users\\misha\\Documents",
"PerformanceAnalyzerPath": "C:\\Users\\misha\\Documents", "PerformanceAnalyzerPath": "C:\\Users\\misha\\Documents",
"AutoUpdateSearch": true,
"AutoBugReportsLoad": true, "AutoBugReportsLoad": true,
"AutoTestsLoad": true, "AutoTestsLoad": true,
"ConfirmPassesStart": true, "ConfirmPassesStart": true,
"ShowPassesDone": true, "ShowPassesDone": true,
"FocusPassesResult": true, "FocusPassesResult": false,
"collapseCredentials": false, "collapseCredentials": true,
"collapseFileGraphs": false, "collapseFileGraphs": false,
"collapseFileMessages": false, "collapseFileMessages": false,
"collapseProjectTrees": false, "collapseProjectTrees": false,
@@ -24,23 +28,24 @@
"CheckTestingIntervalSeconds": 10, "CheckTestingIntervalSeconds": 10,
"AutoCheckTesting": true, "AutoCheckTesting": true,
"EmailOnTestingProgress": true, "EmailOnTestingProgress": true,
"CompleteCompilationOptions": true,
"CompleteRunEnvironments": true,
"CreateEthalonTasks": true,
"ErasePackageWorkspace": true,
"lastMachineId": 13, "lastMachineId": 13,
"lastUserId": 24, "lastUserId": 34,
"lastCompilerId": 52, "lastCompilerId": 52,
"RegisterOn": false, "RegisterOn": false,
"SpacesOn": false, "SpacesOn": false,
"EmptyLinesOn": false, "EmptyLinesOn": false,
"FortranWrapsOn": false, "FortranWrapsOn": false,
"ExtensionsOn": false, "ExtensionsOn": false,
"ComparsionDiffMergeOn": false, "ComparsionDiffMergeOn": true,
"ShowFullArraysDeclarations": false, "ShowFullArraysDeclarations": true,
"ShowFullTabsNames": true, "ShowFullTabsNames": true,
"SmallScreen": false, "SmallScreen": false,
"BugReportsAgeLimit": 1, "BugReportsAgeLimit": 1,
"FastAccessPassesCount": 10, "FastAccessPassesCount": 10,
"LastOpenedProjectsCount": 25, "LastOpenedProjectsCount": 25,
"Mode": "Normal", "Mode": "Normal"
"ComponentsServerPort": 7995,
"TestingServerPort": 7998,
"SocketTimeout": 5000
} }

View File

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

View File

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

View File

@@ -1,8 +1,10 @@
package Common.Database.Objects; package Common.Database.Objects;
public class riDBObject extends iDBObject { public class riDBObject extends iDBObject {
//- //-
//todo int useraccount_id по объекту аккаунтов. сюда и права. и проверку их.
public String sender_name = ""; public String sender_name = "";
public String sender_address = ""; public String sender_address = "";
//---
public String description = ""; public String description = "";
//- //-
@Override @Override

View File

@@ -4,9 +4,9 @@ import Common.Database.Objects.DBObject;
import Common.Database.Tables.DBTable; import Common.Database.Tables.DBTable;
import Common.Database.Tables.DBTableColumn; import Common.Database.Tables.DBTableColumn;
import Common.Passes.PassException; import Common.Passes.PassException;
import Common.Utils.Pair;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import Common.Visual.UI; import Common.Visual.UI;
import javafx.util.Pair;
import java.io.File; import java.io.File;
import java.sql.*; import java.sql.*;

View File

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

View File

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

View File

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

View File

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

View File

@@ -11,6 +11,11 @@ import java.util.LinkedHashMap;
public class Properties { public class Properties {
protected LinkedHashMap<String, JMenuItem> controls = new LinkedHashMap<>(); protected LinkedHashMap<String, JMenuItem> controls = new LinkedHashMap<>();
private File file = null; //файл где хранятся настройки. private File file = null; //файл где хранятся настройки.
public Properties() {
}
public Properties(File file_in) {
setFile(file_in);
}
public File getFile() { public File getFile() {
return file; return file;
} }
@@ -24,11 +29,6 @@ public class Properties {
e.printStackTrace(); e.printStackTrace();
} }
} }
public Properties() {
}
public Properties(File file_in) {
setFile(file_in);
}
public boolean updateField(String name, Object newValue) { public boolean updateField(String name, Object newValue) {
try { try {
Field field = getClass().getField(name); Field field = getClass().getField(name);
@@ -50,7 +50,7 @@ public class Properties {
return "?"; return "?";
} }
public boolean controlAction(String fieldName, JMenuItem control public boolean controlAction(String fieldName, JMenuItem control
){ ) {
return false; return false;
} }
public JMenuItem getMenuItem(String fieldName) { public JMenuItem getMenuItem(String fieldName) {
@@ -86,4 +86,9 @@ public class Properties {
ex.printStackTrace(); ex.printStackTrace();
} }
} }
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,5 +1,6 @@
package Common.Utils; package Common.Utils;
import Common.Visual.UI; import Common.Visual.UI;
import Common.Visual.Windows.ReadOnlyMultilineTextForm;
import java.io.File; import java.io.File;
import java.io.FileWriter; import java.io.FileWriter;
@@ -34,8 +35,10 @@ public interface Loggable {
ex.printStackTrace(writer); ex.printStackTrace(writer);
writer.flush(); writer.flush();
Print(out.toString()); Print(out.toString());
if (UI.isActive()) if (UI.isActive()) {
UI.Error("Возникло исключение. Подробности в файле журнала\n" + Utils_.CopyToClipboard(out.toString());
Utils_.Brackets(getLogFile().getAbsolutePath())); 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

@@ -488,6 +488,16 @@ public class Utils_ {
//-- //--
return hours + " часов, " + minutes + " минут, " + seconds + " секунд"; return hours + " часов, " + minutes + " минут, " + seconds + " секунд";
} }
public static String printSplittedDateIntervalShort(long milliseconds) {
//--
long seconds = milliseconds / 1000;
long hours = seconds / 3600;
seconds = seconds - hours * 3600;
long minutes = (seconds) / 60;
seconds = seconds - minutes * 60;
//--
return hours + ":" + minutes + ":" + seconds;
}
//Синхронизация //Синхронизация
public static void sleep(long millis) { public static void sleep(long millis) {
try { try {

View File

@@ -16,7 +16,7 @@ public class PassButton extends MenuBarButton implements PassControl {
setIcon(pass.getIconPath()); setIcon(pass.getIconPath());
} }
addActionListener(pass.getControlAction()); addActionListener(pass.getControlAction());
pass.controls.add(this); pass.addControl(this);
} }
public PassButton(Pass pass) { public PassButton(Pass pass) {
this(pass, false); this(pass, false);

View File

@@ -8,7 +8,7 @@ public class PassMenuItem extends VisualiserMenuItem implements PassControl {
setToolTipText(pass.getDescription()); setToolTipText(pass.getDescription());
if (pass.getIconPath() != null) setIcon(pass.getIconPath()); if (pass.getIconPath() != null) setIcon(pass.getIconPath());
addActionListener(pass.getControlAction()); addActionListener(pass.getControlAction());
pass.controls.add(this); pass.addControl(this);
} }
@Override @Override
public void setIcon(String icon_path) { public void setIcon(String icon_path) {

View File

@@ -7,7 +7,7 @@ public class StablePassMenuItem extends StableMenuItem implements PassControl {
setToolTipText(pass.getDescription()); setToolTipText(pass.getDescription());
if (pass.getIconPath() != null) setIcon(pass.getIconPath()); if (pass.getIconPath() != null) setIcon(pass.getIconPath());
addActionListener(pass.getControlAction()); addActionListener(pass.getControlAction());
pass.controls.add(this); pass.addControl(this);
} }
@Override @Override
public void setIcon(String icon_path) { public void setIcon(String icon_path) {

View File

@@ -40,7 +40,6 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
//-- //--
Object savedCurrentKey = null; Object savedCurrentKey = null;
Vector<Object> savedSelectedKeys = new Vector<>(); Vector<Object> savedSelectedKeys = new Vector<>();
//--
public DataSetControlForm(DataSet<?, D> dataSource_in, JPanel mountPanel_in) { public DataSetControlForm(DataSet<?, D> dataSource_in, JPanel mountPanel_in) {
super(DataTable.class, mountPanel_in); super(DataTable.class, mountPanel_in);
dataSource = dataSource_in; dataSource = dataSource_in;
@@ -68,7 +67,7 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
//-- //--
counter_ui = (count -> bar.countLabel.setText(String.valueOf(count))); counter_ui = (count -> bar.countLabel.setText(String.valueOf(count)));
//--фильтры всегда в конец бара. //--фильтры всегда в конец бара.
bar.add(new JSeparator()); // bar.add(new JSeparator());
for (FilterFlag filter : getFilters(FilterFlag.class)) { for (FilterFlag filter : getFilters(FilterFlag.class)) {
bar.add(filter.getControl()); bar.add(filter.getControl());
} }
@@ -81,6 +80,10 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
} }
} }
} }
//--
public DataMenuBar getMenuBar() {
return bar;
}
protected boolean isPKVisible() { protected boolean isPKVisible() {
return true; return true;
} }
@@ -559,6 +562,7 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
} else { } else {
title += "просмотр"; title += "просмотр";
dialog.SetReadonly(); dialog.SetReadonly();
dialog.BlockButtons();
} }
return dialog.ShowDialog(title, object); return dialog.ShowDialog(title, object);
} }
@@ -571,7 +575,17 @@ public abstract class DataSetControlForm<D extends DBObject> extends ControlForm
public PassCode_ getDeletePassCode() { public PassCode_ getDeletePassCode() {
return null; return null;
} }
public Object getCurrentPK(Object nanValue){ public Object getCurrentPK(Object nanValue) {
return current==null? nanValue: current.getPK(); return current == null ? nanValue : current.getPK();
}
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.MainModule_;
import Common.Utils.Pair;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import Common.Visual.Menus.StyledPopupMenu; import Common.Visual.Menus.StyledPopupMenu;
import Common.Visual.Menus.TextEditorMenu; import Common.Visual.Menus.TextEditorMenu;
import Common.Visual.Themes.ThemeElement; import Common.Visual.Themes.ThemeElement;
import Common.Visual.UI; import Common.Visual.UI;
import Common.Visual.Windows.Dialog.DialogFields; import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Utils;
import _VisualDVM.Visual.Syntax.SPFEditorTheme; import _VisualDVM.Visual.Syntax.SPFEditorTheme;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
@@ -15,8 +17,9 @@ import java.awt.*;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.net.URI; import java.net.URI;
import java.util.Vector;
public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogFields { public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogFields {
private final StyledPopupMenu menu; protected final StyledPopupMenu menu;
// protected int changesCount = 0; // protected int changesCount = 0;
// protected int insertsCount = 0; // protected int insertsCount = 0;
// protected int removesCount = 0; // protected int removesCount = 0;
@@ -128,14 +131,6 @@ public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogF
changeFont(getFont().getSize() - 1); changeFont(getFont().getSize() - 1);
} }
@Override @Override
public void applyTheme() {
float font_size = (float) getFont().getSize();
((SPFEditorTheme) MainModule_.instance.getUI().getTheme()).getEditorTheme().apply(this);
setFont(getFont().deriveFont(font_size));
menu.applyTheme();
//меню связано с редактором. поэтому тема меняется только вместе с ним.
}
@Override
public Component getContent() { public Component getContent() {
return this; return this;
} }
@@ -152,4 +147,29 @@ public class BaseEditor extends RSyntaxTextArea implements ThemeElement, DialogF
} }
return res; return res;
} }
//todo как то вывести из коммон.
@Override
public void applyTheme() {
float font_size = (float) getFont().getSize();
((SPFEditorTheme) MainModule_.instance.getUI().getTheme()).getEditorTheme().apply(this);
setFont(getFont().deriveFont(font_size));
menu.applyTheme();
//меню связано с редактором. поэтому тема меняется только вместе с ним.
}
//--
public Vector<Pair<Integer, Integer>> getErrorsForHightlight() {
Vector<Pair<Integer, Integer>> res = new Vector<>();
for (int i = 0; i < this.getLineCount(); ++i) {
try {
int start = getLineStartOffset(i);
int end = getLineEndOffset(i);
String line = this.getText(start, end);
if (Utils.isCrushedLine(line))
res.add(new Pair<>(start, end));
} catch (Exception ex) {
ex.printStackTrace();
}
}
return res;
}
} }

View File

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

View File

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

View File

@@ -3,6 +3,8 @@ import Common.CommonConstants;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import javax.swing.*; import javax.swing.*;
import java.awt.*;
import java.util.Vector;
public class TableMenu extends StyledPopupMenu { public class TableMenu extends StyledPopupMenu {
int row = CommonConstants.Nan; int row = CommonConstants.Nan;
int column = CommonConstants.Nan; int column = CommonConstants.Nan;
@@ -10,12 +12,19 @@ public class TableMenu extends StyledPopupMenu {
//- //-
JTable owner = null; JTable owner = null;
VisualiserMenuItem mcopy; VisualiserMenuItem mcopy;
JTextArea value_view;
JScrollPane value_scroll;
public TableMenu(JTable owner_in) { public TableMenu(JTable owner_in) {
owner = owner_in; owner = owner_in;
mcopy = new VisualiserMenuItem("Копировать текст текущей ячейки", "/icons/Editor/Copy.png"); mcopy = new VisualiserMenuItem("Копировать текст текущей ячейки", "/icons/Editor/Copy.png");
//если удалось нажать значит все условия выполнены //если удалось нажать значит все условия выполнены
mcopy.addActionListener(e -> Utils_.CopyToClipboard(target.toString())); mcopy.addActionListener(e -> Utils_.CopyToClipboard(target.toString()));
add(mcopy); add(mcopy);
//
add(value_scroll = new JScrollPane(value_view = new JTextArea()));
value_view.setEditable(false);
//value_view.setLineWrap(true);
//value_view.setWrapStyleWord(true);
} }
@Override @Override
public void CheckElementsVisibility() { public void CheckElementsVisibility() {
@@ -24,7 +33,23 @@ public class TableMenu extends StyledPopupMenu {
if ((row >= 0) && (column >= 0)) { if ((row >= 0) && (column >= 0)) {
target = owner.getValueAt(row, column); target = owner.getValueAt(row, column);
mcopy.setVisible(true); mcopy.setVisible(true);
} else mcopy.setVisible(false); Dimension d = new Dimension(Math.max(mcopy.getWidth(), 300), 100);
value_view.setVisible(true);
String res = target.toString();
if (target instanceof Vector) {
Vector<Object> v = (Vector<Object>) target;
Vector<String> res_ = new Vector<>();
for (Object o : v) {
res_.add(o.toString());
}
res = String.join("\n", res_);
}
value_view.setText(res);
value_scroll.setPreferredSize(d);
} else {
mcopy.setVisible(false);
value_view.setVisible(false);
}
super.CheckElementsVisibility(); super.CheckElementsVisibility();
} }
} }

View File

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

View File

@@ -21,7 +21,7 @@ public abstract class DataTable extends StyledTable implements DataControl {
} }
} }
} }
//------------------------------- //------------------------------
/* /*
public void SelectRow(int r) { public void SelectRow(int r) {
getSelectionModel().setSelectionInterval(r, r); getSelectionModel().setSelectionInterval(r, r);

View File

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

View File

@@ -0,0 +1,16 @@
package Common.Visual.Tables;
import Common.MainModule_;
import Common.Visual.Fonts.VisualiserFonts;
import javax.swing.*;
public class RendererLongCell extends RendererCell {
@Override
public Object Init(JTable table, Object value, int row, int column) {
return value;
}
@Override
public void Display() {
setText(value.toString());
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreePlain).deriveFont(12.0f));
}
}

View File

@@ -0,0 +1,16 @@
package Common.Visual.Tables;
import Common.Utils.Utils_;
import javax.swing.*;
public class RendererMilliseconds extends RendererCell<Long> {
@Override
public Long Init(JTable table, Object value, int row, int column) {
return (Long) value;
}
@Override
public void Display() {
if (value != null) {
setText(Utils_.printSplittedDateIntervalShort(value));
}
}
}

View File

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

View File

@@ -13,6 +13,6 @@ public class TreeForm<C extends StyledTree> extends ControlForm<C> {
} }
@Override @Override
protected void redrawControl() { 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); return Question(MainModule_.instance.getUI().getFrontWindow(), text);
} }
public static void Info(String message) { public static void Info(String message) {
Utils_.CopyToClipboard(message);
if (UI.isActive()) if (UI.isActive())
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 1); JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 1);
} }
public static void Error(String message) { public static void Error(String message) {
Utils_.CopyToClipboard(message);
if (UI.isActive()) if (UI.isActive())
JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 0); JOptionPane.showMessageDialog(MainModule_.instance.getUI().getFrontWindow(), message, "", 0);
} }

View File

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

View File

@@ -30,6 +30,6 @@ public class ComboTextDialog extends Dialog<String, DialogTextComboBox> {
} }
@Override @Override
public int getDefaultHeight() { 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 Common.Visual.Windows.Dialog.Text.TextDialog;
import _VisualDVM.Visual.Editor.BaseEditor;
public class MultilineTextForm extends TextDialog<BaseEditor> { public class MultilineTextForm extends TextDialog<BaseEditor> {
public MultilineTextForm() { public MultilineTextForm() {
super(BaseEditor.class); super(BaseEditor.class);

View File

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

View File

@@ -1,18 +1,16 @@
package _VisualDVM.Repository.BugReport; package _VisualDVM.ComponentsServer.BugReport;
import Common.Database.Objects.DBObject; import Common.Database.Objects.DBObject;
import Common.Database.Objects.rDBObject; import Common.Database.Objects.rDBObject;
import Common.Utils.TextLog; import Common.Utils.TextLog;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import Common.Utils.Vector_; import Common.Utils.Vector_;
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Constants;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.GlobalData.Account.Account;
import _VisualDVM.ProjectData.SapforData.SapforProperties; import _VisualDVM.ProjectData.SapforData.SapforProperties;
import _VisualDVM.Repository.BugReport.Json.RecipientJson;
import _VisualDVM.Repository.BugReport.Json.RecipientsJson;
import _VisualDVM.Repository.BugReport.Json.VisualiserSettingsJson;
import _VisualDVM.Repository.Component.ComponentType;
import _VisualDVM.Repository.RepositoryServer;
import _VisualDVM.Repository.Subscribes.Subscriber;
import com.sun.org.glassfish.gmbal.Description; import com.sun.org.glassfish.gmbal.Description;
import java.io.File; import java.io.File;
@@ -24,10 +22,8 @@ public class BugReport extends rDBObject {
public long visualiser_version = -1; public long visualiser_version = -1;
public long sapfor_version = -1; public long sapfor_version = -1;
public String comment = ""; public String comment = "";
@Description("DEFAULT ''") public Vector<BugReportSetting> settings = null;
public String packedRecipientsJson = ""; public Vector<BugReportRecipient> recipients = null;
@Description("DEFAULT ''")
public String packedSettingsJson = ""; //устарело. (?)
public String executor = ""; public String executor = "";
@Description("DEFAULT ''") @Description("DEFAULT ''")
public String executor_address = ""; public String executor_address = "";
@@ -54,7 +50,7 @@ public class BugReport extends rDBObject {
project_version = version_in; project_version = version_in;
visualiser_version = Global.visualiser.version; visualiser_version = Global.visualiser.version;
sapfor_version = Global.components.get(ComponentType.Sapfor_F).version; sapfor_version = Global.components.get(ComponentType.Sapfor_F).version;
packedSettingsJson = Utils_.gson.toJson(Global.mainModule.getProject().sapforProperties); settings = Global.mainModule.getProject().sapforProperties.toBugReportSettings();
percentage = 0; percentage = 0;
description = description_in; description = description_in;
date = new Date().getTime(); date = new Date().getTime();
@@ -69,7 +65,6 @@ public class BugReport extends rDBObject {
change_date = b.change_date; change_date = b.change_date;
description = b.description; description = b.description;
comment = b.comment; comment = b.comment;
packedRecipientsJson = b.packedRecipientsJson;
state = b.state; state = b.state;
percentage = b.percentage; percentage = b.percentage;
//- //-
@@ -78,8 +73,6 @@ public class BugReport extends rDBObject {
project_version = b.project_version; project_version = b.project_version;
visualiser_version = b.visualiser_version; visualiser_version = b.visualiser_version;
sapfor_version = b.sapfor_version; sapfor_version = b.sapfor_version;
packedSettingsJson = b.packedSettingsJson;
//-
descriptionAdditionDraft = b.descriptionAdditionDraft; descriptionAdditionDraft = b.descriptionAdditionDraft;
commentAdditionDraft = b.commentAdditionDraft; commentAdditionDraft = b.commentAdditionDraft;
owner = b.owner; owner = b.owner;
@@ -127,57 +120,45 @@ public class BugReport extends rDBObject {
} }
public String getSettingsSummary() { public String getSettingsSummary() {
Vector<String> res = new Vector_<String>( Vector<String> res = new Vector_<String>(
(Global.mainModule.HasAccount() ? (Global.mainModule.getAccount().isAdmin() ? ("Адрес отправителя: " + sender_address + "\n") : "") : ""), (Global.mainModule.getAccount().isAdmin() ? ("Адрес отправителя: " + sender_address + "\n") : ""),
"Версия SAPFOR: " + sapfor_version, "Версия SAPFOR: " + sapfor_version,
"Версия визуализатора: " + visualiser_version, "Версия визуализатора: " + visualiser_version,
"----------------------------------" "----------------------------------"
); );
if (!project_version.isEmpty()) { //--
if (visualiser_version < 1134) { Vector<BugReportSetting> settings_ = Global.componentsServer.db.getVectorByFK(this, BugReportSetting.class);
res.add(getSettingsJson().getSummary()); SapforProperties dummy = new SapforProperties();
} else { for (BugReportSetting bugReportSetting : settings_)
res.add(getPropertiesJson().getSummary()); res.add(dummy.getFieldDescription(bugReportSetting.name) + "=" + Utils_.DQuotes(bugReportSetting.value));
} //--
}
return String.join("\n", res); return String.join("\n", res);
} }
public String getPassport() { public String getPassport() {
return String.join("\n", return String.join("\n",
RepositoryServer.separator, Constants.separator,
"Отправитель: " + sender_name, "Отправитель: " + sender_name,
"Исполнитель: " + executor, "Исполнитель: " + executor,
"Проект: " + project_version, "Проект: " + project_version,
RepositoryServer.separator, Constants.separator,
getSettingsSummary(), getSettingsSummary(),
RepositoryServer.separator); Constants.separator);
} }
public boolean isNoneProject() { public boolean isNoneProject() {
return project_version.isEmpty(); return project_version.isEmpty();
} }
//---> //--->
public void CheckSubscribers() { public void CheckRecipients() {
for (Subscriber subscriber : Global.componentsServer.db.subscribers.Data.values()) Global.componentsServer.db.recipients.getUI().SelectAll(false);
subscriber.Select(packedRecipientsJson.contains(subscriber.address)); Vector<BugReportRecipient> recipients_ = state.equals(BugReportState.draft) ?
} recipients : Global.componentsServer.db.getVectorByFK(this, BugReportRecipient.class);
public void saveRecipientsAsJson(Vector<Subscriber> subscribers) { if (recipients_ != null) {
packedRecipientsJson = Utils_.gson.toJson(new RecipientsJson(subscribers)); for (BugReportRecipient bugReportRecipient : recipients_) {
} if (Global.componentsServer.db.recipients.containsKey(bugReportRecipient.email))
public Vector<String> getRecipients() { Global.componentsServer.db.recipients.get(bugReportRecipient.email).Select(true);
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() { public boolean canAppend(UserAccount account, TextLog log) {
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(Account account, TextLog log) {
if (account.CheckRegistered(log)) { if (account.CheckRegistered(log)) {
if (account.email.equals(sender_address) || account.email.equals(executor_address)) { if (account.email.equals(sender_address) || account.email.equals(executor_address)) {
return true; return true;
@@ -195,7 +176,7 @@ public class BugReport extends rDBObject {
} }
return false; return false;
} }
public boolean canModify(Account account, TextLog log) { public boolean canModify(UserAccount account, TextLog log) {
if (account.CheckRegistered(log)) { if (account.CheckRegistered(log)) {
switch (account.role) { switch (account.role) {
case Admin: case Admin:

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.BugReport; package _VisualDVM.ComponentsServer.BugReport;
import Common.Visual.Fonts.VisualiserFonts; import Common.Visual.Fonts.VisualiserFonts;
import Common.Visual.StatusEnum; import Common.Visual.StatusEnum;

View File

@@ -0,0 +1,43 @@
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> {
public BugReportsDBTable() {
super(String.class, BugReport.class);
}
@Override
public String getSingleDescription() {
return "отчёт об ошибке";
}
@Override
public String getPluralDescription() {
return "отчёты об ошибках";
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new BugReportsForm(this, mountPanel);
}
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

@@ -1,5 +1,5 @@
package _VisualDVM.Repository.BugReport.Json; package _VisualDVM.ComponentsServer.BugReport.Json;
import _VisualDVM.Repository.BugReport.BugReport; import _VisualDVM.ComponentsServer.BugReport.BugReport;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import java.io.Serializable; import java.io.Serializable;
@@ -9,8 +9,8 @@ public class BugReportAdditionJson implements Serializable {
@Expose @Expose
public String fieldName = ""; public String fieldName = "";
@Expose @Expose
public String textAddition =""; public String textAddition = "";
public BugReportAdditionJson(BugReport bugReport, String fieldName_in, String addition_in){ public BugReportAdditionJson(BugReport bugReport, String fieldName_in, String addition_in) {
id = bugReport.id; id = bugReport.id;
fieldName = fieldName_in; fieldName = fieldName_in;
textAddition = addition_in; textAddition = addition_in;

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.BugReport.UI; package _VisualDVM.ComponentsServer.BugReport.UI;
import Common.Database.Tables.DataSet; import Common.Database.Tables.DataSet;
import Common.Passes.PassCode_; import Common.Passes.PassCode_;
import Common.Visual.DataSetControlForm; import Common.Visual.DataSetControlForm;
@@ -7,10 +7,10 @@ import Common.Visual.Tables.ColumnInfo;
import Common.Visual.Tables.RendererDate; import Common.Visual.Tables.RendererDate;
import Common.Visual.Tables.RendererProgressBar; import Common.Visual.Tables.RendererProgressBar;
import Common.Visual.Tables.RendererStatusEnum; import Common.Visual.Tables.RendererStatusEnum;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
import _VisualDVM.ComponentsServer.BugReport.BugReportState;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode; import _VisualDVM.Passes.PassCode;
import _VisualDVM.Repository.BugReport.BugReport;
import _VisualDVM.Repository.BugReport.BugReportState;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;

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

@@ -0,0 +1,62 @@
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.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());
}
@Override
protected void initAllTables() throws Exception {
addTable(bugReports = new BugReportsDBTable());
addTable(bugReportSettings = new BugReportSettingsDBTable());
addTable(bugReportRecipients = new BugReportRecipientsDBTable());
}
@Override
public void Init() throws Exception {
DeleteDrafts();
}
@Override
public PassCode getSynchronizePassCode() {
return PassCode.SynchronizeBugReports;
}
public void DeleteDrafts() throws Exception {
Vector<BugReport> drafts = bugReports.getAllDrafts();
for (BugReport draft : drafts)
Delete(draft);
}
@Override
public void DropUI() {
super.DropUI();
bugReports.ClearUI();
recipients.ClearUI();
}
@Override
public void ResetUI() {
bugReports.ShowUI();
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

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component; package _VisualDVM.ComponentsServer.Component;
import Common.CommonConstants; import Common.CommonConstants;
import Common.Database.Objects.DBObject; import Common.Database.Objects.DBObject;
import Common.Passes.PassException; import Common.Passes.PassException;

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component; package _VisualDVM.ComponentsServer.Component;
import Common.Visual.Fonts.VisualiserFonts; import Common.Visual.Fonts.VisualiserFonts;
import Common.Visual.StatusEnum; import Common.Visual.StatusEnum;
public enum ComponentState implements StatusEnum { public enum ComponentState implements StatusEnum {

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component; package _VisualDVM.ComponentsServer.Component;
import java.io.Serializable; import java.io.Serializable;
public enum ComponentType implements Serializable { public enum ComponentType implements Serializable {
Undefined, Undefined,

View File

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

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component; package _VisualDVM.ComponentsServer.Component;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import _VisualDVM.Utils; import _VisualDVM.Utils;

View File

@@ -1,7 +1,8 @@
package _VisualDVM.Repository.Component.Json; package _VisualDVM.ComponentsServer.Component.Json;
import Common.CommonConstants;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import _VisualDVM.Repository.Component.Component; import _VisualDVM.ComponentsServer.Component.Component;
import _VisualDVM.Repository.Component.ComponentType; import _VisualDVM.ComponentsServer.Component.ComponentType;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import java.io.Serializable; import java.io.Serializable;
@@ -13,15 +14,22 @@ public class ComponentPublicationInfoJson implements Serializable {
@Expose @Expose
public byte[] packedFile = null; public byte[] packedFile = null;
@Expose @Expose
public long versionNumber = CommonConstants.Nan;
@Expose
public String versionText = ""; public String versionText = "";
@Expose @Expose
public String changeRecord = ""; public String changeRecord = "";
@Expose @Expose
public boolean needsUpdateMinimalVersion = false; public boolean needsUpdateMinimalVersion = false;
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(); componentType = component.getComponentType();
fileName = component.getFileName(); fileName = component.getFileName();
packedFile = Utils_.fileToBytes(component.getFile()); packedFile = Utils_.fileToBytes(component.getFile());
versionNumber = component.version;
versionText = component.getVersionText(); versionText = component.getVersionText();
} }
} }

View File

@@ -1,5 +1,5 @@
package _VisualDVM.Repository.Component.Json; package _VisualDVM.ComponentsServer.Component.Json;
import _VisualDVM.Repository.Component.ComponentType; import _VisualDVM.ComponentsServer.Component.ComponentType;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import java.io.Serializable; import java.io.Serializable;
@@ -10,7 +10,7 @@ public class ComponentVersionsInfoJson implements Serializable {
public String minimal_version = ""; public String minimal_version = "";
@Expose @Expose
public String actual_version = ""; public String actual_version = "";
public ComponentVersionsInfoJson(ComponentType componentType_in){ public ComponentVersionsInfoJson(ComponentType componentType_in) {
componentType=componentType_in; componentType = componentType_in;
} }
} }

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component; package _VisualDVM.ComponentsServer.Component;
import Common.Utils.Utils_; import Common.Utils.Utils_;
public abstract class OSDComponent extends Component { public abstract class OSDComponent extends Component {
@Override @Override

View File

@@ -1,9 +1,9 @@
package _VisualDVM.Repository.Component.PerformanceAnalyzer; package _VisualDVM.ComponentsServer.Component.PerformanceAnalyzer;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import Common.Visual.UI; import Common.Visual.UI;
import _VisualDVM.ComponentsServer.Component.Component;
import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.Repository.Component.Component;
import _VisualDVM.Repository.Component.ComponentType;
import _VisualDVM.Utils; import _VisualDVM.Utils;
import analyzer.common.MessageJtoJ; import analyzer.common.MessageJtoJ;

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component.Sapfor; package _VisualDVM.ComponentsServer.Component.Sapfor;
import Common.MainModule_; import Common.MainModule_;
import Common.Utils.Utils_; import Common.Utils.Utils_;

View File

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

View File

@@ -1,6 +1,6 @@
package _VisualDVM.Repository.Component.Sapfor; package _VisualDVM.ComponentsServer.Component.Sapfor;
import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.Repository.Component.ComponentType;
import java.io.File; import java.io.File;
import java.nio.file.Paths; import java.nio.file.Paths;
@@ -11,7 +11,7 @@ public class Sapfor_F extends Sapfor {
} }
@Override @Override
public String getAssemblyCommand() { public String getAssemblyCommand() {
return "cd Repo/sapfor/experts/Sapfor_2017/_bin\n" + return "cd Repo/SAPFOR/install\n" +
"cmake ../\n" + "cmake ../\n" +
"make -j 4\n"; "make -j 4\n";
} }
@@ -19,7 +19,7 @@ public class Sapfor_F extends Sapfor {
public File getAssemblyFile() { public File getAssemblyFile() {
return Paths.get( return Paths.get(
Global.RepoDirectory.getAbsolutePath(), Global.RepoDirectory.getAbsolutePath(),
"sapfor/experts/Sapfor_2017/_bin/Sapfor_F").toFile(); "SAPFOR/install/Sapfor_F").toFile();
} }
@Override @Override
public String getUpdateCommand() { public String getUpdateCommand() {

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component.Sapfor; package _VisualDVM.ComponentsServer.Component.Sapfor;
public enum TransformationPermission { public enum TransformationPermission {
None, None,
All, All,

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.Repository.Component.UI.ComponentsFields"> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.ComponentsServer.Component.UI.ComponentsFields">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0"> <grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints> <constraints>
<xy x="20" y="20" width="802" height="400"/> <xy x="20" y="20" width="802" height="400"/>

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component.UI; package _VisualDVM.ComponentsServer.Component.UI;
import Common.Visual.Windows.Dialog.DialogFields; import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.Global; import _VisualDVM.Global;

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component.UI; package _VisualDVM.ComponentsServer.Component.UI;
import Common.Database.Tables.DataSet; import Common.Database.Tables.DataSet;
import Common.MainModule_; import Common.MainModule_;
import Common.Visual.DataSetControlForm; import Common.Visual.DataSetControlForm;
@@ -8,9 +8,9 @@ import Common.Visual.Menus.VisualiserMenu;
import Common.Visual.Tables.ColumnInfo; import Common.Visual.Tables.ColumnInfo;
import Common.Visual.Tables.RendererMaskedNanInteger; import Common.Visual.Tables.RendererMaskedNanInteger;
import Common.Visual.Tables.RendererStatusEnum; import Common.Visual.Tables.RendererStatusEnum;
import _VisualDVM.ComponentsServer.Component.Component;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode; import _VisualDVM.Passes.PassCode;
import _VisualDVM.Repository.Component.Component;
import javax.swing.*; import javax.swing.*;
import java.util.Vector; import java.util.Vector;

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.Repository.Component.UI.PickUpComponentFields"> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.ComponentsServer.Component.UI.PickUpComponentFields">
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0"> <grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints> <constraints>
<xy x="20" y="20" width="500" height="400"/> <xy x="20" y="20" width="500" height="400"/>

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component.UI; package _VisualDVM.ComponentsServer.Component.UI;
import Common.Visual.Windows.Dialog.DialogFields; import Common.Visual.Windows.Dialog.DialogFields;
import javax.swing.*; import javax.swing.*;

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.Repository.Component.UI.PublishFields"> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.ComponentsServer.Component.UI.PublishFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="8" 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="8" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <constraints>

View File

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

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component.UI; package _VisualDVM.ComponentsServer.Component.UI;
import Common.Visual.Windows.Dialog.Dialog; import Common.Visual.Windows.Dialog.Dialog;
public class PublishForm extends Dialog<String, PublishFields> { public class PublishForm extends Dialog<String, PublishFields> {
public PublishForm() { public PublishForm() {

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component; package _VisualDVM.ComponentsServer.Component;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import _VisualDVM.Constants; import _VisualDVM.Constants;
import _VisualDVM.Global; import _VisualDVM.Global;
@@ -62,7 +62,7 @@ public class Visualiser extends Component {
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html //http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
@Override @Override
public void GetVersionInfo() { public void GetVersionInfo() {
version = 1144; version = Constants.version;
String pattern = "MMM dd yyyy HH:mm:ss"; String pattern = "MMM dd yyyy HH:mm:ss";
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH); DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
date_text = df.format(getClassBuildTime()); date_text = df.format(getClassBuildTime());
@@ -85,7 +85,7 @@ public class Visualiser extends Component {
} }
return res; return res;
} }
public File getDownloadsDirectory(){ public File getDownloadsDirectory() {
File res = new File(getWorkspace(), Constants.DownloadsDirectoryName); File res = new File(getWorkspace(), Constants.DownloadsDirectoryName);
Utils_.CheckDirectory(res); Utils_.CheckDirectory(res);
return res; return res;

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.Component; package _VisualDVM.ComponentsServer.Component;
import Common.Passes.PassException; import Common.Passes.PassException;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import Common.Visual.UI; import Common.Visual.UI;
@@ -73,14 +73,16 @@ public class Visualizer_2 extends OSDComponent {
} }
@Override @Override
public String getAssemblyCommand() { public String getAssemblyCommand() {
return "cd Repo/sapfor/experts/Sapfor_2017/_src/Server\n" + 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"; "g++ -O3 -std=c++17 checkUniq.cpp server.cpp -o Visualizer_2 -lpthread -lstdc++fs\n";
} }
@Override @Override
public File getAssemblyFile() { public File getAssemblyFile() {
return Paths.get( return Paths.get(
Global.RepoDirectory.getAbsolutePath(), Global.RepoDirectory.getAbsolutePath(),
"sapfor/experts/Sapfor_2017/_src/Server/Visualizer_2").toFile(); "SAPFOR/src/Server/Visualizer_2").toFile();
} }
public void Connect() throws Exception { public void Connect() throws Exception {
ClearLog(); ClearLog();

View File

@@ -0,0 +1,381 @@
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;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import _VisualDVM.Passes.All.ZipFolderPass;
import _VisualDVM.ProjectData.LanguageName;
import _VisualDVM.Repository.EmailMessage;
import _VisualDVM.Repository.Server.RepositoryServer;
import _VisualDVM.Utils;
import org.apache.commons.io.FileUtils;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.lang.reflect.Field;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Date;
import java.util.Vector;
public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
public CredentialsDatabase credentials_db = null;
public ComponentsServer() {
super(BugReportsDatabase.class);
}
@Override
public String getServerHomeName() {
return "_sapfor_x64";
}
@Override
public int getPort() {
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;
if (bugReport.packed_archive != null) {
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", bugReport.id);
Utils_.bytesToFile(bugReport.packed_archive, bugArchive);
}
}
}
@Override
protected void afterPublishAction(DBObject object) throws Exception {
if (object instanceof BugReport) {
BugReport bugReport = (BugReport) object;
if (bugReport.settings != null) {
for (BugReportSetting setting : bugReport.settings) {
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) {
UserAccount account = (UserAccount) object;
Utils_.forceDeleteWithCheck(account.getServerKeyFile());
}
}
@Override
public void ActivateDB() {
super.ActivateDB();
try {
credentials_db = new CredentialsDatabase();
credentials_db.Activate();
} catch (Exception ex) {
ex.printStackTrace();
}
}
//-
void DVMConvertProject() throws Exception {
String[] args = request.arg.split("\n");
//-
String projectName = args[0];
LanguageName projectLanguage = LanguageName.valueOf(args[1]);
String options = args[2];
Vector<String> filesNames = new Vector<>(Arrays.asList(args).subList(3, args.length));
//-
File workspace = Utils.getTempFileName("convertation");
FileUtils.forceMkdir(workspace);
File archive = new File(workspace, projectName + ".zip");
request.Unpack(archive);
File project = new File(workspace, projectName);
Vector<String> badFiles = new Vector<>();
if (unzip.Do(archive.getAbsolutePath(), workspace.getAbsolutePath()) && project.exists()) {
String output = "";
for (String fileName : filesNames) {
File program = Paths.get(project.getAbsolutePath(), fileName).toFile();
//--
File convertedProgram = Paths.get(program.getParent(), Utils_.getFileNameWithoutExtension(program) + ".DVMH." + (projectLanguage.equals(LanguageName.fortran) ? "f" : "c")).toFile();
String command = Utils_.DQuotes(Global.componentsServerProperties.default_dvm_drv) + " " + projectLanguage.getDVMCompile() + "dv " + options + " " + Utils_.DQuotes(program.getName());
//--
File fileWorkspace = program.getParentFile();
Process process = Utils.startScript(workspace, fileWorkspace, Utils_.getDateName("convert_script"), command);
process.waitFor();
String convertationOut = Utils.readAllOutput(process);
convertationOut = convertationOut.replace(program.getName(), fileName); //для учета пути.
if (!convertationOut.isEmpty()) output += convertationOut + "\n";
try {
if (convertedProgram.exists()) {
FileUtils.forceDelete(program);
convertedProgram.renameTo(program);
} else badFiles.add(program.getName());
} catch (Exception ex) {
ex.printStackTrace();
}
//--
}
response.arg = String.join("\n", badFiles) + "|" + output;
File resultArchive = new File(workspace, projectName + "_result.zip");
if (ComponentsServer.zip.Do(project.getAbsolutePath(), resultArchive.getAbsolutePath())) {
response.object = Utils_.fileToBytes(resultArchive);
} else throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось запаковать версию");
//--
} else throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось распаковать проект");
}
void AppendBugReportField() throws Exception {
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
checkExistense(transport.id, BugReport.class);
BugReport actual = db.bugReports.get(transport.id);
Field field = BugReport.class.getField(transport.fieldName);
field.set(actual, field.get(actual) + "\n" + transport.textAddition);
actual.change_date = new Date().getTime();
db.Update(actual);
response.object = actual;
}
void ReceiveAllArchives() throws Exception {
ZipFolderPass zip = new ZipFolderPass();
File archives = new File(Utils_.getDateName("Bugs"));
if (zip.Do("Bugs", archives.getAbsolutePath())) {
response.object = Utils_.fileToBytes(archives);
} else throw new RepositoryRefuseException("Не удалось запаковать архивы");
}
void ReceiveBugReportsDatabase() throws Exception {
response.object = Utils_.fileToBytes(db.getFile());
response.arg = credentials_db.userAccounts.getPackedActiveRecipients();
}
void ReceiveBugReport() throws Exception {
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", request.arg);
response.object = Utils_.fileToBytes(bugArchive);
}
void UpdateBugReport() throws Exception {
BugReport oldBugReport = (BugReport) request.object;
checkExistense(oldBugReport.id, BugReport.class);
BugReport bugReport = db.bugReports.get(oldBugReport.id);
bugReport.SynchronizeFields(oldBugReport);
bugReport.change_date = new Date().getTime();
db.Update(bugReport);
}
//--
void GetComponentsBackUps() throws Exception {
File backupsDirectory = Paths.get(Utils_.getHomePath(), "Components", request.arg, "Backups").toFile();
//--
if (backupsDirectory.exists()) {
File[] files = backupsDirectory.listFiles(File::isFile);
if (files != null) {
Vector<RemoteFile> res = new Vector<>();
for (File file : files)
res.add(new RemoteFile(file.getAbsolutePath(), false)); //тут всегда линух.
response.object = res;
} else throw new RepositoryRefuseException("Не удалось получить список предыдущих версий");
} else {
//баги еще не создавались. штатная ситуация.
response.object = new Vector<>();
}
}
void CheckURLRegistered() throws Exception {
String[] data = request.arg.split("\n");
String email = data[0];
String machineURL = data[1];
String login = data[2];
response.object = credentials_db.workspaces.findWorkspace(email, machineURL, login);
}
void GetComponentChangesLog() throws Exception {
response.object = Utils_.fileToBytes(Paths.get(Utils_.getHomePath(), "Components", request.arg, "changes.txt").toFile());
}
void PublishComponent() throws Exception {
ComponentPublicationInfoJson info = (ComponentPublicationInfoJson) request.object;
File componentHome = Utils_.getFile(Utils_.getHomePath(), "Components", info.componentType.toString());
File componentFile = new File(componentHome, info.fileName);
File versionFile = new File(componentHome, "version.txt");
File backupsFolder = new File(componentHome, "Backups");
//0 архивация старой версии, если она есть.
if (componentFile.exists()) {
String versionText = "";
if (versionFile.exists()) versionText = Utils.ReadAllText(versionFile);
//---->>
Utils_.CheckDirectory(backupsFolder);
Utils.keepNewFiles(backupsFolder, Global.componentsServerProperties.ComponentsBackUpsCount);
//-->>
File backupFile = new File(backupsFolder, info.componentType + "_" + versionText);
if (backupFile.exists()) Utils_.forceDeleteWithCheck(backupFile);
FileUtils.moveFile(componentFile, backupFile);
}
//1 распаковка компонента
Utils_.bytesToFile((byte[]) info.packedFile, componentFile);
//2 запись версии компонента
FileUtils.writeStringToFile(versionFile, info.versionText);
//3 запись в журнал компонента
File changesLog = new File(componentHome, "changes.txt");
FileWriter writer = new FileWriter(changesLog.getAbsolutePath(), true);
BufferedWriter bufferWriter = new BufferedWriter(writer);
bufferWriter.write(info.changeRecord);
bufferWriter.close();
//-
if (info.needsUpdateMinimalVersion) {
Print("Поднять минимальную версию компонента " + info.componentType);
File minimal_versionFile = new File(componentHome, "minimal_version.txt");
FileUtils.writeStringToFile(minimal_versionFile, info.versionText);
//-
//3 запись в журнал компонента
FileWriter writer_ = new FileWriter(changesLog, true);
BufferedWriter bufferWriter_ = new BufferedWriter(writer_);
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;
Vector<ComponentVersionsInfoJson> res = new Vector<>();
for (String sType : types) {
ComponentType componentType = ComponentType.valueOf(sType);
File actualVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "version.txt").toFile();
File minimalVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "minimal_version.txt").toFile();
ComponentVersionsInfoJson info = new ComponentVersionsInfoJson(componentType);
info.actual_version = Utils_.removeCharacters(Utils.ReadAllText(actualVersionFile), "\n", "\r");
info.minimal_version = Utils_.removeCharacters(Utils.ReadAllText(minimalVersionFile), "\n", "\r");
res.add(info);
}
response.object = res;
}
void ReceiveComponent() throws Exception {
String[] packed1 = request.arg.split("\n");
//тип/имя файла
File componentFile1 = Paths.get(Utils_.getHomePath(), "Components", packed1[0], packed1[1]).toFile();
Print("Получить компонент " + packed1[0]);
response.object = Utils_.fileToBytes(componentFile1);
}
void GetUserAccountByKey() throws Exception {
UserAccount account = credentials_db.userAccounts.getByKey(request.arg);
response.object = account == null ? null : account;
}
void GetUserAccountByEmail() throws Exception {
UserAccount account_info = (UserAccount) request.object;
UserAccount account = credentials_db.userAccounts.getByEmail(account_info.email);
if (account == null) {
account = new UserAccount(account_info);
account.role = Constants.admins_mails.contains(account.email) ? AccountRole.Admin : AccountRole.User;
credentials_db.Insert(account);
account.generateKey();
}
response.object = account;
response.arg = FileUtils.readFileToString(account.getServerKeyFile());
}
void ReceiveCredentialsDatabase() throws Exception {
response.object = Utils_.fileToBytes(credentials_db.getFile());
}
//--
@Override
protected void UnsafeSession() throws Exception {
switch (code) {
case GetUserAccountByKey:
GetUserAccountByKey();
break;
case GetUserAccountByEmail:
GetUserAccountByEmail();
break;
case GetComponentsBackups:
GetComponentsBackUps();
break;
case UpdateComponent:
//zip
PublishComponent();
break;
case ReceiveComponent:
ReceiveComponent();
break;
case GetComponentsVersionsInfo:
GetComponentsVersionsInfo();
break;
case GetComponentChangesLog:
GetComponentChangesLog();
break;
default:
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
}
}
@Override
protected void Session() throws Exception {
switch (code) {
case ReceiveCredentialsDatabase:
ReceiveCredentialsDatabase();
break;
case ReceiveAllArchives:
ReceiveAllArchives();
break;
case UpdateBugReport:
UpdateBugReport();
break;
case AppendBugReportTextField:
AppendBugReportField();
break;
case ReceiveBugReportsDatabase:
ReceiveBugReportsDatabase();
break;
case ReceiveBugReport:
ReceiveBugReport();
break;
case DVMConvertProject:
DVMConvertProject();
break;
case CheckURLRegistered:
CheckURLRegistered();
break;
default:
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
}
}
}

View File

@@ -0,0 +1,35 @@
package _VisualDVM.ComponentsServer;
import Common.Database.SQLITE.SQLiteDatabase;
import Common.Passes.PassCode_;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
import _VisualDVM.ComponentsServer.UserAccount.UserAccountsDBTable;
import _VisualDVM.Passes.PassCode;
import java.nio.file.Paths;
public class CredentialsDatabase extends SQLiteDatabase {
public UserAccountsDBTable userAccounts;
public SubscriberWorkspaceDBTable workspaces;
public CredentialsDatabase() {
super(Paths.get(System.getProperty("user.dir"), "Data", "credentials.sqlite").toFile());
}
@Override
protected void initAllTables() throws Exception {
addTable(userAccounts = new UserAccountsDBTable());
addTable(workspaces = new SubscriberWorkspaceDBTable());
}
@Override
public PassCode_ getSynchronizePassCode() {
return PassCode.SynchronizeCredentials;
}
@Override
public void DropUI() {
super.DropUI();
userAccounts.ClearUI();
workspaces.ClearUI();
}
@Override
public void ResetUI() {
userAccounts.ShowUI();
super.ResetUI();
}
}

View File

@@ -0,0 +1,12 @@
package _VisualDVM.ComponentsServer.Recipient.Json;
import com.google.gson.annotations.Expose;
public class UserAccountJson {
@Expose
public String email;
@Expose
public String name;
public UserAccountJson(String email_in, String name_in) {
email = email_in;
name = name_in;
}
}

View File

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

View File

@@ -0,0 +1,24 @@
package _VisualDVM.ComponentsServer.Recipient;
import Common.Database.Objects.DBObject;
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;
}
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
Recipient src_ = (Recipient) src;
email = src_.email;
name = src_.name;
}
}

View File

@@ -0,0 +1,54 @@
package _VisualDVM.ComponentsServer.Recipient;
import Common.Database.Tables.DataSet;
import Common.Utils.Utils_;
import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
import _VisualDVM.ComponentsServer.Recipient.UI.RecipientsForm;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import javax.swing.*;
import java.util.Vector;
public class RecipientsDataSet extends DataSet<String, Recipient> {
public RecipientsDataSet() {
super(String.class, Recipient.class);
}
public void Unpack(String packed) {
clear();
UserAccountsJson jsons = Utils_.gson.fromJson(packed, UserAccountsJson.class);
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);
}
@Override
public String getPluralDescription() {
return "адресаты";
}
@Override
public String getSingleDescription() {
return "адресат";
}
public Vector<String> getSelectedMails() {
//баг текущий. значит адресаты уже активные и правильные. дополняем их админами и автором.
Vector<String> res = new Vector<>();
for (Recipient recipient : Data.values()) {
if (recipient.isSelected() && !res.contains(recipient.email))
res.add(recipient.email);
}
//--
if (!res.contains(Global.mainModule.getAccount().email))
res.add(Global.mainModule.getAccount().email);
//--
for (String admin_mail : Constants.admins_mails) {
if (!res.contains(admin_mail))
res.add(admin_mail);
}
//--
return res;
}
}

View File

@@ -0,0 +1,44 @@
package _VisualDVM.ComponentsServer.Recipient.UI;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo;
import _VisualDVM.ComponentsServer.Recipient.Recipient;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import javax.swing.*;
public class RecipientsForm extends DataSetControlForm<Recipient> {
public RecipientsForm(DataSet<?, Recipient> dataSource_in, JPanel mountPanel_in) {
super(dataSource_in, mountPanel_in);
}
@Override
protected void createColumns() {
AddColumns(
new ColumnInfo<Recipient>("Имя") {
@Override
public Object getFieldAt(Recipient object) {
return object.name;
}
}
);
}
@Override
protected DataMenuBar createMenuBar() {
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.SaveBugReportExecutor, PassCode.SaveBugReportRecipients);
}
@Override
protected ColumnInfo<Recipient> createPKColumn() {
return new ColumnInfo<Recipient>(dataSource.getPKName()) {
@Override
public Object getFieldAt(Recipient object) {
return object.getPK();
}
@Override
public boolean isVisible() {
return Global.mainModule.getAccount().role.equals(AccountRole.Admin);
}
};
}
}

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.SubscriberRights; package _VisualDVM.ComponentsServer.SubscriberRights;
import Common.Database.Objects.DBObject; import Common.Database.Objects.DBObject;
public class SubscriberRights extends DBObject { public class SubscriberRights extends DBObject {
public String email; //почта public String email; //почта

View File

@@ -1,4 +1,4 @@
package _VisualDVM.Repository.SubscriberWorkspace; package _VisualDVM.ComponentsServer.SubscriberWorkspace;
import Common.Database.Objects.iDBObject; import Common.Database.Objects.iDBObject;
public class SubscriberWorkspace extends iDBObject { public class SubscriberWorkspace extends iDBObject {
public String email; //почта public String email; //почта

View File

@@ -1,7 +1,7 @@
package _VisualDVM.Repository.SubscriberWorkspace; package _VisualDVM.ComponentsServer.SubscriberWorkspace;
import Common.Database.Tables.iDBTable; import Common.Database.Tables.iDBTable;
import Common.Visual.DataSetControlForm; import Common.Visual.DataSetControlForm;
import _VisualDVM.Repository.SubscriberWorkspace.UI.SubscriberWorkspacesForm; import _VisualDVM.ComponentsServer.SubscriberWorkspace.UI.SubscriberWorkspacesForm;
import javax.swing.*; import javax.swing.*;
public class SubscriberWorkspaceDBTable extends iDBTable<SubscriberWorkspace> { public class SubscriberWorkspaceDBTable extends iDBTable<SubscriberWorkspace> {

View File

@@ -1,13 +1,12 @@
package _VisualDVM.Repository.SubscriberWorkspace.UI; package _VisualDVM.ComponentsServer.SubscriberWorkspace.UI;
import Common.Database.Tables.DataSet; import Common.Database.Tables.DataSet;
import Common.Passes.PassCode_;
import Common.Visual.DataSetControlForm; import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar; import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo; import Common.Visual.Tables.ColumnInfo;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode; import _VisualDVM.Passes.PassCode;
import _VisualDVM.Repository.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.Repository.Subscribes.Subscriber;
import javax.swing.*; import javax.swing.*;
public class SubscriberWorkspacesForm extends DataSetControlForm<SubscriberWorkspace> { public class SubscriberWorkspacesForm extends DataSetControlForm<SubscriberWorkspace> {
@@ -46,17 +45,13 @@ public class SubscriberWorkspacesForm extends DataSetControlForm<SubscriberWorks
); );
} }
@Override @Override
public PassCode_ getDeletePassCode() {
return PassCode.DeleteSubscriberWorkspace;
}
@Override
public DataMenuBar createMenuBar() { public DataMenuBar createMenuBar() {
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.DeleteSubscriberWorkspace); return new DataMenuBar(dataSource.getPluralDescription(), PassCode.DeleteRemoteWorkspace);
} }
@Override @Override
public boolean isObjectVisible(SubscriberWorkspace object) { public boolean isObjectVisible(SubscriberWorkspace object) {
Subscriber subscriber = Global.componentsServer.db.subscribers.getUI().getCurrent(); UserAccount account = Global.componentsServer.credentials_db.userAccounts.getUI().getCurrent();
return super.isObjectVisible(object) && (subscriber != null) && subscriber.address.equals(object.email) && return super.isObjectVisible(object) && (account != null) && account.email.equals(object.email) &&
(Global.mainModule.getAccount().isAdmin() || Global.mainModule.getAccount().email.equals(subscriber.address)); (Global.mainModule.getAccount().isAdmin() || Global.mainModule.getAccount().email.equals(account.email));
} }
} }

View File

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

View File

@@ -1,13 +1,13 @@
package _VisualDVM.Repository.Subscribes.UI; package _VisualDVM.ComponentsServer.UserAccount.UI;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import Common.Visual.UI; import Common.Visual.UI;
import Common.Visual.Windows.Dialog.DBObjectDialog; import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.GlobalData.Account.AccountRole; public class UserAccountDialog extends DBObjectDialog<UserAccount, UserAccountFields> {
import _VisualDVM.Repository.Subscribes.Subscriber; public UserAccountDialog() {
public class SubscriberDialog extends DBObjectDialog<Subscriber, SubscriberFields> { super(UserAccountFields.class);
public SubscriberDialog() {
super(SubscriberFields.class);
} }
@Override @Override
public int getDefaultHeight() { public int getDefaultHeight() {
@@ -24,15 +24,15 @@ public class SubscriberDialog extends DBObjectDialog<Subscriber, SubscriberField
Utils_.validateEmail(fields.tfAddress.getText(), Log); Utils_.validateEmail(fields.tfAddress.getText(), Log);
if (fields.tfAddress.getText().isEmpty()) if (fields.tfAddress.getText().isEmpty())
Log.Writeln_("Адрес электронной почты не может быть пустым"); Log.Writeln_("Адрес электронной почты не может быть пустым");
if (!title_text.equals("Регистрация") && (fields.tfAddress.isEditable() && Global.componentsServer.db.subscribers.Data.containsKey(fields.tfAddress.getText()))) { if (!title_text.equals("Регистрация") && (fields.tfAddress.isEditable() && Global.componentsServer.credentials_db.userAccounts.Data.containsKey(fields.tfAddress.getText()))) {
Log.Writeln_("Адрес электронной почты " + Utils_.Brackets(fields.tfAddress.getText()) + " уже есть в списке."); Log.Writeln_("Адрес электронной почты " + Utils_.Brackets(fields.tfAddress.getText()) + " уже есть в списке.");
} }
} }
@Override @Override
public void fillFields() { public void fillFields() {
fields.tfName.setText(Result.name); fields.tfName.setText(Result.name);
fields.tfAddress.setText(Result.address); fields.tfAddress.setText(Result.email);
fields.cbMail.setSelected(Result.mailOn != 0); fields.cbMail.setSelected(Result.subscribe_active != 0);
UI.TrySelect(fields.cbRole, Result.role); UI.TrySelect(fields.cbRole, Result.role);
} }
@Override @Override
@@ -45,9 +45,8 @@ public class SubscriberDialog extends DBObjectDialog<Subscriber, SubscriberField
@Override @Override
public void ProcessResult() { public void ProcessResult() {
Result.name = fields.tfName.getText(); Result.name = fields.tfName.getText();
Result.address = fields.tfAddress.getText(); Result.email = fields.tfAddress.getText();
Result.mailOn = fields.cbMail.isSelected() ? 1 : 0; Result.subscribe_active = fields.cbMail.isSelected() ? 1 : 0;
Result.role = getSelectedRole(); Result.role = getSelectedRole();
} }
}; };

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.Repository.Subscribes.UI.SubscriberFields"> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.ComponentsServer.UserAccount.UI.UserAccountFields">
<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="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <constraints>
@@ -8,7 +8,7 @@
<properties/> <properties/>
<border type="none"/> <border type="none"/>
<children> <children>
<component id="81c98" class="javax.swing.JLabel"> <component id="5e1da" class="javax.swing.JLabel">
<constraints> <constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints> </constraints>
@@ -17,12 +17,20 @@
<text value="имя"/> <text value="имя"/>
</properties> </properties>
</component> </component>
<vspacer id="8f1c6"> <vspacer id="de3f0">
<constraints> <constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
</vspacer> </vspacer>
<component id="4c488" class="javax.swing.JLabel"> <component id="e0e31" 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">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="c014a" class="javax.swing.JLabel">
<constraints> <constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/> <grid row="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> </constraints>
@@ -31,15 +39,7 @@
<text value="адрес"/> <text value="адрес"/>
</properties> </properties>
</component> </component>
<component id="675ad" class="javax.swing.JTextField" binding="tfName" custom-create="true"> <component id="2761d" class="javax.swing.JTextField" binding="tfAddress" 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">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="a96c1" class="javax.swing.JTextField" binding="tfAddress" custom-create="true">
<constraints> <constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> <grid row="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">
<preferred-size width="150" height="-1"/> <preferred-size width="150" height="-1"/>
@@ -47,22 +47,7 @@
</constraints> </constraints>
<properties/> <properties/>
</component> </component>
<component id="1c24b" class="javax.swing.JLabel"> <component id="15e49" 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"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="роль"/>
</properties>
</component>
<component id="81d94" class="javax.swing.JComboBox" binding="cbRole" 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/>
</component>
<component id="fe07e" class="javax.swing.JLabel">
<constraints> <constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/> <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints> </constraints>
@@ -71,7 +56,7 @@
<text value="рассылка"/> <text value="рассылка"/>
</properties> </properties>
</component> </component>
<component id="e0879" class="javax.swing.JCheckBox" binding="cbMail"> <component id="4da2" class="javax.swing.JCheckBox" binding="cbMail">
<constraints> <constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/> <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
@@ -84,6 +69,21 @@
<toolTipText value="Будет ли включена рассылка для этого пользователя"/> <toolTipText value="Будет ли включена рассылка для этого пользователя"/>
</properties> </properties>
</component> </component>
<component id="398ee" 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"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="роль"/>
</properties>
</component>
<component id="34bef" class="javax.swing.JComboBox" binding="cbRole" 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/>
</component>
</children> </children>
</grid> </grid>
</form> </form>

View File

@@ -1,27 +1,28 @@
package _VisualDVM.Repository.Subscribes.UI; package _VisualDVM.ComponentsServer.UserAccount.UI;
import Common.Visual.TextField.StyledTextField; import Common.Visual.TextField.StyledTextField;
import Common.Visual.Windows.Dialog.DialogFields; import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.GlobalData.Account.AccountRole; import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
public class SubscriberFields implements DialogFields { public class UserAccountFields implements DialogFields {
public JTextField tfName; public JTextField tfName;
public JTextField tfAddress; public JTextField tfAddress;
public JComboBox<AccountRole> cbRole;
public JCheckBox cbMail; public JCheckBox cbMail;
public JComboBox cbRole;
private JPanel content; private JPanel content;
@Override
public Component getContent() {
return content;
}
private void createUIComponents() { private void createUIComponents() {
// TODO: place custom component creation code here // TODO: place custom component creation code here
tfName = new StyledTextField(); tfName = new StyledTextField();
tfAddress = new StyledTextField(); tfAddress = new StyledTextField();
cbRole = new JComboBox<>(); cbRole = new JComboBox<>();
cbRole.addItem(AccountRole.User); cbRole.addItem(AccountRole.User);
cbRole.addItem(AccountRole.Student);
cbRole.addItem(AccountRole.Developer); cbRole.addItem(AccountRole.Developer);
cbRole.addItem(AccountRole.Admin); cbRole.addItem(AccountRole.Admin);
} }
@Override
public Component getContent() {
return content;
}
} }

View File

@@ -0,0 +1,61 @@
package _VisualDVM.ComponentsServer.UserAccount.UI;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import javax.swing.*;
public class UserAccountsForm extends DataSetControlForm<UserAccount> {
public UserAccountsForm(DataSet<?, UserAccount> dataSource_in, JPanel mountPanel_in) {
super(dataSource_in, mountPanel_in);
}
@Override
protected void createColumns() {
AddColumns(
new ColumnInfo<UserAccount>("Имя") {
@Override
public Object getFieldAt(UserAccount object) {
return object.name;
}
},
new ColumnInfo<UserAccount>("Почта") {
@Override
public Object getFieldAt(UserAccount object) {
return object.email;
}
},
new ColumnInfo<UserAccount>("Роль") {
@Override
public Object getFieldAt(UserAccount object) {
return object.role.getDescription();
}
@Override
public boolean isVisible() {
return Global.mainModule.getAccount().role.equals(AccountRole.Admin);
}
},
new ColumnInfo<UserAccount>("Рассылка") {
@Override
public Object getFieldAt(UserAccount object) {
return (object.subscribe_active == 0) ? "выключена" : "включена";
}
}
);
}
@Override
protected DataMenuBar createMenuBar() {
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.SynchronizeCredentials,
PassCode.PublishUserAccount,
PassCode.EditUserAccount,
PassCode.DeleteUserAccount);
}
@Override
protected DBObjectDialog getDialog() {
return new UserAccountDialog();
}
}

View File

@@ -1,18 +1,55 @@
package _VisualDVM.GlobalData.Account; package _VisualDVM.ComponentsServer.UserAccount;
import Common.Database.Objects.DBObject; import Common.Database.Objects.DBObject;
import Common.Database.Objects.iDBObject;
import Common.Utils.TextLog; import Common.Utils.TextLog;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.Repository.BugReport.BugReport;
import com.sun.org.glassfish.gmbal.Description; import com.sun.org.glassfish.gmbal.Description;
public class Account extends DBObject { import org.apache.commons.io.FileUtils;
@Description("PRIMARY KEY,NOT NULL") import org.apache.commons.lang.RandomStringUtils;
public int id = 0;
public String name = "?"; import java.io.File;
public String email = "?"; public class UserAccount extends iDBObject {
//-- public String name = "";
@Description("IGNORE") public String email = "";
public AccountRole role = AccountRole.Undefined; //роль незареганного пользователя @Description("DEFAULT ''")
//-- public String telegram_name = "";
@Description("DEFAULT 1")
public int subscribe_active = 1;
@Description("DEFAULT 'Undefined'")
public AccountRole role = AccountRole.Undefined; //права доступа
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;
role = src_.role;
}
public File getClientKeyFile() {
return new File(Global.KeysDirectory, "key");
}
public File getServerKeyFile() {
return new File(Global.KeysDirectory, String.valueOf(id));
}
public String getKey() throws Exception {
return FileUtils.readFileToString(getServerKeyFile());
}
public void generateKey() throws Exception {
FileUtils.writeStringToFile(getServerKeyFile(), RandomStringUtils.random(100, true, true));
}
//todo часть устарело.разобрать.
public boolean CheckRegistered(TextLog Log) { public boolean CheckRegistered(TextLog Log) {
if (role.equals(AccountRole.Undefined)) { if (role.equals(AccountRole.Undefined)) {
if (Log != null) { if (Log != null) {
@@ -62,9 +99,5 @@ public class Account extends DBObject {
} }
return true; return true;
} }
@Override //---
public Object getPK() {
return id;
}
} }

View File

@@ -0,0 +1,74 @@
package _VisualDVM.ComponentsServer.UserAccount;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.FKBehaviour;
import Common.Database.Tables.FKCurrentObjectBehaviuor;
import Common.Database.Tables.FKDataBehaviour;
import Common.Database.Tables.iDBTable;
import Common.Utils.Utils_;
import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountJson;
import _VisualDVM.ComponentsServer.Recipient.Json.UserAccountsJson;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountsForm;
import javax.swing.*;
import java.util.LinkedHashMap;
import java.util.Vector;
public class UserAccountsDBTable extends iDBTable<UserAccount> {
public UserAccountsDBTable() {
super(UserAccount.class);
}
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()) {
if (userAccount.email.equals(email_in))
return userAccount;
}
return null;
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new UserAccountsForm(this, mountPanel);
}
@Override
public String getSingleDescription() {
return "учётная запись";
}
@Override
public String getPluralDescription() {
return "учётные записи";
}
@Override
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
//-
res.put(SubscriberWorkspace.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
return res;
}
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)) {
active.add(userAccount.email);
res.values.add(new UserAccountJson(userAccount.email, userAccount.name));
}
}
return Utils_.gson.toJson(res);
}
public Vector<String> getActiveMails() {
Vector<String> res = new Vector<>();
for (UserAccount account : Data.values()) {
if ((account.subscribe_active != 0) && !res.contains(account.email))
res.add(account.email);
}
return res;
}
}

View File

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

View File

@@ -3,8 +3,11 @@ import Common.Utils.Vector_;
import java.util.Vector; import java.util.Vector;
public class Constants { public class Constants {
public static final int planner_version = 4; public static final int version = 1253;
public static final int testingMaxKernels = 64; //вообще говоря, это параметр машины. public static final int planner_version = 24;
public static final int testingMaxKernels = 64;
//--
public static final String ApplicationFileName = "VisualSapfor.jar";
//-- //--
public static final String ComponentsDirectoryName = "Components"; public static final String ComponentsDirectoryName = "Components";
public static final String DataDirectoryName = "Data"; public static final String DataDirectoryName = "Data";
@@ -21,12 +24,12 @@ public class Constants {
public static final String TestsDirectoryName = "Tests"; public static final String TestsDirectoryName = "Tests";
public static final String DVMPackagesDirectoryName = "DVMPackages"; public static final String DVMPackagesDirectoryName = "DVMPackages";
public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer"; public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer";
public static final String KeyDirectoryName = "Keys";
//-- //--
//SVN vmk-post@yandex.ru //GIT
public static final String REPOSITORY_AUTHENTICATION = "--username dvmhuser --password dvmh2013 --non-interactive"; public static final String DVM_TESTS_REPOSITORY = "https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm-auto-test";
public static final String DVM_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/dvm"; public static final String SAPFOR_REPOSITORY = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR.git";
public static final String SAPFOR_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/sapfor"; public static final String SAPFOR_VERSION_URL = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR/raw/branch/master/src/Utils/version.h";
public static final String SAPFOR_REPOSITORY_BIN = "/sapfor/experts/Sapfor_2017/_bin";
//-вывод задач //-вывод задач
public final static String parse_out_file = "parse_out.txt"; public final static String parse_out_file = "parse_out.txt";
public final static String parse_err_file = "parse_err.txt"; public final static String parse_err_file = "parse_err.txt";
@@ -42,15 +45,20 @@ public class Constants {
public static final String SMTPHost = "smtp.mail.ru"; public static final String SMTPHost = "smtp.mail.ru";
public static final int SMTPPort = 465; public static final int SMTPPort = 465;
public static final int MailSocketPort = 465; public static final int MailSocketPort = 465;
//
//7998 отладочный порт. теперь.
public static final int ComponentsServerPort = 7995; //7795
public static final int TestingServerPort = 7996; //7996
public static final int SocketTimeout = 0;
//- //-
public static final String ServerAddress = "alex-freenas.ddns.net"; public static final String ServerAddress = "alex-freenas.ddns.net";
public static final String ServerUserName = "testuser"; public static final String ServerUserName = "testuser";
public static final int ServerUserSHHPort = 23; public static final int ServerUserSHHPort = 2000;
//-- //--
public static final String package_json = "package_json"; public static final String package_json = "package_json";
public static final String results_json = "results_json"; public static final String results_json = "results_json";
//-- //--
public static final int parser_group = -1; public static final int parser_group = 6000;
public static final int compiler_group = -2; public static final int compiler_group = -2;
// DBProjectFile // DBProjectFile
public static final String no_data = "Нет данных"; public static final String no_data = "Нет данных";
@@ -69,7 +77,9 @@ public class Constants {
public static final String unknown_metric = ""; public static final String unknown_metric = "";
public static final String tests_db_name = "tests2027"; public static final String tests_db_name = "tests2027";
public static final String dateNaN = "NaN"; public static final String dateNaN = "NaN";
//------ //--
public static final String pause = "pause";
//--
public static final String[] crushed_cases = new String[]{ public static final String[] crushed_cases = new String[]{
"rts err", "rts err",
"rts stack trace", "rts stack trace",
@@ -87,6 +97,7 @@ public class Constants {
"killed by signal", "killed by signal",
"bad termination" "bad termination"
}; };
public final static String separator = "----------------------------------";
//------------------------------------------------------- //-------------------------------------------------------
public static String[] resourses_names = new String[]{ public static String[] resourses_names = new String[]{
//-- //--
@@ -458,7 +469,7 @@ public class Constants {
}; };
public static Vector<String> admins_mails = new Vector_<>( public static Vector<String> admins_mails = new Vector_<>(
"sapfor.tracker@internet.ru", "sapfor.tracker@internet.ru",
"vmk-post@yandex.ru", "vmk-post@yandex.ru"
"79854210702@ya.ru" , "79854210702@ya.ru"
); );
} }

View File

@@ -2,14 +2,14 @@ package _VisualDVM;
import Common.Utils.Loggable; import Common.Utils.Loggable;
import Common.Utils.Utils_; import Common.Utils.Utils_;
import Common.Visual.UI; import Common.Visual.UI;
import _VisualDVM.ComponentsServer.Component.ComponentsSet;
import _VisualDVM.ComponentsServer.Component.PerformanceAnalyzer.PerformanceAnalyzer;
import _VisualDVM.ComponentsServer.Component.Sapfor.MessagesServer;
import _VisualDVM.ComponentsServer.Component.Visualiser;
import _VisualDVM.ComponentsServer.Component.Visualizer_2;
import _VisualDVM.ComponentsServer.ComponentsServer;
import _VisualDVM.Passes.PassCode; import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.ProjectView; import _VisualDVM.ProjectData.ProjectView;
import _VisualDVM.Repository.Component.ComponentsSet;
import _VisualDVM.Repository.Component.PerformanceAnalyzer.PerformanceAnalyzer;
import _VisualDVM.Repository.Component.Sapfor.MessagesServer;
import _VisualDVM.Repository.Component.Visualiser;
import _VisualDVM.Repository.Component.Visualizer_2;
import _VisualDVM.Repository.Server.ComponentsServer;
import _VisualDVM.TestingSystem.Common.TestingServer; import _VisualDVM.TestingSystem.Common.TestingServer;
import _VisualDVM.TestingSystem.DVM.RemoteDVMTestingPlanner; import _VisualDVM.TestingSystem.DVM.RemoteDVMTestingPlanner;
import _VisualDVM.TestingSystem.SAPFOR.PackageModeSupervisor; import _VisualDVM.TestingSystem.SAPFOR.PackageModeSupervisor;
@@ -19,12 +19,12 @@ import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
import java.io.File; import java.io.File;
import java.nio.file.Paths; import java.nio.file.Paths;
public class Global { public class Global {
//todo свести большинство к содержимому mainModule, сделать различные типы properties, переместить туда глобальный журнал (?) //todo свести большинство к содержимому mainModule
public static MainModule mainModule = null; public static MainModule mainModule = null;
//Режим //Режим
public static Mode mode = Mode.Undefined; public static Mode mode = Mode.Undefined;
//-------------------------------------------------- //setAdminRights-------------
public static VisualDVMProperties properties= null; public static VisualDVMProperties properties = null;
public static NormalProperties normalProperties = null; public static NormalProperties normalProperties = null;
public static ComponentsServerProperties componentsServerProperties = null; public static ComponentsServerProperties componentsServerProperties = null;
public static TestingServerProperties testingServerProperties = null; public static TestingServerProperties testingServerProperties = null;
@@ -35,9 +35,10 @@ public class Global {
public static ComponentsSet components = null; public static ComponentsSet components = null;
public static MessagesServer messagesServer = null; public static MessagesServer messagesServer = null;
public static File ComponentsDirectory; public static File ComponentsDirectory;
public static File KeysDirectory;
public static File DataDirectory; public static File DataDirectory;
public static File BugReportsDirectory; public static File BugReportsDirectory;
public static File BackUpsDirectory; public static File BackUpsDirectory; //бекапы компонентов на локальной машине.
public static File TempDirectory; public static File TempDirectory;
public static File ProjectsDirectory; public static File ProjectsDirectory;
public static File CompilationTasksDirectory; public static File CompilationTasksDirectory;
@@ -46,7 +47,7 @@ public class Global {
public static File RepoDirectory; public static File RepoDirectory;
public static File TestsDirectory; public static File TestsDirectory;
public static File PerformanceAnalyzerDirectory; public static File PerformanceAnalyzerDirectory;
public static File DataBackUpsDirectory; public static File DataBackUpsDirectory; //бекапы данных сервера.
public static File DVMPackagesDirectory; public static File DVMPackagesDirectory;
public static File SapforsDirectory; public static File SapforsDirectory;
public static File SapforPackagesDirectory; public static File SapforPackagesDirectory;
@@ -59,8 +60,8 @@ public class Global {
public static Visualiser visualiser = null; public static Visualiser visualiser = null;
public static Visualizer_2 visualizer_2 = null; public static Visualizer_2 visualizer_2 = null;
public static void CheckVisualiserDirectories() { public static void CheckVisualiserDirectories() {
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName)); Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName)); Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
//- //-
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName)); Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
@@ -73,30 +74,33 @@ public class Global {
Utils_.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName)); Utils_.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName));
Utils_.CheckDirectory(PerformanceAnalyzerDirectory = new File(Utils_.getHomeDirectory(), Constants.PerformanceAnalyzerDirectoryName)); Utils_.CheckDirectory(PerformanceAnalyzerDirectory = new File(Utils_.getHomeDirectory(), Constants.PerformanceAnalyzerDirectoryName));
Utils_.CheckDirectory(DVMPackagesDirectory = new File(Utils_.getHomeDirectory(), Constants.DVMPackagesDirectoryName)); Utils_.CheckDirectory(DVMPackagesDirectory = new File(Utils_.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
//через пару версий заменить на clean.
Utils_.CheckDirectory(SapforPackagesDirectory = new File(Utils_.getHomeDirectory(), "SapforPackages")); Utils_.CheckDirectory(SapforPackagesDirectory = new File(Utils_.getHomeDirectory(), "SapforPackages"));
Utils_.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines")); Utils_.CheckDirectory(KeysDirectory = new File(Utils_.getHomeDirectory(), Constants.KeyDirectoryName));
try {
Utils_.forceDeleteWithCheck(new File(DataDirectory, "credentials.sqlite"));
} catch (Exception ex) {
ex.printStackTrace();
}
} }
public static void CheckServerDirectories() { public static void CheckServerDirectories() {
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName)); Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName)); Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
//-
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
Utils_.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName)); Utils_.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
Utils_.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines")); //--
Utils_.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
Utils_.CheckDirectory(KeysDirectory = new File(Utils_.getHomeDirectory(), Constants.KeyDirectoryName));
} }
public static void CheckTestingSystemDirectories() { public static void CheckTestingSystemDirectories() {
Utils_.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName)); Utils_.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName)); Utils_.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
Utils_.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
//- //-
Utils_.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName)); Utils_.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName));
Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName)); Utils_.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
Utils_.CheckDirectory(DVMPackagesDirectory = new File(Utils_.getHomeDirectory(), Constants.DVMPackagesDirectoryName)); Utils_.CheckDirectory(DVMPackagesDirectory = new File(Utils_.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
Utils_.CheckDirectory(SapforsDirectory = new File(Utils_.getHomeDirectory(), "Sapfors")); Utils_.CheckDirectory(SapforsDirectory = new File(Utils_.getHomeDirectory(), "Sapfors"));
Utils_.CheckDirectory(SapforPackagesDirectory = new File(Utils_.getHomeDirectory(), "SapforPackages")); Utils_.CheckDirectory(SapforPackagesDirectory = new File(Utils_.getHomeDirectory(), "SapforPackages"));
//CheclAndClean через неделю
Utils_.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines")); Utils_.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines"));
} }
public static void CreateLogAtComponentsPath() { public static void CreateLogAtComponentsPath() {
@@ -131,6 +135,8 @@ public class Global {
mainModule.DeactivateDB(); mainModule.DeactivateDB();
if (componentsServer.db != null) if (componentsServer.db != null)
componentsServer.db.Disconnect(); componentsServer.db.Disconnect();
if (componentsServer.credentials_db != null)
componentsServer.credentials_db.Disconnect();
if (testingServer.db != null) if (testingServer.db != null)
testingServer.db.Disconnect(); testingServer.db.Disconnect();
if (visualizer_2 != null) if (visualizer_2 != null)
@@ -152,13 +158,17 @@ public class Global {
public static void NormalMode(int port) throws Exception { public static void NormalMode(int port) throws Exception {
//-------------------------------->> //-------------------------------->>
mainModule = new MainModule(); mainModule = new MainModule();
System.out.println("main module initialization..");
mainModule.Init(); mainModule.Init();
System.out.println("DONE");
//-- //--
CheckVisualiserDirectories(); CheckVisualiserDirectories();
CreateLogAtComponentsPath(); CreateLogAtComponentsPath();
//- //-
System.out.println("connection to visualiser_2..");
visualizer_2 = new Visualizer_2(port); visualizer_2 = new Visualizer_2(port);
visualizer_2.Connect(); visualizer_2.Connect();
System.out.println("DONE");
visualizer_2.refreshPid(); visualizer_2.refreshPid();
//если делать раньше, то не удастся убить сервер. //если делать раньше, то не удастся убить сервер.
if (Utils_.ContainsCyrillic(Utils_.getHomePath())) { if (Utils_.ContainsCyrillic(Utils_.getHomePath())) {
@@ -167,18 +177,27 @@ public class Global {
"Визуализатор завершает работу."); // "Визуализатор завершает работу."); //
FinishApplication(); FinishApplication();
} }
System.out.println("messages server starting..");
messagesServer = new MessagesServer(); messagesServer = new MessagesServer();
messagesServer.Start(); messagesServer.Start();
System.out.println("DONE");
components = new ComponentsSet(); components = new ComponentsSet();
System.out.println("component initial versions checking..");
components.initialVersionsCheck(); components.initialVersionsCheck();
//-------->> System.out.println("DONE");
if (normalProperties.AutoUpdateSearch) System.out.println("geting component actual versions..");
Global.mainModule.getPass(PassCode.GetComponentsActualVersions).Do(); Global.mainModule.getPass(PassCode.GetComponentsActualVersions).Do();
System.out.println("DONE");
System.out.println("validation component actual versions..");
components.validateStates(); components.validateStates();
System.out.println("DONE");
if (components.needChanges()) { if (components.needChanges()) {
System.out.println("components need changes!!");
boolean flag = true; boolean flag = true;
do { do {
System.out.println("Show components window...");
Global.mainModule.getUI().getComponentsWindow().ShowDialog(""); Global.mainModule.getUI().getComponentsWindow().ShowDialog("");
System.out.println("DONE");
if (flag = (!components.validateStates())) { if (flag = (!components.validateStates())) {
if (!UI.Question("Обнаружены некорректные компоненты.Работа визуализатора невозможна.\n" + if (!UI.Question("Обнаружены некорректные компоненты.Работа визуализатора невозможна.\n" +
"Вернуться к окну компонент" "Вернуться к окну компонент"
@@ -198,16 +217,9 @@ public class Global {
// FoldParserManager.get().addFoldParserMapping("text/FortranSPF", new FortranFolder()); блоки кода. todo // FoldParserManager.get().addFoldParserMapping("text/FortranSPF", new FortranFolder()); блоки кода. todo
//light_editor.xml-------->> //light_editor.xml-------->>
mainModule.ActivateDB(); mainModule.ActivateDB();
/* // https://habr.com/ru/articles/446888/ сертификат?
mainModule.set(Current.Account, new Account() { if (Global.normalProperties.OfferRegistrationOnStart)
{ mainModule.getPass(PassCode.CheckAccount).Do();
name = "M";
email = "vmk-post@yandex.ru";
role = AccountRole.Admin;
}
});
*/
mainModule.getPass(PassCode.CheckAccount).Do();
//--------------- //---------------
componentsServer.ActivateDB(); componentsServer.ActivateDB();
testingServer.ActivateDB(); testingServer.ActivateDB();
@@ -216,13 +228,14 @@ public class Global {
Global.mainModule.getPass(PassCode.SynchronizeBugReports).Do(); Global.mainModule.getPass(PassCode.SynchronizeBugReports).Do();
if (normalProperties.AutoTestsLoad) if (normalProperties.AutoTestsLoad)
Global.mainModule.getPass(PassCode.SynchronizeTests).Do(); Global.mainModule.getPass(PassCode.SynchronizeTests).Do();
Global.mainModule.getPass(PassCode.SynchronizeCredentials).Do();
//-- //--
Global.mainModule.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет. Global.mainModule.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.
Global.mainModule.getUI().getMainWindow().Show(); Global.mainModule.getUI().getMainWindow().Show();
} }
public static void ServerMode() throws Exception { public static void ServerMode() throws Exception {
CheckServerDirectories(); CheckServerDirectories();
CreateLogAtComponentsPath(); CreateLogAtHome();
componentsServer = new ComponentsServer(); componentsServer = new ComponentsServer();
componentsServer.ActivateDB(); componentsServer.ActivateDB();
componentsServer.Start(); componentsServer.Start();
@@ -230,7 +243,7 @@ public class Global {
} }
public static void TestingSystemMode() throws Exception { public static void TestingSystemMode() throws Exception {
CheckTestingSystemDirectories(); CheckTestingSystemDirectories();
CreateLogAtComponentsPath(); CreateLogAtHome();
testingServer = new TestingServer(); testingServer = new TestingServer();
testingServer.ActivateDB(); testingServer.ActivateDB();
testingServer.Start(); testingServer.Start();
@@ -253,17 +266,17 @@ public class Global {
File propertiesFile = new File(System.getProperty("user.dir"), "properties"); File propertiesFile = new File(System.getProperty("user.dir"), "properties");
if (!propertiesFile.exists()) { if (!propertiesFile.exists()) {
mode = Mode.Normal; mode = Mode.Normal;
properties=normalProperties = Utils_.SynschronizeProperties(propertiesFile, NormalProperties.class); properties = normalProperties = Utils_.SynschronizeProperties(propertiesFile, NormalProperties.class);
} else { } else {
properties = Utils_.jsonFromFile(propertiesFile, VisualDVMProperties.class); properties = Utils_.jsonFromFile(propertiesFile, VisualDVMProperties.class);
mode = properties.Mode; mode = properties.Mode;
//--->> //--->>
switch (mode){ switch (mode) {
case Normal: case Normal:
normalProperties = Utils_.SynschronizeProperties(propertiesFile, NormalProperties.class); normalProperties = Utils_.SynschronizeProperties(propertiesFile, NormalProperties.class);
break; break;
case Server: case Server:
componentsServerProperties = Utils_.SynschronizeProperties(propertiesFile, ComponentsServerProperties.class); componentsServerProperties = Utils_.SynschronizeProperties(propertiesFile, ComponentsServerProperties.class);
break; break;
case Testing: case Testing:
testingServerProperties = Utils_.SynschronizeProperties(propertiesFile, TestingServerProperties.class); testingServerProperties = Utils_.SynschronizeProperties(propertiesFile, TestingServerProperties.class);
@@ -280,6 +293,10 @@ public class Global {
public static void Init(String... args) { public static void Init(String... args) {
System.out.println("VisualSapfor.jar started.."); System.out.println("VisualSapfor.jar started..");
System.out.println("home directory is" + Utils_.Brackets(Utils_.getHomePath())); System.out.println("home directory is" + Utils_.Brackets(Utils_.getHomePath()));
System.out.println("args size = " + args.length);
for (int i = 0; i < args.length; ++i)
System.out.println("args[" + i + "]=" + Utils_.DQuotes(args[i]));
System.out.println("====");
//---> //--->
try { try {
SynchronizeProperties(); SynchronizeProperties();

View File

@@ -1,19 +0,0 @@
package _VisualDVM.GlobalData.Account;
public enum AccountSubscribeState {
Undefined,
None,
Active;
public String getDescription() {
switch (this) {
case Undefined:
return "Подписка: нет данных";
case None:
return "Подписка: аннулирована";
case Active:
return "Подписка: активна";
default:
break;
}
return "";
}
}

View File

@@ -1,7 +0,0 @@
package _VisualDVM.GlobalData.Account;
import Common.Database.Tables.DBTable;
public class AccountsDBTable extends DBTable<Integer, Account> {
public AccountsDBTable() {
super(Integer.class, Account.class);
}
}

View File

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

View File

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

View File

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

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