Compare commits
840 Commits
4318d6756f
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| c3a669d497 | |||
| 9b76409781 | |||
| ed3d133dcd | |||
| f2644392ad | |||
| 641ce80102 | |||
| 7924212fed | |||
| 3090e80f72 | |||
| b418066932 | |||
| f5eaf3df25 | |||
| bf5a648582 | |||
| 114e2ac4ad | |||
| b5e3a2c011 | |||
| b8d10a1434 | |||
| 46cdd480bc | |||
| 93396a00b1 | |||
| eeb57ab7c2 | |||
| e53f0ed939 | |||
| 9eede4802e | |||
| 688f36c4c3 | |||
| c270429c66 | |||
| 6135b738ba | |||
| 41ce6527d5 | |||
| cba4425cd7 | |||
| 0cb4022969 | |||
| 0ec1ce09da | |||
| ef92651552 | |||
| d8178fa704 | |||
| c148f62198 | |||
| e1291446c8 | |||
| 1f4b736188 | |||
| 47a4772632 | |||
| 571e2d2544 | |||
| 62a45fd8be | |||
| 6e0956e3e5 | |||
| b46f86bebb | |||
| d2c2f571ff | |||
| 70771dd0ce | |||
| b37e20e4a4 | |||
| e8c748eb7e | |||
| da4e8b07bc | |||
| 611194be8c | |||
| a0c45a2df0 | |||
| 8d236c99b8 | |||
| ccf20c354b | |||
| 28eee09056 | |||
| cb1f19cfb7 | |||
| 74f9a68ceb | |||
| 9303839e8e | |||
| dc17b7d741 | |||
| eb86b936bc | |||
| cd86f1257a | |||
| 46e1bd17f1 | |||
| 7efe852bc1 | |||
| 829cd0c770 | |||
| 6faf06f949 | |||
| 73a39681f1 | |||
| 4c5331de55 | |||
| 411e97abb8 | |||
| fd21de489e | |||
| aac4221a4d | |||
| f1a1ce0436 | |||
| 419af0766e | |||
| 98ec37233a | |||
| 32e1e68d9a | |||
| 68cf40367a | |||
| c6d2452530 | |||
| 76c710b1bc | |||
| 029947c793 | |||
| 38f39411ad | |||
| cb7b5809f1 | |||
| ddf04c6f39 | |||
| 48290ccf97 | |||
| e706b52b53 | |||
| c8045a5db1 | |||
| 5ef516d019 | |||
| 4f5a091af7 | |||
| cc21931ebe | |||
| 18227f565a | |||
| ef5bd5b1a8 | |||
| 41b98607cd | |||
| 7178ecbc9c | |||
| dcdbaa83cf | |||
| 86b582dd1f | |||
| c7a618dd25 | |||
| fb296a02ee | |||
| 19afec4d25 | |||
| 1ae4d1980a | |||
| 919e7a2e10 | |||
| fef75270a7 | |||
| 2a30a42e77 | |||
| b900622e4e | |||
| a47a6705d8 | |||
| 809b1f8d14 | |||
| 23b143f916 | |||
| 7ef9ee0d5c | |||
| a60ed8f661 | |||
| 74ae6abf50 | |||
| b4d0a62d6c | |||
| 535053baca | |||
| af644f8f04 | |||
| dae9d58d82 | |||
| 4f50c4a559 | |||
| fcebae094f | |||
| abab3f067c | |||
| 167ceb42a5 | |||
| cf9b028400 | |||
| b763c2c266 | |||
| 811acba5a7 | |||
| bc1faa1a06 | |||
| f6cc447481 | |||
| 10c213feae | |||
| 74146fae4c | |||
| df204b64a7 | |||
| 2d0d69fd7a | |||
| 637e9c5c0f | |||
| 78ee5bc428 | |||
| 0b5f8c6ec7 | |||
| 3f4ef5f198 | |||
| afaaaba1e7 | |||
| 21a41987b4 | |||
| 933638afb8 | |||
| b6b7bb3ae5 | |||
| 6a3be45b1a | |||
| 55aa66fa18 | |||
| 2ab2a79d8d | |||
| c8d597e9cd | |||
| 9a5b84c068 | |||
| 174bc344a4 | |||
| e2b307d4f6 | |||
| a2017f9e01 | |||
| 9f4eb9d88e | |||
| 04cf5c1552 | |||
| c7626e877e | |||
|
|
cb7360ae86 | ||
| 8fc70d48ad | |||
| 4ce7190905 | |||
| dc68667b20 | |||
| 1d97048de1 | |||
| 91e40c4393 | |||
| a6e02172f8 | |||
| 8a6c9804b4 | |||
| 8aea85a009 | |||
| b1740da1f1 | |||
| 5653438b75 | |||
| c85661a264 | |||
| d2a333c7cb | |||
| f3747a359b | |||
| e123600e06 | |||
| c4157fc30b | |||
| e428d621ac | |||
| aa5bcc7df7 | |||
| dec4835187 | |||
| d66fdc5e77 | |||
| 670324837d | |||
| ab0e0af6b3 | |||
| b08242fed4 | |||
| 7b81a8bdd0 | |||
| 20aef1f340 | |||
| 39f5b99ade | |||
| e8d6764563 | |||
| 9c0f3215ad | |||
| b908ddc8f1 | |||
| 0b35c948ab | |||
| b79b33e232 | |||
| 0e2d2abb84 | |||
| fe78d89a58 | |||
| 7f9305f02b | |||
|
|
fca5bb42bd | ||
|
|
4ae8c2f664 | ||
|
|
683d5249eb | ||
|
|
278782a244 | ||
|
|
4288f83105 | ||
|
|
242719e7a7 | ||
| 4da5f4bc03 | |||
| cba10bef14 | |||
| 7728ddbf23 | |||
| d455c21b9c | |||
|
|
b8751d9b67 | ||
|
|
74f4be7027 | ||
| eb7c0ffbc5 | |||
| b4808bcd7c | |||
|
|
90b45fc806 | ||
|
|
9b02a5c9ea | ||
| e98127880b | |||
| 1ee8256885 | |||
| c9a013a17b | |||
| 6413f2340a | |||
| 3c9bc3f9b7 | |||
| d019beff5f | |||
| 4441864b6f | |||
| 33f3d615da | |||
| 61d8670416 | |||
| c551fdd2c9 | |||
| d7ea2f862e | |||
| d81abc226c | |||
| 2f4f841dcc | |||
| c83cfd9eff | |||
| f7973e0991 | |||
| 8701c8ba36 | |||
| 49f0a56c4f | |||
| ed61eb2ae0 | |||
| 25fc55c03e | |||
| a8244bf872 | |||
| daa53d9d73 | |||
| b445e3e879 | |||
| f1440dd1e2 | |||
| 4e3597ba7a | |||
| 7a9c70f396 | |||
| 8215388bc6 | |||
| 39595d849e | |||
| 024f274360 | |||
| 7eba13370d | |||
| 5046d84b86 | |||
| 073bbfd544 | |||
| 1b4b375f39 | |||
| 794097f81f | |||
| 9d11ebb653 | |||
| 0a123988b3 | |||
| 9c0ed53d52 | |||
| 77179789f5 | |||
| 68bd1ef6b4 | |||
| c76908ad58 | |||
| 209bb2455d | |||
| a86a5b1e6b | |||
| 05b49a842e | |||
| 6d9bd4bc9b | |||
| 245ed7c5f0 | |||
| f2b2acb49f | |||
| 36438e5b20 | |||
| 5e6719412d | |||
| 0bdc870a72 | |||
| 54ec1fee99 | |||
| 91f4ed4a17 | |||
| dd1f7f8040 | |||
| 016e51dbe5 | |||
| 90b6f3648e | |||
| 57baa6c9c1 | |||
| 74fcc2150d | |||
| b80bea4c1b | |||
| ede6438fbf | |||
| 62de67ccb7 | |||
| c69e7194bc | |||
| 25eabf6852 | |||
| 4ef8d4b52c | |||
| 0049409cdf | |||
| 7eecdf8f4d | |||
| bc750f8db0 | |||
| 75abb0ae46 | |||
| a27ab3acef | |||
| 950b47d145 | |||
| 2eca19cad4 | |||
| b8f1ad56ed | |||
| 7dd3069445 | |||
| 407294c6ae | |||
| 0c2b716368 | |||
| bd2e8643fd | |||
| dcdd392e95 | |||
| fa31d5570c | |||
| 16c307103f | |||
| 467c9b5b31 | |||
| 305b607c24 | |||
| 20e82075b7 | |||
| 6e0e51beff | |||
| 63b923e33b | |||
| 775526b5e3 | |||
| 82fbe8a751 | |||
| 19bcc13048 | |||
|
|
d5aabbace7 | ||
|
|
fa12c4b672 | ||
| de9f5ce5c7 | |||
| 905a31da1f | |||
|
|
68c21c6955 | ||
| e259a3c2a9 | |||
| c89e757171 | |||
| dd90100bfa | |||
| 13cda78d47 | |||
| a19a9759d3 | |||
| bcae6820af | |||
| 5841f5ca7d | |||
| d4c2875ed5 | |||
| b05e7ffaec | |||
| e18d605d5b | |||
| 7212dd7d31 | |||
| e1fc740321 | |||
| 7855ce62a4 | |||
| 281ec9bfc2 | |||
| fb98945b38 | |||
| b0941d6bfd | |||
| d35848478f | |||
| 87a761f5a6 | |||
| 353c0b2dbe | |||
| c2256a247b | |||
| 8696c7e66f | |||
| e15f2921ee | |||
| 0373e7b546 | |||
| ae2327347a | |||
| 505d151ee5 | |||
| 26434b21ab | |||
| 458e250b5c | |||
| aefbd50612 | |||
| 46f44f48b7 | |||
| e0f441d82a | |||
| 6911bc6cdb | |||
| ef5089443a | |||
| f7de2590b9 | |||
| f5e411c827 | |||
| 8c9835f8fd | |||
| 58312b9c3d | |||
| 94208ec25c | |||
| 6c0c103804 | |||
| 29176ebb4a | |||
| 18b4d58682 | |||
| 69151dd7a8 | |||
| 3d8ba57f4a | |||
| 9034636067 | |||
| 30fcf649c3 | |||
| 28fe6ee235 | |||
| 01da3b3a70 | |||
| 72e4fbdf31 | |||
| 095c0bad9a | |||
| 328a00063e | |||
| 96a269004d | |||
| 1b6db1fd5b | |||
| 6d7f885926 | |||
| 0f7b65f467 | |||
| 483089e954 | |||
| 63112eed7b | |||
| 3decbe5212 | |||
| 6e28bfa809 | |||
| d2c4794690 | |||
| 7a06c2ce2b | |||
| 8b2fb67422 | |||
| fe752d2073 | |||
| bbe99efefe | |||
| b48e2c995d | |||
| fc60b78784 | |||
| 0d3edd7e3f | |||
| 9c6198656f | |||
| 3de25ff12d | |||
| bd705813e9 | |||
| d495a5afb7 | |||
| fcc2bbaf04 | |||
| f3f6c52f81 | |||
| 0b7b793571 | |||
| 10a4ebfe43 | |||
| 9bc35c0ca6 | |||
| 368fcf4a8e | |||
| a38427a25a | |||
| 8536ba9d77 | |||
| 03b73e98f8 | |||
| 9c8abd7ee4 | |||
| dd674dce48 | |||
| 216b595450 | |||
| b76aa24ae4 | |||
| 01957b9fb3 | |||
| d559e9963d | |||
| 14f2e90d7a | |||
| 18414e5c80 | |||
| 3add52b2b7 | |||
| 784e4dbbca | |||
| f66790f67a | |||
| d5b6d9dd55 | |||
| 7e0332fad0 | |||
| a4b35c2258 | |||
| 025a04d0ed | |||
| 1259db5041 | |||
| 3dd7845d76 | |||
| 493b19c5e4 | |||
| b79002edcc | |||
| 910901f940 | |||
| de960b6a9b | |||
| b6d106aeb7 | |||
| ddd975a37f | |||
| 3e32e51e57 | |||
| e0fa7abeb4 | |||
| 901eb0f623 | |||
| cd0bae2620 | |||
| 62e734f725 | |||
| 2712b904b1 | |||
| c78c5d464d | |||
| 192e20be30 | |||
| 9daf69107a | |||
| 56981686e1 | |||
| ed37dd2107 | |||
| c3ce2fed96 | |||
| a79816082a | |||
| ffcad7a620 | |||
| 48d96d51d7 | |||
| 1d1618ae95 | |||
| d537cbe00d | |||
| 2490a783dd | |||
| f6ab578ce2 | |||
| f2de9054d0 | |||
| 9482abefcc | |||
| aa490e4181 | |||
| 36c11ac93f | |||
| f811d9b3ac | |||
| cee06af384 | |||
| c160a20d06 | |||
| bf5d5442d4 | |||
| 84c3813894 | |||
| 2fed433634 | |||
| 2edaffd634 | |||
| a0ceafff0a | |||
| a60fd375d0 | |||
| 38b2896e4a | |||
| 319e6575c8 | |||
| 54a52a1e6e | |||
| fc6282cd22 | |||
| b696af952f | |||
| 348b7602ff | |||
| 20044315fb | |||
| f1c0523753 | |||
| 6af0df7835 | |||
| 4999e1587f | |||
| 0b6f555099 | |||
| fda2940a79 | |||
| 99643aa755 | |||
| b40328f931 | |||
| f6da288ec5 | |||
| a042f24833 | |||
| 3f42f61c76 | |||
| 10422327ba | |||
| ffb719cbb5 | |||
| f13a9cda2e | |||
| dc53ecd6c8 | |||
| 96df1c3a18 | |||
| 4c2d39cb92 | |||
| c16948a9e4 | |||
| afea3e0233 | |||
| b871d2673b | |||
| 6b7ed74c60 | |||
| c9c8519a10 | |||
| 452c023f1d | |||
| debc1a6cae | |||
| 7b56eae371 | |||
| 3b5bffe998 | |||
| 2b9fc52c12 | |||
| d027036a99 | |||
| 66fa638ec4 | |||
| 01d366e256 | |||
| e34778d6be | |||
| 17c2644766 | |||
| 592ef14909 | |||
| c902dd0b91 | |||
| 5503751e07 | |||
| 307b83f8c9 | |||
| 9dc4922b89 | |||
| d01dab21b2 | |||
| 788bd67201 | |||
| cf660d26ea | |||
| 071aab5ea6 | |||
| b79474fdd1 | |||
| 5c432c0ea4 | |||
| 2fa413b1c6 | |||
| 7d789b22d3 | |||
| fae3ecc8b9 | |||
| f353c1b90c | |||
| 01041ccf75 | |||
| f181f5ab1d | |||
| f44ccf7893 | |||
| 5e2a9848da | |||
| b7b82e54c6 | |||
| e4d907e4a3 | |||
| 2999390b91 | |||
| 1f6cc4a579 | |||
| 7f1d21a067 | |||
| 84acf05c19 | |||
| bdbd49fa6d | |||
| 45447f34f8 | |||
| 702529147d | |||
| 066ebfaa71 | |||
| 5e09fb44ea | |||
| 8eef367bd4 | |||
| e64a4f4c47 | |||
| e1627badd3 | |||
| e265a2a3b6 | |||
| f5538bc220 | |||
| 24631268af | |||
| 452c4c7268 | |||
| 3a29898d5f | |||
| e4422bf2c8 | |||
| 334a8de3bf | |||
| 69173eb2b8 | |||
| 031ae09a4b | |||
| 9669eb61d2 | |||
| b37d52496e | |||
| 4e86871571 | |||
| 6afa2dc892 | |||
| 09b64218bd | |||
| c826b4a4bd | |||
| f317ab1aa1 | |||
| a11b7711f7 | |||
| cde3e1da42 | |||
| 23891a0489 | |||
| 61f6c63e0b | |||
| d1ffab1e70 | |||
| eb278676cc | |||
| 428a056586 | |||
| 6252af944e | |||
| 54c80c516b | |||
| 90b5abb70f | |||
| 63b7f7dfd2 | |||
| e5f4ee40aa | |||
| 91f73cbfa0 | |||
| 07436988cf | |||
| 42675d55d8 | |||
| 31c0cad38f | |||
| e0974fe4a8 | |||
| 90546fc62e | |||
| cba2c8ec34 | |||
| e7939713e7 | |||
| 18ceb04325 | |||
| d0c08a2c7e | |||
| 3516b58127 | |||
| 17c0bf7eb3 | |||
| 7fac84740d | |||
| e7f661f7ad | |||
| 6537eebe09 | |||
| c431745ad4 | |||
| 4b05d4f4f2 | |||
| 61fc37b574 | |||
| 6b1576461d | |||
| c211ffb82b | |||
| 4ad0a32238 | |||
| 76b6a36de6 | |||
| c077af6824 | |||
| 8ebb5d8989 | |||
| d18eb3327e | |||
| b89283fc91 | |||
| 4547fd10bd | |||
| 30b51180c4 | |||
| 1be569e294 | |||
| 45fcf9b585 | |||
| 679e46499e | |||
| bb671c5166 | |||
| 33e6abfbf5 | |||
| 797f232347 | |||
| 00b4250ce0 | |||
| 39dbf5f146 | |||
| a420ddbc9d | |||
| 12c4eaf33d | |||
| ae379ea196 | |||
| 3863b31328 | |||
| 25cd097445 | |||
| 54d86d6e4d | |||
| 660a410a05 | |||
| 00136fa9d9 | |||
| a767fc265a | |||
| c469a38709 | |||
| cd28ce025d | |||
| 0cef474233 | |||
| f55a3a6324 | |||
| 96c9c27191 | |||
| 55a724a511 | |||
| df9fb2e2a2 | |||
| 7bd4600a25 | |||
| 3e55bdec38 | |||
| d4d8d255fb | |||
| 7ea64c49d1 | |||
| 1e782daa3d | |||
| 222163c557 | |||
| 91a509b3de | |||
| 756c2d214f | |||
| 3201742848 | |||
| 4da2187f42 | |||
| 151572fd82 | |||
| 958ccbc9ab | |||
| 5e35c493cf | |||
| 39e9c634a2 | |||
| de1d81ac33 | |||
| 077bfe9676 | |||
| 80e3537fb0 | |||
| 5057db453f | |||
| 0fe33b21ee | |||
| 905e1646e4 | |||
| 9dd52b37c2 | |||
| 53ad5e637f | |||
| 3374c9783b | |||
| 87ed3bd003 | |||
| 12f58bdde2 | |||
| 07c479ad2b | |||
| ba6257cd36 | |||
| 2983d5c579 | |||
| edb6714ea8 | |||
| 8de3474fa4 | |||
| d6bad4d45e | |||
| e860e7968f | |||
| fa04452d3d | |||
| 50c3914228 | |||
| d51fb1a23e | |||
| 0ae5327fb4 | |||
| fb53a4133a | |||
| d29c2ba93c | |||
| 264fc3b955 | |||
| 630d6b3985 | |||
| 8a4371fc86 | |||
| 468bfc027d | |||
| 387b43c771 | |||
| 12fddbdc95 | |||
| b39de4ad14 | |||
| 15a2f83275 | |||
| 002a8517e0 | |||
| c84a648bb6 | |||
| cf81637812 | |||
| 3821e3b164 | |||
| 71f746c3b3 | |||
| 756863ab80 | |||
| 92ceb84898 | |||
| b17e23a93a | |||
| 4d629df46f | |||
| 830aa1a948 | |||
| c6e5036b9c | |||
| 4d543cb94f | |||
| f2d0eb0d2c | |||
| 291c804fc7 | |||
| cefbd875c8 | |||
| 5f7b600c6d | |||
| d7b559fd21 | |||
| 9bd90c7a4a | |||
| 56f97584ef | |||
| 5d09ae430c | |||
| 97a26f7a0e | |||
| 493941edab | |||
| 0fb9412d24 | |||
| e4fe527365 | |||
|
|
5903c72051 | ||
|
|
cacae8041a | ||
| 3d70efe253 | |||
| 4e503d3b9b | |||
| 09afe82704 | |||
| 8b9400fb95 | |||
| 002867274f | |||
| c40d6fbbfc | |||
| 48f7845564 | |||
| 95cd91bbca | |||
| 9687dc9f29 | |||
| a5ffce7c08 | |||
| cad6ea8d3b | |||
| 79085ad5f8 | |||
| bd5ebdf53c | |||
| 3f49abc35a | |||
| fe03fd6b47 | |||
| aaddd55152 | |||
| e83ecac005 | |||
| 784bca869d | |||
| 40feda7c5e | |||
| 9f1777431c | |||
| b6b6e2e642 | |||
| dd0570f281 | |||
| 082753b366 | |||
| a707ceaabd | |||
| 34df30fcd5 | |||
| 7bfb980d69 | |||
| a39b8c3a13 | |||
| eaeaee869b | |||
| 05097bc22e | |||
| 2a2000147c | |||
| 4e611e4333 | |||
| 1b91cff318 | |||
| 431d23f427 | |||
| 0238cc1b3e | |||
| f52a062e86 | |||
| eeaf4d7217 | |||
| 8f38a616d5 | |||
| b792cf80b8 | |||
| e7c8810291 | |||
| 2b9cfc3af1 | |||
| da3f624cf2 | |||
| a4bca9c33b | |||
| 4136236d41 | |||
| 2f31f02eff | |||
| 70ad507313 | |||
| 121d91cf77 | |||
| e8f2e50257 | |||
| 3c43984fe4 | |||
| 6088854a54 | |||
| 2451129e0e | |||
| 34504f9992 | |||
| c34728f65d | |||
| e20ee062c6 | |||
| ba9fb8c0c2 | |||
| 27598fed85 | |||
| 75c196f611 | |||
| 848d95ee14 | |||
| 1c57e1821f | |||
| 00af17e823 | |||
| 0a2f2f05e1 | |||
| a85446b72d | |||
| 037518a085 | |||
| 0092b708d3 | |||
| 6a7feb96e7 | |||
| 11f82d2bb9 | |||
| a138f367a8 | |||
| cd2fefd099 | |||
| 0efd6ebb9b | |||
| 1bb3da18c3 | |||
| 0397346b0f | |||
| ea3fb6a0ba | |||
| fce61bf55a | |||
| 5baf2154e2 | |||
| b4184d9361 | |||
| bf1730cd77 | |||
| bc7059314d | |||
| 64073e8b15 | |||
| b21e25e932 | |||
| 7030e13238 | |||
| ce31d5dae2 | |||
| 05ec4871a1 | |||
| f604f94858 | |||
| 0370573269 | |||
| e5f3230c9c | |||
| 6eccd3364a | |||
| 44e37d01cf | |||
| d6246429f3 | |||
| 9e571d33a8 | |||
| 43d7c4da8b | |||
| f6fdea5c46 | |||
| 2ad0c85331 | |||
| 405b873f8e | |||
| 7684966849 | |||
| cf8c237fa3 | |||
| 2379f65803 | |||
| a399544b77 | |||
| ed8c1ee914 | |||
| 6378a04841 | |||
| 52ce1e78aa | |||
| dbc05900ba | |||
| 0adb5337d5 | |||
| 8a71c79650 | |||
| 76f68ae2ab | |||
| 8e7fa7d763 | |||
| fd34111d20 | |||
| 96b6d40136 | |||
| 8edb0ba16b | |||
| c228832c94 | |||
| 6f8e16602b | |||
| e85e194ae0 | |||
| ef65bb2439 | |||
| ed2222c163 | |||
| 86c6c4700e | |||
| 6011a2851c | |||
| eefbc25be0 | |||
| d9fca1fa72 | |||
| 3efeb28919 | |||
| 0c513cec5e | |||
| 94ff786ed6 | |||
| e69769713b | |||
| ad19ee2665 | |||
| 0c47c893a2 | |||
| 34c08e7d44 | |||
| b7b41ae59c | |||
| ac5757160e | |||
| b4b7a8e183 | |||
| 13c629f1b4 | |||
| 55e49ce3b7 | |||
| da74a8a699 | |||
| bd702b3ebc | |||
| 730ded1f4c | |||
| 57a98475d0 | |||
| 5a1f9b7f68 | |||
| bdf0f7f4eb | |||
| 54bab7f83d | |||
| fd76843aff | |||
| 106626eb9a | |||
| 204d4ceca0 | |||
| a8c8aa3212 | |||
| ff3e3003d4 | |||
| 1fc60e6c12 | |||
| c07b72eb5d | |||
| 749c0397e6 | |||
| 91c494e9f8 | |||
| f700154394 | |||
| 953ff522d5 | |||
| 12e963ca1b | |||
| cb74d629b7 | |||
| 99cdca1ebb | |||
| 4f003b8317 | |||
| d064daa90c | |||
|
|
f86fca6169 | ||
|
|
9bd5dc03f9 | ||
| 127aec5a1d | |||
| fce85afc71 | |||
| dbd8d416f9 | |||
| b76ac2a0b2 | |||
| c4b6db5011 | |||
| 2b169392e6 | |||
| 7dc687e0c6 | |||
| 8147381d4f | |||
| 827981a591 | |||
| 01468da72e | |||
| c491e805c9 | |||
| 033d33dce0 | |||
| f86e4d8109 | |||
| be7176fe11 | |||
| fc20f95457 | |||
| 25d5c4b7f0 | |||
| 9c6d5d57e1 | |||
| ca941814ec | |||
| b9f27bf51f | |||
| bf88dd2eae | |||
| 5ed803cda0 | |||
| 2044ff4320 | |||
| 540c041408 | |||
| 9b46d395df | |||
| def13d2e5e | |||
| e1da90d705 | |||
| 3e5859284f | |||
| 0f74b3168e | |||
| 469330a7ed | |||
| 6b115c7296 | |||
| 2a209bc94e | |||
| 2b52763c02 | |||
| 9beadaf95c | |||
| be4985be2d | |||
| 1e45d4d4d7 | |||
| 5e229fcb68 | |||
| 3794b2a330 | |||
| bba4d403d7 | |||
| 0bd2d3fe36 | |||
| 79cf5bc0da | |||
| 15a179d8e9 | |||
| a6a29e913a | |||
| f6bf044060 | |||
| c1d3d9208e | |||
| c21c7c2e10 | |||
| 5f076f14f4 | |||
| 11fae0bc4e | |||
| 3f9ba0feb3 | |||
| 7b28d1a84d | |||
| c37f3d9e70 | |||
| 163552d74f | |||
| 1f8ebdc9a2 | |||
| 39ee78da3d | |||
| 12a6a1f076 | |||
| 2b0f534f5d | |||
| 7ac88bc689 | |||
| db82187212 | |||
| 91331ae441 | |||
| b1e51ce599 |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -36,9 +36,12 @@ BackUps/*
|
|||||||
*.ilk
|
*.ilk
|
||||||
Bugs/*
|
Bugs/*
|
||||||
Archives/*
|
Archives/*
|
||||||
|
Downloads/*
|
||||||
Temp/*
|
Temp/*
|
||||||
Projects/*
|
Projects/*
|
||||||
CompilationTasks/*
|
CompilationTasks/*
|
||||||
|
Packages/*
|
||||||
|
DVMPackages/*
|
||||||
SapforPackages/*
|
SapforPackages/*
|
||||||
User/*
|
User/*
|
||||||
RunTasks/*
|
RunTasks/*
|
||||||
@@ -46,5 +49,5 @@ Makefiles/*
|
|||||||
Repo/*
|
Repo/*
|
||||||
Sts/*
|
Sts/*
|
||||||
Tests/*
|
Tests/*
|
||||||
debug.log
|
Keys/*
|
||||||
properties
|
debug.log
|
||||||
13
.idea/artifacts/VisualSapfor_jar.xml
generated
13
.idea/artifacts/VisualSapfor_jar.xml
generated
@@ -11,6 +11,19 @@
|
|||||||
<element id="extracted-dir" path="$PROJECT_DIR$/libs/mxgraphx-all-4.2.0.jar" path-in-jar="/" />
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/mxgraphx-all-4.2.0.jar" path-in-jar="/" />
|
||||||
<element id="extracted-dir" path="$PROJECT_DIR$/libs/gson-2.8.1.jar" path-in-jar="/" />
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/gson-2.8.1.jar" path-in-jar="/" />
|
||||||
<element id="extracted-dir" path="$PROJECT_DIR$/libs/commons-io-2.5.jar" path-in-jar="/" />
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/commons-io-2.5.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/poi-3.12-20150511.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/poi-examples-3.12-20150511.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/poi-excelant-3.12-20150511.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/poi-ooxml-3.12-20150511.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/poi-ooxml-schemas-3.12-20150511.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/poi-scratchpad-3.12-20150511.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/commons-codec-1.9.jar" path-in-jar="/" />
|
||||||
|
<element id="extracted-dir" path="$PROJECT_DIR$/libs/commons-logging-1.1.3.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/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
9
.idea/libraries/commons_lang_2_6_0.xml
generated
Normal 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>
|
||||||
49
.idea/workspace.xml
generated
49
.idea/workspace.xml
generated
@@ -6,7 +6,9 @@
|
|||||||
</artifacts-to-build>
|
</artifacts-to-build>
|
||||||
</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/Passes/All/SPF_InsertIncludesPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" afterDir="false" />
|
||||||
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
@@ -26,8 +28,8 @@
|
|||||||
<option name="RECENT_TEMPLATES">
|
<option name="RECENT_TEMPLATES">
|
||||||
<list>
|
<list>
|
||||||
<option value="FxmlFile" />
|
<option value="FxmlFile" />
|
||||||
<option value="Interface" />
|
|
||||||
<option value="Enum" />
|
<option value="Enum" />
|
||||||
|
<option value="Interface" />
|
||||||
<option value="Class" />
|
<option value="Class" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
@@ -44,10 +46,10 @@
|
|||||||
</file-type-list>
|
</file-type-list>
|
||||||
</component>
|
</component>
|
||||||
<component name="HighlightingSettingsPerFile">
|
<component name="HighlightingSettingsPerFile">
|
||||||
<setting file="file://$PROJECT_DIR$/src/Visual_DVM_2021/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/TestingSystem/Common/TestingServer.java" root0="FORCE_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishGroup.java" root0="FORCE_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ConvertCorrectnessTests.java" root0="FORCE_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishTest.java" root0="FORCE_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/PublishGroup.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">
|
||||||
<option name="optimizeImportsOnTheFly" value="true" />
|
<option name="optimizeImportsOnTheFly" value="true" />
|
||||||
@@ -75,18 +77,20 @@
|
|||||||
<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" />
|
||||||
|
<property name="TODO_SCOPE" value="All Places" />
|
||||||
<property name="UI_DESIGNER_EDITOR_MODE.PaletteManager.SHOW" value="true" />
|
<property name="UI_DESIGNER_EDITOR_MODE.PaletteManager.SHOW" value="true" />
|
||||||
<property name="UI_DESIGNER_EDITOR_MODE.PaletteManager.WIDTH" value="282" />
|
<property name="UI_DESIGNER_EDITOR_MODE.PaletteManager.WIDTH" value="282" />
|
||||||
<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" />
|
<property name="last_opened_file_path" value="$PROJECT_DIR$/src" />
|
||||||
<property name="project.structure.last.edited" value="Artifacts" />
|
<property name="project.structure.last.edited" value="Artifacts" />
|
||||||
<property name="project.structure.proportion" value="0.15" />
|
<property name="project.structure.proportion" value="0.15" />
|
||||||
<property name="project.structure.side.proportion" value="0.2" />
|
<property name="project.structure.side.proportion" value="0.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>
|
||||||
@@ -96,27 +100,28 @@
|
|||||||
<recent name="controls.Trees" />
|
<recent name="controls.Trees" />
|
||||||
</key>
|
</key>
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons" />
|
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src" />
|
||||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" />
|
<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_dvm_2020\src\icons" />
|
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\DVM\DVMTasks\UI" />
|
||||||
<recent name="C:\Users\misha\Documents\visual_dvm_2020\src\icons\Transformations" />
|
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveMembersDialog.RECENTS_KEY">
|
<key name="MoveMembersDialog.RECENTS_KEY">
|
||||||
<recent name="Repository.Component.Sapfor.Sapfor" />
|
<recent name="_VisualDVM.ComponentsServer.Component.Sapfor.Sapfor" />
|
||||||
<recent name="TestingSystem.Group.GroupsDBTable" />
|
<recent name="_VisualDVM.Constants" />
|
||||||
<recent name="Common.Constants" />
|
<recent name="_VisualDVM.Global" />
|
||||||
<recent name="SapforTestingSystem.SapforTask.SapforTask" />
|
<recent name="_VisualDVM.ProjectData.SapforData.Arrays.UI.ProjectArraysForm" />
|
||||||
<recent name="TestingSystem.TestingServer" />
|
<recent name="_VisualDVM.TestingSystem.SAPFOR.SapforPackage.UI.SapforPackagesForm" />
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons" />
|
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\TestingSystem\SAPFOR\SapforSettingsCommand\UI" />
|
||||||
<recent name="C:\Users\misha\Documents\visual_dvm_2020\src\Visual_DVM_2021\Passes\UI" />
|
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\GlobalData\FileObject\UI" />
|
||||||
<recent name="E:\Visual_DVM_2020\src\Visual_DVM_2021\UI\Main" />
|
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\Common\icons" />
|
||||||
<recent name="E:\Visual_DVM_2020\src\JAnalyzer" />
|
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\Common\Visual\Windows" />
|
||||||
<recent name="E:\Visual_DVM_2020\resources" />
|
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\Visual\Windows" />
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
|
<key name="MoveClassesOrPackagesDialog.RECENTS_KEY">
|
||||||
|
<recent name="_VisualDVM.Visual.Windows" />
|
||||||
<recent name="Visual_DVM_2021.Passes.UI" />
|
<recent name="Visual_DVM_2021.Passes.UI" />
|
||||||
<recent name="Visual_DVM_2021.Passes" />
|
<recent name="Visual_DVM_2021.Passes" />
|
||||||
<recent name="Common.UI.Menus" />
|
<recent name="Common.UI.Menus" />
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
{"inter":[{"col_op":[{"comm":0.0,"ncall":8,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":0,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":0,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":0,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0}],"id":{"expr":2000000000,"nenter":1.0,"nlev":0,"nline":6,"nline_end":64,"pname":"jac3d.f","t":21},"proc_times":[{"comm":0.0,"exec_time":0.3102550506591797,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"gpu_times":null,"idle":0.0,"insuf_sys":0.0,"insuf_user":0.0,"load_imb":0.0,"lost_time":0.0,"num_gpu":0,"num_threads":0,"overlap":0.0,"prod_cpu":0.3100552558898926,"prod_io":0.0001800060272216797,"prod_sys":1.9788742065429688e-05,"real_comm":0.0,"synch":0.0,"sys_time":0.0,"th_times":null,"thr_sys_time":0.0,"thr_user_time":0.0,"time_var":0.0}],"times":{"comm":0.0,"comm_start":0.0,"efficiency":1.0,"exec_time":0.3102550506591797,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"idle":0.0,"insuf":0.0,"insuf_sys":0.0,"insuf_user":0.0,"load_imb":0.0,"lost_time":0.0,"nproc":1,"overlap":0.0,"prod_cpu":0.3100552558898926,"prod_io":0.0001800060272216797,"prod_sys":1.9788742065429688e-05,"real_comm":0.0,"synch":0.0,"sys_time":0.3102550506591797,"thr_sys_time":0.0,"thr_user_time":0.0,"threadsOfAllProcs":2,"time_var":0.0}}],"iscomp":false,"nproc":1,"p_heading":"1*1","proc":[{"node_name":"mic.dvm-system.org","test_time":0.5540609359741211}]}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"inter":[{"col_op":[{"comm":0.0,"ncall":107,"overlap":0.0,"real_comm":0.0,"synch":0.09642767906188965,"time_var":0.10170316696166992},{"comm":0.09526991844177246,"ncall":100,"overlap":0.00025081634521484375,"real_comm":0.0,"synch":2.384185791015625e-05,"time_var":1.5735626220703125e-05},{"comm":0.01116180419921875,"ncall":100,"overlap":7.390975952148438e-05,"real_comm":0.0,"synch":0.0018832683563232422,"time_var":0.0013852119445800781},{"comm":0.0,"ncall":0,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0}],"id":{"expr":2000000000,"nenter":1.0,"nlev":0,"nline":15,"nline_end":71,"pname":"jac2d.for","t":21},"proc_times":[{"comm":0.008355379104614258,"exec_time":4.960660934448242,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"gpu_times":null,"idle":0.00014519691467285156,"insuf_sys":0.02597987651824951,"insuf_user":0.002836167812347412,"load_imb":0.0,"lost_time":0.03731662034988403,"num_gpu":0,"num_threads":0,"overlap":0.0,"prod_cpu":4.9148295521736145,"prod_io":0.0015007257461547852,"prod_sys":0.007159233093261719,"real_comm":0.0,"synch":0.015146493911743164,"sys_time":1.42268456e-316,"th_times":null,"thr_sys_time":0.0,"thr_user_time":0.0,"time_var":0.011813640594482422},{"comm":0.020066499710083008,"exec_time":4.960740089416504,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"gpu_times":null,"idle":6.604194641113281e-05,"insuf_sys":0.022036850452423096,"insuf_user":0.0030239224433898926,"load_imb":0.006429493427276611,"lost_time":0.04519331455230713,"num_gpu":0,"num_threads":0,"overlap":0.0,"prod_cpu":4.9082671999931335,"prod_io":5.352497100830078e-05,"prod_sys":0.0072920918464660645,"real_comm":0.0,"synch":0.021478652954101563,"sys_time":1632742196.495043,"th_times":null,"thr_sys_time":0.0,"thr_user_time":0.0,"time_var":0.024171829223632813},{"comm":0.05277681350708008,"exec_time":4.960806131362915,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"gpu_times":null,"idle":0.0,"insuf_sys":0.023320376873016357,"insuf_user":0.0034398436546325684,"load_imb":0.040790677070617676,"lost_time":0.079537034034729,"num_gpu":0,"num_threads":0,"overlap":0.0,"prod_cpu":4.873495638370514,"prod_io":7.098913192749023e-05,"prod_sys":0.007702469825744629,"real_comm":0.0,"synch":0.03799128532409668,"sys_time":5.51718905656e-313,"th_times":null,"thr_sys_time":0.0,"thr_user_time":0.0,"time_var":0.04065394401550293},{"comm":0.025233030319213867,"exec_time":4.960805177688599,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"gpu_times":null,"idle":9.5367431640625e-07,"insuf_sys":0.022124826908111572,"insuf_user":0.0031962990760803223,"load_imb":0.011793673038482666,"lost_time":0.05055510997772217,"num_gpu":0,"num_threads":0,"overlap":0.0,"prod_cpu":4.902876079082489,"prod_io":5.5909156799316406e-05,"prod_sys":0.007319033145904541,"real_comm":0.0,"synch":0.02371835708618164,"sys_time":1.4228205e-316,"th_times":null,"thr_sys_time":0.0,"thr_user_time":0.0,"time_var":0.02646470069885254}],"times":{"comm":0.10643172264099121,"comm_start":0.0,"efficiency":0.989285910732807,"exec_time":4.960806131362915,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"idle":0.00021219253540039063,"insuf":0.10595816373825073,"insuf_sys":0.09346193075180054,"insuf_user":0.012496232986450195,"load_imb":0.05901384353637695,"lost_time":0.21260207891464233,"nproc":4,"overlap":0.0003247261047363281,"prod_cpu":19.59946846961975,"prod_io":0.0016811490058898926,"prod_sys":0.029472827911376953,"real_comm":0.0,"synch":0.09833478927612305,"sys_time":19.84322452545166,"thr_sys_time":0.0,"thr_user_time":0.0,"threadsOfAllProcs":4,"time_var":0.1031041145324707}}],"iscomp":false,"nproc":4,"p_heading":"2*2","proc":[{"node_name":"mic.dvm-system.org","test_time":0.5796339511871338},{"node_name":"mic.dvm-system.org","test_time":0.5798628330230713},{"node_name":"mic.dvm-system.org","test_time":0.5795998573303223},{"node_name":"mic.dvm-system.org","test_time":0.5797138214111328}]}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"inter":[{"col_op":[{"comm":0.0,"ncall":107,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0012249946594238281,"ncall":100,"overlap":0.00010442733764648438,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":100,"overlap":5.507469177246094e-05,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":0,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0}],"id":{"expr":2000000000,"nenter":1.0,"nlev":0,"nline":15,"nline_end":71,"pname":"jac2d.for","t":21},"proc_times":[{"comm":0.0012249946594238281,"exec_time":12.855837106704712,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"gpu_times":null,"idle":0.0,"insuf_sys":0.0,"insuf_user":0.0,"load_imb":0.0,"lost_time":0.0012249946594238281,"num_gpu":0,"num_threads":0,"overlap":0.0,"prod_cpu":12.844730615615845,"prod_io":0.0035636425018310547,"prod_sys":0.006317853927612305,"real_comm":0.0,"synch":0.0,"sys_time":1.4784531e-316,"th_times":null,"thr_sys_time":0.0,"thr_user_time":0.0,"time_var":0.0}],"times":{"comm":0.0012249946594238281,"comm_start":0.0,"efficiency":0.9999047129604042,"exec_time":12.855837106704712,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"idle":0.0,"insuf":0.0,"insuf_sys":0.0,"insuf_user":0.0,"load_imb":0.0,"lost_time":0.0012249946594238281,"nproc":1,"overlap":0.0001595020294189453,"prod_cpu":12.844730615615845,"prod_io":0.0035636425018310547,"prod_sys":0.006317853927612305,"real_comm":0.0,"synch":0.0,"sys_time":12.855837106704712,"thr_sys_time":0.0,"thr_user_time":0.0,"threadsOfAllProcs":1,"time_var":0.0}}],"iscomp":false,"nproc":1,"p_heading":"1*1","proc":[{"node_name":"mic.dvm-system.org","test_time":0.5531537532806396}]}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"inter":[{"col_op":[{"comm":0.0,"ncall":54,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":0,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":0,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":0,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0}],"id":{"expr":2000000000,"nenter":1.0,"nlev":0,"nline":174,"nline_end":298,"pname":"bt.f","t":21},"proc_times":[{"comm":0.0,"exec_time":37.97893500328064,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"gpu_times":null,"idle":0.0,"insuf_sys":0.0,"insuf_user":0.0,"load_imb":0.0,"lost_time":0.0,"num_gpu":0,"num_threads":0,"overlap":0.0,"prod_cpu":37.97744798660278,"prod_io":0.0006661415100097656,"prod_sys":0.0008208751678466797,"real_comm":0.0,"synch":0.0,"sys_time":4.080717506121202e-33,"th_times":null,"thr_sys_time":0.0,"thr_user_time":0.0,"time_var":0.0}],"times":{"comm":0.0,"comm_start":0.0,"efficiency":1.0,"exec_time":37.97893500328064,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"idle":0.0,"insuf":0.0,"insuf_sys":0.0,"insuf_user":0.0,"load_imb":0.0,"lost_time":0.0,"nproc":1,"overlap":0.0,"prod_cpu":37.97744798660278,"prod_io":0.0006661415100097656,"prod_sys":0.0008208751678466797,"real_comm":0.0,"synch":0.0,"sys_time":37.97893500328064,"thr_sys_time":0.0,"thr_user_time":0.0,"threadsOfAllProcs":12,"time_var":0.0}}],"iscomp":false,"nproc":1,"p_heading":"1*1*1*1","proc":[{"node_name":"mic.dvm-system.org","test_time":0.5507678985595703}]}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"inter":[{"col_op":[{"comm":0.0,"ncall":107,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0011873245239257813,"ncall":100,"overlap":9.274482727050781e-05,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":100,"overlap":5.435943603515625e-05,"real_comm":0.0,"synch":0.0,"time_var":0.0},{"comm":0.0,"ncall":0,"overlap":0.0,"real_comm":0.0,"synch":0.0,"time_var":0.0}],"id":{"expr":2000000000,"nenter":1.0,"nlev":0,"nline":15,"nline_end":71,"pname":"jac2d.for","t":21},"proc_times":[{"comm":0.0011873245239257813,"exec_time":12.533138990402222,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"gpu_times":null,"idle":0.0,"insuf_sys":0.0,"insuf_user":0.0,"load_imb":0.0,"lost_time":0.0011873245239257813,"num_gpu":0,"num_threads":0,"overlap":0.0,"prod_cpu":12.522205114364624,"prod_io":0.0035867691040039063,"prod_sys":0.006159782409667969,"real_comm":0.0,"synch":0.0,"sys_time":2.49049955e-316,"th_times":null,"thr_sys_time":0.0,"thr_user_time":0.0,"time_var":0.0}],"times":{"comm":0.0011873245239257813,"comm_start":0.0,"efficiency":0.999905265191359,"exec_time":12.533138990402222,"gpu_time_lost":0.0,"gpu_time_prod":0.0,"idle":0.0,"insuf":0.0,"insuf_sys":0.0,"insuf_user":0.0,"load_imb":0.0,"lost_time":0.0011873245239257813,"nproc":1,"overlap":0.00014710426330566406,"prod_cpu":12.522205114364624,"prod_io":0.0035867691040039063,"prod_sys":0.006159782409667969,"real_comm":0.0,"synch":0.0,"sys_time":12.533138990402222,"thr_sys_time":0.0,"thr_user_time":0.0,"threadsOfAllProcs":1,"time_var":0.0}}],"iscomp":false,"nproc":1,"p_heading":"1*1","proc":[{"node_name":"mic.dvm-system.org","test_time":0.5526328086853027}]}
|
|
||||||
226
Planner/String.h
226
Planner/String.h
@@ -1,226 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
class String {
|
|
||||||
friend String operator+(const String& a, const String& b);
|
|
||||||
long length;
|
|
||||||
char* body;
|
|
||||||
public:
|
|
||||||
String() {
|
|
||||||
length = 0;
|
|
||||||
body = new char[1];
|
|
||||||
body[0] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
String(const char* s) {
|
|
||||||
length = (long)strlen(s);
|
|
||||||
body = new char[length + 1];
|
|
||||||
for (long i = 0; i < length; ++i)
|
|
||||||
body[i] = s[i];
|
|
||||||
body[length] = '\0';
|
|
||||||
}
|
|
||||||
String(const char* s, char ps) {
|
|
||||||
length = (long)strlen(s);
|
|
||||||
body = new char[length + 1];
|
|
||||||
for (long i = 0; i < length; ++i) {
|
|
||||||
body[i] = (s[i] == ps) ? '\n' : s[i];
|
|
||||||
}
|
|
||||||
body[length] = '\0';
|
|
||||||
}
|
|
||||||
~String() {
|
|
||||||
if (body != NULL) {
|
|
||||||
delete[] body;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void println() const {
|
|
||||||
printf("[%s]\n", body);
|
|
||||||
}
|
|
||||||
void addChar(char c) {
|
|
||||||
char* buf = new char[length + 2];
|
|
||||||
for (long i = 0; i < length; ++i) {
|
|
||||||
buf[i] = body[i];
|
|
||||||
}
|
|
||||||
buf[length] = c;
|
|
||||||
|
|
||||||
length++;
|
|
||||||
//--
|
|
||||||
buf[length] = '\0';
|
|
||||||
delete[] body;
|
|
||||||
body = buf;
|
|
||||||
buf = NULL;
|
|
||||||
}
|
|
||||||
char* getCharArray() const {
|
|
||||||
return body;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
String(int s) {
|
|
||||||
length = 0;
|
|
||||||
body = new char[1];
|
|
||||||
body[0] = '\0';
|
|
||||||
if (s >= 0) {
|
|
||||||
int s_ = s;
|
|
||||||
int size = 1;
|
|
||||||
while (s_ >= 10) {
|
|
||||||
s_ = s_ / 10;
|
|
||||||
size++;
|
|
||||||
}
|
|
||||||
length = size;
|
|
||||||
body = new char[size + 1];
|
|
||||||
sprintf(body, "%d", s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String(long s) : String((long long)s) { }
|
|
||||||
|
|
||||||
String(long long s) {
|
|
||||||
length = 0;
|
|
||||||
body = new char[1];
|
|
||||||
body[0] = '\0';
|
|
||||||
if (s >= 0) {
|
|
||||||
long long s_ = s;
|
|
||||||
long size = 1;
|
|
||||||
while (s_ >= 10) {
|
|
||||||
s_ = s_ / 10;
|
|
||||||
size++;
|
|
||||||
}
|
|
||||||
length = size;
|
|
||||||
body = new char[size + 1];
|
|
||||||
sprintf(body, "%lld", s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const String& operator=(const String& s) {
|
|
||||||
if (body != NULL)
|
|
||||||
delete[] body;
|
|
||||||
length = s.length;
|
|
||||||
body = new char[length + 1];
|
|
||||||
for (long i = 0; i < length; ++i)
|
|
||||||
body[i] = s.body[i];
|
|
||||||
body[length] = '\0';
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
static String DQuotes(const String& s) {
|
|
||||||
String res;
|
|
||||||
res.length = s.length + 2;
|
|
||||||
res.body = new char[res.length + 1];
|
|
||||||
res.body[0] = '"';
|
|
||||||
res.body[res.length - 1] = '"';
|
|
||||||
res.body[res.length] = '\0';
|
|
||||||
for (long i = 0; i < s.length; ++i)
|
|
||||||
res.body[i + 1] = s.body[i];
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
String Replace(char f, char t) {
|
|
||||||
String res;
|
|
||||||
res.length = length;
|
|
||||||
res.body = new char[length];
|
|
||||||
res.body[length] = '\0';
|
|
||||||
for (long i = 0; i < length; ++i)
|
|
||||||
res.body[i] = (body[i] == f) ? t : body[i];
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
String Remove(char f) {
|
|
||||||
String res;
|
|
||||||
for (long i = 0; i < length; ++i) {
|
|
||||||
if (body[i] != f)
|
|
||||||
res.addChar(body[i]);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
bool isEmpty() const {
|
|
||||||
return length == 0;
|
|
||||||
}
|
|
||||||
bool contains(const String& s) const {
|
|
||||||
bool res = false;
|
|
||||||
bool search_on = false;
|
|
||||||
if (s.isEmpty()) return true;
|
|
||||||
if (s.length > length) return false;
|
|
||||||
long k = 0;
|
|
||||||
long start = -1;
|
|
||||||
for (long i = 0; i < length; ++i) {
|
|
||||||
if (search_on) {
|
|
||||||
if (k < s.length) {
|
|
||||||
if (body[i] == s.body[k]) {
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//обрыв поиска.
|
|
||||||
search_on = false;
|
|
||||||
k = 0;
|
|
||||||
start = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//printf("starts with %ld", start);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (body[i] == s.body[0]) {
|
|
||||||
k = 1;
|
|
||||||
start = i;
|
|
||||||
search_on = true;
|
|
||||||
//printf("search started %d\n", start);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (search_on) {
|
|
||||||
//printf("starts with %ld\n", start);
|
|
||||||
res = true;
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
String toUpper() {
|
|
||||||
String res = String(this->getCharArray());
|
|
||||||
for (long i = 0; i < length; ++i)
|
|
||||||
res.body[i] = toupper(body[i]);
|
|
||||||
res.println();
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
long getLength() {
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
bool operator==(const String& s) const {
|
|
||||||
if (length != s.length) return false;
|
|
||||||
for (long i = 0; i < length; ++i) {
|
|
||||||
if (body[i] != s.body[i]) return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
/* регистр.
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
FILE * f;
|
|
||||||
int c;
|
|
||||||
|
|
||||||
if ( ! ( f = fopen("file.txt", "r") ) )
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
while ( ( c = fgetc(f) ) != EOF )
|
|
||||||
putchar( isupper(c) ? tolower(c) : toupper(c) );
|
|
||||||
|
|
||||||
return ( fclose(f) );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
};
|
|
||||||
|
|
||||||
String operator+(const String& a, const String& b) {
|
|
||||||
String res = String();
|
|
||||||
res.length = a.length + b.length;
|
|
||||||
res.body = new char[res.length + 1];
|
|
||||||
for (long i = 0; i < a.length; ++i)
|
|
||||||
res.body[i] = a.body[i];
|
|
||||||
for (long i = 0; i < b.length; ++i)
|
|
||||||
res.body[i + a.length] = b.body[i];
|
|
||||||
res.body[res.length] = '\0';
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
@@ -1,246 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <set>
|
|
||||||
#include <vector>
|
|
||||||
#include <queue>
|
|
||||||
#include "File.h"
|
|
||||||
#include "Task.h"
|
|
||||||
#include "Array.h"
|
|
||||||
|
|
||||||
enum SupervisorState {
|
|
||||||
WorkspacesCreation, //0
|
|
||||||
Preparation, //1
|
|
||||||
Execution, //2
|
|
||||||
Archivation, //3
|
|
||||||
End //4
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
class Supervisor : public Array <T> {
|
|
||||||
protected:
|
|
||||||
SupervisorState state;
|
|
||||||
public:
|
|
||||||
virtual String getStatePrefix() {
|
|
||||||
return String("");
|
|
||||||
}
|
|
||||||
String printState() {
|
|
||||||
switch (state) {
|
|
||||||
case WorkspacesCreation:
|
|
||||||
return String("WorkspacesCreation");
|
|
||||||
case Preparation:
|
|
||||||
return String("Preparation");
|
|
||||||
case Execution:
|
|
||||||
return String("Execution");
|
|
||||||
case Archivation:
|
|
||||||
return String("Archivation");
|
|
||||||
case End:
|
|
||||||
return String("End");
|
|
||||||
default:
|
|
||||||
return "?";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
void print() {
|
|
||||||
for (auto& elem : this->getElements())
|
|
||||||
elem->print();
|
|
||||||
}
|
|
||||||
|
|
||||||
void init(const char* fileName, int recordSize) {
|
|
||||||
state = WorkspacesCreation;
|
|
||||||
File* packedTasks = new File(fileName);
|
|
||||||
Text* lines = packedTasks->readLines();
|
|
||||||
|
|
||||||
const long length = lines->getLength() / recordSize;
|
|
||||||
int offset = 0;
|
|
||||||
for (int i = 0; i < length; ++i) {
|
|
||||||
this->add(new T(lines, offset));
|
|
||||||
offset += recordSize;
|
|
||||||
}
|
|
||||||
delete packedTasks;
|
|
||||||
delete lines;
|
|
||||||
}
|
|
||||||
|
|
||||||
void changeState() {
|
|
||||||
switch (this->state) {
|
|
||||||
case WorkspacesCreation:
|
|
||||||
this->state = Preparation;
|
|
||||||
saveState();
|
|
||||||
break;
|
|
||||||
case Preparation:
|
|
||||||
this->state = Execution;
|
|
||||||
saveState();
|
|
||||||
break;
|
|
||||||
case Execution:
|
|
||||||
Finalize();
|
|
||||||
this->state = End;
|
|
||||||
saveState();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this->state = End;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Do() {
|
|
||||||
saveState();
|
|
||||||
long activeCount = 0;
|
|
||||||
//todo обязательно убрать отладочную печать.
|
|
||||||
printf("tasks count = %ld\n", this->getLength());
|
|
||||||
while (this->state != End) {
|
|
||||||
// printf("state=%d\n", this->state);
|
|
||||||
// printf("max=%d; busy=%d; free=%d\n", maxKernels, busyKernels, freeKernels);
|
|
||||||
activeCount = 0;
|
|
||||||
for (long i = 0; i < this->getLength(); ++i) {
|
|
||||||
T* task = this->get(i);
|
|
||||||
switch (this->state) {
|
|
||||||
case WorkspacesCreation:
|
|
||||||
if (task->getState() == Waiting) {
|
|
||||||
activeCount++;
|
|
||||||
task->createWorkspace();
|
|
||||||
task->setState(WorkspaceCreated);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Preparation:
|
|
||||||
if (task->getState() == WorkspaceCreated) {
|
|
||||||
activeCount++;
|
|
||||||
task->prepareWorkspace();
|
|
||||||
task->createLaunchScript();
|
|
||||||
task->setState(WorkspaceReady);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Execution:
|
|
||||||
if (task->getState() == WorkspaceReady) {
|
|
||||||
activeCount++;
|
|
||||||
task->Start();
|
|
||||||
}
|
|
||||||
else if (task->getState() == Running) {
|
|
||||||
activeCount++;
|
|
||||||
task->Check();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// printf("id = %ld; state = %d\n", task->getId(), task->getState());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// printf("active count = %d\n", activeCount);
|
|
||||||
if (activeCount == 0)
|
|
||||||
changeState();
|
|
||||||
Utils::Sleep(2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DoWithSchedule(int maxKernels) {
|
|
||||||
saveState();
|
|
||||||
|
|
||||||
// подготовка тестов
|
|
||||||
while (this->state != Execution) {
|
|
||||||
for (auto& task : this->getElements()) {
|
|
||||||
switch (this->state) {
|
|
||||||
case WorkspacesCreation:
|
|
||||||
if (task->getState() == Waiting) {
|
|
||||||
task->createWorkspace();
|
|
||||||
task->setState(WorkspaceCreated);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Preparation:
|
|
||||||
if (task->getState() == WorkspaceCreated) {
|
|
||||||
task->prepareWorkspace();
|
|
||||||
task->createLaunchScript();
|
|
||||||
task->setState(WorkspaceReady);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
//printf("id = %ld; state = %d\n", task->getId(), task->getState());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
changeState();
|
|
||||||
}
|
|
||||||
|
|
||||||
map<int, queue<T*>, std::greater<int>> sortedByKernelNeeds;
|
|
||||||
|
|
||||||
long activeTasks = 0;
|
|
||||||
long done = 0;
|
|
||||||
for (auto& task : this->getElements()) {
|
|
||||||
if (task->getState() == WorkspaceReady) {
|
|
||||||
activeTasks++;
|
|
||||||
sortedByKernelNeeds[task->getKernels()].push(task);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("total tasks count = %ld, active task count %ld, maxkernels %d\n", this->getLength(), activeTasks, maxKernels);
|
|
||||||
|
|
||||||
int busyKernels = 0;
|
|
||||||
set<T*> activeTaskSet;
|
|
||||||
bool ignoreCheck = true;
|
|
||||||
|
|
||||||
while (activeTasks) {
|
|
||||||
long oldActiveTasks = activeTasks;
|
|
||||||
vector<int> emptyKeys;
|
|
||||||
|
|
||||||
//ставим задачи от больших к меньшему по ядрам
|
|
||||||
for (auto& elem : sortedByKernelNeeds) {
|
|
||||||
int freeKernels = maxKernels - busyKernels;
|
|
||||||
int kernelsNeeded = elem.first;
|
|
||||||
|
|
||||||
while (kernelsNeeded <= freeKernels && elem.second.size()) {
|
|
||||||
T* task = elem.second.front();
|
|
||||||
elem.second.pop();
|
|
||||||
|
|
||||||
activeTaskSet.insert(task);
|
|
||||||
task->Start(ignoreCheck);
|
|
||||||
printf("start task with %d kernels and id %ld\n", task->getKernels(), task->getId());
|
|
||||||
|
|
||||||
busyKernels += task->getKernels();
|
|
||||||
freeKernels = maxKernels - busyKernels;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (elem.second.size() == 0)
|
|
||||||
emptyKeys.push_back(kernelsNeeded);
|
|
||||||
|
|
||||||
//если ядер не осталось, то нет смысла дальше смотреть
|
|
||||||
if (freeKernels == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// очищаем от пустых ключей
|
|
||||||
for (auto& empty : emptyKeys)
|
|
||||||
sortedByKernelNeeds.erase(empty);
|
|
||||||
|
|
||||||
// проверяем нет ли завершившихся задач
|
|
||||||
for (auto it = activeTaskSet.begin(); it != activeTaskSet.end(); )
|
|
||||||
{
|
|
||||||
T* task = *(it);
|
|
||||||
|
|
||||||
if (task->Check()) {
|
|
||||||
it++;
|
|
||||||
activeTaskSet.erase(task);
|
|
||||||
activeTasks--;
|
|
||||||
done++;
|
|
||||||
busyKernels -= task->getKernels();
|
|
||||||
printf(" done task with %d kernels and id %ld\n", task->getKernels(), task->getId());
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
it++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (oldActiveTasks != activeTasks)
|
|
||||||
printf("done %ld / %ld\n", done, this->getLength());
|
|
||||||
}
|
|
||||||
|
|
||||||
changeState();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void Finalize() {}
|
|
||||||
|
|
||||||
void saveState() {
|
|
||||||
Utils::Sleep(1); //чтобы не было одинаковых по дате файлов.
|
|
||||||
String stateFile = packageWorkspace + "/state/" + getStatePrefix() + printState();
|
|
||||||
//printf("stateFile=<%s>\n", stateFile.getCharArray());
|
|
||||||
File(stateFile, Utils::getDate());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <chrono>
|
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
#if __cplusplus >= 201703L
|
|
||||||
#include <filesystem>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "String.h"
|
|
||||||
|
|
||||||
class Utils {
|
|
||||||
public:
|
|
||||||
static int max(int a, int b) {
|
|
||||||
return (a > b) ? a : b;
|
|
||||||
}
|
|
||||||
static int min(int a, int b) {
|
|
||||||
return (a > b) ? b : a;
|
|
||||||
}
|
|
||||||
static void Mkdir(const String& path) {
|
|
||||||
#if __cplusplus >= 201703L
|
|
||||||
std::filesystem::create_directory(path.getCharArray());
|
|
||||||
#else
|
|
||||||
mkdir(path.getCharArray(), 0777);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//https://stackoverflow.com/questions/4568681/using-chmod-in-a-c-program
|
|
||||||
static void Chmod(const String& path) {
|
|
||||||
String command = "chmod 777 " + String::DQuotes(path);
|
|
||||||
system(command.getCharArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
//https://stackoverflow.com/questions/230062/whats-the-best-way-to-check-if-a-file-exists-in-c
|
|
||||||
static bool Exists(const String& path) {
|
|
||||||
struct stat buffer;
|
|
||||||
return (stat(path.getCharArray(), &buffer) == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//in seconds
|
|
||||||
static void Sleep(int s) {
|
|
||||||
std::chrono::seconds timespan(s);
|
|
||||||
std::this_thread::sleep_for(timespan);
|
|
||||||
}
|
|
||||||
static void Copy(const String& src, const String& dst) {
|
|
||||||
String command = "cp " + String::DQuotes(src) + " " + String::DQuotes(dst);
|
|
||||||
system(command.getCharArray());
|
|
||||||
}
|
|
||||||
static time_t getAbsoluteTime() {
|
|
||||||
return time(NULL);
|
|
||||||
}
|
|
||||||
static String getDate() {
|
|
||||||
auto ttime = time(NULL);
|
|
||||||
String res(ctime(&ttime));
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
static void ZipFolder(const String& src, const String& dst) {
|
|
||||||
String command = "zip -r " + String::DQuotes(dst) + " " + String::DQuotes(src);
|
|
||||||
system(command.getCharArray());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -4,4 +4,4 @@
|
|||||||
|
|
||||||
Инструкция для установки и настройки Диалоговой обочки https://cloud.mail.ru/public/NDxu/LJJhQgQUG
|
Инструкция для установки и настройки Диалоговой обочки https://cloud.mail.ru/public/NDxu/LJJhQgQUG
|
||||||
|
|
||||||
Проект SAPFOR FORTRAN http://alex-freenas.ddns.net:3000/Alexander_KS/SAPFOR
|
Проект SAPFOR FORTRAN http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR
|
||||||
@@ -16,5 +16,84 @@
|
|||||||
<orderEntry type="library" name="mxgraphx-all-4.2.0" level="project" />
|
<orderEntry type="library" name="mxgraphx-all-4.2.0" level="project" />
|
||||||
<orderEntry type="library" name="gson-2.8.1" level="project" />
|
<orderEntry type="library" name="gson-2.8.1" level="project" />
|
||||||
<orderEntry type="library" name="commons-io-2.5" level="project" />
|
<orderEntry type="library" name="commons-io-2.5" level="project" />
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/poi-3.12-20150511.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/poi-examples-3.12-20150511.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/poi-excelant-3.12-20150511.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/poi-ooxml-3.12-20150511.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/poi-ooxml-schemas-3.12-20150511.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/poi-scratchpad-3.12-20150511.jar!/" />
|
||||||
|
<root url="file://$MODULE_DIR$" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES>
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/osgi/src/main/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/osgi/src/test/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-examples/src/main/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-examples/src/main/ruby/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-examples/src/test/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-excelant/src/main/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-excelant/src/poi-ant-contrib/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-excelant/src/test/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-integration/src/test/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-ooxml-lite-agent/src/main/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-ooxml/src/main/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-ooxml/src/test/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-scratchpad/src/main/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi-scratchpad/src/test/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi/src/main/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/Components/poi-src-5.2.5-20231118/poi-src-5.2.5-20231118/poi/src/test/java" />
|
||||||
|
<root url="file://$MODULE_DIR$/src" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/commons-logging-1.1.3.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/commons-codec-1.9.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/junit-4.12.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/log4j-1.2.17.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/libs/xmlbeans-2.6.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="library" name="commons-lang-2.6.0" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
BIN
Visualizer_2.exe
BIN
Visualizer_2.exe
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 163 KiB |
37
debug_properties/properties
Normal file
37
debug_properties/properties
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"Mode": "Normal",
|
||||||
|
"ServerAddress": "alex-freenas.ddns.net",
|
||||||
|
"ServerUserName": "testuser",
|
||||||
|
"ServerUserSHHPort": 23,
|
||||||
|
"ComponentsServerPort": 7995,
|
||||||
|
"TestingServerPort": 7996,
|
||||||
|
"SocketTimeout": 5000,
|
||||||
|
"OldServer": false,
|
||||||
|
"SMTPHost": "smtp.mail.ru",
|
||||||
|
"SMTPPort": 465,
|
||||||
|
"MailSocketPort": 465,
|
||||||
|
"BackupWorkspace": "_sapfor_x64_backups",
|
||||||
|
"BackupHour": 5,
|
||||||
|
"BackupMinute": 0,
|
||||||
|
"EmailAdminsOnStart": false,
|
||||||
|
"AutoUpdateSearch": false,
|
||||||
|
"ConfirmPassesStart": true,
|
||||||
|
"ShowPassesDone": true,
|
||||||
|
"FocusPassesResult": true,
|
||||||
|
"GlobalDBName": "db7.sqlite",
|
||||||
|
"ProjectDBName": "new_project_base.sqlite",
|
||||||
|
"BugReportsDBName": "bug_reports.sqlite",
|
||||||
|
"TestsDBName": "tests.sqlite",
|
||||||
|
"ComponentsWindowWidth": 843,
|
||||||
|
"ComponentsWindowHeight": 250,
|
||||||
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
|
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||||
|
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
||||||
|
"InstructionPath": "",
|
||||||
|
"PerformanceAnalyzerPath": "",
|
||||||
|
"ComponentsBackUpsCount": 10,
|
||||||
|
"TestingKernels": 28,
|
||||||
|
"AutoCheckTesting": false,
|
||||||
|
"CheckTestingIntervalSeconds": 10,
|
||||||
|
"EmailOnTestingProgress": false
|
||||||
|
}
|
||||||
37
normal_properties/properties
Normal file
37
normal_properties/properties
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"Mode": "Normal",
|
||||||
|
"ServerAddress": "alex-freenas.ddns.net",
|
||||||
|
"ServerUserName": "testuser",
|
||||||
|
"ServerUserSHHPort": 2000,
|
||||||
|
"ComponentsServerPort": 7995,
|
||||||
|
"TestingServerPort": 7998,
|
||||||
|
"SocketTimeout": 5000,
|
||||||
|
"OldServer": false,
|
||||||
|
"SMTPHost": "smtp.mail.ru",
|
||||||
|
"SMTPPort": 465,
|
||||||
|
"MailSocketPort": 465,
|
||||||
|
"BackupWorkspace": "_sapfor_x64_backups",
|
||||||
|
"BackupHour": 5,
|
||||||
|
"BackupMinute": 0,
|
||||||
|
"EmailAdminsOnStart": false,
|
||||||
|
"AutoUpdateSearch": false,
|
||||||
|
"ConfirmPassesStart": true,
|
||||||
|
"ShowPassesDone": true,
|
||||||
|
"FocusPassesResult": true,
|
||||||
|
"GlobalDBName": "db7.sqlite",
|
||||||
|
"ProjectDBName": "new_project_base.sqlite",
|
||||||
|
"BugReportsDBName": "bug_reports.sqlite",
|
||||||
|
"TestsDBName": "tests.sqlite",
|
||||||
|
"ComponentsWindowWidth": 843,
|
||||||
|
"ComponentsWindowHeight": 250,
|
||||||
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
|
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||||
|
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
||||||
|
"InstructionPath": "",
|
||||||
|
"PerformanceAnalyzerPath": "",
|
||||||
|
"ComponentsBackUpsCount": 10,
|
||||||
|
"TestingKernels": 28,
|
||||||
|
"AutoCheckTesting": true,
|
||||||
|
"CheckTestingIntervalSeconds": 10,
|
||||||
|
"EmailOnTestingProgress": false
|
||||||
|
}
|
||||||
71
properties
71
properties
@@ -1,32 +1,51 @@
|
|||||||
{
|
{
|
||||||
"Mode": "Normal",
|
"Email": "vmk-post@yandex.ru",
|
||||||
"SocketTimeout": 5000,
|
"Name": "M",
|
||||||
"OldServer": false,
|
"ServerUserPassword": "mprit_2011",
|
||||||
"SMTPHost": "smtp.mail.ru",
|
"OfferRegistrationOnStart": true,
|
||||||
"SMTPPort": 465,
|
"Workspace": "E:\\Tests",
|
||||||
"MailSocketPort": 465,
|
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1749652835\\tmp_influxsys\\v3",
|
||||||
"BackupWorkspace": "_sapfor_x64_backups",
|
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
||||||
"BackupHour": 5,
|
|
||||||
"BackupMinute": 0,
|
|
||||||
"EmailAdminsOnStart": false,
|
|
||||||
"AutoUpdateSearch": true,
|
|
||||||
"ConfirmPassesStart": true,
|
|
||||||
"ShowPassesDone": true,
|
|
||||||
"FocusPassesResult": false,
|
|
||||||
"GlobalDBName": "db7.sqlite",
|
|
||||||
"ProjectDBName": "new_project_base.sqlite",
|
|
||||||
"BugReportsDBName": "bug_reports.sqlite",
|
|
||||||
"TestsDBName": "tests.sqlite",
|
|
||||||
"ComponentsWindowWidth": 843,
|
|
||||||
"ComponentsWindowHeight": 250,
|
|
||||||
"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": "",
|
"InstructionPath": "C:\\Users\\misha\\Documents",
|
||||||
"PerformanceAnalyzerPath": "",
|
"PerformanceAnalyzerPath": "C:\\Users\\misha\\Documents",
|
||||||
"ComponentsBackUpsCount": 10,
|
"AutoBugReportsLoad": true,
|
||||||
"TestingKernels": 16,
|
"AutoTestsLoad": true,
|
||||||
"AutoCheckTesting": false,
|
"ConfirmPassesStart": true,
|
||||||
|
"ShowPassesDone": true,
|
||||||
|
"FocusPassesResult": false,
|
||||||
|
"collapseCredentials": true,
|
||||||
|
"collapseFileGraphs": false,
|
||||||
|
"collapseFileMessages": false,
|
||||||
|
"collapseProjectTrees": false,
|
||||||
|
"EditorFontSize": 17,
|
||||||
|
"ComponentsWindowWidth": 929,
|
||||||
|
"ComponentsWindowHeight": 250,
|
||||||
|
"Kernels": 8,
|
||||||
|
"LocalMakePathWindows": "C:\\MinGW\\msys\\1.0\\bin\\make.exe",
|
||||||
"CheckTestingIntervalSeconds": 10,
|
"CheckTestingIntervalSeconds": 10,
|
||||||
"EmailOnTestingProgress": true
|
"AutoCheckTesting": true,
|
||||||
|
"EmailOnTestingProgress": true,
|
||||||
|
"CompleteCompilationOptions": true,
|
||||||
|
"CompleteRunEnvironments": true,
|
||||||
|
"CreateEthalonTasks": true,
|
||||||
|
"ErasePackageWorkspace": true,
|
||||||
|
"lastMachineId": 13,
|
||||||
|
"lastUserId": 34,
|
||||||
|
"lastCompilerId": 52,
|
||||||
|
"RegisterOn": false,
|
||||||
|
"SpacesOn": false,
|
||||||
|
"EmptyLinesOn": false,
|
||||||
|
"FortranWrapsOn": false,
|
||||||
|
"ExtensionsOn": false,
|
||||||
|
"ComparsionDiffMergeOn": true,
|
||||||
|
"ShowFullArraysDeclarations": true,
|
||||||
|
"ShowFullTabsNames": true,
|
||||||
|
"SmallScreen": false,
|
||||||
|
"BugReportsAgeLimit": 1,
|
||||||
|
"FastAccessPassesCount": 10,
|
||||||
|
"LastOpenedProjectsCount": 25,
|
||||||
|
"Mode": "Normal"
|
||||||
}
|
}
|
||||||
43
server_debug_properties/properties
Normal file
43
server_debug_properties/properties
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"Mode": "Normal",
|
||||||
|
"ServerAddress": "alex-freenas.ddns.net",
|
||||||
|
"ServerUserName": "testuser",
|
||||||
|
"ServerUserSHHPort": 2000,
|
||||||
|
"ComponentsServerPort": 7996,
|
||||||
|
"TestingServerPort": 7998,
|
||||||
|
"SocketTimeout": 5000,
|
||||||
|
"OldServer": false,
|
||||||
|
"SMTPHost": "smtp.mail.ru",
|
||||||
|
"SMTPPort": 465,
|
||||||
|
"MailSocketPort": 465,
|
||||||
|
"collapseCredentials": false,
|
||||||
|
"collapseFileGraphs": false,
|
||||||
|
"collapseFileMessages": false,
|
||||||
|
"collapseProjectTrees": false,
|
||||||
|
"BackupWorkspace": "_sapfor_x64_backups",
|
||||||
|
"BackupHour": 5,
|
||||||
|
"BackupMinute": 0,
|
||||||
|
"EmailAdminsOnStart": false,
|
||||||
|
"AutoUpdateSearch": true,
|
||||||
|
"ConfirmPassesStart": true,
|
||||||
|
"ShowPassesDone": true,
|
||||||
|
"FocusPassesResult": true,
|
||||||
|
"ProjectDBName": "new_project_base.sqlite",
|
||||||
|
"BugReportsDBName": "bug_reports.sqlite",
|
||||||
|
"TestsDBName": "tests.sqlite",
|
||||||
|
"ComponentsWindowWidth": 924,
|
||||||
|
"ComponentsWindowHeight": 250,
|
||||||
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
|
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||||
|
"Visualizer_2Path": "C:\\Users\\misha\\Documents",
|
||||||
|
"InstructionPath": "",
|
||||||
|
"PerformanceAnalyzerPath": "",
|
||||||
|
"ComponentsBackUpsCount": 10,
|
||||||
|
"AutoCheckTesting": true,
|
||||||
|
"CheckTestingIntervalSeconds": 10,
|
||||||
|
"EmailOnTestingProgress": true,
|
||||||
|
"eraseTestingWorkspaces": true,
|
||||||
|
"lastMachineId": 13,
|
||||||
|
"lastUserId": 34,
|
||||||
|
"lastCompilerId": 52
|
||||||
|
}
|
||||||
3
src/Common/ApplicationMode.java
Normal file
3
src/Common/ApplicationMode.java
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package Common;
|
||||||
|
public interface ApplicationMode {
|
||||||
|
}
|
||||||
31
src/Common/CommonConstants.java
Normal file
31
src/Common/CommonConstants.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package Common;
|
||||||
|
import Common.Utils.Vector_;
|
||||||
|
|
||||||
|
import java.util.Vector;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
public class CommonConstants {
|
||||||
|
public static final int Nan = -1;
|
||||||
|
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
|
||||||
|
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
|
||||||
|
//--
|
||||||
|
//-файлы-признаки
|
||||||
|
public static final String LOADED = "LOADED";
|
||||||
|
public static final String STARTED = "STARTED";
|
||||||
|
public static final String ABORTED = "ABORTED";
|
||||||
|
public static final String INTERRUPT = "INTERRUPT"; //файл признак прерывания.
|
||||||
|
public final static String DONE = "DONE";
|
||||||
|
public final static String TIMEOUT = "TIMEOUT";
|
||||||
|
//--
|
||||||
|
public static char[] regular_metasymbols = new char[]{
|
||||||
|
'<', '>', '(', ')', '[', ']', '{', '}', '^', '-', '=', '$', '!', '|', '?', '*', '+', '.'
|
||||||
|
};
|
||||||
|
public static char toStrike = (char) 822;
|
||||||
|
public static char boop = (char) 7;
|
||||||
|
public static Vector<Character> forbidden_file_name_characters = new Vector_<>(
|
||||||
|
'#', '%', '&', '{', '}',
|
||||||
|
'<', '>', '*', '?', '!',
|
||||||
|
'$', '\'', '\"', '@', '+',
|
||||||
|
'`', '|', '=', '#', ':', '/', '\\',
|
||||||
|
'~', '^'
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,494 +0,0 @@
|
|||||||
package Common;
|
|
||||||
import Common.Database.iDBObject;
|
|
||||||
import Common.UI.Themes.VisualiserTheme;
|
|
||||||
import Common.Utils.TextLog;
|
|
||||||
import GlobalData.Account.Account;
|
|
||||||
import GlobalData.Compiler.Compiler;
|
|
||||||
import GlobalData.Machine.Machine;
|
|
||||||
import GlobalData.Makefile.Makefile;
|
|
||||||
import GlobalData.Module.Module;
|
|
||||||
import GlobalData.RemoteFile.RemoteFile;
|
|
||||||
import GlobalData.RunConfiguration.RunConfiguration;
|
|
||||||
import GlobalData.Tasks.CompilationTask.CompilationTask;
|
|
||||||
import GlobalData.Tasks.RunTask.RunTask;
|
|
||||||
import GlobalData.User.User;
|
|
||||||
import ProjectData.Files.DBProjectFile;
|
|
||||||
import ProjectData.Project.db_project_info;
|
|
||||||
import ProjectData.SapforData.Functions.FuncInfo;
|
|
||||||
import ProjectData.SapforData.Regions.ParallelRegion;
|
|
||||||
import Repository.BugReport.BugReport;
|
|
||||||
import Repository.Subscribes.Subscriber;
|
|
||||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
|
||||||
import TestingSystem.DVM.Configuration.Configuration;
|
|
||||||
import TestingSystem.DVM.Tasks.TestCompilationTask;
|
|
||||||
import TestingSystem.DVM.Tasks.TestRunTask;
|
|
||||||
import TestingSystem.DVM.TasksPackage.TasksPackage;
|
|
||||||
import TestingSystem.Common.Test.Test;
|
|
||||||
import Visual_DVM_2021.Passes.UI.PassForm;
|
|
||||||
|
|
||||||
import javax.swing.tree.DefaultMutableTreeNode;
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
public enum Current {
|
|
||||||
Undefined,
|
|
||||||
//--
|
|
||||||
ServerSapfor,
|
|
||||||
SapforTasksPackage,
|
|
||||||
SapforEtalonVersion,//самый левый пакет
|
|
||||||
SapforVersion,
|
|
||||||
//--
|
|
||||||
|
|
||||||
//--
|
|
||||||
ComponentServerBackup,
|
|
||||||
Subscriber,
|
|
||||||
Theme,
|
|
||||||
FileGraphElement,
|
|
||||||
InlineGraphElement,
|
|
||||||
InlineGraphElement2,
|
|
||||||
IncludeGraphElement,
|
|
||||||
Component,
|
|
||||||
Project,
|
|
||||||
File,
|
|
||||||
Root,
|
|
||||||
Version,
|
|
||||||
BugReport,
|
|
||||||
Account,
|
|
||||||
DBArray,
|
|
||||||
ProjectArray,
|
|
||||||
ParallelRegionInfo,
|
|
||||||
ParallelVariant,
|
|
||||||
Machine,
|
|
||||||
User,
|
|
||||||
Compiler,
|
|
||||||
Makefile,
|
|
||||||
Module,
|
|
||||||
RunConfiguration,
|
|
||||||
EnvironmentValue,
|
|
||||||
CompilationTask,
|
|
||||||
RunTask,
|
|
||||||
ProjectNode, //узел в дереве проекта. нужен для отображения добавленных файлов
|
|
||||||
SelectedDirectory,
|
|
||||||
SelectedFile,
|
|
||||||
//текущий выбранный удаленный файл
|
|
||||||
RemoteFile,
|
|
||||||
PassForm, //текущее окно анимации. нужно для сообщений сапфора по сокету.
|
|
||||||
RunStsRecord,
|
|
||||||
//только для того, чтобы закодировать таблицу.
|
|
||||||
Array,
|
|
||||||
ParallelRegion,
|
|
||||||
Dimensions,
|
|
||||||
//----------
|
|
||||||
Warnings,
|
|
||||||
Errors,
|
|
||||||
Notes,
|
|
||||||
Recommendations,
|
|
||||||
//-
|
|
||||||
Sapfor,
|
|
||||||
//-
|
|
||||||
Scenario,
|
|
||||||
ScenarioCommand,
|
|
||||||
//-
|
|
||||||
Configuration,
|
|
||||||
Group,
|
|
||||||
//-
|
|
||||||
DVMParameterValue,
|
|
||||||
Test,
|
|
||||||
Function,
|
|
||||||
SelectedFunction,
|
|
||||||
//-
|
|
||||||
Credentials,
|
|
||||||
TestCompilationTask,
|
|
||||||
TestRunTask,
|
|
||||||
TasksPackage,
|
|
||||||
//-
|
|
||||||
DialogWindow,
|
|
||||||
//-
|
|
||||||
PackageVersion,
|
|
||||||
SapforConfiguration,
|
|
||||||
SapforConfigurationCommand,
|
|
||||||
SapforTask,
|
|
||||||
SapforProfile,
|
|
||||||
SapforProfileSetting,
|
|
||||||
//--
|
|
||||||
ProjectView;
|
|
||||||
//-
|
|
||||||
//---
|
|
||||||
private static final LinkedHashMap<Current, Object> objects = new LinkedHashMap<>();
|
|
||||||
public static Mode mode;
|
|
||||||
public static boolean hasUI() {
|
|
||||||
return Current.mode.equals(Current.Mode.Normal);
|
|
||||||
}
|
|
||||||
public static boolean HasProject() {
|
|
||||||
return get(Project) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasFile() {
|
|
||||||
return get(File) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasSelectedFile() {
|
|
||||||
return get(SelectedFile) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasAccount() {
|
|
||||||
return get(Account) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasMachine() {
|
|
||||||
return get(Machine) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasUser() {
|
|
||||||
return get(User) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasCompiler() {
|
|
||||||
return get(Compiler) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasRemoteFile() {
|
|
||||||
return get(RemoteFile) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasMakefile() {
|
|
||||||
return get(Makefile) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasRunConfiguration() {
|
|
||||||
return get(RunConfiguration) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasCompilationTask() {
|
|
||||||
return get(CompilationTask) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasRunTask() {
|
|
||||||
return get(RunTask) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasPassForm() {
|
|
||||||
return get(PassForm) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasProjectView() {
|
|
||||||
return get(ProjectView) != null;
|
|
||||||
}
|
|
||||||
//для быстрого доступа на чтение. слишком много на нем завязано.
|
|
||||||
public static db_project_info getProject() {
|
|
||||||
return (db_project_info) get(Project);
|
|
||||||
}
|
|
||||||
public static DBProjectFile getFile() {
|
|
||||||
return (DBProjectFile) get(File);
|
|
||||||
}
|
|
||||||
public static Repository.Component.Component getComponent() {
|
|
||||||
return (Repository.Component.Component) get(Component);
|
|
||||||
}
|
|
||||||
public static Repository.BugReport.BugReport getBugReport() {
|
|
||||||
return (BugReport) get(BugReport);
|
|
||||||
}
|
|
||||||
public static db_project_info getRoot() {
|
|
||||||
return (db_project_info) get(Root);
|
|
||||||
}
|
|
||||||
public static boolean HasRoot() {
|
|
||||||
return get(Root) != null;
|
|
||||||
}
|
|
||||||
public static db_project_info getVersion() {
|
|
||||||
return (db_project_info) get(Version);
|
|
||||||
}
|
|
||||||
public static Account getAccount() {
|
|
||||||
return (Account) get(Account);
|
|
||||||
}
|
|
||||||
public static boolean HasSubscriber() {
|
|
||||||
return get(Current.Subscriber) != null;
|
|
||||||
}
|
|
||||||
public static Repository.Subscribes.Subscriber getSubscriber() {
|
|
||||||
return (Subscriber) get(Current.Subscriber);
|
|
||||||
}
|
|
||||||
public static Machine getMachine() {
|
|
||||||
return (Machine) get(Current.Machine);
|
|
||||||
}
|
|
||||||
public static User getUser() {
|
|
||||||
return (User) get(Current.User);
|
|
||||||
}
|
|
||||||
public static Compiler getCompiler() {
|
|
||||||
return (Compiler) get(Current.Compiler);
|
|
||||||
}
|
|
||||||
public static CompilationTask getCompilationTask() {
|
|
||||||
return (CompilationTask) get(Current.CompilationTask);
|
|
||||||
}
|
|
||||||
public static RunTask getRunTask() {
|
|
||||||
return (RunTask) get(Current.RunTask);
|
|
||||||
}
|
|
||||||
public static RemoteFile getRemoteFile() {
|
|
||||||
return (RemoteFile) get(Current.RemoteFile);
|
|
||||||
}
|
|
||||||
public static Makefile getMakefile() {
|
|
||||||
return (Makefile) get(Current.Makefile);
|
|
||||||
}
|
|
||||||
public static Module getModule() {
|
|
||||||
return (Module) get(Current.Module);
|
|
||||||
}
|
|
||||||
public static RunConfiguration getRunConfiguration() {
|
|
||||||
return (RunConfiguration) get(Current.RunConfiguration);
|
|
||||||
}
|
|
||||||
public static Repository.Component.Sapfor.Sapfor getSapfor() {
|
|
||||||
return (Repository.Component.Sapfor.Sapfor) get(Current.Sapfor);
|
|
||||||
}
|
|
||||||
public static boolean HasGroup() {
|
|
||||||
return get(Current.Group) != null;
|
|
||||||
}
|
|
||||||
public static TestingSystem.Common.Group.Group getGroup() {
|
|
||||||
return (TestingSystem.Common.Group.Group) get(Current.Group);
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
public static boolean HasConfiguration() {
|
|
||||||
return get(Current.Configuration) != null;
|
|
||||||
}
|
|
||||||
public static TestingSystem.DVM.Configuration.Configuration getConfiguration() {
|
|
||||||
return (Configuration) get(Current.Configuration);
|
|
||||||
}
|
|
||||||
public static SapforConfiguration getSapforConfiguration() {
|
|
||||||
return (TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration) get(Current.SapforConfiguration);
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
public static Test getTest() {
|
|
||||||
return (TestingSystem.Common.Test.Test) get(Current.Test);
|
|
||||||
}
|
|
||||||
public static boolean HasTest() {
|
|
||||||
return get(Current.Test) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasVersion() {
|
|
||||||
return get(Current.Version) != null;
|
|
||||||
}
|
|
||||||
public static TestCompilationTask getTestCompilationTask() {
|
|
||||||
return (TestingSystem.DVM.Tasks.TestCompilationTask) get(Current.TestCompilationTask);
|
|
||||||
}
|
|
||||||
public static boolean HasTestCompilationTask() {
|
|
||||||
return get(Current.TestCompilationTask) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasTestRunTask() {
|
|
||||||
return get(Current.TestRunTask) != null;
|
|
||||||
}
|
|
||||||
public static TestRunTask getTestRunTask() {
|
|
||||||
return (TestingSystem.DVM.Tasks.TestRunTask) get(Current.TestRunTask);
|
|
||||||
}
|
|
||||||
public static RemoteFile getComponentServerBackup() {
|
|
||||||
return (RemoteFile) get(Current.ComponentServerBackup);
|
|
||||||
}
|
|
||||||
public static boolean HasComponentServerBackup() {
|
|
||||||
return get(Current.ComponentServerBackup) != null;
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
public static DefaultMutableTreeNode getProjectNode() {
|
|
||||||
return (DefaultMutableTreeNode) get(Current.ProjectNode);
|
|
||||||
}
|
|
||||||
public static DefaultMutableTreeNode getProjectCurrentParentNode() {
|
|
||||||
DefaultMutableTreeNode node = Current.getProjectNode();
|
|
||||||
//если в дереве еще никто не выделялся, берем корень.
|
|
||||||
if (node == null)
|
|
||||||
return Current.getProject().filesTreeRoot;
|
|
||||||
return (node.getUserObject() instanceof DBProjectFile) ? (DefaultMutableTreeNode) node.getParent() : node;
|
|
||||||
}
|
|
||||||
public static File getSelectedDirectory() {
|
|
||||||
return (File) get(Current.SelectedDirectory);
|
|
||||||
}
|
|
||||||
public static DBProjectFile getSelectedFile() {
|
|
||||||
return (DBProjectFile) get(Current.SelectedFile);
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
public static boolean HasBugReport() {
|
|
||||||
return get(Current.BugReport) != null;
|
|
||||||
}
|
|
||||||
public static PassForm getPassForm() {
|
|
||||||
return (Visual_DVM_2021.Passes.UI.PassForm) get(Current.PassForm);
|
|
||||||
}
|
|
||||||
public static VisualiserTheme getTheme() {
|
|
||||||
return (VisualiserTheme) get(Current.Theme);
|
|
||||||
}
|
|
||||||
//--------------------------------------------------------------------------------
|
|
||||||
public static ParallelRegion getParallelRegion() {
|
|
||||||
return (ParallelRegion) get(Current.ParallelRegion);
|
|
||||||
}
|
|
||||||
public static boolean HasParallelRegion() {
|
|
||||||
return get(Current.ParallelRegion) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasFunction() {
|
|
||||||
return get(Current.Function) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasSelectedFunction() {
|
|
||||||
return get(Current.SelectedFunction) != null;
|
|
||||||
}
|
|
||||||
public static FuncInfo getFunction() {
|
|
||||||
return (FuncInfo) get(Current.Function);
|
|
||||||
}
|
|
||||||
public static FuncInfo getSelectionFunction() {
|
|
||||||
return (FuncInfo) get(Current.SelectedFunction);
|
|
||||||
}
|
|
||||||
public static boolean HasTasksPackage() {
|
|
||||||
return get(Current.TasksPackage) != null;
|
|
||||||
}
|
|
||||||
public static TasksPackage getTasksPackage() {
|
|
||||||
return (TasksPackage) get(Current.TasksPackage);
|
|
||||||
}
|
|
||||||
public static boolean HasScenario() {
|
|
||||||
return get(Current.Scenario) != null;
|
|
||||||
}
|
|
||||||
public static db_project_info getPackageVersion() {
|
|
||||||
return (db_project_info) get(Current.PackageVersion);
|
|
||||||
}
|
|
||||||
public static boolean HasPackageVersion() {
|
|
||||||
return get(Current.PackageVersion) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasSapforConfiguration() {
|
|
||||||
return get(Current.SapforConfiguration) != null;
|
|
||||||
}
|
|
||||||
public static boolean HasSapforTask() {
|
|
||||||
return get(Current.SapforTask) != null;
|
|
||||||
}
|
|
||||||
public static TestingSystem.SAPFOR.SapforTask.SapforTask getSapforTask() {
|
|
||||||
return (TestingSystem.SAPFOR.SapforTask.SapforTask) get(Current.SapforTask);
|
|
||||||
}
|
|
||||||
public static ProjectData.ProjectView getProjectView() {
|
|
||||||
return (ProjectData.ProjectView) get(ProjectView);
|
|
||||||
}
|
|
||||||
public static boolean Check(TextLog Log, Current... names) {
|
|
||||||
for (Current name : names)
|
|
||||||
if (get(name) == null)
|
|
||||||
Log.Writeln_(name.getDescription() + " не выбран(а)");
|
|
||||||
return Log.isEmpty();
|
|
||||||
}
|
|
||||||
public static void CreateAll() {
|
|
||||||
for (Current c : values())
|
|
||||||
objects.put(c, null);
|
|
||||||
}
|
|
||||||
//-----------------------------------------
|
|
||||||
public static Object get(Current name) {
|
|
||||||
return objects.get(name);
|
|
||||||
}
|
|
||||||
public static Object set(Current name, Object object) {
|
|
||||||
objects.replace(name, object);
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
//применять только для наследников iDBObject
|
|
||||||
public static boolean CheckID(Current name, int id) {
|
|
||||||
return (get(name) != null) && (((iDBObject) get(name)).id == id);
|
|
||||||
}
|
|
||||||
public static TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand getSapforConfigurationCommand() {
|
|
||||||
return (TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand) get(Current.SapforConfigurationCommand);
|
|
||||||
}
|
|
||||||
public static boolean HasSapforProfile() {
|
|
||||||
return get(Current.SapforProfile) != null;
|
|
||||||
}
|
|
||||||
public static GlobalData.SapforProfile.SapforProfile getSapforProfile() {
|
|
||||||
return (GlobalData.SapforProfile.SapforProfile) get(Current.SapforProfile);
|
|
||||||
}
|
|
||||||
public static boolean HasSapforTasksPackage() {
|
|
||||||
return get(Current.SapforTasksPackage) != null;
|
|
||||||
}
|
|
||||||
public static TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage getSapforTasksPackage() {
|
|
||||||
return (TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage) get(Current.SapforTasksPackage);
|
|
||||||
}
|
|
||||||
//сапфоры установленные на тестовый сервер.
|
|
||||||
public static boolean HasServerSapfor() {
|
|
||||||
return get(Current.ServerSapfor) != null;
|
|
||||||
}
|
|
||||||
public static TestingSystem.SAPFOR.ServerSapfor.ServerSapfor getServerSapfor() {
|
|
||||||
return (TestingSystem.SAPFOR.ServerSapfor.ServerSapfor) get(Current.ServerSapfor);
|
|
||||||
}
|
|
||||||
//--------------------------------------------
|
|
||||||
public String getDescription() {
|
|
||||||
switch (this) {
|
|
||||||
case ServerSapfor:
|
|
||||||
return "тестовая версия SAPFOR";
|
|
||||||
case SapforTasksPackage:
|
|
||||||
return "пакет задач SAPFOR";
|
|
||||||
case SapforProfile:
|
|
||||||
return "Профиль SAPFOR";
|
|
||||||
case SapforProfileSetting:
|
|
||||||
return "Настройка профиля SAPFOR";
|
|
||||||
case SapforEtalonVersion:
|
|
||||||
return "Версия SAPFOR(Эталон)";
|
|
||||||
case SapforVersion:
|
|
||||||
return "Версия SAPFOR";
|
|
||||||
case ComponentServerBackup:
|
|
||||||
return "Версия компонента для восстановления с сервера";
|
|
||||||
case Subscriber:
|
|
||||||
return "Адресат";
|
|
||||||
case SapforTask:
|
|
||||||
return "Задача SAPFOR";
|
|
||||||
case SelectedFunction:
|
|
||||||
return "Выбранный узел графа процедур";
|
|
||||||
case SapforConfigurationCommand:
|
|
||||||
return "Команда конфигурации тестирования SAPFOR";
|
|
||||||
case SapforConfiguration:
|
|
||||||
return "Конфигурация тестирования SAPFOR";
|
|
||||||
case PackageVersion:
|
|
||||||
return "Версия пакетного режима";
|
|
||||||
case TasksPackage:
|
|
||||||
return "Пакет задач";
|
|
||||||
case Credentials:
|
|
||||||
return "Учётные данные";
|
|
||||||
case Function:
|
|
||||||
return "Функция";
|
|
||||||
case TestRunTask:
|
|
||||||
return "Задача на запуск теста";
|
|
||||||
case TestCompilationTask:
|
|
||||||
return "Задача на компиляцию теста";
|
|
||||||
case DVMParameterValue:
|
|
||||||
return "Параметр DVM системы";
|
|
||||||
case ParallelRegion:
|
|
||||||
return "Область распараллеливания";
|
|
||||||
case Group:
|
|
||||||
return "Группа тестов DVM";
|
|
||||||
case Scenario:
|
|
||||||
return "Сценарий";
|
|
||||||
case ScenarioCommand:
|
|
||||||
return "Команда сценария";
|
|
||||||
case ProjectNode:
|
|
||||||
return "текущий узел дерева проектов"; //служебка
|
|
||||||
case Test:
|
|
||||||
return "Тест";
|
|
||||||
case Sapfor:
|
|
||||||
return "SAPFOR";
|
|
||||||
case Theme:
|
|
||||||
return "Тема";
|
|
||||||
case EnvironmentValue:
|
|
||||||
return "Значение переменной окружения";
|
|
||||||
case SelectedDirectory:
|
|
||||||
return "Папка проекта";
|
|
||||||
case SelectedFile:
|
|
||||||
return "Файл проекта";
|
|
||||||
case RunConfiguration:
|
|
||||||
return "Конфигурация запуска";
|
|
||||||
case RunTask:
|
|
||||||
return "Задача на запуск";
|
|
||||||
case CompilationTask:
|
|
||||||
return "Задача на компиляцию";
|
|
||||||
case Makefile:
|
|
||||||
return "Мейкфайл";
|
|
||||||
case Module:
|
|
||||||
return "Языковой модуль мейкфайла";
|
|
||||||
case RemoteFile:
|
|
||||||
return "Удалённый файл";
|
|
||||||
case Component:
|
|
||||||
return "Компонент";
|
|
||||||
case Project:
|
|
||||||
return "Проект";
|
|
||||||
case File:
|
|
||||||
return "Файл";
|
|
||||||
case Root:
|
|
||||||
return "Корень дерева версий";
|
|
||||||
case Version:
|
|
||||||
return "Версия";
|
|
||||||
case BugReport:
|
|
||||||
return "Отчёт об ошибке";
|
|
||||||
case Account:
|
|
||||||
return "Аккаунт";
|
|
||||||
case Machine:
|
|
||||||
return "Машина";
|
|
||||||
case User:
|
|
||||||
return "Пользователь";
|
|
||||||
case Compiler:
|
|
||||||
return "Компилятор";
|
|
||||||
case DialogWindow:
|
|
||||||
return "Диалоговое окно";
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//---
|
|
||||||
public enum Mode {
|
|
||||||
Undefined,
|
|
||||||
Normal,
|
|
||||||
Server,
|
|
||||||
Testing,
|
|
||||||
Package
|
|
||||||
}
|
|
||||||
}
|
|
||||||
6
src/Common/Current_.java
Normal file
6
src/Common/Current_.java
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package Common;
|
||||||
|
public interface Current_ {
|
||||||
|
default String getDescription() {
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package Common.Database;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
public abstract class DBTable<K, D extends DBObject> extends DataSet<K, D> {
|
|
||||||
//-
|
|
||||||
public DBTableColumn PK = null;
|
|
||||||
private Database db = null; //база данных - владелец таблицы.
|
|
||||||
public DBTable(Class<K> k_in, Class<D> d_in) {
|
|
||||||
super(k_in, d_in);
|
|
||||||
for (Field field : d.getFields()) {
|
|
||||||
DBTableColumn column = new DBTableColumn(field);
|
|
||||||
if ((!column.Ignore) && !columns.containsKey(column.Name)) {
|
|
||||||
columns.put(column.Name, column);
|
|
||||||
if (column.PrimaryKey) PK = column;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Database getDb() {
|
|
||||||
return db;
|
|
||||||
}
|
|
||||||
public void setDb(Database db_in) {
|
|
||||||
db = db_in;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getPKName() {
|
|
||||||
return PK.Name;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder res = new StringBuilder(Name + "\n");
|
|
||||||
for (DBTableColumn c : columns.values())
|
|
||||||
res.append(c).append("\n");
|
|
||||||
return res.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,253 +0,0 @@
|
|||||||
package Common.Database;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.UI.DataSetControlForm;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Common.UI.Tables.ColumnFilter;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
|
||||||
import Common.UI.Windows.Dialog.DialogFields;
|
|
||||||
import Common.Utils.TextLog;
|
|
||||||
import Visual_DVM_2021.UI.Interface.FilterWindow;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Vector;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
|
||||||
//-
|
|
||||||
public static LinkedHashMap<Class, Object> selections = new LinkedHashMap<>();
|
|
||||||
//-
|
|
||||||
public String Name;
|
|
||||||
public Class<K> k; //класс первичного ключа.
|
|
||||||
public Class<D> d; //класс объектов.
|
|
||||||
public LinkedHashMap<K, D> Data = new LinkedHashMap<>(); //наполнение
|
|
||||||
//-
|
|
||||||
//<editor-fold desc="UI таблица">
|
|
||||||
public DataSetControlForm ui_;
|
|
||||||
protected FilterWindow f_ui;
|
|
||||||
//</editor-fold>
|
|
||||||
//-
|
|
||||||
public LinkedHashMap<Integer, ColumnFilter> columnsFilters = new LinkedHashMap<>();
|
|
||||||
public DataSet(Class<K> k_in, Class<D> d_in) {
|
|
||||||
k = k_in;
|
|
||||||
d = d_in;
|
|
||||||
Name = d.getSimpleName();
|
|
||||||
}
|
|
||||||
public void mountUI(JPanel content_in) {
|
|
||||||
UI.Clear(content_in);
|
|
||||||
//-->
|
|
||||||
ui_ = createUI();
|
|
||||||
ui_.setContent(content_in);
|
|
||||||
//-->
|
|
||||||
if (UI.menuBars.containsKey(getClass())) {
|
|
||||||
DataMenuBar bar = UI.menuBars.get(getClass());
|
|
||||||
content_in.add(bar, BorderLayout.NORTH);
|
|
||||||
setFilterUI(count -> UI.menuBars.get(getClass()).countLabel.setText(String.valueOf(count)));
|
|
||||||
if (ui_.hasCheckBox())
|
|
||||||
bar.createSelectionButtons(this);
|
|
||||||
}
|
|
||||||
content_in.add(ui_.getDataPanel(), BorderLayout.CENTER);
|
|
||||||
}
|
|
||||||
public DataSetControlForm getUi() {
|
|
||||||
return ui_;
|
|
||||||
}
|
|
||||||
public void setFilterUI(FilterWindow ui_in) {
|
|
||||||
f_ui = ui_in;
|
|
||||||
}
|
|
||||||
public void ShowUI() {
|
|
||||||
if (ui_ != null) {
|
|
||||||
ui_.Show();
|
|
||||||
if (f_ui != null)
|
|
||||||
f_ui.ShowMatchesCount(getRowCountUI());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void ShowUI(Object key) {
|
|
||||||
if (ui_ != null) {
|
|
||||||
ui_.Show(key);
|
|
||||||
if (f_ui != null)
|
|
||||||
f_ui.ShowMatchesCount(getRowCountUI());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void ClearUI() {
|
|
||||||
if ((ui_ != null) && ui_.isShown()) {
|
|
||||||
ui_.ClearSelection();
|
|
||||||
ui_.Clear();
|
|
||||||
if (f_ui != null)
|
|
||||||
f_ui.ShowNoMatches();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void RefreshUI() {
|
|
||||||
if (ui_ != null) ui_.Refresh();
|
|
||||||
}
|
|
||||||
public int getRowCountUI() {
|
|
||||||
return ui_.getRowCount();
|
|
||||||
}
|
|
||||||
public void SetCurrentObjectUI(Object pk) {
|
|
||||||
if (ui_ != null) {
|
|
||||||
//todo возможно проверить, что текущий объект уже соответствует ключу, и если да, то ничего делать.
|
|
||||||
ui_.ClearSelection(); //сброс текущего объекта и всего что с ним связано.
|
|
||||||
ui_.Select(pk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//столбы/ потом переименовать обратно в getUIColumnNames.сейчас так для скорости переноса.
|
|
||||||
public String[] getUIColumnNames() {
|
|
||||||
return new String[]{};
|
|
||||||
}
|
|
||||||
protected DataSetControlForm createUI() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public boolean hasUI() {
|
|
||||||
return ui_ != null;
|
|
||||||
}
|
|
||||||
public void CheckAll(boolean flag) {
|
|
||||||
for (D object : Data.values()) {
|
|
||||||
if (object.isVisible())
|
|
||||||
object.Select(flag);
|
|
||||||
}
|
|
||||||
RefreshUI();
|
|
||||||
}
|
|
||||||
public D getFirstRecord() {
|
|
||||||
return Data.values().stream().findFirst().orElse(null);
|
|
||||||
}
|
|
||||||
public Vector<D> getOrderedRecords(Comparator<D> comparator) {
|
|
||||||
Vector<D> res = new Vector<>(Data.values());
|
|
||||||
res.sort(comparator);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public DBObjectDialog<D, ? extends DialogFields> getDialog() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public boolean ShowAddObjectDialog(DBObject object) {
|
|
||||||
return getDialog().ShowDialog(getSingleDescription() + ": добавление", object);
|
|
||||||
}
|
|
||||||
public boolean ShowEditObjectDialog(DBObject object) {
|
|
||||||
DBObjectDialog dialog = getDialog();
|
|
||||||
dialog.edit = true;
|
|
||||||
dialog.SetEditLimits();
|
|
||||||
return dialog.ShowDialog(getSingleDescription() + ": редактирование", object);
|
|
||||||
}
|
|
||||||
public boolean ViewObject(DBObject object) {
|
|
||||||
DBObjectDialog dialog = getDialog();
|
|
||||||
dialog.SetReadonly();
|
|
||||||
dialog.ShowDialog(getSingleDescription() + ": просмотр", object);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public boolean ShowDeleteObjectDialog(DBObject object) {
|
|
||||||
return UI.Warning(getSingleDescription() + " " + object.getBDialogName() + " будет удален(а)");
|
|
||||||
}
|
|
||||||
public String QName() {
|
|
||||||
return "\"" + Name + "\"";
|
|
||||||
}
|
|
||||||
public String getPKName() {
|
|
||||||
return "";
|
|
||||||
} //получить имя ключевого поля. нужно для таблиц.
|
|
||||||
public String getPluralDescription() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
public String getSingleDescription() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
//времянки
|
|
||||||
public Current CurrentName() {
|
|
||||||
return Current.Undefined;
|
|
||||||
}
|
|
||||||
public boolean CheckCurrent(TextLog log) {
|
|
||||||
return Current.Check(log, CurrentName());
|
|
||||||
}
|
|
||||||
public boolean hasCurrent() {
|
|
||||||
return Current.get(CurrentName()) != null;
|
|
||||||
}
|
|
||||||
public void dropCurrent() {
|
|
||||||
Current.set(CurrentName(), null);
|
|
||||||
}
|
|
||||||
public D getCurrent() {
|
|
||||||
return (D) Current.get(CurrentName());
|
|
||||||
}
|
|
||||||
public void setCurrent(D o) {
|
|
||||||
Current.set(CurrentName(), o);
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
public void put(Object key, D object) {
|
|
||||||
Data.put((K) key, object);
|
|
||||||
}
|
|
||||||
public D get(Object key) {
|
|
||||||
return Data.get(key);
|
|
||||||
}
|
|
||||||
public Object getFieldAt(D object, int columnIndex) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public void clear() {
|
|
||||||
Data.clear();
|
|
||||||
}
|
|
||||||
public int size() {
|
|
||||||
return Data.size();
|
|
||||||
}
|
|
||||||
public boolean containsKey(Object key) {
|
|
||||||
return Data.containsKey(key);
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
public Vector<K> getVisibleKeys() {
|
|
||||||
Comparator<D> comparator = getComparator();
|
|
||||||
Vector<K> res = new Vector<>();
|
|
||||||
if (comparator == null) {
|
|
||||||
for (K key : Data.keySet())
|
|
||||||
if (Data.get(key).isVisible())
|
|
||||||
res.add(key);
|
|
||||||
} else {
|
|
||||||
Vector<D> raw = new Vector<>();
|
|
||||||
for (D object : Data.values()) {
|
|
||||||
if (object.isVisible())
|
|
||||||
raw.add(object);
|
|
||||||
}
|
|
||||||
raw.sort(comparator);
|
|
||||||
for (D object : raw)
|
|
||||||
res.add((K) object.getPK());
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
protected Comparator<D> getComparator() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public int getCheckedCount() {
|
|
||||||
return (int) Data.values().stream().filter(d -> d.isVisible() && d.isSelected()).count();
|
|
||||||
}
|
|
||||||
public Vector<D> getCheckedItems() {
|
|
||||||
return Data.values().stream().filter(d -> d.isVisible() && d.isSelected()).collect(Collectors.toCollection(Vector::new));
|
|
||||||
}
|
|
||||||
public Vector<K> getCheckedKeys() {
|
|
||||||
return Data.values().stream().filter(DBObject::isSelected).map(d -> (K) d.getPK()).collect(Collectors.toCollection(Vector::new));
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
public void SaveLastSelections() {
|
|
||||||
if (hasUI()) {
|
|
||||||
Object lastPk = null;
|
|
||||||
if ((CurrentName() != Current.Undefined) && (getCurrent() != null))
|
|
||||||
lastPk = getCurrent().getPK();
|
|
||||||
if (!selections.containsKey(getClass()))
|
|
||||||
selections.put(getClass(), lastPk);
|
|
||||||
else selections.replace(getClass(), lastPk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void RestoreLastSelections() {
|
|
||||||
if (hasUI()) {
|
|
||||||
Object lastPk = selections.get(getClass());
|
|
||||||
// if (lastPk != null) UI.Info(this.getClass() + ":" + lastPk.toString());
|
|
||||||
if ((CurrentName() != Current.Undefined) && (lastPk != null)) {
|
|
||||||
// UI.Info(lastPk.toString());
|
|
||||||
// System.out.println(ui);
|
|
||||||
// UI.Info("+");
|
|
||||||
ui_.Select(lastPk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//---
|
|
||||||
// применить значение фильтра к фильру объекта напирмер Message.filterValue = text;
|
|
||||||
public void changeColumnFilterValue(int columnIndex, String text) {
|
|
||||||
}
|
|
||||||
public Object getColumnFilterValue(int columnIndex) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
package Common.Database;
|
package Common.Database;
|
||||||
import Common.Constants;
|
import Common.CommonConstants;
|
||||||
import Common.Global;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Utils.Utils;
|
import Common.Database.Objects.iDBObject;
|
||||||
import Repository.RepositoryRefuseException;
|
import Common.Database.Tables.DBTable;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Common.Database.Tables.DataSet;
|
||||||
|
import Common.Passes.PassCode_;
|
||||||
|
import Common.Utils.TextLog;
|
||||||
|
import Common.Utils.Utils_;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@@ -11,11 +15,14 @@ import java.util.Vector;
|
|||||||
//самый общий интерфейс базы данных, независимо от реализации.
|
//самый общий интерфейс базы данных, независимо от реализации.
|
||||||
public abstract class Database {
|
public abstract class Database {
|
||||||
//------------------------------
|
//------------------------------
|
||||||
public LinkedHashMap<Class<? extends DBObject>, DBTable> tables = new LinkedHashMap<>(); //таблицы
|
protected LinkedHashMap<Class<? extends DBObject>, DBTable> tables = new LinkedHashMap<>(); //таблицы
|
||||||
protected File file = null;
|
protected File file = null;
|
||||||
public Database(File file_in) {
|
public Database(File file_in) {
|
||||||
file = file_in;
|
file = file_in;
|
||||||
}
|
}
|
||||||
|
public <T extends DBObject> DBTable<?, T> getTable(Class<T> tableClass) {
|
||||||
|
return tables.get(tableClass);
|
||||||
|
}
|
||||||
public File getFile() {
|
public File getFile() {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
@@ -27,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 {
|
||||||
@@ -81,7 +94,7 @@ public abstract class Database {
|
|||||||
public DBObject InsertS(DBObject object) throws Exception {
|
public DBObject InsertS(DBObject object) throws Exception {
|
||||||
DBTable table = tables.get(object.getClass());
|
DBTable table = tables.get(object.getClass());
|
||||||
if (!(object instanceof iDBObject) && table.Data.containsKey(object.getPK()))
|
if (!(object instanceof iDBObject) && table.Data.containsKey(object.getPK()))
|
||||||
throw new RepositoryRefuseException("Таблица " + Utils.Brackets(table.Name) + " уже содержит объект с ключом " + Utils.Brackets(object.getPK().toString()));
|
throw new RepositoryRefuseException("Таблица " + Utils_.Brackets(table.getName()) + " уже содержит объект с ключом " + Utils_.Brackets(object.getPK().toString()));
|
||||||
insert(table, object);
|
insert(table, object);
|
||||||
table.Data.put(object.getPK(), object);
|
table.Data.put(object.getPK(), object);
|
||||||
return object;
|
return object;
|
||||||
@@ -108,7 +121,7 @@ public abstract class Database {
|
|||||||
table.Data.remove(o.getPK());
|
table.Data.remove(o.getPK());
|
||||||
return o;
|
return o;
|
||||||
} else
|
} else
|
||||||
throw new RepositoryRefuseException("Таблица " + Utils.Brackets(table.Name) + " не содержит объект с ключом " + Utils.Brackets(to_delete.getPK().toString()));
|
throw new RepositoryRefuseException("Таблица " + Utils_.Brackets(table.getName()) + " не содержит объект с ключом " + Utils_.Brackets(to_delete.getPK().toString()));
|
||||||
}
|
}
|
||||||
public DBObject DeleteByPK(Class object_class, Object key) throws Exception {
|
public DBObject DeleteByPK(Class object_class, Object key) throws Exception {
|
||||||
DBTable table = tables.get(object_class);
|
DBTable table = tables.get(object_class);
|
||||||
@@ -118,7 +131,7 @@ public abstract class Database {
|
|||||||
table.Data.remove(key);
|
table.Data.remove(key);
|
||||||
return o;
|
return o;
|
||||||
} else
|
} else
|
||||||
throw new RepositoryRefuseException("Таблица " + Utils.Brackets(table.Name) + " не содержит объект с ключом " + Utils.Brackets(key.toString()));
|
throw new RepositoryRefuseException("Таблица " + Utils_.Brackets(table.getName()) + " не содержит объект с ключом " + Utils_.Brackets(key.toString()));
|
||||||
}
|
}
|
||||||
// не работает с автоинкрементом.
|
// не работает с автоинкрементом.
|
||||||
public DBObject getObjectCopyByPK(Class table_class, Object pk) throws Exception {
|
public DBObject getObjectCopyByPK(Class table_class, Object pk) throws Exception {
|
||||||
@@ -168,19 +181,19 @@ public abstract class Database {
|
|||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
//<editor-fold desc="работа с внешними ключами">
|
//<editor-fold desc="работа с внешними ключами">
|
||||||
public <O extends DBObject, F extends DBObject> Vector<DBObject> getVectorByFK(O owner, Class<F> fk_class) {
|
public <O extends DBObject, F extends DBObject> Vector<F> getVectorByFK(O owner, Class<F> fk_class) {
|
||||||
Vector<DBObject> res = new Vector<>();
|
Vector<F> res = new Vector<>();
|
||||||
try {
|
try {
|
||||||
for (Object o : tables.get(fk_class).Data.values()) {
|
for (Object o : tables.get(fk_class).Data.values()) {
|
||||||
if (fk_class.getField(owner.getFKName()).get(o).equals(owner.getPK())) res.add((DBObject) o);
|
if (fk_class.getField(owner.getFKName()).get(o).equals(owner.getPK())) res.add((F) o);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Global.Log.PrintException(e);
|
Utils_.MainLog.PrintException(e);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
public <F extends DBObject> void DeleteByFK(DBObject master, Class<F> fk_class) throws Exception {
|
public <F extends DBObject> void DeleteByFK(DBObject master, Class<F> fk_class) throws Exception {
|
||||||
Vector<DBObject> to_delete = getVectorByFK(master, fk_class);
|
Vector<F> to_delete = getVectorByFK(master, fk_class);
|
||||||
BeginTransaction();
|
BeginTransaction();
|
||||||
for (DBObject object : to_delete)
|
for (DBObject object : to_delete)
|
||||||
Delete(object);
|
Delete(object);
|
||||||
@@ -188,7 +201,7 @@ public abstract class Database {
|
|||||||
}
|
}
|
||||||
//-----------
|
//-----------
|
||||||
public <F extends DBObject> void DropByFK(DBObject master, Class<F> fk_class) throws Exception {
|
public <F extends DBObject> void DropByFK(DBObject master, Class<F> fk_class) throws Exception {
|
||||||
Vector<DBObject> to_drop = getVectorByFK(master, fk_class);
|
Vector<F> to_drop = getVectorByFK(master, fk_class);
|
||||||
BeginTransaction();
|
BeginTransaction();
|
||||||
for (DBObject object : to_drop) {
|
for (DBObject object : to_drop) {
|
||||||
fk_class.getField(master.getFKName()).set(object, master.getEmptyFK());
|
fk_class.getField(master.getFKName()).set(object, master.getEmptyFK());
|
||||||
@@ -204,13 +217,27 @@ public abstract class Database {
|
|||||||
if (fk_class.getField(owner.getFKName()).get(f).equals(owner.getPK())) res.put((K) f.getPK(), f);
|
if (fk_class.getField(owner.getFKName()).get(f).equals(owner.getPK())) res.put((K) f.getPK(), f);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Global.Log.PrintException(e);
|
Utils_.MainLog.PrintException(e);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
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<>();
|
||||||
@@ -219,7 +246,7 @@ public abstract class Database {
|
|||||||
if (fk_class.getField(owner.getFKName()).get(o).equals(owner.getPK())) res.add(o.toString());
|
if (fk_class.getField(owner.getFKName()).get(o).equals(owner.getPK())) res.add(o.toString());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Global.Log.PrintException(e);
|
Utils_.MainLog.PrintException(e);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -229,7 +256,7 @@ public abstract class Database {
|
|||||||
(O) (tables.get(class_in).Data.get(pk)) : null;
|
(O) (tables.get(class_in).Data.get(pk)) : null;
|
||||||
}
|
}
|
||||||
public <O extends iDBObject> O getById(Class<O> class_in, int pk) {
|
public <O extends iDBObject> O getById(Class<O> class_in, int pk) {
|
||||||
return getByPK(class_in, pk, Constants.Nan);
|
return getByPK(class_in, pk, CommonConstants.Nan);
|
||||||
}
|
}
|
||||||
public <G, O extends DBObject, F extends DBObject> LinkedHashMap<G, F> getByFKAndGroupBy(O owner, Class<F> fk_class, String group_field, Class<G> group_class) {
|
public <G, O extends DBObject, F extends DBObject> LinkedHashMap<G, F> getByFKAndGroupBy(O owner, Class<F> fk_class, String group_field, Class<G> group_class) {
|
||||||
LinkedHashMap<G, F> res = new LinkedHashMap<>();
|
LinkedHashMap<G, F> res = new LinkedHashMap<>();
|
||||||
@@ -240,7 +267,7 @@ public abstract class Database {
|
|||||||
res.put((G) (fk_class.getField(group_field).get(f)), f);
|
res.put((G) (fk_class.getField(group_field).get(f)), f);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Global.Log.PrintException(e);
|
Utils_.MainLog.PrintException(e);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -267,13 +294,63 @@ public abstract class Database {
|
|||||||
protected abstract void resetAI(DBTable table) throws Exception;
|
protected abstract void resetAI(DBTable table) throws Exception;
|
||||||
//-
|
//-
|
||||||
public void SaveLastSelections() {
|
public void SaveLastSelections() {
|
||||||
for (DataSet dataSet : tables.values())
|
for (DataSet dataSet : tables.values()) {
|
||||||
dataSet.SaveLastSelections();
|
if (dataSet.getUI() != null)
|
||||||
|
dataSet.getUI().SaveLastCurrent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void RestoreLastSelections() {
|
public void RestoreLastSelections() {
|
||||||
for (DataSet dataSet : tables.values())
|
for (DataSet dataSet : tables.values()) {
|
||||||
dataSet.RestoreLastSelections();
|
if (dataSet.getUI() != null)
|
||||||
|
dataSet.getUI().RestoreLastCurrent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
public abstract PassCode_2021 getSynchronizePassCode(); //если бд есть на сервере.
|
public boolean CheckCurrent(TextLog log, Class... tablesClasses) {
|
||||||
|
for (Class tableClass : tablesClasses) {
|
||||||
|
DBTable table = getTable(tableClass);
|
||||||
|
if (table.getUI() != null)
|
||||||
|
table.getUI().CheckCurrent(log);
|
||||||
|
}
|
||||||
|
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 void ReplaceFileAndReconnect(File file_in) throws Exception {
|
||||||
|
Disconnect();
|
||||||
|
Utils_.forceDeleteWithCheck(getFile());
|
||||||
|
FileUtils.moveFile(file_in, getFile());
|
||||||
|
Connect();
|
||||||
|
prepareTablesStatements();
|
||||||
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,31 @@
|
|||||||
package GlobalData.FormsParams;
|
package Common.Database.Objects.DBForm;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.UI.Windows.FormType;
|
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
public class DBForm extends DBObject {
|
public class DBForm extends DBObject {
|
||||||
@Description("PRIMARY KEY,UNIQUE, NOT NULL")
|
@Description("PRIMARY KEY,UNIQUE, NOT NULL")
|
||||||
public FormType type = FormType.Undefined;
|
public String type = null;
|
||||||
public int X = 0;
|
public int X = 0;
|
||||||
public int Y = 0;
|
public int Y = 0;
|
||||||
public int Width = 0;
|
public int Width = 0;
|
||||||
public int Height = 0;
|
public int Height = 0;
|
||||||
public DBForm(FormType type_, Window window) {
|
public DBForm(String type_, Window window) {
|
||||||
type = type_;
|
type = type_;
|
||||||
Init(window);
|
Fill(window);
|
||||||
}
|
}
|
||||||
public DBForm() {
|
public DBForm() {
|
||||||
}
|
}
|
||||||
public void Init(Window window) {
|
|
||||||
X = window.getX();
|
|
||||||
Y = window.getY();
|
|
||||||
Width = window.getWidth();
|
|
||||||
Height = window.getHeight();
|
|
||||||
}
|
|
||||||
public void Apply(Window window) {
|
public void Apply(Window window) {
|
||||||
window.setSize(Width, Height);
|
window.setSize(Width, Height);
|
||||||
window.setLocation(X, Y);
|
window.setLocation(X, Y);
|
||||||
}
|
}
|
||||||
|
public void Fill(Window window) {
|
||||||
|
X = window.getX();
|
||||||
|
Y = window.getY();
|
||||||
|
Width = window.getWidth();
|
||||||
|
Height = window.getHeight();
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public Object getPK() {
|
public Object getPK() {
|
||||||
return type;
|
return type;
|
||||||
7
src/Common/Database/Objects/DBForm/FormsDBTable.java
Normal file
7
src/Common/Database/Objects/DBForm/FormsDBTable.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package Common.Database.Objects.DBForm;
|
||||||
|
import Common.Database.Tables.DBTable;
|
||||||
|
public class FormsDBTable extends DBTable<String, DBForm> {
|
||||||
|
public FormsDBTable() {
|
||||||
|
super(String.class, DBForm.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package Common.Database;
|
package Common.Database.Objects;
|
||||||
import Common.UI.Selectable;
|
|
||||||
import Common.Utils.Index;
|
import Common.Utils.Index;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils_;
|
||||||
|
import Common.Visual.Selectable;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -10,6 +10,12 @@ public abstract class DBObject implements Selectable, Serializable {
|
|||||||
//<editor-fold desc="Selectable">
|
//<editor-fold desc="Selectable">
|
||||||
@Description("IGNORE")
|
@Description("IGNORE")
|
||||||
private boolean selected = false;
|
private boolean selected = false;
|
||||||
|
//------
|
||||||
|
public DBObject() {
|
||||||
|
}
|
||||||
|
public DBObject(DBObject src) {
|
||||||
|
this.SynchronizeFields(src);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean isSelected() {
|
public boolean isSelected() {
|
||||||
return selected;
|
return selected;
|
||||||
@@ -29,18 +35,13 @@ public abstract class DBObject implements Selectable, Serializable {
|
|||||||
public Index getSelectionCounter() {
|
public Index getSelectionCounter() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public boolean isVisible() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public abstract Object getPK();
|
public abstract Object getPK();
|
||||||
public String getBDialogName() {
|
public String getBDialogName() {
|
||||||
return Utils.Brackets(getDialogName());
|
return Utils_.Brackets(getDialogName());
|
||||||
}
|
}
|
||||||
public String getDialogName() {
|
public String getDialogName() {
|
||||||
return getPK().toString();
|
return getPK().toString();
|
||||||
}
|
}
|
||||||
//статус. например завершенность багрепорта или состояние задачи на запуск. как правило обладает цветным шрифтом.
|
|
||||||
//как объект будут называть по внешним ключам.
|
|
||||||
public String getFKName() {
|
public String getFKName() {
|
||||||
return getClass().getSimpleName().toLowerCase() + "_id";
|
return getClass().getSimpleName().toLowerCase() + "_id";
|
||||||
}
|
}
|
||||||
@@ -52,14 +53,7 @@ public abstract class DBObject implements Selectable, Serializable {
|
|||||||
return getBDialogName();
|
return getBDialogName();
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
public void SynchronizeFields(DBObject src){
|
public void SynchronizeFields(DBObject src) {
|
||||||
selected = src.selected;
|
selected = src.selected;
|
||||||
}
|
}
|
||||||
//------
|
|
||||||
public DBObject(){}
|
|
||||||
public DBObject(DBObject src){
|
|
||||||
this.SynchronizeFields(src);
|
|
||||||
}
|
|
||||||
//---------
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
package GlobalData.Grid;
|
package Common.Database.Objects.Grid;
|
||||||
import Common.Current;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Database.DBObject;
|
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
public class Grid extends DBObject {
|
public class TableVisualData extends DBObject {
|
||||||
@Description("PRIMARY KEY, UNIQUE") //имя таблицы
|
@Description("PRIMARY KEY, UNIQUE") //имя таблицы
|
||||||
public Current name = Current.Undefined;
|
public String name = null;
|
||||||
|
//todo запаковать в json (?)
|
||||||
@Description("DEFAULT ''")
|
@Description("DEFAULT ''")
|
||||||
public String sizes = ""; //ширины столбцов запакованные через |. вводить объекты ради них нецелесообразно.
|
public String sizes = ""; //ширины столбцов запакованные через |. вводить объекты ради них нецелесообразно.
|
||||||
public Grid() {
|
public TableVisualData() {
|
||||||
}
|
}
|
||||||
public Grid(Current name_in) {
|
public TableVisualData(String name_in) {
|
||||||
name = name_in;
|
name = name_in;
|
||||||
sizes = "";
|
sizes = "";
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package Common.Database.Objects.Grid;
|
||||||
|
import Common.Database.Tables.DBTable;
|
||||||
|
public class TablesVisualDatasDBTable extends DBTable<String, TableVisualData> {
|
||||||
|
public TablesVisualDatasDBTable() {
|
||||||
|
super(String.class, TableVisualData.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,22 +1,20 @@
|
|||||||
package Visual_DVM_2021.PassStats;
|
package Common.Database.Objects.PassStats;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
public class PassStats extends DBObject {
|
public class PassStats extends DBObject {
|
||||||
@Description("PRIMARY KEY, UNIQUE")
|
@Description("PRIMARY KEY, UNIQUE")
|
||||||
public PassCode_2021 code = PassCode_2021.Undefined;
|
public String code = null;
|
||||||
//меняется только когда юзер кликает на пункте меню или же на кнопке.
|
//меняется только когда юзер кликает на пункте меню или же на кнопке.
|
||||||
public int Usages = 0;
|
public int Usages = 0;
|
||||||
public PassStats() {
|
public PassStats() {
|
||||||
}
|
}
|
||||||
public PassStats(Pass_2021 pass) {
|
public PassStats(String code_in) {
|
||||||
code = pass.code();
|
code = code_in;
|
||||||
}
|
}
|
||||||
public void Inc() {
|
public void Inc() {
|
||||||
Usages++;
|
Usages++;
|
||||||
}
|
}
|
||||||
public void Drop() {
|
public void Reset() {
|
||||||
Usages = 0;
|
Usages = 0;
|
||||||
}
|
}
|
||||||
public boolean HasUsages() {
|
public boolean HasUsages() {
|
||||||
19
src/Common/Database/Objects/PassStats/PassStatsDBTable.java
Normal file
19
src/Common/Database/Objects/PassStats/PassStatsDBTable.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package Common.Database.Objects.PassStats;
|
||||||
|
import Common.Database.Tables.DBTable;
|
||||||
|
public class PassStatsDBTable extends DBTable<String, PassStats> {
|
||||||
|
public PassStatsDBTable() {
|
||||||
|
super(String.class, PassStats.class);
|
||||||
|
}
|
||||||
|
public void IncPassStat(String passName) throws Exception {
|
||||||
|
PassStats passStats = null;
|
||||||
|
if (Data.containsKey(passName)) {
|
||||||
|
passStats = Data.get(passName);
|
||||||
|
passStats.Inc();
|
||||||
|
getDb().Update(passStats);
|
||||||
|
} else {
|
||||||
|
passStats = new PassStats(passName);
|
||||||
|
passStats.Inc();
|
||||||
|
getDb().Insert(passStats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package GlobalData.Splitter;
|
package Common.Database.Objects.Splitter;
|
||||||
import Common.Constants;
|
import Common.CommonConstants;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@@ -8,7 +8,7 @@ public class Splitter extends DBObject {
|
|||||||
@Description("PRIMARY KEY, UNIQUE")
|
@Description("PRIMARY KEY, UNIQUE")
|
||||||
public String name = "";
|
public String name = "";
|
||||||
@Description("DEFAULT -1")
|
@Description("DEFAULT -1")
|
||||||
public int position = Constants.Nan;
|
public int position = CommonConstants.Nan;
|
||||||
public Splitter() {
|
public Splitter() {
|
||||||
}
|
}
|
||||||
public Splitter(JSplitPane splitPane) {
|
public Splitter(JSplitPane splitPane) {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package GlobalData.Splitter;
|
package Common.Database.Objects.Splitter;
|
||||||
import Common.Database.DBTable;
|
import Common.Database.Tables.DBTable;
|
||||||
import Common.Global;
|
import Common.Utils.Utils_;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@@ -32,7 +32,7 @@ public class SplittersDBTable extends DBTable<String, Splitter> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Global.Log.PrintException(ex);
|
Utils_.MainLog.PrintException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Save(Object form) {
|
public void Save(Object form) {
|
||||||
@@ -44,7 +44,7 @@ public class SplittersDBTable extends DBTable<String, Splitter> {
|
|||||||
getDb().Update(splitter);
|
getDb().Update(splitter);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Global.Log.PrintException(ex);
|
Utils_.MainLog.PrintException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,26 +1,29 @@
|
|||||||
package Common.Database;
|
package Common.Database.Objects;
|
||||||
import Common.Constants;
|
import Common.CommonConstants;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
//автоинкрементальный ключ
|
//автоинкрементальный ключ
|
||||||
public class iDBObject extends DBObject {
|
public class iDBObject extends DBObject {
|
||||||
|
@Expose
|
||||||
@Description("PRIMARY KEY,AUTOINCREMENT")
|
@Description("PRIMARY KEY,AUTOINCREMENT")
|
||||||
public int id;
|
public int id;
|
||||||
|
public iDBObject() {
|
||||||
|
}
|
||||||
|
public iDBObject(iDBObject src) {
|
||||||
|
this.SynchronizeFields(src);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public Object getPK() {
|
public Object getPK() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Object getEmptyFK() {
|
public Object getEmptyFK() {
|
||||||
return Constants.Nan;
|
return CommonConstants.Nan;
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
@Override
|
@Override
|
||||||
public void SynchronizeFields(DBObject src) {
|
public void SynchronizeFields(DBObject src) {
|
||||||
super.SynchronizeFields(src);
|
super.SynchronizeFields(src);
|
||||||
id = ((iDBObject)src).id;
|
id = ((iDBObject) src).id;
|
||||||
}
|
|
||||||
public iDBObject(){}
|
|
||||||
public iDBObject(iDBObject src){
|
|
||||||
this.SynchronizeFields(src);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
package Common.Database;
|
package Common.Database.Objects;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils_;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
public abstract class nDBObject extends DBObject {
|
public abstract class nDBObject extends DBObject {
|
||||||
@Description("PRIMARY KEY, UNIQUE")
|
@Description("PRIMARY KEY, UNIQUE")
|
||||||
public String id = "";
|
public String id = "";
|
||||||
|
public nDBObject(nDBObject src) {
|
||||||
|
this.SynchronizeFields(src);
|
||||||
|
}
|
||||||
|
public nDBObject() {
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public Object getPK() {
|
public Object getPK() {
|
||||||
return id;
|
return id;
|
||||||
@@ -12,17 +17,16 @@ 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());
|
||||||
}
|
}
|
||||||
//-
|
//-
|
||||||
@Override
|
@Override
|
||||||
public void SynchronizeFields(DBObject src) {
|
public void SynchronizeFields(DBObject src) {
|
||||||
super.SynchronizeFields(src);
|
super.SynchronizeFields(src);
|
||||||
id = ((nDBObject)src).id;
|
id = ((nDBObject) src).id;
|
||||||
}
|
}
|
||||||
public nDBObject(nDBObject src){
|
|
||||||
this.SynchronizeFields(src);
|
|
||||||
}
|
|
||||||
public nDBObject(){}
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Common.Database;
|
package Common.Database.Objects;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
//объект репозитория. ключ имя, и есть данные отправителя.
|
//объект репозитория. ключ имя, и есть данные отправителя.
|
||||||
public class rDBObject extends nDBObject {
|
public class rDBObject extends nDBObject {
|
||||||
@@ -8,6 +8,11 @@ public class rDBObject extends nDBObject {
|
|||||||
//-
|
//-
|
||||||
public long date = 0;
|
public long date = 0;
|
||||||
public long change_date;
|
public long change_date;
|
||||||
|
public rDBObject(rDBObject src) {
|
||||||
|
this.SynchronizeFields(src);
|
||||||
|
}
|
||||||
|
public rDBObject() {
|
||||||
|
}
|
||||||
public Date getDate() {
|
public Date getDate() {
|
||||||
return new Date(date);
|
return new Date(date);
|
||||||
}
|
}
|
||||||
@@ -24,9 +29,4 @@ public class rDBObject extends nDBObject {
|
|||||||
date = r.date;
|
date = r.date;
|
||||||
change_date = r.change_date;
|
change_date = r.change_date;
|
||||||
}
|
}
|
||||||
public rDBObject(rDBObject src) {
|
|
||||||
this.SynchronizeFields(src);
|
|
||||||
}
|
|
||||||
public rDBObject() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
package Common.Database;
|
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
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package Repository;
|
package Common.Database;
|
||||||
public class RepositoryRefuseException extends Exception{
|
public class RepositoryRefuseException extends Exception {
|
||||||
//исключение для "штатных" отказов. например отсутствие объекта с заданным ключом.
|
//исключение для "штатных" отказов. например отсутствие объекта с заданным ключом.
|
||||||
public RepositoryRefuseException(String message_in){
|
public RepositoryRefuseException(String message_in) {
|
||||||
super(message_in);
|
super(message_in);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,26 +1,26 @@
|
|||||||
package Common.Database.SQLITE;
|
package Common.Database.SQLITE;
|
||||||
import Common.Database.DBObject;
|
|
||||||
import Common.Database.DBTable;
|
|
||||||
import Common.Database.DBTableColumn;
|
|
||||||
import Common.Database.Database;
|
import Common.Database.Database;
|
||||||
import Common.UI.UI;
|
import Common.Database.Objects.DBObject;
|
||||||
import Common.Utils.Utils;
|
import Common.Database.Tables.DBTable;
|
||||||
import Visual_DVM_2021.Passes.PassException;
|
import Common.Database.Tables.DBTableColumn;
|
||||||
import javafx.util.Pair;
|
import Common.Passes.PassException;
|
||||||
|
import Common.Utils.Pair;
|
||||||
|
import Common.Utils.Utils_;
|
||||||
|
import Common.Visual.UI;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import static Common.Utils.Utils.requireNonNullElse;
|
import static Common.Utils.Utils_.requireNonNullElse;
|
||||||
public abstract class SQLiteDatabase extends Database {
|
public abstract class SQLiteDatabase extends Database {
|
||||||
protected Connection conn = null;
|
|
||||||
protected Statement statement = null;
|
|
||||||
protected ResultSet resSet = null;
|
|
||||||
public LinkedHashMap<Class<? extends DBObject>, PreparedStatement> insertStatements = new LinkedHashMap<>();
|
public LinkedHashMap<Class<? extends DBObject>, PreparedStatement> insertStatements = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class<? extends DBObject>, PreparedStatement> updateStatements = new LinkedHashMap<>();
|
public LinkedHashMap<Class<? extends DBObject>, PreparedStatement> updateStatements = new LinkedHashMap<>();
|
||||||
public LinkedHashMap<Class<? extends DBObject>, PreparedStatement> deleteStatements = new LinkedHashMap<>();
|
public LinkedHashMap<Class<? extends DBObject>, PreparedStatement> deleteStatements = new LinkedHashMap<>();
|
||||||
|
protected Connection conn = null;
|
||||||
|
protected Statement statement = null;
|
||||||
|
protected ResultSet resSet = null;
|
||||||
//->>
|
//->>
|
||||||
public SQLiteDatabase(File file_in) {
|
public SQLiteDatabase(File file_in) {
|
||||||
super(file_in);
|
super(file_in);
|
||||||
@@ -36,7 +36,7 @@ public abstract class SQLiteDatabase extends Database {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
conn = null;
|
conn = null;
|
||||||
System.gc();
|
System.gc();
|
||||||
Utils.sleep(2000);
|
Utils_.sleep(2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (conn == null)
|
if (conn == null)
|
||||||
@@ -116,7 +116,7 @@ public abstract class SQLiteDatabase extends Database {
|
|||||||
Vector<String> columns_names = new Vector<>();
|
Vector<String> columns_names = new Vector<>();
|
||||||
for (DBTableColumn column : table.columns.values())
|
for (DBTableColumn column : table.columns.values())
|
||||||
columns_names.add(column.toString());
|
columns_names.add(column.toString());
|
||||||
cmd += Utils.RBrackets(String.join(",", columns_names));
|
cmd += Utils_.RBrackets(String.join(",", columns_names));
|
||||||
statement.execute(cmd);
|
statement.execute(cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,8 +135,8 @@ public abstract class SQLiteDatabase extends Database {
|
|||||||
}
|
}
|
||||||
insertStatements.put(table.d, conn.prepareStatement(
|
insertStatements.put(table.d, conn.prepareStatement(
|
||||||
"INSERT OR REPLACE INTO " + table.QName() + " " +
|
"INSERT OR REPLACE INTO " + table.QName() + " " +
|
||||||
Utils.RBrackets(String.join(",", column_names)) + " " + "VALUES " +
|
Utils_.RBrackets(String.join(",", column_names)) + " " + "VALUES " +
|
||||||
Utils.RBrackets(String.join(",", column_values))));
|
Utils_.RBrackets(String.join(",", column_values))));
|
||||||
//------------------------------------------------------------------------------->>
|
//------------------------------------------------------------------------------->>
|
||||||
Vector<String> new_values = new Vector();
|
Vector<String> new_values = new Vector();
|
||||||
for (DBTableColumn column : table.columns.values()) {
|
for (DBTableColumn column : table.columns.values()) {
|
||||||
@@ -184,9 +184,7 @@ public abstract class SQLiteDatabase extends Database {
|
|||||||
try {
|
try {
|
||||||
field_value = Enum.valueOf(enum_class, string);
|
field_value = Enum.valueOf(enum_class, string);
|
||||||
} catch (Exception ignore) {
|
} catch (Exception ignore) {
|
||||||
System.out.println(Utils.Brackets(string) + "not found");
|
|
||||||
field_value = enum_constants[0];
|
field_value = enum_constants[0];
|
||||||
System.out.println(field_value);
|
|
||||||
}
|
}
|
||||||
} else field_value = enum_constants[0];
|
} else field_value = enum_constants[0];
|
||||||
} else
|
} else
|
||||||
@@ -196,7 +194,7 @@ public abstract class SQLiteDatabase extends Database {
|
|||||||
if (field_value != null) {
|
if (field_value != null) {
|
||||||
table.d.getField(column.Name).set(o, field_value);
|
table.d.getField(column.Name).set(o, field_value);
|
||||||
} else
|
} else
|
||||||
throw new PassException("Ошибка при загрузке поля " + Utils.Brackets(column.Name) + " класса " + Utils.Brackets(table.d.getSimpleName()));
|
throw new PassException("Ошибка при загрузке поля " + Utils_.Brackets(column.Name) + " класса " + Utils_.Brackets(table.d.getSimpleName()));
|
||||||
}
|
}
|
||||||
return new Pair<>((K) o.getPK(), o);
|
return new Pair<>((K) o.getPK(), o);
|
||||||
}
|
}
|
||||||
@@ -257,5 +255,4 @@ public abstract class SQLiteDatabase extends Database {
|
|||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
//https://stackoverflow.com/questions/8558099/sqlite-query-with-byte-where-clause
|
//https://stackoverflow.com/questions/8558099/sqlite-query-with-byte-where-clause
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package Common.Database;
|
|
||||||
import Common.UI.Menus_2023.StableMenuItem;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
public class TableFilter<D extends DBObject> {
|
|
||||||
DataSet table;
|
|
||||||
public JMenuItem menuItem; //пункт меню фильтра. ( возможно потом сделать и кнопку)
|
|
||||||
String description;
|
|
||||||
boolean active = false; //включен ли фильтр
|
|
||||||
public int count = 0;
|
|
||||||
protected boolean validate(D object) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public boolean Validate(D object) {
|
|
||||||
boolean valid;
|
|
||||||
if (valid=validate(object))
|
|
||||||
count++;
|
|
||||||
return !active || valid;
|
|
||||||
}
|
|
||||||
static String getNotActiveIconPath() {
|
|
||||||
return "/icons/NotPick.png";
|
|
||||||
}
|
|
||||||
static String getActiveIconPath() {
|
|
||||||
return "/icons/Pick.png";
|
|
||||||
}
|
|
||||||
public TableFilter(DataSet table_in, String description_in) {
|
|
||||||
table = table_in;
|
|
||||||
menuItem = new StableMenuItem((description = description_in)+" (0)");
|
|
||||||
menuItem.addActionListener(e -> {
|
|
||||||
active = !active;
|
|
||||||
Mark();
|
|
||||||
table.ShowUI();
|
|
||||||
});
|
|
||||||
Mark();
|
|
||||||
}
|
|
||||||
public void Mark() {
|
|
||||||
menuItem.setIcon(Utils.getIcon(active ? getActiveIconPath() : getNotActiveIconPath()));
|
|
||||||
}
|
|
||||||
public void ShowDescriptionAndCount() {
|
|
||||||
menuItem.setText(description + " " + Utils.RBrackets(count));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Common.Database;
|
package Common.Database.Tables;
|
||||||
public enum ColumnType {
|
public enum ColumnType {
|
||||||
UNDEFINED,
|
UNDEFINED,
|
||||||
INT,
|
INT,
|
||||||
65
src/Common/Database/Tables/DBTable.java
Normal file
65
src/Common/Database/Tables/DBTable.java
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
package Common.Database.Tables;
|
||||||
|
import Common.Database.Database;
|
||||||
|
import Common.Database.Objects.DBObject;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.Vector;
|
||||||
|
public abstract class DBTable<K, D extends DBObject> extends DataSet<K, D> {
|
||||||
|
//-
|
||||||
|
public DBTableColumn PK = null;
|
||||||
|
private Database db = null; //база данных - владелец таблицы.
|
||||||
|
public DBTable(Class<K> k_in, Class<D> d_in) {
|
||||||
|
super(k_in, d_in);
|
||||||
|
for (Field field : d.getFields()) {
|
||||||
|
DBTableColumn column = new DBTableColumn(field);
|
||||||
|
if ((!column.Ignore) && !columns.containsKey(column.Name)) {
|
||||||
|
columns.put(column.Name, column);
|
||||||
|
if (column.PrimaryKey) PK = column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Database getDb() {
|
||||||
|
return db;
|
||||||
|
}
|
||||||
|
public void setDb(Database db_in) {
|
||||||
|
db = db_in;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getPKName() {
|
||||||
|
return PK.Name;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder res = new StringBuilder(getName() + "\n");
|
||||||
|
for (DBTableColumn c : columns.values())
|
||||||
|
res.append(c).append("\n");
|
||||||
|
return res.toString();
|
||||||
|
}
|
||||||
|
boolean vectorContains(D object, Vector<D> vector) {
|
||||||
|
for (D v_object : vector) {
|
||||||
|
if (isEqual(object, v_object))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public void ActualizeData(Vector<D> old, Vector<D> actual) throws Exception {
|
||||||
|
//привести данные вектора old в соответствие с вектором new
|
||||||
|
//те, что в нем появились вставить, те что отсутствуют но есть в old удалить
|
||||||
|
Vector<D> to_delete = new Vector<>();
|
||||||
|
Vector<D> to_insert = new Vector<>();
|
||||||
|
for (D object : old) {
|
||||||
|
if (!vectorContains(object, actual))
|
||||||
|
to_delete.add(object);
|
||||||
|
}
|
||||||
|
for (D object : actual) {
|
||||||
|
if (!vectorContains(object, old))
|
||||||
|
to_insert.add(object);
|
||||||
|
}
|
||||||
|
db.BeginTransaction();
|
||||||
|
for (D object : to_delete)
|
||||||
|
db.Delete(object);
|
||||||
|
for (D object : to_insert)
|
||||||
|
db.Insert(object);
|
||||||
|
db.Commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Common.Database;
|
package Common.Database.Tables;
|
||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
94
src/Common/Database/Tables/DataSet.java
Normal file
94
src/Common/Database/Tables/DataSet.java
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
package Common.Database.Tables;
|
||||||
|
import Common.Database.Objects.DBObject;
|
||||||
|
import Common.Visual.DataSetControlForm;
|
||||||
|
import Common.Visual.UI;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Vector;
|
||||||
|
public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||||
|
public Class<D> d; //класс объектов.
|
||||||
|
public LinkedHashMap<K, D> Data = new LinkedHashMap<>(); //наполнение
|
||||||
|
Class<K> k; //класс первичного ключа.
|
||||||
|
//-
|
||||||
|
DataSetControlForm ui = null;
|
||||||
|
//--
|
||||||
|
public DataSet(Class<K> k_in, Class<D> d_in) {
|
||||||
|
k = k_in;
|
||||||
|
d = d_in;
|
||||||
|
}
|
||||||
|
//--
|
||||||
|
public String getPluralDescription() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
public String getSingleDescription() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
//---
|
||||||
|
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//БАЗА ДАННЫХ
|
||||||
|
public String getName() {
|
||||||
|
return d.getSimpleName();
|
||||||
|
}
|
||||||
|
public String QName() {
|
||||||
|
return "\"" + getName() + "\"";
|
||||||
|
}
|
||||||
|
public String getPKName() {
|
||||||
|
return "";
|
||||||
|
} //получить имя ключевого поля. нужно для таблиц.
|
||||||
|
//ИНТЕРФЕЙС
|
||||||
|
public DataSetControlForm<D> getUI() {
|
||||||
|
return ui;
|
||||||
|
}
|
||||||
|
public void mountUI(JPanel mountPanel_in) {
|
||||||
|
UI.Clear(mountPanel_in);
|
||||||
|
ui = createUI(mountPanel_in);
|
||||||
|
}
|
||||||
|
public void ClearUI() {
|
||||||
|
if ((ui != null) && ui.isShown()) {
|
||||||
|
ui.ClearSelection();
|
||||||
|
ui.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void ShowUI() {
|
||||||
|
if (ui != null) {
|
||||||
|
ui.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void ShowUI(Object key) {
|
||||||
|
if (ui != null) {
|
||||||
|
ui.Show(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//СОДЕРЖИМОЕ
|
||||||
|
public D getFirstRecord() {
|
||||||
|
return Data.values().stream().findFirst().orElse(null);
|
||||||
|
}
|
||||||
|
public Vector<D> getOrderedRecords(Comparator<D> comparator) {
|
||||||
|
Vector<D> res = new Vector<>(Data.values());
|
||||||
|
res.sort(comparator);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
public void put(Object key, D object) {
|
||||||
|
Data.put((K) key, object);
|
||||||
|
}
|
||||||
|
public D get(Object key) {
|
||||||
|
return Data.get(key);
|
||||||
|
}
|
||||||
|
public void clear() {
|
||||||
|
Data.clear();
|
||||||
|
}
|
||||||
|
public int size() {
|
||||||
|
return Data.size();
|
||||||
|
}
|
||||||
|
public boolean containsKey(Object key) {
|
||||||
|
return Data.containsKey(key);
|
||||||
|
}
|
||||||
|
//--
|
||||||
|
public boolean isEqual(D o1, D o2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
package Common.Database;
|
package Common.Database.Tables;
|
||||||
|
import Common.Database.Objects.DBObject;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
public abstract class DataSetAnchestor {
|
public abstract class DataSetAnchestor {
|
||||||
//чтобы обмануть стирание типов во всех параметризованных полях. используется не во всех потомках.
|
//чтобы обмануть стирание типов во всех параметризованных полях. используется не во всех потомках.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Common.Database;
|
package Common.Database.Tables;
|
||||||
public class FKBehaviour {
|
public class FKBehaviour {
|
||||||
public FKDataBehaviour data; //поведение данных внешнего ключа при удалении/модификации
|
public FKDataBehaviour data; //поведение данных внешнего ключа при удалении/модификации
|
||||||
public FKCurrentObjectBehaviuor ui; //поведение интерфейсов таблиц внешнего ключа при показе текущего объекта.
|
public FKCurrentObjectBehaviuor ui; //поведение интерфейсов таблиц внешнего ключа при показе текущего объекта.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Common.Database;
|
package Common.Database.Tables;
|
||||||
public enum FKCurrentObjectBehaviuor {
|
public enum FKCurrentObjectBehaviuor {
|
||||||
PASSIVE,
|
PASSIVE,
|
||||||
ACTIVE
|
ACTIVE
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Common.Database;
|
package Common.Database.Tables;
|
||||||
//поведение таблиц имеющих внешние ключи
|
//поведение таблиц имеющих внешние ключи
|
||||||
public enum FKDataBehaviour {
|
public enum FKDataBehaviour {
|
||||||
NONE,
|
NONE,
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
package Common.Database;
|
package Common.Database.Tables;
|
||||||
|
import Common.Database.Objects.iDBObject;
|
||||||
public abstract class iDBTable<D extends iDBObject> extends DBTable<Integer, D> {
|
public abstract class iDBTable<D extends iDBObject> extends DBTable<Integer, D> {
|
||||||
public iDBTable(Class<D> d_in) {
|
public iDBTable(Class<D> d_in) {
|
||||||
super(Integer.class, d_in);
|
super(Integer.class, d_in);
|
||||||
29
src/Common/Database/VisualiserDatabase.java
Normal file
29
src/Common/Database/VisualiserDatabase.java
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package Common.Database;
|
||||||
|
import Common.Database.Objects.DBForm.FormsDBTable;
|
||||||
|
import Common.Database.Objects.Grid.TablesVisualDatasDBTable;
|
||||||
|
import Common.Database.Objects.PassStats.PassStatsDBTable;
|
||||||
|
import Common.Database.Objects.Splitter.SplittersDBTable;
|
||||||
|
import Common.Database.SQLITE.SQLiteDatabase;
|
||||||
|
import Common.Passes.PassCode_;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
public class VisualiserDatabase extends SQLiteDatabase {
|
||||||
|
public FormsDBTable forms;
|
||||||
|
public TablesVisualDatasDBTable tablesVisualData;
|
||||||
|
public SplittersDBTable splitters;
|
||||||
|
public PassStatsDBTable passStats;
|
||||||
|
public VisualiserDatabase(File file_in) {
|
||||||
|
super(file_in);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void initAllTables() throws Exception {
|
||||||
|
addTable(forms = new FormsDBTable());
|
||||||
|
addTable(tablesVisualData = new TablesVisualDatasDBTable());
|
||||||
|
addTable(splitters = new SplittersDBTable());
|
||||||
|
addTable(passStats = new PassStatsDBTable());
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public PassCode_ getSynchronizePassCode() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,405 +0,0 @@
|
|||||||
package Common;
|
|
||||||
import Common.Database.DataSet;
|
|
||||||
import Common.UI.Menus_2023.ComponentsMenuBar.ComponentsMenuBar;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import GlobalData.GlobalDatabase;
|
|
||||||
import GlobalData.Settings.DBSetting;
|
|
||||||
import GlobalData.Settings.SettingName;
|
|
||||||
import ProjectData.ProjectView;
|
|
||||||
import Repository.Component.*;
|
|
||||||
import Repository.Component.PerformanceAnalyzer.PerformanceAnalyzer;
|
|
||||||
import Repository.Component.Sapfor.MessagesServer;
|
|
||||||
import Repository.Component.Sapfor.Sapfor_F;
|
|
||||||
import Repository.Component.Sapfor.TransformationPermission;
|
|
||||||
import Repository.Server.ComponentsServer;
|
|
||||||
import TestingSystem.SAPFOR.PackageModeSupervisor;
|
|
||||||
import TestingSystem.Common.TestingServer;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
import Visual_DVM_2021.UI.Interface.Loggable;
|
|
||||||
import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory;
|
|
||||||
import org.fife.ui.rsyntaxtextarea.TokenMakerFactory;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.Vector;
|
|
||||||
public class Global {
|
|
||||||
//--------------------------------------------------
|
|
||||||
//текущая папка системы. в отличие от шарпа никогда не должна меняться.
|
|
||||||
public static final String components = "Components";
|
|
||||||
public static final String data = "Data";
|
|
||||||
public static final String Bugs = "Bugs";
|
|
||||||
public static final String BackUps = "BackUps";
|
|
||||||
public static final String DataBackUps = "DataBackUps";
|
|
||||||
public static final String Temp = "Temp";
|
|
||||||
public static final String Projects = "Projects";
|
|
||||||
public static final String CompilationTasks = "CompilationTasks";
|
|
||||||
public static final String RunTasks = "RunTasks";
|
|
||||||
public static final String Sts = "Sts";
|
|
||||||
public static final String Repo = "Repo";
|
|
||||||
public static final String Tests = "Tests";
|
|
||||||
public static final String Packages = "Packages";
|
|
||||||
public static final String PerformanceAnalyzer = "PerformanceAnalyzer";
|
|
||||||
public static GlobalProperties properties = new GlobalProperties();
|
|
||||||
//</editor-fold>
|
|
||||||
//------------------------------------------------------
|
|
||||||
public static boolean enable_text_changed = false;
|
|
||||||
//---
|
|
||||||
public static boolean files_multiselection = false;
|
|
||||||
public static boolean versions_multiselection = false;
|
|
||||||
//---
|
|
||||||
public static TransformationPermission transformationPermission = TransformationPermission.None;
|
|
||||||
//??
|
|
||||||
public static DataSet<ComponentType, Component> Components = null;
|
|
||||||
public static MessagesServer messagesServer = null;
|
|
||||||
//--------------------------------------------------
|
|
||||||
public static GlobalDatabase db = null;
|
|
||||||
public static String[] admins_mails = new String[]{
|
|
||||||
"vmk-post@yandex.ru",
|
|
||||||
"79854210702@ya.ru"
|
|
||||||
};
|
|
||||||
//-
|
|
||||||
public static String Home;
|
|
||||||
public static File ComponentsDirectory;
|
|
||||||
public static File DataDirectory;
|
|
||||||
public static File BugReportsDirectory;
|
|
||||||
public static File BackUpsDirectory;
|
|
||||||
public static File TempDirectory;
|
|
||||||
public static File ProjectsDirectory;
|
|
||||||
public static File CompilationTasksDirectory;
|
|
||||||
public static File RunTasksDirectory;
|
|
||||||
public static File StsDirectory;
|
|
||||||
public static File RepoDirectory;
|
|
||||||
public static File TestsDirectory;
|
|
||||||
public static File PerformanceAnalyzerDirectory;
|
|
||||||
public static File DataBackUpsDirectory;
|
|
||||||
public static File PackagesDirectory;
|
|
||||||
public static File SapforsDirectory;
|
|
||||||
public static File SapforPackagesDirectory;
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
public static Visualiser visualiser = null;
|
|
||||||
public static Visualizer_2 visualizer_2 = null;
|
|
||||||
public static PerformanceAnalyzer performanceAnalyzer = null;
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
public static ComponentsServer componentsServer = new ComponentsServer();
|
|
||||||
public static TestingServer testingServer = new TestingServer();
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
public static boolean isWindows;
|
|
||||||
public static int bad_state = 0;
|
|
||||||
public static int need_update = 0;
|
|
||||||
public static int need_publish = 0;
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
public static Loggable Log;
|
|
||||||
public static void SynschronizeProperties() {
|
|
||||||
try {
|
|
||||||
File new_propertiesFile = Paths.get(Home, "properties").toFile();
|
|
||||||
if (new_propertiesFile.exists())
|
|
||||||
properties = (GlobalProperties) Utils.jsonFromFile(new_propertiesFile, GlobalProperties.class);
|
|
||||||
Utils.jsonToFile(properties, new_propertiesFile);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static void CheckVisualiserDirectories() {
|
|
||||||
Utils.CheckDirectory(ComponentsDirectory = Paths.get(Home, components).toFile());
|
|
||||||
Utils.CheckAndCleanDirectory(TempDirectory = Paths.get(Home, Temp).toFile());
|
|
||||||
Utils.CheckDirectory(DataDirectory = Paths.get(Home, data).toFile());
|
|
||||||
//-
|
|
||||||
Utils.CheckDirectory(RepoDirectory = Paths.get(Home, Repo).toFile());
|
|
||||||
Utils.CheckDirectory(BugReportsDirectory = Paths.get(Home, Bugs).toFile());
|
|
||||||
Utils.CheckDirectory(BackUpsDirectory = Paths.get(Home, BackUps).toFile());
|
|
||||||
Utils.CheckDirectory(ProjectsDirectory = Paths.get(Home, Projects).toFile());
|
|
||||||
Utils.CheckDirectory(CompilationTasksDirectory = Paths.get(Home, CompilationTasks).toFile());
|
|
||||||
Utils.CheckDirectory(RunTasksDirectory = Paths.get(Home, RunTasks).toFile());
|
|
||||||
Utils.CheckDirectory(StsDirectory = Paths.get(Home, Sts).toFile());
|
|
||||||
Utils.CheckDirectory(TestsDirectory = Paths.get(Home, Tests).toFile());
|
|
||||||
Utils.CheckDirectory(PerformanceAnalyzerDirectory = Paths.get(Home, PerformanceAnalyzer).toFile());
|
|
||||||
Utils.CheckAndCleanDirectory(SapforPackagesDirectory = Paths.get(Home, "SapforPackages").toFile());
|
|
||||||
}
|
|
||||||
public static void CheckServerDirectories() {
|
|
||||||
Utils.CheckDirectory(ComponentsDirectory = Paths.get(Home, components).toFile());
|
|
||||||
Utils.CheckAndCleanDirectory(TempDirectory = Paths.get(Home, Temp).toFile());
|
|
||||||
Utils.CheckDirectory(DataDirectory = Paths.get(Home, data).toFile());
|
|
||||||
//-
|
|
||||||
Utils.CheckDirectory(BugReportsDirectory = Paths.get(Home, Bugs).toFile());
|
|
||||||
Utils.CheckDirectory(DataBackUpsDirectory = Paths.get(Home, DataBackUps).toFile());
|
|
||||||
}
|
|
||||||
public static void CheckTestingSystemDirectories() {
|
|
||||||
Utils.CheckDirectory(ComponentsDirectory = Paths.get(Home, components).toFile());
|
|
||||||
Utils.CheckAndCleanDirectory(TempDirectory = Paths.get(Home, Temp).toFile());
|
|
||||||
Utils.CheckDirectory(DataDirectory = Paths.get(Home, data).toFile());
|
|
||||||
//-
|
|
||||||
Utils.CheckDirectory(TestsDirectory = Paths.get(Home, Tests).toFile());
|
|
||||||
Utils.CheckDirectory(RepoDirectory = Paths.get(Home, Repo).toFile());
|
|
||||||
Utils.CheckDirectory(PackagesDirectory = Paths.get(Home, Packages).toFile());
|
|
||||||
Utils.CheckDirectory(SapforsDirectory = Paths.get(Home, "Sapfors").toFile());
|
|
||||||
Utils.CheckDirectory(SapforPackagesDirectory = Paths.get(Home, "SapforPackages").toFile());
|
|
||||||
}
|
|
||||||
public static void CreateLog() {
|
|
||||||
Log = new Loggable() {
|
|
||||||
@Override
|
|
||||||
public String getLogHomePath() {
|
|
||||||
return Paths.get(System.getProperty("user.dir"), "Components").toString();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getLogName() {
|
|
||||||
return "VisualDVM";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Log.ClearLog();
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
public static void FinishApplication() {
|
|
||||||
try {
|
|
||||||
if (db != null) db.Disconnect();
|
|
||||||
if (componentsServer.db != null)
|
|
||||||
componentsServer.db.Disconnect();
|
|
||||||
if (testingServer.db != null)
|
|
||||||
testingServer.db.Disconnect();
|
|
||||||
if (visualizer_2 != null)
|
|
||||||
visualizer_2.Shutdown();
|
|
||||||
if (messagesServer != null)
|
|
||||||
messagesServer.Shutdown();
|
|
||||||
if (performanceAnalyzer != null)
|
|
||||||
performanceAnalyzer.Shutdown();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
if (Log != null) {
|
|
||||||
Log.PrintException(ex);
|
|
||||||
} else {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
System.exit(0);
|
|
||||||
}
|
|
||||||
public static void ActivateDB() throws Exception {
|
|
||||||
db = new GlobalDatabase();
|
|
||||||
db.Connect();
|
|
||||||
db.CreateAllTables();
|
|
||||||
db.prepareTablesStatements();
|
|
||||||
db.Synchronize();
|
|
||||||
}
|
|
||||||
public static void RefreshUpdatesStatus() {
|
|
||||||
Components.RefreshUI();
|
|
||||||
ValidateComponentsStates();
|
|
||||||
if (UI.HasMainWindow())
|
|
||||||
UI.getMainWindow().ShowUpdatesIcon();
|
|
||||||
}
|
|
||||||
public static boolean ValidateComponentsStates() {
|
|
||||||
bad_state = need_update = need_publish = 0;
|
|
||||||
for (Component component : Components.Data.values()) {
|
|
||||||
if (component.isVisible()) {
|
|
||||||
switch (component.getState()) {
|
|
||||||
case Not_found:
|
|
||||||
case Unknown_version:
|
|
||||||
case Old_version:
|
|
||||||
if (component.isNecessary())
|
|
||||||
bad_state++;
|
|
||||||
component.Select(true);
|
|
||||||
break;
|
|
||||||
case Needs_update:
|
|
||||||
need_update++;
|
|
||||||
component.Select(true);
|
|
||||||
break;
|
|
||||||
case Needs_publish:
|
|
||||||
need_publish++;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
component.Select(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (bad_state == 0);
|
|
||||||
}
|
|
||||||
//возможно заменить settings на properties
|
|
||||||
public static DBSetting getSetting(SettingName settingName) throws Exception {
|
|
||||||
switch (Current.mode) {
|
|
||||||
case Normal:
|
|
||||||
return db.settings.get(settingName);
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static void changeSetting(SettingName settingName, Object new_value) throws Exception {
|
|
||||||
Pass_2021.passes.get(PassCode_2021.UpdateSetting).Do(settingName, new_value);
|
|
||||||
}
|
|
||||||
public static String packSapforSettings() {
|
|
||||||
Vector<String> res_ = new Vector<>();
|
|
||||||
Vector<SettingName> forbidden = new Vector<>();
|
|
||||||
forbidden.add(SettingName.GCOVLimit);
|
|
||||||
forbidden.add(SettingName.Precompilation);
|
|
||||||
forbidden.add(SettingName.DVMConvertationOptions);
|
|
||||||
forbidden.add(SettingName.SaveModifications);
|
|
||||||
for (DBSetting setting : db.settings.getSettingsByOwner(ComponentType.SapforOptions)) {
|
|
||||||
if (!forbidden.contains(setting.Name))
|
|
||||||
res_.add(setting.Value);
|
|
||||||
}
|
|
||||||
return String.join("|", res_);
|
|
||||||
}
|
|
||||||
//--
|
|
||||||
public static void removeOldDatabases() {
|
|
||||||
File data = Paths.get(System.getProperty("user.dir"), "Data").toFile();
|
|
||||||
File[] files = data.listFiles();
|
|
||||||
if (files != null) {
|
|
||||||
for (File file : files) {
|
|
||||||
if (file.getName().contains(Constants.old_tests_db_name)) {
|
|
||||||
System.out.println("found "+Utils.Brackets(file.getAbsolutePath()));
|
|
||||||
try {
|
|
||||||
Utils.forceDeleteWithCheck(file);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static void NormalMode(int port) throws Exception {
|
|
||||||
isWindows = System.getProperty("os.name").startsWith("Windows");
|
|
||||||
removeOldDatabases();
|
|
||||||
CheckVisualiserDirectories();
|
|
||||||
CreateLog();
|
|
||||||
//-
|
|
||||||
visualizer_2 = new Visualizer_2(port);
|
|
||||||
visualizer_2.Connect();
|
|
||||||
visualizer_2.refreshPid();
|
|
||||||
//если делать раньше, то не удастся убить сервер.
|
|
||||||
if (Utils.ContainsCyrillic(Global.Home)) {
|
|
||||||
UI.Info("В пути к корневой папке " + Utils.DQuotes(Global.Home) + "\n" +
|
|
||||||
"Найдены русские буквы.\n" +
|
|
||||||
"Визуализатор завершает работу."); //
|
|
||||||
FinishApplication();
|
|
||||||
}
|
|
||||||
messagesServer = new MessagesServer();
|
|
||||||
messagesServer.Start();
|
|
||||||
//создание списков служебных объектов
|
|
||||||
Current.CreateAll();
|
|
||||||
UI.CreateAll();
|
|
||||||
Pass_2021.CreateAll();
|
|
||||||
Utils.init();
|
|
||||||
//единственное меню до остальных.
|
|
||||||
UI.menuBars.put(ComponentsSet.class, new ComponentsMenuBar());
|
|
||||||
Components = new ComponentsSet();
|
|
||||||
Current.set(Current.ProjectView, ProjectView.Files);
|
|
||||||
Components.put(ComponentType.Visualiser, visualiser = new Visualiser());
|
|
||||||
Components.put(ComponentType.Sapfor_F, (Component) Current.set(Current.Sapfor, new Sapfor_F()));
|
|
||||||
Components.put(ComponentType.Visualizer_2, visualizer_2);
|
|
||||||
Components.put(ComponentType.PerformanceAnalyzer, performanceAnalyzer = new PerformanceAnalyzer());
|
|
||||||
Components.put(ComponentType.Instruction, new Instruction());
|
|
||||||
//-
|
|
||||||
for (Component component : Components.Data.values())
|
|
||||||
if (component.isVisible()) component.InitialVersionCheck();
|
|
||||||
//-
|
|
||||||
UI.CreateComponentsForm();
|
|
||||||
AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance();
|
|
||||||
atmf.putMapping("text/FortranSPF", "Common.UI.Themes.FortranSPFTokenMaker");
|
|
||||||
atmf.putMapping("text/FreeFortranSPF", "Common.UI.Themes.FreeFortranSPFTokenMaker");
|
|
||||||
// FoldParserManager.get().addFoldParserMapping("text/FortranSPF", new FortranFolder()); блоки кода. todo
|
|
||||||
//-------->>
|
|
||||||
//-------->>
|
|
||||||
if (properties.AutoUpdateSearch)
|
|
||||||
Pass_2021.passes.get(PassCode_2021.GetComponentsActualVersions).Do();
|
|
||||||
ValidateComponentsStates();
|
|
||||||
if ((need_update > 0) || (bad_state > 0)) {
|
|
||||||
boolean flag = true;
|
|
||||||
do {
|
|
||||||
UI.ShowComponentsWindow();
|
|
||||||
if (flag = (!ValidateComponentsStates())) {
|
|
||||||
if (!UI.Question("Найдено " + bad_state + " некорректных необходимых компонент.Работа визуализатора невозможна.\n" +
|
|
||||||
"Вернуться к окну компонент"
|
|
||||||
)) {
|
|
||||||
UI.Info("Визуализатор завершает работу.");
|
|
||||||
FinishApplication();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (flag);
|
|
||||||
}
|
|
||||||
//---
|
|
||||||
ActivateDB(); //тут current getAccount; роль по умолчанию всегда неизвестна.
|
|
||||||
///--------------
|
|
||||||
Pass_2021.passes.get(PassCode_2021.CheckAccount).Do();
|
|
||||||
//---------------
|
|
||||||
componentsServer.ActivateDB();
|
|
||||||
testingServer.ActivateDB();
|
|
||||||
//-- чисто чтобы создать таблицы. соединения на стороне клиента не предвидится.
|
|
||||||
testingServer.SetCurrentAccountDB(Current.getAccount().email);
|
|
||||||
//--->>>
|
|
||||||
if (db.settings.get(SettingName.AutoBugReportsLoad).toBoolean())
|
|
||||||
Pass_2021.passes.get(PassCode_2021.SynchronizeBugReports).Do();
|
|
||||||
//--
|
|
||||||
if (db.settings.get(SettingName.AutoTestsLoad).toBoolean())
|
|
||||||
Pass_2021.passes.get(PassCode_2021.SynchronizeTests).Do();
|
|
||||||
Pass_2021.CheckAllStats();
|
|
||||||
Current.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.
|
|
||||||
UI.CreateMenus();
|
|
||||||
UI.CreateWindows();
|
|
||||||
}
|
|
||||||
public static void ServerMode() throws Exception {
|
|
||||||
isWindows = false;
|
|
||||||
CheckServerDirectories();
|
|
||||||
CreateLog();
|
|
||||||
componentsServer = new ComponentsServer();
|
|
||||||
componentsServer.ActivateDB();
|
|
||||||
componentsServer.Start();
|
|
||||||
System.exit(0);
|
|
||||||
}
|
|
||||||
public static void TestingSystemMode() throws Exception {
|
|
||||||
isWindows = false;
|
|
||||||
CheckTestingSystemDirectories();
|
|
||||||
CreateLog();
|
|
||||||
testingServer = new TestingServer();
|
|
||||||
testingServer.ActivateDB();
|
|
||||||
testingServer.Start();
|
|
||||||
System.exit(0);
|
|
||||||
}
|
|
||||||
public static void PackageMode() throws Exception {
|
|
||||||
isWindows = System.getProperty("os.name").startsWith("Windows");
|
|
||||||
Log = new Loggable() {
|
|
||||||
@Override
|
|
||||||
public String getLogHomePath() {
|
|
||||||
return Home;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String getLogName() {
|
|
||||||
return "Package";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Log.ClearLog();
|
|
||||||
PackageModeSupervisor planner = new PackageModeSupervisor();
|
|
||||||
planner.Start();
|
|
||||||
}
|
|
||||||
//---
|
|
||||||
public static void Init(String... args) {
|
|
||||||
System.out.println("VisualSapfor.jar started..");
|
|
||||||
Home = System.getProperty("user.dir"); //если Linux, дает без слеша в конце !!!
|
|
||||||
System.out.println("home directory is" + Utils.Brackets(Home));
|
|
||||||
//---
|
|
||||||
SynschronizeProperties();
|
|
||||||
Current.mode = properties.Mode;
|
|
||||||
System.out.println("mode is " + Current.mode);
|
|
||||||
try {
|
|
||||||
switch (Current.mode) {
|
|
||||||
case Normal:
|
|
||||||
NormalMode(Integer.parseInt(args[1]));
|
|
||||||
break;
|
|
||||||
case Server:
|
|
||||||
ServerMode();
|
|
||||||
break;
|
|
||||||
case Testing:
|
|
||||||
TestingSystemMode();
|
|
||||||
break;
|
|
||||||
case Package:
|
|
||||||
PackageMode();
|
|
||||||
break;
|
|
||||||
case Undefined:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
System.out.println("VISUALISER FAILED");
|
|
||||||
ex.printStackTrace();
|
|
||||||
if (Global.Log != null)
|
|
||||||
Global.Log.PrintException(ex);
|
|
||||||
FinishApplication();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
package Common;
|
|
||||||
import com.google.gson.annotations.Expose;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
public class GlobalProperties extends Properties {
|
|
||||||
@Override
|
|
||||||
public String getFieldDescription(String fieldName) {
|
|
||||||
switch (fieldName) {
|
|
||||||
case "ShowPassesDone":
|
|
||||||
return "Сообщать об успешном выполнении проходов";
|
|
||||||
case "ConfirmPassesStart":
|
|
||||||
return "Запрашивать подтверждения начала выполнения проходов";
|
|
||||||
case "FocusPassesResult":
|
|
||||||
return "Переходить на результирующую вкладку проходов по их завершении";
|
|
||||||
default:
|
|
||||||
return "?";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@Expose
|
|
||||||
public Current.Mode Mode = Current.Mode.Normal;
|
|
||||||
//---
|
|
||||||
@Expose
|
|
||||||
public int SocketTimeout = 5000;
|
|
||||||
@Expose
|
|
||||||
public boolean OldServer = false;
|
|
||||||
//---
|
|
||||||
@Expose
|
|
||||||
public String SMTPHost = "smtp.mail.ru";
|
|
||||||
@Expose
|
|
||||||
public int SMTPPort = 465;
|
|
||||||
@Expose
|
|
||||||
public int MailSocketPort = 465;
|
|
||||||
//---
|
|
||||||
@Expose
|
|
||||||
public String BackupWorkspace = "_sapfor_x64_backups";
|
|
||||||
@Expose
|
|
||||||
public int BackupHour = 5;
|
|
||||||
@Expose
|
|
||||||
public int BackupMinute = 0;
|
|
||||||
@Expose
|
|
||||||
public boolean EmailAdminsOnStart = false;
|
|
||||||
//---
|
|
||||||
@Expose
|
|
||||||
public boolean AutoUpdateSearch = true;
|
|
||||||
// настройки визуализатора. по крайней мере, флаги.
|
|
||||||
@Expose
|
|
||||||
public boolean ConfirmPassesStart = true;
|
|
||||||
@Expose
|
|
||||||
public boolean ShowPassesDone = true;
|
|
||||||
@Expose
|
|
||||||
public boolean FocusPassesResult = true;
|
|
||||||
@Expose
|
|
||||||
public String GlobalDBName = "db7.sqlite";
|
|
||||||
@Expose
|
|
||||||
public String ProjectDBName = "new_project_base.sqlite";
|
|
||||||
@Expose
|
|
||||||
public String BugReportsDBName = "bug_reports.sqlite";
|
|
||||||
@Expose
|
|
||||||
public String TestsDBName = "tests.sqlite";
|
|
||||||
//-
|
|
||||||
@Expose
|
|
||||||
public int ComponentsWindowWidth = 650;
|
|
||||||
@Expose
|
|
||||||
public int ComponentsWindowHeight = 250;
|
|
||||||
//-
|
|
||||||
@Expose
|
|
||||||
public String VisualiserPath = "";
|
|
||||||
@Expose
|
|
||||||
public String Sapfor_FPath = "";
|
|
||||||
@Expose
|
|
||||||
public String Visualizer_2Path = "";
|
|
||||||
@Expose
|
|
||||||
public String InstructionPath = "";
|
|
||||||
@Expose
|
|
||||||
public String PerformanceAnalyzerPath = "";
|
|
||||||
@Expose
|
|
||||||
public int ComponentsBackUpsCount=10;
|
|
||||||
//- тестирование.
|
|
||||||
@Expose
|
|
||||||
public int TestingKernels = 4; //число ядер для тестирования
|
|
||||||
@Expose
|
|
||||||
public boolean AutoCheckTesting = false; // проверять ли задачи тестирования при включенном визуализаторе.
|
|
||||||
@Expose
|
|
||||||
public int CheckTestingIntervalSeconds = 10; //интервал автопроверки тестирования
|
|
||||||
@Expose
|
|
||||||
public boolean EmailOnTestingProgress = false; //включено ли оповещение по email о результатах тестирования.
|
|
||||||
//-
|
|
||||||
@Override
|
|
||||||
public File getFile() {
|
|
||||||
return Paths.get(System.getProperty("user.dir"),"properties").toFile();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
146
src/Common/MainModule_.java
Normal file
146
src/Common/MainModule_.java
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
package Common;
|
||||||
|
import Common.Database.Objects.PassStats.PassStats;
|
||||||
|
import Common.Database.VisualiserDatabase;
|
||||||
|
import Common.Passes.Pass;
|
||||||
|
import Common.Passes.PassCode_;
|
||||||
|
import Common.Utils.TextLog;
|
||||||
|
import Common.Visual.UIModule_;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Vector;
|
||||||
|
//Основной объект визуализатора.
|
||||||
|
public abstract class MainModule_<D extends VisualiserDatabase, U extends UIModule_> {
|
||||||
|
public static MainModule_ instance = null; //текущий экземпляр. всегда один.
|
||||||
|
//--
|
||||||
|
D db = null;
|
||||||
|
Class<D> db_class = null;
|
||||||
|
LinkedHashMap<Current_, Object> objects = null; //Current/ большинство выведено
|
||||||
|
//--
|
||||||
|
LinkedHashMap<PassCode_, Pass> passes = null;
|
||||||
|
//--
|
||||||
|
U ui = null;
|
||||||
|
Class<U> ui_class = null;
|
||||||
|
MenuElement[] last_menu_path = null;
|
||||||
|
//--
|
||||||
|
public MainModule_(Class<D> db_class_in, Class<U> ui_class_in) throws Exception {
|
||||||
|
ui_class = ui_class_in;
|
||||||
|
db_class = db_class_in;
|
||||||
|
instance = this;
|
||||||
|
}
|
||||||
|
public void Init() throws Exception {
|
||||||
|
//нужно потому что внутри есть ссылки на экземпляр объекта, и конструктор не годится
|
||||||
|
if (ui_class != null) {
|
||||||
|
ui = ui_class.newInstance();
|
||||||
|
}
|
||||||
|
//--
|
||||||
|
createPasses();
|
||||||
|
//-
|
||||||
|
objects = new LinkedHashMap<>();
|
||||||
|
}
|
||||||
|
//ИНТЕРФЕЙС
|
||||||
|
public boolean hasUI() {
|
||||||
|
return ui != null;
|
||||||
|
}
|
||||||
|
public U getUI() {
|
||||||
|
return ui;
|
||||||
|
}
|
||||||
|
public boolean hasLastMenuPath() {
|
||||||
|
return last_menu_path != null;
|
||||||
|
}
|
||||||
|
public MenuElement[] getLastMenuPath() {
|
||||||
|
return last_menu_path;
|
||||||
|
}
|
||||||
|
public MenuElement[] setLastMenuPath(MenuElement[] last_menu_path_in) {
|
||||||
|
return last_menu_path = last_menu_path_in;
|
||||||
|
}
|
||||||
|
//БАЗА ДАННЫХ И ТЕКУЩИЕ ОБЪЕКТЫ
|
||||||
|
public D getDb() {
|
||||||
|
return db;
|
||||||
|
}
|
||||||
|
public void ActivateDB() throws Exception {
|
||||||
|
db = db_class.newInstance();
|
||||||
|
db.Connect();
|
||||||
|
db.CreateAllTables();
|
||||||
|
db.prepareTablesStatements();
|
||||||
|
db.Synchronize();
|
||||||
|
}
|
||||||
|
public void DeactivateDB() throws Exception {
|
||||||
|
if (db != null) db.Disconnect();
|
||||||
|
}
|
||||||
|
public Object get(Current_ name) {
|
||||||
|
if (!objects.containsKey(name))
|
||||||
|
objects.put(name, null);
|
||||||
|
return objects.get(name);
|
||||||
|
}
|
||||||
|
public Object set(Current_ name, Object object) {
|
||||||
|
if (objects.containsKey(name))
|
||||||
|
objects.replace(name, object);
|
||||||
|
else objects.put(name, object);
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
public boolean Check(TextLog Log, Current_... names) {
|
||||||
|
for (Current_ name : names)
|
||||||
|
if (get(name) == null)
|
||||||
|
Log.Writeln_(name.getDescription() + " не выбран(а)");
|
||||||
|
return Log.isEmpty();
|
||||||
|
}
|
||||||
|
//ПРОХОДЫ
|
||||||
|
public abstract Class getPassCodesEnum();
|
||||||
|
public abstract String getAllPassesClassPrefix();
|
||||||
|
private void createPasses() {
|
||||||
|
passes = new LinkedHashMap<>();
|
||||||
|
for (Object code : getPassCodesEnum().getEnumConstants()) {
|
||||||
|
try {
|
||||||
|
Class<?> clazz = Class.forName(getAllPassesClassPrefix() + code.toString());
|
||||||
|
Pass pass = ((Pass) clazz.newInstance());
|
||||||
|
passes.put((PassCode_) code, pass);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void setPassesControlsVisible(boolean flag, PassCode_... codes_in) {
|
||||||
|
for (PassCode_ code_in : codes_in)
|
||||||
|
getPass(code_in).setControlsVisible(flag);
|
||||||
|
}
|
||||||
|
public Pass getPass(PassCode_ code) {
|
||||||
|
return passes.get(code);
|
||||||
|
}
|
||||||
|
public String getPassDescription(String passName) {
|
||||||
|
return ((PassCode_) Enum.valueOf(MainModule_.instance.getPassCodesEnum(), passName)).getDescription();
|
||||||
|
}
|
||||||
|
public Vector<Pass> getFirstAccessPasses() {
|
||||||
|
Vector<PassStats> sortedStats = new Vector<>(getDb().passStats.Data.values());
|
||||||
|
sortedStats.sort(new Comparator<PassStats>() {
|
||||||
|
@Override
|
||||||
|
public int compare(PassStats o1, PassStats o2) {
|
||||||
|
return Integer.compare(o2.Usages, o1.Usages);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Vector<Pass> res = new Vector<>();
|
||||||
|
for (PassStats passStats : sortedStats) {
|
||||||
|
PassCode_ passCode = (PassCode_) Enum.valueOf(getPassCodesEnum(), passStats.code);
|
||||||
|
//--
|
||||||
|
Pass pass = getPass(passCode);
|
||||||
|
if (pass.hasStats())
|
||||||
|
res.add(getPass(passCode));
|
||||||
|
//--
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
//---
|
||||||
|
public int getFirstAccessPassesCount() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
public boolean confirmPassesStart() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public boolean confirmPassesDone() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public boolean focusPassesResult() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/Common/MainModules/_MainModule.java
Normal file
13
src/Common/MainModules/_MainModule.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package Common.MainModules;
|
||||||
|
import Common.Database.Database;
|
||||||
|
import Common.Visual.UIModule_;
|
||||||
|
public class _MainModule {
|
||||||
|
protected Database db = null;
|
||||||
|
protected UIModule_ ui = null;
|
||||||
|
public boolean hasUI() {
|
||||||
|
return ui != null;
|
||||||
|
}
|
||||||
|
public Database getDb() {
|
||||||
|
return db;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +1,30 @@
|
|||||||
package Visual_DVM_2021.Passes;
|
package Common.Passes;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
public abstract class AddObjectPass<D extends DBObject> extends ObjectPass<D> {
|
public abstract class AddObjectPass<D extends DBObject> extends ObjectPass<D> {
|
||||||
public AddObjectPass(Class<D> d_in) {
|
public AddObjectPass(Class<D> d_in) {
|
||||||
super(d_in);
|
super(d_in);
|
||||||
}
|
}
|
||||||
public Class<? extends DBObject> getOwner() {
|
protected Class<? extends DBObject> getOwnerClass() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
protected DBObject getOwner() {
|
||||||
|
return getDb().getTable(getOwnerClass()).getUI().getCurrent();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getDescription_() {
|
||||||
|
return "добавление";
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
target = d.newInstance();
|
target = d.newInstance();
|
||||||
return
|
return ((getOwnerClass() == null) || (getDb().getTable(getOwnerClass()).getUI().CheckCurrent(Log))) && fillObjectFields();
|
||||||
((getOwner() == null) || (getDb().tables.get(getOwner()).CheckCurrent(Log))) &&
|
|
||||||
fillObjectFields();
|
|
||||||
}
|
}
|
||||||
protected boolean fillObjectFields() throws Exception {
|
protected boolean fillObjectFields() throws Exception {
|
||||||
return getTable().ShowAddObjectDialog(target);
|
return getTable().getUI().ShowAddObjectDialog(target);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
return "/icons/RedAdd.png";
|
return "/Common/icons/RedAdd.png";
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
@@ -1,17 +1,21 @@
|
|||||||
package Visual_DVM_2021.Passes;
|
package Common.Passes;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.Objects.DBObject;
|
||||||
public abstract class DeleteObjectPass<D extends DBObject> extends ObjectPass<D> {
|
public abstract class DeleteObjectPass<D extends DBObject> extends ObjectPass<D> {
|
||||||
public DeleteObjectPass(Class<D> d_in) {
|
public DeleteObjectPass(Class<D> d_in) {
|
||||||
super(d_in);
|
super(d_in);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public String getDescription_() {
|
||||||
|
return "удаление";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
return "/icons/Delete.png";
|
return "/Common/icons/Delete.png";
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
target = (D) getTable().getCurrent();
|
target = (D) getTable().getUI().getCurrent();
|
||||||
return getTable().CheckCurrent(Log) && getTable().ShowDeleteObjectDialog(target);
|
return getTable().getUI().CheckCurrent(Log) && getTable().getUI().ShowDeleteObjectDialog(target);
|
||||||
}
|
}
|
||||||
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.
|
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.
|
||||||
@Override
|
@Override
|
||||||
@@ -23,7 +27,7 @@ public abstract class DeleteObjectPass<D extends DBObject> extends ObjectPass<D>
|
|||||||
case DROP:
|
case DROP:
|
||||||
break;
|
break;
|
||||||
case DELETE:
|
case DELETE:
|
||||||
getDb().tables.get(dep).ClearUI();
|
getDb().getTable(dep).ClearUI();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,25 +35,11 @@ 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
|
||||||
protected void performFinish() throws Exception {
|
protected void showFinish() throws Exception {
|
||||||
getTable().ShowUI();
|
getTable().ShowUI();
|
||||||
for (Class dep : getTable().getFKDependencies().keySet()) {
|
|
||||||
getDb().tables.get(dep).RefreshUI();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
58
src/Common/Passes/DeleteObjectsPass.java
Normal file
58
src/Common/Passes/DeleteObjectsPass.java
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
package Common.Passes;
|
||||||
|
import Common.Database.Objects.DBObject;
|
||||||
|
public abstract class DeleteObjectsPass<D extends DBObject> extends ObjectsPass<D> {
|
||||||
|
public DeleteObjectsPass(Class<D> d_in) {
|
||||||
|
super(d_in);
|
||||||
|
}
|
||||||
|
public String getDescription_() {
|
||||||
|
return "удаление";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getIconPath() {
|
||||||
|
return "/Common/icons/Delete.png";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
|
if (!getTable().getUI().CheckSelectedOrCurrent(Log))
|
||||||
|
return false;
|
||||||
|
target = getTable().getUI().getSelectedOrCurrent();
|
||||||
|
return getTable().getUI().ShowDeleteObjectsDialog(target.size());
|
||||||
|
}
|
||||||
|
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.
|
||||||
|
@Override
|
||||||
|
protected void showPreparation() throws Exception {
|
||||||
|
getTable().ClearUI();
|
||||||
|
for (Class dep : getTable().getFKDependencies().keySet()) {
|
||||||
|
switch (getTable().getFKDependencies().get(dep).data) {
|
||||||
|
case NONE:
|
||||||
|
case DROP:
|
||||||
|
break;
|
||||||
|
case DELETE:
|
||||||
|
getDb().getTable(dep).ClearUI();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void body() throws Exception {
|
||||||
|
for (D d : target) {
|
||||||
|
getDb().Delete(d);
|
||||||
|
for (Class dep : getTable().getFKDependencies().keySet()) {
|
||||||
|
switch (getTable().getFKDependencies().get(dep).data) {
|
||||||
|
case NONE:
|
||||||
|
break;
|
||||||
|
case DROP:
|
||||||
|
getDb().DropByFK(d, dep);
|
||||||
|
break;
|
||||||
|
case DELETE:
|
||||||
|
getDb().DeleteByFK(d, dep);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void showFinish() throws Exception {
|
||||||
|
getTable().ShowUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
34
src/Common/Passes/EditObjectPass.java
Normal file
34
src/Common/Passes/EditObjectPass.java
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
package Common.Passes;
|
||||||
|
import Common.Database.Objects.DBObject;
|
||||||
|
public abstract class EditObjectPass<D extends DBObject> extends ObjectPass<D> {
|
||||||
|
public EditObjectPass(Class<D> d_in) {
|
||||||
|
super(d_in);
|
||||||
|
}
|
||||||
|
public String getDescription_() {
|
||||||
|
return "редактирование";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getIconPath() {
|
||||||
|
return "/Common/icons/Edit.png";
|
||||||
|
}
|
||||||
|
protected boolean fillObjectFields() throws Exception {
|
||||||
|
return getTable().getUI().ShowEditObjectDialog(target);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
|
target = (D) getTable().getUI().getCurrent();
|
||||||
|
return getTable().getUI().CheckCurrent(Log) && fillObjectFields();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void body() throws Exception {
|
||||||
|
getDb().Update(target);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void showFinish() throws Exception {
|
||||||
|
getTable().ShowUI(target.getPK());
|
||||||
|
for (Class dep : getTable().getFKDependencies().keySet()) {
|
||||||
|
if (getDb().getTable(dep).getUI() != null)
|
||||||
|
getDb().getTable(dep).getUI().RedrawControl();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
29
src/Common/Passes/ObjectPass.java
Normal file
29
src/Common/Passes/ObjectPass.java
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package Common.Passes;
|
||||||
|
import Common.Database.Database;
|
||||||
|
import Common.Database.Objects.DBObject;
|
||||||
|
import Common.Database.Tables.DBTable;
|
||||||
|
import Common.MainModule_;
|
||||||
|
public abstract class ObjectPass<D extends DBObject> extends Pass<D> {
|
||||||
|
protected Class<D> d; //класс объектов.
|
||||||
|
public ObjectPass(Class<D> d_in) {
|
||||||
|
d = d_in;
|
||||||
|
}
|
||||||
|
protected Database getDb() {
|
||||||
|
return MainModule_.instance.getDb();
|
||||||
|
}
|
||||||
|
//источник данных
|
||||||
|
public DBTable getTable() {
|
||||||
|
return getDb().getTable(d);
|
||||||
|
} //таблица в источнике данных
|
||||||
|
public String getDescription_() {
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return getTable().getSingleDescription() + ": " + getDescription_();
|
||||||
|
}
|
||||||
|
@Override//sorted
|
||||||
|
public String getButtonText() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
31
src/Common/Passes/ObjectsPass.java
Normal file
31
src/Common/Passes/ObjectsPass.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package Common.Passes;
|
||||||
|
import Common.Database.Database;
|
||||||
|
import Common.Database.Objects.DBObject;
|
||||||
|
import Common.Database.Tables.DBTable;
|
||||||
|
import Common.MainModule_;
|
||||||
|
|
||||||
|
import java.util.Vector;
|
||||||
|
//массовый проход с объектами. на данный момент удаление.
|
||||||
|
public abstract class ObjectsPass<D extends DBObject> extends Pass<Vector<D>> {
|
||||||
|
protected Class<D> d; //класс объектов.
|
||||||
|
public ObjectsPass(Class<D> d_in) {
|
||||||
|
d = d_in;
|
||||||
|
}
|
||||||
|
protected Database getDb() {
|
||||||
|
return MainModule_.instance.getDb();
|
||||||
|
}
|
||||||
|
public DBTable getTable() {
|
||||||
|
return getDb().getTable(d);
|
||||||
|
} //таблица в источнике данных
|
||||||
|
@Override
|
||||||
|
public String getButtonText() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
public String getDescription_() {
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return getTable().getPluralDescription() + ": " + getDescription_();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,83 +1,51 @@
|
|||||||
package Visual_DVM_2021.Passes;
|
package Common.Passes;
|
||||||
import Common.Current;
|
import Common.MainModule_;
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.DebugPrintLevel;
|
|
||||||
import Common.UI.Menus_2023.PassButton;
|
|
||||||
import Common.UI.Menus_2023.PassControl;
|
|
||||||
import Common.UI.Menus_2023.StablePassMenuItem;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import Common.Utils.Stopwatch;
|
import Common.Utils.Stopwatch;
|
||||||
import Common.Utils.TextLog;
|
import Common.Utils.TextLog;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils_;
|
||||||
import Visual_DVM_2021.PassStats.PassStats;
|
import Common.Visual.Controls.PassButton;
|
||||||
import Visual_DVM_2021.Passes.UI.PassForm;
|
import Common.Visual.Controls.PassControl;
|
||||||
|
import Common.Visual.Controls.StablePassMenuItem;
|
||||||
|
import Common.Visual.UI;
|
||||||
|
import Common.Visual.Windows.PassForm;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.concurrent.Semaphore;
|
import java.util.concurrent.Semaphore;
|
||||||
public class Pass_2021<T> {
|
public class Pass<T> {
|
||||||
public static Vector<Pass_2021> FAPasses = new Vector<>();
|
|
||||||
//</editor-fold>
|
|
||||||
//-
|
|
||||||
public static LinkedHashMap<PassCode_2021, Pass_2021> passes = new LinkedHashMap<>();
|
|
||||||
public PassStats stats = null;
|
|
||||||
public int callsCount = 0; //число вызовов прохода за текущий сеанс визуализатора.
|
public int callsCount = 0; //число вызовов прохода за текущий сеанс визуализатора.
|
||||||
public T target; //главный аргумент.
|
public T target; //главный аргумент.
|
||||||
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<>();
|
||||||
protected TextLog Log; //внутренний журнал прохода.
|
public TextLog Log; //внутренний журнал прохода.
|
||||||
protected boolean interrupt;
|
protected boolean interrupt;
|
||||||
protected SwingWorker dispatcher = null;
|
protected SwingWorker dispatcher = null;
|
||||||
private PassForm form = null;
|
|
||||||
protected JMenuItem menuItem = null;
|
protected JMenuItem menuItem = null;
|
||||||
|
private PassForm form = null;
|
||||||
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 static Throwable getCauseRec(Throwable ex) {
|
public Throwable getCauseRec(Throwable ex) {
|
||||||
Throwable cause = ex.getCause();
|
Throwable cause = ex.getCause();
|
||||||
return (cause == null) ? ex : getCauseRec(cause);
|
return (cause == null) ? ex : getCauseRec(cause);
|
||||||
}
|
}
|
||||||
public static void setPassesControlsVisible(boolean flag, PassCode_2021... codes_in) {
|
|
||||||
for (PassCode_2021 code_in : codes_in)
|
|
||||||
passes.get(code_in).setControlsVisible(flag);
|
|
||||||
}
|
|
||||||
//важно. вызывать только если есть интерфейс.
|
|
||||||
public static void CheckAllStats() throws Exception {
|
|
||||||
for (Pass_2021 pass : FAPasses) {
|
|
||||||
if (!Global.db.passStats.Data.containsKey(pass.code()))
|
|
||||||
Global.db.Insert(pass.stats = new PassStats(pass));
|
|
||||||
else pass.stats = Global.db.passStats.Data.get(pass.code());
|
|
||||||
}
|
|
||||||
FAPasses.sort(new SortPassesByStats());
|
|
||||||
}
|
|
||||||
public static void CreateAll() {
|
|
||||||
for (PassCode_2021 code : PassCode_2021.values()) {
|
|
||||||
if (code != PassCode_2021.Undefined) {
|
|
||||||
try {
|
|
||||||
Class<?> clazz = Class.forName("Visual_DVM_2021.Passes.All." + code.toString());
|
|
||||||
Pass_2021 pass = ((Pass_2021) clazz.newInstance());
|
|
||||||
passes.put(code, pass);
|
|
||||||
if (pass.hasStats())
|
|
||||||
FAPasses.add(pass);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Global.Log.PrintException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//<editor-fold desc="Интерфейс">
|
//<editor-fold desc="Интерфейс">
|
||||||
//https://www.delftstack.com/ru/howto/java/java-resize-image/
|
//https://www.delftstack.com/ru/howto/java/java-resize-image/
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public Icon getTabIcon(){
|
public Icon getTabIcon() {
|
||||||
return Utils.getTabIcon(getIconPath());
|
return Utils_.getTabIcon(getIconPath());
|
||||||
}
|
}
|
||||||
public AbstractAction getControlAction() {
|
public AbstractAction getControlAction() {
|
||||||
return new AbstractAction() {
|
return new AbstractAction() {
|
||||||
@@ -111,8 +79,9 @@ public class Pass_2021<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)
|
||||||
@@ -120,33 +89,31 @@ public class Pass_2021<T> {
|
|||||||
}
|
}
|
||||||
protected void FocusResult() {
|
protected void FocusResult() {
|
||||||
}
|
}
|
||||||
protected boolean hasStats() {
|
public boolean hasStats() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public void UpdateStatsIfNeed() {
|
public void UpdateStatsIfNeed() {
|
||||||
if (hasStats()) {
|
if (hasStats()) {
|
||||||
stats.Inc();
|
|
||||||
try {
|
try {
|
||||||
Global.db.Update(stats);
|
MainModule_.instance.getDb().passStats.IncPassStat(getName());
|
||||||
FAPasses.sort(new SortPassesByStats());
|
|
||||||
if (Current.HasProject())
|
|
||||||
UI.fastAccessMenuBar.Refresh();
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Global.Log.PrintException(ex);
|
Utils_.MainLog.PrintException(ex);
|
||||||
}
|
}
|
||||||
|
if (UI.isActive())
|
||||||
|
MainModule_.instance.getUI().getFastAccessMenuBar().Refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public PassCode_2021 code() {
|
|
||||||
return PassCode_2021.valueOf(getClass().getSimpleName());
|
|
||||||
}
|
|
||||||
public boolean isDone() {
|
public boolean isDone() {
|
||||||
return state == PassState.Done;
|
return state.equals(PassState.Done);
|
||||||
}
|
}
|
||||||
public void setDone() {
|
public void setDone() {
|
||||||
state = PassState.Done;
|
state = PassState.Done;
|
||||||
}
|
}
|
||||||
|
public String getName() {
|
||||||
|
return getClass().getSimpleName();
|
||||||
|
}
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return code().getDescription();
|
return MainModule_.instance.getPassDescription(getName());
|
||||||
}
|
}
|
||||||
public String getStartDescription() {
|
public String getStartDescription() {
|
||||||
return getDescription();
|
return getDescription();
|
||||||
@@ -189,34 +156,34 @@ public class Pass_2021<T> {
|
|||||||
//-
|
//-
|
||||||
private void PerformCanNotStart() throws Exception {
|
private void PerformCanNotStart() throws Exception {
|
||||||
performCanNotStart();
|
performCanNotStart();
|
||||||
if (Current.hasUI())
|
if (UI.isActive())
|
||||||
showCanNotStart();
|
showCanNotStart();
|
||||||
}
|
}
|
||||||
protected void PerformPreparation() throws Exception {
|
protected void PerformPreparation() throws Exception {
|
||||||
performPreparation();
|
performPreparation();
|
||||||
if (Current.hasUI())
|
if (UI.isActive())
|
||||||
showPreparation();
|
showPreparation();
|
||||||
}
|
}
|
||||||
private void PerformFinish() throws Exception {
|
private void PerformFinish() throws Exception {
|
||||||
performFinish();
|
performFinish();
|
||||||
//-
|
//-
|
||||||
if (Current.hasUI())
|
if (UI.isActive())
|
||||||
showFinish();
|
showFinish();
|
||||||
}
|
}
|
||||||
private void PerformDone() throws Exception {
|
private void PerformDone() throws Exception {
|
||||||
performDone();
|
performDone();
|
||||||
//-
|
//-
|
||||||
if (Current.hasUI())
|
if (UI.isActive())
|
||||||
showDone();
|
showDone();
|
||||||
}
|
}
|
||||||
private void PerformFail() throws Exception {
|
private void PerformFail() throws Exception {
|
||||||
performFail();
|
performFail();
|
||||||
//-
|
//-
|
||||||
if (Current.hasUI())
|
if (UI.isActive())
|
||||||
showFail();
|
showFail();
|
||||||
}
|
}
|
||||||
//------
|
//------
|
||||||
protected PassCode_2021 necessary() {
|
protected PassCode_ necessary() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
protected boolean resetsNecessary() {
|
protected boolean resetsNecessary() {
|
||||||
@@ -227,33 +194,34 @@ public class Pass_2021<T> {
|
|||||||
state = PassState.Inactive;
|
state = PassState.Inactive;
|
||||||
}
|
}
|
||||||
//------
|
//------
|
||||||
protected void createStack_r(Stack<Pass_2021> ToDo, Vector<String> ToPrint) {
|
protected void createStack_r(Stack<Pass> ToDo, Vector<String> ToPrint) {
|
||||||
ToDo.push(this);
|
ToDo.push(this);
|
||||||
if (needsConfirmations() // если UI нет, сюда он не дойдет.
|
if (needsConfirmations() // если UI нет, сюда он не дойдет.
|
||||||
) {
|
) {
|
||||||
ToPrint.add(this.getStartDescription());
|
ToPrint.add(this.getStartDescription());
|
||||||
}
|
}
|
||||||
if (necessary() != null) {
|
if (necessary() != null) {
|
||||||
Pass_2021 next = passes.get(necessary());
|
Pass next = MainModule_.instance.getPass(necessary());
|
||||||
if (resetsNecessary() || !next.isDone())
|
if (resetsNecessary() || !next.isDone())
|
||||||
next.createStack_r(ToDo, ToPrint);
|
next.createStack_r(ToDo, ToPrint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean Do(Object... args) {
|
public boolean Do(Object... args) {
|
||||||
Stack<Pass_2021> ToDo = new Stack<>();
|
Stack<Pass> ToDo = new Stack<>();
|
||||||
Vector<String> ToPrint = new Vector<>();
|
Vector<String> ToPrint = new Vector<>();
|
||||||
createStack_r(ToDo, ToPrint);
|
createStack_r(ToDo, ToPrint);
|
||||||
if (Global.properties.ConfirmPassesStart && !ToPrint.isEmpty() &&
|
if (
|
||||||
!UI.Question("Выполнить проход(ы):\n" + String.join("\n", ToPrint))
|
UI.isActive() && MainModule_.instance.confirmPassesStart() && !ToPrint.isEmpty() &&
|
||||||
|
!UI.Question("Выполнить проход(ы):\n" + String.join("\n", ToPrint))
|
||||||
) return false;
|
) return false;
|
||||||
while (ToDo.size() > 1) {
|
while (ToDo.size() > 1) {
|
||||||
if (!ToDo.pop().start()) return false;
|
if (!ToDo.pop().start()) return false;
|
||||||
}
|
}
|
||||||
if (start(args)) {
|
if (start(args)) {
|
||||||
if (Global.properties.FocusPassesResult)
|
if (UI.isActive() && MainModule_.instance.focusPassesResult())
|
||||||
FocusResult();
|
FocusResult();
|
||||||
//-
|
//-
|
||||||
if (Global.properties.ShowPassesDone && !ToPrint.isEmpty()
|
if (UI.isActive() && MainModule_.instance.confirmPassesDone() && !ToPrint.isEmpty()
|
||||||
) {
|
) {
|
||||||
UI.Info("Проход(ы)\n\n" + String.join("\n", ToPrint) +
|
UI.Info("Проход(ы)\n\n" + String.join("\n", ToPrint) +
|
||||||
"\nуспешно выполнен(ы)!");
|
"\nуспешно выполнен(ы)!");
|
||||||
@@ -269,7 +237,7 @@ public class Pass_2021<T> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public void Interrupt() throws Exception {
|
public void Interrupt() throws Exception {
|
||||||
UI.Info("Проход " + Utils.Brackets(getDescription()) + " не разрешено прерывать.");
|
UI.Info("Проход " + Utils_.Brackets(getDescription()) + " не разрешено прерывать.");
|
||||||
}
|
}
|
||||||
public boolean needsConfirmations() {
|
public boolean needsConfirmations() {
|
||||||
return false;
|
return false;
|
||||||
@@ -280,7 +248,7 @@ public class Pass_2021<T> {
|
|||||||
if (ex instanceof PassException) {
|
if (ex instanceof PassException) {
|
||||||
Log.Writeln_(ex.getMessage());
|
Log.Writeln_(ex.getMessage());
|
||||||
} else
|
} else
|
||||||
Global.Log.PrintException(ex);
|
Utils_.MainLog.PrintException(ex);
|
||||||
}
|
}
|
||||||
public boolean start(Object... args) {
|
public boolean start(Object... args) {
|
||||||
//------------------------------->
|
//------------------------------->
|
||||||
@@ -292,23 +260,22 @@ public class Pass_2021<T> {
|
|||||||
target = null;
|
target = null;
|
||||||
Log = new TextLog();
|
Log = new TextLog();
|
||||||
if (!getDescription().isEmpty())
|
if (!getDescription().isEmpty())
|
||||||
Global.Log.Print(DebugPrintLevel.Passes, getDescription() + " стартует..");
|
Utils_.MainLog.Print(getDescription() + " стартует..");
|
||||||
timer.Start();
|
timer.Start();
|
||||||
//------------------------------->
|
//------------------------------->
|
||||||
try {
|
try {
|
||||||
if (Current.hasUI()) FocusBeforeStart();
|
if (UI.isActive()) FocusBeforeStart();
|
||||||
if (canStart(args)) {
|
if (canStart(args)) {
|
||||||
PerformPreparation();
|
PerformPreparation();
|
||||||
//todo тут должна быть вилка на анимацию?
|
if (UI.isActive() && needsAnimation()) {
|
||||||
if (Current.hasUI() && needsAnimation()) {
|
|
||||||
animation_sem = new Semaphore(1);
|
animation_sem = new Semaphore(1);
|
||||||
animation_sem.acquire();
|
animation_sem.acquire();
|
||||||
//---
|
//---
|
||||||
form = null;
|
form = null;
|
||||||
Current.set(Current.PassForm, null);
|
MainModule_.instance.getUI().DropPassForm();
|
||||||
System.gc();
|
System.gc();
|
||||||
//--
|
//--
|
||||||
Current.set(Current.PassForm, form = new PassForm(this));
|
form = MainModule_.instance.getUI().SetPassForm(new PassForm(this));
|
||||||
dispatcher = new SwingWorker() {
|
dispatcher = new SwingWorker() {
|
||||||
@Override
|
@Override
|
||||||
protected Object doInBackground() {
|
protected Object doInBackground() {
|
||||||
@@ -323,7 +290,7 @@ public class Pass_2021<T> {
|
|||||||
try {
|
try {
|
||||||
animation_sem.acquire();
|
animation_sem.acquire();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Global.Log.PrintException(e);
|
Utils_.MainLog.PrintException(e);
|
||||||
}
|
}
|
||||||
//и уничтожаем его.
|
//и уничтожаем его.
|
||||||
// UI.Print(DebugPrintLevel.Passes, "Окно анимации активировано.");
|
// UI.Print(DebugPrintLevel.Passes, "Окно анимации активировано.");
|
||||||
@@ -356,11 +323,7 @@ public class Pass_2021<T> {
|
|||||||
CheckException(ex);
|
CheckException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//---
|
|
||||||
// UI.Info(this.getClass().getSimpleName()+" +");
|
|
||||||
PerformFinish();
|
PerformFinish();
|
||||||
// UI.Info(this.getClass().getSimpleName()+" ++");
|
|
||||||
//---
|
|
||||||
if ((state != PassState.Crushed) && validate()) {
|
if ((state != PassState.Crushed) && validate()) {
|
||||||
state = PassState.Done;
|
state = PassState.Done;
|
||||||
PerformDone();
|
PerformDone();
|
||||||
@@ -374,19 +337,19 @@ public class Pass_2021<T> {
|
|||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
state = PassState.ExternalCrushed;
|
state = PassState.ExternalCrushed;
|
||||||
Global.Log.PrintException(ex);
|
Utils_.MainLog.PrintException(ex);
|
||||||
}
|
}
|
||||||
//------------------------------->
|
//------------------------------->
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
if (!getDescription().isEmpty()) {
|
if (!getDescription().isEmpty()) {
|
||||||
Global.Log.Print(DebugPrintLevel.Passes,
|
Utils_.MainLog.Print(
|
||||||
getDescription() +
|
getDescription() +
|
||||||
" окончен за " + timer.Print() +
|
" окончен за " + timer.Print() +
|
||||||
" состояние " + Utils.Brackets(state.getDescription())
|
" состояние " + Utils_.Brackets(state.getDescription())
|
||||||
);
|
);
|
||||||
if (!Log.isEmpty() && Current.hasUI())
|
if (!Log.isEmpty() && UI.isActive())
|
||||||
UI.Error(
|
UI.Error(
|
||||||
"проход " + Utils.Brackets(getDescription()) + "\n" + state.getDescription() + "\n\n" +
|
"проход " + Utils_.Brackets(getDescription()) + "\n" + state.getDescription() + "\n\n" +
|
||||||
Log.toString());
|
Log.toString());
|
||||||
}
|
}
|
||||||
//------------------------------->
|
//------------------------------->
|
||||||
@@ -394,7 +357,7 @@ public class Pass_2021<T> {
|
|||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
public void ShowSapforMessage(String message) {
|
public void ShowSapforMessage(String message) {
|
||||||
if (Current.hasUI() && form != null) {
|
if (UI.isActive() && form != null) {
|
||||||
String[] data = message.split(":");
|
String[] data = message.split(":");
|
||||||
switch (data[0]) {
|
switch (data[0]) {
|
||||||
case "message_1":
|
case "message_1":
|
||||||
@@ -407,17 +370,15 @@ public class Pass_2021<T> {
|
|||||||
form.fields.ProgressBar.setValue((data.length > 1) ? Integer.parseInt(data[1]) : 0);
|
form.fields.ProgressBar.setValue((data.length > 1) ? Integer.parseInt(data[1]) : 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else System.out.println(Utils.Brackets(message));
|
}
|
||||||
}
|
}
|
||||||
public void ShowMessage1(String message) {
|
public void ShowMessage1(String message) {
|
||||||
if (form != null)
|
if (form != null)
|
||||||
form.fields.Label1.setText((message.length() > 1) ? message : "");
|
form.fields.Label1.setText((message.length() > 1) ? message : "");
|
||||||
else System.out.println(Utils.Brackets(message));
|
|
||||||
}
|
}
|
||||||
public void ShowMessage2(String message) {
|
public void ShowMessage2(String message) {
|
||||||
if (form != null)
|
if (form != null)
|
||||||
form.fields.Label2.setText((message.isEmpty() ? "" : message));
|
form.fields.Label2.setText((message.isEmpty() ? "" : message));
|
||||||
else System.out.println(Utils.Brackets(message));
|
|
||||||
}
|
}
|
||||||
public void ShowProgress(int total, int current, boolean auto) {
|
public void ShowProgress(int total, int current, boolean auto) {
|
||||||
if (form != null) {
|
if (form != null) {
|
||||||
6
src/Common/Passes/PassCode_.java
Normal file
6
src/Common/Passes/PassCode_.java
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package Common.Passes;
|
||||||
|
public interface PassCode_ {
|
||||||
|
default String getDescription() {
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Visual_DVM_2021.Passes;
|
package Common.Passes;
|
||||||
public class PassException extends Exception {
|
public class PassException extends Exception {
|
||||||
//штатное исключение
|
//штатное исключение
|
||||||
public PassException(String text) {
|
public PassException(String text) {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Visual_DVM_2021.Passes;
|
package Common.Passes;
|
||||||
public enum PassState {
|
public enum PassState {
|
||||||
Inactive,
|
Inactive,
|
||||||
Interrupted,
|
Interrupted,
|
||||||
@@ -1,62 +1,44 @@
|
|||||||
package Common;
|
package Common;
|
||||||
import Common.UI.Menus_2023.StableMenuItem;
|
import Common.Utils.Utils_;
|
||||||
import Common.Utils.Utils;
|
import Common.Visual.Controls.StableMenuItem;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
public abstract class Properties {
|
import java.util.LinkedHashMap;
|
||||||
public void addFlagMenuItem(JMenu menu, String fieldName) {
|
public class Properties {
|
||||||
JMenuItem menu_item = new StableMenuItem(getFieldDescription(fieldName),
|
protected LinkedHashMap<String, JMenuItem> controls = new LinkedHashMap<>();
|
||||||
getFlag(fieldName) ? "/icons/Pick.png" : "/icons/NotPick.png");
|
private File file = null; //файл где хранятся настройки.
|
||||||
//-
|
public Properties() {
|
||||||
menu_item.addActionListener(e -> {
|
|
||||||
switchFlag(fieldName);
|
|
||||||
Update();
|
|
||||||
menu_item.setIcon(Utils.getIcon(getFlag(fieldName) ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
|
||||||
});
|
|
||||||
menu.add(menu_item);
|
|
||||||
}
|
}
|
||||||
public boolean getFlag(String fieldName) {
|
public Properties(File file_in) {
|
||||||
boolean field = false;
|
setFile(file_in);
|
||||||
try {
|
|
||||||
field = (boolean) GlobalProperties.class.getField(fieldName).get(this);
|
|
||||||
//
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
return field;
|
|
||||||
}
|
}
|
||||||
public void switchFlag(String fieldName) {
|
public File getFile() {
|
||||||
boolean field = false;
|
return file;
|
||||||
try {
|
}
|
||||||
field = (boolean) GlobalProperties.class.getField(fieldName).get(this);
|
public void setFile(File file) {
|
||||||
GlobalProperties.class.getField(fieldName).set(this, !field);
|
this.file = file;
|
||||||
//
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public void Update() {
|
public void Update() {
|
||||||
try {
|
try {
|
||||||
Utils.jsonToFile(this, getFile());
|
Utils_.jsonToFile(this, getFile());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//--
|
|
||||||
public abstract String getFieldDescription(String fieldName);
|
|
||||||
public abstract File getFile();
|
|
||||||
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);
|
||||||
Object oldValue = field.get(Global.properties);
|
Object oldValue = field.get(this);
|
||||||
//---
|
//---
|
||||||
if (newValue.equals(oldValue))
|
if (newValue.equals(oldValue))
|
||||||
return false;
|
return false;
|
||||||
//--
|
//--
|
||||||
field.set(this, newValue);
|
field.set(this, newValue);
|
||||||
this.Update();
|
Update();
|
||||||
return true;
|
return true;
|
||||||
//--
|
//--
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
@@ -64,17 +46,49 @@ public abstract class Properties {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public void switchAndUpdateFlag(String name){
|
public String getFieldDescription(String fieldName) {
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
public boolean controlAction(String fieldName, JMenuItem control
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public JMenuItem getMenuItem(String fieldName) {
|
||||||
|
final JMenuItem menuItem;
|
||||||
|
if (controls.containsKey(fieldName))
|
||||||
|
menuItem = controls.get(fieldName);
|
||||||
|
else {
|
||||||
|
menuItem = new StableMenuItem();
|
||||||
|
Mark(fieldName, menuItem);
|
||||||
|
menuItem.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (controlAction(fieldName, menuItem))
|
||||||
|
Mark(fieldName, menuItem);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
controls.put(fieldName, menuItem);
|
||||||
|
}
|
||||||
|
return menuItem;
|
||||||
|
}
|
||||||
|
public void Mark(String fieldName, JMenuItem control) {
|
||||||
|
String description = getFieldDescription(fieldName);
|
||||||
try {
|
try {
|
||||||
Field field = getClass().getField(name);
|
Object value = this.getClass().getField(fieldName).get(this);
|
||||||
boolean oldValue = (boolean) field.get(Global.properties);
|
if (value instanceof Boolean) {
|
||||||
boolean newValue = !oldValue;
|
Boolean flag = (Boolean) value;
|
||||||
//---
|
control.setText(description);
|
||||||
field.set(this, newValue);
|
control.setIcon(Utils_.getIcon(flag ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
||||||
this.Update();
|
} else {
|
||||||
//--
|
control.setText(description + " : " + value);
|
||||||
} catch (Exception exception) {
|
}
|
||||||
exception.printStackTrace();
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void setControlVisible(String settingName, boolean flag) {
|
||||||
|
if (controls.containsKey(settingName)) {
|
||||||
|
controls.get(settingName).setVisible(flag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
package Common.UI;
|
|
||||||
import Common.Global;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
//класс, представляющий собой прокручиваемую панель, на которой лежит нечто.
|
|
||||||
public class ControlForm<C extends Component> {
|
|
||||||
public C control = null;
|
|
||||||
protected Class<C> control_class;
|
|
||||||
protected JPanel content; //задник.
|
|
||||||
public JScrollPane scroll = null;
|
|
||||||
public ControlForm(Class<C> class_in) {
|
|
||||||
control_class = class_in;
|
|
||||||
setContent(new JPanel(new BorderLayout()));
|
|
||||||
}
|
|
||||||
//нужно будет вывестии сделать нормальные формы для деревьев а не ручное создание.
|
|
||||||
public JPanel getContent() {
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
public void setContent(JPanel content_in) {
|
|
||||||
|
|
||||||
content = content_in;
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
public void Show() {
|
|
||||||
Clear();
|
|
||||||
CreateControl();
|
|
||||||
//------------------------
|
|
||||||
scroll = new JScrollPane(control);
|
|
||||||
scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
|
|
||||||
scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
|
||||||
}
|
|
||||||
public void CreateControl() {
|
|
||||||
try {
|
|
||||||
control = control_class.newInstance();
|
|
||||||
} catch (Exception e) {
|
|
||||||
Global.Log.PrintException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean isShown() {
|
|
||||||
return control != null;
|
|
||||||
}
|
|
||||||
public void Clear() {
|
|
||||||
control = null; //очищено.
|
|
||||||
}
|
|
||||||
public void Refresh() {
|
|
||||||
if (control != null)
|
|
||||||
refresh();
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
protected void refresh() {
|
|
||||||
} //перерисовать контрол.
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package Common.UI;
|
|
||||||
import Common.Current;
|
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
public class ControlWithCurrentForm<C extends Component> extends ControlForm<C> {
|
|
||||||
public ControlWithCurrentForm(Class<C> class_in) {
|
|
||||||
super(class_in);
|
|
||||||
}
|
|
||||||
//-
|
|
||||||
public Current CurrentName() {
|
|
||||||
return Current.Undefined;
|
|
||||||
}
|
|
||||||
public void ShowCurrentObject() throws Exception {
|
|
||||||
}
|
|
||||||
public void ShowNoCurrentObject() throws Exception {
|
|
||||||
}
|
|
||||||
public void MouseAction2() throws Exception {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package Common.UI;
|
|
||||||
import Common.Current;
|
|
||||||
public interface DataControl_OLD {
|
|
||||||
//todo скорее всего устареет.
|
|
||||||
default Current getCurrent() {
|
|
||||||
return Current.Undefined;
|
|
||||||
}
|
|
||||||
//-?
|
|
||||||
default void ShowCurrentObject() throws Exception {
|
|
||||||
}
|
|
||||||
default void ShowNoCurrentObject() throws Exception {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,329 +0,0 @@
|
|||||||
package Common.UI;
|
|
||||||
import Common.Constants;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Database.DBObject;
|
|
||||||
import Common.Database.DBTable;
|
|
||||||
import Common.Database.DataSet;
|
|
||||||
import Common.Database.FKBehaviour;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.Menus.TableMenu;
|
|
||||||
import Common.UI.Tables.ColumnInfo;
|
|
||||||
import Common.UI.Tables.DataTable;
|
|
||||||
import Common.UI.Tables.Grid.GridAnchestor;
|
|
||||||
import GlobalData.Grid.Grid;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import javax.swing.table.TableColumn;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.MouseAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Vector;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.IntStream;
|
|
||||||
|
|
||||||
import static Common.UI.Tables.TableEditors.EditorSelect;
|
|
||||||
import static Common.UI.Tables.TableRenderers.RendererSelect;
|
|
||||||
public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
|
||||||
protected JPanel dataPanel;
|
|
||||||
protected DataSet dataSource;
|
|
||||||
public JPanel getDataPanel() {
|
|
||||||
return dataPanel;
|
|
||||||
}
|
|
||||||
protected int current_row_i;
|
|
||||||
protected boolean events_on = true;
|
|
||||||
protected String colNamesAndSizes = "";
|
|
||||||
protected Vector<ColumnInfo> columns = new Vector<>();
|
|
||||||
public DataSetControlForm(DataSet dataSource_in) {
|
|
||||||
this(dataSource_in, DataTable.class);
|
|
||||||
}
|
|
||||||
public DataSetControlForm(DataSet dataSource_in, Class tableClass) {
|
|
||||||
super(tableClass);
|
|
||||||
dataSource = dataSource_in;
|
|
||||||
//---
|
|
||||||
dataPanel = new JPanel(new BorderLayout());
|
|
||||||
content.add(dataPanel, BorderLayout.CENTER);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void Show() {
|
|
||||||
super.Show();
|
|
||||||
dataPanel.add(scroll);
|
|
||||||
dataPanel.updateUI();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void Clear() {
|
|
||||||
super.Clear();
|
|
||||||
UI.Clear(dataPanel);
|
|
||||||
}
|
|
||||||
public DataSet getDataSource() {
|
|
||||||
return dataSource;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Current CurrentName() {
|
|
||||||
return getDataSource().CurrentName();
|
|
||||||
}
|
|
||||||
public void SaveColumns() {
|
|
||||||
if (Global.db != null) {
|
|
||||||
try {
|
|
||||||
if ((CurrentName() != Current.Undefined)) {
|
|
||||||
Vector<String> widths = IntStream.range(0, columns.size()).mapToObj(i -> String.valueOf(control.getColumnModel().getColumn(i).getWidth())).collect(Collectors.toCollection(Vector::new));
|
|
||||||
String packed = String.join("|", widths);
|
|
||||||
Grid grid;
|
|
||||||
if (Global.db.grids.containsKey(CurrentName())) {
|
|
||||||
grid = Global.db.grids.get(CurrentName());
|
|
||||||
} else {
|
|
||||||
grid = new Grid(CurrentName());
|
|
||||||
Global.db.Insert(grid);
|
|
||||||
}
|
|
||||||
grid.sizes = packed;
|
|
||||||
Global.db.Update(grid);
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean hasCheckBox() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
private Vector<String> getHeaders() {
|
|
||||||
return columns.stream().map(ColumnInfo::getName).collect(Collectors.toCollection(Vector::new));
|
|
||||||
}
|
|
||||||
protected void CreateColumnsInfo() {
|
|
||||||
columns.clear();
|
|
||||||
columns.add(new ColumnInfo(getDataSource().getPKName()));
|
|
||||||
if (hasCheckBox()) {
|
|
||||||
columns.add(new ColumnInfo("", RendererSelect, EditorSelect));
|
|
||||||
columns.get(1).setMinWidth(25);
|
|
||||||
columns.get(1).setMaxWidth(25);
|
|
||||||
}
|
|
||||||
Arrays.stream(getDataSource().getUIColumnNames()).forEach(name -> columns.add(new ColumnInfo(name)));
|
|
||||||
AdditionalInitColumns();
|
|
||||||
}
|
|
||||||
protected void AdditionalInitColumns() {
|
|
||||||
//уточнение инфы по столбцам.
|
|
||||||
}
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public void CreateControl() {
|
|
||||||
CreateColumnsInfo();
|
|
||||||
GridAnchestor table_data_model = new GridAnchestor(getHeaders(), dataSource.getVisibleKeys()) {
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
|
||||||
Object key = data.get(rowIndex);
|
|
||||||
if (columnIndex == 0)
|
|
||||||
return key;
|
|
||||||
DBObject object = getDataSource().get((key));
|
|
||||||
if ((columnIndex == 1) && hasCheckBox())
|
|
||||||
return object.isSelected();
|
|
||||||
return getDataSource().getFieldAt(object, columnIndex);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean isCellEditable(int row, int col) {
|
|
||||||
return columns.get(col).isEditable();
|
|
||||||
}
|
|
||||||
//------------------------------------------------------------------------------------
|
|
||||||
@Override
|
|
||||||
public void setValueAt(Object value, int row, int col) {
|
|
||||||
fireTableCellUpdated(row, col);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
control = new DataTable(table_data_model) {
|
|
||||||
@Override
|
|
||||||
public TableMenu CreateMenu() {
|
|
||||||
return new TableMenu(this);
|
|
||||||
}
|
|
||||||
//строго говоря эта штука нужна только для рендереров и едиторов клеток.
|
|
||||||
@Override
|
|
||||||
public DBObject getRowObject(int rowIndex) {
|
|
||||||
//вот так делать НЕЛЬЗЯ. модель только для внутреннего пользования
|
|
||||||
// Object key = table_data_model.data.get(rowIndex);
|
|
||||||
//из таблицы можно пользоваться только getValueAt
|
|
||||||
//иначе сортировка не будет работать.
|
|
||||||
Object key = getValueAt(rowIndex, 0);
|
|
||||||
return getDataSource().get(key);
|
|
||||||
}
|
|
||||||
//-----------------------------NEW-------------------------------------
|
|
||||||
@Override
|
|
||||||
public void CorrectColumnsSizes() {
|
|
||||||
if ((Global.db != null) && CurrentName() != Current.Undefined && Global.db.grids.containsKey(CurrentName())) {
|
|
||||||
//Undefined может оказаться в таблице, например если енум устарел. Поэтому надо проверять.
|
|
||||||
if (!getColumnsProfile().equalsIgnoreCase(colNamesAndSizes)) {
|
|
||||||
Grid grid = Global.db.grids.get(CurrentName());
|
|
||||||
String[] data = grid.sizes.split("\\|");
|
|
||||||
for (int i = 0; i < columns.size(); ++i) {
|
|
||||||
if (i <= (data.length - 1)) {
|
|
||||||
int width = Integer.parseInt(data[i]);
|
|
||||||
getColumnModel().getColumn(i).setPreferredWidth(width);
|
|
||||||
getColumnModel().getColumn(i).setWidth(width);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
super.CorrectColumnsSizes(); //обычный авторазмер.
|
|
||||||
}
|
|
||||||
public String getColumnsProfile() {
|
|
||||||
String res = "";
|
|
||||||
for (int i = 0; i < getColumnModel().getColumnCount(); i++) {
|
|
||||||
if (i > 0) res += ",";
|
|
||||||
TableColumn column = getColumnModel().getColumn(i);
|
|
||||||
res += column.getHeaderValue();
|
|
||||||
res += ":";
|
|
||||||
res += column.getWidth();
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void Init() {
|
|
||||||
for (int i = 0; i < columns.size(); i++) {
|
|
||||||
ColumnInfo columnInfo = columns.get(i);
|
|
||||||
if (columnInfo.isVisible()) {
|
|
||||||
if (columnInfo.hasRenderer())
|
|
||||||
getColumnModel().getColumn(i).setCellRenderer(UI.TableRenderers.get(columnInfo.getRenderer()));
|
|
||||||
if (columnInfo.hasEditor())
|
|
||||||
getColumnModel().getColumn(i).setCellEditor(UI.TableEditors.get(columnInfo.getEditor()));
|
|
||||||
if (columnInfo.hasMaxWidth())
|
|
||||||
getColumnModel().getColumn((i)).setMaxWidth(columnInfo.getMaxWidth());
|
|
||||||
if (columnInfo.hasMinWidth())
|
|
||||||
getColumnModel().getColumn((i)).setMinWidth(columnInfo.getMinWidth());
|
|
||||||
} else {
|
|
||||||
getColumnModel().getColumn(i).setMinWidth(0);
|
|
||||||
getColumnModel().getColumn(i).setMaxWidth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//обновление в БД при ручном изменении размера столбиков.--------->>
|
|
||||||
getTableHeader().addMouseListener(new MouseAdapter() {
|
|
||||||
public void mouseReleased(MouseEvent arg0) {
|
|
||||||
System.out.println("Header mouse released");
|
|
||||||
String new_colNamesAndSizes = getColumnsProfile();
|
|
||||||
// check if changed, if yes, persist...
|
|
||||||
if (!colNamesAndSizes.equals(new_colNamesAndSizes)) {
|
|
||||||
colNamesAndSizes = new_colNamesAndSizes;
|
|
||||||
SaveColumns();
|
|
||||||
System.out.println("columns updated");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//------------------------->>
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (CurrentName() != Current.Undefined) {
|
|
||||||
current_row_i = Constants.Nan;
|
|
||||||
ListSelectionModel selModel = control.getSelectionModel();
|
|
||||||
selModel.addListSelectionListener(e -> {
|
|
||||||
int row = control.getSelectedRow();
|
|
||||||
if ((row >= 0)) {
|
|
||||||
if (row != current_row_i) {
|
|
||||||
current_row_i = row;
|
|
||||||
// System.out.println("current row_i="+current_row_i);
|
|
||||||
getDataSource().setCurrent(control.getRowObject(row));
|
|
||||||
if (events_on) {
|
|
||||||
try {
|
|
||||||
ShowCurrentObject();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Global.Log.PrintException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
current_row_i = Constants.Nan;
|
|
||||||
// System.out.println("no current row_i="+current_row_i);
|
|
||||||
getDataSource().dropCurrent();
|
|
||||||
if (events_on) {
|
|
||||||
try {
|
|
||||||
ShowNoCurrentObject();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Global.Log.PrintException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//двойной клик мыши.------------------------------------------------------
|
|
||||||
control.addMouseListener(new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(MouseEvent e) {
|
|
||||||
if ((e.getClickCount() == 2) && (dataSource.getCurrent() != null)) {
|
|
||||||
try {
|
|
||||||
MouseAction2();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Global.Log.PrintException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
//при переотображении таблицы скидываем текущий объект!!
|
|
||||||
getDataSource().dropCurrent();
|
|
||||||
try {
|
|
||||||
ShowNoCurrentObject();
|
|
||||||
} catch (Exception e) {
|
|
||||||
Global.Log.PrintException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//---
|
|
||||||
/*
|
|
||||||
if (hasCheckBox()) {
|
|
||||||
TableColumn column = control.getColumnModel().getColumn(1)
|
|
||||||
column.setHeaderRenderer(new TableCellRenderer() {
|
|
||||||
@Override
|
|
||||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected void refresh() {
|
|
||||||
control.CorrectSizes();
|
|
||||||
}
|
|
||||||
public void Show(Object pk) {
|
|
||||||
Show();
|
|
||||||
Select(pk);
|
|
||||||
}
|
|
||||||
public void Select(Object pk) {
|
|
||||||
if (isShown())
|
|
||||||
control.SelectRowByPK(pk);
|
|
||||||
}
|
|
||||||
public void ClearSelection() {
|
|
||||||
if (isShown())
|
|
||||||
control.clearSelection(); //строка сбросится сама. благодаря сбросу события выбора
|
|
||||||
}
|
|
||||||
public int getRowCount() {
|
|
||||||
return control.getRowCount();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void ShowCurrentObject() throws Exception {
|
|
||||||
if (dataSource instanceof DBTable) {
|
|
||||||
DBTable table = (DBTable) dataSource;
|
|
||||||
for (Class dep : table.getFKDependencies().keySet()) {
|
|
||||||
FKBehaviour behaviour = table.getFKDependencies().get(dep);
|
|
||||||
switch (behaviour.ui) {
|
|
||||||
case ACTIVE:
|
|
||||||
table.getDb().tables.get(dep).ShowUI();
|
|
||||||
break;
|
|
||||||
case PASSIVE:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void ShowNoCurrentObject() throws Exception {
|
|
||||||
if (dataSource instanceof DBTable) {
|
|
||||||
DBTable table = (DBTable) dataSource;
|
|
||||||
for (Class dep : table.getFKDependencies().keySet()) {
|
|
||||||
FKBehaviour behaviour = table.getFKDependencies().get(dep);
|
|
||||||
switch (behaviour.ui) {
|
|
||||||
case ACTIVE:
|
|
||||||
table.getDb().tables.get(dep).ClearUI();
|
|
||||||
break;
|
|
||||||
case PASSIVE:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package Common.UI;
|
|
||||||
public enum DebugPrintLevel {
|
|
||||||
Undefined,
|
|
||||||
Passes,
|
|
||||||
Project;
|
|
||||||
public String getDescription() {
|
|
||||||
return toString();
|
|
||||||
}
|
|
||||||
public boolean isEnabled() {
|
|
||||||
switch (this) {
|
|
||||||
case Passes:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package Common.UI;
|
|
||||||
import Common.UI.Windows.Dialog.DialogFields;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
public class EmptyDialogFields implements DialogFields {
|
|
||||||
private JPanel content;
|
|
||||||
@Override
|
|
||||||
public Component getContent() {
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package Common.UI.List;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.UI.Themes.VisualiserFonts;
|
|
||||||
public class HyperlinksStyledList extends StyledList {
|
|
||||||
@Override
|
|
||||||
public void applyTheme() {
|
|
||||||
super.applyTheme();
|
|
||||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package Common.UI.List;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.UI.Themes.ThemeElement;
|
|
||||||
import Common.UI.Themes.VisualiserFonts;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
public class StyledList extends JList implements ThemeElement {
|
|
||||||
public StyledList() {
|
|
||||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
|
||||||
applyTheme();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void applyTheme() {
|
|
||||||
setBackground(Current.getTheme().table_background);
|
|
||||||
setForeground(Current.getTheme().foreground);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package Common.UI.Menus;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.UI.Themes.VisualiserFonts;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
public class PassesSubMenu extends JMenu {
|
|
||||||
public PassesSubMenu(String title, String icon, PassCode_2021... passes) {
|
|
||||||
super(title);
|
|
||||||
setIcon(Utils.getIcon(icon));
|
|
||||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.Menu));
|
|
||||||
for (PassCode_2021 code : passes) {
|
|
||||||
add(Pass_2021.passes.get(code).createMenuItem());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
package Common.UI.Menus;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.Menus_2023.LanguagesSubmenu;
|
|
||||||
import Common.UI.Menus_2023.StableMenuItem;
|
|
||||||
import Common.UI.Menus_2023.StylesSubmenu;
|
|
||||||
import Common.UI.Menus_2023.TypesSubmenu;
|
|
||||||
import Common.UI.Trees.StyledTree;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import ProjectData.Files.FileType;
|
|
||||||
import ProjectData.Files.LanguageStyle;
|
|
||||||
import ProjectData.LanguageName;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
public class ProjectFilesMenu extends GraphMenu {
|
|
||||||
VisualiserMenuItem m_select_all;
|
|
||||||
VisualiserMenuItem m_unselect_all;
|
|
||||||
VisualiserMenuItem m_multiselection;
|
|
||||||
JMenu mLanguage;
|
|
||||||
JMenu mStyle;
|
|
||||||
JMenu mType;
|
|
||||||
public ProjectFilesMenu(StyledTree tree) {
|
|
||||||
super(tree, "подпапки");
|
|
||||||
addSeparator();
|
|
||||||
JMenuItem m = new VisualiserMenuItem("Открыть в проводнике...", "/icons/Explorer.png");
|
|
||||||
m.addActionListener(
|
|
||||||
new AbstractAction() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
try {
|
|
||||||
Desktop.getDesktop().open(Current.getProject().Home);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Global.Log.PrintException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(m);
|
|
||||||
addSeparator();
|
|
||||||
add(new PassesSubMenu("Добавить", "/icons/RedAdd.png",
|
|
||||||
PassCode_2021.AddFile,
|
|
||||||
PassCode_2021.CreateEmptyDirectory,
|
|
||||||
PassCode_2021.ImportFiles));
|
|
||||||
addSeparator();
|
|
||||||
add(new PassesSubMenu("Переименовать", "/icons/Menu/Rename.png",
|
|
||||||
PassCode_2021.RenameFile,
|
|
||||||
PassCode_2021.RenameDirectory));
|
|
||||||
add(new VisualiserMenuItem("Удалить текущий проект", "/icons/Delete.png") {
|
|
||||||
{
|
|
||||||
addActionListener(e -> {
|
|
||||||
if (Current.HasProject()) {
|
|
||||||
UI.getVersionsWindow().getVersionsForm().getTree().SelectNode(Current.getProject().node);
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DeleteVersion).Do();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
addSeparator();
|
|
||||||
m_multiselection = new VisualiserMenuItem("Массовый режим работы с файлами");
|
|
||||||
m_multiselection.setIcon(Utils.getIcon(Global.files_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
|
||||||
m_multiselection.addActionListener(e -> {
|
|
||||||
Global.files_multiselection = !Global.files_multiselection;
|
|
||||||
m_multiselection.setIcon(Utils.getIcon(Global.files_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
|
||||||
Current.getProject().SelectAllFiles(false);
|
|
||||||
UI.getMainWindow().getProjectWindow().RefreshProjectFiles();
|
|
||||||
|
|
||||||
//-
|
|
||||||
});
|
|
||||||
add(m_multiselection);
|
|
||||||
addSeparator();
|
|
||||||
//-
|
|
||||||
m_select_all = new StableMenuItem("Выбрать всё", "/icons/SelectAll.png");
|
|
||||||
m_select_all.addActionListener(e -> {
|
|
||||||
Current.getProject().SelectAllFiles(true);
|
|
||||||
tree.updateUI();
|
|
||||||
});
|
|
||||||
add(m_select_all);
|
|
||||||
m_unselect_all = new StableMenuItem("Отменить всё", "/icons/UnselectAll.png");
|
|
||||||
m_unselect_all.addActionListener(e -> {
|
|
||||||
Current.getProject().SelectAllFiles(false);
|
|
||||||
tree.updateUI();
|
|
||||||
});
|
|
||||||
add(m_unselect_all);
|
|
||||||
//--------------------------------------------------
|
|
||||||
add(mLanguage = new LanguagesSubmenu(PassCode_2021.SetSelectedFilesLanguage.getDescription()) {
|
|
||||||
@Override
|
|
||||||
public void action(LanguageName languageName) {
|
|
||||||
Pass_2021.passes.get(PassCode_2021.SetSelectedFilesLanguage).Do(languageName);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(mStyle = new StylesSubmenu(PassCode_2021.SetSelectedFilesStyle.getDescription()) {
|
|
||||||
@Override
|
|
||||||
public void action(LanguageStyle languageStyle) {
|
|
||||||
Pass_2021.passes.get(PassCode_2021.SetSelectedFilesStyle).Do(languageStyle);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
add(mType = new TypesSubmenu(PassCode_2021.SetSelectedFilesType.getDescription()) {
|
|
||||||
@Override
|
|
||||||
public void action(FileType fileType) {
|
|
||||||
Pass_2021.passes.get(PassCode_2021.SetSelectedFilesType).Do(fileType);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//--------------------------------------------------
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.ExcludeSelectedFiles).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.IncludeSelectedFiles).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.ExcludeFile).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.IncludeFile).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DeleteFile).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DeleteDirectory).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DeleteSelectedFiles).createMenuItem());
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void CheckElementsVisibility() {
|
|
||||||
m_select_all.setVisible(Global.files_multiselection);
|
|
||||||
m_unselect_all.setVisible(Global.files_multiselection);
|
|
||||||
mLanguage.setVisible(Global.files_multiselection);
|
|
||||||
mStyle.setVisible(Global.files_multiselection);
|
|
||||||
mType.setVisible(Global.files_multiselection);
|
|
||||||
//-
|
|
||||||
Pass_2021.passes.get(PassCode_2021.ExcludeFile).setControlsVisible(!Global.files_multiselection);
|
|
||||||
Pass_2021.passes.get(PassCode_2021.IncludeFile).setControlsVisible(!Global.files_multiselection);
|
|
||||||
//-
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DeleteFile).setControlsVisible(!Global.files_multiselection);
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DeleteDirectory).setControlsVisible(!Global.files_multiselection);
|
|
||||||
//--
|
|
||||||
Pass_2021.passes.get(PassCode_2021.ExcludeSelectedFiles).setControlsVisible(Global.files_multiselection);
|
|
||||||
Pass_2021.passes.get(PassCode_2021.IncludeSelectedFiles).setControlsVisible(Global.files_multiselection);
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DeleteSelectedFiles).setControlsVisible(Global.files_multiselection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package Common.UI.Menus;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.Themes.VisualiserFonts;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
public class PropertiesSubmenu extends JMenu {
|
|
||||||
public PropertiesSubmenu(String title, String icon, String... settings) {
|
|
||||||
super(title);
|
|
||||||
if (icon != null)
|
|
||||||
setIcon(Utils.getIcon(icon));
|
|
||||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.Menu));
|
|
||||||
for (String name : settings) {
|
|
||||||
Global.properties.addFlagMenuItem(this, name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package Common.UI.Menus;
|
|
||||||
import Common.Constants;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
public class TableMenu extends StyledPopupMenu {
|
|
||||||
int row = Constants.Nan;
|
|
||||||
int column = Constants.Nan;
|
|
||||||
Object target = null;
|
|
||||||
//-
|
|
||||||
JTable owner = null;
|
|
||||||
VisualiserMenuItem mcopy;
|
|
||||||
public TableMenu(JTable owner_in) {
|
|
||||||
owner = owner_in;
|
|
||||||
mcopy = new VisualiserMenuItem("Копировать текст текущей ячейки", "/icons/Editor/Copy.png");
|
|
||||||
//если удалось нажать значит все условия выполнены
|
|
||||||
mcopy.addActionListener(e -> Utils.CopyToClipboard(target.toString()));
|
|
||||||
add(mcopy);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void CheckElementsVisibility() {
|
|
||||||
row = owner.getSelectedRow();
|
|
||||||
column = owner.getSelectedColumn();
|
|
||||||
if ((row >= 0) && (column >= 0)) {
|
|
||||||
target = owner.getValueAt(row, column);
|
|
||||||
mcopy.setVisible(true);
|
|
||||||
} else mcopy.setVisible(false);
|
|
||||||
super.CheckElementsVisibility();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package Common.UI.Menus;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.Menus_2023.StableMenuItem;
|
|
||||||
import Common.UI.Trees.DataTree;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
public class VersionsMenu extends GraphMenu<DataTree> {
|
|
||||||
VisualiserMenuItem m_select_all;
|
|
||||||
VisualiserMenuItem m_unselect_all;
|
|
||||||
VisualiserMenuItem m_multiselection;
|
|
||||||
public VersionsMenu(DataTree tree) {
|
|
||||||
super(tree, "подверсии");
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DeleteSubversions).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DeleteLonelyM).createMenuItem());
|
|
||||||
addSeparator();
|
|
||||||
m_multiselection = new VisualiserMenuItem("Массовый режим работы с версиями");
|
|
||||||
m_multiselection.setIcon(Utils.getIcon(Global.versions_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
|
||||||
m_multiselection.addActionListener(e -> {
|
|
||||||
Global.versions_multiselection = !Global.versions_multiselection;
|
|
||||||
m_multiselection.setIcon(Utils.getIcon(Global.versions_multiselection ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
|
||||||
Current.getRoot().SelectAllVersions(false);
|
|
||||||
UI.getVersionsWindow().getVersionsForm().getTree().updateUI();
|
|
||||||
});
|
|
||||||
add(m_multiselection);
|
|
||||||
addSeparator();
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DeleteVersion).createMenuItem());
|
|
||||||
//-
|
|
||||||
m_select_all = new StableMenuItem("Выбрать всё, кроме резервных копий","/icons/SelectAll.png");
|
|
||||||
m_select_all.addActionListener(e -> {
|
|
||||||
Current.getRoot().SelectAllVersions(true);
|
|
||||||
tree.updateUI();
|
|
||||||
});
|
|
||||||
add(m_select_all);
|
|
||||||
m_unselect_all = new StableMenuItem("Отменить всё","/icons/UnselectAll.png");
|
|
||||||
m_unselect_all.addActionListener(e -> {
|
|
||||||
Current.getRoot().SelectAllVersions(false);
|
|
||||||
tree.updateUI();
|
|
||||||
});
|
|
||||||
add(m_unselect_all);
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DeleteSelectedVersions).createMenuItem());
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void CheckElementsVisibility() {
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DeleteSelectedVersions).setControlsVisible(!Global.versions_multiselection);
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DeleteSelectedVersions).setControlsVisible(Global.versions_multiselection);
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DeleteVersion).setControlsVisible(!Global.versions_multiselection);
|
|
||||||
m_select_all.setVisible(Global.versions_multiselection);
|
|
||||||
m_unselect_all.setVisible(Global.versions_multiselection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package Common.UI.Menus;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.UI.Themes.VisualiserFonts;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
public class VisualiserMenuItem extends JMenuItem {
|
|
||||||
public VisualiserMenuItem(String text) {
|
|
||||||
super(text, null);
|
|
||||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.Menu));
|
|
||||||
}
|
|
||||||
public VisualiserMenuItem(String text, String icon_path) {
|
|
||||||
super(text);
|
|
||||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.Menu));
|
|
||||||
if (icon_path != null)
|
|
||||||
setIcon(Utils.getIcon(icon_path));
|
|
||||||
}
|
|
||||||
public VisualiserMenuItem(){
|
|
||||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.Menu));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.BugReportsMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class BugReportsMenuBar extends DataMenuBar {
|
|
||||||
public BugReportsMenuBar() {
|
|
||||||
super("отчёты об ошибках",
|
|
||||||
PassCode_2021.SynchronizeBugReports,
|
|
||||||
PassCode_2021.DownloadAllBugReportsArchives,
|
|
||||||
PassCode_2021.AddBugReport,
|
|
||||||
PassCode_2021.PublishBugReport,
|
|
||||||
PassCode_2021.OpenBugReportTestProject,
|
|
||||||
PassCode_2021.OpenBugReport,
|
|
||||||
PassCode_2021.UpdateBugReportProgress,
|
|
||||||
PassCode_2021.CloseBugReport,
|
|
||||||
PassCode_2021.DeleteBugReport);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.CompilersMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class CompilersMenuBar extends DataMenuBar {
|
|
||||||
public CompilersMenuBar() {
|
|
||||||
super("компиляторы",
|
|
||||||
PassCode_2021.AddCompiler,
|
|
||||||
PassCode_2021.EditCompiler,
|
|
||||||
PassCode_2021.DeleteCompiler,
|
|
||||||
PassCode_2021.ShowCompilerVersion,
|
|
||||||
PassCode_2021.ShowCompilerHelp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.ComponentsMenuBar;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Common.UI.Menus_2023.VisualiserMenu;
|
|
||||||
import Common.UI.Themes.VisualiserFonts;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
public class ComponentsMenuBar extends DataMenuBar {
|
|
||||||
public ComponentsMenuBar() {
|
|
||||||
super("компоненты");
|
|
||||||
addMenus(
|
|
||||||
new VisualiserMenu(
|
|
||||||
"Восстановление предыдущей версии компонента", "/icons/Resurrect.png") {
|
|
||||||
{
|
|
||||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.Menu));
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.ResurrectComponent).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.ResurrectComponentFromServer).createMenuItem());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
addPasses(PassCode_2021.InstallComponentFromFolder,
|
|
||||||
PassCode_2021.UpdateSelectedComponents,
|
|
||||||
PassCode_2021.PublishComponent,
|
|
||||||
PassCode_2021.ShowComponentChangesLog);
|
|
||||||
Pass_2021.passes.get(PassCode_2021.PublishComponent).setControlsVisible(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.ConfigurationsMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class ConfigurationsMenuBar extends DataMenuBar {
|
|
||||||
public ConfigurationsMenuBar() {
|
|
||||||
super("конфигурации");
|
|
||||||
addPasses(
|
|
||||||
PassCode_2021.StartTests,
|
|
||||||
PassCode_2021.PublishConfiguration,
|
|
||||||
PassCode_2021.EditConfiguration,
|
|
||||||
PassCode_2021.DeleteConfiguration
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.DVMParametersMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class DVMParametersMenuBar extends DataMenuBar {
|
|
||||||
public DVMParametersMenuBar() {
|
|
||||||
super("параметры",
|
|
||||||
PassCode_2021.AddDVMParameter,
|
|
||||||
PassCode_2021.EditDVMParameter,
|
|
||||||
PassCode_2021.DeleteDVMParameter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.EnvironmentValuesMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class EnvironmentValuesMenuBar extends DataMenuBar {
|
|
||||||
public EnvironmentValuesMenuBar() {
|
|
||||||
super("переменные окружения", PassCode_2021.AddEnvironmentValue,
|
|
||||||
PassCode_2021.EditEnvironmentValue,
|
|
||||||
PassCode_2021.DeleteEnvironmentValue,
|
|
||||||
PassCode_2021.PickCompilerEnvironments
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.FastAccessMenuBar;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.Menus_2023.VisualiserMenuBar;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import GlobalData.Settings.SettingName;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
public class FastAccessMenuBar extends VisualiserMenuBar {
|
|
||||||
LinkedHashMap<PassCode_2021, JButton> passesButtons = new LinkedHashMap<>();
|
|
||||||
public FastAccessMenuBar() {
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void setSizeLimits() {
|
|
||||||
//если задавать PreffredSize 0, скролл НЕ РАБОТАЕТ. Магия!
|
|
||||||
}
|
|
||||||
public void showPass(Pass_2021 pass) {
|
|
||||||
JButton button = null;
|
|
||||||
if (passesButtons.containsKey(pass.code()))
|
|
||||||
button = passesButtons.get((pass.code()));
|
|
||||||
else {
|
|
||||||
button = pass.createButton();
|
|
||||||
passesButtons.put(pass.code(), button);
|
|
||||||
}
|
|
||||||
add(button);
|
|
||||||
Dimension d = button.getPreferredSize();
|
|
||||||
button.setPreferredSize(new Dimension(d.width, 30));
|
|
||||||
revalidate();
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
public void Refresh() {
|
|
||||||
UI.Clear(this);
|
|
||||||
int i = 1;
|
|
||||||
for (Pass_2021 pass : Pass_2021.FAPasses) {
|
|
||||||
if (pass.stats.HasUsages()) {
|
|
||||||
showPass(pass);
|
|
||||||
++i;
|
|
||||||
if (i > (Global.db.settings.get(SettingName.FastAccessPassesCount).toInt32())) break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void Drop(){
|
|
||||||
UI.Clear(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.FileMenuBar;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.UI.Menus_2023.LanguagesSubmenu;
|
|
||||||
import Common.UI.Menus_2023.StylesSubmenu;
|
|
||||||
import Common.UI.Menus_2023.TypesSubmenu;
|
|
||||||
import Common.UI.Menus_2023.VisualiserMenu;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import ProjectData.Files.FileType;
|
|
||||||
import ProjectData.Files.LanguageStyle;
|
|
||||||
import ProjectData.LanguageName;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
public class FileSettingsMenu extends VisualiserMenu {
|
|
||||||
JMenu mLanguage;
|
|
||||||
JMenu mStyle;
|
|
||||||
JMenu mType;
|
|
||||||
public FileSettingsMenu() {
|
|
||||||
super("Настройки файла", "/icons/Settings.png");
|
|
||||||
add(mLanguage = new LanguagesSubmenu() {
|
|
||||||
@Override
|
|
||||||
public void action(LanguageName languageName) {
|
|
||||||
if (Current.getFile().UpdateLanguage(languageName)) {
|
|
||||||
Current.getSapfor().ResetAllAnalyses();
|
|
||||||
Current.getFile().form.ShowLanguage();
|
|
||||||
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RefreshNode(Current.getFile().node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ShowLanguage();
|
|
||||||
//--
|
|
||||||
add(mStyle = new StylesSubmenu() {
|
|
||||||
@Override
|
|
||||||
public void action(LanguageStyle languageStyle) {
|
|
||||||
if (Current.getFile().UpdateStyle(languageStyle)) {
|
|
||||||
Current.getSapfor().ResetAllAnalyses();
|
|
||||||
Current.getFile().form.ShowStyle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ShowStyle();
|
|
||||||
//--
|
|
||||||
add(mType = new TypesSubmenu() {
|
|
||||||
@Override
|
|
||||||
public void action(FileType fileType) {
|
|
||||||
if (Current.getFile().UpdateType(fileType)) {
|
|
||||||
Current.getSapfor().ResetAllAnalyses();
|
|
||||||
UI.getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RefreshNode(Current.getFile().node);
|
|
||||||
Current.getFile().form.ShowType();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ShowType();
|
|
||||||
}
|
|
||||||
public void ShowLanguage() {
|
|
||||||
mLanguage.setText("Язык: " + Current.getFile().languageName.getDescription());
|
|
||||||
}
|
|
||||||
public void ShowStyle() {
|
|
||||||
mStyle.setText("Стиль: " + Current.getFile().style.getDescription());
|
|
||||||
}
|
|
||||||
public void ShowType() {
|
|
||||||
mType.setText("Тип: " + Current.getFile().fileType.getDescription());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.GroupsMenuBar;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Common.UI.Menus_2023.MenuBarButton;
|
|
||||||
import Common.Utils.Utils;
|
|
||||||
import TestingSystem.Common.Group.GroupsDBTable;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
public class GroupsMenuBar extends DataMenuBar {
|
|
||||||
public GroupsMenuBar() {
|
|
||||||
super("группы", PassCode_2021.SynchronizeTests, PassCode_2021.ConvertCorrectnessTests,
|
|
||||||
PassCode_2021.PublishGroup,
|
|
||||||
PassCode_2021.CreateGroupFromDirectory,
|
|
||||||
PassCode_2021.CreateGroupFromFiles,
|
|
||||||
PassCode_2021.EditGroup,
|
|
||||||
PassCode_2021.DeleteGroup
|
|
||||||
);
|
|
||||||
add(new JSeparator());
|
|
||||||
add(new MenuBarButton() {
|
|
||||||
{
|
|
||||||
setText("Свои");
|
|
||||||
setToolTipText("Отображать только группы тестов авторства пользователя");
|
|
||||||
Mark();
|
|
||||||
addActionListener(e -> {
|
|
||||||
GroupsDBTable.filterMyOnly = !GroupsDBTable.filterMyOnly;
|
|
||||||
Mark();
|
|
||||||
Global.testingServer.db.groups.ShowUI();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public void Mark() {
|
|
||||||
setIcon(Utils.getIcon(GroupsDBTable.filterMyOnly ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public void addFilters(JMenu typesFilterMenu, JMenu languagesFilterMenu) {
|
|
||||||
filters = addMenus(typesFilterMenu, languagesFilterMenu);
|
|
||||||
}
|
|
||||||
JMenuBar filters= null;
|
|
||||||
public void DropFilters() {
|
|
||||||
if (filters != null) {
|
|
||||||
remove(filters);
|
|
||||||
filters = null;
|
|
||||||
}
|
|
||||||
revalidate();
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.MachinesMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class MachinesMenuBar extends DataMenuBar {
|
|
||||||
public MachinesMenuBar() {
|
|
||||||
super("машины",
|
|
||||||
PassCode_2021.AddMachine,
|
|
||||||
PassCode_2021.EditMachine,
|
|
||||||
PassCode_2021.DeleteMachine);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.MainMenuBar;
|
|
||||||
import Common.UI.Menus_2023.VisualiserMenu;
|
|
||||||
import Repository.Component.Sapfor.Sapfor;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
public class AnalysesMenu extends VisualiserMenu {
|
|
||||||
public AnalysesMenu() {
|
|
||||||
super("Анализаторы","/icons/Analyses.png" );
|
|
||||||
for (PassCode_2021 code : Sapfor.getAnalysesCodes())
|
|
||||||
add(Pass_2021.passes.get(code).createMenuItem());
|
|
||||||
addSeparator();
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.SPF_GetGCovInfo).createMenuItem());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.MainMenuBar;
|
|
||||||
import Common.UI.Menus_2023.VisualiserMenu;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
public class GlobalCleaningMenu extends VisualiserMenu {
|
|
||||||
public GlobalCleaningMenu() {
|
|
||||||
super("Очистка", "/icons/Clean.png", false);
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DropLastProjects).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DropFastAccess).createMenuItem());
|
|
||||||
addSeparator();
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DeleteDownloadedBugReports).createMenuItem());
|
|
||||||
addSeparator();
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DropAnalyses).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.CleanAnalyses).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DropSavedArrays).createMenuItem());
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.DeleteDebugResults).createMenuItem());
|
|
||||||
addSeparator();
|
|
||||||
add(Pass_2021.passes.get(PassCode_2021.ResetCurrentProject).createMenuItem());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.MainMenuBar;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.Menus_2023.MenuBarButton;
|
|
||||||
import Common.UI.Menus_2023.VisualiserMenuBar;
|
|
||||||
import Common.UI.UI;
|
|
||||||
import Repository.Component.PerformanceAnalyzer.PerformanceAnalyzer;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
public class MainMenuBar extends VisualiserMenuBar {
|
|
||||||
JMenu analyses;
|
|
||||||
JMenu transformations;
|
|
||||||
MenuBarButton components;
|
|
||||||
public MainMenuBar() {
|
|
||||||
addMenus(new LastOpenedProjectsMenu());
|
|
||||||
addPasses(PassCode_2021.OpenCurrentProject, PassCode_2021.CreateEmptyProject);
|
|
||||||
addMenus(
|
|
||||||
analyses = new AnalysesMenu(),
|
|
||||||
transformations = new TransformationsMenu(),
|
|
||||||
new GlobalCleaningMenu(),
|
|
||||||
new VisualiserSettingsMenu()
|
|
||||||
);
|
|
||||||
add(components = new MenuBarButton() {
|
|
||||||
{
|
|
||||||
setToolTipText("Компоненты");
|
|
||||||
setIcon("/icons/ComponentsActual.png");
|
|
||||||
addActionListener(e -> {
|
|
||||||
if (PerformanceAnalyzer.isActive) {
|
|
||||||
UI.Info("Перед работой с компонентами закройте анализатор производительности!");
|
|
||||||
} else {
|
|
||||||
Pass_2021.passes.get(PassCode_2021.GetComponentsActualVersions).Do();
|
|
||||||
Global.RefreshUpdatesStatus();
|
|
||||||
UI.ShowComponentsWindow();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
/*
|
|
||||||
add(new MenuBarButton() {
|
|
||||||
{
|
|
||||||
setIcon("/icons/Comparsion.png");
|
|
||||||
setToolTipText("Анализатор статистик");
|
|
||||||
addActionListener(e -> {
|
|
||||||
Global.performanceAnalyzer.Start();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
addPasses(PassCode_2021.ShowInstruction);
|
|
||||||
//-
|
|
||||||
setPreferredSize(new Dimension(0, 30));
|
|
||||||
//---
|
|
||||||
/*
|
|
||||||
add(new MenuBarButton() {
|
|
||||||
{
|
|
||||||
setIcon("/icons/Apply.png");
|
|
||||||
setToolTipText("Test");
|
|
||||||
addActionListener(e -> {
|
|
||||||
Pass_2021.passes.get(PassCode_2021.TestPass).Do();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
*/
|
|
||||||
//---
|
|
||||||
ShowProject(false);
|
|
||||||
}
|
|
||||||
public void ShowUpdatesIcon() {
|
|
||||||
components.setIcon(
|
|
||||||
(Global.need_update > 0) || (Global.bad_state > 0)
|
|
||||||
? "/icons/ComponentsNeedUpdate.gif"
|
|
||||||
: (Global.need_publish > 0 ? "/icons/ComponentsNeedPublish_2023.gif" : "/icons/ComponentsActual.png"));
|
|
||||||
}
|
|
||||||
public void ShowProject(boolean flag) {
|
|
||||||
analyses.setEnabled(flag);
|
|
||||||
transformations.setEnabled(flag);
|
|
||||||
Pass_2021[] cleaningPasses = new Pass_2021[]{
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DropAnalyses),
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DropSavedArrays),
|
|
||||||
Pass_2021.passes.get(PassCode_2021.CleanAnalyses),
|
|
||||||
Pass_2021.passes.get(PassCode_2021.DeleteDebugResults),
|
|
||||||
Pass_2021.passes.get(PassCode_2021.ResetCurrentProject)
|
|
||||||
};
|
|
||||||
for (Pass_2021 pass : cleaningPasses) {
|
|
||||||
pass.setControlsEnabled(flag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.MainMenuBar;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.Menus.PropertiesSubmenu;
|
|
||||||
import Common.UI.Menus_2023.SettingsSubmenu;
|
|
||||||
import Common.UI.Menus_2023.VisualiserMenu;
|
|
||||||
import GlobalData.Settings.SettingName;
|
|
||||||
public class VisualiserSettingsMenu extends VisualiserMenu {
|
|
||||||
public VisualiserSettingsMenu() {
|
|
||||||
super("Настройки визуализатора", "/icons/Settings.png");
|
|
||||||
//-
|
|
||||||
add(new PropertiesSubmenu("Подтверждения и уведомления", null,
|
|
||||||
"ShowPassesDone",
|
|
||||||
"ConfirmPassesStart",
|
|
||||||
"FocusPassesResult"
|
|
||||||
));
|
|
||||||
add(new SettingsSubmenu("Компактность отображения", null,
|
|
||||||
SettingName.SmallScreen,
|
|
||||||
SettingName.ShowFullTabsNames,
|
|
||||||
SettingName.ShowFullArraysDeclarations,
|
|
||||||
SettingName.FastAccessPassesCount,
|
|
||||||
SettingName.LastOpenedProjectsCount
|
|
||||||
));
|
|
||||||
if (Global.isWindows) {
|
|
||||||
add(new SettingsSubmenu("Компиляция на локальной машине", null,
|
|
||||||
SettingName.LocalMakePathWindows,
|
|
||||||
SettingName.Kernels
|
|
||||||
));
|
|
||||||
} else {
|
|
||||||
add(new SettingsSubmenu("Компиляция на локальной машине", null,
|
|
||||||
SettingName.Kernels
|
|
||||||
));
|
|
||||||
}
|
|
||||||
add(new SettingsSubmenu("Синхронизация", null,
|
|
||||||
SettingName.AutoBugReportsLoad,
|
|
||||||
SettingName.AutoTestsLoad
|
|
||||||
));
|
|
||||||
add(new SettingsSubmenu("Сравнение", null,
|
|
||||||
SettingName.ExtensionsOn,
|
|
||||||
SettingName.RegisterOn,
|
|
||||||
SettingName.SpacesOn,
|
|
||||||
SettingName.EmptyLinesOn,
|
|
||||||
SettingName.FortranWrapsOn,
|
|
||||||
SettingName.ComparsionDiffMergeOn
|
|
||||||
));
|
|
||||||
add(Global.db.settings.get(SettingName.Workspace).getMenuItem());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.MakefilesMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class MakefilesMenuBar extends DataMenuBar {
|
|
||||||
public MakefilesMenuBar() {
|
|
||||||
super("мейкфайлы",
|
|
||||||
PassCode_2021.Compile,
|
|
||||||
PassCode_2021.AddMakefile,
|
|
||||||
PassCode_2021.EditMakefile,
|
|
||||||
PassCode_2021.DeleteMakefile);
|
|
||||||
addSeparator();
|
|
||||||
addPasses(PassCode_2021.ShowMakefilePreview, PassCode_2021.EditProjectCompilationMaxtime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.ModulesMenuBar;
|
|
||||||
import Common.UI.Menus_2023.DataMenuBar;
|
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
||||||
public class ModulesMenuBar extends DataMenuBar {
|
|
||||||
public ModulesMenuBar() {
|
|
||||||
super("языковые модули", PassCode_2021.EditModule);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package Common.UI.Menus_2023;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
public class PassButton extends MenuBarButton implements PassControl {
|
|
||||||
public PassButton(Pass_2021 pass, boolean tab) {
|
|
||||||
setText(pass.getButtonText());
|
|
||||||
setToolTipText(pass.getDescription());
|
|
||||||
if (pass.getIconPath() != null) {
|
|
||||||
if (tab) {
|
|
||||||
setIcon(pass.getTabIcon());
|
|
||||||
setPreferredSize(new Dimension(18,18));
|
|
||||||
setMaximumSize(new Dimension(18,18));
|
|
||||||
setMinimumSize(new Dimension(18,18));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
setIcon(pass.getIconPath());
|
|
||||||
}
|
|
||||||
addActionListener(pass.getControlAction());
|
|
||||||
pass.controls.add(this);
|
|
||||||
}
|
|
||||||
public PassButton(Pass_2021 pass) {
|
|
||||||
this(pass, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
package Common.UI.Menus_2023.ProjectMenuBar;
|
|
||||||
import Common.Current;
|
|
||||||
import Common.Global;
|
|
||||||
import Common.UI.Menus_2023.LanguagesSubmenu;
|
|
||||||
import Common.UI.Menus_2023.SettingsSubmenu;
|
|
||||||
import Common.UI.Menus_2023.StylesSubmenu;
|
|
||||||
import Common.UI.Menus_2023.VisualiserMenu;
|
|
||||||
import GlobalData.Settings.SettingName;
|
|
||||||
import ProjectData.Files.LanguageStyle;
|
|
||||||
import ProjectData.LanguageName;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
public class ProjectSettingsMenu extends VisualiserMenu {
|
|
||||||
JMenu mLanguage;
|
|
||||||
JMenu mStyle;
|
|
||||||
public ProjectSettingsMenu() {
|
|
||||||
super("Настройки проекта", "/icons/Settings.png");
|
|
||||||
add(mLanguage = new LanguagesSubmenu() {
|
|
||||||
@Override
|
|
||||||
public void action(LanguageName languageName) {
|
|
||||||
if (Current.getProject().UpdateLanguage(languageName)) {
|
|
||||||
Current.getSapfor().ResetAllAnalyses();
|
|
||||||
ShowLanguage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ShowLanguage();
|
|
||||||
//--
|
|
||||||
add(mStyle = new StylesSubmenu() {
|
|
||||||
@Override
|
|
||||||
public void action(LanguageStyle languageStyle) {
|
|
||||||
if (Current.getProject().UpdateStyle(languageStyle))
|
|
||||||
ShowStyle();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ShowStyle();
|
|
||||||
addSeparator();
|
|
||||||
add(new SettingsSubmenu("Анализ", null,
|
|
||||||
SettingName.Precompilation,
|
|
||||||
SettingName.STATIC_SHADOW_ANALYSIS,
|
|
||||||
SettingName.KEEP_DVM_DIRECTIVES,
|
|
||||||
SettingName.IGNORE_IO_SAPFOR,
|
|
||||||
SettingName.MPI_PROGRAM,
|
|
||||||
SettingName.ANALYSIS_OPTIONS
|
|
||||||
));
|
|
||||||
addSeparator();
|
|
||||||
add(new SettingsSubmenu("Построение системы интервалов", null,
|
|
||||||
SettingName.KEEP_LOOPS_CLOSE_NESTING,
|
|
||||||
SettingName.KEEP_GCOV
|
|
||||||
));
|
|
||||||
addSeparator();
|
|
||||||
add(new SettingsSubmenu("Построение версий", null,
|
|
||||||
SettingName.FREE_FORM,
|
|
||||||
SettingName.KEEP_SPF_DIRECTIVES,
|
|
||||||
SettingName.KEEP_SPF_DIRECTIVES_AMONG_TRANSFORMATIONS,
|
|
||||||
SettingName.OUTPUT_UPPER,
|
|
||||||
SettingName.MAX_SHADOW_WIDTH,
|
|
||||||
SettingName.DVMConvertationOptions,
|
|
||||||
SettingName.SaveModifications
|
|
||||||
));
|
|
||||||
addSeparator();
|
|
||||||
add(Global.db.settings.get(SettingName.TRANSLATE_MESSAGES).getMenuItem());
|
|
||||||
add(Global.db.settings.get(SettingName.DEBUG_PRINT_ON).getMenuItem());
|
|
||||||
add(Global.db.settings.get(SettingName.GCOVLimit).getMenuItem());
|
|
||||||
}
|
|
||||||
public void ShowLanguage() {
|
|
||||||
mLanguage.setText("Язык: " + Current.getProject().languageName.getDescription());
|
|
||||||
}
|
|
||||||
public void ShowStyle() {
|
|
||||||
mStyle.setText("Стиль: " + Current.getProject().style.getDescription());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user