Compare commits
644 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 88b9226bcb | |||
| 9f4e025305 | |||
| ecbd6ecd66 | |||
| e701f54c07 | |||
| 2a2728505f | |||
| a5dc629e21 | |||
| c7fbe8a26a | |||
| b43a8ff2bb | |||
| 6cf303deca | |||
| 855762095f | |||
| 733fd4dc09 | |||
| 71a4985392 | |||
| 0d4d9a4520 | |||
| 622439de62 | |||
| 618d02d7c6 | |||
| d37df9d0f4 | |||
| 011673510d | |||
| ff52b9a79b | |||
| 85a5200e6b | |||
| 0e665ef1b0 | |||
| 2b99df6238 | |||
| 39ea11a8c4 | |||
| 79c7e3e536 | |||
| e4eb264abb | |||
| 500aa2eacf | |||
| b55810f235 | |||
| b898346efb | |||
| 586e4689ae | |||
| 7668aa5766 | |||
| e64090bfaf | |||
| 7c71fd4842 | |||
| 888bf0fcf8 | |||
| 009f22e146 | |||
| ef14b08737 | |||
| 8f9bd3ecb7 | |||
| 3eb6518ea4 | |||
| b15eb92785 | |||
| 96511ca335 | |||
| 974dee54da | |||
| 7e52ce986f | |||
| 4fc4875b91 | |||
| b3138d1982 | |||
| e87622ef5d | |||
| aafe52d2da | |||
| ffe53bf725 | |||
| 832ea7aec5 | |||
| 6d9a157b35 | |||
| 71afc6554e | |||
| bc40da74ab | |||
| 405fde996c | |||
| 8321f09af8 | |||
| 391583b9ea | |||
| 5cf0472806 | |||
| 89598c154e | |||
| 785792d63b | |||
| 5874a39b25 | |||
| 43f3f2f6d8 | |||
| 79a883a303 | |||
| e3f88296e5 | |||
| e207ed7ece | |||
| e97175765b | |||
| 6a0ebb9fee | |||
| 0a698dae34 | |||
| b74c052dd1 | |||
| 330e501277 | |||
| b7d62ace2c | |||
| c6f353ec35 | |||
| 0b7bdd6ade | |||
| 3febbbbcbf | |||
| 31874a8b92 | |||
| c75d9d6bc2 | |||
| 96dd92c3d3 | |||
| ebc41183bc | |||
| feb7982bef | |||
| f241b72453 | |||
| 2b306763c6 | |||
| f1b0a28e71 | |||
| 121f02fb0c | |||
| 848b6d98a5 | |||
| 0589565b8e | |||
| 1109a91dd9 | |||
| 37cb1dbb6a | |||
| 152788fe1b | |||
| 534b363a04 | |||
| 3f13706b97 | |||
| 1f804ab6fc | |||
| 21dd6fbbb1 | |||
| da73acc8a0 | |||
| f9825db2ac | |||
| a3ea3bd1eb | |||
| 805a3acf54 | |||
| f21f2a6422 | |||
| b25d73c0cb | |||
| 50d9603598 | |||
| fae8018df9 | |||
| 3b2715ee58 | |||
| d7c8e8e21d | |||
| 9d11e6e9ca | |||
| 8d90714a82 | |||
| 429d7f58e4 | |||
| 7e15ef9dd1 | |||
| 6060746412 | |||
| 2b4f3d93dc | |||
| f365c7a593 | |||
| fc797ff4a7 | |||
| 63b1f1532a | |||
| b861c647fc | |||
| fa7d95cc53 | |||
| cdb0414097 | |||
| 48ac0a878f | |||
| 804992e485 | |||
| 4ef9497514 | |||
| 3c939a9e5b | |||
| aaddb6897f | |||
| b0db630d56 | |||
| e608fd3a52 | |||
| 573cc1478a | |||
| 25d7516c7a | |||
| 8ac3c4879b | |||
| b551120fcc | |||
| b1846bb804 | |||
| 399a1f466f | |||
| c1ca70adce | |||
| 364520f9a3 | |||
| c0bfe75fd7 | |||
| 1d9618d797 | |||
| 1ac9f823a4 | |||
| 73950690ff | |||
| 2bc79ad2de | |||
| 9ad45b9ea4 | |||
| 89cb9e06f1 | |||
| 3b77f647a6 | |||
| 71c5b20782 | |||
| 08ac48d16e | |||
| 90ac144f2a | |||
| f5b98f803c | |||
| 8f05ef25f6 | |||
| 0022aacbd3 | |||
| ba64c8e231 | |||
| 431c30935c | |||
| 47d0fef508 | |||
| 6decc2f690 | |||
| 2bbd407019 | |||
| abc2c4fe07 | |||
| 2b8342111a | |||
| d57dd30fa0 | |||
| 06d3c53122 | |||
| 5a20897641 | |||
| ae65d448a9 | |||
| df9395e808 | |||
| 402e17b57d | |||
| 3d867dfa3a | |||
| 03a6936f8a | |||
| a4a48f3c3b | |||
| 1d7c390180 | |||
| adb4636513 | |||
| fb0c02e790 | |||
| b5ef4567b6 | |||
| 1a6c2fa340 | |||
| 21784ab491 | |||
| d5147e3dd1 | |||
| bfb1dea84b | |||
| e927a5334a | |||
| 3310eb039c | |||
| 946b4e0e42 | |||
| ff7661f1e0 | |||
| f4eaaf2d59 | |||
| b5fef75133 | |||
| 09035439bd | |||
| 22ed5c599c | |||
| 8822da5d09 | |||
| c4d01b7aff | |||
| c8e962d709 | |||
| cb7819c687 | |||
| ebd9092565 | |||
| 167c6bf39d | |||
| def20a48a3 | |||
| 0945aaf9d0 | |||
| 07dbd89849 | |||
| fa511c5c2c | |||
| 6c065fedfc | |||
| 7858480cde | |||
| c388cb7b21 | |||
| 4d11248b0e | |||
| e2040f2153 | |||
| b19b44f86d | |||
| eb37f8bb8f | |||
| b83a03e36a | |||
| 6d11f6345f | |||
| 32e8cf7923 | |||
| ac2167f5ea | |||
| 8236b0ff96 | |||
| 78cde47c01 | |||
| 2d51bbaeb5 | |||
| 620a87105a | |||
| ab40ad056c | |||
| 62f85d6f92 | |||
| 01ac9d36da | |||
| a466e85b70 | |||
| 5c9fd216bc | |||
| 4685717a8a | |||
| 08ae91e412 | |||
| 145b3ccbe8 | |||
| 4cea9959c9 | |||
| 7118efbc2d | |||
| 4a4613454d | |||
| 45464ab85d | |||
| 22539226e6 | |||
| e9eaff2685 | |||
| 66567d8ec6 | |||
| 1715b5c5b1 | |||
| 2ad4c5af21 | |||
| 27a1618265 | |||
| a3c9d256b4 | |||
| 5c6febf055 | |||
| feecab95ab | |||
| d5a338a902 | |||
| 8763400f06 | |||
| 34ddc826f8 | |||
| 1b3c46fbae | |||
| b05fbac9fe | |||
| 42353d4b04 | |||
| 52ce04727a | |||
| 87b4ebca64 | |||
| c7a50d88b7 | |||
| fef7112f46 | |||
| 98025f02a4 | |||
| f4b4d5ee90 | |||
| 6337113437 | |||
| b7b2606c84 | |||
| c79a584ab7 | |||
| f7435ab895 | |||
| ccd9a70c0c | |||
| 04c8f8eba2 | |||
| e8870ca050 | |||
| 6900eedd63 | |||
| 5848bc2b0c | |||
| 795f202b0c | |||
| e41cb24fc9 | |||
| ed72c7a4e1 | |||
| 8c3ff80547 | |||
| 28de1c6791 | |||
| 4e814d73c6 | |||
| 402015af8a | |||
| e4d1514047 | |||
| 33da807eb5 | |||
| 43a755febd | |||
| 24ed23f161 | |||
| ba6a718119 | |||
| 9a7db0207d | |||
| e35f51e0c8 | |||
| 4502f1162c | |||
| 370b270d95 | |||
| 70f26de43f | |||
| ef626eaaf9 | |||
| 2ebbfd5662 | |||
| 5244caf8e2 | |||
| 89ab7bf961 | |||
| 331b9341be | |||
| fe5d09a8bd | |||
| 312722d3c3 | |||
| 5f37a796e6 | |||
| 0a9fe6f8b6 | |||
| 8f12378299 | |||
| affd519bc8 | |||
| 9434211413 | |||
| 01959dde1f | |||
| fc6c07c613 | |||
| c6e59dd6bb | |||
| fc1f07a01b | |||
| 11d6425de3 | |||
| da79e8b833 | |||
| 4a1bdf2397 | |||
| 40bcfde47c | |||
| 08db55b69f | |||
| 914b7317e8 | |||
| be2c5e1774 | |||
| dcdc612569 | |||
| 6798c0faa5 | |||
| 3758957946 | |||
| cb755b8869 | |||
| ffedabc0f3 | |||
| 557f53bc66 | |||
| 24770cc9f4 | |||
| d07d441e5d | |||
| 2d1de6ccf3 | |||
| 457da42970 | |||
| 527a3bc3b9 | |||
| e6047e51c6 | |||
| 77f225f866 | |||
| 0e662a8799 | |||
| ca2828958d | |||
| 97d6b26df5 | |||
| e01104dba3 | |||
| 443f72d86a | |||
| 794b45e4f3 | |||
| 456a4e6fb0 | |||
| 52b111aff3 | |||
| e3a436ff4d | |||
| cc04872cc1 | |||
| 4075563e9f | |||
| c68efe69be | |||
| bb0a838d91 | |||
| 217a3b6fcc | |||
| a7de0d3b1e | |||
| 77be897037 | |||
| 2ef75b21d0 | |||
| b5066816e1 | |||
| 34e5b6ec55 | |||
| 14e3fa908a | |||
| 81427b38b3 | |||
| d95bd48d9e | |||
| 342472c625 | |||
| 694feab56e | |||
| d7262bfbb6 | |||
| 1f510bfae8 | |||
| a054c472cf | |||
| 24827b336a | |||
| d9681dbcb5 | |||
| dd9ff98329 | |||
| 3fe0400219 | |||
| 5cf6343518 | |||
| 69a2905d9b | |||
| b1254c3247 | |||
| c2a3fdfbd4 | |||
| fd92dbbe23 | |||
| 0218880d93 | |||
| 057d31ab49 | |||
| 1ec1e4539f | |||
| 1c2f87d79f | |||
| 5d0a7705d5 | |||
| e357e54152 | |||
| e598c7af90 | |||
| ab930e2e90 | |||
| 3752846faa | |||
| 7deafdde51 | |||
| 145ba2afda | |||
| 31822c78a4 | |||
| a36313b9b2 | |||
| 9e7be2740e | |||
| 5f6572d0ef | |||
| ce794f55dc | |||
| bd13256399 | |||
| 76bdc0bb19 | |||
| 83bfe07c50 | |||
| cd940ccf7e | |||
| ae7474445d | |||
| ebec1bb583 | |||
| 3ddc441674 | |||
| acd66d7738 | |||
| 7be48bd00a | |||
| 136de45c47 | |||
| 93c4e02633 | |||
| f47bf047b8 | |||
| b0c6bb52f8 | |||
| 7642884442 | |||
| f8dc8d075b | |||
| 927f171cd6 | |||
| 5ca6f13899 | |||
| b68f6bfeee | |||
| cefff881f5 | |||
| 923f1ab7ff | |||
| f1b2e66b97 | |||
| b5daa71abf | |||
| ee558cecd6 | |||
| c87210873f | |||
| 0535036d36 | |||
| 77333dfc9e | |||
| a6b9fcd2ba | |||
| 568e98aec8 | |||
| 4548e468a1 | |||
| a73af5928f | |||
| 5385547af6 | |||
| 46f2db3415 | |||
| 2aa61e5141 | |||
| 007c9c0edc | |||
| ba807e89bc | |||
| 53ca42389e | |||
| 35cc8959da | |||
| 467284d008 | |||
| 51a2cbf17c | |||
| 8e8d1c2a91 | |||
| 7a2c45fc4b | |||
| 19b1b8d984 | |||
| 1767aa7f97 | |||
| 652ce25a83 | |||
| 6c2d3bb7b5 | |||
| 4257a92486 | |||
| ac621d9dc0 | |||
| 6f56ae6686 | |||
| e19032f3cb | |||
| 92b770f448 | |||
| 27d8eb37e8 | |||
| dfb3774943 | |||
| a9b003d9ec | |||
| 8c9f2ce613 | |||
| b833d6c4ec | |||
| 111c59ea46 | |||
| 21a91b5202 | |||
| c1fba27b1f | |||
| 7225bad678 | |||
| 6b2aa1a8d1 | |||
| f95ce8d671 | |||
| 54ed7dc11c | |||
| 69beb83764 | |||
| faa8aada54 | |||
| 4dcd4a1fa0 | |||
| e4178317a9 | |||
| a9b25e1a30 | |||
| 32d099f5cc | |||
| fe21d5e65e | |||
| 241b392036 | |||
| fb90d5a98c | |||
| 9db10d8cde | |||
| aeb60213b6 | |||
| 69111c057a | |||
| 44e97c3452 | |||
| 8112616b96 | |||
| 0f6179bcd1 | |||
| f52f48c57e | |||
| 1d596e8d41 | |||
| 0651a225ff | |||
| 8fbed00523 | |||
| 0bdb218488 | |||
| dae912e76c | |||
| e2d226a0f9 | |||
| b33baf8288 | |||
| 5c3b677c20 | |||
| 30b4b60d53 | |||
| 73978d1ca9 | |||
| 52eec22b63 | |||
| 863605838b | |||
| 9257a2fd3a | |||
| bb68659510 | |||
| 04f3e94e50 | |||
| 5dbb4601a5 | |||
| 25c4864c63 | |||
| ab1bac7a79 | |||
| a286caf8f5 | |||
| ce4aa010ab | |||
| 502a38449f | |||
| 752de23e13 | |||
| 9794378382 | |||
| 8f6cac5d75 | |||
| 4c6e74cac1 | |||
| 505ec32b74 | |||
| 949f0b9c7f | |||
| 7e4b77f321 | |||
| 843ea293a9 | |||
| b52786ef2b | |||
| 1298aeaf85 | |||
| 46d9be852b | |||
| b319b84e20 | |||
| dcad21374b | |||
| 28ca22ee35 | |||
| c4af3eedd4 | |||
| 5e9d068078 | |||
| 791ed3480c | |||
| a26e25b253 | |||
| 1db314e077 | |||
| fb81c84ab2 | |||
| defe2a36d0 | |||
| 71b13d514a | |||
| 6c4bb9d0a7 | |||
| 82d18f368e | |||
| 4152a7aa1b | |||
| 5dd829e205 | |||
| 7218459c24 | |||
| 8592f8d65f | |||
| e5a3f0c68a | |||
| e168545ec8 | |||
| 84a6cf3c2f | |||
| a5c142f25c | |||
| 99bd24fe38 | |||
| 69e010e147 | |||
| ccf903acfc | |||
| 76b96a41e3 | |||
| 44518a00a5 | |||
| 95cf5e2195 | |||
| 5a7e359ab8 | |||
| ea05a73a4b | |||
| d071bcb321 | |||
| 4c27716ba2 | |||
| 6ccb91b658 | |||
| 4f0ba7382e | |||
| bcf45654a2 | |||
| 7ab408c2ea | |||
| 299a09d34d | |||
| bad8f85e26 | |||
| 07262542e3 | |||
| 4c3773c22f | |||
| ee06c05a77 | |||
| 6d3be63778 | |||
| 243b9b6a1a | |||
| f9b94ef999 | |||
| 889e45bf31 | |||
| b6fbf4e425 | |||
| ea0aa78530 | |||
| e539b83041 | |||
| c7bd1dc1f9 | |||
| 474a1c1217 | |||
| 66dbb529e1 | |||
| e32dc440c1 | |||
| 766e758ed1 | |||
| 3041753cb9 | |||
| 4d20011478 | |||
| 78470c8ad0 | |||
| 5666c271a3 | |||
| ace6bbc35c | |||
| 61a634edab | |||
| 5b9be206a7 | |||
| 73bf46d466 | |||
| f4d1728c6a | |||
| 4bac0bb1a3 | |||
| 380f4f337c | |||
| 42f0a18d71 | |||
| b10493ab11 | |||
| 753a07de3b | |||
| 70cb04a2b2 | |||
| 2ec91830e4 | |||
| c211557cdd | |||
| f1bff666c2 | |||
| b4a58d9f4f | |||
| 17dfbf2701 | |||
| 3ec694db3a | |||
| 15c965c5b2 | |||
| 6482a4c1b8 | |||
| 9de7cb546a | |||
| 0a352fe1dd | |||
| f7fdc4aad8 | |||
| 3ed7bb01f8 | |||
| 0fa73dbc06 | |||
| 7f6cbee96e | |||
| be1b98d3d9 | |||
| 13d87a180d | |||
| d827fd0c57 | |||
| eea875458d | |||
| ef5009e274 | |||
| f26e5126b7 | |||
| 42fc5935f3 | |||
| 0dde9fe328 | |||
| 06dbef5ed1 | |||
| e2973d5e31 | |||
| 9d36b42c19 | |||
| 3ba60a9fa6 | |||
| 4dc7629b35 | |||
| 7bb4401cc7 | |||
| aae8557dca | |||
| e980b4203d | |||
| 2aceb33c79 | |||
| 2f0d375b70 | |||
| 044c62fc5e | |||
| a957ae1183 | |||
| e8b262b34a | |||
| d1f3a44aec | |||
| c7a7261070 | |||
| 07d1545ef6 | |||
| b6ace3b35f | |||
| 82e0abbbaf | |||
| 57d087db85 | |||
| 6e22857086 | |||
| cefe870899 | |||
| 4881f35fa3 | |||
| 9f06f6e75d | |||
| 1ae01e0939 | |||
| 35f5266745 | |||
| ae496e7aab | |||
| f6638eea9e | |||
| 1444babea7 | |||
| e975d227f6 | |||
| efc3b5da34 | |||
| 2f78a26dfa | |||
| 59253eb4de | |||
| ae795ae501 | |||
| e0693c6463 | |||
| f804a7ea58 | |||
| b9dd34abd4 | |||
| 7d2e32108e | |||
| c3a306a8fd | |||
| ad9a25556c | |||
| ad796bb971 | |||
| 18f701d3fa | |||
| 445d2c0778 | |||
| 0063ae8ab2 | |||
| cbed398eae | |||
| d6031231e5 | |||
| 93c4c50fa2 | |||
| a1ebb8adb9 | |||
| 52cde60512 | |||
| c9e67777ef | |||
| 2af621914c | |||
| 3d383392f6 | |||
| 0fa9e62487 | |||
| fa283cf17e | |||
| 5a719ab11b | |||
| bfe5de52c6 | |||
| 63e2141024 | |||
| 6e1f08d24a | |||
| d25350bb25 | |||
| d6b3ebf0ae | |||
| f295ca1ac5 | |||
| eba6d775f5 | |||
| e1835d4d94 | |||
| d22b840264 | |||
| c8cf01e724 | |||
| 3c1f9c32eb | |||
| a8778abc97 | |||
| ff7dc48efb | |||
| c39ed46b98 | |||
| d611f66d43 | |||
| 3c1231937a | |||
| bf7300310b | |||
| 903c1eba65 | |||
| 24cfabec05 | |||
| b4e8d68c62 | |||
| f6e411264b | |||
| 708654e98a | |||
| 2b10b7c9d1 | |||
| d15844f55b | |||
| 4e7017041d | |||
| a9290d84ce | |||
| 6c75191729 | |||
| 8cd82722fe | |||
| 4a3be724f3 | |||
| c238d68095 | |||
| 13c86bdcdb | |||
| 37b727c52a | |||
| d56246e95b | |||
| 46d6c2b360 | |||
| 5ac81297ad | |||
| 49fbb772e2 | |||
| 7abb957ab2 | |||
| 9a0fdff213 | |||
| 346da073a3 | |||
| e1d77a37b6 | |||
| eb9fddccaf | |||
| 0a7b93561e | |||
| 4b294c992a | |||
| 211cbd1f9b | |||
| c5507a7543 | |||
| a84d4a0223 | |||
| e41af36b20 | |||
| 15562bd9ca | |||
| 58c7fa5408 |
@@ -327,3 +327,4 @@ _UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
|
||||
.ionide/symbolCache.db
|
||||
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
variables:
|
||||
NUGET_PATH: 'C:\Tools\nuget.exe'
|
||||
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
|
||||
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
|
||||
EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\GPW\Release'
|
||||
DEPLOY_FOLDER: 'c:\Projects\Deploy\GPW\Builds'
|
||||
APP_NAME: 'EgtBEAMWALL'
|
||||
APP_NAMEG: 'EgtBEAMWALL'
|
||||
NEW_REL: ''
|
||||
VERS_RD: 'Release'
|
||||
ARCH: 'x86'
|
||||
ARCH64: 'x64'
|
||||
OUTPUT_DIR: ''
|
||||
NET_SHARE: '\\10.74.82.201\Artifacts\EgtProg\EgtBEAMWALL'
|
||||
NET_USER: 'steamw\steamware'
|
||||
|
||||
# helper x mount cartella Artifacts su truenas
|
||||
.ReplicaCompiled: &ReplicaCompiled
|
||||
- |
|
||||
rm -Recurse Z:\$CI_COMMIT_BRANCH\$env:ARCH\*.*
|
||||
rm -Recurse Z:\$CI_COMMIT_BRANCH\$env:ARCH\*.*
|
||||
ROBOCOPY /E $env:APP_NAME\bin\$env:ARCH\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH /XF *.xml /XF *.pdb
|
||||
ROBOCOPY /E $env:APP_NAME2\bin\$env:ARCH\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH /XF *.xml /XF *.pdb
|
||||
SLEEP 2
|
||||
net use Z: /delete
|
||||
|
||||
.ReplicaCompileds2: &ReplicaCompileds2
|
||||
- |
|
||||
ROBOCOPY /E $env:APP_NAME\bin\$env:ARCH64\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH64 /XF *.xml /XF *.pdb
|
||||
ROBOCOPY /E $env:APP_NAME2\bin\$env:ARCH64\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH64 /XF *.xml /XF *.pdb
|
||||
SLEEP 2
|
||||
net use Z: /delete
|
||||
|
||||
.MakeFolderM: &MakeFolderM
|
||||
- |
|
||||
net use Z: /delete
|
||||
new-item c:\EgtProg\EgtBEAMWALL -itemtype directory
|
||||
net use Z: $env:NET_SHARE
|
||||
|
||||
.nuget-fix: &nuget-fix
|
||||
- |
|
||||
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
|
||||
if ($hasSource -eq 0) {
|
||||
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
|
||||
} else {
|
||||
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
|
||||
}
|
||||
echo $hasSource
|
||||
|
||||
|
||||
# helper creazione hash files
|
||||
.hashBuild: &hashBuild
|
||||
- |
|
||||
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
||||
$MD5 = Get-FileHash $Target -Algorithm MD5
|
||||
$SHA1 = Get-FileHash $Target -Algorithm SHA1
|
||||
New-Item $Target".md5"
|
||||
New-Item $Target".sha1"
|
||||
$MD5.Hash | Set-Content -Path $Target".md5"
|
||||
$SHA1.Hash | Set-Content -Path $Target".sha1"
|
||||
|
||||
echo "Created HASH files for $Target"
|
||||
|
||||
.cleanup-dir: &cleanup-dir
|
||||
- |
|
||||
rm $env:APP_NAME\bin\$env:ARCH\$env:VERS_RD\*.xml
|
||||
rm $env:APP_NAME\bin\$env:ARCH\$env:VERS_RD\*.pdb
|
||||
rm $env:APP_NAME\bin\$env:ARCH64\$env:VERS_RD\*.xml
|
||||
rm $env:APP_NAME\bin\$env:ARCH64\$env:VERS_RD\*.pdb
|
||||
|
||||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
X86:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
only:
|
||||
- main
|
||||
- master
|
||||
- develop
|
||||
variables:
|
||||
APP_NAME: EgtBEAMWALL.Supervisor
|
||||
APP_NAME2: EgtBEAMWALL.ViewerOptimizer
|
||||
VERS_RD: 'Release'
|
||||
ARCH: 'x86'
|
||||
ARCH64: 'x64'
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore EgtBEAMWALL.sln -verbosity quiet'
|
||||
- *MakeFolderM
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH" /p:OutputPath=bin/$env:ARCH/$env:VERS_RD/ /verbosity:minimal /m'
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME2\$env:APP_NAME2.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH" /p:OutputPath=bin/$env:ARCH/$env:VERS_RD/ /verbosity:minimal /m'
|
||||
- *ReplicaCompiled
|
||||
|
||||
|
||||
X64:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
only:
|
||||
- main
|
||||
- master
|
||||
- develop
|
||||
variables:
|
||||
APP_NAME: EgtBEAMWALL.Supervisor
|
||||
APP_NAME2: EgtBEAMWALL.ViewerOptimizer
|
||||
VERS_RD: 'Release'
|
||||
ARCH: 'x86'
|
||||
ARCH64: 'x64'
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore EgtBEAMWALL.sln -verbosity quiet'
|
||||
- *MakeFolderM
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH64" /p:OutputPath=bin/$env:ARCH64/$env:VERS_RD/ /verbosity:minimal /m'
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME2\$env:APP_NAME2.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH64" /p:OutputPath=bin/$env:ARCH64/$env:VERS_RD/ /verbosity:minimal /m'
|
||||
- *ReplicaCompileds2
|
||||
|
||||
+148
-77
@@ -8,8 +8,8 @@ Imports EgtWPFLib5
|
||||
Public Class BTLFeatureM
|
||||
|
||||
' Feature a cui appartiene il parametro
|
||||
Protected m_ParentPart As BTLPartM
|
||||
Public ReadOnly Property ParentPart As BTLPartM
|
||||
Protected m_ParentPart As Object
|
||||
Public ReadOnly Property ParentPart As Object
|
||||
Get
|
||||
Return m_ParentPart
|
||||
End Get
|
||||
@@ -90,6 +90,16 @@ Public Class BTLFeatureM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nPriority As Integer = 0
|
||||
Public Overridable Property nPriority As Integer
|
||||
Get
|
||||
Return m_nPriority
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPriority = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Nome
|
||||
Protected m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
@@ -174,7 +184,7 @@ Public Class BTLFeatureM
|
||||
Protected m_sCALC_MSG As String
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
Return MessageFromLuaMsg(m_sCALC_MSG)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
@@ -240,14 +250,15 @@ Public Class BTLFeatureM
|
||||
Return New BTLFeatureM
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateBTLFeature(ParentPart As BTLPartM, nFeatureId As Integer) As BTLFeatureM
|
||||
Public Shared Function CreateBTLFeature(ParentPart As Object, nFeatureId As Integer, Optional bIsBTL As Boolean = True) As BTLFeatureM
|
||||
Dim NewBTLFeature As New BTLFeatureM
|
||||
NewBTLFeature.m_ParentPart = ParentPart
|
||||
NewBTLFeature.m_nFeatureId = nFeatureId
|
||||
' leggo gruppo, numero feature e lato
|
||||
' leggo gruppo, numero feature, lato e priorità
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.m_nSelGRP)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.m_nPRC)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, NewBTLFeature.m_nPRIORITY)
|
||||
Dim nDO As Integer = 1
|
||||
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
||||
NewBTLFeature.m_bDO = (nDO <> 0)
|
||||
@@ -258,19 +269,26 @@ Public Class BTLFeatureM
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_DES, NewBTLFeature.m_sDES)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_PRID, NewBTLFeature.m_nPRID)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_FRAME, NewBTLFeature.m_frFRAME)
|
||||
' leggo parametri della feature
|
||||
GetBeamPrivateProfileGRPList(CalcBeamPrivateProfileGRP(NewBTLFeature.m_nSelGRP), NewBTLFeature.m_nPRC, NewBTLFeature.m_GRPList)
|
||||
GetBeamPrivateProfileName(NewBTLFeature.m_nSelGRP, NewBTLFeature.m_nPRC, NewBTLFeature)
|
||||
' crea parametri per questa feature da file ini
|
||||
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
|
||||
' leggo parametri delle feature
|
||||
NewBTLFeature.ReadFeatureParams()
|
||||
' leggo calc error
|
||||
Dim nErr As Integer = 0
|
||||
Dim nRot As Integer = 0
|
||||
Dim sMsg As String = ""
|
||||
Dim bCalc As Boolean = False
|
||||
If IsNothing(ParentPart) Then
|
||||
bCalc = EgtGetInfo(NewBTLFeature.nFeatureId, ITG_PROD_ERR, nErr)
|
||||
EgtGetInfo(nFeatureId, ITG_PROD_ROT, nRot)
|
||||
EgtGetInfo(nFeatureId, ITG_PROD_MSG, sMsg)
|
||||
Else
|
||||
If bIsBTL Then
|
||||
bCalc = EgtGetInfo(NewBTLFeature.nFeatureId, ITG_PROJ_ERR, nErr)
|
||||
EgtGetInfo(nFeatureId, ITG_PROJ_ROT, nRot)
|
||||
EgtGetInfo(nFeatureId, ITG_PROJ_MSG, sMsg)
|
||||
Else
|
||||
bCalc = EgtGetInfo(NewBTLFeature.nFeatureId, ITG_PROD_ERR, nErr)
|
||||
EgtGetInfo(nFeatureId, ITG_PROD_ROT, nRot)
|
||||
EgtGetInfo(nFeatureId, ITG_PROD_MSG, sMsg)
|
||||
End If
|
||||
If Not bCalc Then
|
||||
NewBTLFeature.m_nState = CalcStates.NOTCALCULATED
|
||||
@@ -281,23 +299,19 @@ Public Class BTLFeatureM
|
||||
NewBTLFeature.m_nCALC_ERR = nErr
|
||||
NewBTLFeature.m_nCALC_ROT = nRot
|
||||
NewBTLFeature.m_sCALC_MSG = sMsg
|
||||
If nErr = 0 Then
|
||||
NewBTLFeature.nState = CalcStates.OK
|
||||
ElseIf nErr = 17 Then
|
||||
NewBTLFeature.nState = CalcStates.WARNING
|
||||
ElseIf nErr > 0 Then
|
||||
NewBTLFeature.nState = CalcStates.ERROR_
|
||||
ElseIf nErr < 0 Then
|
||||
NewBTLFeature.nState = CalcStates.INFO
|
||||
End If
|
||||
Select Case nErr
|
||||
Case 0
|
||||
NewBTLFeature.nState = CalcStates.OK
|
||||
Case 22
|
||||
NewBTLFeature.nState = CalcStates.COLLISION
|
||||
Case 17, 19
|
||||
NewBTLFeature.nState = CalcStates.WARNING
|
||||
Case < 0
|
||||
NewBTLFeature.nState = CalcStates.INFO
|
||||
Case > 0
|
||||
NewBTLFeature.nState = CalcStates.ERROR_
|
||||
End Select
|
||||
End If
|
||||
' leggo parametri della feature
|
||||
GetBeamPrivateProfileGRPList(CalcBeamPrivateProfileGRP(NewBTLFeature.m_nSelGRP), NewBTLFeature.m_nPRC, NewBTLFeature.m_GRPList)
|
||||
GetBeamPrivateProfileName(NewBTLFeature.m_nSelGRP, NewBTLFeature.m_nPRC, NewBTLFeature)
|
||||
' crea parametri per questa feature da file ini
|
||||
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
|
||||
' leggo parametri delle feature
|
||||
NewBTLFeature.ReadFeatureParams()
|
||||
Return NewBTLFeature
|
||||
End Function
|
||||
|
||||
@@ -306,28 +320,13 @@ Public Class BTLFeatureM
|
||||
NewBTLFeature.m_nPRC = nPRC
|
||||
NewBTLFeature.m_nSelGRP = nGRP
|
||||
NewBTLFeature.m_nSelSIDE = nSIDE
|
||||
NewBTLFeature.m_nPriority = 0
|
||||
NewBTLFeature.m_bDO = True
|
||||
' crea parametri per questa feature da file ini
|
||||
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
|
||||
Return NewBTLFeature
|
||||
End Function
|
||||
|
||||
'Sub New(ParentPart As BTLPartM, nFeatureId As Integer)
|
||||
' m_ParentPart = ParentPart
|
||||
' m_nFeatureId = nFeatureId
|
||||
' m_PParamList = New ObservableCollection(Of BTLParam)
|
||||
' m_QParamList = New ObservableCollection(Of BTLParam)
|
||||
'End Sub
|
||||
|
||||
'Sub New(nPRC As Integer, nGRP As Integer, nSIDE As Integer)
|
||||
' m_PParamList = New ObservableCollection(Of BTLParam)
|
||||
' m_QParamList = New ObservableCollection(Of BTLParam)
|
||||
' m_nPRC = nPRC
|
||||
' m_nSelGRP = nGRP
|
||||
' m_nSelSIDE = nSIDE
|
||||
' m_bDO = True
|
||||
'End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
@@ -388,17 +387,36 @@ Public Class BTLFeatureM
|
||||
For Each Param As BTLParamM In ParamList
|
||||
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
|
||||
Dim dParamValue As Double = 0
|
||||
If Not EgtGetInfo(m_nFeatureId, Param.sName, dParamValue) Then
|
||||
Dim sReadName As String = Param.sName
|
||||
If IsFreeContour() Then
|
||||
Select Case Param.sName
|
||||
Case "P05"
|
||||
sReadName = "DEPTH"
|
||||
Case "P07"
|
||||
sReadName = "PCKT"
|
||||
Case "P13"
|
||||
sReadName = "CNT_TYPE"
|
||||
Case "P14"
|
||||
sReadName = "CNT_DATA"
|
||||
Case "P15"
|
||||
sReadName = "CNT_PAR"
|
||||
End Select
|
||||
End If
|
||||
If Not EgtGetInfo(m_nFeatureId, sReadName, dParamValue) Then
|
||||
dParamValue = 0
|
||||
End If
|
||||
' se è un parametro P setto il valore letto nel DB
|
||||
If Param.bIsP Then
|
||||
Param.SetValue(dParamValue)
|
||||
Else
|
||||
' se è un parametro Q verifico nel progetto se sia un valore custom
|
||||
' recupero info Custom
|
||||
Dim nCustom As Integer = 0
|
||||
EgtGetInfo(nFeatureId, Param.sName & "A", nCustom)
|
||||
If nCustom = 1 Then
|
||||
'se pezzo parent di tipo Part
|
||||
If TypeOf m_ParentPart Is PartM Then
|
||||
Param.SetValue(dParamValue)
|
||||
' se è un parametro Q verifico nel progetto se sia un valore custom
|
||||
ElseIf nCustom = 1 Then
|
||||
Param.SetValue(dParamValue)
|
||||
Param.bCustom = True
|
||||
' altrimenti lo setto al valore di default
|
||||
@@ -407,7 +425,20 @@ Public Class BTLFeatureM
|
||||
Dim dReadValue As Double = 0
|
||||
EgtGetInfo(m_nFeatureId, Param.sName, dReadValue)
|
||||
If dReadValue <> Param.dDefault Then
|
||||
' Disabilito segnalazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
EgtSetInfo(m_nFeatureId, Param.sName, Param.dDefault)
|
||||
'se pezzo parent di tipo BTL
|
||||
If TypeOf m_ParentPart Is BTLPartM AndAlso m_bDO Then
|
||||
Dim BTLPartM As BTLPartM = DirectCast(m_ParentPart, BTLPartM)
|
||||
EgtRemoveInfo(BTLPartM.m_nPartId, ITG_PROJ_ERR)
|
||||
EgtRemoveInfo(BTLPartM.m_nPartId, ITG_PROJ_MSG)
|
||||
EgtRemoveInfo(BTLPartM.m_nPartId, ITG_PROJ_FALL)
|
||||
EgtRemoveInfo(BTLPartM.m_nPartId, ITG_PROJ_ROT)
|
||||
'EgtDuploSetModified(DirectCast(m_ParentPart, BTLPartM).m_nPartId)
|
||||
End If
|
||||
' Ripristino stato segnalazione modifica
|
||||
DisableMgr.ReEnable()
|
||||
bToRecalc = True
|
||||
End If
|
||||
Param.bCustom = False
|
||||
@@ -424,12 +455,20 @@ Public Class BTLFeatureM
|
||||
End If
|
||||
Next
|
||||
' Se necessario ricalcolo, lo eseguo
|
||||
If bToRecalc Then
|
||||
If Not IsFreeContour() And bToRecalc Then
|
||||
' Disabilito segnalazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
UpdateParams()
|
||||
' Ripristino stato segnalazione modifica
|
||||
DisableMgr.ReEnable()
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' funzione che rilegge i parametri Q
|
||||
Public Function ReadQValues()
|
||||
Return ReadFeatureParams(m_QBTLParamMList)
|
||||
End Function
|
||||
' funzione che setta i valori di default a tutti i parametri
|
||||
Public Function SetDefaultValues() As Boolean
|
||||
Return SetDefaultValues(m_PBTLParamMList) And SetDefaultValues(m_QBTLParamMList)
|
||||
@@ -440,7 +479,7 @@ Public Class BTLFeatureM
|
||||
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
|
||||
Param.SetValue(Param.dDefault)
|
||||
ElseIf Param.nType = BTLParamType.STRING_ Then
|
||||
Param.SetValue("")
|
||||
Param.SetValue(Param.sDefault)
|
||||
ElseIf Param.nType = BTLParamType.COMBO Then
|
||||
Param.nSelValue = Param.dDefault
|
||||
End If
|
||||
@@ -451,26 +490,27 @@ Public Class BTLFeatureM
|
||||
' funzione che calcola array dei valori dei parametri
|
||||
Public Function CalcParamArray(ByRef vPar() As Double, ByRef sPar As String, ByRef vParQ() As String) As Boolean
|
||||
' verifico che lista parametri non sia vuota
|
||||
If IsNothing(m_PBTLParamMList) OrElse m_PBTLParamMList.Count = 0 Then Return False
|
||||
' calcolo lunghezza array Parametri
|
||||
Dim nLastParId As Integer = m_PBTLParamMList(m_PBTLParamMList.Count - 1).nId - 1
|
||||
Dim vTempPar(nLastParId) As Double
|
||||
Dim sTempPar As String = String.Empty
|
||||
' carico tutti i parametri su array
|
||||
For ParIndex = 0 To m_PBTLParamMList.Count - 1
|
||||
Dim BTLPar As BTLParamM = DirectCast(m_PBTLParamMList(ParIndex), BTLParamM)
|
||||
Select Case BTLPar.nType
|
||||
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
||||
vTempPar(BTLPar.nId - 1) = BTLPar.dValue
|
||||
Case BTLParamType.STRING_
|
||||
sTempPar = BTLPar.sValue
|
||||
'Case BTLParamType.COMBO
|
||||
' Dim cBTLPar As BTLParamCombo = DirectCast(ParentFeature.PParamList(ParIndex), BTLParamCombo)
|
||||
' vPar(ParIndex) = cBTLPar.
|
||||
End Select
|
||||
Next
|
||||
vPar = vTempPar
|
||||
sPar = If(String.IsNullOrEmpty(sTempPar), " ", sTempPar)
|
||||
If Not IsNothing(m_PBTLParamMList) AndAlso m_PBTLParamMList.Count > 0 Then
|
||||
' calcolo lunghezza array Parametri
|
||||
Dim nLastParId As Integer = m_PBTLParamMList(m_PBTLParamMList.Count - 1).nId - 1
|
||||
Dim vTempPar(nLastParId) As Double
|
||||
Dim sTempPar As String = String.Empty
|
||||
' carico tutti i parametri su array
|
||||
For ParIndex = 0 To m_PBTLParamMList.Count - 1
|
||||
Dim BTLPar As BTLParamM = DirectCast(m_PBTLParamMList(ParIndex), BTLParamM)
|
||||
Select Case BTLPar.nType
|
||||
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
||||
vTempPar(BTLPar.nId - 1) = BTLPar.dValue
|
||||
Case BTLParamType.STRING_
|
||||
sTempPar = BTLPar.sValue
|
||||
'Case BTLParamType.COMBO
|
||||
' Dim cBTLPar As BTLParamCombo = DirectCast(ParentFeature.PParamList(ParIndex), BTLParamCombo)
|
||||
' vPar(ParIndex) = cBTLPar.
|
||||
End Select
|
||||
Next
|
||||
vPar = vTempPar
|
||||
sPar = If(String.IsNullOrEmpty(sTempPar), " ", sTempPar)
|
||||
End If
|
||||
' Determino parametri Q
|
||||
Dim vTempParQ(m_QBTLParamMList.Count) As String
|
||||
For ParQIndex = 0 To m_QBTLParamMList.Count - 1
|
||||
@@ -486,20 +526,26 @@ Public Class BTLFeatureM
|
||||
|
||||
' funzione che aggiorna parametri della feature
|
||||
Public Function UpdateParams(nNewGRP As Integer, nNewPRC As Integer, nNewSIDE As Integer, sNewDesc As String, nNewProcId As Integer,
|
||||
frNewRef As Frame3d, vNewParP() As Double, sNewPar As String, vNewParQ As String()) As Boolean
|
||||
' aggiorno la feature con nuovo valore
|
||||
Dim vPar() As Double = Nothing
|
||||
frNewRef As Frame3d, vNewParP() As Double, sNewPar As String, vNewParQ As String(), Optional bUpdate As Boolean = True) As Boolean
|
||||
' Recupero parametri originali della feature
|
||||
Dim vPar() As Double = {}
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
Dim vParQ() As String = {}
|
||||
CalcParamArray(vPar, sPar, vParQ)
|
||||
' recupero eventuali percorsi originali della feature
|
||||
Dim nCrvId As Integer = GDB_ID.NULL
|
||||
Dim nCrv2Id As Integer = GDB_ID.NULL
|
||||
GetFreeContourPaths(nCrvId, nCrv2Id)
|
||||
' modifica della feature con i nuovi parametri
|
||||
Dim nFeatureId As Integer = EgtBeamModifyProcess(Me.nFeatureId, nNewGRP, nNewPRC, nNewSIDE, sNewDesc, nNewProcId,
|
||||
frNewRef, vNewParP, sNewPar, vNewParQ)
|
||||
frNewRef, vNewParP, sNewPar, vNewParQ, nCrvId, nCrv2Id, bUpdate)
|
||||
Dim bOk As Boolean = nFeatureId <> GDB_ID.NULL
|
||||
If bOk Then
|
||||
' riporto parametri Q custom
|
||||
For Each QPar In QBTLParamMList
|
||||
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
|
||||
Next
|
||||
EgtSetInfo( nFeatureId, BTL_FTR_PRIORITY, nPriority)
|
||||
SetFeatureId(nFeatureId)
|
||||
' imposto modificato per copie
|
||||
EgtDuploSetModified(ParentPart.nPartId)
|
||||
@@ -507,19 +553,20 @@ Public Class BTLFeatureM
|
||||
Else
|
||||
' Impossibile creare una feature con questi valori - ERRORE
|
||||
MessageBox.Show(EgtMsg(61852), EgtMsg(30007))
|
||||
nFeatureId = EgtBeamModifyProcess(Me.nFeatureId, Me.nSelGRP, Me.nPRC, Me.nSelSIDE, "", Me.nPRID, New Frame3d(), vPar, sPar, vParQ)
|
||||
nFeatureId = EgtBeamModifyProcess(Me.nFeatureId, Me.nSelGRP, Me.nPRC, Me.nSelSIDE, "", Me.nPRID,
|
||||
New Frame3d(), vPar, sPar, vParQ, nCrvId, nCrv2Id)
|
||||
SetFeatureId(nFeatureId)
|
||||
bOk = False
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
Public Function UpdateParams() As Boolean
|
||||
Public Function UpdateParams(Optional bUpdate As Boolean = True) As Boolean
|
||||
' aggiorno la feature con nuovo valore
|
||||
Dim vPar() As Double = Nothing
|
||||
Dim vPar() As Double = {}
|
||||
Dim sPar As String = String.Empty
|
||||
Dim vParQ() As String = Nothing
|
||||
Dim vParQ() As String = {}
|
||||
CalcParamArray(vPar, sPar, vParQ)
|
||||
Return UpdateParams(Me.nSelGRP, Me.nPRC, Me.nSelSIDE, Me.sDES, Me.nPRID, Me.frFRAME, vPar, sPar, vParQ)
|
||||
Return UpdateParams(Me.nSelGRP, Me.nPRC, Me.nSelSIDE, Me.sDES, Me.nPRID, Me.frFRAME, vPar, sPar, vParQ, bUpdate)
|
||||
End Function
|
||||
|
||||
' funzione che restituisce se la feature è un contorno libero
|
||||
@@ -527,6 +574,30 @@ Public Class BTLFeatureM
|
||||
Return m_nPRC = 250 OrElse m_nPRC = 251 OrElse m_nPRC = 252
|
||||
End Function
|
||||
|
||||
' funzione che restituisce i percorsi associati ai contorni liberi
|
||||
Public Function GetFreeContourPaths(ByRef nCrvId As Integer, ByRef nCrv2Id As Integer) As Boolean
|
||||
' imposto eventuali percorsi
|
||||
nCrvId = GDB_ID.NULL
|
||||
nCrv2Id = GDB_ID.NULL
|
||||
If IsFreeContour() Then
|
||||
Dim sAuxId As String = ""
|
||||
If EgtGetInfo(nFeatureId, "AUXID", sAuxId) Then
|
||||
Dim sAuxIdSplit() As String = sAuxId.Split(","c)
|
||||
Dim nAuxId As Integer
|
||||
If Integer.TryParse(sAuxIdSplit(0), nAuxId) Then
|
||||
nCrvId = nFeatureId + nAuxId
|
||||
Dim nAux2Id As Integer
|
||||
If sAuxIdSplit.Count > 1 Then
|
||||
If Integer.TryParse(sAuxIdSplit(1), nAux2Id) Then
|
||||
nCrv2Id = nFeatureId + nAux2Id
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -129,6 +129,16 @@ Public Class BTLParamM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sDefault As String
|
||||
Public Property sDefault As String
|
||||
Get
|
||||
Return m_sDefault
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sDefault = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' tipo della variabile
|
||||
Protected m_nType As BTLParamType
|
||||
Public ReadOnly Property nType As BTLParamType
|
||||
@@ -136,6 +146,9 @@ Public Class BTLParamM
|
||||
Return m_nType
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetType(value As BTLParamType)
|
||||
m_nType = value
|
||||
End Sub
|
||||
|
||||
' Feature a cui appartiene il parametro
|
||||
Protected m_ParentFeature As BTLFeatureM
|
||||
@@ -155,6 +168,16 @@ Public Class BTLParamM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sBWType As String
|
||||
Public Property sBWType As String
|
||||
Get
|
||||
Return m_sBWType
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sBWType = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property Name_Msg As String
|
||||
@@ -221,10 +244,33 @@ Public Class BTLParamM
|
||||
Return NewBTLParam
|
||||
End Function
|
||||
|
||||
' new per double e length (con tipo Beam o Wall)
|
||||
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String,
|
||||
dMin As Double, dMax As Double, dDefault As Double, sDescription As String, sBWType As String) As BTLParamM
|
||||
Dim NewBTLParam As New BTLParamM
|
||||
|
||||
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||
NewBTLParam.dMin = dMin
|
||||
NewBTLParam.dMax = dMax
|
||||
NewBTLParam.m_dDefault = dDefault
|
||||
NewBTLParam.m_sBWType = sBWType
|
||||
Return NewBTLParam
|
||||
End Function
|
||||
|
||||
' new per stringhe
|
||||
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
|
||||
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDefault As String, sDescription As String)
|
||||
Dim NewBTLParam As New BTLParamM
|
||||
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||
NewBTLParam.m_sDefault = sDefault
|
||||
Return NewBTLParam
|
||||
End Function
|
||||
|
||||
' new per stringhe (con tipo Beam o Wall)
|
||||
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDefault As String, sDescription As String, sBWType As String)
|
||||
Dim NewBTLParam As New BTLParamM
|
||||
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||
NewBTLParam.m_sDefault = sDefault
|
||||
NewBTLParam.m_sBWType = sBWType
|
||||
Return NewBTLParam
|
||||
End Function
|
||||
|
||||
@@ -239,6 +285,18 @@ Public Class BTLParamM
|
||||
Return NewBTLParam
|
||||
End Function
|
||||
|
||||
' new per combobox (con tipo Beam o Wall)
|
||||
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, nMin As Integer, nMax As Integer, nDefault As Integer, sDescription As String, ValueList As List(Of String), sBWType As String)
|
||||
Dim NewBTLParam As New BTLParamM
|
||||
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||
NewBTLParam.dMin = nMin
|
||||
NewBTLParam.dMax = nMax
|
||||
NewBTLParam.m_dDefault = nDefault
|
||||
NewBTLParam.m_ValueList = ValueList
|
||||
NewBTLParam.m_sBWType = sBWType
|
||||
Return NewBTLParam
|
||||
End Function
|
||||
|
||||
' new per parametro vuoto
|
||||
Public Shared Function CreateBTLParam(IsP As Boolean, nType As BTLParamType, sParamName As String)
|
||||
Dim NewBTLParam As New BTLParamM
|
||||
@@ -548,6 +548,17 @@ Public Class BTLPartM
|
||||
|
||||
#End Region ' Parametri pezzo
|
||||
|
||||
' volume del pezzo
|
||||
Private m_dVolume As Double
|
||||
Public Property dVolume As Double
|
||||
Get
|
||||
Return m_dVolume
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dVolume = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' numero di pezzi da fare da BTL
|
||||
Public m_nCNT As Integer
|
||||
Public Property nCNT As Integer
|
||||
@@ -566,7 +577,9 @@ Public Class BTLPartM
|
||||
Return m_nADDED
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nADDED = value
|
||||
If EgtSetInfo(nPartId, BTL_PRT_ADDED, value) Then
|
||||
m_nADDED = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -600,6 +613,16 @@ Public Class BTLPartM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bLockInversion As Boolean = False
|
||||
Public Property bLockInversion As Boolean
|
||||
Get
|
||||
Return m_bLockInversion
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bLockInversion = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nROTATED As Integer
|
||||
Public Property nROTATED As Integer
|
||||
Get
|
||||
@@ -610,6 +633,16 @@ Public Class BTLPartM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bLockRotation As Boolean = False
|
||||
Public Property bLockRotation As Boolean
|
||||
Get
|
||||
Return m_bLockRotation
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bLockRotation = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_ERR As Integer
|
||||
Public Property nCALC_ERR As Integer
|
||||
Get
|
||||
@@ -633,7 +666,7 @@ Public Class BTLPartM
|
||||
Private m_sCALC_MSG As String
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
Return MessageFromLuaMsg(m_sCALC_MSG)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
@@ -670,6 +703,16 @@ Public Class BTLPartM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nFeaturesGlobalState As CalcStates
|
||||
Public Property nFeaturesGlobalState As CalcStates
|
||||
Get
|
||||
Return m_nFeaturesGlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nFeaturesGlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_GlobalERR As Integer
|
||||
Public Property nCALC_GlobalERR As Integer
|
||||
Get
|
||||
@@ -754,15 +797,15 @@ Public Class BTLPartM
|
||||
Dim vtVersY As New Vector3d
|
||||
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 9 Then
|
||||
StringToLen(sValArray(0), ptOri.x)
|
||||
StringToLen(sValArray(1), ptOri.y)
|
||||
StringToLen(sValArray(2), ptOri.z)
|
||||
StringToDouble(sValArray(3), vtVersX.x)
|
||||
StringToDouble(sValArray(4), vtVersX.y)
|
||||
StringToDouble(sValArray(5), vtVersX.z)
|
||||
StringToDouble(sValArray(6), vtVersY.x)
|
||||
StringToDouble(sValArray(7), vtVersY.y)
|
||||
StringToDouble(sValArray(8), vtVersY.z)
|
||||
StringToLenAdv(sValArray(0), ptOri.x)
|
||||
StringToLenAdv(sValArray(1), ptOri.y)
|
||||
StringToLenAdv(sValArray(2), ptOri.z)
|
||||
StringToDoubleAdv(sValArray(3), vtVersX.x)
|
||||
StringToDoubleAdv(sValArray(4), vtVersX.y)
|
||||
StringToDoubleAdv(sValArray(5), vtVersX.z)
|
||||
StringToDoubleAdv(sValArray(6), vtVersY.x)
|
||||
StringToDoubleAdv(sValArray(7), vtVersY.y)
|
||||
StringToDoubleAdv(sValArray(8), vtVersY.z)
|
||||
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
|
||||
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||
End If
|
||||
@@ -770,12 +813,12 @@ Public Class BTLPartM
|
||||
ind = ind + 1
|
||||
End While
|
||||
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 5 Then
|
||||
StringToLen(sValArray(3), NewBTLPart.m_dCamberLen1)
|
||||
StringToLen(sValArray(5), NewBTLPart.m_dCamberLen2)
|
||||
StringToLen(sValArray(7), NewBTLPart.m_dCamberLen3)
|
||||
StringToLen(sValArray(9), NewBTLPart.m_dCamberCross3)
|
||||
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 10 Then
|
||||
StringToLenAdv(sValArray(3), NewBTLPart.m_dCamberLen1)
|
||||
StringToLenAdv(sValArray(5), NewBTLPart.m_dCamberLen2)
|
||||
StringToLenAdv(sValArray(7), NewBTLPart.m_dCamberLen3)
|
||||
StringToLenAdv(sValArray(9), NewBTLPart.m_dCamberCross3)
|
||||
End If
|
||||
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||
Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||
@@ -785,12 +828,12 @@ Public Class BTLPartM
|
||||
End If
|
||||
|
||||
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 5 Then
|
||||
StringToLen(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
||||
StringToLen(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
||||
StringToLen(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
||||
StringToLen(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
||||
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 10 Then
|
||||
StringToLenAdv(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
||||
StringToLenAdv(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
||||
StringToLenAdv(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
||||
StringToLenAdv(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
||||
End If
|
||||
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||
pTo = sValue.LastIndexOf(" P11")
|
||||
@@ -800,14 +843,36 @@ Public Class BTLPartM
|
||||
NewBTLPart.ocREFSIDEFIXCLAMP)
|
||||
End If
|
||||
|
||||
Dim EnumIndex As Integer = 0
|
||||
EgtGetInfo(nPartId, BTL_PRT_PROCESSINGQUALITY, sValue)
|
||||
NewBTLPart.m_SelPROCESSINGQUALITY = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLPart.ocPROCESSINGQUALITY),
|
||||
NewBTLPart.ocPROCESSINGQUALITY)
|
||||
For ind = 1 To NewBTLPart.ocPROCESSINGQUALITY.Count
|
||||
Dim sEnumName = [Enum].GetName(GetType(ProcessingQuality), ind)
|
||||
If sEnumName.Equals(sValue) Then
|
||||
EnumIndex = ind
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
NewBTLPart.m_SelPROCESSINGQUALITY = EnumIndex - 1
|
||||
EgtGetInfo(nPartId, BTL_PRT_RECESS, sValue)
|
||||
NewBTLPart.m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLPart.ocRECESS), NewBTLPart.ocRECESS)
|
||||
EnumIndex = 0
|
||||
For ind = 1 To NewBTLPart.ocRECESS.Count
|
||||
Dim sEnumName = [Enum].GetName(GetType(Recess), ind)
|
||||
If sEnumName.Equals(sValue) Then
|
||||
EnumIndex = ind
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
NewBTLPart.m_SelRECESS = EnumIndex - 1
|
||||
EgtGetInfo(nPartId, BTL_PRT_STOREYTYPE, sValue)
|
||||
NewBTLPart.m_SelSTOREYTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLPart.ocSTOREYTYPE),
|
||||
NewBTLPart.ocSTOREYTYPE)
|
||||
EnumIndex = 0
|
||||
For ind = 1 To NewBTLPart.ocSTOREYTYPE.Count
|
||||
Dim sEnumName = [Enum].GetName(GetType(StoreyType), ind)
|
||||
If sEnumName.Equals(sValue) Then
|
||||
EnumIndex = ind
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
NewBTLPart.m_SelSTOREYTYPE = EnumIndex - 1
|
||||
EgtGetInfo(nPartId, BTL_PRT_ELEMENTNUM, NewBTLPart.m_sELEMENTNUM)
|
||||
EgtGetInfo(nPartId, BTL_PRT_LAYER, NewBTLPart.m_nLAYER)
|
||||
EgtGetInfo(nPartId, BTL_PRT_MODULENUM, NewBTLPart.m_sMODULENUM)
|
||||
@@ -818,9 +883,9 @@ Public Class BTLPartM
|
||||
NewBTLPart.m_refGrainDir = New Vector3d
|
||||
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 4 Then
|
||||
StringToDouble(sValArray(0), NewBTLPart.m_refGrainDir.x)
|
||||
StringToDouble(sValArray(1), NewBTLPart.m_refGrainDir.y)
|
||||
StringToDouble(sValArray(2), NewBTLPart.m_refGrainDir.z)
|
||||
StringToDoubleAdv(sValArray(0), NewBTLPart.m_refGrainDir.x)
|
||||
StringToDoubleAdv(sValArray(1), NewBTLPart.m_refGrainDir.y)
|
||||
StringToDoubleAdv(sValArray(2), NewBTLPart.m_refGrainDir.z)
|
||||
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||
End If
|
||||
|
||||
@@ -857,6 +922,13 @@ Public Class BTLPartM
|
||||
NewBTLPart.m_nINVERTED = 0
|
||||
End If
|
||||
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewBTLPart.m_sMATERIAL)
|
||||
If Not EgtGetInfo(nPartId, LOCK_ROT, NewBTLPart.m_bLockRotation) Then
|
||||
NewBTLPart.m_bLockRotation = False
|
||||
End If
|
||||
If Not EgtGetInfo(nPartId, LOCK_FLIP, NewBTLPart.m_bLockInversion) Then
|
||||
NewBTLPart.m_bLockInversion = False
|
||||
End If
|
||||
EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewBTLPart.m_dVolume)
|
||||
' Leggo outline e features
|
||||
NewBTLPart.m_BTLFeatureMList = LoadFeatures(nPartId, NewBTLPart)
|
||||
' leggo calc error
|
||||
@@ -880,15 +952,18 @@ Public Class BTLPartM
|
||||
NewBTLPart.m_nCALC_ROT = nRot
|
||||
NewBTLPart.m_nCALC_FALL = nFall
|
||||
NewBTLPart.m_sCALC_MSG = sMsg
|
||||
If nErr = 0 Then
|
||||
NewBTLPart.nState = CalcStates.OK
|
||||
ElseIf nErr = 17 Then
|
||||
NewBTLPart.nState = CalcStates.WARNING
|
||||
ElseIf nErr > 0 Then
|
||||
NewBTLPart.nState = CalcStates.ERROR_
|
||||
ElseIf nErr < 0 Then
|
||||
NewBTLPart.nState = CalcStates.INFO
|
||||
End If
|
||||
Select Case nErr
|
||||
Case 0
|
||||
NewBTLPart.nState = CalcStates.OK
|
||||
Case 22
|
||||
NewBTLPart.nState = CalcStates.COLLISION
|
||||
Case 17, 19
|
||||
NewBTLPart.nState = CalcStates.WARNING
|
||||
Case < 0
|
||||
NewBTLPart.nState = CalcStates.INFO
|
||||
Case > 0
|
||||
NewBTLPart.nState = CalcStates.ERROR_
|
||||
End Select
|
||||
End If
|
||||
EgtGetInfo(nPartId, ITG_PROJ_TIME, NewBTLPart.m_nCALC_TIME)
|
||||
Return NewBTLPart
|
||||
@@ -969,15 +1044,15 @@ Public Class BTLPartM
|
||||
' Dim vtVersY As New Vector3d
|
||||
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||
' If sValArray.Count() >= 9 Then
|
||||
' StringToLen(sValArray(0), ptOri.x)
|
||||
' StringToLen(sValArray(1), ptOri.y)
|
||||
' StringToLen(sValArray(2), ptOri.z)
|
||||
' StringToDouble(sValArray(3), vtVersX.x)
|
||||
' StringToDouble(sValArray(4), vtVersX.y)
|
||||
' StringToDouble(sValArray(5), vtVersX.z)
|
||||
' StringToDouble(sValArray(6), vtVersY.x)
|
||||
' StringToDouble(sValArray(7), vtVersY.y)
|
||||
' StringToDouble(sValArray(8), vtVersY.z)
|
||||
' StringToLenAdv(sValArray(0), ptOri.x)
|
||||
' StringToLenAdv(sValArray(1), ptOri.y)
|
||||
' StringToLenAdv(sValArray(2), ptOri.z)
|
||||
' StringToDoubleAdv(sValArray(3), vtVersX.x)
|
||||
' StringToDoubleAdv(sValArray(4), vtVersX.y)
|
||||
' StringToDoubleAdv(sValArray(5), vtVersX.z)
|
||||
' StringToDoubleAdv(sValArray(6), vtVersY.x)
|
||||
' StringToDoubleAdv(sValArray(7), vtVersY.y)
|
||||
' StringToDoubleAdv(sValArray(8), vtVersY.z)
|
||||
' m_refTransf.ChangeOrigin(ptOri)
|
||||
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||
' End If
|
||||
@@ -988,10 +1063,10 @@ Public Class BTLPartM
|
||||
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
' If sValArray.Count() >= 5 Then
|
||||
' StringToLen(sValArray(3), m_dCamberLen1)
|
||||
' StringToLen(sValArray(5), m_dCamberLen2)
|
||||
' StringToLen(sValArray(7), m_dCamberLen3)
|
||||
' StringToLen(sValArray(9), m_dCamberCross3)
|
||||
' StringToLenAdv(sValArray(3), m_dCamberLen1)
|
||||
' StringToLenAdv(sValArray(5), m_dCamberLen2)
|
||||
' StringToLenAdv(sValArray(7), m_dCamberLen3)
|
||||
' StringToLenAdv(sValArray(9), m_dCamberCross3)
|
||||
' End If
|
||||
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||
' Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||
@@ -1003,10 +1078,10 @@ Public Class BTLPartM
|
||||
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
' If sValArray.Count() >= 5 Then
|
||||
' StringToLen(sValArray(3), m_dPartOffsetSide1)
|
||||
' StringToLen(sValArray(5), m_dPartOffsetSide2)
|
||||
' StringToLen(sValArray(7), m_dPartOffsetSide3)
|
||||
' StringToLen(sValArray(9), m_dPartOffsetSide4)
|
||||
' StringToLenAdv(sValArray(3), m_dPartOffsetSide1)
|
||||
' StringToLenAdv(sValArray(5), m_dPartOffsetSide2)
|
||||
' StringToLenAdv(sValArray(7), m_dPartOffsetSide3)
|
||||
' StringToLenAdv(sValArray(9), m_dPartOffsetSide4)
|
||||
' End If
|
||||
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||
' pTo = sValue.LastIndexOf(" P11")
|
||||
@@ -1030,9 +1105,9 @@ Public Class BTLPartM
|
||||
' m_refGrainDir = New Vector3d
|
||||
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
' If sValArray.Count() >= 4 Then
|
||||
' StringToDouble(sValArray(0), m_refGrainDir.x)
|
||||
' StringToDouble(sValArray(1), m_refGrainDir.y)
|
||||
' StringToDouble(sValArray(2), m_refGrainDir.z)
|
||||
' StringToDoubleAdv(sValArray(0), m_refGrainDir.x)
|
||||
' StringToDoubleAdv(sValArray(1), m_refGrainDir.y)
|
||||
' StringToDoubleAdv(sValArray(2), m_refGrainDir.z)
|
||||
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||
' End If
|
||||
|
||||
@@ -1135,7 +1210,7 @@ Public Class BTLPartM
|
||||
Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
|
||||
End Function
|
||||
|
||||
Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType) As Boolean
|
||||
Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional bRedraw As Boolean = True, Optional dAng As Double = 90) As Boolean
|
||||
' recupero il box del pezzo
|
||||
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||
Dim b3Solid As New BBox3d
|
||||
@@ -1145,7 +1220,7 @@ Public Class BTLPartM
|
||||
Return False
|
||||
End If
|
||||
' eseguo rotazione di 90 gradi attorno asse X
|
||||
Dim dRot = If(IsPositive, 90, -90)
|
||||
Dim dRot = If(IsPositive, 1, -1) * Math.Abs(dAng)
|
||||
Dim vtAxes As Vector3d
|
||||
' se travi ruoto attorno all'asse X
|
||||
If SelectedMachineType = MachineType.BEAM Then
|
||||
@@ -1163,16 +1238,8 @@ Public Class BTLPartM
|
||||
' eseguo rotazione
|
||||
Dim bOk As Boolean = EgtRotate(nPartId, b3Solid.Center, vtAxes, dRot, GDB_RT.GLOB)
|
||||
If bOk Then
|
||||
Select Case m_nROTATED
|
||||
Case 0
|
||||
m_nROTATED = If(IsPositive, 90, 270)
|
||||
Case 90
|
||||
m_nROTATED = If(IsPositive, 180, 0)
|
||||
Case 180
|
||||
m_nROTATED = If(IsPositive, 270, 90)
|
||||
Case 270
|
||||
m_nROTATED = If(IsPositive, 0, 180)
|
||||
End Select
|
||||
Dim dNewRotation As Double = (m_nROTATED + dRot) Mod 360
|
||||
m_nROTATED = If(dNewRotation >= 0, dNewRotation, 360 + dNewRotation)
|
||||
EgtSetInfo(nPartId, BTL_PRT_ROTATED, m_nROTATED)
|
||||
' imposto modificato per copie
|
||||
EgtDuploSetModified(nPartId)
|
||||
@@ -1182,7 +1249,7 @@ Public Class BTLPartM
|
||||
' ripristino inversione
|
||||
Inversion(SelectedMachineType)
|
||||
End If
|
||||
EgtDraw()
|
||||
If bRedraw Then EgtDraw()
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
+22
@@ -11,6 +11,13 @@ Public Class BTLStructureM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nAsseBaseId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nAsseBaseId As Integer
|
||||
Get
|
||||
Return m_nAsseBaseId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' pezzi da BTL
|
||||
Public m_BTLPartMList As List(Of BTLPartM)
|
||||
Public Property BTLPartMList As List(Of BTLPartM)
|
||||
@@ -384,7 +391,20 @@ Public Class BTLStructureM
|
||||
End If
|
||||
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
|
||||
End While
|
||||
' cerco tra gli AsseBase
|
||||
Dim nAsseBaseLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
While nAsseBaseLayerId <> GDB_ID.NULL
|
||||
' verifico se il layer appartiene al ProjId
|
||||
Dim nAsseBaseLayerProjId As Integer
|
||||
EgtGetInfo(nAsseBaseLayerId, BTL_PRT_PROJ, nAsseBaseLayerProjId)
|
||||
If nAsseBaseLayerProjId = ProjId Then
|
||||
NewBTLStructure.m_nAsseBaseId = nAsseBaseLayerId
|
||||
Exit While
|
||||
End If
|
||||
nAsseBaseLayerId = EgtGetNextName(nAsseBaseLayerId, ASSEBASE)
|
||||
End While
|
||||
Else
|
||||
NewBTLStructure.m_nAsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
NewBTLStructure.m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
End If
|
||||
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNUM, NewBTLStructure.m_sPROJNUM)
|
||||
@@ -412,6 +432,8 @@ Public Class BTLStructureM
|
||||
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_PRT_RECESS, sValue)
|
||||
NewBTLStructure.m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLStructure.ocRECESS), NewBTLStructure.ocRECESS)
|
||||
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_USERATTRIBUTE, NewBTLStructure.m_sUSERATTRIBUTE)
|
||||
' setto il tipo di progetto (Beam o Wall) nel file ini del BTL
|
||||
If NewBTLStructure.m_nPROJTYPE <> BWType.NULL Then BTLIniFile.m_nBTLBWType = NewBTLStructure.m_nPROJTYPE
|
||||
' recupero i part
|
||||
NewBTLStructure.m_BTLPartMList = LoadParts(ProjId)
|
||||
'Dim nPartId As Integer = EgtGetFirstPart()
|
||||
+32
-22
@@ -109,7 +109,7 @@ Public Class BTLFeatureVM
|
||||
' proprieta' che mostra la descrizione in interfaccia
|
||||
Public ReadOnly Property sDesc As String
|
||||
Get
|
||||
Return sDescGRP & " " & sName
|
||||
Return sDescGRP & " [" & nPRID & "] " & sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -139,21 +139,19 @@ Public Class BTLFeatureVM
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If Not m_BTLFeatureM.bDO Then
|
||||
Return Brushes.Aqua
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.OK Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.NOTCALCULATED Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.WARNING Then
|
||||
Return Brushes.Orange
|
||||
ElseIf m_BTLFeatureM.nState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
If Not m_BTLFeatureM.bDO Then Return Brushes.Aqua
|
||||
Select Case m_BTLFeatureM.nState
|
||||
Case CalcStates.ERROR_, CalcStates.COLLISION
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
Case CalcStates.INFO, CalcStates.OK
|
||||
Return Brushes.Green
|
||||
Case CalcStates.NOTCALCULATED
|
||||
Return Brushes.LightGray
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -165,14 +163,14 @@ Public Class BTLFeatureVM
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case m_BTLFeatureM.nCALC_ERR
|
||||
Case 22
|
||||
Select Case m_BTLFeatureM.nState
|
||||
Case CalcStates.COLLISION
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Case CalcStates.ERROR_
|
||||
Return "e"
|
||||
Case 17
|
||||
Case CalcStates.WARNING
|
||||
Return "w"
|
||||
Case < 0
|
||||
Case CalcStates.INFO
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
@@ -183,7 +181,7 @@ Public Class BTLFeatureVM
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case m_BTLFeatureM.nState
|
||||
Case CalcStates.ERROR_
|
||||
Case CalcStates.ERROR_, CalcStates.COLLISION
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
@@ -195,6 +193,17 @@ Public Class BTLFeatureVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' variabile che indica se rifare il pezzo
|
||||
Private m_bRedo As Boolean = True
|
||||
Public Property bRedo As Boolean
|
||||
Get
|
||||
Return m_bRedo
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bRedo = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
'Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
|
||||
@@ -231,6 +240,7 @@ Public Class BTLFeatureVM
|
||||
EgtDeselectAll()
|
||||
SelGeomFeature(nFeatureId)
|
||||
End Sub
|
||||
|
||||
Private Sub SelGeomFeature(nMyFeatureId As Integer)
|
||||
EgtSelectObj(nMyFeatureId)
|
||||
Dim sVal As String = ""
|
||||
@@ -0,0 +1,24 @@
|
||||
Public Class CalcEditEndEventArgs
|
||||
Inherits EventArgs
|
||||
|
||||
Public Enum Results As Integer
|
||||
NULL = 0
|
||||
MODIFIED = 1
|
||||
ERROR_ = 2
|
||||
End Enum
|
||||
|
||||
Public m_End As Results
|
||||
Public Property End_ As Results
|
||||
Get
|
||||
Return m_End
|
||||
End Get
|
||||
Private Set(value As Results)
|
||||
m_End = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Result As Results)
|
||||
m_End = Result
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,36 @@
|
||||
Public Class CalcEndEventArgs
|
||||
Inherits EventArgs
|
||||
|
||||
Public Enum Results As Integer
|
||||
NULL = 0
|
||||
OK = 1
|
||||
ERROR_ = 2
|
||||
EDIT = 3
|
||||
End Enum
|
||||
|
||||
Public m_End As Results
|
||||
Public Property End_ As Results
|
||||
Get
|
||||
Return m_End
|
||||
End Get
|
||||
Private Set(value As Results)
|
||||
m_End = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_CmdType As CmdTypes
|
||||
Public Property CmdType As CmdTypes
|
||||
Get
|
||||
Return m_CmdType
|
||||
End Get
|
||||
Private Set(value As CmdTypes)
|
||||
m_CmdType = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(CmdType As CmdTypes, Result As Results)
|
||||
m_CmdType = CmdType
|
||||
m_End = Result
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,596 @@
|
||||
Imports System.IO
|
||||
Imports System.Threading
|
||||
Imports System.Globalization
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Module CalcIntegration
|
||||
|
||||
Private _thread As System.Threading.Thread
|
||||
|
||||
Public Event Calc_Ended As EventHandler(Of CalcEndEventArgs)
|
||||
Public Event Calc_ProcessResult As EventHandler(Of CalcResultEventArgs)
|
||||
Public Event Calc_ProcessEnd As EventHandler(Of CalcProcessEndEventArgs)
|
||||
|
||||
Private m_bIsSupervisor As Boolean = False
|
||||
|
||||
Public Enum CmdTypes As Integer
|
||||
GENERATE = 0
|
||||
MODIFY = 1
|
||||
SIMULATE = 2
|
||||
CHECK = 3
|
||||
CHECKGEN = 4
|
||||
POINT_CLOUD = 5
|
||||
RAWPART = 6
|
||||
EDIT = 7
|
||||
End Enum
|
||||
|
||||
Private Structure MyProc
|
||||
Public bEnable As Boolean
|
||||
Public Proc As Process
|
||||
Public nBar As Integer
|
||||
End Structure
|
||||
|
||||
Private m_MaxCamInstances As Integer = 1
|
||||
Public Sub SetMaxCamInstances(value As Integer)
|
||||
m_MaxCamInstances = value
|
||||
End Sub
|
||||
|
||||
Delegate Sub CallbackDlg(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
|
||||
|
||||
Public Sub Run(vBar As Bar(), sProjDirPath As String, callback As CallbackDlg, Optional bIsSupervisor As Boolean = False)
|
||||
_thread = New Thread(Sub()
|
||||
m_bIsSupervisor = bIsSupervisor
|
||||
DoJob(vBar, sProjDirPath, callback)
|
||||
End Sub)
|
||||
_thread.Start()
|
||||
End Sub
|
||||
|
||||
Private Sub DoJob(vBar As Bar(), sProjDirPath As String, callback As CallbackDlg)
|
||||
Dim bCancel As Boolean = False
|
||||
callback(0, "Init", bCancel)
|
||||
|
||||
If vBar.Count > 0 AndAlso vBar(0).nCmdType = CmdTypes.SIMULATE Then
|
||||
Dim Bar As Bar = vBar(0)
|
||||
' verifico se il pezzo e' non calcolato
|
||||
If Bar.nProgramPage = ProjectType.PROJ Then
|
||||
If Bar.nGlobState = CalcStates.NOTCALCULATED Then
|
||||
Bar.sBarPath = CreateNewProjectFromPart(Bar.nBarId, sProjDirPath)
|
||||
Else
|
||||
Dim nPDN As Integer = 0
|
||||
EgtGetInfo(Bar.nBarId, BTL_PRT_PDN, nPDN)
|
||||
Bar.sBarPath = sProjDirPath & "\" & nPDN.ToString() & ".bwe"
|
||||
End If
|
||||
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
||||
If Bar.nGlobState = CalcStates.NOTCALCULATED Then
|
||||
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath, Bar.nGlobState)
|
||||
Else
|
||||
Dim sMachGroupName As String = ""
|
||||
EgtGetMachGroupName(Bar.nBarId, sMachGroupName)
|
||||
Bar.sBarPath = sProjDirPath & "\" & sMachGroupName & ".bwe"
|
||||
End If
|
||||
End If
|
||||
ElseIf vBar(0).nCmdType <> CmdTypes.EDIT Then
|
||||
' creo progetti a seconda del tipo
|
||||
For Each Bar In vBar
|
||||
If Bar.nProgramPage = ProjectType.PROJ Then
|
||||
Bar.sBarPath = CreateNewProjectFromPart(Bar.nBarId, sProjDirPath)
|
||||
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
||||
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath, Bar.nGlobState)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Dim bIsSimulation As Boolean = False
|
||||
Dim bIsSimulationVerifyed As Boolean = False
|
||||
Dim bIsEdit As Boolean = False
|
||||
Dim LastFileWriteTime As Date
|
||||
' se sono in simulazione
|
||||
If vBar.Count > 0 AndAlso vBar(0).nCmdType = CmdTypes.SIMULATE Then
|
||||
bIsSimulation = True
|
||||
callback(0, "Simulation opened", bCancel)
|
||||
ElseIf vBar.Count > 0 AndAlso vBar(0).nCmdType = CmdTypes.EDIT Then
|
||||
bIsEdit = True
|
||||
Dim sCurrFilePath As String = ""
|
||||
EgtGetCurrFilePath(sCurrFilePath)
|
||||
vBar(0).sBarPath = sCurrFilePath
|
||||
LastFileWriteTime = File.GetLastWriteTime(sCurrFilePath)
|
||||
callback(0, "Editor opened", bCancel)
|
||||
Else
|
||||
callback(0.1, "", bCancel)
|
||||
End If
|
||||
|
||||
Dim ExePath As String = String.Empty
|
||||
GetMainPrivateProfileString(S_BEAM, K_CALCPATH, "", ExePath)
|
||||
' Numero di barre
|
||||
Dim numBars As Integer = vBar.Count
|
||||
If numBars = 0 Then Return
|
||||
|
||||
' Numero di core logici da utilizzare (minimo tra presenti sul PC e imposti da INI)
|
||||
Dim nMaxThread As Integer = Math.Min(Environment.ProcessorCount, m_MaxCamInstances)
|
||||
|
||||
Array.Resize(Of Bar)(vBar, numBars + nMaxThread - 1)
|
||||
|
||||
' Frazione di avanzamento del lavoro (in piu)
|
||||
Dim dProgress As Double = 0
|
||||
'indice incremento progress durante calcolo barra
|
||||
Dim nPgsCurrBar As Integer = 0
|
||||
Dim nPgsClock As Integer = 0
|
||||
|
||||
|
||||
' Lancio in parallelo più processi (senza superare il numero di core logici presenti)
|
||||
Dim vProc As MyProc() = New MyProc(nMaxThread - 1) {}
|
||||
For j As Integer = 0 To nMaxThread - 1
|
||||
vProc(j).nBar = -1
|
||||
vProc(j).bEnable = True
|
||||
Next
|
||||
|
||||
' Processo i Btl in parallelo
|
||||
Dim nCurrBar As Integer = 0
|
||||
Dim nDoneBar As Integer = 0
|
||||
Dim nShiftBar As Integer = 0
|
||||
Dim nActProc As Integer = 0
|
||||
|
||||
Dim bAllKO As Boolean
|
||||
|
||||
While nCurrBar < numBars + nShiftBar OrElse nActProc > 0
|
||||
|
||||
For j As Integer = 0 To nMaxThread - 1
|
||||
If Not vProc(j).bEnable Then Continue For
|
||||
Dim bDone As Boolean = False
|
||||
|
||||
If vProc(j).nBar = -1 Then
|
||||
|
||||
If nCurrBar < numBars + nShiftBar Then
|
||||
|
||||
If vBar(nCurrBar).bBarOk Then
|
||||
vProc(j).Proc = New Process()
|
||||
vProc(j).Proc.StartInfo.FileName = ExePath
|
||||
If bIsEdit Then
|
||||
vProc(j).Proc.StartInfo.Arguments = """" & vBar(nCurrBar).sBarPath & """"
|
||||
Else
|
||||
vProc(j).Proc.StartInfo.Arguments = """" & vBar(nCurrBar).sBarPath & """ " &
|
||||
"""" & vBar(nCurrBar).nProjType & """ " &
|
||||
"""" & vBar(nCurrBar).nMachineName & """ " & vBar(nCurrBar).nCmdType
|
||||
End If
|
||||
vProc(j).Proc.StartInfo.UseShellExecute = False
|
||||
|
||||
If vProc(j).Proc.Start() Then
|
||||
vProc(j).nBar = nCurrBar
|
||||
nCurrBar += 1
|
||||
nActProc += 1
|
||||
End If
|
||||
Else
|
||||
If vBar(nCurrBar).nCmdType = CmdTypes.CHECK OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKGEN Then
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
ElseIf vBar(nCurrBar).nCmdType = CmdTypes.GENERATE Then
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
End If
|
||||
bDone = True
|
||||
nCurrBar += 1
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
|
||||
If vProc(j).Proc.HasExited Then
|
||||
' se terminato con successo
|
||||
If vProc(j).Proc.ExitCode = 0 Then
|
||||
' salvo il risultato
|
||||
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
|
||||
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
|
||||
'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
End If
|
||||
bDone = True
|
||||
vProc(j).nBar = -1
|
||||
nActProc -= 1
|
||||
' se superato il numero di processi eseguibili in parallelo
|
||||
ElseIf vProc(j).Proc.ExitCode = 1 Then
|
||||
' aggiungo il pezzo in coda
|
||||
If numBars + nShiftBar < numBars + nMaxThread Then
|
||||
vBar(numBars + nShiftBar) = vBar(vProc(j).nBar)
|
||||
nShiftBar += 1
|
||||
End If
|
||||
' disabilito il processo
|
||||
vProc(j).bEnable = False
|
||||
vProc(j).nBar = -1
|
||||
nActProc -= 1
|
||||
' altrimenti (errore generico di esecuzione)
|
||||
Else
|
||||
' salvo il risultato
|
||||
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
|
||||
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
|
||||
'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
|
||||
End If
|
||||
bDone = True
|
||||
vProc(j).nBar = -1
|
||||
nActProc -= 1
|
||||
End If
|
||||
Else
|
||||
vProc(j).Proc.Refresh()
|
||||
End If
|
||||
End If
|
||||
|
||||
If bDone Then
|
||||
' se sono in simulazione
|
||||
If bIsSimulation Then
|
||||
Dim sOriPath As String = Path.ChangeExtension(vBar(0).sBarPath, ".ori.bwe")
|
||||
' se file modificato a mano
|
||||
If File.GetLastWriteTime(sOriPath) < File.GetLastWriteTime(vBar(0).sBarPath) Then
|
||||
' aggiorno progetto
|
||||
If File.Exists(vBar(0).sBarPath) Then File.Copy(vBar(0).sBarPath, sOriPath, True)
|
||||
|
||||
' messaggio di lancio verifica
|
||||
callback(50, "Verifying modifications...", bCancel)
|
||||
' lancio verifica
|
||||
System.Threading.Thread.Sleep(500)
|
||||
|
||||
Dim Proc As New Process()
|
||||
Proc.StartInfo.FileName = ExePath
|
||||
Proc.StartInfo.Arguments = """" & vBar(0).sBarPath & """ " &
|
||||
"""" & vBar(0).nProjType & """ " &
|
||||
"""" & vBar(0).nMachineName & """ " & CmdTypes.CHECKGEN
|
||||
Proc.StartInfo.UseShellExecute = False
|
||||
|
||||
If Proc.Start() Then
|
||||
Dim ProgressValue As Integer = 50
|
||||
While Not Proc.HasExited
|
||||
Proc.Refresh()
|
||||
If ProgressValue < 90 Then ProgressValue += 0.001
|
||||
callback(ProgressValue, "Verifying modifications...", bCancel)
|
||||
Thread.Sleep(1)
|
||||
End While
|
||||
' se terminato con successo
|
||||
If Proc.ExitCode = 0 Then
|
||||
' salvo il risultato
|
||||
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(0)))
|
||||
Thread.Sleep(500)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' messaggio di completamento simulazione
|
||||
callback(0, "Simulation closing", bCancel)
|
||||
ElseIf bIsEdit Then
|
||||
' ricarico il progetto
|
||||
Dim Result As CalcEndEventArgs.Results
|
||||
If bAllKO Then
|
||||
Result = CalcEndEventArgs.Results.ERROR_
|
||||
ElseIf bIsEdit Then
|
||||
Result = CalcEndEventArgs.Results.EDIT
|
||||
Else
|
||||
Result = CalcEndEventArgs.Results.OK
|
||||
End If
|
||||
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(CmdTypes.EDIT, Result))
|
||||
Return
|
||||
Else
|
||||
' Dialog con Progress Bar
|
||||
nDoneBar += 1
|
||||
dProgress = 1 / numBars * nDoneBar
|
||||
Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
|
||||
callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
|
||||
End If
|
||||
If bCancel Then
|
||||
' fine
|
||||
callback(1, "", bCancel)
|
||||
' riabilito interfaccia
|
||||
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(CmdTypes.CHECKGEN, CalcEndEventArgs.Results.OK))
|
||||
Return
|
||||
End If
|
||||
nPgsCurrBar = 0
|
||||
nPgsClock = 0
|
||||
Else
|
||||
' se non sono in simulazione
|
||||
If Not bIsSimulation AndAlso Not bIsEdit Then
|
||||
' aggiorno conteggio
|
||||
If nPgsClock >= 100 AndAlso nPgsCurrBar < 149 Then
|
||||
nPgsCurrBar += 1
|
||||
dProgress = 1 / numBars * nDoneBar + 1 / numBars / 150 * nPgsCurrBar
|
||||
Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
|
||||
callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
|
||||
nPgsClock = 0
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
nPgsClock += 1
|
||||
Thread.Sleep(1)
|
||||
Next
|
||||
|
||||
' Verifico che i processi non siano andati tutti in errore
|
||||
bAllKO = True
|
||||
|
||||
For j As Integer = 0 To nMaxThread - 1
|
||||
If vProc(j).bEnable Then bAllKO = False
|
||||
Next
|
||||
|
||||
If bAllKO Then
|
||||
Exit While
|
||||
End If
|
||||
|
||||
Thread.Sleep(10)
|
||||
End While
|
||||
|
||||
Thread.Sleep(300)
|
||||
|
||||
' se sono in simulazione
|
||||
If bIsSimulation Then
|
||||
callback(1, "Simulation closed", bCancel)
|
||||
Else
|
||||
callback(1, "Done", bCancel)
|
||||
End If
|
||||
' riabilito interfaccia
|
||||
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(If(bIsSimulation And Not bIsSimulationVerifyed, CmdTypes.SIMULATE, CmdTypes.CHECKGEN), If(bAllKO, CalcEndEventArgs.Results.ERROR_, CalcEndEventArgs.Results.OK)))
|
||||
End Sub
|
||||
|
||||
Private Function CreateNewProjectFromPart(nPartId As Integer, sProjDirPath As String) As String
|
||||
|
||||
' Aggiorno identificativi per segnalazione errori
|
||||
UpdateCutIdAndTaskId(nPartId)
|
||||
|
||||
' Disabilito segnalazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
|
||||
' Recupero visibilita' pezzo e lo imposto a visibile
|
||||
Dim nOldPartMode As Integer
|
||||
EgtGetMode(nPartId, nOldPartMode)
|
||||
EgtSetMode(nPartId, GDB_MD.STD)
|
||||
|
||||
' Salvo pezzo nel suo progetto
|
||||
Dim bOk As Boolean = False
|
||||
Dim nPDN As Integer = 0
|
||||
EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN)
|
||||
Dim sPartFilePath As String = sProjDirPath & "\" & nPDN.ToString() & ".bwe"
|
||||
bOk = EgtSaveObjToFile(nPartId, sPartFilePath, NGE.CMPTEXT)
|
||||
|
||||
' Ripristino visibilita' pezzo
|
||||
EgtSetMode(nPartId, nOldPartMode)
|
||||
|
||||
' Ripristino stato segnalazione modifica
|
||||
DisableMgr.ReEnable()
|
||||
|
||||
Return If(bOk, sPartFilePath, String.Empty)
|
||||
End Function
|
||||
|
||||
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String, nGlobState As Integer) As String
|
||||
' aggiorno cutid e taskid solo fuori dal supervisore o se pezzo ricalcolato
|
||||
If Not m_bIsSupervisor OrElse nGlobState = CalcStates.NOTCALCULATED Then
|
||||
Dim DisableMgr As DisableModifiedMgr = Nothing
|
||||
If m_bIsSupervisor Then
|
||||
' Disabilito segnalazione modificato
|
||||
DisableMgr = New DisableModifiedMgr
|
||||
End If
|
||||
' Aggiorno identificativi per segnalazione errori
|
||||
Dim nOldMachGroup As Integer = EgtGetCurrMachGroup()
|
||||
If nMachGroupId <> nOldMachGroup Then EgtSetCurrMachGroup(nMachGroupId)
|
||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If EgtVerifyRawPartPhase(nRawId, 1) Then
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
UpdateCutIdAndTaskId(nPartId)
|
||||
nPartId = EgtGetNextPartInRawPart(nPartId)
|
||||
End While
|
||||
End If
|
||||
nRawId = EgtGetNextRawPart(nRawId)
|
||||
End While
|
||||
If nMachGroupId <> nOldMachGroup Then
|
||||
If nOldMachGroup <> GDB_ID.NULL Then
|
||||
EgtSetCurrMachGroup(nOldMachGroup)
|
||||
Else
|
||||
EgtResetCurrMachGroup()
|
||||
End If
|
||||
End If
|
||||
If m_bIsSupervisor Then
|
||||
' Ripristino stato segnalazione modifica
|
||||
DisableMgr.ReEnable()
|
||||
End If
|
||||
End If
|
||||
|
||||
' Salvo gruppo di lavorazione nel suo progetto
|
||||
Dim sMachGroupName As String = ""
|
||||
EgtGetMachGroupName(nMachGroupId, sMachGroupName)
|
||||
Dim sMachGroupFilePath As String = sProjDirPath & "\" & sMachGroupName & ".bwe"
|
||||
If EgtSaveObjToFile(nMachGroupId, sMachGroupFilePath, NGE.CMPTEXT) Then
|
||||
Return sMachGroupFilePath
|
||||
End If
|
||||
Return String.Empty
|
||||
End Function
|
||||
|
||||
Private Function UpdateCutIdAndTaskId(nPartId As Integer) As Boolean
|
||||
' Assegno Id a CutId per calcoli
|
||||
EgtSetInfo(nPartId, "CUTID", nPartId, True)
|
||||
|
||||
' Assegno TASKID agli outline per calcoli
|
||||
Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia una feature
|
||||
Dim nGRP As Integer
|
||||
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
|
||||
' verifico se ha un principale
|
||||
Dim nMainOffsId As Integer = 0
|
||||
Dim nTaskId As Integer = nOutlineId
|
||||
If EgtGetInfo(nOutlineId, BTL_FTR_MAINID, nMainOffsId) Then
|
||||
nTaskId = nOutlineId + nMainOffsId
|
||||
'' assegno TASKID alla feature per calcoli
|
||||
'EgtSetInfo(nOutlineId, "TASKID", nOutlineId + nMainOffsId, True)
|
||||
'Else
|
||||
' ' assegno TASKID alla feature per calcoli
|
||||
' EgtSetInfo(nOutlineId, "TASKID", nOutlineId, True)
|
||||
End If
|
||||
' assegno TASKID alla feature per calcoli
|
||||
EgtSetInfo(nOutlineId, "TASKID", nTaskId)
|
||||
' recupero eventuali AuxId
|
||||
Dim sAuxIds As String = ""
|
||||
If EgtGetInfo(nOutlineId, BTL_FTR_AUXID, sAuxIds) Then
|
||||
Dim AuxIdArray() As String = sAuxIds.Split(","c)
|
||||
If AuxIdArray.Count > 0 Then
|
||||
For Each AuxId In AuxIdArray
|
||||
AuxId = AuxId.Trim()
|
||||
AuxId = AuxId.Trim("+"c)
|
||||
Dim nAuxId As Integer
|
||||
If Integer.TryParse(AuxId, nAuxId) Then
|
||||
EgtSetInfo(nOutlineId + nAuxId, "TASKID", nTaskId)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
|
||||
' Assegno TASKID alle feature per calcoli
|
||||
Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia una feature
|
||||
Dim nGRP As Integer
|
||||
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
|
||||
' verifico se ha un principale
|
||||
Dim nMainOffsId As Integer
|
||||
Dim nTaskId As Integer = nFeatureId
|
||||
If EgtGetInfo(nFeatureId, BTL_FTR_MAINID, nMainOffsId) Then
|
||||
nTaskId = nFeatureId + nMainOffsId
|
||||
' ' assegno TASKID alla feature per calcoli
|
||||
' EgtSetInfo(nFeatureId, "TASKID", nFeatureId + nMainOffsId, True)
|
||||
'Else
|
||||
' ' assegno TASKID alla feature per calcoli
|
||||
' EgtSetInfo(nFeatureId, "TASKID", nFeatureId, True)
|
||||
End If
|
||||
' assegno TASKID alla feature per calcoli
|
||||
EgtSetInfo(nFeatureId, "TASKID", nTaskId)
|
||||
' recupero eventuali AuxId
|
||||
Dim sAuxIds As String = ""
|
||||
If EgtGetInfo(nFeatureId, BTL_FTR_AUXID, sAuxIds) Then
|
||||
Dim AuxIdArray() As String = sAuxIds.Split(","c)
|
||||
For Each AuxId In AuxIdArray
|
||||
AuxId = AuxId.Trim()
|
||||
AuxId = AuxId.Trim("+"c)
|
||||
Dim nAuxId As Integer
|
||||
If Integer.TryParse(AuxId, nAuxId) Then
|
||||
EgtSetInfo(nFeatureId + nAuxId, "TASKID", nTaskId)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
Public Class Bar
|
||||
'Public piInfo As PatternInfo
|
||||
Public nBarState As Integer
|
||||
Public nBarId As Integer
|
||||
Public sBarPath As String
|
||||
Public bBarOk As Boolean
|
||||
Public nCmdType As Integer
|
||||
Public nProgramPage As ProjectType
|
||||
Public nProjType As BWType
|
||||
Public nMachineName As String
|
||||
Public nGlobState As Integer
|
||||
End Class
|
||||
|
||||
Public Class ProcessResult
|
||||
|
||||
Public Enum ProcessResultTypes As Integer
|
||||
BAR = 1
|
||||
PART = 2
|
||||
TASKID = 3
|
||||
FALL = 4
|
||||
TIME = 5
|
||||
End Enum
|
||||
|
||||
Private m_Type As ProcessResultTypes
|
||||
Public ReadOnly Property Type As ProcessResultTypes
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nCUTID As Integer
|
||||
Public ReadOnly Property nCUTID As Integer
|
||||
Get
|
||||
Return m_nCUTID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nTASKID As Integer
|
||||
Public ReadOnly Property nTASKID As Integer
|
||||
Get
|
||||
Return m_nTASKID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nERR As Integer
|
||||
Public ReadOnly Property nERR As Integer
|
||||
Get
|
||||
Return m_nERR
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sMSG As String
|
||||
Public ReadOnly Property sMSG As String
|
||||
Get
|
||||
Return m_sMSG
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dROT As Double
|
||||
Public ReadOnly Property dROT As Double
|
||||
Get
|
||||
Return m_dROT
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetROT(value As Double)
|
||||
m_dROT = value
|
||||
End Sub
|
||||
|
||||
Private m_nFALL As Integer
|
||||
Public ReadOnly Property nFALL As Integer
|
||||
Get
|
||||
Return m_nFALL
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nTIME As Integer
|
||||
Public ReadOnly Property nTIME As Integer
|
||||
Get
|
||||
Return m_nTIME
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Shared Function CreateTaskResult(CUTID As Integer, TASKID As Integer, ERR As Integer, MSG As String, ROT As Double) As ProcessResult
|
||||
If CUTID <> 0 Then
|
||||
If TASKID = 0 Then
|
||||
Return New ProcessResult(ProcessResultTypes.PART, CUTID, TASKID, ERR, MSG, ROT, 0, 0)
|
||||
End If
|
||||
Return New ProcessResult(ProcessResultTypes.TASKID, CUTID, TASKID, ERR, MSG, ROT, 0, 0)
|
||||
End If
|
||||
Return New ProcessResult(ProcessResultTypes.BAR, CUTID, TASKID, ERR, MSG, ROT, 0, 0)
|
||||
End Function
|
||||
Public Shared Function CreateFallResult(CUTID As Integer, ERR As Integer, MSG As String, FALL As Integer) As ProcessResult
|
||||
Return New ProcessResult(ProcessResultTypes.FALL, CUTID, 0, ERR, MSG, 0, FALL, 0)
|
||||
End Function
|
||||
Public Shared Function CreateTimeResult(CUTID As Integer, TIME As Integer) As ProcessResult
|
||||
Return New ProcessResult(ProcessResultTypes.TIME, CUTID, 0, 0, "", 0, 0, TIME)
|
||||
End Function
|
||||
|
||||
Protected Sub New(Type As ProcessResultTypes, CUTID As Integer, TASKID As Integer, ERR As Integer, MSG As String, ROT As Double, FALL As Integer, TIME As Integer)
|
||||
m_Type = Type
|
||||
m_nCUTID = CUTID
|
||||
m_nTASKID = TASKID
|
||||
m_nERR = ERR
|
||||
m_sMSG = MSG
|
||||
m_dROT = ROT
|
||||
m_nFALL = FALL
|
||||
m_nTIME = TIME
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class CalcProcessEndEventArgs
|
||||
Inherits EventArgs
|
||||
|
||||
Public m_Result As Bar
|
||||
Public Property Result As Bar
|
||||
Get
|
||||
Return m_Result
|
||||
End Get
|
||||
Private Set(value As Bar)
|
||||
m_Result = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Result As Bar)
|
||||
m_Result = Result
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,24 @@
|
||||
Public Class CalcResultEventArgs
|
||||
Inherits EventArgs
|
||||
|
||||
Public Enum Results As Integer
|
||||
NULL = 0
|
||||
OK = 1
|
||||
ERROR_ = 2
|
||||
End Enum
|
||||
|
||||
Public m_Result As Bar
|
||||
Public Property Result As Bar
|
||||
Get
|
||||
Return m_Result
|
||||
End Get
|
||||
Private Set(value As Bar)
|
||||
m_Result = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Result As Bar)
|
||||
m_Result = Result
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -30,8 +30,9 @@
|
||||
Enum CalcStates As Integer
|
||||
NOTCALCULATED = -1
|
||||
OK = 0
|
||||
WARNING = 1
|
||||
ERROR_ = 2
|
||||
INFO = 1
|
||||
WARNING = 2
|
||||
ERROR_ = 3
|
||||
End Enum
|
||||
|
||||
Public Enum Range As Integer
|
||||
@@ -112,170 +113,199 @@
|
||||
PROD = 2
|
||||
End Enum
|
||||
|
||||
' Tipo di progetto (Beam o Wall)
|
||||
Public Enum BWType As Integer
|
||||
BEAM = 1
|
||||
WALL = 2
|
||||
' Tipo di progetto (Beam o Wall)
|
||||
Public Enum BWType As Integer
|
||||
NULL = 0
|
||||
BEAM = 1
|
||||
WALL = 2
|
||||
End Enum
|
||||
|
||||
Friend Const PROJ As String = "PROJ"
|
||||
Friend Const FILENAMESEPARATOR As Char = "^"c
|
||||
Friend Const BTLINFO As String = "BtlInfo"
|
||||
Public Const PROJ As String = "PROJ"
|
||||
Public Const FILENAMESEPARATOR As Char = "^"c
|
||||
Public Const BTLINFO As String = "BtlInfo"
|
||||
|
||||
' layer per assemblato
|
||||
Public Const ASSEBASE As String = "AsseBase"
|
||||
' info parametri assemblato
|
||||
Public Const BTL_ASSEBASE_N As String = "N"
|
||||
|
||||
' info parametri BTL
|
||||
Friend Const BTL_PRT_PROJ As String = "PROJ"
|
||||
Friend Const BTL_PRT_PDN As String = "PDN"
|
||||
Friend Const BTL_PRT_DO As String = "DO"
|
||||
Friend Const BTL_PRT_NAM As String = "NAM"
|
||||
Friend Const BTL_PRT_L As String = "L"
|
||||
Friend Const BTL_PRT_W As String = "W"
|
||||
Friend Const BTL_PRT_H As String = "H"
|
||||
Friend Const BTL_PRT_CNT As String = "CNT"
|
||||
Friend Const BTL_PRT_ADDED As String = "ADDED"
|
||||
Friend Const BTL_PRT_DONE As String = "DONE"
|
||||
Friend Const BTL_PRT_ROTATED As String = "ROTATED"
|
||||
Friend Const BTL_PRT_INVERTED As String = "INVERTED"
|
||||
Friend Const BTL_PRT_MATERIAL As String = "MATERIAL"
|
||||
Public Const BTL_PRT_PROJ As String = "PROJ"
|
||||
Public Const BTL_PRT_PDN As String = "PDN"
|
||||
Public Const BTL_PRT_DO As String = "DO"
|
||||
Public Const BTL_PRT_NAM As String = "NAM"
|
||||
Public Const BTL_PRT_L As String = "L"
|
||||
Public Const BTL_PRT_W As String = "W"
|
||||
Public Const BTL_PRT_H As String = "H"
|
||||
Public Const BTL_PRT_CNT As String = "CNT"
|
||||
Public Const BTL_PRT_ADDED As String = "ADDED"
|
||||
Public Const BTL_PRT_DONE As String = "DONE"
|
||||
Public Const BTL_PRT_ROTATED As String = "ROTATED"
|
||||
Public Const BTL_PRT_INVERTED As String = "INVERTED"
|
||||
Public Const BTL_PRT_MATERIAL As String = "MATERIAL"
|
||||
Public Const BTL_PRT_VOLUME As String = "VOLUME"
|
||||
' parametri pezzo
|
||||
Friend Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER"
|
||||
Friend Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER"
|
||||
Friend Const BTL_PRT_ORDERNUM = "ORDERNUMBER"
|
||||
Friend Const BTL_PRT_DESIGNATION = "DESIGNATION"
|
||||
Friend Const BTL_PRT_ANNOTATION = "ANNOTATION"
|
||||
Friend Const BTL_PRT_STOREY = "STOREY"
|
||||
Friend Const BTL_PRT_GROUP = "GROUP"
|
||||
Friend Const BTL_PRT_PACKAGE = "PACKAGE"
|
||||
Friend Const BTL_PRT_TIMBERGRADE = "TIMBERGRADE"
|
||||
Friend Const BTL_PRT_QUALITYGRADE = "QUALITYGRADE"
|
||||
Friend Const BTL_PRT_COLOUR = "COLOUR"
|
||||
Friend Const BTL_PRT_PLANINGLENGTH = "PLANINGLENGTH"
|
||||
Friend Const BTL_PRT_STARTOFFSET = "STARTOFFSET"
|
||||
Friend Const BTL_PRT_ENDOFFSET = "ENDOFFSET"
|
||||
Friend Const BTL_PRT_UID = "UID"
|
||||
Friend Const BTL_PRT_TRANSFORMATION = "TRANSFORMATION"
|
||||
Friend Const BTL_PRT_CAMBER = "CAMBER"
|
||||
Friend Const BTL_PRT_PARTOFFSET = "PARTOFFSET"
|
||||
Friend Const BTL_PRT_PROCESSINGQUALITY = "PROCESSINGQUALITY"
|
||||
Friend Const BTL_PRT_RECESS = "RECESS"
|
||||
Friend Const BTL_PRT_STOREYTYPE = "STOREYTYPE"
|
||||
Friend Const BTL_PRT_ELEMENTNUM = "ELEMENTNUMBER"
|
||||
Friend Const BTL_PRT_LAYER = "LAYER"
|
||||
Friend Const BTL_PRT_MODULENUM = "MODULENUMBER"
|
||||
Public Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER"
|
||||
Public Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER"
|
||||
Public Const BTL_PRT_ORDERNUM = "ORDERNUMBER"
|
||||
Public Const BTL_PRT_DESIGNATION = "DESIGNATION"
|
||||
Public Const BTL_PRT_ANNOTATION = "ANNOTATION"
|
||||
Public Const BTL_PRT_STOREY = "STOREY"
|
||||
Public Const BTL_PRT_GROUP = "GROUP"
|
||||
Public Const BTL_PRT_PACKAGE = "PACKAGE"
|
||||
Public Const BTL_PRT_TIMBERGRADE = "TIMBERGRADE"
|
||||
Public Const BTL_PRT_QUALITYGRADE = "QUALITYGRADE"
|
||||
Public Const BTL_PRT_COLOUR = "COLOUR"
|
||||
Public Const BTL_PRT_PLANINGLENGTH = "PLANINGLENGTH"
|
||||
Public Const BTL_PRT_STARTOFFSET = "STARTOFFSET"
|
||||
Public Const BTL_PRT_ENDOFFSET = "ENDOFFSET"
|
||||
Public Const BTL_PRT_UID = "UID"
|
||||
Public Const BTL_PRT_TRANSFORMATION = "TRANSFORMATION"
|
||||
Public Const BTL_PRT_CAMBER = "CAMBER"
|
||||
Public Const BTL_PRT_PARTOFFSET = "PARTOFFSET"
|
||||
Public Const BTL_PRT_PROCESSINGQUALITY = "PROCESSINGQUALITY"
|
||||
Public Const BTL_PRT_RECESS = "RECESS"
|
||||
Public Const BTL_PRT_STOREYTYPE = "STOREYTYPE"
|
||||
Public Const BTL_PRT_ELEMENTNUM = "ELEMENTNUMBER"
|
||||
Public Const BTL_PRT_LAYER = "LAYER"
|
||||
Public Const BTL_PRT_MODULENUM = "MODULENUMBER"
|
||||
'Friend Const BTL_PRT_USERATTRIBUTE = "USERATTRIBUTE"
|
||||
Friend Const BTL_PRT_COMMENT = "COMMENT"
|
||||
Friend Const BTL_PRT_GRAINDIR = "GRAINDIRECTION"
|
||||
Friend Const BTL_PRT_REFSIDE = "REFERENCESIDE"
|
||||
Friend Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
|
||||
Friend Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
|
||||
Public Const BTL_PRT_COMMENT = "COMMENT"
|
||||
Public Const BTL_PRT_GRAINDIR = "GRAINDIRECTION"
|
||||
Public Const BTL_PRT_REFSIDE = "REFERENCESIDE"
|
||||
Public Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
|
||||
Public Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
|
||||
Public Const BTL_PRT_DESCRIPTION = "NAM"
|
||||
|
||||
' parametri generici
|
||||
Friend Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
|
||||
Friend Const BTL_GEN_PROJNAME = "PROJECTNAME"
|
||||
Friend Const BTL_GEN_PROJPART = "PROJECTPART"
|
||||
Friend Const BTL_GEN_PROJGUID = "PROJECTGUID"
|
||||
Friend Const BTL_GEN_PROJTYPE = "PROJECTTYPE"
|
||||
Friend Const BTL_GEN_LISTNAME = "LISTNAME"
|
||||
Friend Const BTL_GEN_CUSTOMER = "CUSTOMER"
|
||||
Friend Const BTL_GEN_ARCHITECT = "ARCHITECT"
|
||||
Friend Const BTL_GEN_EDITOR = "EDITOR"
|
||||
Friend Const BTL_GEN_DELIVDATE = "DELIVERYDATE"
|
||||
Friend Const BTL_GEN_EXPDATE = "EXPORTDATE"
|
||||
Friend Const BTL_GEN_EXPTIME = "EXPORTTIME"
|
||||
Friend Const BTL_GEN_EXPRELEASE = "EXPORTRELEASE"
|
||||
Friend Const BTL_GEN_LANGUAGE = "LANGUAGE"
|
||||
Friend Const BTL_GEN_RANGE = "RANGE"
|
||||
Friend Const BTL_GEN_COMPUTERNAME = "COMPUTERNAME"
|
||||
Friend Const BTL_GEN_USER = "USER"
|
||||
Friend Const BTL_GEN_SRCFILE = "SOURCEFILE"
|
||||
Friend Const BTL_GEN_EXPFILE = "EXPORTFILE"
|
||||
Friend Const BTL_GEN_USERATTRIBUTE = "USERATTRIBUTE"
|
||||
Public Const BTL_GEN_BTLPATH = "BTL"
|
||||
Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
|
||||
Public Const BTL_GEN_PROJNAME = "PROJECTNAME"
|
||||
Public Const BTL_GEN_PROJPART = "PROJECTPART"
|
||||
Public Const BTL_GEN_PROJGUID = "PROJECTGUID"
|
||||
Public Const BTL_GEN_PROJTYPE = "PROJECTTYPE"
|
||||
Public Const BTL_GEN_LISTNAME = "LISTNAME"
|
||||
Public Const BTL_GEN_CUSTOMER = "CUSTOMER"
|
||||
Public Const BTL_GEN_ARCHITECT = "ARCHITECT"
|
||||
Public Const BTL_GEN_EDITOR = "EDITOR"
|
||||
Public Const BTL_GEN_DELIVDATE = "DELIVERYDATE"
|
||||
Public Const BTL_GEN_EXPDATE = "EXPORTDATE"
|
||||
Public Const BTL_GEN_EXPTIME = "EXPORTTIME"
|
||||
Public Const BTL_GEN_EXPRELEASE = "EXPORTRELEASE"
|
||||
Public Const BTL_GEN_LANGUAGE = "LANGUAGE"
|
||||
Public Const BTL_GEN_RANGE = "RANGE"
|
||||
Public Const BTL_GEN_COMPUTERNAME = "COMPUTERNAME"
|
||||
Public Const BTL_GEN_USER = "USER"
|
||||
Public Const BTL_GEN_SRCFILE = "SOURCEFILE"
|
||||
Public Const BTL_GEN_EXPFILE = "EXPORTFILE"
|
||||
Public Const BTL_GEN_USERATTRIBUTE = "USERATTRIBUTE"
|
||||
|
||||
Friend Const PROCESSINGS As String = "Processings"
|
||||
Friend Const OUTLINE As String = "Outline"
|
||||
Friend Const BTL_FTR_GRP As String = "GRP"
|
||||
Friend Const BTL_FTR_PRC As String = "PRC"
|
||||
Friend Const BTL_FTR_DO As String = "DO"
|
||||
Friend Const BTL_FTR_SIDE As String = "SIDE"
|
||||
Friend Const BTL_FTR_NAME As String = "NAME"
|
||||
Friend Const BTL_FTR_DES As String = "DES"
|
||||
Friend Const BTL_FTR_PRID As String = "PRID"
|
||||
Friend Const BTL_FTR_FRAME As String = "FRAME"
|
||||
Friend Const BTL_FTR_MAINID As String = "MAINID"
|
||||
Friend Const BTL_FTR_ADJID As String = "ADJID"
|
||||
Friend Const BTL_FTR_AUXID As String = "AUXID"
|
||||
Public Const PROCESSINGS As String = "Processings"
|
||||
Public Const OUTLINE As String = "Outline"
|
||||
Public Const BTL_FTR_GRP As String = "GRP"
|
||||
Public Const BTL_FTR_PRC As String = "PRC"
|
||||
Public Const BTL_FTR_DO As String = "DO"
|
||||
Public Const BTL_FTR_SIDE As String = "SIDE"
|
||||
Public Const BTL_FTR_PRIORITY As String = "PRIORITY"
|
||||
Public Const BTL_FTR_NAME As String = "NAME"
|
||||
Public Const BTL_FTR_DES As String = "DES"
|
||||
Public Const BTL_FTR_PRID As String = "PRID"
|
||||
Public Const BTL_FTR_FRAME As String = "FRAME"
|
||||
Public Const BTL_FTR_MAINID As String = "MAINID"
|
||||
Public Const BTL_FTR_ADJID As String = "ADJID"
|
||||
Public Const BTL_FTR_AUXID As String = "AUXID"
|
||||
|
||||
' parametri machgroup grezzi
|
||||
Friend Const MGR_RPT_ID As String = "ID"
|
||||
Friend Const MGR_RPT_L As String = "L"
|
||||
Friend Const MGR_RPT_W As String = "W"
|
||||
Friend Const MGR_RPT_H As String = "H"
|
||||
Friend Const MGR_RPT_WASTE As String = "WASTE"
|
||||
Friend Const MGR_RPT_USAGE As String = "USAGE"
|
||||
Friend Const MGR_RPT_STARTCUT As String = "STARTCUT"
|
||||
Friend Const MGR_RPT_MATERIAL As String = "MATERIAL"
|
||||
Public Const MGR_RPT_ID As String = "ID"
|
||||
Public Const MGR_RPT_L As String = "L"
|
||||
Public Const MGR_RPT_W As String = "W"
|
||||
Public Const MGR_RPT_H As String = "H"
|
||||
Public Const MGR_RPT_WASTE As String = "WASTE"
|
||||
Public Const MGR_RPT_USAGE As String = "USAGE"
|
||||
Public Const MGR_RPT_STARTCUT As String = "STARTCUT"
|
||||
Public Const MGR_RPT_MATERIAL As String = "MATERIAL"
|
||||
|
||||
Friend Const MGR_PRT_PDN As String = "PDN"
|
||||
Friend Const MGR_PRT_L As String = "L"
|
||||
Friend Const MGR_PRT_W As String = "W"
|
||||
Friend Const MGR_PRT_H As String = "H"
|
||||
Friend Const MGR_PRT_DES As String = "DES"
|
||||
Friend Const MGR_PRT_STARTCUT As String = "STARTCUT"
|
||||
Friend Const MGR_PRT_MATERIAL As String = "MATERIAL"
|
||||
Friend Const MGR_PRT_ROT As String = "ROT"
|
||||
Friend Const MGR_PRT_FLIP As String = "FLIP"
|
||||
Friend Const MGR_PRT_POSX As String = "POSX"
|
||||
Friend Const MGR_PRT_POSY As String = "POSY"
|
||||
Public Const MGR_PRT_PDN As String = "PDN"
|
||||
Public Const MGR_PRT_L As String = "L"
|
||||
Public Const MGR_PRT_W As String = "W"
|
||||
Public Const MGR_PRT_H As String = "H"
|
||||
Public Const MGR_PRT_DES As String = "DES"
|
||||
Public Const MGR_PRT_STARTCUT As String = "STARTCUT"
|
||||
Public Const MGR_PRT_MATERIAL As String = "MATERIAL"
|
||||
Public Const MGR_PRT_DO As String = "DO"
|
||||
Public Const MGR_PRT_ROT As String = "ROT"
|
||||
Public Const MGR_PRT_FLIP As String = "FLIP"
|
||||
Public Const MGR_PRT_POSX As String = "POSX"
|
||||
Public Const MGR_PRT_POSY As String = "POSY"
|
||||
|
||||
Friend Const MGR_FTR_GRP As String = "GRP"
|
||||
Friend Const MGR_FTR_PRC As String = "PRC"
|
||||
Friend Const MGR_FTR_DO As String = "DO"
|
||||
Friend Const MGR_FTR_SIDE As String = "SIDE"
|
||||
Friend Const MGR_FTR_NAME As String = "NAME"
|
||||
Friend Const MGR_FTR_DES As String = "DES"
|
||||
Friend Const MGR_FTR_PRID As String = "PRID"
|
||||
Friend Const MGR_FTR_FRAME As String = "FRAME"
|
||||
Public Const MGR_FTR_GRP As String = "GRP"
|
||||
Public Const MGR_FTR_PRC As String = "PRC"
|
||||
Public Const MGR_FTR_DO As String = "DO"
|
||||
Public Const MGR_FTR_SIDE As String = "SIDE"
|
||||
Public Const MGR_FTR_NAME As String = "NAME"
|
||||
Public Const MGR_FTR_DES As String = "DES"
|
||||
Public Const MGR_FTR_PRID As String = "PRID"
|
||||
Public Const MGR_FTR_FRAME As String = "FRAME"
|
||||
|
||||
' parametri creazione barre
|
||||
Friend Const MGR_RPT_BARLEN As String = "BARLEN"
|
||||
Friend Const MGR_RPT_BARHEIGHT As String = "BARHEIGHT"
|
||||
Friend Const MGR_RPT_BARWIDTH As String = "BARWIDTH"
|
||||
Friend Const MGR_RPT_PANELLEN As String = "PANELLEN"
|
||||
Friend Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
|
||||
Friend Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
|
||||
Friend Const MGR_RPT_PART As String = "PART"
|
||||
Public Const MGR_RPT_BARLEN As String = "BARLEN"
|
||||
Public Const MGR_RPT_BARHEIGHT As String = "BARHEIGHT"
|
||||
Public Const MGR_RPT_BARWIDTH As String = "BARWIDTH"
|
||||
Public Const MGR_RPT_PANELLEN As String = "PANELLEN"
|
||||
Public Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
|
||||
Public Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
|
||||
Public Const MGR_RPT_PANELPOSZ As String = "PANELPOSZ"
|
||||
Public Const MGR_RPT_PART As String = "PART"
|
||||
|
||||
' parametri P per comunicazione con la macchina
|
||||
Public Const MGR_RPT_PRODID As String = "PRODID"
|
||||
Public Const MGR_RPT_PATTID As String = "PATTID"
|
||||
|
||||
' parametri errori integration
|
||||
Friend Const ITG_CUTID As String = "CUTID"
|
||||
Friend Const ITG_TASKID As String = "TASKID"
|
||||
Friend Const ITG_PROJ_ERR As String = "PROJ_ERR"
|
||||
Friend Const ITG_PROJ_MSG As String = "PROJ_MSG"
|
||||
Friend Const ITG_PROJ_ROT As String = "PROJ_ROT"
|
||||
Friend Const ITG_PROJ_FALL As String = "PROJ_FALL"
|
||||
Friend Const ITG_PROJ_TIME As String = "PROJ_TIME"
|
||||
Public Const ITG_CUTID As String = "CUTID"
|
||||
Public Const ITG_TASKID As String = "TASKID"
|
||||
Public Const ITG_PROJ_ERR As String = "PROJ_ERR"
|
||||
Public Const ITG_PROJ_MSG As String = "PROJ_MSG"
|
||||
Public Const ITG_PROJ_ROT As String = "PROJ_ROT"
|
||||
Public Const ITG_PROJ_FALL As String = "PROJ_FALL"
|
||||
Public Const ITG_PROJ_TIME As String = "PROJ_TIME"
|
||||
|
||||
' parametri errori integration
|
||||
Friend Const ITG_PROD_ERR As String = "PROD_ERR"
|
||||
Friend Const ITG_PROD_MSG As String = "PROD_MSG"
|
||||
Friend Const ITG_PROD_ROT As String = "PROD_ROT"
|
||||
Friend Const ITG_PROD_FALL As String = "PROD_FALL"
|
||||
Friend Const ITG_PROD_TIME As String = "PROD_TIME"
|
||||
Public Const ITG_PROD_ERR As String = "PROD_ERR"
|
||||
Public Const ITG_PROD_MSG As String = "PROD_MSG"
|
||||
Public Const ITG_PROD_ROT As String = "PROD_ROT"
|
||||
Public Const ITG_PROD_FALL As String = "PROD_FALL"
|
||||
Public Const ITG_PROD_TIME As String = "PROD_TIME"
|
||||
|
||||
' parametri blocco rot e flip
|
||||
Public Const LOCK_ROT As String = "MANUALROT"
|
||||
Public Const LOCK_FLIP As String = "MANUALFLIP"
|
||||
|
||||
' parametri errori integration
|
||||
Friend Const DUPLO_TODELETE As String = "DUPLO_TODELETE"
|
||||
Public Const DUPLO_TODELETE As String = "DUPLO_TODELETE"
|
||||
|
||||
' parametri warehouse
|
||||
Friend Const WRH_BEAM As String = "BEAM"
|
||||
Friend Const WRH_WALL As String = "WALL"
|
||||
Friend Const WRH_CURRENT As String = "Current"
|
||||
Friend Const WRH_STARTOFFSET As String = "StartOffset"
|
||||
Friend Const WRH_OFFSET As String = "Offset"
|
||||
Friend Const WRH_L As String = "L"
|
||||
Friend Const WRH_KERF As String = "Kerf"
|
||||
Friend Const WRH_S As String = "S"
|
||||
Public Const WRH_BEAM As String = "BEAM"
|
||||
Public Const WRH_WALL As String = "WALL"
|
||||
Public Const WRH_CURRENT As String = "Current"
|
||||
Public Const WRH_STARTOFFSET As String = "StartOffset"
|
||||
Public Const WRH_OFFSET As String = "Offset"
|
||||
Public Const WRH_RANGE As String = "Range"
|
||||
Public Const WRH_QUANTITY As String = "Quantity"
|
||||
Public Const WRH_L As String = "L"
|
||||
Public Const WRH_KERF As String = "Kerf"
|
||||
Public Const WRH_S As String = "S"
|
||||
|
||||
' parametri import/export
|
||||
Public Const EXP_PROJ As String = "EXPORTPROJ"
|
||||
Public Const EXP_PROD As String = "EXPORTPROD"
|
||||
Public Const BTLFILENAME As String = "BTLFILENAME"
|
||||
Public Const EXP_PART As String = "ImportExport"
|
||||
Public Const EXP_MACHINE As String = "Machine"
|
||||
' parametro che indica se il progetto e' stato appena importato e quindi bisogna riverificare i MachGroup
|
||||
Public Const IMP_VERIFYMACHGROUP As String = "VerifyMachGroup"
|
||||
|
||||
' parametri modifica percorsi free contour
|
||||
Public Const PATH_SIDEANGLAYER As String = "SideAngLayer"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
Public Module ConstColumns
|
||||
|
||||
' RawPartList
|
||||
Public Const COL_NAME As String = "colNAME"
|
||||
Public Const COL_CALC As String = "colCALC"
|
||||
Public Const COL_DO As String = "colDO"
|
||||
Public Const COL_VALUE As String = "colVALUE"
|
||||
Public Const COL_CUSTOM As String = "colCUSTOM"
|
||||
Public Const COL_STARTCUT As String = "colSTARTCUT"
|
||||
Public Const COL_W As String = "colW"
|
||||
Public Const COL_H As String = "colH"
|
||||
Public Const COL_L As String = "colL"
|
||||
Public Const COL_MATERIAL As String = "colMATERIAL"
|
||||
Public Const COL_USAGE As String = "colUSAGE"
|
||||
Public Const COL_WASTE As String = "colWASTE"
|
||||
|
||||
' PartInRawPartList
|
||||
Public Const COL_PDN As String = "colPDN"
|
||||
Public Const COL_NAM As String = "colNAM"
|
||||
Public Const COL_POSZ As String = "colPOSZ"
|
||||
Public Const COL_ROT As String = "colROT"
|
||||
Public Const COL_FLIP As String = "colFLIP"
|
||||
Public Const COL_POSX As String = "colPOSX"
|
||||
Public Const COL_POSY As String = "colPOSY"
|
||||
Public Const COL_OFFSET As String = "colOFFSET"
|
||||
Public Const COL_REDO As String = "colREDO"
|
||||
Public Const COL_TYPE As String = "colTYPE"
|
||||
Public Const COL_DESCRIPTION As String = "colDESCRIPTION"
|
||||
Public Const COL_SUPERVISORID As String = "colSUPERVISORID"
|
||||
Public Const COL_PRIORITY As String = "colPRIORITY"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -9,5 +9,27 @@
|
||||
Public Const S_RAWPARTLIST_WALL As String = "DG_RawPartList_WALL"
|
||||
Public Const S_PARTINRAWPARTLIST_BEAM As String = "DG_PartInRawPartList_BEAM"
|
||||
Public Const S_PARTINRAWPARTLIST_WALL As String = "DG_PartInRawPartList_WALL"
|
||||
Public Const S_PARAMETERLIST_P As String = "DG_ParameterList_P"
|
||||
Public Const S_PARAMETERLIST_Q As String = "DG_ParameterList_Q"
|
||||
Public Const S_DUPLOPARAMETERLIST_Q As String = "DG_DuploParameterList_Q"
|
||||
Public Const S_RAWPARTLIST_SUPERVISOR As String = "DG_RawPartList_SUPERVISOR"
|
||||
Public Const S_PARTINRAWPARTLIST_SUPERVISOR As String = "DG_PartInRawPartList_SUPERVISOR"
|
||||
Public Const S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR As String = "DG_FeatureInPartInRawPartList_SUPERVISOR"
|
||||
Public Const S_PARTLIST As String = "DG_PartList"
|
||||
Public Const S_FEATUREINPARTINRAWPARTLIST As String = "DG_FeatureInPartInRawPartList"
|
||||
Public Const S_STATISTICS As String = "DG_Statistics"
|
||||
Public Const S_OPTIMIZERSTATISTICS As String = "DG_OptimizerStatistics"
|
||||
Public Const S_RAWPARTSTATISTICS As String = "DG_RawPartStatistics"
|
||||
Public Const S_BEAMMACHININGS As String = "DG_BeamMachinings"
|
||||
Public Const S_SPARAMLIST_BEAM As String = "DG_SParamList_BEAM"
|
||||
Public Const S_SPARAMLIST_WALL As String = "DG_SParamList_WALL"
|
||||
Public Const S_SECTXMATLIST_BEAM As String = "DG_SectXMatList_BEAM"
|
||||
Public Const S_SECTXMATLIST_WALL As String = "DG_SectXMatList_WALL"
|
||||
Public Const S_VARIABLESLIST As String = "DG_VariablesList"
|
||||
Public Const S_MDICOMMANDS As String = "DG_MDICommands"
|
||||
Public Const S_MACHINELOG As String = "DG_MachineLog"
|
||||
Public Const S_UPDATEBTLPARTLIST As String = "DG_UpdateBTLPartList"
|
||||
|
||||
Public Const K_LOCKTABLE As String = "LockTable"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
Public Class ConstDims
|
||||
|
||||
Public Const DIMENSIONS_FILE_NAME As String = "Dimensions.ini"
|
||||
|
||||
Public Const PROJECT_VIEW As String = "Project_View"
|
||||
Public Const PROJECT_OPTIMIZER As String = "Project_Optimizer"
|
||||
Public Const LEFTPANEL_VIEW As String = "LeftPanel_View"
|
||||
Public Const LEFTPANEL_OPTIMIZER As String = "LeftPanel_Optimizer"
|
||||
Public Const TOPPANEL_OPTIMIZER As String = "TopPanel_Optimizer"
|
||||
Public Const LEFTPANEL_SUPERVISOR As String = "LeftPanel_Supervisor"
|
||||
Public Const PROJECT_SUPERVISOR As String = "Project_Supervisor"
|
||||
|
||||
End Class
|
||||
+13
-4
@@ -11,7 +11,7 @@
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
Module ConstGen
|
||||
Public Module ConstGen
|
||||
|
||||
' File con direttorio radice dei dati
|
||||
Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
|
||||
@@ -21,6 +21,7 @@ Module ConstGen
|
||||
' File con dati di licenza
|
||||
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
|
||||
Public Const S_LICENCE As String = "Licence"
|
||||
Public Const K_LOCKID As String = "LockId"
|
||||
Public Const K_KEY As String = "Key"
|
||||
Public Const K_NESTKEY As String = "NestKey"
|
||||
|
||||
@@ -30,25 +31,29 @@ Module ConstGen
|
||||
MACHINING = 1
|
||||
SUPERVISOR = 2
|
||||
CONFIG = 3
|
||||
INPUTS = 4
|
||||
OUTPUTS = 5
|
||||
End Enum
|
||||
|
||||
' Abilitazioni licenza
|
||||
Friend Enum KEY_OPT As UInteger
|
||||
Public Enum KEY_OPT As UInteger
|
||||
BEAM = 1
|
||||
WALL = 2
|
||||
NESTING_AUTO = 4
|
||||
SUPERVISOR = 8
|
||||
NETWORK = 16
|
||||
ANY_DB = 32
|
||||
End Enum
|
||||
|
||||
' File di log generale
|
||||
Public Const GENLOG_FILE_NAME As String = "EgtBEAMWALLLog#.txt"
|
||||
Public Const VWOPTGENLOG_FILE_NAME As String = "EgtBEAMWALL.ViewerOptimizerLog#.txt"
|
||||
Public Const SUPGENLOG_FILE_NAME As String = "EgtBEAMWALL.SupervisorLog#.txt"
|
||||
|
||||
' Sottodirettorio di configurazione
|
||||
Public Const CONF_DIR As String = "Config"
|
||||
' Sottodirettorio delle risorse
|
||||
Public Const RES_DIR As String = "Resources"
|
||||
' Sottodirettorio temporaneo
|
||||
' Sottodirettorio temporaneo
|
||||
Public Const TEMP_DIR As String = "Temp"
|
||||
' Sottodirettorio per Cam automatico
|
||||
Public Const PROJS_DIR As String = "Projs"
|
||||
@@ -70,5 +75,9 @@ Module ConstGen
|
||||
Public Const TOOLMAKERS_DFL_DIR As String = "ToolMakers"
|
||||
' Nome file Lua con le funzioni di attrezzaggio
|
||||
Public Const SETUP_LUA As String = "SetUp.lua"
|
||||
' Nome eseguibile per stampa
|
||||
Public Const ZEBRAPRINTER_EXE As String = "ZebraPrinterUtilitiesD32.exe"
|
||||
' Sottodirettorio di default per macro
|
||||
Public Const MACRO_DFL_DIR As String = "Macro"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,162 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2015-2015
|
||||
'----------------------------------------------------------------------------
|
||||
' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
|
||||
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 12.02.15 DS Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
Public Module ConstIni
|
||||
|
||||
Public Const INI_FILE_NAME As String = "EgtBEAMWALL.ini"
|
||||
|
||||
'Public Const S_GENERAL As String = "General"
|
||||
'Public Const K_DEBUG As String = "Debug"
|
||||
'Public Const K_LICENCE As String = "Licence"
|
||||
'Public Const K_USERLEVEL As String = "UserLevel"
|
||||
'Public Const K_MAXINST As String = "MaxInstances"
|
||||
Public Const K_NETKEY As String = "NetKey"
|
||||
Public Const K_MAXCAMINST As String = "MaxCamInstances"
|
||||
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
|
||||
Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances"
|
||||
'Public Const K_COMMANDLOG As String = "CommandLog"
|
||||
'Public Const K_MESSAGESDIR As String = "MessagesDir"
|
||||
'Public Const K_MESSAGES As String = "Messages"
|
||||
'Public Const K_WINPLACE As String = "WinPlace"
|
||||
Public Const K_VIEWOPTIMWINPLACE As String = "ViewOptimWinPlace"
|
||||
Public Const K_SUPERVISORWINPLACE As String = "SupervisorWinPlace"
|
||||
'Public Const K_LASTPROJ As String = "LastProj"
|
||||
'Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
|
||||
Public Const K_LASTIMPDIR As String = "LastImpDir"
|
||||
Public Const K_LASTNGEXPDIR As String = "LastNgexpDir"
|
||||
Public Const K_LASTUPDATEDIR As String = "LastUpdateDir"
|
||||
Public Const K_PROJSINDEX As String = "ProjsIndex"
|
||||
Public Const K_PRODSINDEX As String = "ProdsIndex"
|
||||
'Public Const K_SUPPORT As String = "Support"
|
||||
Public Const K_DBADDRESS As String = "DbAddress"
|
||||
Public Const K_DBMASTERKEY As String = "DbMasterKey"
|
||||
Public Const K_SHAREDFOLDER As String = "SharedFolder"
|
||||
Public Const K_UPDATEBTL As String = "UpdateBtl"
|
||||
Public Const K_DATADIR As String = "DataDir"
|
||||
Public Const K_ENABLEEDIT As String = "EnableEdit"
|
||||
Public Const K_FASTPRODUCE As String = "FastProduce"
|
||||
Public Const K_ADDPROJ As String = "AddProj"
|
||||
|
||||
'Public Const S_LANGUAGES As String = "Languages"
|
||||
'Public Const K_LANGUAGE As String = "Language"
|
||||
|
||||
'Public Const S_LUA As String = "Lua"
|
||||
'Public Const K_LIBSDIR As String = "LibsDir"
|
||||
'Public Const K_BASELIB As String = "BaseLib"
|
||||
|
||||
'Public Const S_GEOMDB As String = "GeomDB"
|
||||
'Public Const K_DEFAULTFONT As String = "DefaultFont"
|
||||
'Public Const K_NFEFONTDIR As String = "NfeFontDir"
|
||||
'Public Const K_DEFAULTCOLOR As String = "DefaultColor"
|
||||
'Public Const K_SAVETYPE As String = "SaveType"
|
||||
|
||||
'Public Const S_OPENGL As String = "OpenGL"
|
||||
'Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
|
||||
'Public Const K_COLORBITS As String = "ColorBits"
|
||||
'Public Const K_DEPTHBITS As String = "DepthBits"
|
||||
'Public Const K_DRIVER As String = "Driver"
|
||||
|
||||
'Public Const S_SCENE As String = "Scene"
|
||||
'Public Const K_BACKTOP As String = "BackTop"
|
||||
'Public Const K_BACKBOTTOM As String = "BackBottom"
|
||||
'Public Const K_SHOWGFRAME As String = "ShowGFrame"
|
||||
'Public Const K_MARK As String = "Mark"
|
||||
'Public Const K_SELSURF As String = "SelSurf"
|
||||
'Public Const K_SHOWMODE As String = "ShowMode"
|
||||
Public Const K_SHOWBUILDING As String = "ShowBuilding"
|
||||
'Public Const K_CURVEDIR As String = "CurveDir"
|
||||
'Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
|
||||
'Public Const K_SHOWZMAP As String = "ShowZmap"
|
||||
'Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
|
||||
'Public Const K_ZOOMWIN As String = "ZoomWin"
|
||||
'Public Const K_DISTLINE As String = "DistLine"
|
||||
'Public Const K_MMUNITS As String = "MmUnits"
|
||||
|
||||
'Public Const S_GRID As String = "Grid"
|
||||
'Public Const K_SHOWGRID As String = "ShowGrid"
|
||||
'Public Const K_SHOWFRAME As String = "ShowFrame"
|
||||
'Public Const K_SNAPSTEP As String = "SnapStep"
|
||||
'Public Const K_SNAPSTEPINCH As String = "SnapStepInch"
|
||||
'Public Const K_MINLINESSTEP As String = "MinLineSStep"
|
||||
'Public Const K_MAJLINESSTEP As String = "MajLineSStep"
|
||||
'Public Const K_EXTSSTEP As String = "ExtSStep"
|
||||
'Public Const K_MINLNCOLOR As String = "MinLnColor"
|
||||
'Public Const K_MAJLNCOLOR As String = "MajLnColor"
|
||||
|
||||
Public Const S_IMPORT As String = "Import"
|
||||
Public Const K_BTLFLAG As String = "BtlFlag"
|
||||
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
|
||||
Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting"
|
||||
|
||||
'Public Const S_MACH As String = "Mach"
|
||||
'Public Const K_MACHINESDIR As String = "MachinesDir"
|
||||
'Public Const K_TOOLMAKERSDIR As String = "ToolMakersDir"
|
||||
'Public Const K_CURRMACH As String = "CurrMach"
|
||||
Public Const K_SUPERVISORMACH As String = "SupervisorMach"
|
||||
Public Const K_PASSWORD As String = "Password"
|
||||
Public Const K_CHANGEMACH As String = "ChangeMach"
|
||||
Public Const K_EXPORTBWE As String = "ExpBwe"
|
||||
|
||||
'Public Const S_SIMUL As String = "Simul"
|
||||
'Public Const K_SLIDERX As String = "SliderX"
|
||||
'Public Const K_SLIDERVAL As String = "SliderVal"
|
||||
|
||||
Public Const S_BEAM As String = "Beam"
|
||||
Public Const K_CALCPATH As String = "CalcPath"
|
||||
Public Const K_BEAMBASEDIR As String = "BaseDir"
|
||||
Public Const K_BEAMBWEEXEC As String = "BweExec"
|
||||
|
||||
Public Const S_WALL As String = "Wall"
|
||||
Public Const K_WALLBASEDIR As String = "BaseDir"
|
||||
Public Const K_WALLBWEEXEC As String = "BweExec"
|
||||
|
||||
Public Const S_MACHINELOGFILTER As String = "MachineLogFilters"
|
||||
Public Const K_PARTEVENTTYPE As String = "PartEventType"
|
||||
Public Const K_ENTITYTYPE As String = "EntityType"
|
||||
Public Const K_DAYTYPE As String = "DayType"
|
||||
Public Const K_STARTDATE As String = "StartDate"
|
||||
Public Const K_ENDDATE As String = "EndDate"
|
||||
|
||||
'Public Const S_NEST As String = "Nest"
|
||||
Public Const K_NESTEXEC As String = "NestExec"
|
||||
Public Const K_FLIPROT As String = "FlipRot"
|
||||
Public Const K_SECTIONTIME As String = "SectionTime"
|
||||
Public Const K_PARTTIME As String = "PartTime"
|
||||
Public Const K_RAWPARTDEF As String = "RawPartDefinition"
|
||||
Public Const K_MANUALNEST As String = "ManualNest"
|
||||
Public Const K_LDINTERSOTHER As String = "LDIntersOther"
|
||||
Public Const K_MINSCORE As String = "MinScore"
|
||||
|
||||
Public Const S_BEAMWALL As String = "BeamWall"
|
||||
Public Const K_BEAMWALLENABLE As String = "BtlEnable"
|
||||
Public Const K_BEAMWALLBASEDIR As String = "BaseDir"
|
||||
Public Const K_BEAMWALLBUTTON As String = "Button"
|
||||
|
||||
Public Const S_MRUPROJFILES As String = "MruProjFiles"
|
||||
Public Const S_MRUPRODFILES As String = "MruProdFiles"
|
||||
Public Const S_MRUSUPERVISORPRODFILES As String = "MruSupervisorProdFiles"
|
||||
|
||||
Public Const S_PRINTER As String = "Printer"
|
||||
Public Const K_LINK As String = "Link"
|
||||
Public Const K_ENABLE As String = "Enable"
|
||||
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
|
||||
Public Const K_TEMPLATE As String = "Template"
|
||||
|
||||
Public Const S_BEAM_LIST As String = "Beam_List"
|
||||
Public Const S_WALL_LIST As String = "Wall_List"
|
||||
|
||||
Public Const S_WAREHOUSE As String = "Warehouse"
|
||||
Public Const K_TYPE As String = "Type"
|
||||
Public Const K_DEFAULTQUANTITY As String = "DefaultQuantity"
|
||||
|
||||
End Module
|
||||
@@ -19,10 +19,14 @@
|
||||
SENDPROG = 10
|
||||
REMOVEPROG = 11
|
||||
REMOVEALLPROG = 12
|
||||
READ = 13
|
||||
READ_TPA = 13
|
||||
WRITE = 14
|
||||
DELETEALARMS = 15
|
||||
SETOP = 16
|
||||
SETOPMODE = 16
|
||||
READ_NUMFLEXIUM = 17
|
||||
STOPREAD_NUMFLEXIUM = 18
|
||||
MDI = 19
|
||||
SETCHANNEL = 20
|
||||
End Enum
|
||||
|
||||
Public Enum LogCommandTypes As Integer
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
Public Module ConstMachIni
|
||||
|
||||
Public Const MACH_INI_FILE_NAME As String = "MachData.ini"
|
||||
Public Const GETBEAMDATA_FILE_NAME As String = "GetBeamData.lua"
|
||||
Public Const GETWALLDATA_FILE_NAME As String = "GetWallData.lua"
|
||||
Public Const GETTS3DATA_FILE_NAME As String = "GetTs3Data.lua"
|
||||
|
||||
Public Const K_NCTYPE As String = "NCType"
|
||||
Public Const K_CONNECTIONSTRING As String = "ConnectionString"
|
||||
|
||||
Public Const S_CHANNELS As String = "Channels"
|
||||
|
||||
' Variables della macchina corrente
|
||||
Public Const S_MAINVARIABLES As String = "MainVariables"
|
||||
Public Const S_VARIABLES As String = "Variables"
|
||||
Public Const S_INPUTVARIABLES As String = "InputVariables"
|
||||
Public Const S_OUTPUTVARIABLES As String = "OutputVariables"
|
||||
Public Const S_MDI As String = "MDI"
|
||||
|
||||
Public Const K_BEAM As String = "Beam"
|
||||
Public Const K_WALL As String = "Wall"
|
||||
Public Const K_SCRIPT As String = "Scripts"
|
||||
Public Const K_SETUP As String = "Setup"
|
||||
Public Const K_FLOW As String = "Flow"
|
||||
|
||||
Public Const TS3DATA_FILE As String = "Ts3Data.lua"
|
||||
|
||||
End Module
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Module ConstMsg
|
||||
Public Module ConstMsg
|
||||
|
||||
Public Const MSG_SETUPERRORS As Integer = 5000 + 1470
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<AssemblyName>EgtBEAMWALL.Core</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
@@ -47,18 +47,17 @@
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EgtUILib, Version=2.3.4.3, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\EgtProg\Dll32\EgtUILib.dll</HintPath>
|
||||
<Reference Include="EgtUILib">
|
||||
<HintPath>..\ExtLibs\EgtUILib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtWPFLib5, Version=2.3.4.3, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\EgtProg\Dll32\EgtWPFLib5.dll</HintPath>
|
||||
<Reference Include="EgtWPFLib5">
|
||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml" />
|
||||
@@ -78,37 +77,49 @@
|
||||
<Import Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BeamM.vb" />
|
||||
<Compile Include="BTL ViewModel\BTLFeatureVM.vb" />
|
||||
<Compile Include="BTLViewModel\BTLFeatureVM.vb" />
|
||||
<Compile Include="CALCPanel\CalcEditEndEventArgs.vb" />
|
||||
<Compile Include="Constants\ConstColumns.vb" />
|
||||
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
|
||||
<Compile Include="Constants\ConstDims.vb" />
|
||||
<Compile Include="Constants\ConstGen.vb" />
|
||||
<Compile Include="Constants\ConstIni.vb" />
|
||||
<Compile Include="Constants\ConstMachComm.vb" />
|
||||
<Compile Include="Constants\ConstMachIni.vb" />
|
||||
<Compile Include="Constants\ConstMsg.vb" />
|
||||
<Compile Include="EgtDataGrid\EgtDataGrid.xaml.vb">
|
||||
<DependentUpon>EgtDataGrid.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EgtDataGrid\DataGridColumnsIniFile.vb" />
|
||||
<Compile Include="MachGroup Model\BeamMachGroupM.vb" />
|
||||
<Compile Include="CALCPanel\CalcProcessEndEventArgs.vb" />
|
||||
<Compile Include="CALCPanel\CalcResultEventArgs.vb" />
|
||||
<Compile Include="CALCPanel\CalcEndEventArgs.vb" />
|
||||
<Compile Include="CALCPanel\CalcIntegration.vb" />
|
||||
<Compile Include="DataAccess\PartAddedEventArgs.vb" />
|
||||
<Compile Include="DataAccess\BTLParamAddedEventArgs.vb" />
|
||||
<Compile Include="Lib\MachGroupAddedEventArgs.vb" />
|
||||
<Compile Include="Lib\MachGroupVM.vb" />
|
||||
<Compile Include="Lib\NewMachGroupPanelVM.vb" />
|
||||
<Compile Include="BTL Model\BTLFeatureM.vb" />
|
||||
<Compile Include="BTL Model\BTLParamM.vb" />
|
||||
<Compile Include="BTLModel\BTLFeatureM.vb" />
|
||||
<Compile Include="BTLModel\BTLParamM.vb" />
|
||||
<Compile Include="DataAccess\BTLFeatureAddedEventArgs.vb" />
|
||||
<Compile Include="DataAccess\BTLPartAddedEventArgs.vb" />
|
||||
<Compile Include="BTL Model\BTLPartM.vb" />
|
||||
<Compile Include="BTL Model\BTLStructureM.vb" />
|
||||
<Compile Include="BTLModel\BTLPartM.vb" />
|
||||
<Compile Include="BTLModel\BTLStructureM.vb" />
|
||||
<Compile Include="Constants\ConstBeam.vb" />
|
||||
<Compile Include="Enum.vb" />
|
||||
<Compile Include="MachGroupPanel\BeamMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\BeamVM.vb" />
|
||||
<Compile Include="LoadingWnd\LoadingWndHelper.vb" />
|
||||
<Compile Include="LoadingWnd\LoadingWndV.xaml.vb">
|
||||
<DependentUpon>LoadingWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LoadingWnd\LoadingWndVM.vb" />
|
||||
<Compile Include="Utility\DimensionsIniFile.vb" />
|
||||
<Compile Include="Utility\Enum.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\PartVM.vb" />
|
||||
<Compile Include="MachGroupPanel\WallMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\WallVM.vb" />
|
||||
<Compile Include="MachLog.vb" />
|
||||
<Compile Include="Utility\GridDimension.vb" />
|
||||
<Compile Include="Utility\LuaMsgManager.vb" />
|
||||
<Compile Include="Utility\MachLog.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -125,29 +136,31 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="MachGroup Model\MyMachGroupM.vb" />
|
||||
<Compile Include="MachGroupModel\MyMachGroupM.vb" />
|
||||
<Compile Include="Lib\MachGroupM.vb" />
|
||||
<Compile Include="Lib\MachGroupPanelM.vb" />
|
||||
<Compile Include="MachGroup Model\MyMachGroupPanelM.vb" />
|
||||
<Compile Include="MyMachine.vb" />
|
||||
<Compile Include="MachGroupModel\MyMachGroupPanelM.vb" />
|
||||
<Compile Include="Utility\ManageWindow.vb" />
|
||||
<Compile Include="Utility\MyMachine.vb" />
|
||||
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml.vb">
|
||||
<DependentUpon>OpenProjectFileDialogV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogVM.vb" />
|
||||
<Compile Include="PartM.vb" />
|
||||
<Compile Include="ProdFileM.vb" />
|
||||
<Compile Include="ProjectFileM.vb" />
|
||||
<Compile Include="MachGroupModel\PartM.vb" />
|
||||
<Compile Include="ProjectFileVM\ProdFileM.vb" />
|
||||
<Compile Include="ProjectFileVM\ProjectFileM.vb" />
|
||||
<Compile Include="ProjectManager\ProdFileVM.vb" />
|
||||
<Compile Include="ProjectManager\ProjectFileVM.vb" />
|
||||
<Compile Include="ProjectManager\ProjFileVM.vb" />
|
||||
<Compile Include="ProjFileM.vb" />
|
||||
<Compile Include="SectionXMaterial.vb" />
|
||||
<Compile Include="ProjectFileVM\ProjFileM.vb" />
|
||||
<Compile Include="Utility\SectionXMaterial.vb" />
|
||||
<Compile Include="Utility\BTLIniFile.vb" />
|
||||
<Compile Include="Utility\Command.vb" />
|
||||
<Compile Include="Utility\CoreMap.vb" />
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<Compile Include="WallM.vb" />
|
||||
<Compile Include="WallMachGroupM.vb" />
|
||||
<Compile Include="Utility\DisableModifiedMgr.vb" />
|
||||
<Compile Include="ViewPanel\ViewPanelV.xaml.vb">
|
||||
<DependentUpon>ViewPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewPanel\ViewPanelVM.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
@@ -173,10 +186,18 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="LoadingWnd\LoadingWndV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
||||
</Page>
|
||||
<Page Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ViewPanel\ViewPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
@@ -7,13 +8,14 @@ Public Module DataGridColumnsIniFile
|
||||
|
||||
Public m_sDataGridColumnsIniFile As String
|
||||
|
||||
' funzione per ottenere dal file INI le colonne da caricare nelle EgtDataGrid del programma
|
||||
Public Function GetPrivateProfileColumns(ParentDGName As String, ByRef ocColumns As ObservableCollection(Of EgtDataGridColumn)) As Boolean
|
||||
Dim colIndex As Integer = 0
|
||||
Dim str = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(ParentDGName, colIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 7 Then
|
||||
If sColumnParams.Count >= 9 Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
@@ -26,9 +28,12 @@ Public Module DataGridColumnsIniFile
|
||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||
Dim Width As Double
|
||||
Dim WidthType As DataGridLengthUnitType
|
||||
StringToDouble(sColumnParams(5), Width)
|
||||
StringToDoubleAdv(sColumnParams(5), Width)
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType)))
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
|
||||
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
@@ -39,4 +44,39 @@ Public Module DataGridColumnsIniFile
|
||||
Return WritePrivateProfileString(ParentDataGridName, DisplayIndex, sColumnParams, m_sDataGridColumnsIniFile)
|
||||
End Function
|
||||
|
||||
' funzione per ottenere dal file INI le colonne da caricare nelle EgtDataGrid del programma
|
||||
Public Function GetPrivateProfileColumn(ParentDGName As String, ByRef Column As EgtDataGridColumn) As Boolean
|
||||
Dim colIndex As Integer = 0
|
||||
Dim str = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(ParentDGName, colIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 9 Then
|
||||
If Column.Name = sColumnParams(0) Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
Next
|
||||
' creo colonna
|
||||
Dim sName = sColumnParams(0)
|
||||
Dim bReorder As Boolean = sColumnParams(1).Equals("1")
|
||||
Dim bResize As Boolean = sColumnParams(2).Equals("1")
|
||||
Dim bSort As Boolean = sColumnParams(3).Equals("1")
|
||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||
Dim Width As Double
|
||||
Dim WidthType As DataGridLengthUnitType
|
||||
StringToDoubleAdv(sColumnParams(5), Width)
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
|
||||
Column = New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection)
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
Return Not IsNothing(Column)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -2,11 +2,16 @@
|
||||
x:Name="CurrDataGrid"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<EventSetter Event="SizeChanged" Handler="Cell_SizedChanged" />
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Stretch" />
|
||||
<EventSetter Event="SizeChanged"
|
||||
Handler="Cell_SizedChanged" />
|
||||
<EventSetter Event="MouseRightButtonDown"
|
||||
Handler="Cell_MouseRightButtonDown" />
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
|
||||
@@ -1,12 +1,27 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Data
|
||||
Imports System.Windows.Controls.Primitives
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class EgtDataGrid
|
||||
|
||||
' vecchio indice da salvare per il Reorder delle colonne
|
||||
Public OldIndex As Integer = 0
|
||||
' indice header su cui è aperto il ContextMenu per gestione check/uncheck LockTable
|
||||
Private HeaderDispIndex As Integer = 0
|
||||
' somma delle larghezze delle colonne di EgtDataGrid
|
||||
Private columnsWidth As Double = 0
|
||||
|
||||
' larghezza minima dell'ultima colonna per attivare/disattivare ScrollBar orizzontale
|
||||
Private Const LASTCOLUMN_MINWIDTH As Double = 40
|
||||
|
||||
Sub New()
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
@@ -28,8 +43,8 @@ Public Class EgtDataGrid
|
||||
|
||||
If oldItems IsNot Nothing Then
|
||||
|
||||
For Index = 0 To oldItems.Count - 1
|
||||
Dim Column As DataGridColumn = context.FindResource(oldItems(Index))
|
||||
For index = 0 To oldItems.Count - 1
|
||||
Dim Column As DataGridColumn = context.FindResource(oldItems(index))
|
||||
context.Columns.Remove(Column)
|
||||
Next
|
||||
|
||||
@@ -40,10 +55,14 @@ Public Class EgtDataGrid
|
||||
|
||||
If newItems IsNot Nothing Then
|
||||
|
||||
For Index = 0 To newItems.Count - 1
|
||||
Dim col As DataGridColumn = context.FindResource(newItems(Index).Name)
|
||||
newItems(Index).InitColumn(col)
|
||||
context.Columns.Add(col)
|
||||
For index = 0 To newItems.Count - 1
|
||||
Try
|
||||
Dim col As DataGridColumn = context.FindResource(newItems(index).Name)
|
||||
newItems(index).InitColumn(col)
|
||||
context.Columns.Add(col)
|
||||
Catch ex As Exception
|
||||
MessageBox.Show(String.Format(EgtMsg(61883), newItems(index).Name, newItems(index).ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
End Try
|
||||
Next
|
||||
|
||||
AddHandler newItems.CollectionChanged, AddressOf context.collectionChanged
|
||||
@@ -57,12 +76,16 @@ Public Class EgtDataGrid
|
||||
If e.NewItems IsNot Nothing Then
|
||||
|
||||
For Each one As EgtDataGridColumn In e.NewItems
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(one.Name)
|
||||
one.InitColumn(col)
|
||||
CurrDataGrid.Columns.Insert(e.NewStartingIndex, col)
|
||||
If col.DisplayIndex <> e.NewStartingIndex Then
|
||||
CurrDataGrid.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex
|
||||
End If
|
||||
Try
|
||||
Dim col As DataGridColumn = CurrDataGrid.FindResource(one.Name)
|
||||
one.InitColumn(col)
|
||||
CurrDataGrid.Columns.Insert(e.NewStartingIndex, col)
|
||||
If col.DisplayIndex <> e.NewStartingIndex Then
|
||||
CurrDataGrid.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MessageBox.Show(String.Format(EgtMsg(61883), one.Name, one.ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
End Try
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -101,11 +124,134 @@ Public Class EgtDataGrid
|
||||
Private Sub Cell_SizedChanged(sender As Object, e As SizeChangedEventArgs)
|
||||
' ad ogni ridimensionamento della cella del ColumnHeader salvo le nuove dimensioni nell'ini
|
||||
If Not IsNothing(e.OriginalSource.Column) AndAlso Not IsNothing(BindingColumns(e.OriginalSource.Column.DisplayIndex)) Then
|
||||
BindingColumns(e.OriginalSource.Column.DisplayIndex).SaveDataGridColumn()
|
||||
' se la colonna corrente è Star ed è preceduta da una colonna Pixel non scrivo le modifiche
|
||||
If Not (e.OriginalSource.Column.Width.IsStar) Then
|
||||
BindingColumns(e.OriginalSource.Column.DisplayIndex).SaveDataGridColumn()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public OldIndex As Integer = 0
|
||||
Private Sub DataGrid_SizedChanged(sender As Object, e As SizeChangedEventArgs) Handles CurrDataGrid.SizeChanged
|
||||
' confronto la larghezza effettiva della EgtDataGrid con la somma delle larghezze delle colonne
|
||||
UpdateColumnsWidth()
|
||||
If BindingColumns.Count > 0 Then
|
||||
If CurrDataGrid.ActualWidth - LASTCOLUMN_MINWIDTH > columnsWidth Then
|
||||
' nascondo la ScrollBar orizzontale e setto lo UnitType dell'ultima colonna visibile a Star
|
||||
ScrollViewer.SetHorizontalScrollBarVisibility(CurrDataGrid, ScrollBarVisibility.Hidden)
|
||||
BindingColumns.Last(Function(x) x.Visible = True).Width = New DataGridLength(1, DataGridLengthUnitType.Star)
|
||||
Else
|
||||
' mostro la ScrollBar orizzontale e se UnitType delle colonne è Star lo setto a Pixel
|
||||
ScrollViewer.SetHorizontalScrollBarVisibility(CurrDataGrid, ScrollBarVisibility.Visible)
|
||||
For Each bc In BindingColumns
|
||||
If bc.Width.IsStar Then
|
||||
bc.Width = New DataGridLength(bc.ActualWidth, DataGridLengthUnitType.Pixel)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' scrivo nell'INI la Width dell'ultima colonna visibile
|
||||
BindingColumns.Last(Function(x) x.Visible = True).SaveDataGridColumn()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateColumnsWidth()
|
||||
' ricalcolo la somma delle larghezze delle colonne visibili
|
||||
columnsWidth = 0
|
||||
For Each col In BindingColumns
|
||||
If col.ColumnVisibility = Visibility.Visible Then
|
||||
columnsWidth += col.ActualWidth
|
||||
End If
|
||||
Next
|
||||
' alla somma calcolata tolgo la larghezza dell'ultima colonna visibile e aggiungo LASTCOLUMN_MINWIDTH
|
||||
' (in questo modo si attiva/disattiva la ScrollBar orizzontale non appena l'ultima colonna viene ristretta/estesa a LASTCOLUMN_MINWIDTH px)
|
||||
If BindingColumns.Count > 0 AndAlso
|
||||
BindingColumns.Any(Function(x) x.Visible = True) Then
|
||||
columnsWidth = columnsWidth - BindingColumns.Last(Function(x) x.Visible = True).ActualWidth + LASTCOLUMN_MINWIDTH
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Cell_MouseRightButtonDown(sender As Object, e As RoutedEventArgs)
|
||||
Dim nDispIndex As Integer = sender.DisplayIndex
|
||||
' creo il ContextMenu con gli item checkabili
|
||||
Dim cm As ContextMenu = New ContextMenu()
|
||||
Dim miReorder As MenuItem = New MenuItem()
|
||||
Dim miResize As MenuItem = New MenuItem()
|
||||
Dim miSort As MenuItem = New MenuItem()
|
||||
Dim sep1 As Separator = New Separator()
|
||||
Dim miVis As MenuItem = New MenuItem()
|
||||
Dim sep2 As Separator = New Separator()
|
||||
Dim miLock As MenuItem = New MenuItem()
|
||||
Dim miResetSort As MenuItem = New MenuItem()
|
||||
miReorder.Header = NameOf(EgtDataGridColumn.CanUserReorder)
|
||||
miResize.Header = NameOf(EgtDataGridColumn.CanUserResize)
|
||||
miSort.Header = NameOf(EgtDataGridColumn.CanUserSort)
|
||||
miVis.Header = "Columns Visibility"
|
||||
miLock.Header = "Lock Table"
|
||||
miResetSort.Header = "Reset Sort"
|
||||
miReorder.IsCheckable = True
|
||||
miResize.IsCheckable = True
|
||||
miSort.IsCheckable = True
|
||||
miLock.IsCheckable = True
|
||||
miResetSort.IsCheckable = False
|
||||
miReorder.StaysOpenOnClick = True
|
||||
miResize.StaysOpenOnClick = True
|
||||
miSort.StaysOpenOnClick = True
|
||||
miLock.StaysOpenOnClick = True
|
||||
miResetSort.StaysOpenOnClick = True
|
||||
' setto il binding
|
||||
Dim miReorderBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserReorder))
|
||||
Dim miResizeBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserResize))
|
||||
Dim miSortBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserSort))
|
||||
miReorderBinding.Mode = BindingMode.TwoWay
|
||||
miResizeBinding.Mode = BindingMode.TwoWay
|
||||
miSortBinding.Mode = BindingMode.TwoWay
|
||||
miReorder.DataContext = BindingColumns(nDispIndex)
|
||||
miResize.DataContext = BindingColumns(nDispIndex)
|
||||
miSort.DataContext = BindingColumns(nDispIndex)
|
||||
miReorder.SetBinding(MenuItem.IsCheckedProperty, miReorderBinding)
|
||||
miResize.SetBinding(MenuItem.IsCheckedProperty, miResizeBinding)
|
||||
miSort.SetBinding(MenuItem.IsCheckedProperty, miSortBinding)
|
||||
' setto check e enable associati a LockTable
|
||||
miLock.IsChecked = (GetPrivateProfileInt(BindingColumns(nDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile) > 0)
|
||||
miReorder.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserReorder)
|
||||
miResize.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserResize)
|
||||
miReorder.IsEnabled = Not miLock.IsChecked
|
||||
miResize.IsEnabled = Not miLock.IsChecked
|
||||
HeaderDispIndex = nDispIndex
|
||||
AddHandler miLock.Checked, AddressOf miLock_Checked
|
||||
AddHandler miLock.Unchecked, AddressOf miLock_Unchecked
|
||||
AddHandler miResetSort.Click, AddressOf miResetSort_Click
|
||||
' aggiungo i MenuItem al ContextMenu
|
||||
cm.Items.Add(miReorder)
|
||||
cm.Items.Add(miResize)
|
||||
cm.Items.Add(miSort)
|
||||
cm.Items.Add(sep1)
|
||||
cm.Items.Add(miVis)
|
||||
cm.Items.Add(sep2)
|
||||
cm.Items.Add(miLock)
|
||||
cm.Items.Add(miResetSort)
|
||||
' creo e aggiungo gli item figli di Columns Visibility
|
||||
For Each Column In BindingColumns
|
||||
Dim mi As MenuItem = New MenuItem()
|
||||
mi.Header = Column.Name
|
||||
mi.IsCheckable = True
|
||||
Dim miBinding As Binding = New Binding(NameOf(EgtDataGridColumn.Visible))
|
||||
miBinding.Mode = BindingMode.TwoWay
|
||||
mi.DataContext = Column
|
||||
mi.SetBinding(MenuItem.IsCheckedProperty, miBinding)
|
||||
mi.StaysOpenOnClick = True
|
||||
mi.IsEnabled = Column.CanUserEditVisible
|
||||
miVis.Items.Add(mi)
|
||||
Next
|
||||
' disabilito Columns Visibility se tutti i suoi figli sono disabilitati
|
||||
Dim bIsEnabled As Boolean = False
|
||||
For Each visMenuItem In miVis.Items
|
||||
bIsEnabled = visMenuItem.IsEnabled
|
||||
Next
|
||||
cm.Items(4).IsEnabled = bIsEnabled
|
||||
|
||||
cm.PlacementTarget = TryCast(sender, Button)
|
||||
cm.IsOpen = True
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_ColumnReordering(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordering
|
||||
' conservo il vecchio indice in modo da effettuare lo scambio in BindingColumns una volta riordinate graficamente
|
||||
@@ -125,6 +271,99 @@ Public Class EgtDataGrid
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub miLock_Checked(sender As Object, e As RoutedEventArgs)
|
||||
Dim miLock = DirectCast(sender, MenuItem)
|
||||
' disabilito Reorder e Resize di tutte le colonne salvandone prima il valore
|
||||
For Each Column In BindingColumns
|
||||
Column.OldCanUserReorder = Column.CanUserReorder
|
||||
Column.OldCanUserResize = Column.CanUserResize
|
||||
Column.CanUserReorder = False
|
||||
Column.CanUserResize = False
|
||||
Next
|
||||
' aggiorno il ContextMenu correntemente aperto
|
||||
Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
|
||||
Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
|
||||
miReorder.IsChecked = False
|
||||
miResize.IsChecked = False
|
||||
miReorder.IsEnabled = False
|
||||
miResize.IsEnabled = False
|
||||
' scrivo il valore di LockTable nell'INI
|
||||
WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 1, m_sDataGridColumnsIniFile)
|
||||
End Sub
|
||||
|
||||
Private Sub miLock_Unchecked(sender As Object, e As RoutedEventArgs)
|
||||
Dim miLock = DirectCast(sender, MenuItem)
|
||||
' abilito Reorder e Resize di tutte le colonne ripristinando il valore precedente, se presente
|
||||
For Each Column In BindingColumns
|
||||
If Not IsNothing(Column.OldCanUserReorder) Then Column.CanUserReorder = Column.OldCanUserReorder
|
||||
If Not IsNothing(Column.OldCanUserResize) Then Column.CanUserResize = Column.OldCanUserResize
|
||||
Next
|
||||
' aggiorno il ContextMenu correntemente aperto
|
||||
Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
|
||||
Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
|
||||
miReorder.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserReorder), BindingColumns(HeaderDispIndex).CanUserReorder, BindingColumns(HeaderDispIndex).OldCanUserReorder)
|
||||
miResize.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserResize), BindingColumns(HeaderDispIndex).CanUserResize, BindingColumns(HeaderDispIndex).OldCanUserResize)
|
||||
miReorder.IsEnabled = True
|
||||
miResize.IsEnabled = True
|
||||
' scrivo il valore di LockTable nell'INI
|
||||
WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile)
|
||||
End Sub
|
||||
|
||||
Private Sub miResetSort_Click(sender As Object, e As RoutedEventArgs)
|
||||
' resetto le SortDirection di tutte le colonne della datagrid
|
||||
ResetSortDirections()
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_Loaded(sender As Object, e As RoutedEventArgs) Handles CurrDataGrid.Loaded
|
||||
' setto la SortDirection, se attiva, sulla colonna su cui è attiva
|
||||
Dim colIndex As Integer = 0
|
||||
For Each col In BindingColumns
|
||||
If col.SortDirection > 0 Then
|
||||
CurrDataGrid.Items.SortDescriptions.Add(New SortDescription(CurrDataGrid.Columns(colIndex).SortMemberPath, col.SortDirection - 1))
|
||||
Exit For
|
||||
End If
|
||||
colIndex += 1
|
||||
Next
|
||||
' calcolo la somma delle larghezze delle colonne visibili
|
||||
For Each col In BindingColumns
|
||||
If col.ColumnVisibility = Visibility.Visible Then
|
||||
columnsWidth += col.ActualWidth
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_Sorting(sender As Object, e As DataGridSortingEventArgs) Handles CurrDataGrid.Sorting
|
||||
' salvo la SortDirection corrente della colonna prima di resettarla per tutte le colonne
|
||||
Dim CurrSortDirection As ListSortDirection? = e.Column.SortDirection
|
||||
ResetSortDirections(True)
|
||||
' ora applico la SortDirection corretta
|
||||
Select Case CurrSortDirection
|
||||
Case ListSortDirection.Ascending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 2 ' la setto a Descending
|
||||
Case ListSortDirection.Descending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la setto a Ascending
|
||||
Case Else
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la setto a Ascending
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ResetSortDirections(Optional bUserClick As Boolean = False)
|
||||
If bUserClick Then
|
||||
' nel caso di click dell'utente sulla colonna da sortare occorre solamente settare a 0 la SortDirection di tutte le colonne
|
||||
For Each column In BindingColumns
|
||||
column.SortDirection = 0
|
||||
Next
|
||||
Else
|
||||
' altrimenti (caso ResetSort da ContextMenu) è necessatio un Clear più ampio e anche grafico
|
||||
CurrDataGrid.Items.SortDescriptions.Clear()
|
||||
For Each column In BindingColumns
|
||||
column.SortDirection = 0
|
||||
' resetto graficamente anche l'header della colonna
|
||||
CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtDataGridColumn
|
||||
@@ -165,6 +404,12 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ActualWidth As Double
|
||||
Get
|
||||
Return m_dgColumn.ActualWidth
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property m_DisplayIndex As Integer
|
||||
Public Property DisplayIndex As Integer
|
||||
Get
|
||||
@@ -179,6 +424,7 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_OrigIsReadOnly As Boolean = True
|
||||
Private Property m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
@@ -190,10 +436,10 @@ Public Class EgtDataGridColumn
|
||||
Else
|
||||
m_IsReadOnly = value
|
||||
End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend OldCanUserReorder As Boolean?
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
@@ -209,6 +455,7 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend OldCanUserResize As Boolean?
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
@@ -239,18 +486,88 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Visible As Boolean
|
||||
Public Property Visible As Boolean
|
||||
Get
|
||||
Return m_Visible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Visible = value
|
||||
ColumnVisibility = If(m_Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ColumnVisibility As Visibility
|
||||
Public Property ColumnVisibility As Visibility
|
||||
Get
|
||||
Return If(m_Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_ColumnVisibility = value
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.Visibility = value
|
||||
' ricavo la EgtDataGrid a cui appartiene la DataGridColumn
|
||||
Dim propertyInfo As Reflection.PropertyInfo = m_dgColumn.GetType().GetProperty("DataGridOwner",
|
||||
Reflection.BindingFlags.Instance Or
|
||||
Reflection.BindingFlags.NonPublic)
|
||||
Dim dg As EgtDataGrid = propertyInfo.GetValue(m_dgColumn, Nothing)
|
||||
' ogni colonna visibile con UnitType a Star tranne l'ultima verrà settata a Pixel
|
||||
For Each bc In dg.BindingColumns
|
||||
If bc.Width.IsStar And Not bc.Name = dg.BindingColumns.Last(Function(x) x.Visible = True).Name Then
|
||||
bc.Width = New DataGridLength(bc.ActualWidth, DataGridLengthUnitType.Pixel)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserEditVisible As Boolean
|
||||
Public Property CanUserEditVisible As Boolean
|
||||
Get
|
||||
Return m_CanUserEditVisible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserEditVisible = value
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SortDirection As Forms.SortOrder = Forms.SortOrder.None
|
||||
Public Property SortDirection As Forms.SortOrder
|
||||
Get
|
||||
Return m_SortDirection 'If(IsNothing(m_dgColumn.SortDirection), 0, m_dgColumn.SortDirection + 1)
|
||||
End Get
|
||||
Set(value As Forms.SortOrder)
|
||||
'If Not IsNothing(m_dgColumn) Then
|
||||
' If value = 0 Then
|
||||
' m_dgColumn.SortDirection = Nothing
|
||||
' Else
|
||||
' m_dgColumn.SortDirection = value - 1
|
||||
' End If
|
||||
'Else
|
||||
m_SortDirection = value
|
||||
'End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sName As String)
|
||||
m_Name = sName
|
||||
End Sub
|
||||
|
||||
Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength)
|
||||
Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean, nSortDirection As Integer)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
m_CanUserResize = bCanUserResize
|
||||
m_CanUserSort = bCanUserSort
|
||||
m_OrigIsReadOnly = bIsReadOnly
|
||||
m_IsReadOnly = bIsReadOnly
|
||||
m_Width = Width
|
||||
m_Visible = bVisible
|
||||
m_CanUserEditVisible = bCanUserEditVisible
|
||||
m_SortDirection = nSortDirection
|
||||
End Sub
|
||||
|
||||
Friend Sub InitColumn(dgColumn As DataGridColumn)
|
||||
@@ -261,13 +578,19 @@ Public Class EgtDataGridColumn
|
||||
m_dgColumn.IsReadOnly = m_IsReadOnly
|
||||
'm_dgColumn.DisplayIndex = m_DisplayIndex
|
||||
m_dgColumn.Width = m_Width
|
||||
m_dgColumn.Visibility = m_ColumnVisibility
|
||||
If CInt(m_SortDirection) > 0 Then
|
||||
m_dgColumn.SortDirection = m_SortDirection - 1 'If(CInt(m_SortDirection) = 0, Nothing, m_SortDirection - 1)
|
||||
Else
|
||||
m_dgColumn.SortDirection = Nothing
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' funzione per calcolare e scrivere la stringa dei parametri della colonna nell'INI
|
||||
Public Function SaveDataGridColumn() As Boolean
|
||||
Dim bOk As Boolean
|
||||
Dim sColumnParams = String.Empty
|
||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType
|
||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(m_OrigIsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
|
||||
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
Public Enum CalcStates As Integer
|
||||
NOTCALCULATED = -1
|
||||
OK = 0
|
||||
INFO = 1
|
||||
WARNING = 2
|
||||
ERROR_ = 3
|
||||
End Enum
|
||||
|
||||
Public Enum EventType
|
||||
ND = -1
|
||||
Started = 0
|
||||
Ended = 1
|
||||
End Enum
|
||||
|
||||
Public Enum ItemState As Integer
|
||||
|
||||
ND = -1
|
||||
Assigned = 0
|
||||
Confirmed = 1
|
||||
WIP = 2
|
||||
Produced = 3
|
||||
Scrapped = 4
|
||||
End Enum
|
||||
|
||||
Public Enum LogSupportLevel
|
||||
ND = -1
|
||||
I = 0
|
||||
E = 1
|
||||
End Enum
|
||||
|
||||
Public Enum LogSupportTarget
|
||||
ND = -1
|
||||
Supervisor = 0
|
||||
LoadProject = 1
|
||||
End Enum
|
||||
|
||||
Public Enum StatusMapItemType
|
||||
ND = -1
|
||||
Prod = 0
|
||||
MachGroup = 1
|
||||
End Enum
|
||||
|
||||
Public Enum StatusMapOpType
|
||||
ND = -1
|
||||
Startup = 0
|
||||
PartStart = 1
|
||||
PartEnd = 2
|
||||
MachGroupAdd = 3
|
||||
MachGroupMod = 4
|
||||
MachGroupRem = 5
|
||||
MachGroupNeedRedo = 6
|
||||
|
||||
End Enum
|
||||
@@ -119,6 +119,7 @@ Public Class MachGroupPanelM
|
||||
#Region "METHODS"
|
||||
|
||||
Public Event MachGroupAdded As EventHandler(Of MachGroupAddedEventArgs)
|
||||
Public Event MachGroupRemoved As EventHandler(Of MachGroupAddedEventArgs)
|
||||
|
||||
Public Overridable Sub AddMachGroup(MachGroupM As MachGroupM)
|
||||
If IsNothing(MachGroupM) Then Return
|
||||
@@ -128,6 +129,13 @@ Public Class MachGroupPanelM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub RemoveMachGroup(MachGroupM As MachGroupM)
|
||||
If IsNothing(MachGroupM) Then Return
|
||||
If m_MachGroupMList.Contains(MachGroupM) AndAlso m_MachGroupMList.Remove(MachGroupM) Then
|
||||
RaiseEvent MachGroupRemoved(Me, New MachGroupAddedEventArgs(MachGroupM))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function GetMachGroups() As List(Of MachGroupM)
|
||||
Return New List(Of MachGroupM)(m_MachGroupMList)
|
||||
End Function
|
||||
|
||||
@@ -94,8 +94,6 @@ Public Class NewMachGroupPanelVM
|
||||
AddHandler m_MachGroupPanelM.MachGroupAdded, AddressOf OnMachGroupAdded
|
||||
If Not MachGroupPanelM.IsMultiMachGroup Then SetMachGroupPanelVisibility(False)
|
||||
CreateMachGroupVMList()
|
||||
' Creo riferimento a questa classe in LibMap
|
||||
'''LibMap.SetRefMachGroupPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -275,6 +273,7 @@ Public Class NewMachGroupPanelVM
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each MachGroupVM As MachGroupVM In e.OldItems
|
||||
RemoveHandler MachGroupVM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged
|
||||
m_MachGroupPanelM.MachGroupMList.Remove(MachGroupVM.MachGroupM)
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
Imports System.Threading
|
||||
Imports System.Windows.Threading
|
||||
|
||||
Public Module LoadingWndHelper
|
||||
|
||||
Public Enum ActiveIds As Integer
|
||||
OPENPROJ = 1
|
||||
SAVEPROJ = 2
|
||||
IMPORTBTL = 3
|
||||
GOTOPROD = 4
|
||||
OPENPROD = 5
|
||||
SAVEPROD = 6
|
||||
GOTOPROJ = 7
|
||||
EXPORTPROJECT = 8
|
||||
IMPORTPROJECT = 9
|
||||
CHANGEPARAM = 10
|
||||
CREATINGPDF = 11
|
||||
CHANGEMATERIAL = 12
|
||||
End Enum
|
||||
|
||||
Dim m_MainWindow As Windows.Window
|
||||
Public Sub SetMainWindow(MainWindow As Windows.Window)
|
||||
m_MainWindow = MainWindow
|
||||
End Sub
|
||||
|
||||
Private m_bMainWindow_IsActive As Boolean = True
|
||||
Public Sub SetMainWindowIsActive(IsActive As Boolean)
|
||||
m_bMainWindow_IsActive = IsActive
|
||||
End Sub
|
||||
|
||||
Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
|
||||
|
||||
Private m_thread As Thread
|
||||
Private m_LoadingWndVM As Core.LoadingWndVM
|
||||
Private m_CurrStep As Integer
|
||||
Private m_StepText As String
|
||||
Private m_nProgress As Integer
|
||||
Private m_nNextProgress As Integer
|
||||
Private m_bClose As Boolean
|
||||
Private m_bActiveId As Integer = -1
|
||||
|
||||
Public Function OpenLoadingWnd(Id As Integer, nSteps As Integer, TotText As String, FirstStepText As String, nNextProgress As Integer) As Boolean
|
||||
If m_bActiveId > 0 Then Return False
|
||||
m_bActiveId = Id
|
||||
m_LoadingWndVM = Nothing
|
||||
m_CurrStep = 1
|
||||
m_StepText = FirstStepText
|
||||
m_nProgress = 1
|
||||
m_nNextProgress = nNextProgress
|
||||
m_bClose = False
|
||||
Dim Top As Double = m_MainWindow.Top + (m_MainWindow.Height / 2) - 100
|
||||
Dim Left As Double = m_MainWindow.Left + (m_MainWindow.Width / 2) - 150
|
||||
Dim WindowStartupLocation As Windows.WindowStartupLocation = Windows.WindowStartupLocation.Manual
|
||||
If m_MainWindow.WindowState = Windows.WindowState.Maximized Then
|
||||
WindowStartupLocation = Windows.WindowStartupLocation.CenterOwner
|
||||
End If
|
||||
m_thread = New Thread(Sub()
|
||||
m_LoadingWndVM = New Core.LoadingWndVM(nSteps, TotText, AddressOf LoadingCallback)
|
||||
m_LoadingWndVM.UpdateProgress(m_CurrStep, m_StepText, m_nProgress, m_nNextProgress)
|
||||
Dim LoadingWnd As New LoadingWndV(Nothing, m_LoadingWndVM)
|
||||
' posiziono la finestra
|
||||
If WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen Then
|
||||
LoadingWnd.WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
|
||||
Else
|
||||
LoadingWnd.Top = Top
|
||||
LoadingWnd.Left = Left
|
||||
End If
|
||||
LoadingWnd.Show()
|
||||
Dispatcher.Run()
|
||||
End Sub)
|
||||
m_thread.SetApartmentState(ApartmentState.STA)
|
||||
m_thread.Start()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub LoadingCallback(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
|
||||
CurrStep = m_CurrStep
|
||||
StepText = m_StepText
|
||||
nProgress = m_nProgress
|
||||
nNextProgress = m_nNextProgress
|
||||
m_bMainWindow_IsActive = MainWindow_IsActive
|
||||
bClose = m_bClose
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateLoadingWnd(Id As Integer, CurrStep As Integer, StepText As String, nProgress As Integer, nNextProgress As Integer)
|
||||
If Id <> m_bActiveId Then Return
|
||||
m_CurrStep = CurrStep
|
||||
m_StepText = StepText
|
||||
m_nProgress = nProgress
|
||||
m_nNextProgress = nNextProgress
|
||||
End Sub
|
||||
|
||||
Public Sub CloseLoadingWnd(Id As Integer)
|
||||
If Id <> m_bActiveId Then Return
|
||||
m_bClose = True
|
||||
m_bActiveId = -1
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,56 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="LoadingWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Height="200" Width="300"
|
||||
TitleBarHeight="0"
|
||||
ResizeMode="NoResize" WindowStyle="None"
|
||||
IsClosable="False" IsMinimizable="False"
|
||||
WindowStartupLocation="Manual" ShowInTaskbar="False">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding TotText_Msg}"
|
||||
TextAlignment="Center"/>
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding StepText_Msg}"
|
||||
TextAlignment="Center"
|
||||
Visibility="{Binding StepText_Visibility}"/>
|
||||
<Grid Grid.Row="3"
|
||||
Visibility="{Binding StepProgress_Visibility}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Height="20"/>
|
||||
<ProgressBar Grid.Row="1"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="{Binding StepProgress_Value}"
|
||||
Height="20"
|
||||
Margin="40,0,40,0"/>
|
||||
</Grid>
|
||||
<ProgressBar Grid.Row="5"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="{Binding TotProgress_Value}"
|
||||
Height="20"
|
||||
Margin="40,0,40,0"/>
|
||||
<TextBlock Grid.Row="7"
|
||||
Text="{Binding TotProgress_Msg}"
|
||||
TextAlignment="Center"/>
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,36 @@
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
|
||||
Public Class LoadingWndV
|
||||
|
||||
Private WithEvents m_LoadingWndVM As LoadingWndVM
|
||||
|
||||
Sub New(Owner As Window, LoadingWndVM As LoadingWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = LoadingWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_LoadingWndVM = LoadingWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_LoadingWndVM.m_CloseWindow
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub ActivateWindow() Handles m_LoadingWndVM.m_ActivateWindow
|
||||
Me.Activate()
|
||||
End Sub
|
||||
|
||||
Private Sub Me_ContentRendered() Handles Me.ContentRendered
|
||||
m_LoadingWndVM.StartFunction()
|
||||
End Sub
|
||||
|
||||
Private Sub ToolsDbView_Closing(sender As Object, e As ComponentModel.CancelEventArgs) Handles Me.Closing
|
||||
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
|
||||
e.Cancel = True
|
||||
Return
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,233 @@
|
||||
Imports System.Timers
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class LoadingWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Enum LoadingTypes As Integer
|
||||
NULL = 0
|
||||
OPEN = 1
|
||||
IMPORT = 2
|
||||
End Enum
|
||||
|
||||
Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
Friend Event m_ActivateWindow()
|
||||
|
||||
Private m_CallbackLoading As CallbackLoadingDlg
|
||||
Private m_Waiting_Timer As New DispatcherTimer
|
||||
|
||||
' numero di passaggi di caricamento
|
||||
Private m_nSteps As Integer
|
||||
' titolo testo di caricamento
|
||||
Private m_TotText As String
|
||||
' numero passaggio corrente
|
||||
Private m_CurrStep As Integer
|
||||
' testo del passaggio corrente
|
||||
Private m_StepText As String
|
||||
' indice d'inizio di questo passaggio
|
||||
Private m_nStartProgress As Integer
|
||||
' indice d'inizio del prossimo passaggio
|
||||
Private m_nNextProgress As Integer
|
||||
' variabile che indica richiesta chiusura della finestra
|
||||
Private m_bClosing As Boolean = False
|
||||
Private m_bMainWindow_IsActive As Boolean = True
|
||||
|
||||
Private m_StepProgress_Value As Double = 0
|
||||
Public Property StepProgress_Value As Double
|
||||
Get
|
||||
Return m_StepProgress_Value
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_StepProgress_Value = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_TotProgress_Value As Double = 0
|
||||
Public Property TotProgress_Value As Double
|
||||
Get
|
||||
Return Math.Floor(m_TotProgress_Value)
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_TotProgress_Value = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_StepText_Visibility As Visibility
|
||||
Public ReadOnly Property StepText_Visibility As Visibility
|
||||
Get
|
||||
Return m_StepText_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_StepProgress_Visibility As Visibility
|
||||
Public ReadOnly Property StepProgress_Visibility As Visibility
|
||||
Get
|
||||
Return m_StepProgress_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property TotText_Msg As String
|
||||
Get
|
||||
Return If(m_nSteps > 0, m_TotText & " (" & m_CurrStep & "/" & m_nSteps & ")", m_TotText)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property StepText_Msg As String
|
||||
Get
|
||||
Return m_StepText
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TotProgress_Msg As String
|
||||
Get
|
||||
Return m_TotProgress_Value.ToString("0.#") & "%"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
Sub New(Steps As Integer, TotText As String, callback As CallbackLoadingDlg)
|
||||
m_nSteps = Steps
|
||||
m_TotText = TotText
|
||||
m_CallbackLoading = callback
|
||||
m_bClosing = False
|
||||
If Steps = 1 Then
|
||||
m_StepText_Visibility = Visibility.Collapsed
|
||||
m_StepProgress_Visibility = Visibility.Collapsed
|
||||
Else
|
||||
m_StepText_Visibility = Visibility.Visible
|
||||
m_StepProgress_Visibility = Visibility.Visible
|
||||
End If
|
||||
' imposto contatore
|
||||
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(200)
|
||||
AddHandler m_Waiting_Timer.Tick, AddressOf WaitingTimer_Tick
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateProgress(CurrStep As Integer, StepText As String, nStartProgress As Integer, nNextProgress As Integer)
|
||||
m_CurrStep = CurrStep
|
||||
m_StepText = StepText
|
||||
m_StepProgress_Value = nStartProgress
|
||||
m_nNextProgress = nNextProgress
|
||||
NotifyPropertyChanged(NameOf(StepText_Msg))
|
||||
NotifyPropertyChanged(NameOf(TotText_Msg))
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub StartFunction()
|
||||
m_Waiting_Timer.Start()
|
||||
End Sub
|
||||
|
||||
Protected Overridable Sub WaitingTimer_Tick()
|
||||
' leggo eventuali nuovi valori
|
||||
Dim CurrStep As Integer = 0
|
||||
Dim StepText As String = ""
|
||||
Dim nStartProgress As Integer = 0
|
||||
Dim nNextProgress As Integer = 0
|
||||
Dim bMainWindow_IsActive As Boolean = True
|
||||
Dim bClose As Boolean = False
|
||||
m_CallbackLoading(CurrStep, StepText, nStartProgress, nNextProgress, bMainWindow_IsActive, bClose)
|
||||
If bMainWindow_IsActive <> m_bMainWindow_IsActive Then
|
||||
RaiseEvent m_ActivateWindow()
|
||||
End If
|
||||
If m_bClosing Then
|
||||
Close()
|
||||
Dispatcher.CurrentDispatcher.InvokeShutdown()
|
||||
Return
|
||||
ElseIf bClose Then
|
||||
m_bClosing = True
|
||||
' mostro completamento caricamento
|
||||
m_CurrStep = m_nSteps
|
||||
m_StepProgress_Value = 100
|
||||
m_TotProgress_Value = 100
|
||||
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||
Else
|
||||
If m_CurrStep <> CurrStep Then
|
||||
If m_StepProgress_Value < 100 Then
|
||||
m_StepProgress_Value = 100
|
||||
ElseIf m_StepProgress_Value = 100 Then
|
||||
m_StepProgress_Value = 0
|
||||
m_CurrStep = CurrStep
|
||||
m_StepText = StepText
|
||||
m_nStartProgress = nStartProgress
|
||||
m_nNextProgress = nNextProgress
|
||||
End If
|
||||
Else
|
||||
' incremento Step corrente
|
||||
If m_StepProgress_Value < 80 Then
|
||||
m_StepProgress_Value += 1
|
||||
ElseIf m_StepProgress_Value < 90 Then
|
||||
m_StepProgress_Value += 0.4
|
||||
ElseIf m_StepProgress_Value < 98 Then
|
||||
m_StepProgress_Value += 0.1
|
||||
Else
|
||||
m_StepProgress_Value += 0.01
|
||||
End If
|
||||
End If
|
||||
' calcolo totale
|
||||
Dim dStepStart As Double = If(m_CurrStep > 1, m_nStartProgress, 0)
|
||||
Dim dStepEnd As Double = m_nNextProgress
|
||||
m_TotProgress_Value = dStepStart + ((dStepEnd - dStepStart) / 100 * m_StepProgress_Value)
|
||||
End If
|
||||
' aggiorno grafica
|
||||
NotifyPropertyChanged(NameOf(StepText_Msg))
|
||||
NotifyPropertyChanged(NameOf(TotText_Msg))
|
||||
NotifyPropertyChanged(NameOf(StepProgress_Value))
|
||||
NotifyPropertyChanged(NameOf(TotProgress_Value))
|
||||
NotifyPropertyChanged(NameOf(TotProgress_Msg))
|
||||
End Sub
|
||||
|
||||
Public Sub Close()
|
||||
' fermo timer
|
||||
m_Waiting_Timer.Stop()
|
||||
' chiudo finestra
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Open.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Cancel_Command As ICommand
|
||||
Get
|
||||
If m_cmdCancel Is Nothing Then
|
||||
m_cmdCancel = New Command(AddressOf Cancel)
|
||||
End If
|
||||
Return m_cmdCancel
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub Cancel()
|
||||
'' chiedo conferma
|
||||
'If MessageBox.Show("Are you sure you want to stop the nesting?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then Return
|
||||
'' fermo il nesting
|
||||
'Map.refOptimizePanelVM.m_StopNesting = True
|
||||
'' fermo timer e chiudo finestra
|
||||
'CloseNesting()
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -1,332 +0,0 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class MyMachGroupM
|
||||
Inherits MachGroupM
|
||||
|
||||
Protected m_nMachineType As MachineType
|
||||
Public ReadOnly Property nMachineType As MachineType
|
||||
Get
|
||||
Return m_nMachineType
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetMachineType(nMachineType As MachineType)
|
||||
m_nMachineType = nMachineType
|
||||
End Sub
|
||||
|
||||
Protected m_dL As Double
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return m_dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dW As Double
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return m_dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dH As Double
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return m_dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dtStartTime As DateTime
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return m_dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_dtStartTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dtEndTime As DateTime
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return m_dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_dtEndTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dMatForPart As Double = 0
|
||||
Public ReadOnly Property dMatForPart As Double
|
||||
Get
|
||||
Return m_dMatForPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_nProdIndex As Integer = 0
|
||||
Public Property nProdIndex As Integer
|
||||
Get
|
||||
Return m_nProdIndex
|
||||
End Get
|
||||
Set
|
||||
m_nProdIndex = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub SetMatForPart(dMatForPart As Double)
|
||||
m_dMatForPart = dMatForPart
|
||||
End Sub
|
||||
|
||||
Protected m_dTotMat As Double = 0
|
||||
Public ReadOnly Property dTotMat As Double
|
||||
Get
|
||||
Return m_dTotMat
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetTotMat(TotMat As Double)
|
||||
m_dTotMat = TotMat
|
||||
End Sub
|
||||
|
||||
Protected m_sMATERIAL As String
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei pezzi che sono nel grezzo
|
||||
Protected m_PartMList As New List(Of PartM)
|
||||
Public Property PartMList As List(Of PartM)
|
||||
Get
|
||||
Return m_PartMList
|
||||
End Get
|
||||
Set(value As List(Of PartM))
|
||||
m_PartMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_ERR As Integer
|
||||
Public Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_nCALC_ERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_FALL As Integer
|
||||
Public Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return m_nCALC_FALL
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_FALL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sCALC_MSG As String
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_nCALC_ROT As Integer
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_nCALC_TIME As Integer
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return m_nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_nCALC_GlobalState As CalcStates = CalcStates.NOTCALCULATED
|
||||
Public Property nCALC_GlobalState As CalcStates
|
||||
Get
|
||||
Return m_nCALC_GlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nCALC_GlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_GlobalERR As Integer
|
||||
Public Property nCALC_GlobalERR As Integer
|
||||
Get
|
||||
Return m_nCALC_GlobalERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_GlobalERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_nCALC_State As CalcStates = CalcStates.NOTCALCULATED
|
||||
Public Property nCALC_State As CalcStates
|
||||
Get
|
||||
Return m_nCALC_State
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nCALC_State = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sSupervisorId As String
|
||||
Public Property sSupervisorId As String
|
||||
Get
|
||||
Return m_sSupervisorId
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sSupervisorId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nPriorityIndex As Integer
|
||||
Public Property nPriorityIndex As Integer
|
||||
Get
|
||||
Return m_nPriorityIndex
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPriorityIndex = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nProductionState As Integer = 0
|
||||
Public ReadOnly Property nProductionState As Integer
|
||||
Get
|
||||
Return m_nProductionState
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetState(nState As CalcStates)
|
||||
m_nProductionState = nState
|
||||
End Sub
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
'Sub New(nId As Integer, sName As String, sMachine As String)
|
||||
' MyBase.New(nId, sName, sMachine)
|
||||
' 'aggiorno lista pezzi
|
||||
' RefreshPartList()
|
||||
'End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public Event PartAdded As EventHandler(Of PartAddedEventArgs)
|
||||
Public Event PartRemoved As EventHandler(Of PartAddedEventArgs)
|
||||
|
||||
Public Sub AddPart(PartM As PartM)
|
||||
If IsNothing(PartM) Then Return
|
||||
If Not m_PartMList.Contains(PartM) Then
|
||||
m_PartMList.Add(PartM)
|
||||
RaiseEvent PartAdded(Me, New PartAddedEventArgs(PartM))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub RemovePart(PartM As PartM)
|
||||
If IsNothing(PartM) Then Return
|
||||
If m_PartMList.Contains(PartM) AndAlso m_PartMList.Remove(PartM) Then
|
||||
RaiseEvent PartRemoved(Me, New PartAddedEventArgs(PartM))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub RemoveAllParts()
|
||||
If IsNothing(m_PartMList) Then Return
|
||||
For PartIndex = m_PartMList.Count - 1 To 0 Step -1
|
||||
Dim PartM As PartM = m_PartMList(PartIndex)
|
||||
If m_PartMList.Remove(PartM) Then
|
||||
RaiseEvent PartRemoved(Me, New PartAddedEventArgs(PartM))
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Function GetParts() As List(Of PartM)
|
||||
Return New List(Of PartM)(m_PartMList)
|
||||
End Function
|
||||
|
||||
Public Shared Sub ReadMachGroupData(NewMachgroup As MyMachGroupM)
|
||||
' leggo materiale
|
||||
EgtGetInfo(NewMachgroup.Id, MGR_RPT_MATERIAL, NewMachgroup.sMATERIAL)
|
||||
' leggo calc error
|
||||
Dim nErr As Integer = 0
|
||||
Dim nRot As Integer = 0
|
||||
Dim nFall As Integer = 0
|
||||
Dim sMsg As String = ""
|
||||
Dim bCalc As Boolean = False
|
||||
bCalc = EgtGetInfo(NewMachgroup.Id, ITG_PROD_ERR, nErr)
|
||||
EgtGetInfo(NewMachgroup.Id, ITG_PROD_ROT, nRot)
|
||||
EgtGetInfo(NewMachgroup.Id, ITG_PROD_MSG, sMsg)
|
||||
If Not bCalc Then
|
||||
NewMachgroup.m_nCALC_State = CalcStates.NOTCALCULATED
|
||||
NewMachgroup.m_nCALC_ERR = 0
|
||||
NewMachgroup.m_nCALC_ROT = 0
|
||||
NewMachgroup.m_sCALC_MSG = ""
|
||||
Else
|
||||
NewMachgroup.m_nCALC_ERR = nErr
|
||||
NewMachgroup.m_nCALC_ROT = nRot
|
||||
NewMachgroup.m_sCALC_MSG = sMsg
|
||||
If nErr = 0 Then
|
||||
NewMachgroup.nCALC_State = CalcStates.OK
|
||||
ElseIf nErr = 17 Then
|
||||
NewMachgroup.nCALC_State = CalcStates.WARNING
|
||||
ElseIf nErr > 0 Then
|
||||
NewMachgroup.nCALC_State = CalcStates.ERROR_
|
||||
ElseIf nErr < 0 Then
|
||||
NewMachgroup.nCALC_State = CalcStates.INFO
|
||||
End If
|
||||
End If
|
||||
EgtGetInfo(NewMachgroup.Id, ITG_PROD_TIME, NewMachgroup.m_nCALC_TIME)
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
Public MustOverride Sub RefreshPartList()
|
||||
|
||||
Public MustOverride Sub RefreshGroupData()
|
||||
|
||||
Public Overridable Sub DeleteMachGroup()
|
||||
' elimino tutte le copie
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
EgtRemovePartFromRawPart(nBeamId)
|
||||
EgtErase(nBeamId)
|
||||
nRawPartId = EgtGetNextRawPart(nRawPartId)
|
||||
nBeamId = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
End While
|
||||
' elimino MachGroup
|
||||
EgtRemoveMachGroup(Me.Id)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,221 +0,0 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MyMachGroupPanelM
|
||||
Inherits MachGroupPanelM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Public Shared Function CreateMyMachGroupPanel(MachineList As List(Of Machine)) As MachGroupPanelM
|
||||
Dim NewMyMachGroupPanelM As New MyMachGroupPanelM
|
||||
NewMyMachGroupPanelM.m_IsMultiMachGroup = False
|
||||
' Assegno nome base
|
||||
NewMyMachGroupPanelM.m_BaseName = ""
|
||||
' Recupero lista macchine
|
||||
NewMyMachGroupPanelM.m_MachineList = MachineList
|
||||
' Assegno macchina di default
|
||||
NewMyMachGroupPanelM.m_DefaultMachine = ""
|
||||
' aggiorno copie
|
||||
UpdateDuplo()
|
||||
' recupero i MachGroup
|
||||
NewMyMachGroupPanelM.m_MachGroupMList = LoadMyMachGroups(MachineList)
|
||||
Return NewMyMachGroupPanelM
|
||||
End Function
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public Shared Function LoadMyMachGroups(MachineList As List(Of Machine)) As List(Of MachGroupM)
|
||||
Dim TempList As New List(Of MachGroupM)
|
||||
' Carico i gruppi di lavorazione nella lista
|
||||
Dim nId = EgtGetFirstMachGroup()
|
||||
While nId <> GDB_ID.NULL
|
||||
EgtSetCurrMachGroup(nId)
|
||||
Dim sName As String = String.Empty
|
||||
Dim sMachine As String = String.Empty
|
||||
EgtGetMachGroupName(nId, sName)
|
||||
EgtGetMachGroupMachineName(nId, sMachine)
|
||||
' cerco la macchina tra quelle presenti
|
||||
Dim UsedMachine As MyMachine = Nothing
|
||||
Dim bOk As Boolean = Machine.SearchMachine(sMachine, MachineList, UsedMachine)
|
||||
If Not bOk OrElse UsedMachine.nType = MachineType.NULL Then
|
||||
EgtOutLog("Machine incompatible with beam & wall machining!!")
|
||||
ElseIf UsedMachine.nType = MachineType.BEAM Then
|
||||
TempList.Add(BeamMachGroupM.CreateBeamMachGroup(nId, sName, sMachine))
|
||||
ElseIf UsedMachine.nType = MachineType.WALL Then
|
||||
TempList.Add(WallMachGroupM.CreateWallMachGroup(nId, sName, sMachine))
|
||||
End If
|
||||
nId = EgtGetNextMachGroup(nId)
|
||||
End While
|
||||
EgtResetCurrMachGroup()
|
||||
Return TempList
|
||||
End Function
|
||||
|
||||
' funzione che aggiunge solo i gruppi di lavorazione creati nel nesting
|
||||
Public Shared Function UpdateFromNestingMyMachGroups(MachineList As List(Of Machine)) As List(Of MachGroupM)
|
||||
Dim TempList As New List(Of MachGroupM)
|
||||
' Carico i gruppi di lavorazione nella lista
|
||||
Dim nId = EgtGetFirstMachGroup()
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim UpdateUI As Integer = 0
|
||||
If EgtGetInfo(nId, "UPDATEUI", UpdateUI) AndAlso UpdateUI = 1 Then
|
||||
EgtSetCurrMachGroup(nId)
|
||||
Dim sName As String = String.Empty
|
||||
Dim sMachine As String = String.Empty
|
||||
EgtGetMachGroupName(nId, sName)
|
||||
EgtGetMachGroupMachineName(nId, sMachine)
|
||||
' cerco la macchina tra quelle presenti
|
||||
Dim UsedMachine As MyMachine = Nothing
|
||||
Dim bOk As Boolean = Machine.SearchMachine(sMachine, MachineList, UsedMachine)
|
||||
If Not bOk OrElse UsedMachine.nType = MachineType.NULL Then
|
||||
EgtOutLog("Machine incompatible with beam & wall machining!!")
|
||||
ElseIf UsedMachine.nType = MachineType.BEAM Then
|
||||
TempList.Add(BeamMachGroupM.CreateBeamMachGroup(nId, sName, sMachine))
|
||||
ElseIf UsedMachine.nType = MachineType.WALL Then
|
||||
TempList.Add(WallMachGroupM.CreateWallMachGroup(nId, sName, sMachine))
|
||||
End If
|
||||
' rimuovo info
|
||||
EgtRemoveInfo(nId, "UPDATEUI")
|
||||
End If
|
||||
nId = EgtGetNextMachGroup(nId)
|
||||
End While
|
||||
EgtResetCurrMachGroup()
|
||||
Return TempList
|
||||
End Function
|
||||
|
||||
Public Function NewMyMachGroup(sMachName As String, nMachineType As MachineType) As MachGroupM
|
||||
' Sistemazioni preliminari
|
||||
OnPreNewMachGroup()
|
||||
' Se non ci sono macchine disponibili esco con errore
|
||||
If m_MachineList.Count <= 0 Then Return Nothing
|
||||
' Creo il nuovo gruppo di lavorazione con i dati ottenuti a seconda del caso in cui mi trovo
|
||||
Dim MachGroupM As MachGroupM
|
||||
If nMachineType = MachineType.NULL Then
|
||||
EgtOutLog("Machine incompatible with beam & wall machining!!")
|
||||
Return Nothing
|
||||
ElseIf nMachineType = MachineType.BEAM Then
|
||||
MachGroupM = BeamMachGroupM.CreateBeamMachGroup(NewMachGroupID(), sMachName)
|
||||
ElseIf nMachineType = MachineType.WALL Then
|
||||
MachGroupM = WallMachGroupM.CreateWallMachGroup(NewMachGroupID(), sMachName)
|
||||
End If
|
||||
If IsNothing(MachGroupM) Then Return Nothing
|
||||
AddMachGroup(MachGroupM)
|
||||
' Sistemazioni finali
|
||||
m_DefaultMachine = sMachName
|
||||
OnPostNewMachGroup()
|
||||
Return MachGroupM
|
||||
End Function
|
||||
|
||||
Public Overrides Function OnPreNewMachGroup() As Boolean
|
||||
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' NB: Anche se ho già aggiunto il nuovo gruppo di lavorazione, non l'ho ancora reso corrente (viene fatto dopo), quindi
|
||||
' non posso usare CurrentMachine perchè è ancora impostata quella precedente!!!
|
||||
Public Overrides Function OnPostNewMachGroup() As Boolean
|
||||
' Salvo macchina del gruppo come nuovo default
|
||||
Dim sCurrMachName As String = String.Empty
|
||||
EgtGetCurrMachineName(sCurrMachName)
|
||||
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, sCurrMachName)
|
||||
'' leggo nome attrezzaggio di default
|
||||
'Dim sDefaultSetUpName As String = String.Empty
|
||||
'Dim sMachineIniPath As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sCurrMachName & "\" & sCurrMachName & ".ini"
|
||||
'EgtUILib.GetPrivateProfileString(S_SETUP, K_DEFAULT, "", sDefaultSetUpName, sMachineIniPath)
|
||||
'' se è attiva l'opzione, rendo corrente l'attrezzaggio di default
|
||||
'If Not String.IsNullOrEmpty(sDefaultSetUpName) Then
|
||||
' If Not EgtImportSetup(sDefaultSetUpName) Then
|
||||
' EgtOutLog("Error loading default setup " & sDefaultSetUpName)
|
||||
' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 9) & " " & sDefaultSetUpName, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
' End If
|
||||
'End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Overrides Function OnPreRemoveCurrMachGroup() As Boolean
|
||||
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function NewMachGroupID() As Integer
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(MachGroupMList) AndAlso MachGroupMList.Count > 0 Then Return MachGroupMList.Select(Of Integer)(Function(x) If(Integer.TryParse(x.Name, nTemp), nTemp, 0)).Max() + 1
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
' funzione che fa l'update di tutte le copie dei pezzi modificati
|
||||
Public Shared Sub UpdateDuplo()
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim bIsModified As Boolean = False
|
||||
If EgtDuploGetModified(nPartId, bIsModified) AndAlso bIsModified Then
|
||||
EgtDuploUpdate(nPartId)
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
' funzione che cancella tutti i pezzi segnati da eliminare
|
||||
Public Shared Sub DeleteDuplo()
|
||||
' reset necessario per poter accedere direttamente al grezzo dalle info pezzo e al MachGroup tramite la gerarchia Db geometrico
|
||||
EgtResetCurrMachGroup()
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim bIsToDelete As Boolean = False
|
||||
If DuploGetToDelete(nPartId, bIsToDelete) AndAlso bIsToDelete Then
|
||||
' verifico se ci sono copie
|
||||
Dim nDuploCount As Integer = 0
|
||||
EgtDuploCount(nPartId, nDuploCount)
|
||||
Dim DuploList As New List(Of Integer)
|
||||
If nDuploCount > 0 AndAlso EgtDuploList(nPartId, DuploList) Then
|
||||
' cancello tutti i pezzi copia nelle barre
|
||||
For Each nDuploId In DuploList
|
||||
' recupero grezzo cui appartiene
|
||||
Dim nRawPartId As Integer
|
||||
EgtGetInfo(nDuploId, "!LST", nRawPartId)
|
||||
' recupero gruppo di lavorazione
|
||||
Dim nMachGroupId As Integer = EgtGetParent(EgtGetParent(EgtGetParent(nRawPartId)))
|
||||
' lo setto come corrente
|
||||
EgtSetCurrMachGroup(nMachGroupId)
|
||||
' elimino pezzo copia
|
||||
EgtRemovePartFromRawPart(nDuploId)
|
||||
EgtErase(nDuploId)
|
||||
'' recupero gruppo di lavorazione e trave dell'interfaccia
|
||||
'Dim BeamMachGroup As BeamMachGroupM = MachGroupMList.FirstOrDefault(Function(x) x.Id = nMachGroupId)
|
||||
'Dim Beam As BeamM = BeamMachGroup.PartMList.FirstOrDefault(Function(x) x.nPartId = nDuploId)
|
||||
'EgtSetCurrMachGroup(BeamMachGroup.Id)
|
||||
'''Beam.DeletePart()
|
||||
Next
|
||||
End If
|
||||
DuploResetToDelete(nPartId)
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
EgtResetCurrMachGroup()
|
||||
End Sub
|
||||
|
||||
Friend Shared Function DuploGetToDelete(nSouId As Integer, ByRef bToDelete As Boolean) As Boolean
|
||||
If IsNothing(nSouId) Then Return False
|
||||
Return EgtGetInfo(nSouId, DUPLO_TODELETE, bToDelete)
|
||||
End Function
|
||||
|
||||
Public Shared Function DuploSetToDelete(nSouId As Integer) As Boolean
|
||||
If IsNothing(nSouId) Then Return False
|
||||
Return EgtSetInfo(nSouId, DUPLO_TODELETE, True)
|
||||
End Function
|
||||
|
||||
Private Shared Function DuploResetToDelete(nSouId As Integer) As Boolean
|
||||
If IsNothing(nSouId) Then Return False
|
||||
Return EgtSetInfo(nSouId, DUPLO_TODELETE, "")
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
+3
-3
@@ -30,7 +30,7 @@ Public Class BeamMachGroupM
|
||||
NewMachGroupM.m_Id = nId
|
||||
NewMachGroupM.m_Name = sName
|
||||
NewMachGroupM.m_Machine = sMachine
|
||||
NewMachGroupM.SetMachineType(MachineType.BEAM)
|
||||
' NewMachGroupM.SetMachineType(MachineType.BEAM)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
|
||||
@@ -51,7 +51,7 @@ Public Class BeamMachGroupM
|
||||
If NewMachGroupM.m_Id = GDB_ID.NULL Then Return Nothing
|
||||
NewMachGroupM.m_Name = sName
|
||||
NewMachGroupM.m_Machine = sMachine
|
||||
NewMachGroupM.SetMachineType(MachineType.BEAM)
|
||||
'NewMachGroupM.SetMachineType(MachineType.BEAM)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
|
||||
@@ -72,7 +72,7 @@ Public Class BeamMachGroupM
|
||||
NewMachGroupM.m_Id = nId
|
||||
NewMachGroupM.m_Name = sName
|
||||
NewMachGroupM.m_Machine = sMachine
|
||||
NewMachGroupM.SetMachineType(MachineType.BEAM)
|
||||
'NewMachGroupM.SetMachineType(MachineType.BEAM)
|
||||
'EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
|
||||
'EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
|
||||
'EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
|
||||
@@ -0,0 +1,547 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MyMachGroupM
|
||||
Inherits MachGroupM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
#Region "General"
|
||||
|
||||
Public Event PartAdded As EventHandler(Of PartAddedEventArgs)
|
||||
Public Event PartRemoved As EventHandler(Of PartAddedEventArgs)
|
||||
|
||||
Protected m_nType As BWType
|
||||
Public ReadOnly Property nType As BWType
|
||||
Get
|
||||
Return m_nType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_dL As Double
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Return m_dL
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dW As Double
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Return m_dW
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dH As Double
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Return m_dH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dtStartTime As DateTime
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return m_dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_dtStartTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dtEndTime As DateTime
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return m_dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_dtEndTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dMatForPart As Double = 0
|
||||
Public ReadOnly Property dMatForPart As Double
|
||||
Get
|
||||
Return m_dMatForPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_nProdIndex As Integer = 0
|
||||
Public Property nProdIndex As Integer
|
||||
Get
|
||||
Return m_nProdIndex
|
||||
End Get
|
||||
Set
|
||||
m_nProdIndex = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub SetMatForPart(dMatForPart As Double)
|
||||
m_dMatForPart = dMatForPart
|
||||
End Sub
|
||||
|
||||
Protected m_dTotMat As Double = 0
|
||||
Public ReadOnly Property dTotMat As Double
|
||||
Get
|
||||
Return m_dTotMat
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetTotMat(TotMat As Double)
|
||||
m_dTotMat = TotMat
|
||||
End Sub
|
||||
|
||||
Protected m_sMATERIAL As String
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei pezzi che sono nel grezzo
|
||||
Protected m_PartMList As New List(Of PartM)
|
||||
Public Property PartMList As List(Of PartM)
|
||||
Get
|
||||
Return m_PartMList
|
||||
End Get
|
||||
Set(value As List(Of PartM))
|
||||
m_PartMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' General
|
||||
|
||||
#Region "Beam"
|
||||
|
||||
Protected m_dStartCut As Double
|
||||
Public Property dStartCut As Double
|
||||
Get
|
||||
Return m_dStartCut
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dStartCut = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Beam
|
||||
|
||||
#Region "Wall"
|
||||
|
||||
Protected m_nRawPartId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nRawPartId As Integer
|
||||
Get
|
||||
Return m_nRawPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_dPosZ As Double = 0
|
||||
Public Property dPosZ As Double
|
||||
Get
|
||||
Return m_dPosZ
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dPosZ = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Wall
|
||||
|
||||
#Region "Calc"
|
||||
|
||||
Private m_nCALC_ERR As Integer
|
||||
Public Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_nCALC_ERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_FALL As Integer
|
||||
Public Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return m_nCALC_FALL
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_FALL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sCALC_MSG As String
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return MessageFromLuaMsg(m_sCALC_MSG)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_nCALC_ROT As Integer
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_nCALC_TIME As Integer
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return m_nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_nCALC_GlobalState As CalcStates = CalcStates.NOTCALCULATED
|
||||
Public Property nCALC_GlobalState As CalcStates
|
||||
Get
|
||||
Return m_nCALC_GlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nCALC_GlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bCALC_PartsGlobalState As CalcStates
|
||||
Public Property bCALC_PartsGlobalState As CalcStates
|
||||
Get
|
||||
Return m_bCALC_PartsGlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_bCALC_PartsGlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_GlobalERR As Integer
|
||||
Public Property nCALC_GlobalERR As Integer
|
||||
Get
|
||||
Return m_nCALC_GlobalERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_GlobalERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_nCALC_State As CalcStates = CalcStates.NOTCALCULATED
|
||||
Public Property nCALC_State As CalcStates
|
||||
Get
|
||||
Return m_nCALC_State
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nCALC_State = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Calc
|
||||
|
||||
#Region "Supervisor"
|
||||
|
||||
Protected m_sSupervisorId As String
|
||||
Public Property sSupervisorId As String
|
||||
Get
|
||||
Return m_sSupervisorId
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sSupervisorId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nPriorityIndex As Integer
|
||||
Public Property nPriorityIndex As Integer
|
||||
Get
|
||||
Return m_nPriorityIndex
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPriorityIndex = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nProductionState As ItemState = ItemState.ND
|
||||
Public ReadOnly Property nProductionState As ItemState
|
||||
Get
|
||||
Return m_nProductionState
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetProductionState(nState As ItemState)
|
||||
m_nProductionState = nState
|
||||
End Sub
|
||||
|
||||
#End Region ' Supervisor
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Protected Sub New()
|
||||
End Sub
|
||||
|
||||
Public Overloads Shared Function CreateNewMachGroup() As MyMachGroupM
|
||||
Return New MyMachGroupM
|
||||
End Function
|
||||
|
||||
Public Overloads Shared Function CreateMyMachGroup(Type As BWType, nId As Integer, sName As String, sMachine As String) As MachGroupM
|
||||
Dim NewMachGroupM As New MyMachGroupM
|
||||
NewMachGroupM.m_Id = nId
|
||||
NewMachGroupM.m_Name = sName
|
||||
NewMachGroupM.m_Machine = sMachine
|
||||
NewMachGroupM.m_nType = Type
|
||||
If NewMachGroupM.m_nType = MachineType.BEAM Then
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
|
||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||
For Each Part In NewMachGroupM.m_PartMList
|
||||
Part.UpdateOffset()
|
||||
NewMachGroupM.m_dTotMat += Part.dL + Part.dOffset
|
||||
NewMachGroupM.m_dMatForPart += Part.dL
|
||||
Next
|
||||
Else
|
||||
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
|
||||
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW * NewMachGroupM.m_dH
|
||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||
For Each Part In NewMachGroupM.m_PartMList
|
||||
NewMachGroupM.m_dMatForPart += Part.dVolume
|
||||
Next
|
||||
End If
|
||||
ReadMachGroupData(NewMachGroupM)
|
||||
Return NewMachGroupM
|
||||
End Function
|
||||
|
||||
Public Overloads Shared Function CreateMyMachGroup(Type As BWType, sName As String, sMachine As String) As MachGroupM
|
||||
Dim NewMachGroupM As New MyMachGroupM
|
||||
NewMachGroupM.m_Id = EgtAddMachGroup(sName, sMachine)
|
||||
If NewMachGroupM.m_Id = GDB_ID.NULL Then Return Nothing
|
||||
NewMachGroupM.m_Name = sName
|
||||
NewMachGroupM.m_Machine = sMachine
|
||||
NewMachGroupM.m_nType = Type
|
||||
If NewMachGroupM.m_nType = MachineType.BEAM Then
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
|
||||
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL
|
||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||
For Each Part In NewMachGroupM.m_PartMList
|
||||
Part.UpdateOffset()
|
||||
NewMachGroupM.m_dMatForPart += Part.dL + Part.dOffset
|
||||
Next
|
||||
Else
|
||||
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
|
||||
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW
|
||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||
For Each Part In NewMachGroupM.m_PartMList
|
||||
NewMachGroupM.m_dMatForPart += Part.dVolume
|
||||
Next
|
||||
End If
|
||||
ReadMachGroupData(NewMachGroupM)
|
||||
Return NewMachGroupM
|
||||
End Function
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
#Region "Machgroup"
|
||||
|
||||
Public Shared Sub ReadMachGroupData(NewMachgroup As MyMachGroupM)
|
||||
' leggo materiale
|
||||
EgtGetInfo(NewMachgroup.Id, MGR_RPT_MATERIAL, NewMachgroup.sMATERIAL)
|
||||
' leggo calc error
|
||||
Dim nErr As Integer = 0
|
||||
Dim nRot As Integer = 0
|
||||
Dim nFall As Integer = 0
|
||||
Dim sMsg As String = ""
|
||||
Dim bCalc As Boolean = False
|
||||
bCalc = EgtGetInfo(NewMachgroup.Id, ITG_PROD_ERR, nErr)
|
||||
EgtGetInfo(NewMachgroup.Id, ITG_PROD_ROT, nRot)
|
||||
EgtGetInfo(NewMachgroup.Id, ITG_PROD_FALL, nFall)
|
||||
EgtGetInfo(NewMachgroup.Id, ITG_PROD_MSG, sMsg)
|
||||
If Not bCalc Then
|
||||
NewMachgroup.m_nCALC_State = CalcStates.NOTCALCULATED
|
||||
NewMachgroup.m_nCALC_ERR = 0
|
||||
NewMachgroup.m_nCALC_ROT = 0
|
||||
NewMachgroup.m_nCALC_FALL = 0
|
||||
NewMachgroup.m_sCALC_MSG = ""
|
||||
Else
|
||||
NewMachgroup.m_nCALC_ERR = nErr
|
||||
NewMachgroup.m_nCALC_ROT = nRot
|
||||
NewMachgroup.m_nCALC_FALL = nFall
|
||||
NewMachgroup.m_sCALC_MSG = sMsg
|
||||
Select Case nErr
|
||||
Case 0
|
||||
NewMachgroup.nCALC_State = CalcStates.OK
|
||||
Case 22
|
||||
NewMachgroup.nCALC_State = CalcStates.COLLISION
|
||||
Case 17, 19
|
||||
NewMachgroup.nCALC_State = CalcStates.WARNING
|
||||
Case < 0
|
||||
NewMachgroup.nCALC_State = CalcStates.INFO
|
||||
Case > 0
|
||||
NewMachgroup.nCALC_State = CalcStates.ERROR_
|
||||
End Select
|
||||
End If
|
||||
EgtGetInfo(NewMachgroup.Id, ITG_PROD_TIME, NewMachgroup.m_nCALC_TIME)
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub RefreshPartList()
|
||||
If m_nType = MachineType.BEAM Then
|
||||
' leggo StartCut da posizione primo pezzo
|
||||
Dim sInfo As String = ""
|
||||
Dim sSplitInfo() As String
|
||||
Dim bFound As Boolean = False
|
||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
StringToDoubleAdv(sSplitInfo(1), m_dStartCut)
|
||||
Else
|
||||
m_dStartCut = 0
|
||||
End If
|
||||
' aggiorno lista pezzi
|
||||
RemoveAllParts()
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
If nPartId <> GDB_ID.NULL Then
|
||||
Dim NewBeam As PartM = PartM.CreatePart(BWType.BEAM, Me, nPartId, nRawPartId)
|
||||
AddPart(NewBeam)
|
||||
NewBeam.UpdateOffset()
|
||||
End If
|
||||
nRawPartId = EgtGetNextRawPart(nRawPartId)
|
||||
End While
|
||||
Else
|
||||
' aggiorno lista pezzi
|
||||
RemoveAllParts()
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
If nRawPartId <> GDB_ID.NULL Then
|
||||
Me.m_nRawPartId = nRawPartId
|
||||
End If
|
||||
Dim nWallId As Integer = EgtGetFirstPartInRawPart(m_nRawPartId)
|
||||
While nWallId <> GDB_ID.NULL
|
||||
If nWallId <> GDB_ID.NULL Then
|
||||
Dim NewWall As PartM = PartM.CreatePart(BWType.WALL, Me, nWallId, m_nRawPartId)
|
||||
AddPart(NewWall)
|
||||
End If
|
||||
nWallId = EgtGetNextPartInRawPart(nWallId)
|
||||
End While
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub RefreshGroupData()
|
||||
If m_nType = MachineType.BEAM Then
|
||||
EgtGetInfo(Id, MGR_RPT_BARLEN, dL)
|
||||
EgtGetInfo(Id, MGR_RPT_BARHEIGHT, dH)
|
||||
EgtGetInfo(Id, MGR_RPT_BARWIDTH, dW)
|
||||
EgtGetInfo(Id, MGR_RPT_MATERIAL, sMATERIAL)
|
||||
Else
|
||||
EgtGetInfo(Id, MGR_RPT_PANELLEN, dL)
|
||||
EgtGetInfo(Id, MGR_RPT_PANELWIDTH, dW)
|
||||
EgtGetInfo(Id, MGR_RPT_PANELHEIGHT, dH)
|
||||
EgtGetInfo(Id, MGR_RPT_MATERIAL, sMATERIAL)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub DeleteMachGroup()
|
||||
' elimino tutte le copie
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
EgtRemovePartFromRawPart(nBeamId)
|
||||
EgtErase(nBeamId)
|
||||
nRawPartId = EgtGetNextRawPart(nRawPartId)
|
||||
nBeamId = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
End While
|
||||
' elimino MachGroup
|
||||
EgtRemoveMachGroup(Me.Id)
|
||||
End Sub
|
||||
|
||||
#End Region ' Machgroup
|
||||
|
||||
#Region "Parts"
|
||||
|
||||
Private Shared Function LoadParts(NewMachGroupM As MyMachGroupM) As List(Of PartM)
|
||||
Dim TempList As New List(Of PartM)
|
||||
If NewMachGroupM.m_nType = MachineType.BEAM Then
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
If nPartId <> GDB_ID.NULL Then
|
||||
Dim NewBeam As PartM = PartM.CreatePart(BWType.BEAM, NewMachGroupM, nPartId, nRawPartId)
|
||||
TempList.Add(NewBeam)
|
||||
End If
|
||||
nRawPartId = EgtGetNextRawPart(nRawPartId)
|
||||
End While
|
||||
Else
|
||||
Dim nWallId As Integer = EgtGetFirstPartInRawPart(NewMachGroupM.m_nRawPartId)
|
||||
While nWallId <> GDB_ID.NULL
|
||||
If nWallId <> GDB_ID.NULL Then
|
||||
Dim NewWall As PartM = PartM.CreatePart(BWType.WALL, NewMachGroupM, nWallId, NewMachGroupM.m_nRawPartId)
|
||||
TempList.Add(NewWall)
|
||||
End If
|
||||
nWallId = EgtGetNextPartInRawPart(nWallId)
|
||||
End While
|
||||
End If
|
||||
Return TempList
|
||||
End Function
|
||||
|
||||
Public Sub AddPart(PartM As PartM)
|
||||
If IsNothing(PartM) Then Return
|
||||
If Not m_PartMList.Contains(PartM) Then
|
||||
m_PartMList.Add(PartM)
|
||||
RaiseEvent PartAdded(Me, New PartAddedEventArgs(PartM))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub RemovePart(PartM As PartM)
|
||||
If IsNothing(PartM) Then Return
|
||||
If m_PartMList.Contains(PartM) AndAlso m_PartMList.Remove(PartM) Then
|
||||
RaiseEvent PartRemoved(Me, New PartAddedEventArgs(PartM))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub RemoveAllParts()
|
||||
If IsNothing(m_PartMList) Then Return
|
||||
For PartIndex = m_PartMList.Count - 1 To 0 Step -1
|
||||
Dim PartM As PartM = m_PartMList(PartIndex)
|
||||
If m_PartMList.Remove(PartM) Then
|
||||
RaiseEvent PartRemoved(Me, New PartAddedEventArgs(PartM))
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Function GetParts() As List(Of PartM)
|
||||
Return New List(Of PartM)(m_PartMList)
|
||||
End Function
|
||||
|
||||
#End Region ' Parts
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,449 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MyMachGroupPanelM
|
||||
Inherits MachGroupPanelM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Public Shared Function CreateMyMachGroupPanel(MachineList As List(Of Machine)) As MachGroupPanelM
|
||||
Dim NewMyMachGroupPanelM As New MyMachGroupPanelM
|
||||
NewMyMachGroupPanelM.m_IsMultiMachGroup = False
|
||||
' Assegno nome base
|
||||
NewMyMachGroupPanelM.m_BaseName = ""
|
||||
' Recupero lista macchine
|
||||
NewMyMachGroupPanelM.m_MachineList = MachineList
|
||||
' Assegno macchina di default
|
||||
NewMyMachGroupPanelM.m_DefaultMachine = ""
|
||||
' aggiorno copie
|
||||
UpdateDuplo()
|
||||
' recupero i MachGroup
|
||||
NewMyMachGroupPanelM.m_MachGroupMList = LoadMyMachGroups(MachineList)
|
||||
Return NewMyMachGroupPanelM
|
||||
End Function
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public Shared Function LoadMyMachGroups(MachineList As List(Of Machine)) As List(Of MachGroupM)
|
||||
Dim TempList As New List(Of MachGroupM)
|
||||
' Carico i gruppi di lavorazione nella lista
|
||||
Dim nId = EgtGetFirstMachGroup()
|
||||
While nId <> GDB_ID.NULL
|
||||
EgtSetCurrMachGroup(nId)
|
||||
Dim sName As String = String.Empty
|
||||
Dim sMachine As String = String.Empty
|
||||
EgtGetMachGroupName(nId, sName)
|
||||
EgtGetMachGroupMachineName(nId, sMachine)
|
||||
' cerco la macchina tra quelle presenti
|
||||
Dim UsedMachine As MyMachine = Nothing
|
||||
Dim bOk As Boolean = Machine.SearchMachine(sMachine, MachineList, UsedMachine)
|
||||
If Not bOk OrElse UsedMachine.nType = MachineType.NULL Then
|
||||
EgtOutLog("Machine incompatible with beam & wall machining!!")
|
||||
Else
|
||||
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
Dim nPROJTYPE As Integer = BWType.NULL
|
||||
EgtGetInfo(nBTLInfoLayerId, BTL_GEN_PROJTYPE, nPROJTYPE)
|
||||
If nPROJTYPE = BWType.BEAM Or nPROJTYPE = BWType.WALL Then
|
||||
TempList.Add(MyMachGroupM.CreateMyMachGroup(nPROJTYPE, nId, sName, sMachine))
|
||||
Else
|
||||
EgtOutLog("Machine of beam & wall type, but project type not found!!")
|
||||
End If
|
||||
End If
|
||||
nId = EgtGetNextMachGroup(nId)
|
||||
End While
|
||||
EgtResetCurrMachGroup()
|
||||
Return TempList
|
||||
End Function
|
||||
|
||||
' funzione che restituisce il gruppo di lavorazione dato l'Id geometrico
|
||||
Public Shared Function LoadMyMachGroupFromId(nId As Integer, MachineList As List(Of Machine)) As MachGroupM
|
||||
If nId <= 0 Then Return Nothing
|
||||
If Not EgtSetCurrMachGroup(nId) Then Return Nothing
|
||||
Dim sName As String = String.Empty
|
||||
Dim sMachine As String = String.Empty
|
||||
EgtGetMachGroupName(nId, sName)
|
||||
EgtGetMachGroupMachineName(nId, sMachine)
|
||||
' cerco la macchina tra quelle presenti
|
||||
Dim UsedMachine As MyMachine = Nothing
|
||||
Dim bOk As Boolean = Machine.SearchMachine(sMachine, MachineList, UsedMachine)
|
||||
If Not bOk OrElse UsedMachine.nType = MachineType.NULL Then
|
||||
EgtOutLog("Machine incompatible with beam & wall machining!!")
|
||||
Else
|
||||
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
Dim nPROJTYPE As Integer = BWType.NULL
|
||||
EgtGetInfo(nBTLInfoLayerId, BTL_GEN_PROJTYPE, nPROJTYPE)
|
||||
If nPROJTYPE = BWType.BEAM Or nPROJTYPE = BWType.WALL Then
|
||||
Return MyMachGroupM.CreateMyMachGroup(nPROJTYPE, nId, sName, sMachine)
|
||||
Else
|
||||
EgtOutLog("Machine of beam & wall type, but project type not found!!")
|
||||
End If
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
|
||||
' funzione che restituisce solo i gruppi di lavorazione creati nel nesting
|
||||
Public Shared Function UpdateFromNestingMyMachGroups(MachineList As List(Of Machine)) As List(Of MachGroupM)
|
||||
Dim TempList As New List(Of MachGroupM)
|
||||
' Carico i gruppi di lavorazione nella lista
|
||||
Dim nId = EgtGetFirstMachGroup()
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim UpdateUI As Integer = 0
|
||||
If EgtGetInfo(nId, "UPDATEUI", UpdateUI) AndAlso UpdateUI = 1 Then
|
||||
TempList.Add(LoadMyMachGroupFromId(nId, MachineList))
|
||||
' rimuovo info
|
||||
EgtRemoveInfo(nId, "UPDATEUI")
|
||||
End If
|
||||
nId = EgtGetNextMachGroup(nId)
|
||||
End While
|
||||
EgtResetCurrMachGroup()
|
||||
Return TempList
|
||||
End Function
|
||||
|
||||
Public Function NewMyMachGroup(sMachName As String, nMachineType As MachineType) As MachGroupM
|
||||
' Sistemazioni preliminari
|
||||
OnPreNewMachGroup()
|
||||
' Se non ci sono macchine disponibili esco con errore
|
||||
If m_MachineList.Count <= 0 Then Return Nothing
|
||||
' Creo il nuovo gruppo di lavorazione con i dati ottenuti a seconda del caso in cui mi trovo
|
||||
Dim MachGroupM As MachGroupM
|
||||
If nMachineType = MachineType.NULL Then
|
||||
EgtOutLog("Machine incompatible with beam & wall machining!!")
|
||||
Return Nothing
|
||||
Else
|
||||
MachGroupM = MyMachGroupM.CreateMyMachGroup(nMachineType, NewMachGroupID(), sMachName)
|
||||
End If
|
||||
If IsNothing(MachGroupM) Then Return Nothing
|
||||
AddMachGroup(MachGroupM)
|
||||
' Sistemazioni finali
|
||||
m_DefaultMachine = sMachName
|
||||
OnPostNewMachGroup()
|
||||
Return MachGroupM
|
||||
End Function
|
||||
|
||||
Public Overrides Function OnPreNewMachGroup() As Boolean
|
||||
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' NB: Anche se ho già aggiunto il nuovo gruppo di lavorazione, non l'ho ancora reso corrente (viene fatto dopo), quindi
|
||||
' non posso usare CurrentMachine perchè è ancora impostata quella precedente!!!
|
||||
Public Overrides Function OnPostNewMachGroup() As Boolean
|
||||
' Salvo macchina del gruppo come nuovo default
|
||||
Dim sCurrMachName As String = String.Empty
|
||||
EgtGetCurrMachineName(sCurrMachName)
|
||||
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, sCurrMachName)
|
||||
'' leggo nome attrezzaggio di default
|
||||
'Dim sDefaultSetUpName As String = String.Empty
|
||||
'Dim sMachineIniPath As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sCurrMachName & "\" & sCurrMachName & ".ini"
|
||||
'EgtUILib.GetPrivateProfileString(S_SETUP, K_DEFAULT, "", sDefaultSetUpName, sMachineIniPath)
|
||||
'' se è attiva l'opzione, rendo corrente l'attrezzaggio di default
|
||||
'If Not String.IsNullOrEmpty(sDefaultSetUpName) Then
|
||||
' If Not EgtImportSetup(sDefaultSetUpName) Then
|
||||
' EgtOutLog("Error loading default setup " & sDefaultSetUpName)
|
||||
' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 9) & " " & sDefaultSetUpName, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Exclamation)
|
||||
' End If
|
||||
'End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Overrides Function OnPreRemoveCurrMachGroup() As Boolean
|
||||
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function NewMachGroupID() As Integer
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(MachGroupMList) AndAlso MachGroupMList.Count > 0 Then Return MachGroupMList.Select(Of Integer)(Function(x) If(Integer.TryParse(x.Name, nTemp), nTemp, 0)).Max() + 1
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
' funzione che fa l'update di tutte le copie dei pezzi modificati
|
||||
Public Shared Sub UpdateDuplo()
|
||||
' verifico tipo di progetto
|
||||
Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
Dim nBWType As Integer = 0
|
||||
EgtGetInfo(nBtlInfoId, BTL_GEN_PROJTYPE, nBWType)
|
||||
' ciclo sui pezzi
|
||||
Dim bTotIsModified As Boolean = False
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim bIsModified As Boolean = False
|
||||
If EgtDuploGetModified(nPartId, bIsModified) AndAlso bIsModified Then
|
||||
' verifico se c'é PRID sugli outline
|
||||
Dim nPRId As Integer = 1
|
||||
Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
If EgtExistsInfo(nOutlineId, MGR_FTR_PRC) Then
|
||||
If EgtExistsInfo(nOutlineId, MGR_FTR_PRID) Then
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
Continue While
|
||||
Else
|
||||
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
|
||||
nPRId += 1
|
||||
End If
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
bTotIsModified = True
|
||||
Dim DuploList As New List(Of Integer)
|
||||
EgtDuploList(nPartId, DuploList)
|
||||
Dim DuploArray() As Integer
|
||||
Dim RotArray(DuploList.Count) As Integer
|
||||
Dim FlipArray(DuploList.Count) As Integer
|
||||
Dim QArray(DuploList.Count) As Dictionary(Of String, Dictionary(Of String, String))
|
||||
DuploArray = DuploList.ToArray()
|
||||
' recupero ROT (gradi) e FLIP (0/1) per non perderli
|
||||
For Duploindex = 0 To DuploArray.Length - 1
|
||||
RotArray(Duploindex) = 0
|
||||
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
|
||||
FlipArray(Duploindex) = 0
|
||||
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
|
||||
If FlipArray(Duploindex) <> 0 Then FlipArray(Duploindex) = 180
|
||||
If nBWType = BWType.WALL Then
|
||||
' salvo parametri Q
|
||||
QArray(Duploindex) = New Dictionary(Of String, Dictionary(Of String, String))
|
||||
' ciclo sugli outline
|
||||
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nGlobPRId As Integer = 1
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
||||
nPRId = 0
|
||||
If Not EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) Then
|
||||
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
|
||||
nPRId = nGlobPRId
|
||||
nGlobPRId += 1
|
||||
End If
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
|
||||
For QIndex = 1 To 10
|
||||
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
||||
Dim QValue As Integer = 0
|
||||
If EgtGetInfo(nOutlineId, QKey, QValue) Then
|
||||
QArray(Duploindex)(sKey).Add(QKey, QValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
' ciclo sulle feature
|
||||
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
|
||||
If nFeatureLayer <> GDB_ID.NULL Then
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
||||
nPRId = 0
|
||||
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
|
||||
For QIndex = 1 To 10
|
||||
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
||||
Dim QValue As Integer = 0
|
||||
If EgtGetInfo(nFeatureId, QKey, QValue) Then
|
||||
QArray(Duploindex)(sKey).Add(QKey, QValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' aggiornamento dei Duplo
|
||||
EgtDuploUpdate(nPartId)
|
||||
' ripristino i valori di ROT e FLIP
|
||||
For Duploindex = 0 To DuploArray.Length - 1
|
||||
' ripristino info rot e flip
|
||||
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
|
||||
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
|
||||
If nBWType = BWType.WALL Then
|
||||
' ciclo sugli outline
|
||||
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
|
||||
If nOutlineLayer <> GDB_ID.NULL Then
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
||||
nPRId = 0
|
||||
EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
' ripristino parametri Q
|
||||
If QArray(Duploindex).ContainsKey(sKey) Then
|
||||
For Each QPar In QArray(Duploindex)(sKey)
|
||||
EgtSetInfo(nOutlineId, QPar.Key, QPar.Value)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
End If
|
||||
' ciclo sulle feature
|
||||
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
|
||||
If nFeatureLayer <> GDB_ID.NULL Then
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
Dim nPRC As Integer
|
||||
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
||||
nPRId = 0
|
||||
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
||||
Dim sKey As String = nPRId & "." & nPRC
|
||||
' ripristino parametri Q
|
||||
If QArray(Duploindex).ContainsKey(sKey) Then
|
||||
For Each QPar In QArray(Duploindex)(sKey)
|
||||
EgtSetInfo(nFeatureId, QPar.Key, QPar.Value)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
If bTotIsModified Then
|
||||
Dim CurrFilePath As String = ""
|
||||
EgtGetCurrFilePath(CurrFilePath)
|
||||
EgtSaveFile(CurrFilePath, NGE.CMPTEXT)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Class DuploFeature
|
||||
' Id geometrico della feature
|
||||
Friend nFeatureId As Integer
|
||||
Friend nPRC As Integer
|
||||
Friend nPRID As Integer
|
||||
End Class
|
||||
|
||||
' funzione che cancella tutti i pezzi segnati da eliminare
|
||||
Public Shared Function DeleteDuplo() As List(Of Integer)
|
||||
Dim ToRedrawMachGroupList As New List(Of Integer)
|
||||
' reset necessario per poter accedere direttamente al grezzo dalle info pezzo e al MachGroup tramite la gerarchia Db geometrico
|
||||
EgtResetCurrMachGroup()
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim bIsToDelete As Boolean = False
|
||||
If DuploGetToDelete(nPartId, bIsToDelete) AndAlso bIsToDelete Then
|
||||
' verifico se ci sono copie
|
||||
Dim nDuploCount As Integer = 0
|
||||
EgtDuploCount(nPartId, nDuploCount)
|
||||
Dim DuploList As New List(Of Integer)
|
||||
If nDuploCount > 0 AndAlso EgtDuploList(nPartId, DuploList) Then
|
||||
' cancello tutti i pezzi copia nelle barre
|
||||
For Each nDuploId In DuploList
|
||||
' recupero grezzo cui appartiene
|
||||
Dim nRawPartId As Integer = DuploGetRawPart(nDuploId)
|
||||
' recupero gruppo di lavorazione
|
||||
Dim nMachGroupId As Integer = EgtGetParent(EgtGetParent(EgtGetParent(nRawPartId)))
|
||||
|
||||
' elimino eventuali successive info pezzi di troppo
|
||||
Dim nIndex As Integer = 0
|
||||
Dim sTemp As String = ""
|
||||
While EgtGetInfo(nMachGroupId, MGR_RPT_PART & nIndex, sTemp)
|
||||
Dim PartData() As String = sTemp.Split(","c)
|
||||
If PartData(0) <> nDuploId Then
|
||||
EgtSetInfo(nMachGroupId, MGR_RPT_PART & nIndex, sTemp)
|
||||
nIndex += 1
|
||||
End If
|
||||
End While
|
||||
ToRedrawMachGroupList.Add(nMachGroupId)
|
||||
|
||||
|
||||
|
||||
'' elimino vecchio grezzo ed eseguo script creazione nuovo
|
||||
'Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
'While nRawId <> GDB_ID.NULL
|
||||
' EgtRemovePartFromRawPart(EgtGetFirstPartInRawPart(nRawId))
|
||||
' EgtRemoveRawPart(nRawId)
|
||||
' nRawId = EgtGetFirstRawPart()
|
||||
'End While
|
||||
'If Not ExecBeam(Map.refMainWindowVM.MainWindowM.sTempDir, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then Return False
|
||||
|
||||
|
||||
|
||||
' lo setto come corrente
|
||||
EgtSetCurrMachGroup(nMachGroupId)
|
||||
' elimino pezzo copia
|
||||
EgtRemovePartFromRawPart(nDuploId)
|
||||
EgtErase(nDuploId)
|
||||
Next
|
||||
End If
|
||||
DuploResetToDelete(nPartId)
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
EgtResetCurrMachGroup()
|
||||
Return ToRedrawMachGroupList
|
||||
End Function
|
||||
|
||||
Friend Shared Function DuploGetToDelete(nSouId As Integer, ByRef bToDelete As Boolean) As Boolean
|
||||
If IsNothing(nSouId) Then Return False
|
||||
Return EgtGetInfo(nSouId, DUPLO_TODELETE, bToDelete)
|
||||
End Function
|
||||
|
||||
Public Shared Function DuploSetToDelete(nSouId As Integer) As Boolean
|
||||
If IsNothing(nSouId) Then Return False
|
||||
Return EgtSetInfo(nSouId, DUPLO_TODELETE, True)
|
||||
End Function
|
||||
|
||||
Private Shared Function DuploResetToDelete(nSouId As Integer) As Boolean
|
||||
If IsNothing(nSouId) Then Return False
|
||||
Return EgtSetInfo(nSouId, DUPLO_TODELETE, "")
|
||||
End Function
|
||||
|
||||
' funzione che restituisce il pezzo di origine di un Duplo
|
||||
' sostituisce EgtDuploGetOriginal che funziona solo all'interno del MachGroup del Duplo
|
||||
Public Shared Function DuploGetOriginal(nDuploId As Integer) As Integer
|
||||
Dim nOrigId As Integer = GDB_ID.NULL
|
||||
If EgtGetInfo(nDuploId, GDB_SI_DUPSOU, nOrigId) AndAlso nOrigId > 0 Then
|
||||
Return nOrigId
|
||||
Else
|
||||
Return GDB_ID.NULL
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Shared Function DuploGetRawPart(nDuploId As Integer) As Integer
|
||||
Dim nSwapItem As Integer = GDB_ID.NULL
|
||||
Dim sSwapItem As String = String.Empty
|
||||
EgtGetInfo(nDuploId, "!LST", sSwapItem)
|
||||
Dim LSTValues() As String = sSwapItem.Split(","c)
|
||||
If Not IsNothing(LSTValues(LSTValues.Count - 1)) AndAlso Integer.TryParse(LSTValues(LSTValues.Count - 1), nSwapItem) AndAlso nSwapItem > 0 Then
|
||||
Return EgtGetParent(nSwapItem)
|
||||
End If
|
||||
Return GDB_ID.NULL
|
||||
|
||||
|
||||
|
||||
'Dim nRawId As Integer = GDB_ID.NULL
|
||||
'If EgtGetInfo(nDuploId, GDB_SI_LIST, nRawId) AndAlso nRawId > 0 Then
|
||||
' Return nRawId
|
||||
'Else
|
||||
' Return GDB_ID.NULL
|
||||
'End If
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,646 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class PartM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
#Region "General"
|
||||
|
||||
Public Event BTLFeatureAdded As EventHandler(Of BTLFeatureAddedEventArgs)
|
||||
|
||||
Protected m_nType As BWType
|
||||
Public ReadOnly Property nType As BWType
|
||||
Get
|
||||
Return m_nType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_ParentMachGroup As MyMachGroupM
|
||||
Public ReadOnly Property ParentMachGroup As MyMachGroupM
|
||||
Get
|
||||
Return m_ParentMachGroup
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Id geometrico del pezzo
|
||||
Protected m_nPartId As Integer
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
Get
|
||||
Return m_nPartId
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetPartId(nPartId As Integer)
|
||||
m_nPartId = nPartId
|
||||
End Sub
|
||||
|
||||
' Proj del pezzo
|
||||
Protected m_nProjId As Integer = 0
|
||||
Public Property nProjId As Integer
|
||||
Get
|
||||
Return m_nProjId
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nProjId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Info del pezzo
|
||||
Protected m_nPDN As Integer
|
||||
Public ReadOnly Property nPDN As Integer
|
||||
Get
|
||||
Return m_nPDN
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_sNAM As String
|
||||
Public ReadOnly Property sNAM As String
|
||||
Get
|
||||
Return m_sNAM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_dBtlL As Double
|
||||
Public ReadOnly Property dBtlL As String
|
||||
Get
|
||||
Return m_dBtlL
|
||||
End Get
|
||||
End Property
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Dim frBeam As New Frame3d
|
||||
EgtGetGroupGlobFrame(nPartId, frBeam)
|
||||
If IsX(frBeam.VersX(), EPS_SMALL) Then
|
||||
Return m_dBtlL
|
||||
ElseIf IsX(frBeam.VersY(), EPS_SMALL) Then
|
||||
Return m_dBtlH
|
||||
Else
|
||||
Return m_dBtlW
|
||||
End If
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dBtlL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dBtlW As Double
|
||||
Public ReadOnly Property dBtlW As String
|
||||
Get
|
||||
Return m_dBtlW
|
||||
End Get
|
||||
End Property
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Dim frBeam As New Frame3d
|
||||
EgtGetGroupGlobFrame(nPartId, frBeam)
|
||||
If IsY(frBeam.VersX()) Then
|
||||
Return m_dBtlL
|
||||
ElseIf IsY(frBeam.VersY()) Then
|
||||
Return m_dBtlH
|
||||
Else
|
||||
Return m_dBtlW
|
||||
End If
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dBtlW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dBtlH As Double
|
||||
Public ReadOnly Property dBtlH As String
|
||||
Get
|
||||
Return m_dBtlH
|
||||
End Get
|
||||
End Property
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Dim frBeam As New Frame3d
|
||||
EgtGetGroupGlobFrame(nPartId, frBeam)
|
||||
If IsZ(frBeam.VersX()) Then
|
||||
Return m_dBtlL
|
||||
ElseIf IsZ(frBeam.VersY()) Then
|
||||
Return m_dBtlH
|
||||
Else
|
||||
Return m_dBtlW
|
||||
End If
|
||||
Return m_dBtlH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dBtlH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dPOSX As Double
|
||||
Public Property dPOSX As Double
|
||||
Get
|
||||
If nType = BWType.WALL Then
|
||||
' verifico che sia attivo MachGroup di questo pezzo
|
||||
If EgtGetCurrMachGroup() = ParentMachGroup.Id Then
|
||||
' recupero box pezzo
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
|
||||
' recupero layer del box
|
||||
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||
' recupero box del layer box
|
||||
Dim b3Box As New BBox3d
|
||||
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
|
||||
' recupero origine grezzo
|
||||
Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
|
||||
Dim b3Raw As New BBox3d
|
||||
EgtGetRawPartBBox(nrawPartId, b3Raw)
|
||||
' calcolo distanza tra origine pezzo e tavolo
|
||||
Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
|
||||
m_dPOSX = vtPartRef.x
|
||||
Return vtPartRef.x
|
||||
' altrimenti restituisco valore salvato (per quando viene clickato un BTLPart)
|
||||
Else
|
||||
Return m_dPOSX
|
||||
End If
|
||||
Else ' nType = BWType.BEAM
|
||||
Return m_dPOSX
|
||||
End If
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dPOSX = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCNT As Integer
|
||||
Public Property nCNT As Integer
|
||||
Get
|
||||
Return m_nCNT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCNT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nINVERTED As Integer
|
||||
Public ReadOnly Property nINVERTED As Integer
|
||||
Get
|
||||
Return m_nINVERTED
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetInverted(nInverted As Integer)
|
||||
m_nINVERTED = nInverted
|
||||
End Sub
|
||||
|
||||
Protected m_nROTATED As Integer
|
||||
Public ReadOnly Property nROTATED As Integer
|
||||
Get
|
||||
Return m_nROTATED
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetRotated(nRotated As Integer)
|
||||
m_nROTATED = nRotated
|
||||
End Sub
|
||||
|
||||
Protected m_sMATERIAL As String
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_sSTOREY As String
|
||||
Public Property sSTOREY As String
|
||||
Get
|
||||
Return m_sSTOREY
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sSTOREY = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_sGROUP As String
|
||||
Public Property sGROUP As String
|
||||
Get
|
||||
Return m_sGROUP
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sGROUP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nBTLPartId As Integer
|
||||
Public ReadOnly Property nBTLPartId As Integer
|
||||
Get
|
||||
Return m_nBTLPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' lista delle feature del pezzo
|
||||
Protected m_FeatureMList As List(Of BTLFeatureM)
|
||||
Public Property FeatureMList As List(Of BTLFeatureM)
|
||||
Get
|
||||
Return m_FeatureMList
|
||||
End Get
|
||||
Set(value As List(Of BTLFeatureM))
|
||||
m_FeatureMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' General
|
||||
|
||||
#Region "Beam"
|
||||
|
||||
' Id del grezzo
|
||||
Protected m_nRawPartId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nRawPartId As Integer
|
||||
Get
|
||||
Return m_nRawPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_dOffset As Double
|
||||
Public Property dOffset As Double
|
||||
Get
|
||||
Return m_dOffset
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dOffset = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Beam
|
||||
|
||||
#Region "Wall"
|
||||
|
||||
Protected m_dPOSY As Double
|
||||
Public Property dPOSY As Double
|
||||
Get
|
||||
' verifico che sia attivo MachGroup di questo pezzo
|
||||
If EgtGetCurrMachGroup() = ParentMachGroup.Id Then
|
||||
' recupero box pezzo
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
|
||||
' recupero layer del box
|
||||
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||
' recupero box del layer box
|
||||
Dim b3Box As New BBox3d
|
||||
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
|
||||
' recupero origine grezzo
|
||||
Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
|
||||
Dim b3Raw As New BBox3d
|
||||
EgtGetRawPartBBox(nrawPartId, b3Raw)
|
||||
' calcolo distanza tra origine pezzo e tavolo
|
||||
Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
|
||||
m_dPOSY = vtPartRef.y
|
||||
Return vtPartRef.y
|
||||
' altrimenti restituisco valore salvato (per quando viene clickato un BTLPart)
|
||||
Else
|
||||
Return m_dPOSY
|
||||
End If
|
||||
'Return m_dPOSY
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dPOSY = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dROT As Double
|
||||
Public Property dROT As Double
|
||||
Get
|
||||
Return m_dROT
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nFLIP As Integer
|
||||
Public Property nFLIP As Integer
|
||||
Get
|
||||
Return m_nFLIP
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nFLIP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dVolume As Double
|
||||
Public Property dVolume As Double
|
||||
Get
|
||||
Return m_dVolume
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dVolume = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Wall
|
||||
|
||||
#Region "Calc"
|
||||
|
||||
Protected m_nCALC_GlobalState As CalcStates = CalcStates.NOTCALCULATED
|
||||
Public Property nCALC_GlobalState As CalcStates
|
||||
Get
|
||||
Return m_nCALC_GlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nCALC_GlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_GlobalERR As Integer
|
||||
Public Property nCALC_GlobalERR As Integer
|
||||
Get
|
||||
Return m_nCALC_GlobalERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_GlobalERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_State As CalcStates = CalcStates.NOTCALCULATED
|
||||
Public Property nCALC_State As CalcStates
|
||||
Get
|
||||
Return m_nCALC_State
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nCALC_State = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_ERR As Integer
|
||||
Public Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_nCALC_ERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sCALC_MSG As String = String.Empty
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return MessageFromLuaMsg(m_sCALC_MSG)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_ROT As Integer
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_FALL As Integer
|
||||
Public Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return m_nCALC_FALL
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_FALL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_TIME As Integer
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return m_nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Calc
|
||||
|
||||
#Region "Supervisor"
|
||||
|
||||
Protected m_nProductionState As ItemState = ItemState.ND
|
||||
Public ReadOnly Property nProductionState As ItemState
|
||||
Get
|
||||
Return m_nProductionState
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetProductionState(nState As CalcStates)
|
||||
m_nProductionState = nState
|
||||
End Sub
|
||||
|
||||
Protected m_dtStartTime As DateTime
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return m_dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_dtStartTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dtEndTime As DateTime
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return m_dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_dtEndTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Supervisor
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(nParentMachGroup As MyMachGroupM, nPartId As Integer)
|
||||
m_ParentMachGroup = nParentMachGroup
|
||||
SetPartId(nPartId)
|
||||
' imposto BtlPart da cui deriva questo Duplo
|
||||
m_nBTLPartId = MyMachGroupPanelM.DuploGetOriginal(nPartId)
|
||||
End Sub
|
||||
|
||||
Public Shared Function CreatePart(Type As BWType, nParentMachGroup As MyMachGroupM, nPartId As Integer, nRawPartId As Integer) As PartM
|
||||
Dim NewPartM As New PartM(nParentMachGroup, nPartId)
|
||||
NewPartM.m_nType = Type
|
||||
NewPartM.m_nRawPartId = nRawPartId
|
||||
' leggo info pezzo
|
||||
EgtGetInfo(nPartId, BTL_PRT_PROJ, NewPartM.m_nProjId)
|
||||
EgtGetInfo(nPartId, BTL_PRT_PDN, NewPartM.m_nPDN)
|
||||
EgtGetInfo(nPartId, BTL_PRT_NAM, NewPartM.m_sNAM)
|
||||
EgtGetInfo(nPartId, BTL_PRT_L, NewPartM.m_dBtlL)
|
||||
EgtGetInfo(nPartId, BTL_PRT_W, NewPartM.m_dBtlW)
|
||||
EgtGetInfo(nPartId, BTL_PRT_H, NewPartM.m_dBtlH)
|
||||
EgtGetInfo(nPartId, BTL_PRT_CNT, NewPartM.m_nCNT)
|
||||
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP)
|
||||
EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY)
|
||||
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL)
|
||||
Dim nTemp As Integer = 0
|
||||
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
|
||||
nTemp = 0
|
||||
End If
|
||||
NewPartM.SetRotated(nTemp)
|
||||
If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, nTemp) Then
|
||||
nTemp = 0
|
||||
End If
|
||||
NewPartM.SetInverted(nTemp)
|
||||
If NewPartM.m_nType = BWType.BEAM Then
|
||||
' leggo PosX
|
||||
Dim sInfo As String = ""
|
||||
Dim Index = 1
|
||||
Dim sSplitInfo() As String = Nothing
|
||||
Dim bFound As Boolean = False
|
||||
While EgtGetInfo(NewPartM.m_ParentMachGroup.Id, MGR_RPT_PART & Index, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
If sSplitInfo(0) = nPartId Then
|
||||
bFound = True
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
Index += 1
|
||||
End While
|
||||
If bFound Then
|
||||
StringToDoubleAdv(sSplitInfo(1), NewPartM.m_dPOSX)
|
||||
End If
|
||||
Else
|
||||
' leggo PosX, PosY, Rot e Flip
|
||||
EgtGetInfo(nPartId, MGR_PRT_POSX, NewPartM.m_dPOSX)
|
||||
EgtGetInfo(nPartId, MGR_PRT_POSY, NewPartM.m_dPOSY)
|
||||
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
|
||||
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
|
||||
End If
|
||||
' leggo volume
|
||||
If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewPartM.dVolume) Then
|
||||
Dim nOrigId As Integer = EgtDuploGetOriginal(nPartId)
|
||||
EgtGetInfo(nOrigId, BTL_PRT_VOLUME, NewPartM.dVolume)
|
||||
End If
|
||||
' leggo feature
|
||||
NewPartM.m_FeatureMList = LoadBTLFeatures(NewPartM, nPartId)
|
||||
ReadMachGroupData(NewPartM)
|
||||
Return NewPartM
|
||||
End Function
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
#Region "Part"
|
||||
|
||||
Public Shared Sub ReadMachGroupData(NewPartM As PartM)
|
||||
' leggo calc error
|
||||
Dim nErr As Integer = 0
|
||||
Dim nRot As Integer = 0
|
||||
Dim nFall As Integer = 0
|
||||
Dim sMsg As String = ""
|
||||
Dim bCalc As Boolean = False
|
||||
bCalc = EgtGetInfo(NewPartM.nPartId, ITG_PROD_ERR, nErr)
|
||||
EgtGetInfo(NewPartM.nPartId, ITG_PROD_ROT, nRot)
|
||||
EgtGetInfo(NewPartM.nPartId, ITG_PROD_FALL, nFall)
|
||||
EgtGetInfo(NewPartM.nPartId, ITG_PROD_MSG, sMsg)
|
||||
If Not bCalc Then
|
||||
NewPartM.m_nCALC_State = CalcStates.NOTCALCULATED
|
||||
NewPartM.m_nCALC_ERR = -1
|
||||
NewPartM.m_nCALC_ROT = 0
|
||||
NewPartM.m_nCALC_FALL = 0
|
||||
NewPartM.m_sCALC_MSG = ""
|
||||
Else
|
||||
NewPartM.m_nCALC_ERR = nErr
|
||||
NewPartM.m_nCALC_ROT = nRot
|
||||
NewPartM.m_nCALC_FALL = nFall
|
||||
NewPartM.m_sCALC_MSG = sMsg
|
||||
Select Case nErr
|
||||
Case 0
|
||||
NewPartM.nCALC_State = CalcStates.OK
|
||||
Case 22
|
||||
NewPartM.nCALC_State = CalcStates.COLLISION
|
||||
Case 17, 19
|
||||
NewPartM.nCALC_State = CalcStates.WARNING
|
||||
Case < 0
|
||||
NewPartM.nCALC_State = CalcStates.INFO
|
||||
Case > 0
|
||||
NewPartM.nCALC_State = CalcStates.ERROR_
|
||||
End Select
|
||||
End If
|
||||
EgtGetInfo(NewPartM.nPartId, ITG_PROD_TIME, NewPartM.m_nCALC_TIME)
|
||||
End Sub
|
||||
|
||||
Public Sub ReadVolume()
|
||||
' leggo volume
|
||||
If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, dVolume) Then
|
||||
Dim nOrigId As Integer = EgtDuploGetOriginal(nPartId)
|
||||
EgtGetInfo(nOrigId, BTL_PRT_VOLUME, dVolume)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Part
|
||||
|
||||
#Region "Beam"
|
||||
|
||||
Public Sub UpdateOffset()
|
||||
' calcolo offset
|
||||
Dim nBeamIndex As Integer = ParentMachGroup.PartMList.IndexOf(Me)
|
||||
If nBeamIndex > 0 Then
|
||||
m_dOffset = dPOSX - (ParentMachGroup.PartMList(nBeamIndex - 1).dPOSX + ParentMachGroup.PartMList(nBeamIndex - 1).dL)
|
||||
Else
|
||||
m_dOffset = dPOSX
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Beam
|
||||
|
||||
#Region "Features"
|
||||
|
||||
Public Shared Function LoadBTLFeatures(NewPartM As PartM, nPartId As Integer) As List(Of BTLFeatureM)
|
||||
Dim TempList As New List(Of BTLFeatureM)
|
||||
' Aggiungo outline
|
||||
Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId)
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia una feature
|
||||
Dim nGRP As Integer
|
||||
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nOutlineId, BTL_FTR_MAINID) Then
|
||||
' creo la feature
|
||||
TempList.Add(BTLFeatureM.CreateBTLFeature(NewPartM, nOutlineId, False))
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
' Aggiungo feature
|
||||
Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
|
||||
While nFeatureId <> GDB_ID.NULL
|
||||
' verifico che sia una feature
|
||||
Dim nGRP As Integer
|
||||
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nFeatureId, BTL_FTR_MAINID) Then
|
||||
' creo la feature
|
||||
TempList.Add(BTLFeatureM.CreateBTLFeature(NewPartM, nFeatureId, False))
|
||||
End If
|
||||
nFeatureId = EgtGetNext(nFeatureId)
|
||||
End While
|
||||
Return TempList
|
||||
End Function
|
||||
|
||||
Public Sub AddBTLFeature(BTLFeatureM As BTLFeatureM)
|
||||
If IsNothing(BTLFeatureM) Then Return
|
||||
If Not m_FeatureMList.Contains(BTLFeatureM) Then
|
||||
m_FeatureMList.Add(BTLFeatureM)
|
||||
RaiseEvent BTLFeatureAdded(Me, New BTLFeatureAddedEventArgs(BTLFeatureM))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function GetBTLFeatures() As List(Of BTLFeatureM)
|
||||
Return New List(Of BTLFeatureM)(m_FeatureMList)
|
||||
End Function
|
||||
|
||||
#End Region ' Features
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
+2
-2
@@ -27,7 +27,7 @@ Public Class WallMachGroupM
|
||||
NewMachGroupM.m_Id = nId
|
||||
NewMachGroupM.m_Name = sName
|
||||
NewMachGroupM.m_Machine = sMachine
|
||||
NewMachGroupM.SetMachineType(MachineType.WALL)
|
||||
NewMachGroupM.m_nType = MachineType.WALL
|
||||
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
||||
@@ -48,7 +48,7 @@ Public Class WallMachGroupM
|
||||
If NewMachGroupM.m_Id = GDB_ID.NULL Then Return Nothing
|
||||
NewMachGroupM.m_Name = sName
|
||||
NewMachGroupM.m_Machine = sMachine
|
||||
NewMachGroupM.SetMachineType(MachineType.WALL)
|
||||
NewMachGroupM.m_nType = MachineType.WALL
|
||||
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
||||
@@ -6,7 +6,7 @@ Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamMachGroupVM
|
||||
Public MustInherit Class BeamMachGroupVM
|
||||
Inherits MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property m_BeamMachGroupM As BeamMachGroupM
|
||||
@@ -58,17 +58,7 @@ Public Class BeamMachGroupVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreateBeamVMList()
|
||||
Dim all As List(Of BeamVM) = (From BeamM In m_BeamMachGroupM.GetParts()
|
||||
Select New BeamVM(BeamM, Me)).ToList()
|
||||
|
||||
For Each BeamVM As BeamVM In all
|
||||
AddHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_PartVMList = New ObservableCollection(Of PartVM)(all)
|
||||
AddHandler m_PartVMList.CollectionChanged, AddressOf OnBeamVMListChanged
|
||||
End Sub
|
||||
Protected MustOverride Sub CreateBeamVMList()
|
||||
|
||||
Public Overrides Sub RefreshPartList()
|
||||
End Sub
|
||||
@@ -84,16 +74,13 @@ Public Class BeamMachGroupVM
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnBeamAdded(sender As Object, e As PartAddedEventArgs)
|
||||
Dim BeamVM As BeamVM = New BeamVM(e.NewPart, Me)
|
||||
PartVMList.Add(BeamVM)
|
||||
End Sub
|
||||
Protected MustOverride Sub OnBeamAdded(sender As Object, e As PartAddedEventArgs)
|
||||
Private Sub OnBeamRemoved(sender As Object, e As PartAddedEventArgs)
|
||||
Dim BeamVM As BeamVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
|
||||
If Not IsNothing(BeamVM) Then PartVMList.Remove(BeamVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnBeamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
Protected Sub OnBeamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If e.Action = NotifyCollectionChangedAction.Add Then
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BeamVM As BeamVM In e.NewItems
|
||||
@@ -115,7 +102,7 @@ Public Class BeamMachGroupVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnBeamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Protected Overridable Sub OnBeamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
|
||||
@@ -4,7 +4,7 @@ Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BeamVM
|
||||
Public MustInherit Class BeamVM
|
||||
Inherits PartVM
|
||||
|
||||
Public ReadOnly Property m_BeamM As BeamM
|
||||
@@ -30,10 +30,6 @@ Public Class BeamVM
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(BeamM As BeamM)
|
||||
MyBase.New(BeamM)
|
||||
End Sub
|
||||
|
||||
Sub New(BeamM As BeamM, ParentMachGroupVM As BeamMachGroupVM)
|
||||
MyBase.New(BeamM, ParentMachGroupVM)
|
||||
End Sub
|
||||
|
||||
@@ -5,7 +5,7 @@ Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MyMachGroupPanelVM
|
||||
Public MustInherit Class MyMachGroupPanelVM
|
||||
Inherits NewMachGroupPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
@@ -29,12 +29,48 @@ Public Class MyMachGroupPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotTime As String
|
||||
Public ReadOnly Property sTotEstimatedTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.nCALC_TIME, Func(Of MachGroupVM, Double)))).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dTotTime As String
|
||||
Get
|
||||
Return m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) If(x.nProduction_State >= ItemState.Produced AndAlso Not IsNothing(x.dtEndTime) AndAlso x.dtEndTime <> DateTime.MinValue, (x.dtEndTime - x.dtStartTime).TotalSeconds(), x.nCALC_TIME), Func(Of MachGroupVM, Double)))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sTotTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(dTotTime).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dDoneTime As String
|
||||
Get
|
||||
Return m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) If(x.nProduction_State >= ItemState.Produced AndAlso Not IsNothing(x.dtEndTime) AndAlso x.dtEndTime <> DateTime.MinValue, (x.dtEndTime - x.dtStartTime).TotalSeconds(), 0), Func(Of MachGroupVM, Double)))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sDoneTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(dDoneTime).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dRemainingTime As String
|
||||
Get
|
||||
Return m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) If(x.nProduction_State < ItemState.Produced, x.nCALC_TIME, 0), Func(Of MachGroupVM, Double)))
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sRemainingTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(dRemainingTime).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -49,23 +85,7 @@ Public Class MyMachGroupPanelVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Protected Overrides Sub CreateMachGroupVMList()
|
||||
Dim all As New List(Of MachGroupVM)
|
||||
For Each MachGroupM In m_MachGroupPanelM.GetMachGroups()
|
||||
If DirectCast(MachGroupM, MyMachGroupM).nMachineType = MachineType.BEAM Then
|
||||
all.Add(New BeamMachGroupVM(MachGroupM))
|
||||
Else
|
||||
all.Add(New WallMachGroupVM(MachGroupM))
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each MachGroupvM As MachGroupVM In all
|
||||
AddHandler MachGroupvM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged
|
||||
Next
|
||||
|
||||
MachGroupVMList = New ObservableCollection(Of MachGroupVM)(all)
|
||||
AddHandler MachGroupVMList.CollectionChanged, AddressOf OnMachGroupVMListChanged
|
||||
End Sub
|
||||
Protected MustOverride Overrides Sub CreateMachGroupVMList()
|
||||
|
||||
Public Overrides Function InitMachGroupList(Optional bUseDefaults As Boolean = False) As Boolean
|
||||
' Svuoto precedente lista di MachGroup
|
||||
@@ -88,6 +108,21 @@ Public Class MyMachGroupPanelVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub RedrawModifiedMachGroup(RedrawList As List(Of Integer))
|
||||
For Each nMachGroupId In RedrawList
|
||||
EgtSetCurrMachGroup(nMachGroupId)
|
||||
' elimino vecchio grezzo ed eseguo script creazione nuovo
|
||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
EgtRemovePartFromRawPart(EgtGetFirstPartInRawPart(nRawId))
|
||||
EgtRemoveRawPart(nRawId)
|
||||
nRawId = EgtGetFirstRawPart()
|
||||
End While
|
||||
'If Not ExecBeam(Map.refMainWindowVM.MainWindowM.sTempDir, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then Return False
|
||||
|
||||
Next
|
||||
End Sub
|
||||
|
||||
'Public Overrides Sub AddMachGroup()
|
||||
' Dim MyMachGroupM As MyMachGroupM = m_MyMachGroupPanelM.NewMyMachGroup(CurrentMachine.sMachineName, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
' ' e lo seleziono
|
||||
@@ -101,21 +136,11 @@ Public Class MyMachGroupPanelVM
|
||||
|
||||
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
|
||||
' resetto eventuale selezione pezzo
|
||||
DirectCast(SelectedMachGroup, MyMachGroupVM).SelPart = Nothing
|
||||
Dim SelMachGroup As MyMachGroupVM = DirectCast(SelectedMachGroup, MyMachGroupVM)
|
||||
SelMachGroup.SelPart = Nothing
|
||||
' Imposto vista solo tavola
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
Dim View As VT
|
||||
For Each Mach As MyMachine In CoreMap.refMachinePanelVM.MachineList
|
||||
If Mach.Name = SelectedMachGroup.Machine Then
|
||||
If Mach.nType = Core.ConstBeam.MachineType.BEAM Then
|
||||
View = VT.ISO_SW
|
||||
Else
|
||||
View = VT.TOP
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
EgtSetView(View, False)
|
||||
Core.ViewPanelVM.BWSetView(If(ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
Return True
|
||||
End Function
|
||||
@@ -149,6 +174,7 @@ Public Class MyMachGroupPanelVM
|
||||
' funzione che aggiorna totale tempi a fine calcolo
|
||||
Public Sub CalcGlobalTime()
|
||||
NotifyPropertyChanged(NameOf(sTotTime))
|
||||
NotifyPropertyChanged(NameOf(sRemainingTime))
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna numero gruppi di lavorazione e volume totale
|
||||
@@ -156,29 +182,26 @@ Public Class MyMachGroupPanelVM
|
||||
NotifyPropertyChanged(NameOf(sTotMachGroups))
|
||||
NotifyPropertyChanged(NameOf(sTotVolume))
|
||||
NotifyPropertyChanged(NameOf(sTotTime))
|
||||
NotifyPropertyChanged(NameOf(sRemainingTime))
|
||||
End Sub
|
||||
|
||||
Public Shared Sub DuploRemoveProjCalc(nPartDuploId As Integer)
|
||||
EgtSetInfo(nPartDuploId, ITG_PROJ_ERR, "")
|
||||
EgtSetInfo(nPartDuploId, ITG_PROJ_MSG, "")
|
||||
EgtSetInfo(nPartDuploId, ITG_PROJ_ROT, "")
|
||||
EgtSetInfo(nPartDuploId, ITG_PROJ_FALL, "")
|
||||
EgtSetInfo(nPartDuploId, ITG_PROJ_TIME, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Protected Overrides Sub OnMachGroupAdded(sender As Object, e As MachGroupAddedEventArgs)
|
||||
Dim MachGroupVM As MachGroupVM = Nothing
|
||||
Select Case DirectCast(e.NewMachGroupM, MyMachGroupM).nMachineType
|
||||
Case Core.ConstBeam.MachineType.BEAM
|
||||
MachGroupVM = New BeamMachGroupVM(e.NewMachGroupM)
|
||||
Case Core.ConstBeam.MachineType.WALL
|
||||
MachGroupVM = New WallMachGroupVM(e.NewMachGroupM)
|
||||
Case Core.ConstBeam.MachineType.NULL
|
||||
Return
|
||||
End Select
|
||||
MachGroupVMList.Add(MachGroupVM)
|
||||
NotifyPropertyChanged(NameOf(MachGroupVMList))
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnMachGroupVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
'Case nameof(sender.sMATERIAL)
|
||||
Case NameOf(sender.nProduction_State)
|
||||
NotifyPropertyChanged(NameOf(sTotTime))
|
||||
NotifyPropertyChanged(NameOf(sRemainingTime))
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
@@ -10,15 +12,27 @@ Imports EgtWPFLib5
|
||||
Public MustInherit Class MyMachGroupVM
|
||||
Inherits MachGroupVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
#Region "General"
|
||||
|
||||
Public ReadOnly Property MyMachGroupM As MyMachGroupM
|
||||
Get
|
||||
Return m_MachGroupM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nMachineType As MachineType
|
||||
Public ReadOnly Property nType As BWType
|
||||
Get
|
||||
Return MyMachGroupM.nMachineType
|
||||
Return MyMachGroupM.nType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nName As Integer
|
||||
Get
|
||||
Dim nIntName As Integer = 0
|
||||
Integer.TryParse(MyMachGroupM.Name, nIntName)
|
||||
Return nIntName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -71,13 +85,13 @@ Public MustInherit Class MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property dUsage As Double
|
||||
Get
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, MyMachGroupM.dMatForPart / MyMachGroupM.dTotMat * 100, 0)
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, If(nType = BWType.WALL, MyMachGroupM.dMatForPart / MyMachGroupM.dTotMat * 100, MyMachGroupM.dMatForPart / MyMachGroupM.dL * 100), 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dWaste As Double
|
||||
Get
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, (MyMachGroupM.dTotMat - MyMachGroupM.dMatForPart) / MyMachGroupM.dTotMat * 100, 0)
|
||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, If(nType = BWType.WALL, (MyMachGroupM.dTotMat - MyMachGroupM.dMatForPart) / 1000000000, MyMachGroupM.dL - MyMachGroupM.dTotMat), 0)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -89,7 +103,7 @@ Public MustInherit Class MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property sWaste As String
|
||||
Get
|
||||
Return DoubleToString(dWaste, 3)
|
||||
Return LenToString(dWaste, 3)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -102,6 +116,24 @@ Public MustInherit Class MyMachGroupVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sUnitTime As String
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(nCALC_TIME).ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dUnitVolume As Double
|
||||
Get
|
||||
Return dL * dW * dH
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Section As SectionXMaterial
|
||||
Get
|
||||
Return New SectionXMaterial(dW, dH, dL, MyMachGroupM.sMATERIAL)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' lista dei pezzi che sono nel grezzo
|
||||
Protected m_PartVMList As New ObservableCollection(Of PartVM)
|
||||
Public Property PartVMList As ObservableCollection(Of PartVM)
|
||||
@@ -128,6 +160,36 @@ Public MustInherit Class MyMachGroupVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' General
|
||||
|
||||
#Region "Beam"
|
||||
|
||||
Public Overridable Property sStartCut As String
|
||||
Get
|
||||
Return LenToString(MyMachGroupM.dStartCut, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLenAdv(value, MyMachGroupM.dStartCut, True)
|
||||
End Set
|
||||
End Property
|
||||
Public Property dStartCut As Double
|
||||
Get
|
||||
Return MyMachGroupM.dStartCut
|
||||
End Get
|
||||
Set(value As Double)
|
||||
MyMachGroupM.dStartCut = value
|
||||
NotifyPropertyChanged(NameOf(sStartCut))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Beam
|
||||
|
||||
#Region "Wall"
|
||||
|
||||
#End Region ' Wall
|
||||
|
||||
#Region "Calc"
|
||||
|
||||
Public ReadOnly Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_ERR
|
||||
@@ -173,6 +235,12 @@ Public MustInherit Class MyMachGroupVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nPartsGlobalState As CalcStates
|
||||
Get
|
||||
Return MyMachGroupM.bCALC_PartsGlobalState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nCALC_State As CalcStates
|
||||
Get
|
||||
Return MyMachGroupM.nCALC_State
|
||||
@@ -184,37 +252,18 @@ Public MustInherit Class MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If MyMachGroupM.nCALC_GlobalState = CalcStates.OK Then
|
||||
Return Brushes.Green
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.WARNING Then
|
||||
Return Brushes.Gold
|
||||
ElseIf MyMachGroupM.nCALC_GlobalState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nProduction_State As Integer
|
||||
Get
|
||||
Return MyMachGroupM.nProductionState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable ReadOnly Property Production_Background As SolidColorBrush
|
||||
Get
|
||||
If dtEndTime <> DateTime.MinValue Then ' barra finita
|
||||
Return Brushes.LightGray
|
||||
ElseIf dtStartTime <> DateTime.MinValue Then ' barra iniziata
|
||||
Return Brushes.Green
|
||||
Else ' barra in coda
|
||||
Return Brushes.White
|
||||
End If
|
||||
Select Case MyMachGroupM.nCALC_GlobalState
|
||||
Case CalcStates.ERROR_, CalcStates.COLLISION
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
Case CalcStates.INFO, CalcStates.OK
|
||||
Return Brushes.Green
|
||||
Case CalcStates.NOTCALCULATED
|
||||
Return Brushes.LightGray
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -232,14 +281,14 @@ Public MustInherit Class MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case MyMachGroupM.nCALC_GlobalERR
|
||||
Case 22
|
||||
Select Case MyMachGroupM.nCALC_GlobalState
|
||||
Case CalcStates.COLLISION
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Case CalcStates.ERROR_
|
||||
Return "e"
|
||||
Case 17
|
||||
Case CalcStates.WARNING
|
||||
Return "w"
|
||||
Case < 0
|
||||
Case CalcStates.INFO
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
@@ -250,7 +299,7 @@ Public MustInherit Class MyMachGroupVM
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case MyMachGroupM.m_nCALC_GlobalState
|
||||
Case CalcStates.ERROR_
|
||||
Case CalcStates.ERROR_, CalcStates.COLLISION
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
@@ -262,26 +311,148 @@ Public MustInherit Class MyMachGroupVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sUnitTime As String
|
||||
#End Region ' Calc
|
||||
|
||||
#Region "Supervisor"
|
||||
|
||||
Public Property nProduction_State As ItemState
|
||||
Get
|
||||
Return TimeSpan.FromSeconds(nCALC_TIME).ToString()
|
||||
Return MyMachGroupM.nProductionState
|
||||
End Get
|
||||
Set(value As ItemState)
|
||||
MyMachGroupM.SetProductionState(value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Production_Background As SolidColorBrush
|
||||
Get
|
||||
Select Case nProduction_State
|
||||
Case ItemState.ND
|
||||
Return Brushes.White
|
||||
Case ItemState.Assigned, ItemState.Confirmed
|
||||
If m_bToBeProduced Then ' barra in attesa
|
||||
If m_bCNReCalculated Then
|
||||
Return Brushes.Orange
|
||||
Else ' barra in check calc
|
||||
Return Brushes.Purple
|
||||
End If
|
||||
Else ' barra in coda
|
||||
Return Brushes.White
|
||||
End If
|
||||
Case ItemState.WIP
|
||||
Return Brushes.Green
|
||||
Case ItemState.Produced
|
||||
Return Brushes.Yellow
|
||||
Case Else ' ItemState.Scrapped
|
||||
Return Brushes.Aqua
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dUnitVolume As Double
|
||||
' indica se il pezzo deve essere tagliato
|
||||
Protected m_bToBeProduced As Boolean = False
|
||||
Public ReadOnly Property bToBeProduced As Boolean
|
||||
Get
|
||||
Return dL * dW * dH
|
||||
Return m_bToBeProduced
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Section As SectionXMaterial
|
||||
' indica se il pezzo e' gia' stato ricalcolato e quindi pronto a partire
|
||||
Protected m_bCNReCalculated As Boolean = False
|
||||
Public ReadOnly Property bReadyForMachining As Boolean
|
||||
Get
|
||||
Return New SectionXMaterial(dW, dH, dL, MyMachGroupM.sMATERIAL)
|
||||
Return m_bToBeProduced AndAlso m_bCNReCalculated
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_bSendingToMachine As Boolean = False
|
||||
Public ReadOnly Property bSendingToMachine As Boolean
|
||||
Get
|
||||
Return m_bSendingToMachine
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetSendingToMachine(value As Boolean)
|
||||
m_bSendingToMachine = value
|
||||
End Sub
|
||||
|
||||
' indica se il pezzo e' stato mandato alla macchina
|
||||
Protected m_bSentToMachine As Boolean = False
|
||||
Public ReadOnly Property bSentToMachine As Boolean
|
||||
Get
|
||||
Return m_bSentToMachine
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetSentToMachine(value As Boolean)
|
||||
m_bSentToMachine = value
|
||||
m_bSendingToMachine = False
|
||||
End Sub
|
||||
|
||||
' indica se la macchina e' stata interrotta durante la lavorazione
|
||||
Protected m_bResetWhileCutting As Boolean = False
|
||||
Public ReadOnly Property bResetWhileCutting As Boolean
|
||||
Get
|
||||
Return m_bResetWhileCutting
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetResetWhileCutting(value As Boolean)
|
||||
m_bResetWhileCutting = value
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property Background As SolidColorBrush
|
||||
Get
|
||||
Select Case nProduction_State
|
||||
Case ItemState.ND
|
||||
Return Brushes.White
|
||||
Case ItemState.Assigned
|
||||
Return Brushes.LightGray
|
||||
Case ItemState.Confirmed
|
||||
Return Brushes.LightGray
|
||||
Case ItemState.WIP
|
||||
Return Brushes.Green
|
||||
Case ItemState.Produced
|
||||
Return Brushes.Yellow
|
||||
Case Else ' ItemState.Scrapped
|
||||
Return Brushes.Aqua
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable ReadOnly Property Produce_IsEnabled As Boolean
|
||||
Get
|
||||
Select Case nProduction_State
|
||||
Case ItemState.Assigned, ItemState.Confirmed
|
||||
Return Not m_bToBeProduced
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SupervisorId As String = ""
|
||||
Public ReadOnly Property SupervisorId As String
|
||||
Get
|
||||
Return m_SupervisorId
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetSupervisorId(SupervisorId As String)
|
||||
m_SupervisorId = SupervisorId
|
||||
End Sub
|
||||
|
||||
Private m_cc As StateChangeEventArgs
|
||||
|
||||
Public ReadOnly Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return String.IsNullOrEmpty(m_SupervisorId)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Supervisor
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdDeleteMachGroup As ICommand
|
||||
Private m_cmdProduceMachGroup As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
@@ -289,21 +460,57 @@ Public MustInherit Class MyMachGroupVM
|
||||
MyBase.New(MyMachGroupM)
|
||||
'aggiorno lista pezzi
|
||||
RefreshPartList()
|
||||
AddHandler MyMachGroupM.PartAdded, AddressOf OnPartAdded
|
||||
AddHandler MyMachGroupM.PartRemoved, AddressOf OnPartRemoved
|
||||
CreatePartVMList()
|
||||
' Aggiorno stato da stati feature
|
||||
CalcGlobalUpdate()
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
#Region "Machgroup"
|
||||
|
||||
Public MustOverride Sub RefreshGroupData()
|
||||
|
||||
Public Overridable Function Copy() As MyMachGroupVM
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
Public Sub UpdateUsage()
|
||||
If nType = BWType.BEAM Then
|
||||
MyMachGroupM.SetMatForPart(0)
|
||||
Dim dPartLength As Double
|
||||
Dim dPartOffsetLength As Double
|
||||
For Each Part In PartVMList
|
||||
dPartOffsetLength += Part.dL + Part.dOffset
|
||||
dPartLength += Part.dL
|
||||
Next
|
||||
MyMachGroupM.SetTotMat(dPartOffsetLength)
|
||||
MyMachGroupM.SetMatForPart(dPartLength)
|
||||
Else
|
||||
MyMachGroupM.SetTotMat(dL * dH * dW)
|
||||
MyMachGroupM.SetMatForPart(0)
|
||||
Dim dPartVolume As Double
|
||||
For Each Part In PartVMList
|
||||
dPartVolume += Part.dVolume
|
||||
Next
|
||||
MyMachGroupM.SetMatForPart(dPartVolume)
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sUsage))
|
||||
NotifyPropertyChanged(NameOf(sWaste))
|
||||
End Sub
|
||||
|
||||
Public MustOverride Sub RefreshPartList()
|
||||
Public Overridable Function CnFilePath() As String
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Public MustOverride Sub RefreshGroupData()
|
||||
#End Region ' Machgroup
|
||||
|
||||
#Region "Calc"
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcMachGroupUpdate(ERR As Integer, ROT As Integer, MSG As String)
|
||||
@@ -313,15 +520,18 @@ Public MustInherit Class MyMachGroupVM
|
||||
MyMachGroupM.nCALC_ERR = ERR
|
||||
MyMachGroupM.nCALC_ROT = ROT
|
||||
MyMachGroupM.sCALC_MSG = MSG
|
||||
If ERR = 0 Then
|
||||
nCALC_State = CalcStates.OK
|
||||
ElseIf ERR = 17 Then
|
||||
nCALC_State = CalcStates.WARNING
|
||||
ElseIf ERR > 0 Then
|
||||
nCALC_State = CalcStates.ERROR_
|
||||
ElseIf ERR < 0 Then
|
||||
nCALC_State = CalcStates.INFO
|
||||
End If
|
||||
Select Case ERR
|
||||
Case 0
|
||||
nCALC_State = CalcStates.OK
|
||||
Case 22
|
||||
nCALC_State = CalcStates.COLLISION
|
||||
Case 17, 19
|
||||
nCALC_State = CalcStates.WARNING
|
||||
Case < 0
|
||||
nCALC_State = CalcStates.INFO
|
||||
Case > 0
|
||||
nCALC_State = CalcStates.ERROR_
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
@@ -344,28 +554,22 @@ Public MustInherit Class MyMachGroupVM
|
||||
End Sub
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcGlobalUpdate()
|
||||
Public Overridable Sub CalcGlobalUpdate()
|
||||
MyMachGroupM.nCALC_GlobalERR = nCALC_ERR
|
||||
MyMachGroupM.nCALC_GlobalState = nCALC_State
|
||||
' stato globale dei pezzi
|
||||
MyMachGroupM.bCALC_PartsGlobalState = CalcStates.NOTCALCULATED
|
||||
For Each Part In MyMachGroupM.PartMList
|
||||
If Part.nCALC_GlobalState = CalcStates.NOTCALCULATED Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
If Part.nCALC_GlobalState = CalcStates.NOTCALCULATED And nCALC_State < CalcStates.ERROR_ Then
|
||||
MyMachGroupM.nCALC_GlobalState = Part.nCALC_GlobalState
|
||||
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
|
||||
Exit For
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.OK AndAlso MyMachGroupM.m_nCALC_GlobalState = Core.CalcStates.NOTCALCULATED Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.OK
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.INFO And (MyMachGroupM.nCALC_GlobalState = CalcStates.OK Or MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED) Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.INFO
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.WARNING And (MyMachGroupM.nCALC_GlobalState = CalcStates.OK Or MyMachGroupM.nCALC_GlobalState = CalcStates.INFO Or MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED) Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.WARNING
|
||||
ElseIf Part.nCALC_GlobalState = CalcStates.ERROR_ And (MyMachGroupM.nCALC_GlobalState = CalcStates.OK Or MyMachGroupM.nCALC_GlobalState = CalcStates.INFO Or MyMachGroupM.nCALC_GlobalState = CalcStates.WARNING Or MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED) Then
|
||||
MyMachGroupM.nCALC_GlobalState = CalcStates.ERROR_
|
||||
ElseIf Part.nCALC_GlobalState > MyMachGroupM.nCALC_GlobalState Then
|
||||
MyMachGroupM.nCALC_GlobalState = Part.nCALC_GlobalState
|
||||
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
|
||||
End If
|
||||
If Part.nCALC_GlobalERR = 22 Then
|
||||
MyMachGroupM.nCALC_GlobalERR = 22
|
||||
ElseIf Part.nCALC_GlobalERR > 0 And MyMachGroupM.nCALC_GlobalERR <= 0 Then
|
||||
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
|
||||
ElseIf Part.nCALC_GlobalERR < 0 And MyMachGroupM.nCALC_GlobalERR = 0 Then
|
||||
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
|
||||
If Part.nCALC_GlobalState > MyMachGroupM.bCALC_PartsGlobalState Then
|
||||
MyMachGroupM.bCALC_PartsGlobalState = Part.nCALC_GlobalState
|
||||
End If
|
||||
If Part.nCALC_ROT <> 0 Then
|
||||
MyMachGroupM.m_nCALC_ROT = Part.nCALC_ROT
|
||||
@@ -374,6 +578,7 @@ Public MustInherit Class MyMachGroupVM
|
||||
MyMachGroupM.nCALC_FALL = Part.nCALC_FALL
|
||||
End If
|
||||
Next
|
||||
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
@@ -387,6 +592,38 @@ Public MustInherit Class MyMachGroupVM
|
||||
NotifyPropertyChanged(NameOf(sUnitTime))
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub CALCEnd()
|
||||
End Sub
|
||||
|
||||
#End Region ' Calc
|
||||
|
||||
#Region "Supervisor"
|
||||
|
||||
Public Sub SentToSupervisor()
|
||||
MyMachGroupM.SetProductionState(ItemState.Assigned)
|
||||
NotifyPropertyChanged(NameOf(Background))
|
||||
End Sub
|
||||
|
||||
Public Sub ResetProduce()
|
||||
m_bCNReCalculated = False
|
||||
m_bToBeProduced = False
|
||||
m_bSendingToMachine = False
|
||||
m_bSentToMachine = False
|
||||
NotifyPropertyChanged(NameOf(Production_Background))
|
||||
End Sub
|
||||
|
||||
#End Region ' Supervisor
|
||||
|
||||
#Region "Parts"
|
||||
|
||||
Protected MustOverride Sub CreatePartVMList()
|
||||
|
||||
Public MustOverride Sub RefreshPartList()
|
||||
|
||||
#End Region ' Parts
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeleteMachGroup"
|
||||
@@ -395,13 +632,17 @@ Public MustInherit Class MyMachGroupVM
|
||||
Public ReadOnly Property DeleteMachGroup_Command As ICommand
|
||||
Get
|
||||
If m_cmdDeleteMachGroup Is Nothing Then
|
||||
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroup)
|
||||
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroupCmd)
|
||||
End If
|
||||
Return m_cmdDeleteMachGroup
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable Sub DeleteMachGroup()
|
||||
Public Sub DeleteMachGroupCmd()
|
||||
DeleteMachGroup()
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub DeleteMachGroup(Optional bMultipleCommand As Boolean = False)
|
||||
' elimino tutte le copie
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
@@ -417,6 +658,66 @@ Public MustInherit Class MyMachGroupVM
|
||||
|
||||
#End Region ' DeleteMachGroup
|
||||
|
||||
#Region "ProduceMachGroup"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property ProduceMachGroup_Command As ICommand
|
||||
Get
|
||||
If m_cmdProduceMachGroup Is Nothing Then
|
||||
m_cmdProduceMachGroup = New Command(AddressOf ProduceMachGroup)
|
||||
End If
|
||||
Return m_cmdProduceMachGroup
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Overridable Sub ProduceMachGroup()
|
||||
End Sub
|
||||
|
||||
#End Region ' ProduceMachGroup
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Protected MustOverride Sub OnPartAdded(sender As Object, e As PartAddedEventArgs)
|
||||
|
||||
Private Sub OnPartRemoved(sender As Object, e As PartAddedEventArgs)
|
||||
Dim PartVM As PartVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
|
||||
If Not IsNothing(PartVM) Then PartVMList.Remove(PartVM)
|
||||
End Sub
|
||||
|
||||
Protected Sub OnPartVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If e.Action = NotifyCollectionChangedAction.Add Then
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each PartVM As PartVM In e.NewItems
|
||||
AddHandler PartVM.PropertyChanged, AddressOf OnPartVMPropertyChanged
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If e.Action = NotifyCollectionChangedAction.Remove Then
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each PartVM As PartVM In e.OldItems
|
||||
RemoveHandler PartVM.PropertyChanged, AddressOf OnPartVMPropertyChanged
|
||||
MyMachGroupM.PartMList.Remove(PartVM.PartM)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If e.Action = NotifyCollectionChangedAction.Move Then
|
||||
Dim ItemVM As PartVM = e.OldItems(0)
|
||||
MyMachGroupM.PartMList.RemoveAt(e.OldStartingIndex)
|
||||
MyMachGroupM.PartMList.Insert(e.NewStartingIndex, ItemVM.PartM)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Overridable Sub OnPartVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
Case NameOf(sender.sPOSX), NameOf(sender.sPOSY), NameOf(sender.bFLIP), NameOf(sender.sROT)
|
||||
' setto pezzo da ricalcolare
|
||||
ResetCalcMachGroup()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -14,6 +14,8 @@ Public MustInherit Class PartVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
#Region "General"
|
||||
|
||||
Protected m_PartM As PartM
|
||||
Public ReadOnly Property PartM As PartM
|
||||
Get
|
||||
@@ -105,7 +107,7 @@ Public MustInherit Class PartVM
|
||||
Return LenToString(m_PartM.dPOSX, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_PartM.dPOSX)
|
||||
StringToLenAdv(value, m_PartM.dPOSX, True)
|
||||
End Set
|
||||
End Property
|
||||
Public Property dPOSX As Double
|
||||
@@ -133,12 +135,24 @@ Public MustInherit Class PartVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nINVERTED As Integer
|
||||
Get
|
||||
Return m_PartM.nINVERTED
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sROTATED As String
|
||||
Get
|
||||
Return m_PartM.nROTATED & "°"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nROTATED As Integer
|
||||
Get
|
||||
Return m_PartM.nROTATED
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_PartM.sMATERIAL
|
||||
@@ -148,6 +162,117 @@ Public MustInherit Class PartVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sSTOREY As String
|
||||
Get
|
||||
Return m_PartM.sSTOREY
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sGROUP As String
|
||||
Get
|
||||
Return m_PartM.sGROUP
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dVolume As Double
|
||||
Get
|
||||
Return m_PartM.dVolume
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' lista delle feature del pezzo
|
||||
Protected m_FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
Public Property FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
Get
|
||||
Return m_FeatureVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLFeatureVM))
|
||||
m_FeatureVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelFeatureVM As BTLFeatureVM
|
||||
Public Property SelFeatureVM As BTLFeatureVM
|
||||
Get
|
||||
Return m_SelFeatureVM
|
||||
End Get
|
||||
Set(value As BTLFeatureVM)
|
||||
m_SelFeatureVM = value
|
||||
If Not IsNothing(m_SelFeatureVM) Then
|
||||
DirectCast(m_SelFeatureVM, BTLFeatureVM).SelGeomFeature()
|
||||
Else
|
||||
EgtDeselectAll()
|
||||
End If
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelFeatureVM))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' General
|
||||
|
||||
#Region "Beam"
|
||||
|
||||
Public Overridable Property sOffset As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dOffset, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLenAdv(value, m_PartM.dOffset, True)
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property dOffset As Double
|
||||
Get
|
||||
Return m_PartM.dOffset
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Beam
|
||||
|
||||
#Region "Wall"
|
||||
|
||||
Public Overridable Property sPOSY As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dPOSY, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLenAdv(value, m_PartM.dPOSY, True)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dPOSY As Double
|
||||
Get
|
||||
Return m_PartM.dPOSY
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sROT As String
|
||||
Get
|
||||
Return LenToString(m_PartM.dROT, 3) & "°"
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLenAdv(value, m_PartM.dROT, True)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dROT As Double
|
||||
Get
|
||||
Return m_PartM.dROT
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable Property nFLIP As Integer
|
||||
Get
|
||||
Return m_PartM.nFLIP
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_PartM.nFLIP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Wall
|
||||
|
||||
#Region "Calc"
|
||||
|
||||
Public ReadOnly Property nGlobalState As CalcStates
|
||||
Get
|
||||
Return m_PartM.nCALC_GlobalState
|
||||
@@ -174,40 +299,18 @@ Public MustInherit Class PartVM
|
||||
|
||||
Public ReadOnly Property Calc_Background As SolidColorBrush
|
||||
Get
|
||||
If m_PartM.nCALC_GlobalState = CalcStates.OK Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED Then
|
||||
Return Brushes.LightGray
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.WARNING Then
|
||||
Return Brushes.Orange
|
||||
ElseIf m_PartM.nCALC_GlobalState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
Return Brushes.Red
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property nProduction_State As CalcStates
|
||||
Get
|
||||
Return m_PartM.nProductionState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_PartM.SetProductionState(value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Production_Background As SolidColorBrush
|
||||
Get
|
||||
If dtEndTime <> DateTime.MinValue Then ' barra finita
|
||||
Return Brushes.LightGray
|
||||
ElseIf dtStartTime <> DateTime.MinValue Then ' barra iniziata
|
||||
Return Brushes.Green
|
||||
Else ' barra in coda
|
||||
Return Brushes.White
|
||||
End If
|
||||
Select Case m_PartM.nCALC_GlobalState
|
||||
Case CalcStates.ERROR_, CalcStates.COLLISION
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
Case CalcStates.INFO, CalcStates.OK
|
||||
Return Brushes.Green
|
||||
Case CalcStates.NOTCALCULATED
|
||||
Return Brushes.LightGray
|
||||
Case Else
|
||||
Return Brushes.Red
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -225,14 +328,14 @@ Public MustInherit Class PartVM
|
||||
|
||||
Public ReadOnly Property CALC_ERR_Letter As String
|
||||
Get
|
||||
Select Case m_PartM.nCALC_GlobalERR
|
||||
Case 22
|
||||
Select Case m_PartM.nCALC_GlobalState
|
||||
Case CalcStates.COLLISION
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Case CalcStates.ERROR_
|
||||
Return "e"
|
||||
Case 17
|
||||
Case CalcStates.WARNING
|
||||
Return "w"
|
||||
Case < 0
|
||||
Case CalcStates.INFO
|
||||
Return "i"
|
||||
Case Else
|
||||
Return ""
|
||||
@@ -243,7 +346,7 @@ Public MustInherit Class PartVM
|
||||
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
||||
Get
|
||||
Select Case m_PartM.nCALC_GlobalState
|
||||
Case CalcStates.ERROR_
|
||||
Case CalcStates.ERROR_, CalcStates.COLLISION
|
||||
Return Brushes.Red
|
||||
Case CalcStates.WARNING
|
||||
Return Brushes.Orange
|
||||
@@ -294,32 +397,34 @@ Public MustInherit Class PartVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle feature del pezzo
|
||||
Protected m_FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
Public Property FeatureVMList As ObservableCollection(Of BTLFeatureVM)
|
||||
#End Region ' Calc
|
||||
|
||||
#Region "Supervisor"
|
||||
|
||||
Public Property nProduction_State As ItemState
|
||||
Get
|
||||
Return m_FeatureVMList
|
||||
Return m_PartM.nProductionState
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLFeatureVM))
|
||||
m_FeatureVMList = value
|
||||
Set(value As ItemState)
|
||||
m_PartM.SetProductionState(value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelFeatureVM As BTLFeatureVM
|
||||
Public Property SelFeatureVM As BTLFeatureVM
|
||||
Public ReadOnly Property Production_Background As SolidColorBrush
|
||||
Get
|
||||
Return m_SelFeatureVM
|
||||
Select Case nProduction_State
|
||||
Case ItemState.ND
|
||||
Return Brushes.White
|
||||
Case ItemState.Assigned, ItemState.Confirmed
|
||||
Return Brushes.White
|
||||
Case ItemState.WIP
|
||||
Return Brushes.Green
|
||||
Case ItemState.Produced
|
||||
Return Brushes.Yellow
|
||||
Case Else ' ItemState.Scrapped
|
||||
Return Brushes.Aqua
|
||||
End Select
|
||||
End Get
|
||||
Set(value As BTLFeatureVM)
|
||||
m_SelFeatureVM = value
|
||||
If Not IsNothing(m_SelFeatureVM) Then
|
||||
DirectCast(m_SelFeatureVM, BTLFeatureVM).SelGeomFeature()
|
||||
Else
|
||||
EgtDeselectAll()
|
||||
End If
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelFeatureVM))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property dtStartTime As DateTime
|
||||
@@ -342,6 +447,41 @@ Public MustInherit Class PartVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' variabile che indica se rifare il pezzo
|
||||
Private m_bRedo As Boolean = True
|
||||
Public Property bRedo As Boolean
|
||||
Get
|
||||
Return m_bRedo
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
For Each Feature In FeatureVMList
|
||||
Feature.bRedo = value
|
||||
Next
|
||||
m_bRedo = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Background As SolidColorBrush
|
||||
Get
|
||||
Select Case nProduction_State
|
||||
Case ItemState.ND
|
||||
Return Brushes.White
|
||||
Case ItemState.Assigned
|
||||
Return Brushes.LightGray
|
||||
Case ItemState.Confirmed
|
||||
Return Brushes.LightGray
|
||||
Case ItemState.WIP
|
||||
Return Brushes.Green
|
||||
Case ItemState.Produced
|
||||
Return Brushes.Yellow
|
||||
Case Else ' ItemState.Scrapped
|
||||
Return Brushes.Aqua
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Supervisor
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdDeletePart As ICommand
|
||||
|
||||
@@ -367,17 +507,15 @@ Public MustInherit Class PartVM
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
Private Sub CreateBTLFeatureVMList()
|
||||
Dim all As List(Of BTLFeatureVM) = (From BTLFeatureM In m_PartM.GetBTLFeatures()
|
||||
Select New BTLFeatureVM(BTLFeatureM)).ToList()
|
||||
#Region "METHODS"
|
||||
|
||||
For Each BTLFeatureVM As BTLFeatureVM In all
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
Next
|
||||
#Region "Feature"
|
||||
|
||||
m_FeatureVMList = New ObservableCollection(Of BTLFeatureVM)(all)
|
||||
AddHandler m_FeatureVMList.CollectionChanged, AddressOf OnBTLFeatureVMListChanged
|
||||
End Sub
|
||||
Protected MustOverride Sub CreateBTLFeatureVMList()
|
||||
|
||||
#End Region ' Feature
|
||||
|
||||
#Region "Calc"
|
||||
|
||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||
Public Sub CalcPartUpdate(ERR As Integer, ROT As Integer, MSG As String)
|
||||
@@ -387,15 +525,18 @@ Public MustInherit Class PartVM
|
||||
m_PartM.nCALC_ERR = ERR
|
||||
m_PartM.nCALC_ROT = ROT
|
||||
m_PartM.sCALC_MSG = MSG
|
||||
If ERR = 0 Then
|
||||
nCALC_State = CalcStates.OK
|
||||
ElseIf ERR = 17 Then
|
||||
nCALC_State = CalcStates.WARNING
|
||||
ElseIf ERR > 0 Then
|
||||
nCALC_State = CalcStates.ERROR_
|
||||
ElseIf ERR < 0 Then
|
||||
nCALC_State = CalcStates.INFO
|
||||
End If
|
||||
Select Case ERR
|
||||
Case 0
|
||||
nCALC_State = CalcStates.OK
|
||||
Case 22
|
||||
nCALC_State = CalcStates.COLLISION
|
||||
Case 17, 19
|
||||
nCALC_State = CalcStates.WARNING
|
||||
Case < 0
|
||||
nCALC_State = CalcStates.INFO
|
||||
Case > 0
|
||||
nCALC_State = CalcStates.ERROR_
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
End Sub
|
||||
|
||||
@@ -429,23 +570,13 @@ Public MustInherit Class PartVM
|
||||
Public Sub CalcGlobalUpdate()
|
||||
m_PartM.nCALC_GlobalState = nCALC_State
|
||||
For Each Feature In FeatureVMList
|
||||
If Not Feature.bDO Then
|
||||
ElseIf Feature.nState = CalcStates.NOTCALCULATED Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED
|
||||
Exit For
|
||||
ElseIf Feature.nState = CalcStates.INFO And m_PartM.nCALC_GlobalState = CalcStates.OK Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.INFO
|
||||
ElseIf Feature.nState = CalcStates.WARNING And (m_PartM.nCALC_GlobalState = CalcStates.OK Or m_PartM.nCALC_GlobalState = CalcStates.INFO) Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.WARNING
|
||||
ElseIf Feature.nState = CalcStates.ERROR_ And (m_PartM.nCALC_GlobalState = CalcStates.OK Or m_PartM.nCALC_GlobalState = CalcStates.INFO Or m_PartM.nCALC_GlobalState = CalcStates.WARNING) Then
|
||||
m_PartM.nCALC_GlobalState = CalcStates.ERROR_
|
||||
If Not Feature.bDO Then Continue For
|
||||
If Feature.nState > m_PartM.nCALC_GlobalState Then
|
||||
m_PartM.nCALC_GlobalState = Feature.nState
|
||||
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
|
||||
End If
|
||||
If Feature.nCALC_ERR = 22 Then
|
||||
m_PartM.nCALC_GlobalERR = 22
|
||||
ElseIf Feature.nCALC_ERR > 0 And m_PartM.nCALC_GlobalERR <= 0 Then
|
||||
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
|
||||
ElseIf Feature.nCALC_ERR < 0 And m_PartM.nCALC_GlobalERR = 0 Then
|
||||
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
|
||||
If Feature.nCALC_ROT <> 0 Then
|
||||
m_PartM.nCALC_ROT = Feature.nCALC_ROT
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
@@ -454,6 +585,10 @@ Public MustInherit Class PartVM
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
#End Region ' Calc
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DeletePart"
|
||||
@@ -478,12 +613,12 @@ Public MustInherit Class PartVM
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnBTLFeatureAdded(sender As Object, e As BTLFeatureAddedEventArgs)
|
||||
Public Sub OnBTLFeatureAdded(sender As Object, e As BTLFeatureAddedEventArgs)
|
||||
Dim BTLFeatureVM As BTLFeatureVM = New BTLFeatureVM(e.NewBTLFeature)
|
||||
FeatureVMList.Add(BTLFeatureVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLFeatureVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
Protected Sub OnBTLFeatureVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BTLFeatureVM As BTLFeatureVM In e.NewItems
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
@@ -492,16 +627,17 @@ Public MustInherit Class PartVM
|
||||
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
|
||||
For Each BTLFeatureVM As BTLFeatureVM In e.OldItems
|
||||
RemoveHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
'm_PartM.FeatureMList.Remove(BTLFeatureVM.BTLFeatureM)
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLFeatureVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Protected Overridable Sub OnBTLFeatureVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -6,7 +6,7 @@ Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class WallMachGroupVM
|
||||
Public MustInherit Class WallMachGroupVM
|
||||
Inherits MyMachGroupVM
|
||||
|
||||
Public ReadOnly Property m_WallMachGroupM As WallMachGroupM
|
||||
@@ -31,17 +31,7 @@ Public Class WallMachGroupVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreateWallVMList()
|
||||
Dim all As List(Of WallVM) = (From WallM In m_WallMachGroupM.GetParts()
|
||||
Select New WallVM(WallM, Me)).ToList()
|
||||
|
||||
For Each WallVM As WallVM In all
|
||||
AddHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
|
||||
Next
|
||||
|
||||
m_PartVMList = New ObservableCollection(Of PartVM)(all)
|
||||
AddHandler m_PartVMList.CollectionChanged, AddressOf OnWallVMListChanged
|
||||
End Sub
|
||||
Protected MustOverride Sub CreateWallVMList()
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
@@ -57,16 +47,14 @@ Public Class WallMachGroupVM
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnWallAdded(sender As Object, e As PartAddedEventArgs)
|
||||
Dim WallVM As WallVM = New WallVM(e.NewPart, Me)
|
||||
PartVMList.Add(WallVM)
|
||||
End Sub
|
||||
Protected MustOverride Sub OnWallAdded(sender As Object, e As PartAddedEventArgs)
|
||||
|
||||
Private Sub OnWallRemoved(sender As Object, e As PartAddedEventArgs)
|
||||
Dim WallVM As WallVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
|
||||
If Not IsNothing(WallVM) Then PartVMList.Remove(WallVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnWallVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
Protected Sub OnWallVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each WallVM As WallVM In e.NewItems
|
||||
AddHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
|
||||
@@ -79,7 +67,7 @@ Public Class WallMachGroupVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnWallVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Protected Sub OnWallVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
'Select Case e.PropertyName
|
||||
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||
'End Select
|
||||
|
||||
@@ -5,7 +5,7 @@ Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class WallVM
|
||||
Public MustInherit Class WallVM
|
||||
Inherits PartVM
|
||||
|
||||
Public ReadOnly Property m_WallM As WallM
|
||||
@@ -32,6 +32,12 @@ Public Class WallVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dPOSY As Double
|
||||
Get
|
||||
Return m_WallM.dPOSY
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property sROT As String
|
||||
Get
|
||||
Return LenToString(m_WallM.dROT, 3) & "°"
|
||||
@@ -41,6 +47,12 @@ Public Class WallVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dROT As Double
|
||||
Get
|
||||
Return m_WallM.dROT
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overridable Property bFLIP As Boolean
|
||||
Get
|
||||
Return m_WallM.bFLIP
|
||||
|
||||
@@ -14,9 +14,9 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyTitle("EgtBEAMWALL.Core Release AnyCPU")>
|
||||
#End If
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("EgalWare s.r.l.")>
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2021 by EgalWare s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.3.6.2")>
|
||||
<Assembly: AssemblyFileVersion("2.3.6.2")>
|
||||
<Assembly: AssemblyVersion("2.5.5.4")>
|
||||
<Assembly: AssemblyFileVersion("2.5.5.4")>
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ Option Explicit On
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0"), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="5"
|
||||
BindingColumns="{Binding ProjectColumns}">
|
||||
<DataGrid.Resources>
|
||||
@@ -115,6 +115,12 @@
|
||||
<TextBlock Text="{Binding Path=DataContext.CreateDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!-- Machine -->
|
||||
<DataGridTextColumn x:Key="colMACHINE" Binding="{Binding sMachine}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Machine_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!-- Name (per Prod) -->
|
||||
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
|
||||
<DataGridTextColumn.Header>
|
||||
@@ -148,6 +154,7 @@
|
||||
</ListBox.ItemTemplate>-->
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="IsEnabled" Value="{Binding bIsEnabled}"/>
|
||||
<EventSetter Event="MouseDoubleClick" Handler="ProjectList_MouseDoubleClick"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
|
||||
@@ -36,6 +36,12 @@ Public Class OpenProjectFileDialogV
|
||||
Return Me.ShowDialog()
|
||||
End Function
|
||||
|
||||
Public Function EgtShowDialog(ProjectType As ProjectType, GoToProd As Boolean) As Boolean?
|
||||
m_OpenProjFileDialogVM.Init(ProjectType, Nothing, GoToProd)
|
||||
' mostro la finestra di dialogo
|
||||
Return Me.ShowDialog()
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
@@ -12,6 +12,8 @@ Imports EgtWPFLib5
|
||||
Public MustInherit Class OpenProjectFileDialogVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
@@ -59,10 +61,6 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
Get
|
||||
Return m_ProjectList
|
||||
End Get
|
||||
'Set(value As List(Of ProjFile))
|
||||
' m_ProjList = value
|
||||
' NotifyPropertyChanged("ProjList")
|
||||
'End Set
|
||||
End Property
|
||||
|
||||
Protected m_SelProject As ProjectFileVM
|
||||
@@ -110,7 +108,7 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
' ora setto il valore scelto come Tipo Filtro
|
||||
m_SelSearchColumn = value
|
||||
Select Case m_SelSearchColumn.Id
|
||||
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME
|
||||
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME, OpenProjFileColumn.MACHINE
|
||||
SearchText_Visibility = Visibility.Visible
|
||||
SearchDate_Visibility = Visibility.Collapsed
|
||||
Case OpenProjFileColumn.EXPORTDATE, OpenProjFileColumn.CREATEDATE
|
||||
@@ -170,6 +168,7 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
LISTNAME = 3
|
||||
EXPORTDATE = 4
|
||||
CREATEDATE = 5
|
||||
MACHINE = 6
|
||||
End Enum
|
||||
|
||||
#Region "Messages"
|
||||
@@ -210,6 +209,11 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
Return EgtMsg(61822)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Machine_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61886)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Name_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61808)
|
||||
@@ -238,7 +242,11 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
Private m_cmdProjectDoubleClick As ICommand
|
||||
Private m_cmdDelete As ICommand
|
||||
|
||||
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing) As Boolean?
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||
|
||||
Protected Sub LoadColumns(ProjectType As ProjectType)
|
||||
If ProjectType = ProjectType.PROJ Then
|
||||
@@ -250,7 +258,8 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.LISTNAME, ListName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.EXPORTDATE, ExportDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
||||
ElseIf ProjectType = ProjectType.PROD Then
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
|
||||
@@ -258,18 +267,27 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
||||
End If
|
||||
' setto la visibilità delle colonne delle EgtDataGrid
|
||||
For Each col In ProjectColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Function VerifySelected() As Boolean
|
||||
If IsNothing(SelProject) Then Return False
|
||||
Dim AllFilesInDir As IEnumerable(Of String)
|
||||
Dim AllFilesInDir As IEnumerable(Of String) = Nothing
|
||||
If m_ProjectType = Core.ConstBeam.ProjectType.PROJ Then
|
||||
If String.IsNullOrWhiteSpace(SelProject.sProjDirPath) OrElse Not Directory.Exists(SelProject.sProjDirPath) Then Return False
|
||||
' verifico se esiste ProdId
|
||||
AllFilesInDir = IO.Directory.EnumerateFiles(SelProject.sProjDirPath)
|
||||
AllFilesInDir = Directory.EnumerateFiles(SelProject.sProjDirPath)
|
||||
ElseIf m_ProjectType = Core.ConstBeam.ProjectType.PROD Then
|
||||
AllFilesInDir = IO.Directory.EnumerateFiles(SelProject.sProdDirPath)
|
||||
If String.IsNullOrWhiteSpace(SelProject.sProdDirPath) OrElse Not Directory.Exists(SelProject.sProdDirPath) Then Return False
|
||||
AllFilesInDir = Directory.EnumerateFiles(SelProject.sProdDirPath)
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
@@ -289,18 +307,22 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
ElseIf m_ProjectType = ProjectType.PROD Then
|
||||
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
End If
|
||||
Return bProjectOk
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "ProjectDoubleClick"
|
||||
@@ -345,7 +367,7 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Friend Overridable Sub Delete()
|
||||
Public Overridable Sub Delete()
|
||||
End Sub
|
||||
|
||||
#End Region ' Delete
|
||||
|
||||
@@ -1,381 +0,0 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public MustInherit Class PartM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Protected m_ParentMachGroup As MyMachGroupM
|
||||
Public ReadOnly Property ParentMachGroup As MyMachGroupM
|
||||
Get
|
||||
Return m_ParentMachGroup
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Id geometrico del pezzo
|
||||
Protected m_nPartId As Integer
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
Get
|
||||
Return m_nPartId
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetPartId(nPartId As Integer)
|
||||
m_nPartId = nPartId
|
||||
End Sub
|
||||
|
||||
' Proj del pezzo
|
||||
Protected m_nProjId As Integer = 0
|
||||
Public Property nProjId As Integer
|
||||
Get
|
||||
Return m_nProjId
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nProjId = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Info del pezzo
|
||||
Protected m_nPDN As Integer
|
||||
Public ReadOnly Property nPDN As Integer
|
||||
Get
|
||||
Return m_nPDN
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_sNAM As String
|
||||
Public ReadOnly Property sNAM As String
|
||||
Get
|
||||
Return m_sNAM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_dBtlL As Double
|
||||
Public ReadOnly Property dBtlL As String
|
||||
Get
|
||||
Return m_dBtlL
|
||||
End Get
|
||||
End Property
|
||||
Public Property dL As Double
|
||||
Get
|
||||
Dim frBeam As New Frame3d
|
||||
EgtGetGroupGlobFrame( nPartId, frBeam)
|
||||
If IsX( frBeam.VersX(), EPS_SMALL) Then
|
||||
Return m_dBtlL
|
||||
ElseIf IsX( frBeam.VersY(), EPS_SMALL) Then
|
||||
Return m_dBtlH
|
||||
Else
|
||||
Return m_dBtlW
|
||||
End If
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dBtlL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dBtlW As Double
|
||||
Public ReadOnly Property dBtlW As String
|
||||
Get
|
||||
Return m_dBtlW
|
||||
End Get
|
||||
End Property
|
||||
Public Property dW As Double
|
||||
Get
|
||||
Dim frBeam As New Frame3d
|
||||
EgtGetGroupGlobFrame( nPartId, frBeam)
|
||||
If IsY( frBeam.VersX()) Then
|
||||
Return m_dBtlL
|
||||
ElseIf IsY( frBeam.VersY()) Then
|
||||
Return m_dBtlH
|
||||
Else
|
||||
Return m_dBtlW
|
||||
End If
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dBtlW = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dBtlH As Double
|
||||
Public ReadOnly Property dBtlH As String
|
||||
Get
|
||||
Return m_dBtlH
|
||||
End Get
|
||||
End Property
|
||||
Public Property dH As Double
|
||||
Get
|
||||
Dim frBeam As New Frame3d
|
||||
EgtGetGroupGlobFrame( nPartId, frBeam)
|
||||
If IsZ( frBeam.VersX()) Then
|
||||
Return m_dBtlL
|
||||
ElseIf IsZ( frBeam.VersY()) Then
|
||||
Return m_dBtlH
|
||||
Else
|
||||
Return m_dBtlW
|
||||
End If
|
||||
Return m_dBtlH
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dBtlH = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dPOSX As Double
|
||||
Public Property dPOSX As Double
|
||||
Get
|
||||
Return m_dPOSX
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_dPOSX = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCNT As Integer
|
||||
Public Property nCNT As Integer
|
||||
Get
|
||||
Return m_nCNT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCNT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nINVERTED As Integer
|
||||
Public ReadOnly Property nINVERTED As Integer
|
||||
Get
|
||||
Return m_nINVERTED
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetInverted(nInverted As Integer)
|
||||
m_nINVERTED = nInverted
|
||||
End Sub
|
||||
|
||||
Protected m_nROTATED As Integer
|
||||
Public ReadOnly Property nROTATED As Integer
|
||||
Get
|
||||
Return m_nROTATED
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetRotated(nRotated As Integer)
|
||||
m_nROTATED = nRotated
|
||||
End Sub
|
||||
|
||||
Protected m_sMATERIAL As String
|
||||
Public Property sMATERIAL As String
|
||||
Get
|
||||
Return m_sMATERIAL
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMATERIAL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_sGROUP As String
|
||||
Public Property sGROUP As String
|
||||
Get
|
||||
Return m_sGROUP
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sGROUP = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_GlobalState As CalcStates = -1
|
||||
Public Property nCALC_GlobalState As CalcStates
|
||||
Get
|
||||
Return m_nCALC_GlobalState
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nCALC_GlobalState = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nCALC_GlobalERR As Integer
|
||||
Public Property nCALC_GlobalERR As Integer
|
||||
Get
|
||||
Return m_nCALC_GlobalERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_GlobalERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_State As CalcStates = -1
|
||||
Public Property nCALC_State As CalcStates
|
||||
Get
|
||||
Return m_nCALC_State
|
||||
End Get
|
||||
Set(value As CalcStates)
|
||||
m_nCALC_State = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_ERR As Integer
|
||||
Public Property nCALC_ERR As Integer
|
||||
Get
|
||||
Return m_nCALC_ERR
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ERR = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sCALC_MSG As String = String.Empty
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_ROT As Integer
|
||||
Public Property nCALC_ROT As Integer
|
||||
Get
|
||||
Return m_nCALC_ROT
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_ROT = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_FALL As Integer
|
||||
Public Property nCALC_FALL As Integer
|
||||
Get
|
||||
Return m_nCALC_FALL
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_FALL = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nCALC_TIME As Integer
|
||||
Public Property nCALC_TIME As Integer
|
||||
Get
|
||||
Return m_nCALC_TIME
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nCALC_TIME = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle feature del pezzo
|
||||
Protected m_FeatureMList As List(Of BTLFeatureM)
|
||||
Public Property FeatureMList As List(Of BTLFeatureM)
|
||||
Get
|
||||
Return m_FeatureMList
|
||||
End Get
|
||||
Set(value As List(Of BTLFeatureM))
|
||||
m_FeatureMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dtStartTime As DateTime
|
||||
Public Property dtStartTime As DateTime
|
||||
Get
|
||||
Return m_dtStartTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_dtStartTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dtEndTime As DateTime
|
||||
Public Property dtEndTime As DateTime
|
||||
Get
|
||||
Return m_dtEndTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_dtEndTime = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nProductionState As Integer = 0
|
||||
Public ReadOnly Property nProductionState As Integer
|
||||
Get
|
||||
Return m_nProductionState
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetProductionState(nState As CalcStates)
|
||||
m_nProductionState = nState
|
||||
End Sub
|
||||
|
||||
Protected m_nBTLPartId As Integer
|
||||
Public ReadOnly Property nBTLPartId As Integer
|
||||
Get
|
||||
Return m_nBTLPartId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New(nParentMachGroup As MyMachGroupM, nPartId As Integer)
|
||||
m_ParentMachGroup = nParentMachGroup
|
||||
SetPartId(nPartId)
|
||||
' imposto BtlPart da cui deriva questo Duplo
|
||||
Dim c As Integer = EgtGetCurrMachGroup()
|
||||
EgtResetCurrMachGroup()
|
||||
m_nBTLPartId = EgtDuploGetOriginal(nPartId)
|
||||
EgtSetCurrMachGroup(c)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Public Event BTLFeatureAdded As EventHandler(Of BTLFeatureAddedEventArgs)
|
||||
|
||||
Public Sub AddBTLFeature(BTLFeatureM As BTLFeatureM)
|
||||
If IsNothing(BTLFeatureM) Then Return
|
||||
If Not m_FeatureMList.Contains(BTLFeatureM) Then
|
||||
m_FeatureMList.Add(BTLFeatureM)
|
||||
RaiseEvent BTLFeatureAdded(Me, New BTLFeatureAddedEventArgs(BTLFeatureM))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function GetBTLFeatures() As List(Of BTLFeatureM)
|
||||
Return New List(Of BTLFeatureM)(m_FeatureMList)
|
||||
End Function
|
||||
|
||||
Public Shared Sub ReadMachGroupData(NewPart As PartM)
|
||||
' leggo calc error
|
||||
Dim nErr As Integer = 0
|
||||
Dim nRot As Integer = 0
|
||||
Dim nFall As Integer = 0
|
||||
Dim sMsg As String = ""
|
||||
Dim bCalc As Boolean = False
|
||||
bCalc = EgtGetInfo(NewPart.nPartId, ITG_PROD_ERR, nErr)
|
||||
EgtGetInfo(NewPart.nPartId, ITG_PROD_ROT, nRot)
|
||||
EgtGetInfo(NewPart.nPartId, ITG_PROD_MSG, sMsg)
|
||||
If Not bCalc Then
|
||||
NewPart.m_nCALC_State = CalcStates.NOTCALCULATED
|
||||
NewPart.m_nCALC_ERR = 0
|
||||
NewPart.m_nCALC_ROT = 0
|
||||
NewPart.m_sCALC_MSG = ""
|
||||
Else
|
||||
NewPart.m_nCALC_ERR = nErr
|
||||
NewPart.m_nCALC_ROT = nRot
|
||||
NewPart.m_sCALC_MSG = sMsg
|
||||
If nErr = 0 Then
|
||||
NewPart.nCALC_State = CalcStates.OK
|
||||
ElseIf nErr = 17 Then
|
||||
NewPart.nCALC_State = CalcStates.WARNING
|
||||
ElseIf nErr > 0 Then
|
||||
NewPart.nCALC_State = CalcStates.ERROR_
|
||||
ElseIf nErr < 0 Then
|
||||
NewPart.nCALC_State = CalcStates.INFO
|
||||
End If
|
||||
End If
|
||||
EgtGetInfo(NewPart.nPartId, ITG_PROD_TIME, NewPart.m_nCALC_TIME)
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -10,6 +10,9 @@ Public Class ProdFileM
|
||||
Return m_nProjIdList
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetProjIdList(value As List(Of Integer))
|
||||
m_nProjIdList = value
|
||||
End Sub
|
||||
|
||||
Protected m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
@@ -27,13 +30,17 @@ Public Class ProdFileM
|
||||
Return New ProdFileM
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer),
|
||||
dtCreateProjDate As DateTime, sName As String) As ProdFileM
|
||||
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
|
||||
sMachine As String, sLockedBy As String, dtLock As DateTime) As ProdFileM
|
||||
Dim NewProjectFileM As New ProdFileM
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
NewProjectFileM.m_nProjIdList = nProjIdList
|
||||
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
||||
NewProjectFileM.m_sName = sName
|
||||
NewProjectFileM.m_nType = nType
|
||||
NewProjectFileM.m_sMachine = sMachine
|
||||
NewProjectFileM.m_sLockedBy = sLockedBy
|
||||
NewProjectFileM.m_dtLock = dtLock
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
|
||||
@@ -37,8 +37,8 @@ Public Class ProjFileM
|
||||
Return New ProjFileM
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime,
|
||||
dtExportDate As DateTime, sListName As String, sBTLFileName As String, IsNew As Boolean, IsLocked As Boolean) As ProjFileM
|
||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String,
|
||||
sBTLFileName As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String) As ProjFileM
|
||||
Dim NewProjectFileM As New ProjFileM
|
||||
NewProjectFileM.m_nProjId = nProjId
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
@@ -48,6 +48,8 @@ Public Class ProjFileM
|
||||
NewProjectFileM.m_sBTLFileName = sBTLFileName
|
||||
NewProjectFileM.m_bIsNew = IsNew
|
||||
NewProjectFileM.m_bIsLocked = IsLocked
|
||||
NewProjectFileM.m_nType = nType
|
||||
NewProjectFileM.m_sMachine = sMachine
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
|
||||
@@ -54,18 +54,47 @@ Public Class ProjectFileM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
Protected m_nType As BWType
|
||||
Public Property nType As BWType
|
||||
Get
|
||||
Return m_nType
|
||||
End Get
|
||||
Set(value As BWType)
|
||||
m_nType = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Sub New(nProjectType As ProjectType, nProjId As Integer, nProdId As Integer, sBTLFileName As String)
|
||||
' m_nProjectType = nProjectType
|
||||
' If m_nProjectType = ProjectType.PROJ Then
|
||||
' m_nProjId = nProjId
|
||||
' m_nProdId = nProdId
|
||||
' m_BTLFileName = sBTLFileName
|
||||
' ElseIf m_nProjectType = ProjectType.PROD Then
|
||||
' m_nProdId = nProdId
|
||||
' End If
|
||||
'End Sub
|
||||
Protected m_sMachine As String
|
||||
Public Property sMachine As String
|
||||
Get
|
||||
Return m_sMachine
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMachine = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sLockedBy As String
|
||||
Public Property sLockedBy As String
|
||||
Get
|
||||
Return m_sLockedBy
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sLockedBy = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_dtLock As DateTime
|
||||
Public Property dtLock As DateTime
|
||||
Get
|
||||
Return m_dtLock
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
m_dtLock = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
@@ -62,6 +62,7 @@ Public Class ProdFileVM
|
||||
Protected Sub SetBTLFileName(value As String)
|
||||
m_sBTLFileName = value
|
||||
End Sub
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
Sub New(ProdFileM As ProdFileM)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ProjectFileVM
|
||||
Inherits VMBase
|
||||
@@ -87,13 +88,35 @@ Public Class ProjectFileVM
|
||||
End Property
|
||||
|
||||
' variabile che indica se ricaricare il progetto
|
||||
Private m_bReloadProject As Boolean = True
|
||||
Friend ReadOnly Property bReloadProject As Boolean
|
||||
Protected m_bReloadProject As Boolean = True
|
||||
Public ReadOnly Property bReloadProject As Boolean
|
||||
Get
|
||||
Return m_bReloadProject
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_nModificationIndex As Integer = Integer.MaxValue - 1000
|
||||
Public ReadOnly Property nModificationIndex As Integer
|
||||
Get
|
||||
Return m_nModificationIndex
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetModificationIndex(value As String)
|
||||
m_nModificationIndex = value
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property nType As BWType
|
||||
Get
|
||||
Return m_ProjectFileM.nType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sMachine As String
|
||||
Get
|
||||
Return m_ProjectFileM.sMachine
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Id_Msg As String
|
||||
@@ -142,4 +165,8 @@ Public Class ProjectFileVM
|
||||
m_sProdsDir = sProdsDir
|
||||
End Sub
|
||||
|
||||
Public Sub SetMachine(sMachine)
|
||||
m_ProjectFileM.sMachine = sMachine
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -18,6 +18,7 @@ Imports EgtWPFLib5
|
||||
Public Module BTLIniFile
|
||||
|
||||
Public m_sBTLIniFile As String
|
||||
Public m_nBTLBWType As BWType
|
||||
|
||||
Public Function GetBeamPrivateProfileProcessList(IpGRPType As GRPType, ByRef IpProcessList As ObservableCollection(Of Integer)) As Boolean
|
||||
Dim PRCList As New ObservableCollection(Of Integer)
|
||||
@@ -124,9 +125,16 @@ Public Module BTLIniFile
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
' funzione che ottiene il parametro P/Q usando m_nBTLBWType del modulo
|
||||
Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeatureM, ByRef IpBTLParam As BTLParamM) As Boolean
|
||||
Dim sBTLParam As String = String.Empty
|
||||
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q") & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
|
||||
Dim sBWQParam As String = String.Empty
|
||||
If m_nBTLBWType = BWType.BEAM Then
|
||||
sBWQParam = "B"
|
||||
ElseIf m_nBTLBWType = BWType.WALL Then
|
||||
sBWQParam = "W"
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q" & sBWQParam) & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
|
||||
Dim sBTLParamParams() As String = sBTLParam.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sBTLParamParams.Count >= 6 Then
|
||||
@@ -139,9 +147,9 @@ Public Module BTLIniFile
|
||||
Dim dMin As Double
|
||||
Dim dMax As Double
|
||||
Dim dDefault As Double
|
||||
StringToDouble(sBTLParamParams(2), dMin)
|
||||
StringToDouble(sBTLParamParams(3), dMax)
|
||||
StringToDouble(sBTLParamParams(4), dDefault)
|
||||
StringToDoubleAdv(sBTLParamParams(2), dMin)
|
||||
StringToDoubleAdv(sBTLParamParams(3), dMax)
|
||||
StringToDoubleAdv(sBTLParamParams(4), dDefault)
|
||||
Dim ParamType As BTLParamType
|
||||
If sBTLParamParams(0) = "d" Then
|
||||
ParamType = BTLParamType.DOUBLE_
|
||||
@@ -151,7 +159,7 @@ Public Module BTLIniFile
|
||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5))
|
||||
Return Not IsNothing(IpBTLParam)
|
||||
ElseIf sBTLParamParams(0) = "s" Then
|
||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5))
|
||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(4), sBTLParamParams(5))
|
||||
Return Not IsNothing(IpBTLParam)
|
||||
ElseIf sBTLParamParams(0) = "c" Then
|
||||
Dim nMin As Integer
|
||||
@@ -170,4 +178,57 @@ Public Module BTLIniFile
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' funzione che ottiene il parametro P/Q usando BTLBWType passato come argomento
|
||||
Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeatureM, ByRef IpBTLParam As BTLParamM, BTLBWType As BWType) As Boolean
|
||||
Dim sBTLParam As String = String.Empty
|
||||
Dim sBWQParam As String = String.Empty
|
||||
If BTLBWType = BWType.BEAM Then
|
||||
sBWQParam = "B"
|
||||
ElseIf BTLBWType = BWType.WALL Then
|
||||
sBWQParam = "W"
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q" & sBWQParam) & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
|
||||
Dim sBTLParamParams() As String = sBTLParam.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sBTLParamParams.Count >= 6 Then
|
||||
' cancello spazi
|
||||
For Index = 0 To sBTLParamParams.Count - 1
|
||||
sBTLParamParams(Index) = sBTLParamParams(Index).Trim()
|
||||
Next
|
||||
' creo parametro
|
||||
If sBTLParamParams(0) = "d" OrElse sBTLParamParams(0) = "l" Then
|
||||
Dim dMin As Double
|
||||
Dim dMax As Double
|
||||
Dim dDefault As Double
|
||||
StringToDoubleAdv(sBTLParamParams(2), dMin)
|
||||
StringToDoubleAdv(sBTLParamParams(3), dMax)
|
||||
StringToDoubleAdv(sBTLParamParams(4), dDefault)
|
||||
Dim ParamType As BTLParamType
|
||||
If sBTLParamParams(0) = "d" Then
|
||||
ParamType = BTLParamType.DOUBLE_
|
||||
Else
|
||||
ParamType = BTLParamType.LENGTH
|
||||
End If
|
||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5), sBWQParam)
|
||||
Return Not IsNothing(IpBTLParam)
|
||||
ElseIf sBTLParamParams(0) = "s" Then
|
||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(4), sBTLParamParams(5), sBWQParam)
|
||||
Return Not IsNothing(IpBTLParam)
|
||||
ElseIf sBTLParamParams(0) = "c" Then
|
||||
Dim nMin As Integer
|
||||
Dim nMax As Integer
|
||||
Dim nDefault As Integer
|
||||
Integer.TryParse(sBTLParamParams(2), nMin)
|
||||
Integer.TryParse(sBTLParamParams(3), nMax)
|
||||
Integer.TryParse(sBTLParamParams(4), nDefault)
|
||||
' recupero lista valori
|
||||
Dim ValueList As New List(Of String)
|
||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.COMBO, sBTLParamParams(1), nMin, nMax, nDefault, sBTLParamParams(5), ValueList, sBWQParam)
|
||||
Return Not IsNothing(IpBTLParam)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
Imports System.Windows.Input
|
||||
|
||||
''' <summary>
|
||||
''' A command whose sole purpose is to
|
||||
''' relay its functionality to other
|
||||
''' objects by invoking delegates. The
|
||||
''' default return value for the CanExecute
|
||||
''' method is 'true'.
|
||||
''' </summary>
|
||||
Public Class Command
|
||||
Implements ICommand
|
||||
|
||||
#Region "Fields"
|
||||
|
||||
Private ReadOnly _execute As Action(Of Object)
|
||||
Private ReadOnly _canExecute As Predicate(Of Object)
|
||||
|
||||
#End Region ' Fields
|
||||
|
||||
#Region "Constructors"
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command that can always execute.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object))
|
||||
Me.New(execute, Nothing)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
''' <param name="canExecute">The execution status logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object), ByVal canExecute As Predicate(Of Object))
|
||||
If execute Is Nothing Then
|
||||
Throw New ArgumentNullException("execute")
|
||||
End If
|
||||
|
||||
_execute = execute
|
||||
_canExecute = canExecute
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
|
||||
#Region "ICommand Members"
|
||||
|
||||
<DebuggerStepThrough> _
|
||||
Public Function CanExecute(ByVal parameter As Object) As Boolean Implements ICommand.CanExecute
|
||||
Return If(_canExecute Is Nothing, True, _canExecute(parameter))
|
||||
End Function
|
||||
|
||||
Public Custom Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged
|
||||
AddHandler(ByVal value As EventHandler)
|
||||
AddHandler CommandManager.RequerySuggested, value
|
||||
End AddHandler
|
||||
RemoveHandler(ByVal value As EventHandler)
|
||||
RemoveHandler CommandManager.RequerySuggested, value
|
||||
End RemoveHandler
|
||||
RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||||
End RaiseEvent
|
||||
End Event
|
||||
|
||||
Public Sub Execute(ByVal parameter As Object) Implements ICommand.Execute
|
||||
_execute(parameter)
|
||||
End Sub
|
||||
|
||||
#End Region ' ICommand Members
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,62 @@
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports System.Collections.ObjectModel
|
||||
|
||||
Public Module DimensionsIniFile
|
||||
|
||||
Public m_sDimensionsIniFile As String
|
||||
|
||||
Public Sub ReadGridDimensions(GridName As String, ByRef GridDimsList As ObservableCollection(Of GridDimension))
|
||||
GridDimsList = New ObservableCollection(Of GridDimension)
|
||||
Dim Index As Integer = 0
|
||||
Dim sValue = String.Empty
|
||||
While GetPrivateProfileString(GridName, Index, String.Empty, sValue, m_sDimensionsIniFile) > 0
|
||||
Dim sValueParams() As String = sValue.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sValueParams.Count >= 4 Then
|
||||
' cancello spazi
|
||||
For I = 0 To sValueParams.Count - 1
|
||||
sValueParams(I) = sValueParams(I).Trim()
|
||||
Next
|
||||
' creo valore
|
||||
Dim nDimIndex As Integer
|
||||
Dim nDimType As DimensionType
|
||||
Dim GridLenValue As Double
|
||||
Dim GridLenType As GridUnitType
|
||||
Integer.TryParse(sValueParams(0), nDimIndex)
|
||||
Integer.TryParse(sValueParams(1), nDimType)
|
||||
StringToDoubleAdv(sValueParams(2), GridLenValue)
|
||||
Integer.TryParse(sValueParams(3), GridLenType)
|
||||
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
|
||||
End If
|
||||
Index += 1
|
||||
End While
|
||||
For Each GridDimsItem In GridDimsList
|
||||
GridDimsItem.GridDimensions = GridDimsList
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione per calcolare e scrivere la stringa dei valori delle righe/colonne della Grid nell'INI
|
||||
Public Function SaveGridDimensions(GridName As String, GridDims As ObservableCollection(Of GridDimension)) As Boolean
|
||||
Dim bOk As Boolean
|
||||
Dim Index = 0
|
||||
Dim sValue = String.Empty
|
||||
For Each GridDimsItem In GridDims
|
||||
sValue = GridDimsItem.Index & "," & GridDimsItem.DimType & "," & DoubleToString(GridDimsItem.GridLen.Value, 6) & "," & GridDimsItem.GridLen.GridUnitType
|
||||
bOk = WritePrivateProfileDimension(GridName, Index, sValue)
|
||||
Index += 1
|
||||
Next
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Function WritePrivateProfileDimension(GridName As String, Index As String, sValue As String) As Boolean
|
||||
Return WritePrivateProfileString(GridName, Index, sValue, m_sDimensionsIniFile)
|
||||
End Function
|
||||
|
||||
Private Function GetGridLengthFromIndexAndType(GridDimsList As List(Of GridDimension), Index As Integer, DimType As DimensionType) As GridDimension
|
||||
Return GridDimsList.FirstOrDefault(Function(x) x.Index = Index And x.DimType = DimType)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,16 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class DisableModifiedMgr
|
||||
|
||||
Private m_bOldEnMod As Boolean
|
||||
|
||||
Sub New()
|
||||
m_bOldEnMod = EgtGetEnableModified()
|
||||
If m_bOldEnMod Then EgtDisableModified()
|
||||
End Sub
|
||||
|
||||
Public Sub ReEnable()
|
||||
If m_bOldEnMod Then EgtEnableModified()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,71 @@
|
||||
Public Enum CalcStates As Integer
|
||||
NOTCALCULATED = -1
|
||||
OK = 0
|
||||
INFO = 1
|
||||
WARNING = 2
|
||||
ERROR_ = 3
|
||||
COLLISION = 4
|
||||
End Enum
|
||||
|
||||
Public Enum EventType
|
||||
ND = -1
|
||||
Started = 0
|
||||
Ended = 1
|
||||
End Enum
|
||||
|
||||
Public Enum ItemState As Integer
|
||||
ND = -1
|
||||
Assigned = 0
|
||||
Confirmed = 1
|
||||
WIP = 2
|
||||
Produced = 3
|
||||
Scrapped = 4
|
||||
End Enum
|
||||
|
||||
Public Enum LogSupportLevel
|
||||
ND = -1
|
||||
I = 0
|
||||
E = 1
|
||||
End Enum
|
||||
|
||||
Public Enum LogSupportTarget
|
||||
ND = -1
|
||||
Supervisor = 0
|
||||
LoadProject = 1
|
||||
End Enum
|
||||
|
||||
Public Enum StatusMapItemType
|
||||
ND = -1
|
||||
Prod = 0
|
||||
MachGroup = 1
|
||||
Part = 2
|
||||
Comm = 3
|
||||
End Enum
|
||||
|
||||
Public Enum StatusMapOpType
|
||||
ND = -1
|
||||
Startup = 0
|
||||
PartStart = 1
|
||||
PartEnd = 2
|
||||
MachGroupAdd = 3
|
||||
MachGroupMod = 4
|
||||
MachGroupRem = 5
|
||||
MachGroupNeedRedo = 6
|
||||
MachGroupAssignedToSupervisor = 7
|
||||
MachGroupRemovedFromSupervisor = 8
|
||||
SupervisorStopRequest = 9
|
||||
ViewOptimStoped = 10
|
||||
SupervisorReleaseStop = 11
|
||||
ResetPartStart = 12
|
||||
ResetPartEnd = 13
|
||||
SetPartScrapped = 14
|
||||
ChangeProdInSupervisorRequest = 15
|
||||
ChangeProdInProdRequest = 16
|
||||
OpenPageInViewOptimRequest = 17
|
||||
MachGroupValidationUpdate = 18
|
||||
End Enum
|
||||
|
||||
Public Enum DimensionType
|
||||
COLUMN = 0
|
||||
ROW = 1
|
||||
End Enum
|
||||
@@ -0,0 +1,73 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class GridDimension
|
||||
Inherits VMBase
|
||||
|
||||
Private Shared m_SoftwareModActive As Boolean = False
|
||||
|
||||
Private Property m_GridName As String
|
||||
Public Property GridName As String
|
||||
Get
|
||||
Return m_GridName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_GridName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_Index As Integer
|
||||
Public Property Index As Integer
|
||||
Get
|
||||
Return m_Index
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_Index = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_DimType As DimensionType
|
||||
Public Property DimType As DimensionType
|
||||
Get
|
||||
Return m_DimType
|
||||
End Get
|
||||
Set(value As DimensionType)
|
||||
m_DimType = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_GridLen As GridLength
|
||||
Public Property GridLen As GridLength
|
||||
Get
|
||||
Return m_GridLen
|
||||
End Get
|
||||
Set(value As GridLength)
|
||||
m_GridLen = value
|
||||
If Not m_SoftwareModActive Then DimensionsIniFile.SaveGridDimensions(GridName, GridDimensions)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_GridDimensions As ObservableCollection(Of GridDimension)
|
||||
Public Property GridDimensions As ObservableCollection(Of GridDimension)
|
||||
Get
|
||||
Return m_GridDimensions
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of GridDimension))
|
||||
m_GridDimensions = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(GridName As String, Index As Integer, DimType As DimensionType, GridLen As GridLength)
|
||||
m_GridName = GridName
|
||||
m_Index = Index
|
||||
m_DimType = DimType
|
||||
m_GridLen = GridLen
|
||||
End Sub
|
||||
|
||||
Public Shared Sub SetSoftwareMod(bActive As Boolean)
|
||||
m_SoftwareModActive = bActive
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,31 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Module LuaMsgManager
|
||||
|
||||
Public Function MessageFromLuaMsg(LuaMsg As String) As String
|
||||
' verifico se inizia con $$
|
||||
If Not String.IsNullOrWhiteSpace(LuaMsg) AndAlso LuaMsg.Length >= 2 AndAlso LuaMsg.Substring(0, 2) = "$$" Then
|
||||
Dim sMsgArgs() As String = LuaMsg.Substring(2).Split(",")
|
||||
Dim nMsg As Integer = -1
|
||||
If sMsgArgs.Count > 1 AndAlso Integer.TryParse(sMsgArgs(0), nMsg) AndAlso nMsg > 0 Then
|
||||
If sMsgArgs.Count > 1 Then
|
||||
Dim sArgs() As String = sMsgArgs.Skip(1).ToArray()
|
||||
Dim sMsg As String = String.Format(EgtMsg(65000 + nMsg), sArgs)
|
||||
If Not String.IsNullOrWhiteSpace(sMsg) Then
|
||||
Return sMsg
|
||||
Else
|
||||
Return EgtMsg(65000 + nMsg)
|
||||
End If
|
||||
Else
|
||||
Return EgtMsg(65000 + nMsg)
|
||||
End If
|
||||
Else
|
||||
Return LuaMsg
|
||||
End If
|
||||
Else
|
||||
Return LuaMsg
|
||||
End If
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -2,6 +2,19 @@
|
||||
|
||||
#Region "Private Fields"
|
||||
|
||||
Public Enum MachLogTypes
|
||||
PART_STATUS = 1
|
||||
MACHGROUP_STATUS = 2
|
||||
MACHINE_MODE = 3
|
||||
MACHINE_STATUS = 4
|
||||
MACHINE_COMMAND = 5
|
||||
READ_VAR = 6
|
||||
WRITE_VAR = 7
|
||||
ALARM = 8
|
||||
OPERATOR_MSG = 9
|
||||
PROGRAM_SEND = 10
|
||||
End Enum
|
||||
|
||||
Private m_AlarmCode As String
|
||||
Private m_AlarmDateTime As DateTime
|
||||
Private m_AlarmMessage As String
|
||||
@@ -11,15 +24,74 @@
|
||||
Private m_CommandState As CommandStates
|
||||
Private m_CommandType As LogCommandTypes
|
||||
Private m_Description As String
|
||||
|
||||
Private m_newOpState As Integer
|
||||
|
||||
Private m_ResultType As ResultTypes
|
||||
|
||||
Private m_VarAddress As String
|
||||
|
||||
Private m_VarValue As String
|
||||
|
||||
' variabili del log macchina
|
||||
Public ReadOnly Property EventType As MachLogTypes
|
||||
Get
|
||||
Return m_ResultType
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property EventDateTime As DateTime
|
||||
Get
|
||||
Return m_AlarmDateTime
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property EventValue As String
|
||||
Get
|
||||
Return m_VarValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sEventType As String
|
||||
Get
|
||||
Select Case m_ResultType
|
||||
Case MachLogTypes.PART_STATUS
|
||||
Return String.Format("({0}) Stato pezzo", 1)
|
||||
Case MachLogTypes.MACHGROUP_STATUS
|
||||
Return String.Format("({0}) Stato barra", 2)
|
||||
Case MachLogTypes.MACHINE_MODE = 3
|
||||
Return String.Format("({0}) Modalità macchina", 3)
|
||||
Case MachLogTypes.MACHINE_STATUS = 4
|
||||
Return String.Format("({0}) Stato macchina", 4)
|
||||
Case MachLogTypes.MACHINE_COMMAND = 5
|
||||
Return String.Format("({0}) Comando macchina", 5)
|
||||
Case MachLogTypes.READ_VAR = 6
|
||||
Return String.Format("({0}) Lettura variabile", 6)
|
||||
Case MachLogTypes.WRITE_VAR = 7
|
||||
Return String.Format("({0}) Scrittura variabile", 7)
|
||||
Case MachLogTypes.ALARM = 8
|
||||
Return String.Format("({0}) Allarme", 8)
|
||||
Case MachLogTypes.OPERATOR_MSG = 9
|
||||
Return String.Format("({0}) Messaggio opertore", 9)
|
||||
Case MachLogTypes.PROGRAM_SEND = 10
|
||||
Return String.Format("({0}) Invio programma", 10)
|
||||
Case Else
|
||||
Return "Altro"
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property sEventDateTime As String
|
||||
Get
|
||||
Return m_AlarmDateTime
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property sEventValue As String
|
||||
Get
|
||||
Return m_VarValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sPROD As String
|
||||
Get
|
||||
|
||||
Return m_VarValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Protected Constructors"
|
||||
@@ -147,7 +219,7 @@
|
||||
|
||||
Public Shared Function CreateReadLog(CommandExecutedCorrectly As Boolean, VarAddress As String, VarValue As String)
|
||||
Dim NewMachLog As New MachLog
|
||||
NewMachLog.m_CommandType = CommandTypes.READ
|
||||
NewMachLog.m_CommandType = CommandTypes.READ_TPA
|
||||
NewMachLog.m_CommandExecutedCorrectly = CommandExecutedCorrectly
|
||||
NewMachLog.m_VarAddress = VarAddress
|
||||
NewMachLog.m_VarValue = VarValue
|
||||
@@ -165,11 +237,20 @@
|
||||
Return NewMachLog
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateMachLog(EventType As MachLogTypes, EventDateTime As DateTime, Value As String, SupervisorID As String)
|
||||
Dim NewMachEvent As New MachLog
|
||||
NewMachEvent.m_ResultType = EventType
|
||||
NewMachEvent.m_AlarmDateTime = EventDateTime
|
||||
NewMachEvent.m_VarValue = Value
|
||||
NewMachEvent.m_VarAddress = SupervisorID
|
||||
Return NewMachEvent
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Public Methods"
|
||||
|
||||
Public Shared Function CreateMacLog(AlarmCode As String, AlarmDateTime As Date, AlarmMessage As String, AlarmOperation As Integer, AlarmType As Integer, CommandExecutedCorrectly As Boolean, CommandState As CommandStates, CommandType As LogCommandTypes, Description As String, newOpState As Integer, ResultType As ResultTypes, VarAddress As String, VarValue As String) As MachLog
|
||||
Public Shared Function CreateMachLog(AlarmCode As String, AlarmDateTime As Date, AlarmMessage As String, AlarmOperation As Integer, AlarmType As Integer, CommandExecutedCorrectly As Boolean, CommandState As CommandStates, CommandType As LogCommandTypes, Description As String, newOpState As Integer, ResultType As ResultTypes, VarAddress As String, VarValue As String) As MachLog
|
||||
|
||||
Dim NewMachLog As New MachLog
|
||||
NewMachLog.m_AlarmCode = AlarmCode
|
||||
@@ -0,0 +1,81 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Module ManageView
|
||||
|
||||
' Tipo di progetto aperto
|
||||
Private m_Type As BWType
|
||||
|
||||
' Per macchine pareti:
|
||||
' Posizione vista
|
||||
Private m_nViewDir As VT
|
||||
|
||||
Public Function BWSetView(nView As VT, Optional bRedraw As Boolean = True)
|
||||
' condizioni che cambiano la vista del progetto
|
||||
Select Case m_Type
|
||||
Case BWType.BEAM
|
||||
EgtSetView(VT.ISO_SW, bRedraw)
|
||||
Case BWType.WALL
|
||||
Select Case nView
|
||||
Case VT.TOP
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(0, -90, bRedraw) ' equivalente a vista TOP
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(0, 90, bRedraw) ' equivalente a vista TOP ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.FRONT
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(90, -90, bRedraw) ' equivalente a vista FRONT
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(90, 90, bRedraw) ' equivalente a vista FRONT ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.BACK
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(-90, -90, bRedraw) ' equivalente a vista BACK
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(-90, 90, bRedraw) ' equivalente a vista BACK ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.RIGHT
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista RIGHT
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista RIGHT ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.LEFT
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista RIGHT
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista RIGHT ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.ISO_SW
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
|
||||
End Select
|
||||
Case Else ' VT.ISO_SW
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
|
||||
End Select
|
||||
End Select
|
||||
End Select
|
||||
|
||||
End Function
|
||||
|
||||
Public Sub UpdateMachParam(ViewDir As Integer)
|
||||
m_nViewDir = ViewDir
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateBWType(Type As BWType)
|
||||
m_Type = Type
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,57 @@
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
Public Module ManageWindow
|
||||
|
||||
|
||||
<DllImport("user32.dll")>
|
||||
Public Function FindWindow(ByVal className As String, ByVal windowTitle As String) As IntPtr
|
||||
End Function
|
||||
<DllImport("user32.dll")>
|
||||
Private Function ShowWindow(ByVal hWnd As IntPtr, ByVal flags As ShowWindowEnum) As Boolean
|
||||
End Function
|
||||
<DllImport("user32.dll")>
|
||||
Private Function SetForegroundWindow(ByVal hwnd As IntPtr) As Integer
|
||||
End Function
|
||||
<DllImport("user32.dll")>
|
||||
Private Function GetWindowPlacement(ByVal hWnd As IntPtr, ByRef lpwndpl As Windowplacement) As Boolean
|
||||
End Function
|
||||
|
||||
Private Enum ShowWindowEnum
|
||||
Hide = 0
|
||||
ShowNormal = 1
|
||||
ShowMinimized = 2
|
||||
ShowMaximized = 3
|
||||
Maximize = 3
|
||||
ShowNormalNoActivate = 4
|
||||
Show = 5
|
||||
Minimize = 6
|
||||
ShowMinNoActivate = 7
|
||||
ShowNoActivate = 8
|
||||
Restore = 9
|
||||
ShowDefault = 10
|
||||
ForceMinimized = 11
|
||||
End Enum
|
||||
|
||||
Private Structure Windowplacement
|
||||
Public length As Integer
|
||||
Public flags As Integer
|
||||
Public showCmd As Integer
|
||||
Public ptMinPosition As System.Drawing.Point
|
||||
Public ptMaxPosition As System.Drawing.Point
|
||||
Public rcNormalPosition As System.Drawing.Rectangle
|
||||
End Structure
|
||||
|
||||
Public Sub BringWindowToFront(wdwIntPtr As IntPtr)
|
||||
'Dim wdwIntPtr As IntPtr = FindWindow(Nothing, "0016 - EgtBEAMWALL")
|
||||
Dim placement As Windowplacement = New Windowplacement()
|
||||
GetWindowPlacement(wdwIntPtr, placement)
|
||||
' se minimizzata
|
||||
If placement.showCmd = 2 Then
|
||||
' riporto in vista non minimizzata
|
||||
ShowWindow(wdwIntPtr, ShowWindowEnum.Restore)
|
||||
End If
|
||||
' porto avanti la finestra rendendola quella attiva
|
||||
SetForegroundWindow(wdwIntPtr)
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
+48
-61
@@ -5,8 +5,13 @@ Imports EgtWPFLib5
|
||||
Public Class SectionXMaterial
|
||||
Inherits VMBase
|
||||
|
||||
Private Shared m_nType As MachineType
|
||||
Public Shared Sub SetType(nType As MachineType)
|
||||
Private Shared m_nType As BWType
|
||||
Public Shared ReadOnly Property nType As BWType
|
||||
Get
|
||||
Return m_nType
|
||||
End Get
|
||||
End Property
|
||||
Public Shared Sub SetType(nType As BWType)
|
||||
m_nType = nType
|
||||
End Sub
|
||||
|
||||
@@ -77,9 +82,9 @@ Public Class SectionXMaterial
|
||||
End Property
|
||||
|
||||
Shared Operator =(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
|
||||
Return (S1.m_dH < S2.m_dH + 100 * EPS_SMALL AndAlso S1.m_dH > S2.m_dH - 100 * EPS_SMALL AndAlso
|
||||
S1.m_dW < S2.m_dW + 100 * EPS_SMALL AndAlso S1.m_dW > S2.m_dW - 100 * EPS_SMALL AndAlso
|
||||
S1.m_dL < S2.m_dL + 100 * EPS_SMALL AndAlso S1.m_dL > S2.m_dL - 100 * EPS_SMALL AndAlso
|
||||
Return (Math.Abs( S1.m_dH - S2.m_dH) < 100 * EPS_SMALL AndAlso
|
||||
Math.Abs( S1.m_dW - S2.m_dW) < 100 * EPS_SMALL AndAlso
|
||||
Math.Abs( S1.m_dL - S2.m_dL) < 100 * EPS_SMALL AndAlso
|
||||
S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x)))
|
||||
End Operator
|
||||
|
||||
@@ -95,10 +100,10 @@ Public Class SectionXMaterial
|
||||
End Function
|
||||
|
||||
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String)
|
||||
If m_nType = MachineType.BEAM Then
|
||||
If m_nType = BWType.BEAM Then
|
||||
m_dW = dW
|
||||
m_dH = dH
|
||||
ElseIf m_nType = MachineType.WALL Then
|
||||
ElseIf m_nType = BWType.WALL Then
|
||||
m_dH = dH
|
||||
Else
|
||||
m_dW = dW
|
||||
@@ -136,6 +141,16 @@ Public Class SectionXMaterial
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nQuantity As Integer
|
||||
Public Property nQuantity As Integer
|
||||
Get
|
||||
Return m_nQuantity
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nQuantity = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Alias_IsEnabled As Boolean
|
||||
Public Property Alias_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -147,65 +162,12 @@ Public Class SectionXMaterial
|
||||
End Property
|
||||
|
||||
Private m_Alias_IsChecked As Boolean
|
||||
Public Property Alias_IsChecked As Boolean
|
||||
Public Overridable Property Alias_IsChecked As Boolean
|
||||
Get
|
||||
Return m_Alias_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Alias_IsChecked = value
|
||||
If value Then
|
||||
NewBeam_Visibility = Visibility.Collapsed
|
||||
NewWall_Visibility = Visibility.Collapsed
|
||||
Alias_Visibility = Visibility.Visible
|
||||
Else
|
||||
If m_nType = MachineType.BEAM Then
|
||||
NewBeam_Visibility = Visibility.Visible
|
||||
NewWall_Visibility = Visibility.Collapsed
|
||||
Else
|
||||
NewBeam_Visibility = Visibility.Collapsed
|
||||
NewWall_Visibility = Visibility.Visible
|
||||
End If
|
||||
Alias_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_NewBeam_Visibility As Visibility
|
||||
Public Property NewBeam_Visibility As Visibility
|
||||
Get
|
||||
Return m_NewBeam_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
If value <> m_NewBeam_Visibility Then
|
||||
m_NewBeam_Visibility = value
|
||||
NotifyPropertyChanged("NewBeam_Visibility")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_NewWall_Visibility As Visibility
|
||||
Public Property NewWall_Visibility As Visibility
|
||||
Get
|
||||
Return m_NewWall_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
If value <> m_NewWall_Visibility Then
|
||||
m_NewWall_Visibility = value
|
||||
NotifyPropertyChanged("NewWall_Visibility")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Alias_Visibility As Visibility
|
||||
Public Property Alias_Visibility As Visibility
|
||||
Get
|
||||
Return m_Alias_Visibility
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
If value <> m_Alias_Visibility Then
|
||||
m_Alias_Visibility = value
|
||||
NotifyPropertyChanged("Alias_Visibility")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -227,6 +189,31 @@ Public Class SectionXMaterial
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Quantity_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61774)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, nQuantity As Integer)
|
||||
If m_nType = BWType.BEAM Then
|
||||
m_dW = dW
|
||||
m_dH = dH
|
||||
ElseIf m_nType = BWType.WALL Then
|
||||
m_dH = dH
|
||||
Else
|
||||
m_dW = dW
|
||||
m_dH = dH
|
||||
m_dL = dL
|
||||
End If
|
||||
m_Material = New List(Of String)
|
||||
Dim sMaterialArray() As String = Split(sMaterial, ";")
|
||||
For Each sMatItem In sMaterialArray
|
||||
m_Material.Add(sMatItem)
|
||||
Next
|
||||
m_nQuantity = nQuantity
|
||||
End Sub
|
||||
|
||||
#End Region ' Import BTL <-> Warehouse
|
||||
|
||||
End Class
|
||||
@@ -1,12 +0,0 @@
|
||||
Imports System.ComponentModel
|
||||
|
||||
Public Class VMBase
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,44 @@
|
||||
<EgtFloating:EgtFloatingPanel x:Class="ViewPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
|
||||
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
|
||||
<Button ToolTip="{Binding ZoomAllToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding ZoomAllCommand}">
|
||||
<Image Source="/Resources/ViewPanel/ZoomAll.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding LookFromTopToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding TopViewCommand}">
|
||||
<Image Source="/Resources/ViewPanel/LookFromTOP.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding LookFromFrontToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding FrontViewCommand}">
|
||||
<Image Source="/Resources/ViewPanel/LookFromFRONT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding LookFromRightToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding RightViewCommand}">
|
||||
<Image Source="/Resources/ViewPanel/LookFromRIGHT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding LookFromBackToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding BackViewCommand}">
|
||||
<Image Source="/Resources/ViewPanel/LookFromBACK.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding LookFromLeftToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding LeftViewCommand}">
|
||||
<Image Source="/Resources/ViewPanel/LookFromLEFT.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button ToolTip="{Binding LookFromIso_SWToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding IsoViewSWCommand}">
|
||||
<Image Source="/Resources/ViewPanel/LookFromISO_SW.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class ViewPanelV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,265 @@
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ViewPanelVM
|
||||
Inherits EgtWPFLib5.ViewPanelVM
|
||||
|
||||
' Tipo di progetto aperto
|
||||
Private Shared m_Type As BWType
|
||||
Public Shared ReadOnly Property Type As BWType
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Posizione vista
|
||||
Private Shared m_nViewDir As VT = VT.ISO_SW
|
||||
|
||||
Public Shared Sub BWSetView(nView As VT, Optional bRedraw As Boolean = True)
|
||||
' condizioni che cambiano la vista del progetto
|
||||
'Select Case m_Type
|
||||
' Case BWType.BEAM
|
||||
' Select Case nView
|
||||
' Case VT.TOP
|
||||
' EgtSetView(VT.TOP, bRedraw)
|
||||
' Case VT.FRONT
|
||||
' EgtSetView(VT.FRONT, bRedraw)
|
||||
' Case VT.BACK
|
||||
' EgtSetView(VT.BACK, bRedraw)
|
||||
' Case VT.RIGHT
|
||||
' EgtSetView(VT.RIGHT, bRedraw)
|
||||
' Case VT.LEFT
|
||||
' EgtSetView(VT.LEFT, bRedraw)
|
||||
' Case VT.ISO_SW
|
||||
' EgtSetView(VT.ISO_SW, bRedraw)
|
||||
' Case Else ' VT.ISO_SW
|
||||
' EgtSetView(VT.ISO_SW, bRedraw)
|
||||
' End Select
|
||||
' Case BWType.WALL
|
||||
Select Case nView
|
||||
Case VT.TOP
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(0, -90, bRedraw) ' equivalente a vista TOP
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(0, 90, bRedraw) ' equivalente a vista TOP ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.FRONT
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(90, -90, bRedraw) ' equivalente a vista FRONT
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(90, 90, bRedraw) ' equivalente a vista FRONT ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.BACK
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(-90, -90, bRedraw) ' equivalente a vista BACK
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(-90, 90, bRedraw) ' equivalente a vista BACK ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.RIGHT
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista RIGHT
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista RIGHT ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.LEFT
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista LEFT
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista LEFT ruotata di 180 su Z
|
||||
End Select
|
||||
Case VT.ISO_SW
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
|
||||
End Select
|
||||
Case Else ' VT.ISO_SW
|
||||
Select Case m_nViewDir
|
||||
Case VT.ISO_SW, VT.ISO_SE
|
||||
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
|
||||
Case VT.ISO_NW, VT.ISO_NE
|
||||
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
|
||||
End Select
|
||||
End Select
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
Public Shared Sub UpdateMachParam(ViewDir As VT)
|
||||
m_nViewDir = ViewDir
|
||||
End Sub
|
||||
|
||||
Public Shared Sub UpdateBWType(Type As BWType)
|
||||
m_Type = Type
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "TopViewCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Execute the TopView. This method is invoked by the TopViewCommand.
|
||||
''' </summary>
|
||||
Public Overrides Sub TopView(ByVal param As Object)
|
||||
ViewPanelVM.BWSetView(VT.TOP, True)
|
||||
End Sub
|
||||
|
||||
#End Region ' TopViewCommand
|
||||
|
||||
#Region "FrontViewCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Execute the FrontView. This method is invoked by the FrontViewCommand.
|
||||
''' </summary>
|
||||
Public Overrides Sub FrontView(ByVal param As Object)
|
||||
ViewPanelVM.BWSetView(VT.FRONT, True)
|
||||
End Sub
|
||||
|
||||
#End Region ' FrontViewCommand
|
||||
|
||||
#Region "LeftViewCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Execute the LeftView. This method is invoked by the LeftViewCommand.
|
||||
''' </summary>
|
||||
Public Overrides Sub LeftView(ByVal param As Object)
|
||||
ViewPanelVM.BWSetView(VT.LEFT, True)
|
||||
End Sub
|
||||
|
||||
#End Region ' LeftViewCommand
|
||||
|
||||
#Region "BackViewCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Execute the BackView. This method is invoked by the BackViewCommand.
|
||||
''' </summary>
|
||||
Public Overrides Sub BackView(ByVal param As Object)
|
||||
ViewPanelVM.BWSetView(VT.BACK, True)
|
||||
End Sub
|
||||
|
||||
#End Region ' BackViewCommand
|
||||
|
||||
#Region "RightViewCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Execute the RightView. This method is invoked by the RightViewCommand.
|
||||
''' </summary>
|
||||
Public Overrides Sub RightView(ByVal param As Object)
|
||||
ViewPanelVM.BWSetView(VT.RIGHT, True)
|
||||
End Sub
|
||||
|
||||
#End Region ' RightViewCommand
|
||||
|
||||
'#Region "IsoViewSECommand"
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns a command that do IsoViewSE.
|
||||
' ''' </summary>
|
||||
' Public ReadOnly Property IsoViewSECommand As ICommand
|
||||
' Get
|
||||
' If m_cmdIsoViewSE Is Nothing Then
|
||||
' m_cmdIsoViewSE = New Command(AddressOf IsoViewSE)
|
||||
' End If
|
||||
' Return m_cmdIsoViewSE
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Execute the IsoViewSE. This method is invoked by the IsoViewSECommand.
|
||||
' ''' </summary>
|
||||
' Public Sub IsoViewSE(ByVal param As Object)
|
||||
' LibMap.refSceneHostVM.MainScene.IsoViewSE()
|
||||
' End Sub
|
||||
|
||||
'#End Region ' IsoViewSECommand
|
||||
|
||||
#Region "IsoViewSWCommand"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Execute the IsoViewSW. This method is invoked by the IsoViewSWCommand.
|
||||
''' </summary>
|
||||
Public Overrides Sub IsoViewSW(ByVal param As Object)
|
||||
ViewPanelVM.BWSetView(VT.ISO_SW, True)
|
||||
End Sub
|
||||
|
||||
#End Region ' IsoViewSWCommand
|
||||
|
||||
'#Region "IsoViewNECommand"
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns a command that do IsoViewNE.
|
||||
' ''' </summary>
|
||||
' Public ReadOnly Property IsoViewNECommand As ICommand
|
||||
' Get
|
||||
' If m_cmdIsoViewNE Is Nothing Then
|
||||
' m_cmdIsoViewNE = New Command(AddressOf IsoViewNE)
|
||||
' End If
|
||||
' Return m_cmdIsoViewNE
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Execute the IsoViewNE. This method is invoked by the IsoViewNECommand.
|
||||
' ''' </summary>
|
||||
' Public Sub IsoViewNE(ByVal param As Object)
|
||||
' LibMap.refSceneHostVM.MainScene.IsoViewNE()
|
||||
' End Sub
|
||||
|
||||
'#End Region ' IsoViewNECommand
|
||||
|
||||
'#Region "IsoViewNWCommand"
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns a command that do IsoViewNW.
|
||||
' ''' </summary>
|
||||
' Public ReadOnly Property IsoViewNWCommand As ICommand
|
||||
' Get
|
||||
' If m_cmdIsoViewNW Is Nothing Then
|
||||
' m_cmdIsoViewNW = New Command(AddressOf IsoViewNW)
|
||||
' End If
|
||||
' Return m_cmdIsoViewNW
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Execute the IsoViewNW. This method is invoked by the IsoViewNWCommand.
|
||||
' ''' </summary>
|
||||
' Public Sub IsoViewNW(ByVal param As Object)
|
||||
' LibMap.refSceneHostVM.MainScene.IsoViewNW()
|
||||
' End Sub
|
||||
|
||||
'#End Region ' IsoViewNWCommand
|
||||
|
||||
'#Region "ViewToCPlaneCommand"
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Returns a command that do GetDist.
|
||||
' ''' </summary>
|
||||
' Public ReadOnly Property ViewToCPlaneCommand As ICommand
|
||||
' Get
|
||||
' If m_cmdViewToCPlane Is Nothing Then
|
||||
' m_cmdViewToCPlane = New Command(AddressOf ViewToCPlane)
|
||||
' End If
|
||||
' Return m_cmdViewToCPlane
|
||||
' End Get
|
||||
' End Property
|
||||
|
||||
' ''' <summary>
|
||||
' ''' Execute the GetDist. This method is invoked by the GetDistCommand.
|
||||
' ''' </summary>
|
||||
' Public Sub ViewToCPlane(ByVal param As Object)
|
||||
' LibMap.refSceneHostVM.MainScene.CPlaneView()
|
||||
' End Sub
|
||||
|
||||
'#End Region ' ViewToCPlaneCommand
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using EgtBEAMWALL.DataLayer.Migrations;
|
||||
using MySql.Data.EntityFramework;
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Migrations;
|
||||
using MySql.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using EgtBEAMWALL.DataLayer.Migrations;
|
||||
using System.ServiceProcess;
|
||||
using System.IO;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer
|
||||
{
|
||||
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||
//[DbConfigurationType(typeof(aMySqlConfiguration))]
|
||||
public class AdminContext : DbContext
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
|
||||
public AdminContext() : base("DefaultConnection")
|
||||
public AdminContext() : base(DbConfig.ADMIN_CONNECTION_STRING)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,5 +33,67 @@ namespace EgtBEAMWALL.DataLayer
|
||||
public DbSet<UserPriv> UserList { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public bool SetUpDbConnectionAndDbConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
String serviceName = getDbServiceName();
|
||||
if (serviceName.Equals(""))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ServiceController service = new ServiceController(serviceName);
|
||||
try
|
||||
{
|
||||
TimeSpan timeout = TimeSpan.FromSeconds(DbConfig.DATABASE_PROCESS_TIMEOUT);
|
||||
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//Database.SetInitializer<DatabaseContext>(null);
|
||||
Database.SetInitializer(new MigrateDatabaseToLatestVersion<DatabaseContext, Configuration>());
|
||||
var migrator = new DbMigrator(new Configuration());
|
||||
|
||||
if (migrator.GetPendingMigrations().Any())
|
||||
{
|
||||
// Run migrations and seed.
|
||||
migrator.Update();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine(exc.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private static string getDbServiceName()
|
||||
{
|
||||
ServiceController[] services = ServiceController.GetServices();
|
||||
var service = services.FirstOrDefault(s => s.ServiceName == "MariaDB");
|
||||
if (service != null)
|
||||
return service.DisplayName;
|
||||
|
||||
service = services.FirstOrDefault(s => s.ServiceName == "MySQL");
|
||||
if (service != null)
|
||||
return service.DisplayName;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework"
|
||||
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
requirePermission="false" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<connectionStrings>
|
||||
<add name="DefaultConnection"
|
||||
connectionString="server=localhost;port=3306;User Id=EgtUser;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none"
|
||||
providerName="MySql.Data.MySqlClient" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.10.9.0" newVersion="6.10.9.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
|
||||
<providers>
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||
</provider>
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<connectionStrings>
|
||||
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=Egalware_24068!;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -1,25 +1,17 @@
|
||||
using System;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class BTLPartController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public BTLPartController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
@@ -32,7 +24,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <param name="corePart"></param>
|
||||
/// <param name="currProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public static BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
|
||||
public BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
|
||||
{
|
||||
BTLPartModel answ = new BTLPartModel();
|
||||
if (corePart != null)
|
||||
@@ -105,15 +97,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.AddRange(partData);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.BTLPartList.AddRange(partData);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Create: {exc}");
|
||||
string errMessage = $"EXCEPTION on BTLPart.Create: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
return partData;
|
||||
}
|
||||
@@ -147,15 +143,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.AddRange(partData);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.BTLPartList.AddRange(partData);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on CreateBaseObj: {exc}");
|
||||
string errMessage = $"EXCEPTION on BTLPart.CreateBaseObj: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
|
||||
return partData;
|
||||
@@ -169,22 +169,26 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Delete(int PartDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var item2del = dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var item2del = localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.BTLPartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.Remove(item2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Delete: {exc}");
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.BTLPartList.Remove(item2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on BTLPart.Delete: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
@@ -197,29 +201,31 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool DeleteByProject(int ProjDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var items2del = dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var items2del = localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == ProjDbId);
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.BTLPartList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on DeleteByProject: {exc}");
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.BTLPartList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on BTLPart.DeleteByProject: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -229,10 +235,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public BTLPartModel FindByDbId(int PartDbId)
|
||||
{
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
return localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.BTLPartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -242,10 +251,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public BTLPartModel FindByPartId(int PartId)
|
||||
{
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
return localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartId == PartId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -256,10 +268,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public BTLPartModel FindByPartIdProjDbId(int PartId, int ProjDbId)
|
||||
{
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
return localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.PartId == PartId && x.ProjDbId == ProjDbId)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -269,12 +284,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetByProjectAsc(int ProjDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
return localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == ProjDbId)
|
||||
.OrderBy(x => x.BTLPartDbId)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -284,12 +302,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetByProjectDesc(int ProjDbId)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
return localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == ProjDbId)
|
||||
.OrderByDescending(x => x.BTLPartDbId)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -300,17 +321,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetPaginatedAsc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
List<BTLPartModel> answ = new List<BTLPartModel>();
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.BTLPartDbId <= PartDbIdStart)
|
||||
.OrderBy(x => x.BTLPartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
answ = localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.BTLPartDbId <= PartDbIdStart)
|
||||
.OrderBy(x => x.BTLPartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -321,26 +347,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public List<BTLPartModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
|
||||
{
|
||||
List<BTLPartModel> answ = new List<BTLPartModel>();
|
||||
int numEnd = PartDbIdStart - numRecord;
|
||||
// check numEnd
|
||||
if (numEnd < 0)
|
||||
numEnd = 0;
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.BTLPartDbId <= PartDbIdStart)
|
||||
.OrderByDescending(x => x.BTLPartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reinizializzaizone del controller
|
||||
/// </summary>
|
||||
public void ResetController()
|
||||
{
|
||||
// Re-Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
answ = localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.BTLPartDbId <= PartDbIdStart)
|
||||
.OrderByDescending(x => x.BTLPartDbId)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -351,32 +373,44 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Update(BTLPartModel updItem)
|
||||
{
|
||||
bool done = false;
|
||||
var item2update = dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var item2update = localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.BTLPartDbId == updItem.BTLPartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
|
||||
//// update, vers 2
|
||||
//dbCtx.BTLPartList.Remove(item2del);
|
||||
//dbCtx.BTLPartList.Add(updItem);
|
||||
//// update, vers 2
|
||||
//localDbCtx.BTLPartList.Remove(item2del);
|
||||
//localDbCtx.BTLPartList.Add(updItem);
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
done = true;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on BTLPart.Update: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Update: {exc}");
|
||||
}
|
||||
// reset...
|
||||
ResetController();
|
||||
return done;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Istanza logger
|
||||
/// </summary>
|
||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -1,97 +1,227 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using System.Threading;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class DbController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
public class DbController : IDisposable
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
private AdminContext adbCtx;
|
||||
/// <summary>
|
||||
/// Singleton gestione
|
||||
/// </summary>
|
||||
public static DbController man = new DbController();
|
||||
|
||||
#endregion Private Fields
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Fields
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Singleton gestione
|
||||
/// </summary>
|
||||
public static DbController man = new DbController();
|
||||
public DbController()
|
||||
{
|
||||
// Initialize database context for ADMIN
|
||||
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
|
||||
// DB standard utente
|
||||
dbCtx = new AdminContext(DbConfig.CONNECTION_STRING);
|
||||
}
|
||||
|
||||
#endregion Public Fields
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Constructors
|
||||
#region Public Methods
|
||||
|
||||
public DbController()
|
||||
{
|
||||
// Initialize database context for ADMIN
|
||||
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica necessità creazione utente (locale o in rete)
|
||||
/// </summary>
|
||||
/// <param name="username"></param>
|
||||
/// <param name="pwd"></param>
|
||||
/// <param name="isNetwork"></param>
|
||||
/// <returns></returns>
|
||||
public bool checkCreateUser(string username, string pwd, bool isNetwork)
|
||||
{
|
||||
bool answ = false;
|
||||
string domain = isNetwork ? "%" : "localhost";
|
||||
answ = doCheckCreate(username, pwd, answ, domain, false);
|
||||
if (answ)
|
||||
{
|
||||
doGrantPriv(username, domain, "ALL ON *.*");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
/// <summary>
|
||||
/// Migrazione esplicita del DB da parte dell'admin controller
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool checkMigrateDb()
|
||||
{
|
||||
return adbCtx.SetUpDbConnectionAndDbConfig();
|
||||
}
|
||||
|
||||
#region Public Methods
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
adbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica esistenza views + utente relativo eventualmente ricreandole + fornendo accesso
|
||||
/// all'utente ReadOnly Essetre
|
||||
/// </summary>
|
||||
/// <param name="dbName"></param>
|
||||
/// <param name="username"></param>
|
||||
/// <param name="pwd"></param>
|
||||
/// <returns></returns>
|
||||
public bool refreshViews(string dbName, string username = "S3_User", string pwd = "S3_P4ssw0rd")
|
||||
{
|
||||
bool answ = false;
|
||||
|
||||
// in primis refresh delle view
|
||||
string sqlCommand = @"CREATE OR REPLACE VIEW v_expProdRaw AS
|
||||
SELECT DbId, AlarmDtEvent AS DtEvent, VarValue,
|
||||
SUBSTRING_INDEX(VarValue, ';', 1) AS Prod,
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', 2), ';', -1) AS MachGroupId,
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', -2), ';', 1) AS PartId,
|
||||
SUBSTRING_INDEX(VarValue, ';', -1) AS Status
|
||||
FROM logmachine
|
||||
WHERE ResultType = 1
|
||||
AND VarAddress = 1;
|
||||
|
||||
CREATE OR REPLACE VIEW v_expProd AS
|
||||
SELECT vp.DtEvent, vp.Prod, mgl.Name AS mgName, pl.PDN, vp.`Status`
|
||||
FROM v_expProdRaw AS vp
|
||||
INNER JOIN MachGroupList mgl ON vp.MachGroupId = mgl.Id
|
||||
INNER JOIN partlist pl ON vp.PartId = pl.Id;";
|
||||
dbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
Thread.Sleep(100);
|
||||
|
||||
// ora setup parametri x utente
|
||||
string domain = "%";
|
||||
|
||||
// ora controllo utente con diritti
|
||||
answ = doCheckCreate(username, pwd, answ, domain, true);
|
||||
if (answ)
|
||||
{
|
||||
doGrantPriv(username, domain, "USAGE ON *.*");
|
||||
doGrantPriv(username, domain, $"SELECT ON {dbName}.v_expProd");
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ATTENZIONE!!!! Procedura di Reset del DB
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool ResetDb()
|
||||
{
|
||||
bool answ = false;
|
||||
|
||||
try
|
||||
{
|
||||
adbCtx
|
||||
.Database
|
||||
.SqlQuery<int>("CALL stp_ResetDb()");
|
||||
answ = true;
|
||||
|
||||
adbCtx.SaveChanges();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on DbController.ResetDb: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private AdminContext adbCtx;
|
||||
private AdminContext dbCtx;
|
||||
|
||||
/// <summary>
|
||||
/// Istanza logger
|
||||
/// </summary>
|
||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Procedura interna effettiva di check utente ed eventuale creazione + grant level
|
||||
/// </summary>
|
||||
/// <param name="username"></param>
|
||||
/// <param name="pwd"></param>
|
||||
/// <param name="answ"></param>
|
||||
/// <param name="domain"></param>
|
||||
/// <param name="force">Force = esegue un drop prima...</param>
|
||||
/// <returns></returns>
|
||||
private bool doCheckCreate(string username, string pwd, bool answ, string domain, bool force)
|
||||
{
|
||||
// ricerca utente...
|
||||
var numUser = adbCtx
|
||||
.UserList
|
||||
.Where(x => x.User == username)
|
||||
.ToList()
|
||||
.Count;
|
||||
if (numUser > 0)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
if (!answ)
|
||||
{
|
||||
// creo utente
|
||||
string sqlCommand = $"DROP USER IF EXISTS {username};";
|
||||
if (force)
|
||||
{
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
sqlCommand = "FLUSH PRIVILEGES;";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
Thread.Sleep(100);
|
||||
sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}';";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
Thread.Sleep(100);
|
||||
sqlCommand = "FLUSH PRIVILEGES;";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
Thread.Sleep(100);
|
||||
answ = true;
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Procedura interna effettiva di grant level x utente
|
||||
/// </summary>
|
||||
/// <param name="username"></param>
|
||||
/// <param name="domain"></param>
|
||||
/// <param name="grantLevel"></param>
|
||||
/// <returns></returns>
|
||||
private bool doGrantPriv(string username, string domain, string grantLevel)
|
||||
{
|
||||
bool answ = false;
|
||||
|
||||
public bool checkCreateUser(string username, string pwd)
|
||||
{
|
||||
bool answ = false;
|
||||
// ricerca utente...
|
||||
var numUser = adbCtx
|
||||
.UserList
|
||||
.Where(x => x.User == username)
|
||||
.ToList()
|
||||
.Count;
|
||||
if (numUser > 0)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
if (!answ)
|
||||
{
|
||||
// creo utente
|
||||
string sqlCommand = "FLUSH PRIVILEGES;";
|
||||
//string sqlCommand = $"CREATE USER '{username}'@'localhost' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
|
||||
//string sqlCommand = $"CREATE USER '{username}'@'localhost' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
sqlCommand = $"CREATE USER '{username}'@'localhost' IDENTIFIED BY '{pwd}';";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
sqlCommand = $"GRANT ALL ON *.* TO '{username}'@'localhost';";
|
||||
Thread.Sleep(100);
|
||||
sqlCommand = $"GRANT {grantLevel} TO '{username}'@'{domain}';";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
Thread.Sleep(100);
|
||||
sqlCommand = "FLUSH PRIVILEGES;";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
adbCtx.Dispose();
|
||||
}
|
||||
|
||||
public bool ResetDb()
|
||||
{
|
||||
bool answ = false;
|
||||
|
||||
try
|
||||
{
|
||||
adbCtx
|
||||
.Database
|
||||
.SqlQuery<int>("CALL stp_ResetDb()");
|
||||
Thread.Sleep(100);
|
||||
answ = true;
|
||||
|
||||
adbCtx.SaveChanges();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on ResetDb: {exc}");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,17 @@
|
||||
using System;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class LogMachineController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public LogMachineController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
@@ -31,7 +23,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// </summary>
|
||||
/// <param name="coreMacLog"></param>
|
||||
/// <returns></returns>
|
||||
public static LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
||||
public LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
||||
{
|
||||
LogMachineModel answ = new LogMachineModel();
|
||||
if (coreMacLog != null)
|
||||
@@ -61,9 +53,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// </summary>
|
||||
/// <param name="dbLog"></param>
|
||||
/// <returns></returns>
|
||||
public static Core.MachLog ConvertToCore(LogMachineModel dbLog)
|
||||
public Core.MachLog ConvertToCore(LogMachineModel dbLog)
|
||||
{
|
||||
var newRecord = Core.MachLog.CreateMacLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue);
|
||||
var newRecord = Core.MachLog.CreateMachLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue);
|
||||
return newRecord;
|
||||
}
|
||||
|
||||
@@ -79,18 +71,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var currDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
using (var locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Add to database
|
||||
currDbCtx.LogMachineList.Add(newLogMac);
|
||||
locallocalDbCtx.LogMachineList.Add(newLogMac);
|
||||
// Commit changes
|
||||
currDbCtx.SaveChanges();
|
||||
ResetController();
|
||||
locallocalDbCtx.SaveChanges();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Create LogMachine: {exc}");
|
||||
string errMessage = $"EXCEPTION on LogMachine.Create: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -117,29 +110,31 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool DeleteByKey(int LogDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var items2del = dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var items2del = localDbCtx
|
||||
.LogMachineList
|
||||
.Where(x => x.LogDbId == LogDbId);
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.LogMachineList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on DeleteByKey: {exc}");
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.LogMachineList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on LogMachine.DeleteByKey: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -149,10 +144,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public LogMachineModel FindByDbId(int LogDbId)
|
||||
{
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
return localDbCtx
|
||||
.LogMachineList
|
||||
.Where(x => x.LogDbId == LogDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -163,12 +161,41 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public List<LogMachineModel> GetAsc(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
return localDbCtx
|
||||
.LogMachineList
|
||||
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
|
||||
.OrderBy(x => x.AlarmDatetime)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (ASC ordered) in "core format"
|
||||
/// </summary>
|
||||
/// <param name="dtStart"></param>
|
||||
/// <param name="dtEnd"></param>
|
||||
/// <returns></returns>
|
||||
public List<Core.MachLog> GetCoreAsc(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
var rawData = GetAsc(dtStart, dtEnd);
|
||||
var coreData = rawData.Select(x => ConvertToCore(x)).ToList();
|
||||
return coreData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get paginated data from DB (DESC ordered) in "core format"
|
||||
/// </summary>
|
||||
/// <param name="dtStart"></param>
|
||||
/// <param name="dtEnd"></param>
|
||||
/// <returns></returns>
|
||||
public List<Core.MachLog> GetCoreDesc(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
var rawData = GetDesc(dtStart, dtEnd);
|
||||
var coreData = rawData.Select(x => ConvertToCore(x)).ToList();
|
||||
return coreData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -179,21 +206,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public List<LogMachineModel> GetDesc(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
return localDbCtx
|
||||
.LogMachineList
|
||||
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
|
||||
.OrderByDescending(x => x.AlarmDatetime)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reinizializzaizone del controller
|
||||
/// </summary>
|
||||
public void ResetController()
|
||||
{
|
||||
// Re-Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -204,27 +225,40 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Update(LogMachineModel updItem)
|
||||
{
|
||||
bool done = false;
|
||||
var item2update = dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var item2update = localDbCtx
|
||||
.LogMachineList
|
||||
.Where(x => x.LogDbId == updItem.LogDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Update: {exc}");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on LogMachine.Update: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Istanza logger
|
||||
/// </summary>
|
||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,17 @@
|
||||
using System;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class LogSupportController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public LogSupportController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
@@ -41,24 +33,28 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Create(DateTime dtCreated, Core.LogSupportLevel level, Core.LogSupportTarget target, string message)
|
||||
{
|
||||
bool fatto = false;
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
try
|
||||
{
|
||||
LogSupportModel newItem = new LogSupportModel() { DtEvent = dtCreated, Level = level, Target = target, Message = message };
|
||||
// Add to database
|
||||
dbCtx.LogSupportList.Add(newItem);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Create LogSupport: {exc}");
|
||||
try
|
||||
{
|
||||
LogSupportModel newItem = new LogSupportModel() { DtEvent = dtCreated, Level = level, Target = target, Message = message };
|
||||
// Add to database
|
||||
localDbCtx.LogSupportList.Add(newItem);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on LogSupport.Create: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return fatto;
|
||||
}
|
||||
|
||||
@@ -70,29 +66,31 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool DeleteByKey(int LogDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var items2del = dbCtx
|
||||
.LogSupportList
|
||||
.Where(x => x.LogDbId == LogDbId);
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.LogSupportList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on DeleteByKey: {exc}");
|
||||
var items2del = localDbCtx
|
||||
.LogSupportList
|
||||
.Where(x => x.LogDbId == LogDbId);
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.LogSupportList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on LogSupport.DeleteByKey: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -102,10 +100,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public LogSupportModel FindByDbId(int LogDbId)
|
||||
{
|
||||
return dbCtx
|
||||
.LogSupportList
|
||||
.Where(x => x.LogDbId == LogDbId)
|
||||
.SingleOrDefault();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
return localDbCtx
|
||||
.LogSupportList
|
||||
.Where(x => x.LogDbId == LogDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -117,11 +118,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public List<LogSupportModel> GetPaginatedAsc(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
return localDbCtx
|
||||
.LogSupportList
|
||||
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
|
||||
.OrderBy(x => x.DtEvent)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -133,20 +137,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public List<LogSupportModel> GetPaginatedDesc(DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
return localDbCtx
|
||||
.LogSupportList
|
||||
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
|
||||
.OrderByDescending(x => x.DtEvent)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reinizializzaizone del controller
|
||||
/// </summary>
|
||||
public void ResetController()
|
||||
{
|
||||
// Re-Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -157,27 +155,40 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Update(LogSupportModel updItem)
|
||||
{
|
||||
bool done = false;
|
||||
var item2update = dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var item2update = localDbCtx
|
||||
.LogSupportList
|
||||
.Where(x => x.LogDbId == updItem.LogDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Update: {exc}");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on LogSupport.Update: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Istanza logger
|
||||
/// </summary>
|
||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,105 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class PartController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Fields
|
||||
|
||||
public static PartController man = new PartController();
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public PartController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
}
|
||||
{ }
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Get BtlPartDBId by ProjId + PDN
|
||||
/// </summary>
|
||||
/// <param name="ProjId"></param>
|
||||
/// <param name="PDN"></param>
|
||||
/// <returns></returns>
|
||||
protected int FindBtlPart(int ProjId, int PDN)
|
||||
{
|
||||
int BtlPartDbId = 0;
|
||||
|
||||
#if false
|
||||
var currProj = dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjId == ProjId)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (currProj != null)
|
||||
{
|
||||
var btlPart = dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == currProj.ProjDbId && x.PDN == PDN)
|
||||
.SingleOrDefault();
|
||||
|
||||
if (btlPart != null)
|
||||
{
|
||||
BtlPartDbId = btlPart.BTLPartDbId;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
var btlPart = dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.Project.ProjId == ProjId && x.PDN == PDN)
|
||||
.SingleOrDefault();
|
||||
|
||||
if (btlPart != null)
|
||||
{
|
||||
BtlPartDbId = btlPart.BTLPartDbId;
|
||||
}
|
||||
|
||||
return BtlPartDbId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get BtlPartDBId by ProjId + BtlPartId
|
||||
/// </summary>
|
||||
/// <param name="ProjId"></param>
|
||||
/// <param name="BtlPartId"></param>
|
||||
/// <returns></returns>
|
||||
protected int FindBtlPartByBPI(int ProjId, int BtlPartId)
|
||||
{
|
||||
int BtlPartDbId = 0;
|
||||
|
||||
var btlPart = dbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.Project.ProjId == ProjId && x.PartId == BtlPartId)
|
||||
.SingleOrDefault();
|
||||
|
||||
if (btlPart != null)
|
||||
{
|
||||
BtlPartDbId = btlPart.BTLPartDbId;
|
||||
}
|
||||
|
||||
return BtlPartDbId;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
@@ -108,19 +22,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <param name="corePart"></param>
|
||||
/// <param name="currMachGroupDbId"></param>
|
||||
/// <returns></returns>
|
||||
public static PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
|
||||
public PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
|
||||
{
|
||||
PartModel answ = new PartModel();
|
||||
if (corePart != null)
|
||||
{
|
||||
int BTLPartId = man.FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
|
||||
int BTLPartId = FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
|
||||
answ = new PartModel()
|
||||
{
|
||||
PartId = corePart.nPartId,
|
||||
PDN = corePart.nPDN,
|
||||
BTLPartDbId = BTLPartId,
|
||||
MachGroupDbId = currMachGroupDbId,
|
||||
State = Core.ItemState.Assigned,
|
||||
State = corePart.nProductionState,
|
||||
NAM = corePart.sNAM,
|
||||
W = corePart.dW,
|
||||
L = corePart.dL,
|
||||
@@ -151,24 +65,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Delete(int ProdId, int MachGroupId, int PartId)
|
||||
{
|
||||
bool done = false;
|
||||
var item2del = dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Remove from database
|
||||
dbCtx.PartList.Remove(item2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId} | PartId: {PartId}{Environment.NewLine}{exc}");
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
var item2del = localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.SingleOrDefault();
|
||||
|
||||
if (item2del != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Remove from database
|
||||
localDbCtx.PartList.Remove(item2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on Part.Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId} | PartId: {PartId}{Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string errMessage = $"ERROR on Part.Delete (01): req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
@@ -181,22 +110,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Delete(int PartDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var item2del = dbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.PartList.Remove(item2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on Delete: {exc}");
|
||||
var item2del = localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
|
||||
if (item2del != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.PartList.Remove(item2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on Part.Delete: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string errMessage = $"ERROR on Part.Delete (02): req item was not found | PartDbId {PartDbId}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
@@ -209,29 +152,31 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool DeleteByMachGroup(int MachGroupDbId)
|
||||
{
|
||||
bool done = false;
|
||||
var items2del = dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroupDbId == MachGroupDbId);
|
||||
try
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Add to database
|
||||
dbCtx.PartList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on DeleteByMachGroup: {exc}");
|
||||
var items2del = localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroupDbId == MachGroupDbId);
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.PartList.RemoveRange(items2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on Part.DeleteByMachGroup: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -241,10 +186,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public PartModel FindByDbId(int PartDbId)
|
||||
{
|
||||
return dbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
return localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -252,21 +200,17 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// </summary>
|
||||
/// <param name="PartId"></param>
|
||||
/// <returns></returns>
|
||||
public PartModel FindByPartId(int PartId)
|
||||
public PartModel FindByPartId(int ProdId, int PartId)
|
||||
{
|
||||
return dbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartId == PartId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reinizializzaizone del controller
|
||||
/// </summary>
|
||||
public void ResetController()
|
||||
{
|
||||
// Re-Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
PartModel answ = null;
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
answ = locallocalDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.PartId == PartId)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -277,28 +221,44 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool Update(PartModel updItem)
|
||||
{
|
||||
bool done = false;
|
||||
var item2update = dbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// update, vers 1...
|
||||
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
var item2upd = locallocalDbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||
.SingleOrDefault();
|
||||
if (item2upd != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
locallocalDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
|
||||
|
||||
//// update, vers 2
|
||||
//dbCtx.PartList.Remove(item2del);
|
||||
//dbCtx.PartList.Add(updItem);
|
||||
//// update, vers 2
|
||||
//localDbCtx.PartList.Remove(item2del);
|
||||
//localDbCtx.PartList.Add(updItem);
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.MachGroup.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
myStatusMapCtrl.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on Part.Update: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string errMessage = $"ERROR on Part.Update (01): req item was not found | PartId {updItem.PartId} | PartDbId {updItem.PartDbId} | BTLPartDbId {updItem.BTLPartDbId}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -311,26 +271,40 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateEnd(int ProdId, int MachGroupId, int PartId, DateTime DtEnd)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.DtEnd = DtEnd;
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.PartEnd, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
}
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var item2upd = locallocalDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.DtEnd = DtEnd;
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
string errMessage = $"ERROR on Part.UpdateEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtEnd {DtEnd}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on Part.UpdateEnd: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
@@ -343,24 +317,38 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateStart(int ProdId, int MachGroupId, int PartId, DateTime DtStart)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.DtStart = DtStart;
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.PartStart, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var item2upd = locallocalDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault();
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.DtStart = DtStart;
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtStart {DtStart}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on Part.UpdateStart: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
|
||||
return done;
|
||||
@@ -375,29 +363,106 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public bool UpdateStatus(int ProdId, int MachGroupId, int PartId, Core.ItemState newState)
|
||||
{
|
||||
bool done = false;
|
||||
try
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiorno
|
||||
dbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var item2upd = locallocalDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault();
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.State = newState;
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | newState {newState}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on Part.UpdateStatus: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Get BtlPartDBId by ProjId + PDN
|
||||
/// </summary>
|
||||
/// <param name="ProjId"></param>
|
||||
/// <param name="PDN"></param>
|
||||
/// <returns></returns>
|
||||
protected int FindBtlPart(int ProjId, int PDN)
|
||||
{
|
||||
int BtlPartDbId = 0;
|
||||
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var btlPart = locallocalDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.Project.ProjId == ProjId && x.PDN == PDN)
|
||||
.SingleOrDefault();
|
||||
|
||||
if (btlPart != null)
|
||||
{
|
||||
BtlPartDbId = btlPart.BTLPartDbId;
|
||||
}
|
||||
}
|
||||
return BtlPartDbId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get BtlPartDBId by ProjId + BtlPartId
|
||||
/// </summary>
|
||||
/// <param name="ProjId"></param>
|
||||
/// <param name="BtlPartId"></param>
|
||||
/// <returns></returns>
|
||||
protected int FindBtlPartByBPI(int ProjId, int BtlPartId)
|
||||
{
|
||||
int BtlPartDbId = 0;
|
||||
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var btlPart = localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.Project.ProjId == ProjId && x.PartId == BtlPartId)
|
||||
.SingleOrDefault();
|
||||
|
||||
if (btlPart != null)
|
||||
{
|
||||
BtlPartDbId = btlPart.BTLPartDbId;
|
||||
}
|
||||
}
|
||||
return BtlPartDbId;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Istanza logger
|
||||
/// </summary>
|
||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,34 +1,17 @@
|
||||
using System;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class StatusMapController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private DatabaseContext dbCtx;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto statico per gestione chiamate da altre classi
|
||||
/// </summary>
|
||||
public static StatusMapController man = new StatusMapController();
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public StatusMapController()
|
||||
{
|
||||
// Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
@@ -38,7 +21,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <summary>
|
||||
/// Elimina i dati di una sessione (SupervisorId) precedente
|
||||
/// </summary>
|
||||
/// <param name="Session">Se vuoto --> tutti</param>
|
||||
/// <param name="Session">Se vuoto --> tutti</param>
|
||||
/// <returns></returns>
|
||||
public bool DeleteSession(string Session)
|
||||
{
|
||||
@@ -46,41 +29,42 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
DateTime adesso = DateTime.Now;
|
||||
List<StatusMapModel> SM2Del = new List<StatusMapModel>();
|
||||
|
||||
// svuoto la tab mappa precedente (da rivalutare in futuro)
|
||||
if (string.IsNullOrEmpty(Session))
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
SM2Del = dbCtx
|
||||
.StatusMapList
|
||||
.ToList();
|
||||
// svuoto la tab mappa precedente (da rivalutare in futuro)
|
||||
if (string.IsNullOrEmpty(Session))
|
||||
{
|
||||
SM2Del = localDbCtx
|
||||
.StatusMapList
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
SM2Del = localDbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.Session == Session)
|
||||
.ToList();
|
||||
}
|
||||
try
|
||||
{
|
||||
// Remove to database
|
||||
localDbCtx.StatusMapList.RemoveRange(SM2Del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on StatusMap.DeleteSession: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SM2Del = dbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.Session == Session)
|
||||
.ToList();
|
||||
}
|
||||
try
|
||||
{
|
||||
// Remove to database
|
||||
dbCtx.StatusMapList.RemoveRange(SM2Del);
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on DeleteSession: {exc}");
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
dbCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -88,52 +72,78 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// </summary>
|
||||
/// <param name="Session"></param>
|
||||
/// <returns></returns>
|
||||
public List<StatusMapModel> GetBySession(string Session = "")
|
||||
public List<StatusMapModel> GetBySession(string Session)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
return localDbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.Session == Session)
|
||||
.OrderByDescending(x => x.Index)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get data for session where Index > minIndex ordered by index DESC
|
||||
/// Get data for session where Index > minIndex ordered by index DESC
|
||||
/// </summary>
|
||||
/// <param name="Session"></param>
|
||||
/// <param name="minIndex"></param>
|
||||
/// <returns></returns>
|
||||
public List<StatusMapModel> GetFrom(int minIndex = 0)
|
||||
public List<StatusMapModel> GetFrom(string Session, int minIndex = 0)
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
return localDbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.Index >= minIndex)
|
||||
.OrderByDescending(x => x.Index)
|
||||
.Where(x => x.Session == Session && x.Index >= minIndex)
|
||||
.OrderBy(x => x.Index)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get PROD data for session
|
||||
/// Get PROD (all)
|
||||
/// </summary>
|
||||
/// <param name="Session"></param>
|
||||
/// <returns></returns>
|
||||
public List<StatusMapModel> GetProd()
|
||||
{
|
||||
// retrieve
|
||||
return dbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod)
|
||||
.OrderByDescending(x => x.Index)
|
||||
.ToList();
|
||||
List<StatusMapModel> answ = new List<StatusMapModel>();
|
||||
// Initialize database context
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
answ = localDbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod)
|
||||
.OrderByDescending(x => x.Index)
|
||||
.ToList();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reinizializzaizone del controller
|
||||
/// Get PROD for session
|
||||
/// </summary>
|
||||
public void ResetController()
|
||||
/// <param name="Session"></param>
|
||||
/// <returns></returns>
|
||||
public List<StatusMapModel> GetProd(string Session)
|
||||
{
|
||||
// Re-Initialize database context
|
||||
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
List<StatusMapModel> answ = new List<StatusMapModel>();
|
||||
// Initialize database context
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
answ = localDbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.Session == Session && x.ItemType == Core.StatusMapItemType.Prod)
|
||||
.OrderByDescending(x => x.Index)
|
||||
.ToList();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -147,8 +157,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
DateTime adesso = DateTime.Now;
|
||||
|
||||
// svuoto dati precedenti
|
||||
done = DeleteSession("");
|
||||
// gestione corretta x multi-supervisors
|
||||
done = DeleteSession(SupervisorId);
|
||||
|
||||
// se ho fatto inserisco nuovo
|
||||
if (done)
|
||||
@@ -157,22 +167,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
done = false;
|
||||
// inserisco dato prod
|
||||
StatusMapModel prodSMRecord = new StatusMapModel() { Session = SupervisorId, Index = 0, ItemId = ProdId, ItemType = Core.StatusMapItemType.Prod, Operation = Core.StatusMapOpType.Startup, DtEvent = adesso, Val = "" };
|
||||
// aggiungo
|
||||
dbCtx.StatusMapList.Add(prodSMRecord);
|
||||
// Initialize database context
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// aggiungo
|
||||
localDbCtx.StatusMapList.Add(prodSMRecord);
|
||||
|
||||
// recupero MachGroup da PROD
|
||||
var MGList = dbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId)
|
||||
.ToList();
|
||||
// recupero MachGroup da PROD
|
||||
var MGList = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId)
|
||||
.ToList();
|
||||
|
||||
var mgSMRecords = MGList.Select(x => new StatusMapModel() { Session = SupervisorId, Index = 0, ItemId = x.MachGroupId, ItemType = Core.StatusMapItemType.MachGroup, Operation = Core.StatusMapOpType.Startup, DtEvent = adesso, Val = "" }).ToList();
|
||||
// aggiungo
|
||||
dbCtx.StatusMapList.AddRange(mgSMRecords);
|
||||
var mgSMRecords = MGList.Select(x => new StatusMapModel() { Session = SupervisorId, Index = 0, ItemId = x.MachGroupId, ItemType = Core.StatusMapItemType.MachGroup, Operation = Core.StatusMapOpType.Startup, DtEvent = adesso, Val = "" }).ToList();
|
||||
// aggiungo
|
||||
localDbCtx.StatusMapList.AddRange(mgSMRecords);
|
||||
|
||||
// salvo
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
// salvo
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
done = true;
|
||||
}
|
||||
return done;
|
||||
@@ -188,57 +201,70 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <param name="Operation"></param>
|
||||
/// <param name="Value"></param>
|
||||
/// <returns></returns>
|
||||
public bool UpdateAction(String Session, int ProdId, int ItemId, Core.StatusMapItemType ItemType, Core.StatusMapOpType Operation, string Value)
|
||||
public bool UpdateAction(string Session, int ProdId, int ItemId, Core.StatusMapItemType ItemType, Core.StatusMapOpType Operation, string Value)
|
||||
{
|
||||
bool fatto = false;
|
||||
// Recupero il record PROD (che è ultimo indice)
|
||||
StatusMapModel prodData = new StatusMapModel();
|
||||
// se è un prod --> vado x ID
|
||||
if (Session == "")
|
||||
// Initialize database context
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
prodData = dbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.ItemId == ProdId)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
prodData = dbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.Session == Session)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
// se ho trovato
|
||||
if (prodData != null)
|
||||
{
|
||||
try
|
||||
// se è un prod --> vado x ID
|
||||
if (Session == "")
|
||||
{
|
||||
// aggiorno indice PROD
|
||||
prodData.Index++;
|
||||
// recupero record richiesto
|
||||
var currRecor = dbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.ItemType == ItemType && x.ItemId == ItemId && x.Session == Session)
|
||||
.SingleOrDefault();
|
||||
|
||||
// aggiorno
|
||||
currRecor.Index = prodData.Index;
|
||||
currRecor.Operation = Operation;
|
||||
currRecor.Val = Value;
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
ResetController();
|
||||
fatto = true;
|
||||
prodData = localDbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.ItemId == ProdId)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
catch (Exception exc)
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on UpdateAction: {exc}");
|
||||
prodData = localDbCtx
|
||||
.StatusMapList
|
||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.Session == Session)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
// se ho trovato
|
||||
if (prodData != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// aggiorno indice PROD
|
||||
prodData.Index++;
|
||||
// se session è nulla ma ho un PROD --> calcolo da li la sessione
|
||||
if (string.IsNullOrEmpty(Session))
|
||||
{
|
||||
Session = prodData.Session;
|
||||
}
|
||||
// creo un nuovo record
|
||||
DateTime adesso = DateTime.Now;
|
||||
var newRec = new StatusMapModel() { Session = Session, Index = prodData.Index, ItemId = ItemId, ItemType = ItemType, Operation = Operation, DtEvent = adesso, Val = Value };
|
||||
localDbCtx.StatusMapList.Add(newRec);
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on StatusMap.UpdateAction: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Istanza logger
|
||||
/// </summary>
|
||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ using System.Data.Entity.Infrastructure.MappingViews;
|
||||
|
||||
[assembly: DbMappingViewCacheTypeAttribute(
|
||||
typeof(EgtBEAMWALL.DataLayer.DatabaseContext),
|
||||
typeof(Edm_EntityMappingGeneratedViews.ViewsForBaseEntitySets2a70b5e578abdbcbb91ea4a5002c25750fd61f2b76495520401ff22a445540d2))]
|
||||
typeof(Edm_EntityMappingGeneratedViews.ViewsForBaseEntitySets47a6a51e27ee277e915fd1421f83fa2aae50563a874ec88b922716849579f599))]
|
||||
|
||||
namespace Edm_EntityMappingGeneratedViews
|
||||
{
|
||||
@@ -23,14 +23,14 @@ namespace Edm_EntityMappingGeneratedViews
|
||||
/// Implements a mapping view cache.
|
||||
/// </summary>
|
||||
[GeneratedCode("Entity Framework 6 Power Tools", "0.9.2.0")]
|
||||
internal sealed class ViewsForBaseEntitySets2a70b5e578abdbcbb91ea4a5002c25750fd61f2b76495520401ff22a445540d2 : DbMappingViewCache
|
||||
internal sealed class ViewsForBaseEntitySets47a6a51e27ee277e915fd1421f83fa2aae50563a874ec88b922716849579f599 : DbMappingViewCache
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a hash value computed over the mapping closure.
|
||||
/// </summary>
|
||||
public override string MappingHashValue
|
||||
{
|
||||
get { return "2a70b5e578abdbcbb91ea4a5002c25750fd61f2b76495520401ff22a445540d2"; }
|
||||
get { return "47a6a51e27ee277e915fd1421f83fa2aae50563a874ec88b922716849579f599"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -166,7 +166,7 @@ namespace Edm_EntityMappingGeneratedViews
|
||||
{
|
||||
return new DbMappingView(@"
|
||||
SELECT VALUE -- Constructing ProjModel
|
||||
[CodeFirstDatabaseSchema.ProjModel](T1.ProjModel_ProjDbId, T1.ProjModel_BTLFileName, T1.ProjModel_DtCreated, T1.ProjModel_DtExported, T1.ProjModel_IsNew, T1.ProjModel_ListName, T1.ProjModel_Lock, T1.ProjModel_ProdDbId, T1.ProjModel_Id)
|
||||
[CodeFirstDatabaseSchema.ProjModel](T1.ProjModel_ProjDbId, T1.ProjModel_BTLFileName, T1.ProjModel_DtCreated, T1.ProjModel_DtExported, T1.ProjModel_IsNew, T1.ProjModel_ListName, T1.ProjModel_Lock, T1.ProjModel_ProdDbId, T1.ProjModel_Id, T1.ProjModel_PType)
|
||||
FROM (
|
||||
SELECT
|
||||
T.ProjDbId AS ProjModel_ProjDbId,
|
||||
@@ -178,6 +178,7 @@ namespace Edm_EntityMappingGeneratedViews
|
||||
T.Locked AS ProjModel_Lock,
|
||||
T.ProdDbId AS ProjModel_ProdDbId,
|
||||
T.ProjId AS ProjModel_Id,
|
||||
CAST(T.PType AS [Edm.Int32]) AS ProjModel_PType,
|
||||
True AS _from0
|
||||
FROM DatabaseContext.ProjList AS T
|
||||
) AS T1");
|
||||
@@ -191,7 +192,7 @@ namespace Edm_EntityMappingGeneratedViews
|
||||
{
|
||||
return new DbMappingView(@"
|
||||
SELECT VALUE -- Constructing ProdModel
|
||||
[CodeFirstDatabaseSchema.ProdModel](T1.ProdModel_ProdDbId, T1.ProdModel_Description, T1.ProdModel_DtCreated, T1.ProdModel_IsNew, T1.ProdModel_Lock, T1.ProdModel_Id)
|
||||
[CodeFirstDatabaseSchema.ProdModel](T1.ProdModel_ProdDbId, T1.ProdModel_Description, T1.ProdModel_DtCreated, T1.ProdModel_IsNew, T1.ProdModel_Lock, T1.ProdModel_Id, T1.ProdModel_PType)
|
||||
FROM (
|
||||
SELECT
|
||||
T.ProdDbId AS ProdModel_ProdDbId,
|
||||
@@ -200,6 +201,7 @@ namespace Edm_EntityMappingGeneratedViews
|
||||
T.IsNew AS ProdModel_IsNew,
|
||||
T.Locked AS ProdModel_Lock,
|
||||
T.ProdId AS ProdModel_Id,
|
||||
CAST(T.PType AS [Edm.Int32]) AS ProdModel_PType,
|
||||
True AS _from0
|
||||
FROM DatabaseContext.ProdList AS T
|
||||
) AS T1");
|
||||
@@ -304,7 +306,7 @@ namespace Edm_EntityMappingGeneratedViews
|
||||
{
|
||||
return new DbMappingView(@"
|
||||
SELECT VALUE -- Constructing ProjList
|
||||
[EgtBEAMWALL.DataLayer.ProjModel](T1.ProjModel_ProjDbId, T1.ProjModel_BTLFileName, T1.ProjModel_DtCreated, T1.ProjModel_DtExported, T1.ProjModel_IsNew, T1.ProjModel_ListName, T1.ProjModel_Locked, T1.ProjModel_ProdDbId, T1.ProjModel_ProjId)
|
||||
[EgtBEAMWALL.DataLayer.ProjModel](T1.ProjModel_ProjDbId, T1.ProjModel_BTLFileName, T1.ProjModel_DtCreated, T1.ProjModel_DtExported, T1.ProjModel_IsNew, T1.ProjModel_ListName, T1.ProjModel_Locked, T1.ProjModel_ProdDbId, T1.ProjModel_ProjId, T1.ProjModel_PType)
|
||||
FROM (
|
||||
SELECT
|
||||
T.ProjDbId AS ProjModel_ProjDbId,
|
||||
@@ -316,6 +318,7 @@ namespace Edm_EntityMappingGeneratedViews
|
||||
T.Lock AS ProjModel_Locked,
|
||||
T.ProdDbId AS ProjModel_ProdDbId,
|
||||
T.Id AS ProjModel_ProjId,
|
||||
CAST(T.PType AS [EgtBEAMWALL.DataLayer.BWType]) AS ProjModel_PType,
|
||||
True AS _from0
|
||||
FROM CodeFirstDatabase.ProjModel AS T
|
||||
) AS T1");
|
||||
@@ -329,7 +332,7 @@ namespace Edm_EntityMappingGeneratedViews
|
||||
{
|
||||
return new DbMappingView(@"
|
||||
SELECT VALUE -- Constructing ProdList
|
||||
[EgtBEAMWALL.DataLayer.ProdModel](T1.ProdModel_ProdDbId, T1.ProdModel_Description, T1.ProdModel_DtCreated, T1.ProdModel_IsNew, T1.ProdModel_Locked, T1.ProdModel_ProdId)
|
||||
[EgtBEAMWALL.DataLayer.ProdModel](T1.ProdModel_ProdDbId, T1.ProdModel_Description, T1.ProdModel_DtCreated, T1.ProdModel_IsNew, T1.ProdModel_Locked, T1.ProdModel_ProdId, T1.ProdModel_PType)
|
||||
FROM (
|
||||
SELECT
|
||||
T.ProdDbId AS ProdModel_ProdDbId,
|
||||
@@ -338,6 +341,7 @@ namespace Edm_EntityMappingGeneratedViews
|
||||
T.IsNew AS ProdModel_IsNew,
|
||||
T.Lock AS ProdModel_Locked,
|
||||
T.Id AS ProdModel_ProdId,
|
||||
CAST(T.PType AS [EgtBEAMWALL.DataLayer.BWType]) AS ProdModel_PType,
|
||||
True AS _from0
|
||||
FROM CodeFirstDatabase.ProdModel AS T
|
||||
) AS T1");
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using MySql.Data.EntityFramework;
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Migrations;
|
||||
using MySql.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
using EgtBEAMWALL.DataLayer.Migrations;
|
||||
using System.ServiceProcess;
|
||||
using System.IO;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
using System.IO;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer
|
||||
{
|
||||
@@ -28,21 +22,18 @@ namespace EgtBEAMWALL.DataLayer
|
||||
}
|
||||
|
||||
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||
//[DbConfigurationType(typeof(aMySqlConfiguration))]
|
||||
public class DatabaseContext : DbContext
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
|
||||
public DatabaseContext() : base("DefaultConnection")
|
||||
public DatabaseContext() : base(DbConfig.CONNECTION_STRING)
|
||||
{
|
||||
}
|
||||
|
||||
public DatabaseContext(string connectionString) : base(connectionString)
|
||||
{
|
||||
Database.CreateIfNotExists();
|
||||
//Database.SetInitializer(new MigrateDatabaseToLatestVersion<StratonLocalizerDatabase, Migrations.Configuration>());
|
||||
Database.Initialize(false);
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
@@ -91,31 +82,6 @@ namespace EgtBEAMWALL.DataLayer
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Db data mode
|
||||
/// </summary>
|
||||
public static bool AdvDataModel { get; set; } = false;
|
||||
#endif
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private static string getDbServiceName()
|
||||
{
|
||||
ServiceController[] services = ServiceController.GetServices();
|
||||
var service = services.FirstOrDefault(s => s.ServiceName == "MariaDB");
|
||||
if (service != null)
|
||||
return service.DisplayName;
|
||||
|
||||
service = services.FirstOrDefault(s => s.ServiceName == "MySQL");
|
||||
if (service != null)
|
||||
return service.DisplayName;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public static DatabaseContext Create()
|
||||
@@ -123,44 +89,6 @@ namespace EgtBEAMWALL.DataLayer
|
||||
return new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||
}
|
||||
|
||||
public static bool SetUpDbConnectionAndDbConfig()
|
||||
{
|
||||
try
|
||||
{
|
||||
String serviceName = getDbServiceName();
|
||||
if (serviceName.Equals(""))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ServiceController service = new ServiceController(serviceName);
|
||||
try
|
||||
{
|
||||
TimeSpan timeout = TimeSpan.FromSeconds(DbConfig.DATABASE_PROCESS_TIMEOUT);
|
||||
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
System.Data.Entity.Database.SetInitializer<DatabaseContext>(null);
|
||||
var migrator = new DbMigrator(new Configuration());
|
||||
|
||||
if (migrator.GetPendingMigrations().Any())
|
||||
{
|
||||
// Run migrations and seed.
|
||||
migrator.Update();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -98,12 +98,5 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// MachineId del BTL
|
||||
/// </summary>
|
||||
[Column("MachineId")]
|
||||
public string MachineId { get; set; } = "";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -97,6 +97,8 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
if (!(obj is PartModel item))
|
||||
return false;
|
||||
|
||||
if (BTLPartDbId != item.BTLPartDbId)
|
||||
return false;
|
||||
if (H != item.H)
|
||||
return false;
|
||||
if (L != item.L)
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static EgtBEAMWALL.Core.ConstBeam;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
{
|
||||
@@ -31,11 +32,29 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
public bool IsNew { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Stato locked (quando aperto da un dispositivo in rete)
|
||||
/// Stato locked, quando aperto da un dispositivo in rete
|
||||
/// </summary>
|
||||
[Column("Lock")]
|
||||
public bool Locked { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// ID utente che ha bloccato (NumKey), quando aperto da un dispositivo in rete
|
||||
/// </summary>
|
||||
[Column("LockedBy")]
|
||||
public string LockedBy { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
|
||||
/// </summary>
|
||||
[Column("LockDate")]
|
||||
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
||||
|
||||
/// <summary>
|
||||
/// Macchina
|
||||
/// </summary>
|
||||
[Column("Machine")]
|
||||
public string Machine { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Chiave univoca DB
|
||||
/// </summary>
|
||||
@@ -48,6 +67,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
[Column("Id")]
|
||||
public int ProdId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia del progetto (Travi, Pareti, ...)
|
||||
/// </summary>
|
||||
public BWType PType { get; set; } = BWType.NULL;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static EgtBEAMWALL.Core.ConstBeam;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
{
|
||||
@@ -48,6 +49,24 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
[Column("Lock")]
|
||||
public bool Locked { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// ID utente che ha bloccato (NumKey), quando aperto da un dispositivo in rete
|
||||
/// </summary>
|
||||
[Column("LockedBy")]
|
||||
public string LockedBy { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
|
||||
/// </summary>
|
||||
[Column("LockDate")]
|
||||
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
||||
|
||||
/// <summary>
|
||||
/// Macchina
|
||||
/// </summary>
|
||||
[Column("Machine")]
|
||||
public string Machine { get; set; } = "";
|
||||
|
||||
[ForeignKey("ProdDbId")]
|
||||
public virtual ProdModel Prod { get; set; }
|
||||
|
||||
@@ -60,6 +79,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
[Column("Id")]
|
||||
public int ProjId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia del progetto (Travi, Pareti, ...)
|
||||
/// </summary>
|
||||
public BWType PType { get; set; } = BWType.NULL;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer
|
||||
{
|
||||
@@ -37,23 +37,142 @@ namespace EgtBEAMWALL.DataLayer
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public static void InitDb(string server, string nKey, string sKey)
|
||||
/// <summary>
|
||||
/// Effettua migrazione esplicita del DB
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool CheckMigrateDb()
|
||||
{
|
||||
DATABASE_SERV = server;
|
||||
DATABASE_NAME = $"EgtBwDb_{nKey}";
|
||||
DATABASE_USER = $"user_{nKey}";
|
||||
DATABASE_PWD = $"pwd_{sKey}";
|
||||
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
|
||||
// stringa admin con utente root egalware...
|
||||
ADMIN_CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database=mysql;uid=root;pwd=Egalware_24068!;sslmode=None";
|
||||
// esecuzione script di migrations del DB
|
||||
return Controllers.DbController.man.checkMigrateDb();
|
||||
}
|
||||
|
||||
public static bool CheckUser(string nKey, string sKey)
|
||||
{
|
||||
// esecuzione script di install locale
|
||||
return Controllers.DbController.man.checkCreateUser(DATABASE_USER, DATABASE_PWD);
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua verifica presenza utente
|
||||
/// </summary>
|
||||
/// <param name="nKey"></param>
|
||||
/// <param name="sKey"></param>
|
||||
/// <param name="isNetwork"></param>
|
||||
/// <returns></returns>
|
||||
public static bool CheckUser(string nKey, string sKey, bool isNetwork)
|
||||
{
|
||||
// esecuzione script di install locale
|
||||
return Controllers.DbController.man.checkCreateUser(DATABASE_USER, DATABASE_PWD, isNetwork);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua verifica presenza view prod + relativo utente
|
||||
/// </summary>
|
||||
/// <param name="nKey"></param>
|
||||
/// <param name="sKey"></param>
|
||||
/// <param name="isNetwork"></param>
|
||||
/// <returns></returns>
|
||||
public static bool CheckViews(string nKey, string sKey)
|
||||
{
|
||||
// esecuzione script di install locale
|
||||
return Controllers.DbController.man.refreshViews(DATABASE_NAME);
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua DUMP del DB dato utente admin + percorso salvataggio
|
||||
/// </summary>
|
||||
/// <param name="outFilePath">Percorso di salvataggio del dump (*.sql)</param>
|
||||
/// <returns></returns>
|
||||
public static bool DumpDB(string mysqlDumpPath, string outFilePath)
|
||||
{
|
||||
bool fatto = false;
|
||||
// aggiungo sql finale
|
||||
if (!outFilePath.EndsWith(".sql"))
|
||||
{
|
||||
outFilePath = $"{outFilePath}.sql";
|
||||
}
|
||||
// esecuzione script x dump del DB
|
||||
string dirPath = Path.GetDirectoryName(outFilePath);
|
||||
if (!Directory.Exists(dirPath))
|
||||
{
|
||||
Directory.CreateDirectory(dirPath);
|
||||
}
|
||||
// se ci fosse già file elimino...
|
||||
if (File.Exists(outFilePath))
|
||||
{
|
||||
File.Delete(outFilePath);
|
||||
}
|
||||
// chiamo script esterno...
|
||||
string callScript = $"\"{mysqlDumpPath}\" -u{DATABASE_USER} -p{DATABASE_PWD} {DATABASE_NAME} > {outFilePath}";
|
||||
ExecuteCommand(callScript);
|
||||
return fatto;
|
||||
}
|
||||
/// <summary>
|
||||
/// Esecuzione di un comando esterno
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
public static void ExecuteCommand(string command)
|
||||
{
|
||||
int exitCode;
|
||||
ProcessStartInfo processInfo;
|
||||
Process process;
|
||||
|
||||
processInfo = new ProcessStartInfo("cmd.exe", "/c " + command);
|
||||
processInfo.CreateNoWindow = true;
|
||||
processInfo.UseShellExecute = false;
|
||||
// *** Redirect the output ***
|
||||
processInfo.RedirectStandardError = true;
|
||||
processInfo.RedirectStandardOutput = true;
|
||||
|
||||
process = Process.Start(processInfo);
|
||||
process.WaitForExit();
|
||||
|
||||
// *** Read the streams ***
|
||||
// Warning: This approach can lead to deadlocks, see Edit #2
|
||||
string output = process.StandardOutput.ReadToEnd();
|
||||
string error = process.StandardError.ReadToEnd();
|
||||
|
||||
exitCode = process.ExitCode;
|
||||
|
||||
Console.WriteLine("output>>" + (String.IsNullOrEmpty(output) ? "(none)" : output));
|
||||
Console.WriteLine("error>>" + (String.IsNullOrEmpty(error) ? "(none)" : error));
|
||||
Console.WriteLine("ExitCode: " + exitCode.ToString(), "ExecuteCommand");
|
||||
process.Close();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Metodo di init standard per DB in rete con Master_Key
|
||||
/// </summary>
|
||||
/// <param name="server">Indirizzo del server (tipicamente indirizzo di rete)</param>
|
||||
/// <param name="nKey">Numero chiave</param>
|
||||
/// <param name="sKey">Codice/pwd associato a chaive</param>
|
||||
/// <param name="masterKey">Numero di chiave master con cui è creato il DB</param>
|
||||
public static void InitDb(string server, string nKey, string sKey, string masterKey = "")
|
||||
{
|
||||
// se nulla metto amster come nKey...
|
||||
masterKey = string.IsNullOrEmpty(masterKey) ? nKey : masterKey;
|
||||
DATABASE_SERV = server;
|
||||
DATABASE_NAME = $"EgtBwDb_{masterKey}";
|
||||
DATABASE_USER = $"user_{nKey}";
|
||||
DATABASE_PWD = $"pwd_{sKey}";
|
||||
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};SslMode=None";
|
||||
// stringa admin con utente root egalware...
|
||||
ADMIN_CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database=mysql;uid=root;pwd=Egalware_24068!;SslMode=none;CHARSET=utf8";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna conf NLog x target DIR
|
||||
/// </summary>
|
||||
/// <param name="logDir"></param>
|
||||
public static void SetupLogDir(string logDir)
|
||||
{
|
||||
string appDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
string filePath = Path.Combine(appDir, "NLog.config");
|
||||
// leggo il file NLog
|
||||
string rawData = File.ReadAllText(filePath);
|
||||
|
||||
// sostituzione livello minimo da selezione
|
||||
rawData = rawData.Replace("${basedir}", logDir);
|
||||
|
||||
// ri-scrivo file NLog
|
||||
File.WriteAllText(filePath, rawData);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ namespace EgtBEAMWALL.DataLayer
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static DbManager obj = new DbManager();
|
||||
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
|
||||
public Controllers.LogMachineController LogMacCtr = new Controllers.LogMachineController();
|
||||
public Controllers.LogSupportController LogSupCtr = new Controllers.LogSupportController();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>EgtBEAMWALL.DataLayer</RootNamespace>
|
||||
<AssemblyName>EgtBEAMWALL.DataLayer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
@@ -37,8 +37,11 @@
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtWPFLib5">
|
||||
<HintPath>..\..\..\EgtProg\DllD32\EgtWPFLib5.dll</HintPath>
|
||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
@@ -46,16 +49,37 @@
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.6.10.9\lib\net452\MySql.Data.dll</HintPath>
|
||||
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.Entity.6.10.9\lib\net452\MySql.Data.Entity.EF6.dll</HintPath>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.EntityFramework.8.0.21\lib\net452\MySql.Data.EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.5.0.1\lib\net46\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
@@ -63,16 +87,39 @@
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Drawing.Design" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Ubiety.Dns.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Zstandard.Net, Version=1.1.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Zstandard.Net.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AdminContext.cs" />
|
||||
@@ -88,7 +135,6 @@
|
||||
<Compile Include="Controllers\ProjController.cs" />
|
||||
<Compile Include="Controllers\BTLPartController.cs" />
|
||||
<Compile Include="DatabaseContext.cs" />
|
||||
<Compile Include="DatabaseContext.Views.cs" />
|
||||
<Compile Include="DatabaseModels\LogSupportModel.cs" />
|
||||
<Compile Include="DatabaseModels\PartModel.cs" />
|
||||
<Compile Include="DatabaseModels\BTLPartModel.cs" />
|
||||
@@ -114,12 +160,27 @@
|
||||
<Compile Include="Migrations\202105051121209_renameIndex.designer.cs">
|
||||
<DependentUpon>202105051121209_renameIndex.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\202107151001537_AddBwType.cs" />
|
||||
<Compile Include="Migrations\202107151001537_AddBwType.designer.cs">
|
||||
<DependentUpon>202107151001537_AddBwType.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\202109141058345_AddMachine2ProjProd.cs" />
|
||||
<Compile Include="Migrations\202109141058345_AddMachine2ProjProd.designer.cs">
|
||||
<DependentUpon>202109141058345_AddMachine2ProjProd.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\202207051703296_UpgradeLockModel.cs" />
|
||||
<Compile Include="Migrations\202207051703296_UpgradeLockModel.designer.cs">
|
||||
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Utils.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="NLog.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -141,6 +202,15 @@
|
||||
<EmbeddedResource Include="Migrations\202105051121209_renameIndex.resx">
|
||||
<DependentUpon>202105051121209_renameIndex.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\202107151001537_AddBwType.resx">
|
||||
<DependentUpon>202107151001537_AddBwType.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\202109141058345_AddMachine2ProjProd.resx">
|
||||
<DependentUpon>202109141058345_AddMachine2ProjProd.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\202207051703296_UpgradeLockModel.resx">
|
||||
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||
public sealed partial class AddBwType : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(AddBwType));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "202107151001537_AddBwType"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class AddBwType : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
AddColumn("dbo.ProjList", "PType", c => c.Int(nullable: false));
|
||||
AddColumn("dbo.ProdList", "PType", c => c.Int(nullable: false));
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropColumn("dbo.ProdList", "PType");
|
||||
DropColumn("dbo.ProjList", "PType");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
||||
// <auto-generated />
|
||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||
public sealed partial class AddMachine2ProjProd : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(AddMachine2ProjProd));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "202109141058345_AddMachine2ProjProd"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class AddMachine2ProjProd : DbMigration
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropColumn("dbo.ProdList", "Machine");
|
||||
DropColumn("dbo.ProjList", "Machine");
|
||||
}
|
||||
|
||||
public override void Up()
|
||||
{
|
||||
AddColumn("dbo.ProjList", "Machine", c => c.String(unicode: false));
|
||||
AddColumn("dbo.ProdList", "Machine", c => c.String(unicode: false));
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user