Compare commits
817 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6976ca959e | |||
| ba6a9bc9ed | |||
| 98750aadbf | |||
| bbe1a1c20e | |||
| 5770e7e15a | |||
| 3d942836f3 | |||
| 9fa9807bc5 | |||
| ccef55e5e2 | |||
| a1d757cd94 | |||
| ab00dea4bd | |||
| 4cd7214cc6 | |||
| c52963cb21 | |||
| 6383a31b15 | |||
| 0f7dd9901c | |||
| 2e3c6f2e12 | |||
| 1ea6e5531a | |||
| 91e70da050 | |||
| b22bb8e0b8 | |||
| cd9f9a3cf4 | |||
| aa1d796293 | |||
| 691286e28b | |||
| 3e14ec5392 | |||
| 6d950d8593 | |||
| 987a758155 | |||
| 3019abd841 | |||
| 8dd12ead14 | |||
| 7c079c6e93 | |||
| c93c171271 | |||
| 899ba0ec85 | |||
| eaf212a120 | |||
| 13ff7ab59f | |||
| 7c80fb36c2 | |||
| 248b6561e9 | |||
| 23c8789e47 | |||
| 54a288fe6a | |||
| 04ebcea85c | |||
| dc0a517579 | |||
| 958a8c7bef | |||
| ae85d06069 | |||
| 0777cd6a52 | |||
| b802e180df | |||
| 5121a825a2 | |||
| 5bf295fce2 | |||
| db6cdc8500 | |||
| 8cb02d197f | |||
| 2ed1d9c7f4 | |||
| 447fa15443 | |||
| edcfb09a3c | |||
| d02d1ca6e4 | |||
| d65667d390 | |||
| a9bbca262e | |||
| f6695c7754 | |||
| 2f57349347 | |||
| c3df26caad | |||
| 90839b0a7e | |||
| ee85cc4b94 | |||
| 64255e7405 | |||
| f50f277381 | |||
| efca6d9a67 | |||
| a738cf1df4 | |||
| d2b785593e | |||
| e98c6d1cd1 | |||
| 1104998906 | |||
| 2cd3821f44 | |||
| 002d4558d3 | |||
| cfc3fcc03d | |||
| 0a9749a3d6 | |||
| f3b319afc6 | |||
| 3dae7c7e14 | |||
| abe6aa24a4 | |||
| f0cbb18246 | |||
| 84ac2c365d | |||
| 50aa9c27c3 | |||
| 28638544d1 | |||
| ef8c11de93 | |||
| 5258088ad4 | |||
| a7a60f2839 | |||
| 235eacaad9 | |||
| 7064047f9a | |||
| 48fcce3c9b | |||
| 3a0880e5a4 | |||
| 39e3a9f7fa | |||
| 8a07a80599 | |||
| 34ec183982 | |||
| 46362b8bfb | |||
| 35c36cfe6c | |||
| 91a0366b3f | |||
| 55e3bbbba9 | |||
| 1be69aff97 | |||
| 2c40dfc38d | |||
| cf19510bae | |||
| 11166ea024 | |||
| 71f19a8223 | |||
| 15ae12f813 | |||
| 4bbd9ab770 | |||
| bba61d7331 | |||
| 4a42855062 | |||
| 91666cc680 | |||
| 560c2a4dfb | |||
| 2279732ab7 | |||
| 656d0ed525 | |||
| 8231c0d3a0 | |||
| 05bf628d39 | |||
| 347c479fb0 | |||
| 28bfd705a7 | |||
| 4fd1e39981 | |||
| 980c4387a7 | |||
| 779db5e1d4 | |||
| a33d43bd0c | |||
| 1eebf0f255 | |||
| 9e37f01cfd | |||
| d78c6a5a3c | |||
| 8c604a7c27 | |||
| 640c8275ed | |||
| f316e26c23 | |||
| 37399b6ba7 | |||
| 5e444aa9e6 | |||
| b9e146ec9d | |||
| 097a0bc80a | |||
| 1ee69596d1 | |||
| cff43b76c4 | |||
| 596b079055 | |||
| 7667e00333 | |||
| 0d8776e0b4 | |||
| 5ed337b2f5 | |||
| 50a577ae01 | |||
| 6affc054a4 | |||
| 08261f80f7 | |||
| fa470f88e1 | |||
| a7dca4dfe7 | |||
| 8df54c6212 | |||
| 33481fa554 | |||
| ca5f222d56 | |||
| 9788302619 | |||
| 2ed77d7fc2 | |||
| 3525f81d3b | |||
| d0539e494d | |||
| ce45a9e99a | |||
| 7d43808b11 | |||
| 91f785fe43 | |||
| 9e4221a376 | |||
| d92edb0d18 | |||
| 29e72e3be2 | |||
| 7284803f8b | |||
| 0ab2655947 | |||
| dee5cbefc8 | |||
| 46415e0869 | |||
| 5e06f06a85 | |||
| 746873624a | |||
| 4a9fee6ce0 | |||
| 60c4c75723 | |||
| b1120b574d | |||
| eed4e4fff3 | |||
| c74fbb9f57 | |||
| fef9c95c0c | |||
| 379157c767 | |||
| 674605ecf4 | |||
| f3d8f4f36f | |||
| 4cec875964 | |||
| 3f58a52741 | |||
| db94dc3f31 | |||
| dfde1cefd5 | |||
| 45656fec10 | |||
| 578620d1cd | |||
| 9d43293b35 | |||
| 5a6056d898 | |||
| 364ac36baa | |||
| 38abdae335 | |||
| f36fff0568 | |||
| 4f37dae021 | |||
| 2ed8cfe371 | |||
| 5c6a4416a9 | |||
| 8a2fa432d9 | |||
| 36c3a9cb0d | |||
| 67db15a5b3 | |||
| bb652ad220 | |||
| f1786511ee | |||
| dd04ad966a | |||
| f1f8792d3a | |||
| ed63f99045 | |||
| 45404f078e | |||
| 2bc5177a40 | |||
| a552e77aa9 | |||
| 00b9e0d8b4 | |||
| 8f147516d3 | |||
| 6a04ddb7c4 | |||
| e636ca721f | |||
| d74e017829 | |||
| 5966493251 | |||
| ce2d91615f | |||
| f8a92debb4 | |||
| 452471eafe | |||
| 22a670b881 | |||
| 7c91ffdaf4 | |||
| de84685b9b | |||
| 9fa0baf1a1 | |||
| 1f1a8b127d | |||
| f760186916 | |||
| 57ffe97878 | |||
| 8881c6fc04 | |||
| c65799b93d | |||
| a69df23835 | |||
| ddc66cc5a0 | |||
| 543126f467 | |||
| 103e5bc46f | |||
| 60c8b0384a | |||
| 66bc72f6ce | |||
| 6192a47ce6 | |||
| 7856f90405 | |||
| 864eee46ee | |||
| 737979b264 | |||
| 7845dedfef | |||
| 3af8933678 | |||
| ca26ba39d7 | |||
| e7fe61c394 | |||
| ef25994615 | |||
| 7892366242 | |||
| f4e78055d4 | |||
| 02a021cc0f | |||
| 3e322c2dc9 | |||
| a2e866540e | |||
| 8cae143f82 | |||
| 2f70720f4f | |||
| f5f973f410 | |||
| 015d0abd1c | |||
| cd28df8a1d | |||
| df60390f62 | |||
| c094e97920 | |||
| 3bd8ec6d04 | |||
| 59764bbac3 | |||
| cbfeb7ec38 | |||
| a92527e02d | |||
| 0a60cac585 | |||
| 7fbfa144a9 | |||
| 95c4aca305 | |||
| f685d99442 | |||
| e1c8b84ff2 | |||
| 7066f25073 | |||
| 546b6715fb | |||
| c333dab24f | |||
| 137456b70f | |||
| 0673e2aeb9 | |||
| 8fb9dce7d0 | |||
| 26745bc696 | |||
| c7ee3c7142 | |||
| 0345d996d6 | |||
| 8af7eeccc6 | |||
| 451dcf5fff | |||
| e3b3ac9221 | |||
| 11f5a0644a | |||
| da53277a58 | |||
| 1287bdd5c7 | |||
| ab196be84b | |||
| 1a02397b31 | |||
| 6d0b120860 | |||
| 2ee8526b2d | |||
| 1f61ae33ce | |||
| 1f8cfc6fe7 | |||
| 12b250089d | |||
| 421f382c65 | |||
| 66865195d5 | |||
| 2e29127d19 | |||
| 1f498b01d1 | |||
| e93aec990a | |||
| 601f48ab8a | |||
| 519b608870 | |||
| 557499592f | |||
| 1248ba0cbf | |||
| b64df4682f | |||
| b47882d0fc | |||
| e741eaa88a | |||
| d042c077bb | |||
| 9656a803aa | |||
| 412de6b7ed | |||
| 02cbc242d9 | |||
| 98b9dd4397 | |||
| cd4a8aef8f | |||
| 9c1d3dabcf | |||
| 29e082c265 | |||
| a991542ff3 | |||
| 5487eff9a0 | |||
| b42f855ffa | |||
| d830f65aa6 | |||
| 29b640710a | |||
| 52eae095bb | |||
| 29e4de3afa | |||
| 5460cf1f20 | |||
| 915c2f4ff3 | |||
| 01311a846a | |||
| aa77100740 | |||
| 248dc49254 | |||
| 64284dd8dd | |||
| febdc131eb | |||
| a8068f3841 | |||
| 5990bbc385 | |||
| ef1dc655d4 | |||
| 568e65946a | |||
| de9b6fa3fb | |||
| 89c964c3cd | |||
| a3acb09a03 | |||
| e0cb419f82 | |||
| 414d5df6ee | |||
| 962027e436 | |||
| af2cbd6beb | |||
| ffc6e8be5e | |||
| 7566a5c369 | |||
| cdad086744 | |||
| 5b45e7ddfc | |||
| cb29265547 | |||
| 7aee0d92d9 | |||
| eadc2c6eb5 | |||
| 93a8bc2315 | |||
| ad76b97930 | |||
| c8aa06098d | |||
| c812e82bf4 | |||
| 57b068bf02 | |||
| 3a82500232 | |||
| dd090d5adb | |||
| 8eadfce339 | |||
| ee286d0049 | |||
| b57104507f | |||
| 32656645f7 | |||
| 679388ef20 | |||
| fc806af86e | |||
| 95dbe07693 | |||
| 79b37db58f | |||
| c7f640af1e | |||
| 35637bb693 | |||
| bf0ee03589 | |||
| 1a563e3865 | |||
| bf2c780049 | |||
| 0778d44235 | |||
| 5861298b91 | |||
| e47ffe7b4e | |||
| fe39b23e74 | |||
| 20a11f61e7 | |||
| a97546920e | |||
| bdeb60507c | |||
| d9711f5dd9 | |||
| bfeda7ed6a | |||
| 7a3e03c053 | |||
| b2e5f82de5 | |||
| e4db9763c4 | |||
| 21770cfa66 | |||
| d233c51364 | |||
| be51449c62 | |||
| e9f5244b81 | |||
| be6e838a36 | |||
| 9c2fb93bad | |||
| 5d8ac192ac | |||
| fa7eb5ad13 | |||
| f780f99705 | |||
| ab2323bf3f | |||
| 0829378d59 | |||
| be6f944646 | |||
| 36e6038de4 | |||
| e11b88ce62 | |||
| 5296b91f03 | |||
| e01fdc7d94 | |||
| c592f485ec | |||
| 36cdf993b8 | |||
| d474a5f75c | |||
| 0ce2852e9a | |||
| 45cecaa3cb | |||
| 1cc9973a2f | |||
| e201b3666d | |||
| 067bc6ef47 | |||
| 6b40ebfe9f | |||
| 3e8418c8ab | |||
| f56d389946 | |||
| da056d95a0 | |||
| 18510afaf6 | |||
| 924944a425 | |||
| d31eb46ec8 | |||
| 0ac53b3219 | |||
| 36170f369a | |||
| 183c441430 | |||
| 6ad13b80b2 | |||
| b9578f4dab | |||
| 57f13e31db | |||
| 6d31362a9c | |||
| 6a2c39e3cf | |||
| 5c385bd58e | |||
| 4c264dbfb5 | |||
| 3db4688e20 | |||
| ef83c4ad66 | |||
| b768a8d5aa | |||
| 9a4c0a935d | |||
| b2128bc23b | |||
| 5b6d9d7801 | |||
| 579b59e9d5 | |||
| 8504b8aef7 | |||
| 7457fae6f8 | |||
| ab106cc8c4 | |||
| 75f7a19418 | |||
| b20f37140d | |||
| 663e8459d7 | |||
| f5f04c68d1 | |||
| 30f0601a09 | |||
| 5ace8f2fac | |||
| b1626b1381 | |||
| 47a796b945 | |||
| acc0bf2734 | |||
| c139c6e7ce | |||
| de21437881 | |||
| 864c71a79f | |||
| 0c8ea6f344 | |||
| 52268e633c | |||
| c95eacf22b | |||
| fba5879902 | |||
| d1db6dbefc | |||
| d6e9371d24 | |||
| cd99295817 | |||
| d7690b8d1d | |||
| d2b46deff1 | |||
| 93b2199f1c | |||
| 0a5b05467a | |||
| b09576f91a | |||
| 6a2ca75de7 | |||
| d37d71c51d | |||
| 3a7eff3554 | |||
| 1e9fe1be3d | |||
| f270bac1db | |||
| c609e7644e | |||
| 0901fabe62 | |||
| 61341e2ab8 | |||
| d8262e82e9 | |||
| 0b0ec306b3 | |||
| 09dcff9303 | |||
| a28c0acc48 | |||
| 2211fc284d | |||
| 88089c5a7c | |||
| 1dd6ca4511 | |||
| 41e276f069 | |||
| 90f735ceb0 | |||
| f0a0e0cb2d | |||
| 1aa4f7da12 | |||
| 3c5004253d | |||
| 9f7bfebf97 | |||
| 1e7bf45e8b | |||
| 1cb0bc84b1 | |||
| f82824fc41 | |||
| dfe57d73de | |||
| 1502588443 | |||
| afa2b2b069 | |||
| 04d42a0bc1 | |||
| 0ea4e7e122 | |||
| a6dff6dc0b | |||
| 6d06c601a8 | |||
| 7c84d739fb | |||
| 49312dd181 | |||
| 7e66ebb79a | |||
| 8ee2f3b9c4 | |||
| 9d320ae451 | |||
| d388c420ed | |||
| d2aa632a89 | |||
| 0199669847 | |||
| f85c47fe24 | |||
| 3620822e83 | |||
| 14740640fb | |||
| 3b5e76d72a | |||
| eb8cb3cfb5 | |||
| 821a2c3fcf | |||
| aded6e2020 | |||
| 5029049835 | |||
| 51227605f2 | |||
| 7cfa69e889 | |||
| f40044ff31 | |||
| e2c905d113 | |||
| a399761674 | |||
| c336f7504d | |||
| c3c9addbef | |||
| b7fb86f94f | |||
| b861daaf12 | |||
| 937fffb2c4 | |||
| 503d2ecfa3 | |||
| a200f1455e | |||
| 9822f43894 | |||
| eae1d51337 | |||
| 9f8944876d | |||
| 4941dc3fdc | |||
| 852bbcb29a | |||
| 0f6f32a5a0 | |||
| 06d25078e6 | |||
| ace3ef79c1 | |||
| e162c2a8af | |||
| 9baae29627 | |||
| 845c32d56f | |||
| 04734ddf46 | |||
| 3f995027b5 | |||
| 46b50fac5b | |||
| 657c90061f | |||
| fffb0c712e | |||
| e8f5044972 | |||
| b5d214b437 | |||
| cde83c36b0 | |||
| 7c83c314ea | |||
| 42c50cad0c | |||
| 77de6722f3 | |||
| 6bfb159f19 | |||
| cbc6de2cca | |||
| 335a877d4d | |||
| 766fc5eade | |||
| 1e7b2cd24e | |||
| f009dbef37 | |||
| 81233d0bc4 | |||
| a70d4af729 | |||
| bbae83a669 | |||
| 121eacfb6a | |||
| 0928ebe6ec | |||
| b4a0333085 | |||
| e0098e4194 | |||
| 5a35a2e926 | |||
| 8efa8fc1d1 | |||
| fd45ab8180 | |||
| dbf5a88a4e | |||
| c691a677d2 | |||
| b55cb314f2 | |||
| bbe04ea0cb | |||
| 3a2749d947 | |||
| 8b34765ad5 | |||
| ebc7afc455 | |||
| 3bd9da0949 | |||
| 11fd84276c | |||
| a7ce11b60f | |||
| 10ef85de20 | |||
| 8e4b89c48d | |||
| c595480f19 | |||
| 4fe94cb958 | |||
| f5d7032df1 | |||
| 1fb557449c | |||
| 0b738d13b9 | |||
| 216621f11f | |||
| 996587dbeb | |||
| d181d82ab7 | |||
| 5c7177c2a6 | |||
| b3c56a3e6c | |||
| 560e2dd2b4 | |||
| 2f9e194beb | |||
| 3b429a8008 | |||
| 275a111690 | |||
| 344599471c | |||
| 891798d257 | |||
| dbdccc3967 | |||
| 9d4ed7202c | |||
| c7e15fdc38 | |||
| da08f8f6bf | |||
| 983913943a | |||
| d7579b8be4 | |||
| 13ef2a709e | |||
| 6c8525125e | |||
| 4b3ed4ce96 | |||
| 4d30ea9085 | |||
| 06c930a7af | |||
| 18bcab111f | |||
| dca21af7c0 | |||
| 35a31389be | |||
| f54c0548d4 | |||
| 07fae10616 | |||
| 55a74acfef | |||
| 8702001a59 | |||
| ae727e0e2c | |||
| 6f67cf8047 | |||
| 08e6c3e5f5 | |||
| e32b2b2f93 | |||
| cf28fdb365 | |||
| d5edd3b3de | |||
| ae37112e92 | |||
| 5a98c67c8d | |||
| 998b1d884f | |||
| aa7aa4488b | |||
| 1dfe00a518 | |||
| 6ed8446955 | |||
| e3dc9f7131 | |||
| e07c47736c | |||
| 47df3a1361 | |||
| 9863edbc22 | |||
| a19e851074 | |||
| cc59454a32 | |||
| 1a6f46d5a9 | |||
| 6fc1b3c807 | |||
| 5205a95d03 | |||
| 9750fea139 | |||
| e7d41527ef | |||
| 683f53ad87 | |||
| 377355db7c | |||
| 78ef931f5c | |||
| 0f5cf33c29 | |||
| 159ed6dc2b | |||
| 6e7ff45b0b | |||
| 23e8ea081e | |||
| 31213f6d28 | |||
| 8c4efc1f40 | |||
| 849d38b5f2 | |||
| d99448e386 | |||
| e1516a5605 | |||
| c3b641d5aa | |||
| 2690235596 | |||
| 7a0fa01e4f | |||
| a7a8364fcb | |||
| 6dd92534ef | |||
| d037ecf346 | |||
| dc8b9b2f98 | |||
| 74bca84447 | |||
| 40199534d1 | |||
| 23104a2024 | |||
| b17acd2eda | |||
| 86f519f83b | |||
| 6654efc919 | |||
| be21df40ee | |||
| 1376d3ec7d | |||
| 95603bb8d7 | |||
| 0716ac0191 | |||
| 5707214fe8 | |||
| 94b8a298ff | |||
| ed2f6f003c | |||
| e6bb233570 | |||
| b36446abfe | |||
| 2e03aca330 | |||
| 7f565ca8e0 | |||
| bf0b5684b7 | |||
| 4a60c7cc0c | |||
| 89a6f8e367 | |||
| 8f64173a17 | |||
| e2f248f57c | |||
| 64bf154f19 | |||
| 77cb123d2b | |||
| 2a14ed9de6 | |||
| 1374d36428 | |||
| 9da95aca53 | |||
| 9b61847148 | |||
| 10058e7169 | |||
| 502e014e55 | |||
| 40ce9677ce | |||
| a01b5e8a1e | |||
| 2af0bd479c | |||
| 52f3c71c1d | |||
| 00da2310c6 | |||
| b612467325 | |||
| 31f1f180a0 | |||
| 569efd65ee | |||
| 25e8fc1cc6 | |||
| 91fc8b648d | |||
| 14f0c4ef61 | |||
| 9d551277df | |||
| 104d58106d | |||
| af97350bae | |||
| ff37ee05ca | |||
| c062a9a0dc | |||
| 5ad4ac9148 | |||
| 6521935ba8 | |||
| 06c7ba9309 | |||
| f49277ec93 | |||
| fd4712f38d | |||
| fa1f4e1f03 | |||
| c24ffa6d32 | |||
| 636d7e28f7 | |||
| 1ab5854bc3 | |||
| 7cd001cef4 | |||
| 982d8177e0 | |||
| 6f94b274b3 | |||
| 197a5c2cd9 | |||
| b8d381c5df | |||
| 8b4aaf84a3 | |||
| 1d2eb2116d | |||
| 52330eb094 | |||
| 4db1b7368b | |||
| b967013739 | |||
| 0e6a034cf4 | |||
| 448375b234 | |||
| ff0f39586f | |||
| b7b8819461 | |||
| 2bd1652369 | |||
| d8d979d53c | |||
| 33055fc66f | |||
| 9269c8db4f | |||
| 26f7176a62 | |||
| 3cb33197e6 | |||
| 16807d7382 | |||
| dc074308a5 | |||
| 9a4010dabe | |||
| b52cdaa5ce | |||
| 15bdde06b5 | |||
| 7b008906dd | |||
| cfa98e54f4 | |||
| 2a2a389d71 | |||
| 3384eb2a82 | |||
| bfad961b1e | |||
| 3e93f88b42 | |||
| 3fac227532 | |||
| 9c784e2233 | |||
| f2559b759e | |||
| 5adee48d51 | |||
| 435b13d58c | |||
| 429aebcc85 | |||
| 38dfd71842 | |||
| d019002454 | |||
| 5e73527847 | |||
| 10121d874b | |||
| 284f2bb2ee | |||
| c6ea2fc22d | |||
| 731e069a59 | |||
| aae3504a5b | |||
| 4f58ea2846 | |||
| 59332fb668 | |||
| e776951ec8 | |||
| 9b8a314a62 | |||
| 7584a729c1 | |||
| 233bfeeee7 | |||
| 4020779bcb | |||
| 25112bddd7 | |||
| 884fbad219 | |||
| 28ddddd8ef | |||
| 0d11a69779 | |||
| d2931a363a | |||
| 5ed3306661 | |||
| a13dec7d3b | |||
| ed17df0667 | |||
| aa8bf8861f | |||
| ed006c0367 | |||
| 589433dba4 | |||
| 1a2e5639d8 | |||
| ac0c0a8d62 | |||
| 2e88073973 | |||
| dab327c567 | |||
| 99adc168fd | |||
| d07847ea54 | |||
| 6b3816a8ac | |||
| dbbb562d66 | |||
| 5c75d5f128 | |||
| e7428e90f8 | |||
| 54949ac357 | |||
| 0a81b4f2c6 | |||
| aca6f1afe0 | |||
| d8ef55a4fa | |||
| ed95ecf1f9 | |||
| 06a481fae1 | |||
| 4ac926f24a | |||
| c61cda22ed | |||
| 4217e0fac1 | |||
| f2cd283589 | |||
| d341046cc1 | |||
| 0fecb35559 | |||
| 3770e1eb57 | |||
| 7148177c01 | |||
| 9c668938a8 | |||
| b807053813 | |||
| 1b7f2cbda9 | |||
| a7ec20ef5e | |||
| 548fa2469a | |||
| 358f422ade | |||
| 397409ca40 | |||
| 4a5328f3fd | |||
| 2c996965a0 | |||
| 27d5e1499f | |||
| 45f06365dc | |||
| 4ca5b52dff | |||
| e2af337f04 | |||
| fd410de445 | |||
| 04a4820ed6 | |||
| 2772f71042 | |||
| f00c519263 | |||
| 3df235284a | |||
| 3a76d68b3e | |||
| 6960eb7c81 | |||
| c0c3334e9f | |||
| 1e3b6bede1 | |||
| ad34f3d5b1 | |||
| 98f8b1f4da | |||
| df68a123aa | |||
| b7435c8703 | |||
| e35e6cce89 | |||
| c1f7fbffeb | |||
| 1966ab5db3 | |||
| 482a085db9 | |||
| 872fa084d5 | |||
| 56980c363f | |||
| 426d0561c8 | |||
| 7f3d0979d2 | |||
| 1136519691 | |||
| 1c3c1b8a1a | |||
| 60c4e6bd84 | |||
| 9f7e7a1660 | |||
| 1d0840a557 | |||
| 721ed28b76 | |||
| e434712a4d | |||
| ee951372a3 | |||
| 3895543199 | |||
| 05fce2e224 | |||
| 4a6b32fc47 | |||
| 1371a32164 | |||
| 7225941f5e | |||
| 997e70fc88 | |||
| a5e081efd2 | |||
| d4d65ae3a1 | |||
| ff340ee8a5 | |||
| e81b6b5755 | |||
| 6d9a3ef898 | |||
| b812efd438 | |||
| 46705d265e | |||
| c828b2eb79 | |||
| 5eed8cbac6 | |||
| ba72168d85 | |||
| 6f5e9b30bb | |||
| f043d4ff75 | |||
| 922e0a4f5d | |||
| 5afee5d823 | |||
| 682a486252 | |||
| 6b43ed1081 | |||
| 60de646718 | |||
| 40618f573f | |||
| 9c29d2f96c | |||
| 8caea2861f | |||
| 6dd2c9afb9 | |||
| 3d8ce81114 | |||
| d1b01b1a9e | |||
| 369540d73d |
+87
-5
@@ -35,9 +35,9 @@ variables:
|
||||
# helper x fix version number
|
||||
.version-fix: &version-fix
|
||||
- |
|
||||
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+(get-date –format ddHH)
|
||||
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+(get-date –format ddHH)
|
||||
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date –format yyMM)+"-beta."+(get-date –format dHH)
|
||||
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format ddHH)
|
||||
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format dHH)
|
||||
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date -format yyMM)+"-beta."+(get-date -format dHH)
|
||||
$env:NEW_COPYRIGHT = "EgalWare @ 2006-" + (get-date -format yyyy)
|
||||
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
|
||||
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
|
||||
@@ -46,7 +46,7 @@ variables:
|
||||
# display versioni generate
|
||||
$resoconto = "Effettuato fix file VersGen | release v: " + $env:NUM_REL + " | debug v: " + $env:NUM_DEB;
|
||||
Write-Output $resoconto;
|
||||
echo "replace completati"
|
||||
echo "Replace completati"
|
||||
|
||||
# helper x fix nuspec file
|
||||
.nuspec-fix: &nuspec-fix
|
||||
@@ -93,7 +93,7 @@ variables:
|
||||
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
||||
cd "$env:APP_NAME\bin\"
|
||||
$Source = "*"
|
||||
7zip a -tzip $Target $Source -xr!DATA
|
||||
7zip a -tzip $Target $Source -xr!DATA\CONF
|
||||
echo "called ZIP $Source --> $Target"
|
||||
|
||||
# helper creazione hash files
|
||||
@@ -201,6 +201,23 @@ IOB-WIN-NEXT:build:
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
|
||||
|
||||
EgwProxy.Ftp:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: EgwProxy.Ftp
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
- SDK/Ftp
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
|
||||
|
||||
EgwProxy.Icoel:build:
|
||||
stage: build
|
||||
tags:
|
||||
@@ -209,6 +226,7 @@ EgwProxy.Icoel:build:
|
||||
APP_NAME: EgwProxy.Icoel
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
- SDK/Icoel
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
@@ -225,6 +243,7 @@ EgwProxy.MultiCncLib:build:
|
||||
APP_NAME: EgwProxy.MultiCncLib
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
- SDK/MultiCnc
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
@@ -241,6 +260,7 @@ EgwProxy.OsaiCncLib:build:
|
||||
APP_NAME: EgwProxy.OsaiCncLib
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
- SDK/OsaiCnc
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
@@ -249,9 +269,33 @@ EgwProxy.OsaiCncLib:build:
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
|
||||
|
||||
|
||||
# --------------------------------
|
||||
# STAGING: (nuget beta)
|
||||
# --------------------------------
|
||||
EgwProxy.Ftp:build:staging:
|
||||
stage: staging
|
||||
needs: ["EgwProxy.Ftp:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Debug
|
||||
APP_NAME: EgwProxy.Ftp
|
||||
only:
|
||||
refs:
|
||||
- develop
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m'
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Debug.nuspec"'
|
||||
- '& "$env:NUGET_PATH" setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
EgwProxy.Icoel:build:staging:
|
||||
stage: staging
|
||||
needs: ["EgwProxy.Icoel:build"]
|
||||
@@ -395,6 +439,30 @@ IOB-WIN-NEXT:release:
|
||||
- *hashBuild
|
||||
- *nexusUpload
|
||||
|
||||
EgwProxy.Ftp:build:release:
|
||||
stage: release
|
||||
needs: ["EgwProxy.Ftp:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Release
|
||||
APP_NAME: EgwProxy.Ftp
|
||||
only:
|
||||
refs:
|
||||
- SDK/Ftp
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m'
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Release.nuspec"'
|
||||
# - '& "$env:NUGET_PATH" pack "$env:APP_NAME\$env:APP_NAME.csproj" -properties Configuration=$env:CONFIG -Version $env:NUM_REL'
|
||||
- '& "$env:NUGET_PATH" setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_REL.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
EgwProxy.Icoel:build:release:
|
||||
stage: release
|
||||
needs: ["EgwProxy.Icoel:build"]
|
||||
@@ -469,6 +537,20 @@ EgwProxy.OsaiCncLib:build:release:
|
||||
# --------------------------------
|
||||
# DocFx
|
||||
# --------------------------------
|
||||
EgwProxy.Ftp:docfx:
|
||||
stage: docfx
|
||||
needs: ["EgwProxy.Ftp:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: EgwProxy.Ftp
|
||||
only:
|
||||
- SDK/Ftp
|
||||
script:
|
||||
- docfx $env:APP_NAME/docfx.json
|
||||
- mv $env:APP_NAME/_site "docfx"
|
||||
- *DocReplica
|
||||
|
||||
EgwProxy.Icoel:docfx:
|
||||
stage: docfx
|
||||
needs: ["EgwProxy.Icoel:build"]
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
SELECT *
|
||||
FROM DettagliConferimentoMES
|
||||
where FillingId = 31729
|
||||
order by PackId
|
||||
|
||||
|
||||
/*
|
||||
Numero lotto = sigla giorno
|
||||
sigla lotto: incrementale giornaliero
|
||||
|
||||
in particoalre x il prodotto grosso --> seleziono da + fornitori (es fornitori grossi)
|
||||
|
||||
PackId = id univoco scatoletta
|
||||
FillingId / FillingRow NON USATI: li posso ignorare, si applicano al caso "travaso" da bins ingresso / bins uscita "tipizzati" --> serve x precalibrare
|
||||
scaricoId = operazione di scannerizzazione ( è il barcode letto)
|
||||
codice a barre è letto x ogni etichetta di conferimento
|
||||
codice e nome fornitore = grower
|
||||
codice e descrizione prodotto : sono il GREZZO specifico
|
||||
cdice prodotto grezzo è il "ceppo" / famiglia
|
||||
sigla e numero lotto: colonna di entrata ciliegie (frontiera)
|
||||
idem x data e qta entrata
|
||||
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,16 @@
|
||||
SELECT *
|
||||
FROM DettagliConfezioniMES
|
||||
|
||||
|
||||
/*
|
||||
pack id = singola cassetta/scatola/cartone
|
||||
ean = barcode in uscita
|
||||
batch id / batch name = dati tracciabilità, legato ai lotti in entrata sul sizer
|
||||
lane [1/2]sizerBatchId = lotti del sizer
|
||||
pesoDecigram = peso netto confezionato (tolleranza +/-10g...20gr)
|
||||
|
||||
tabella scritta dal momento in cui arriva il cartone/cassetta per iniziare riempimento
|
||||
|
||||
dati live li vediamo dal sizer
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,19 @@
|
||||
select top 100 *
|
||||
from ProductsTotals
|
||||
|
||||
/*
|
||||
SizerBatch id = id del batch da WS SOAP
|
||||
Index = indice di prodotto FINITO, di cui ho il NOME
|
||||
- prodotti da matrice: colonne = gradi, righe = taglie(sizes)
|
||||
- grado a colore rosso
|
||||
- do il nome prodotto rosse 26- (che sono da 22 a 26 in grado A)
|
||||
- colonna qualities = è la "somma dei qualities" ovvero le colonne che passano nelcontrollo prodotto
|
||||
- codice in 3 parametri, che sono a,b,c
|
||||
- a = qualità interna (SEMPRE NULL x le ciliegie)
|
||||
- b grado = qualità esterna del frutto, es rosse, nere, con stelo... ricircolo = scarto per cattiva disposizione
|
||||
- c : calibri che mi definiscono la dimensione, tipicamente 22..32
|
||||
|
||||
|
||||
si scrive tutto quando è chiuso il lotto
|
||||
inizialmente 1 solo lotto x entrambe le linee
|
||||
*/
|
||||
@@ -0,0 +1,23 @@
|
||||
/****** Script for SelectTopNRows command from SSMS ******/
|
||||
SELECT TOP (1000) [ID_CHIAVE]
|
||||
,[CODBARRE]
|
||||
,[CODICE_FORNITORE]
|
||||
,[CODICE_LUOGO_PRODUZIONE]
|
||||
,[NOME_FORNITORE]
|
||||
,[INDIRIZZO_FORNITORE]
|
||||
,[COMUNE_FORNITORE]
|
||||
,[NOME_LUOGO_PRODUZIONE]
|
||||
,[INDIRIZZO_LUOGO_PRODUZIONE]
|
||||
,[COMUNE_LUOGO_PRODUZIONE]
|
||||
,[CODICE_PRODOTTO]
|
||||
,[DESCRIZIONE_PRODOTTO]
|
||||
,[CODICE_PRODOTTO_GREZZO]
|
||||
,[DESCRIZIONE_PRODOTTO_GREZZO]
|
||||
,[SIGLA_LOTTO]
|
||||
,[NUMERO_LOTTO]
|
||||
,[DATA_ENTRATA]
|
||||
,[QUANTITA_ENTRATA]
|
||||
FROM [frontiera].[dbo].[ENTRATACILIEGIE]
|
||||
|
||||
|
||||
-- utilizzare codice e descrizione prodotto...
|
||||
@@ -0,0 +1,72 @@
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Implementazione di riferimento x un file di configurazione x esecuzione task tramite EgwCApp
|
||||
/// </summary>
|
||||
public class ConfigFile
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Path Archivio dove depositare file ORIGINALI processati (se !="" vanno archiviati)
|
||||
/// </summary>
|
||||
public string ArchiveDir { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Path dove depositare file tradotti processati (se !="" vanno spostati li)
|
||||
/// </summary>
|
||||
public string ConvertDir { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Path file da processare
|
||||
/// </summary>
|
||||
public string FileInPath { get; set; } = "demoIn.txt";
|
||||
|
||||
/// <summary>
|
||||
/// Path file dove salvare
|
||||
/// </summary>
|
||||
public string FileOutPath { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// IdxODL da registrare
|
||||
/// </summary>
|
||||
public int IdxODL { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Parametri per processing file string --> int
|
||||
/// </summary>
|
||||
public Dictionary<string, int> ProcessParamInt { get; set; } = new Dictionary<string, int>();
|
||||
|
||||
/// <summary>
|
||||
/// Parametri per processing file string --> string
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ProcessParamStr { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// DB Redis dove salvare
|
||||
/// </summary>
|
||||
public int RedisDB { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Posizione Redis dove salvare (HashKey)
|
||||
/// </summary>
|
||||
public string RedisOut { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Modalità ritorno risutlati
|
||||
/// </summary>
|
||||
public ReturnMode Return { get; set; } = ReturnMode.ND;
|
||||
|
||||
/// <summary>
|
||||
/// Path file da processare
|
||||
/// </summary>
|
||||
public string TargetName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia di iport da condurre
|
||||
/// </summary>
|
||||
public ImportType Type { get; set; } = ImportType.ND;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ExcelDataReader.DataSet" Version="3.6.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.86" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,37 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Tipologia file da importare
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ImportType
|
||||
{
|
||||
ND = 0,
|
||||
CSV,
|
||||
Excel
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum rawTransfType
|
||||
{
|
||||
ND,
|
||||
IcoelBatch,
|
||||
IcoelVarInfo,
|
||||
RegGiacenze
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modalità ritorno risultati
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ReturnMode
|
||||
{
|
||||
ND = 0,
|
||||
Console,
|
||||
File,
|
||||
Redis
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using ExcelDataReader;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Gestione lettura excel:
|
||||
/// https://github.com/ExcelDataReader/ExcelDataReader
|
||||
/// </summary>
|
||||
public class ExcelMan
|
||||
{
|
||||
protected string _path { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Avvio componente x il file indicato
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
public ExcelMan(string filePath)
|
||||
{
|
||||
// verifico esistenza file...
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
_path = filePath;
|
||||
}
|
||||
}
|
||||
|
||||
public DataSet getDataSet()
|
||||
{
|
||||
DataSet result = new DataSet();
|
||||
using (var stream = File.Open(_path, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
// Auto-detect format, supports:
|
||||
// - Binary Excel files (2.0-2003 format; *.xls)
|
||||
// - OpenXml Excel files (2007 format; *.xlsx, *.xlsb)
|
||||
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
|
||||
using (var reader = ExcelReaderFactory.CreateReader(stream))
|
||||
{
|
||||
// 2. Use the AsDataSet extension method
|
||||
//result = reader.AsDataSet();
|
||||
// The result of each spreadsheet is in result.Tables
|
||||
|
||||
// modalità lettura con intestazione
|
||||
result = reader.AsDataSet(new ExcelDataSetConfiguration()
|
||||
{
|
||||
ConfigureDataTable = (_) => new ExcelDataTableConfiguration()
|
||||
{
|
||||
UseHeaderRow = true
|
||||
}
|
||||
});
|
||||
|
||||
#if false
|
||||
result = reader.AsDataSet();
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public IExcelDataReader getExcelReader()
|
||||
{
|
||||
// ExcelDataReader works with the binary Excel file, so it needs a FileStream
|
||||
// to get started. This is how we avoid dependencies on ACE or Interop:
|
||||
FileStream stream = File.Open(_path, FileMode.Open, FileAccess.Read);
|
||||
|
||||
// We return the interface, so that
|
||||
IExcelDataReader reader = null;
|
||||
try
|
||||
{
|
||||
if (_path.EndsWith(".xls"))
|
||||
{
|
||||
reader = ExcelReaderFactory.CreateBinaryReader(stream);
|
||||
}
|
||||
if (_path.EndsWith(".xlsx"))
|
||||
{
|
||||
reader = ExcelReaderFactory.CreateOpenXmlReader(stream);
|
||||
}
|
||||
return reader;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
public IEnumerable<string> getWorksheetNames()
|
||||
{
|
||||
var reader = this.getExcelReader();
|
||||
var workbook = reader.AsDataSet();
|
||||
var sheets = from DataTable sheet in workbook.Tables select sheet.TableName;
|
||||
return sheets;
|
||||
}
|
||||
|
||||
public IEnumerable<DataRow> getData(string sheet, bool firstRowIsColumnNames = true)
|
||||
{
|
||||
var reader = this.getExcelReader();
|
||||
//reader.IsFirstRowAsColumnNames = firstRowIsColumnNames;
|
||||
var workSheet = reader.AsDataSet().Tables[sheet];
|
||||
var rows = from DataRow a in workSheet.Rows select a;
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
public class RedisMan
|
||||
{
|
||||
protected string connString = "";
|
||||
protected string servAddr = "";
|
||||
protected int servPort = 0;
|
||||
protected int redisDb = 0;
|
||||
public RedisMan(string server, int port, int db)
|
||||
{
|
||||
servAddr = server;
|
||||
servPort = port;
|
||||
redisDb = db;
|
||||
connString = $"{servAddr}:{servPort},db={redisDb},abortConnect=false,ssl=false";
|
||||
}
|
||||
|
||||
public bool writeData(string redKey, string rawData)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public string getRSV(string redKey)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
namespace EgwCApp.Core
|
||||
{
|
||||
public class WharehouseData
|
||||
{
|
||||
#region Public Classes
|
||||
|
||||
public class BatchRec
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public DateTime DateRif { get; set; } = DateTime.Today;
|
||||
public string ExtDoc { get; set; } = "Doc";
|
||||
public string IdentRG { get; set; } = "NA";
|
||||
public int IdxODL { get; set; } = 0;
|
||||
public string Notes { get; set; } = "Notes";
|
||||
public int NumPack { get; set; } = 0;
|
||||
public string Product { get; set; } = "Prod";
|
||||
|
||||
public double QtyTot { get; set; } = 0.0;
|
||||
public string Supplier { get; set; } = "Suppl";
|
||||
public string Variety { get; set; } = "Var";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.2.32516.85
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EgwCApp.Testing", "EgwCApp.Testing\EgwCApp.Testing.csproj", "{E37013B7-E5C6-48ED-8051-0BA5F29CB234}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EgwCApp.ExcImport", "EgwCApp.ExcImport\EgwCApp.ExcImport.csproj", "{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwCApp.Core", "EgwCApp.Core\EgwCApp.Core.csproj", "{DF02D478-2309-48B8-BF0D-90B02327AF02}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2AF3181F-288A-47D5-8087-2AB660476D85}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AssemblyName>ExcImport</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.6.86" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwCApp.Core\EgwCApp.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="testConfExcel.json">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="testConfCsv.json">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="testConf.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,373 @@
|
||||
using EgwCApp.Core;
|
||||
using Newtonsoft.Json;
|
||||
using static EgwCApp.Core.WharehouseData;
|
||||
|
||||
namespace EgwCApp.ExcImport
|
||||
{
|
||||
public class ImportProc
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init oggetto per import
|
||||
/// </summary>
|
||||
/// <param name="confFileName"></param>
|
||||
public ImportProc(string confFileName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(confFileName))
|
||||
{
|
||||
fileConfName = confFileName;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Decodifica configurazione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool decodeConfig()
|
||||
{
|
||||
bool answ = false;
|
||||
if (!string.IsNullOrEmpty(fileConfName))
|
||||
{
|
||||
// deserializzo config
|
||||
if (!File.Exists(fileConfName))
|
||||
{
|
||||
Console.WriteLine($"Error: ConfigFile not found | {fileConfName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
string rawData = File.ReadAllText(fileConfName);
|
||||
// se ho contenuto procedo
|
||||
if (string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
Console.WriteLine($"Error: ConfigFile empty! | {fileConfName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// deserializzo
|
||||
taskConfig = JsonConvert.DeserializeObject<ConfigFile>(rawData);
|
||||
answ = taskConfig != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue import (se possibile)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool doProcess()
|
||||
{
|
||||
bool answ = false;
|
||||
if (taskConfig != null)
|
||||
{
|
||||
// verifico esista il file...
|
||||
if (string.IsNullOrEmpty(taskConfig.FileInPath) && File.Exists(taskConfig.FileInPath))
|
||||
{
|
||||
// manca file ingresso!!! esco!
|
||||
}
|
||||
else
|
||||
{
|
||||
// verifico il tipo di process necessario...
|
||||
switch (taskConfig.Type)
|
||||
{
|
||||
case ImportType.CSV:
|
||||
fileReturnData = File.ReadAllText(taskConfig.FileInPath);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ImportType.Excel:
|
||||
fileReturnData = processExcelImport(taskConfig.FileInPath);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ImportType.ND:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esecuzione ritorno informazioni secondo configurazione...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool doReturn()
|
||||
{
|
||||
bool answ = false;
|
||||
if (taskConfig != null)
|
||||
{
|
||||
// verifico il tipo di return necessario...
|
||||
switch (taskConfig.Return)
|
||||
{
|
||||
case ReturnMode.Console:
|
||||
Console.WriteLine(fileReturnData);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ReturnMode.Redis:
|
||||
break;
|
||||
|
||||
case ReturnMode.File:
|
||||
// verifico path ci sia... sennò creo
|
||||
string outPath = string.IsNullOrEmpty(taskConfig.FileOutPath) ? "FileOut.txt" : taskConfig.FileOutPath;
|
||||
// verifico se vadano salvati in una folder differente...
|
||||
if (!string.IsNullOrEmpty(taskConfig.ConvertDir))
|
||||
{
|
||||
if (!Directory.Exists(taskConfig.ConvertDir))
|
||||
{
|
||||
Directory.CreateDirectory(taskConfig.ConvertDir);
|
||||
}
|
||||
outPath = Path.Combine(taskConfig.ConvertDir, Path.GetFileName(outPath));
|
||||
}
|
||||
// salvo il file!
|
||||
File.WriteAllText(outPath, fileReturnData);
|
||||
answ = true;
|
||||
break;
|
||||
|
||||
case ReturnMode.ND:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// se fatto eventualmente archivio
|
||||
if (answ)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(taskConfig.ArchiveDir))
|
||||
{
|
||||
// verifico cartella archivio
|
||||
if (!Directory.Exists(taskConfig.ArchiveDir))
|
||||
{
|
||||
Directory.CreateDirectory(taskConfig.ArchiveDir);
|
||||
}
|
||||
// sposto file
|
||||
string fName = Path.GetFileName(taskConfig.FileInPath);
|
||||
File.Move(taskConfig.FileInPath, Path.Combine(taskConfig.ArchiveDir, fName), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Nome del file config da processare
|
||||
/// </summary>
|
||||
protected string fileConfName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Contenuto del file da restituire come return data (serializzato)
|
||||
/// </summary>
|
||||
protected string fileReturnData { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione del task da eseguire
|
||||
/// </summary>
|
||||
protected ConfigFile? taskConfig { get; set; } = new ConfigFile();
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Estrae da una riga l'i-esimo elemento
|
||||
/// </summary>
|
||||
/// <param name="riga"></param>
|
||||
/// <param name="col"></param>
|
||||
/// <returns></returns>
|
||||
protected string getCellVal(System.Data.DataRow? riga, int col)
|
||||
{
|
||||
string answ = "";
|
||||
if (riga != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = $"{riga.ItemArray[col]}".Trim();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleanup stringa x impiego tipo ident da char dubbi
|
||||
/// </summary>
|
||||
/// <param name="origData"></param>
|
||||
/// <returns></returns>
|
||||
protected string strFixId(string origData)
|
||||
{
|
||||
return origData.Replace(".", "").Replace(" ", "_");
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Importa un file excel e restituisce una
|
||||
/// </summary>
|
||||
/// <param name="fileItem"></param>
|
||||
/// <returns></returns>
|
||||
private string processExcelImport(string fileItem)
|
||||
{
|
||||
string outVal = "";
|
||||
int numErr = 0;
|
||||
// test procedura di import files excel x Giacovelli...
|
||||
var currExcel = new ExcelMan(fileItem);
|
||||
// creo lista dati in formato RegGiacenze...
|
||||
Dictionary<string, BatchRec> listaGiac = new Dictionary<string, BatchRec>();
|
||||
var dtSet = currExcel.getDataSet();
|
||||
if (dtSet != null && dtSet.Tables != null && dtSet.Tables.Count > 0)
|
||||
{
|
||||
string nomeFile = Path.GetFileName(fileItem);
|
||||
nomeFile = nomeFile.Substring(0, nomeFile.LastIndexOf("."));
|
||||
var elSheet = dtSet.Tables;
|
||||
int idxTab = 0;
|
||||
// cerco lo sheet corretto se > 1
|
||||
if (dtSet.Tables.Count > 1)
|
||||
{
|
||||
bool found = false;
|
||||
for (int i = 0; i < dtSet.Tables.Count; i++)
|
||||
{
|
||||
if (nomeFile.Contains(dtSet.Tables[i].TableName))
|
||||
{
|
||||
idxTab = i;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
// controllo parametro opzionale...
|
||||
if (!found && taskConfig != null && !string.IsNullOrEmpty(taskConfig.TargetName))
|
||||
{
|
||||
if (dtSet.Tables[i].TableName == taskConfig.TargetName)
|
||||
{
|
||||
idxTab = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var tabella = dtSet.Tables[idxTab];
|
||||
int numRighe = tabella.Rows.Count;
|
||||
int idxODL = taskConfig != null ? taskConfig.IdxODL : 0;
|
||||
for (int i = 0; i < numRighe; i++)
|
||||
{
|
||||
if (taskConfig != null && taskConfig.ProcessParamInt != null && taskConfig.ProcessParamInt.Count > 5)
|
||||
{
|
||||
if (numErr < numRighe / 5)
|
||||
{
|
||||
try
|
||||
{
|
||||
// variabili di appoggio...
|
||||
DateTime dtRif = DateTime.Today;
|
||||
double qtyTot = 0;
|
||||
int numPack = 0;
|
||||
var riga = tabella.Rows[i];
|
||||
if (riga != null)
|
||||
{
|
||||
string ddt = getCellVal(riga, taskConfig.ProcessParamInt["ExtDoc"]);
|
||||
string sDate = getCellVal(riga, taskConfig.ProcessParamInt["DateRif"]);
|
||||
string prod = getCellVal(riga, taskConfig.ProcessParamInt["Product"]);
|
||||
// verifiche x import: header, data e DDT (vuoti o "-") --> SKIP!
|
||||
bool checkHeaderKo = (ddt == "DDT" || prod == "PRODOTTO");
|
||||
bool checkEmptyDdt = (string.IsNullOrEmpty(ddt) || ddt == "-");
|
||||
bool checkEmptyDate = (string.IsNullOrEmpty(sDate) || sDate == "-");
|
||||
if (checkHeaderKo)
|
||||
{
|
||||
//lgTrace($"SKIP header");
|
||||
}
|
||||
else if (checkEmptyDdt || checkEmptyDate)
|
||||
{
|
||||
//lgTrace($"SKIP linea vuota | i: {i} | ddt: {ddt} | date: {sDate} | prod: {prod}");
|
||||
}
|
||||
else
|
||||
{
|
||||
string variety = getCellVal(riga, taskConfig.ProcessParamInt["Variety"]);
|
||||
string suppl = getCellVal(riga, taskConfig.ProcessParamInt["Supplier"]);
|
||||
string sQty = getCellVal(riga, taskConfig.ProcessParamInt["QtyTot"]);
|
||||
string sNum = getCellVal(riga, taskConfig.ProcessParamInt["NumPack"]);
|
||||
string numPed = getCellVal(riga, taskConfig.ProcessParamInt["NumPed"]);
|
||||
string packPed = getCellVal(riga, taskConfig.ProcessParamInt["PackPed"]);
|
||||
string pesoPack = getCellVal(riga, taskConfig.ProcessParamInt["PesoPack"]);
|
||||
DateTime.TryParse(sDate, out dtRif);
|
||||
int.TryParse(sNum, out numPack);
|
||||
double.TryParse(sQty, out qtyTot);
|
||||
string identRG = ddt.Length > 2 ? $"{strFixId(ddt)}.{strFixId(prod)}.{strFixId(variety)}.{strFixId(suppl)}" : $"{dtRif:yyyyMMdd}.{strFixId(prod)}.{strFixId(variety)}.{strFixId(suppl)}";
|
||||
string notes = $"{numPed}x{packPed}x{pesoPack}";
|
||||
// verifico di avere dati per proseguire...
|
||||
bool checkIdent = !string.IsNullOrEmpty($"{prod}{variety}{suppl}");
|
||||
if (checkIdent)
|
||||
{
|
||||
BatchRec newRow = new BatchRec()
|
||||
{
|
||||
IdxODL = idxODL,
|
||||
IdentRG = identRG,
|
||||
DateRif = dtRif,
|
||||
ExtDoc = ddt,
|
||||
Product = prod,
|
||||
Variety = variety,
|
||||
Supplier = suppl,
|
||||
NumPack = numPack,
|
||||
QtyTot = qtyTot,
|
||||
Notes = notes
|
||||
};
|
||||
// verifico: se manca aggiungo
|
||||
if (!listaGiac.ContainsKey(identRG))
|
||||
{
|
||||
listaGiac.Add(identRG, newRow);
|
||||
}
|
||||
else
|
||||
{
|
||||
// altrimenti aggiorno giacenza con valori numerici
|
||||
listaGiac[identRG].NumPack += newRow.NumPack;
|
||||
listaGiac[identRG].QtyTot += newRow.QtyTot;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//lgError($"Errore verifica identità riga | prod: {prod} | variety: {variety} | suppl: {suppl}");
|
||||
numErr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
numErr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (listaGiac.Count > 0)
|
||||
{
|
||||
// converto in una nuova lista...
|
||||
int rCounter = 1;
|
||||
Dictionary<int, BatchRec> list2Send = new Dictionary<int, BatchRec>();
|
||||
foreach (var item in listaGiac)
|
||||
{
|
||||
list2Send.Add(rCounter, item.Value);
|
||||
rCounter++;
|
||||
}
|
||||
// serializzo e restituisco file JSON...
|
||||
var serVal = JsonConvert.SerializeObject(list2Send);
|
||||
if (serVal != null && !string.IsNullOrEmpty(serVal))
|
||||
{
|
||||
outVal = serVal;
|
||||
}
|
||||
}
|
||||
return outVal;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
// ExcImport: Excel Importer, per IobWin in logica lettura Giacenze
|
||||
// parametri:
|
||||
// $0: Path ConfigFile file per esecuzione
|
||||
|
||||
using EgwCApp.ExcImport;
|
||||
|
||||
string separator = "--------------------------------------";
|
||||
string fileName = "";
|
||||
|
||||
// controllo args, se mancassero o incompleti mostro help
|
||||
if (args.Length < 1)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("- ExcelFileImporter - Core 6.0");
|
||||
Console.WriteLine("- v.0.0.0.0 | @Egalware 2022+");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Mancano parametri per esecuzione:");
|
||||
Console.WriteLine("");
|
||||
Console.WriteLine("$0: ConfigFile da impiegare");
|
||||
|
||||
// provo a processare testConf...
|
||||
fileName = "testConf.json";
|
||||
}
|
||||
else
|
||||
{
|
||||
fileName = args[0];
|
||||
}
|
||||
|
||||
// ora processo se ho filename valido...
|
||||
if (!string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
// verifico se ho file...
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
ImportProc importObj = new ImportProc(fileName);
|
||||
bool stepOk = importObj.decodeConfig();
|
||||
if (stepOk)
|
||||
{
|
||||
stepOk = importObj.doProcess();
|
||||
if (!stepOk)
|
||||
{
|
||||
Console.WriteLine("Errore in processing file");
|
||||
}
|
||||
else
|
||||
{
|
||||
importObj.doReturn();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Errore in processing config file");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Errore file non trovato!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@echo off
|
||||
|
||||
REM compilo in publish
|
||||
dotnet publish EgwCApp.ExcImport.csproj -p:PublishSingleFile=true -r win-x64 -c Release --self-contained false
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"ArchiveDir": "C:\\temp\\import\\archive",
|
||||
"ConvertDir": "C:\\temp\\import\\convert",
|
||||
"FileInPath": "C:\\temp\\import\\01.12.xlsx",
|
||||
"FileOutPath": "01.12.json",
|
||||
"IdxODL": 987654321,
|
||||
"ProcessParamInt": {
|
||||
"Product": 3,
|
||||
"Variety": 9,
|
||||
"Supplier": 8,
|
||||
"ExtDoc": 2,
|
||||
"DateRif": 14,
|
||||
"QtyTot": 22,
|
||||
"NumPack": 21,
|
||||
"NumPed": 17,
|
||||
"PackPed": 18,
|
||||
"PesoPack": 20
|
||||
},
|
||||
"ProcessParamStr": {},
|
||||
"RedisDB": 0,
|
||||
"RedisOut": "",
|
||||
"Return": "File",
|
||||
"TargetName": "DB Loco",
|
||||
"Type": "Excel"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"FilePath": "C:\\Temp\\test.log",
|
||||
"ProcessParams": {},
|
||||
"Return": "Console",
|
||||
"Type": "Excel"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"ArchiveDir": "C:\\temp\\import\\archive",
|
||||
"ConvertDir": "C:\\temp\\import\\convert",
|
||||
"FileInPath": "C:\\temp\\import\\01.12.xlsx",
|
||||
"FileOutPath": "01.12.json",
|
||||
"IdxODL": 987654321,
|
||||
"ProcessParamInt": {
|
||||
"Product": 3,
|
||||
"Variety": 9,
|
||||
"Supplier": 8,
|
||||
"ExtDoc": 2,
|
||||
"DateRif": 14,
|
||||
"QtyTot": 22,
|
||||
"NumPack": 21,
|
||||
"NumPed": 17,
|
||||
"PackPed": 18,
|
||||
"PesoPack": 20
|
||||
},
|
||||
"ProcessParamStr": {},
|
||||
"RedisDB": 0,
|
||||
"RedisOut": "",
|
||||
"Return": "File",
|
||||
"TargetName": "DB Loco",
|
||||
"Type": "Excel"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
echo ------------ Parametri compilazione ------------
|
||||
echo OutDir: $(OutDir)
|
||||
echo Configuration: $(ConfigurationName)
|
||||
echo ProjectDir: $(ProjectDir)
|
||||
echo AssemblyName: $(AssemblyName)
|
||||
echo TargetDir: $(TargetDir)
|
||||
echo ------------ Parametri compilazione ------------
|
||||
|
||||
preBuild.bat $(SolutionDir)EgwCApp.ExcImport\EgwCApp.ExcImport.csproj $(SolutionDir)EgwCApp.ExcImport\bin\Release\net6.0\publish\win-x64\ $(ProjectDir)Utils
|
||||
@@ -0,0 +1,42 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>embedded</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Tools\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwCApp.Core\EgwCApp.Core.csproj" />
|
||||
<ProjectReference Include="..\EgwCApp.ExcImport\EgwCApp.ExcImport.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Tools\ExcImport.exe">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="preBuild.bat $(SolutionDir)EgwCApp.ExcImport\bin\Release\net6.0\win-x64\publish\ $(ProjectDir)Tools" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,114 @@
|
||||
using EgwCApp.Core;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace EgwCApp.Testing
|
||||
{
|
||||
public class FileProcMan
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public FileProcMan(string toolDir, string exeFileName)
|
||||
{
|
||||
this.confFileName = "conf.json";
|
||||
this.baseDir = toolDir;
|
||||
this.exeName = exeFileName;
|
||||
appPath = $"./{baseDir}/{exeName}";
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Processa il singolo file e riporta tempo esecuzione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public TimeSpan doProcess(string fPath)
|
||||
{
|
||||
TimeSpan outVal = new TimeSpan();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
// preparo file conf
|
||||
createConfFile(fPath);
|
||||
// avvio processing
|
||||
Console.WriteLine("calling ext app with args:");
|
||||
Console.WriteLine($"{appPath} {confFileName}");
|
||||
Console.WriteLine();
|
||||
|
||||
ProcessStartInfo psi = new ProcessStartInfo
|
||||
{
|
||||
FileName = appPath,
|
||||
Arguments = $"{confFileName}",
|
||||
WindowStyle = ProcessWindowStyle.Minimized,
|
||||
//WindowStyle = ProcessWindowStyle.Hidden,
|
||||
UseShellExecute = false,
|
||||
//CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardInput = true,
|
||||
};
|
||||
|
||||
sw.Start();
|
||||
|
||||
Process p = Process.Start(psi);
|
||||
|
||||
string q = "";
|
||||
while (!p.HasExited)
|
||||
{
|
||||
q += p.StandardOutput.ReadToEnd();
|
||||
}
|
||||
|
||||
sw.Stop();
|
||||
outVal = sw.Elapsed;
|
||||
|
||||
return outVal;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string appPath = "";
|
||||
protected string baseDir = "";
|
||||
protected string confFileName = "";
|
||||
protected string exeName = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void createConfFile(string item)
|
||||
{
|
||||
Dictionary<string, int> importParams = new Dictionary<string, int>();
|
||||
importParams.Add("Product", 3);
|
||||
importParams.Add("Variety", 9);
|
||||
importParams.Add("Supplier", 8);
|
||||
importParams.Add("ExtDoc", 2);
|
||||
importParams.Add("DateRif", 14);
|
||||
importParams.Add("QtyTot", 22);
|
||||
importParams.Add("NumPack", 21);
|
||||
importParams.Add("NumPed", 17);
|
||||
importParams.Add("PackPed", 18);
|
||||
importParams.Add("PesoPack", 20);
|
||||
// calcolo nome file conf specifico
|
||||
string outFileName = Path.GetFileName(item).Replace("xlsx", "json");
|
||||
confFileName = $"conf_{outFileName}";
|
||||
// calcolo outFIleName
|
||||
var newConf = new ConfigFile()
|
||||
{
|
||||
ArchiveDir = @"C:\temp\import\archive\",
|
||||
ConvertDir = @"C:\temp\import\convert\",
|
||||
Type = ImportType.Excel,
|
||||
FileInPath = item,
|
||||
FileOutPath = outFileName,
|
||||
Return = ReturnMode.File,
|
||||
ProcessParamInt = importParams,
|
||||
TargetName = "DB Loco"
|
||||
};
|
||||
// serializzo e salvo!
|
||||
var rawData = JsonConvert.SerializeObject(newConf, Formatting.Indented);
|
||||
File.WriteAllText(confFileName, rawData);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
using EgwCApp.Core;
|
||||
using System.Diagnostics;
|
||||
using Newtonsoft.Json;
|
||||
using EgwCApp.Testing;
|
||||
|
||||
Dictionary<string, TimeSpan> statsColl = new Dictionary<string, TimeSpan>();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
|
||||
string separator = "--------------------------------------";
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Console Test Application");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
|
||||
// creo il file di configurazione...
|
||||
string fileName = "conf.json";
|
||||
ConfigFile newConf = new ConfigFile();
|
||||
string rawData = "";
|
||||
|
||||
// test CSV
|
||||
//newConf = new ConfigFile()
|
||||
//{
|
||||
// Type = ImportType.CSV,
|
||||
// FileInPath = @"C:\Temp\test.log",
|
||||
// Return = ReturnMode.Console
|
||||
//};
|
||||
|
||||
|
||||
// svuoto eventuali conf vecchi
|
||||
var listaConf = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.json");
|
||||
if (listaConf != null && listaConf.Count() > 0)
|
||||
{
|
||||
foreach (var file2del in listaConf)
|
||||
{
|
||||
File.Delete(file2del);
|
||||
}
|
||||
}
|
||||
// cerco file xlsx e ciclo...
|
||||
var listaFiles = Directory.GetFiles(@"C:\temp\import\", "*.xlsx");
|
||||
if (listaFiles != null && listaFiles.Count() > 0)
|
||||
{
|
||||
FileProcMan fpm = new FileProcMan("Tools", "ExcImport.exe");
|
||||
foreach (var item in listaFiles)
|
||||
{
|
||||
TimeSpan timeElaps = fpm.doProcess(item);
|
||||
|
||||
statsColl.Add($"Ext prog executed for {item}", timeElaps);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("press enter to proceed...");
|
||||
|
||||
Console.ReadLine();
|
||||
|
||||
foreach (var item in statsColl)
|
||||
{
|
||||
Console.WriteLine($"{item.Key} {item.Value.TotalMilliseconds} ms");
|
||||
}
|
||||
//Console.WriteLine($"Display executed in {timeElaps.TotalMilliseconds} ms");
|
||||
|
||||
Console.ReadLine();
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
|
||||
REM recupero versione compilata
|
||||
ROBOCOPY %1 %2 *.exe /MIR
|
||||
|
||||
echo Eseguito restore CApp!
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32901.82
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Ftp.Test", "EgwProxy.Ftp.Test\EgwProxy.Ftp.Test.csproj", "{A655A6AC-5997-46F9-9752-8C621B80516C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Ftp", "EgwProxy.Ftp\EgwProxy.Ftp.csproj", "{35D95ED8-E48A-434D-A305-A83E48C8FC6F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E2472E21-58D3-4EAD-BC4A-BC3915B18BEF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>EgwProxy.Ftp</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwProxy.Ftp</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per comunicazione con server Ftp (IOB-WIN-NEXT) - beta/unstable</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.Ftp EgwProxy Ftp</tags>
|
||||
<dependencies>
|
||||
<group>
|
||||
<dependency id="FluentFTP" version="41.0.0" />
|
||||
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.Ftp\bin\Debug\EgwProxy*.dll" target="lib" />
|
||||
<file src="EgwProxy.Ftp\bin\Debug\EgwProxy*.config" target="lib" />
|
||||
<file src="EgwProxy.Ftp\bin\Debug\EgwProxy*.pdb" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>EgwProxy.Ftp</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwProxy.Ftp</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per comunicazione con server Ftp (IOB-WIN-NEXT)</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.Ftp EgwProxy Ftp</tags>
|
||||
<dependencies>
|
||||
<dependency id="FluentFTP" version="41.0.0" />
|
||||
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.Ftp\bin\Release\EgwProxy*.dll" target="lib" />
|
||||
<file src="EgwProxy.Ftp\bin\Release\EgwProxy*.config" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="testFile" value="conf/testSetup.json" />
|
||||
<add key="server" value="ftp.steamware.net" />
|
||||
<add key="userName" value="testftpuser" />
|
||||
<add key="passwd" value="we4reFromB3rghem!" />
|
||||
<add key="rawCert" value="" />
|
||||
<add key="skipCert" value="true" />
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
</appSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.web>
|
||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||
<providers>
|
||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||
</providers>
|
||||
</membership>
|
||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||
<providers>
|
||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A655A6AC-5997-46F9-9752-8C621B80516C}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>EgwProxy.Ftp.Test</RootNamespace>
|
||||
<AssemblyName>EgwProxy.Ftp.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentFTP, Version=41.0.0.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentFTP.41.0.0\lib\net462\FluentFTP.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.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="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TestSetup.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="conf\testSetup.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="conf\.placeholder" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="test\FileProva.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="temp\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwProxy.Ftp\EgwProxy.Ftp.csproj">
|
||||
<Project>{35d95ed8-e48a-434d-a305-a83e48c8fc6f}</Project>
|
||||
<Name>EgwProxy.Ftp</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,374 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace EgwProxy.Ftp.Test
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// legge conf in formato stringa
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
protected static string ReadSetting(string key)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = $"{ConfigurationManager.AppSettings[key]}" ?? "";
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.Write("Eccezione in ReadSettings");
|
||||
Console.Write(exc.Message);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Helper separatore dash
|
||||
/// </summary>
|
||||
private const string separator = "------------------------";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Programma principale
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Test FTP Client");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||
string BaseDirectory = System.IO.Path.GetDirectoryName(exePath);
|
||||
string testFile = Path.Combine(BaseDirectory, ReadSetting("testFile"));
|
||||
Manager ftpClient = new Manager("", "", "", "", false);
|
||||
if (!string.IsNullOrEmpty(testFile))
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine($"Mode json ({testFile})");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
if (File.Exists(testFile))
|
||||
{
|
||||
var rawData = File.ReadAllText(testFile);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
TestSetup testConf = new TestSetup();
|
||||
try
|
||||
{
|
||||
testConf = JsonConvert.DeserializeObject<TestSetup>(rawData);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// setup server
|
||||
ftpClient = new Manager(testConf.server, testConf.user, testConf.password, testConf.rawCert, testConf.skipCert);
|
||||
serverTest(ftpClient);
|
||||
|
||||
// eseguo per ogni step
|
||||
foreach (var item in testConf.steps)
|
||||
{
|
||||
Console.WriteLine($"------ Step {item.id} | {item.description} ------");
|
||||
string esitoStep = "";
|
||||
switch (item.action)
|
||||
{
|
||||
case stepType.checkDir:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
var dirCheckExists = ftpClient.dirExists(dir2check);
|
||||
esitoStep = dirCheckExists ? $"Directory {dir2check} found!" : $"Directory {dir2check} NOT found!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.checkFile:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string file2check = item.paramList[0];
|
||||
var dirCheckExists = ftpClient.fileExists(file2check);
|
||||
esitoStep = dirCheckExists ? $"File {file2check} found!" : $"File {file2check} NOT found!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.createDir:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
var preTest = ftpClient.dirExists(dir2check);
|
||||
if (preTest)
|
||||
{
|
||||
esitoStep = "Error: Folder already exists!";
|
||||
}
|
||||
else
|
||||
{
|
||||
var dirCreate = ftpClient.createDir(dir2check);
|
||||
esitoStep = dirCreate ? $"Directory {dir2check} created!" : $"Error: {dir2check} NOT created!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.delDir:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
var preTest = ftpClient.dirExists(dir2check);
|
||||
if (preTest)
|
||||
{
|
||||
var dirDelete = ftpClient.deleteDir(dir2check);
|
||||
esitoStep = dirDelete ? $"Directory {dir2check} deleted!" : $"Error: {dir2check} NOT deleted!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: Folder doesn't exists, delete not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.delFile:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string file2check = item.paramList[0];
|
||||
var preTest = ftpClient.fileExists(file2check);
|
||||
if (preTest)
|
||||
{
|
||||
var dirDelete = ftpClient.deleteFile(file2check);
|
||||
esitoStep = dirDelete ? $"File {file2check} deleted!" : $"Error: {file2check} NOT deleted!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: File doesn't exists, delete not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.downloadDir:
|
||||
if (item.paramList != null && item.paramList.Count > 1)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
string localDir = Path.Combine(BaseDirectory, item.paramList[1]);
|
||||
var preTest = ftpClient.dirExists(dir2check);
|
||||
if (preTest)
|
||||
{
|
||||
var dirDelete = ftpClient.getDir(localDir, dir2check);
|
||||
esitoStep = dirDelete ? $"Directory {dir2check} downloaded!" : $"Error: {dir2check} NOT downloaded!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: Folder doesn't exists, download not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameters!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.downloadFile:
|
||||
if (item.paramList != null && item.paramList.Count > 1)
|
||||
{
|
||||
string dir2check = item.paramList[0];
|
||||
string localDir = Path.Combine(BaseDirectory, item.paramList[1]);
|
||||
var preTest = ftpClient.dirExists(dir2check);
|
||||
if (preTest)
|
||||
{
|
||||
var dirDelete = ftpClient.getDir(localDir, dir2check);
|
||||
esitoStep = dirDelete ? $"Directory {dir2check} downloaded!" : $"Error: {dir2check} NOT downloaded!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: Folder doesn't exists, download not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameters!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.uploadDir:
|
||||
if (item.paramList != null && item.paramList.Count > 1)
|
||||
{
|
||||
string remoteDir = item.paramList[0];
|
||||
string localDir = Path.Combine(BaseDirectory, item.paramList[1]);
|
||||
var dirUploaded = ftpClient.sendDir(localDir, remoteDir);
|
||||
esitoStep = dirUploaded ? $"Directory {remoteDir} uploaded!" : $"Error: {remoteDir} NOT uploaded!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameters!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.uploadFile:
|
||||
if (item.paramList != null && item.paramList.Count > 1)
|
||||
{
|
||||
string remotePath = item.paramList[0];
|
||||
string localPath = Path.Combine(BaseDirectory, item.paramList[1]);
|
||||
var fileUploaded = ftpClient.sendFile(localPath, remotePath);
|
||||
esitoStep = fileUploaded ? $"File {remotePath} uploaded!" : $"Error: {remotePath} NOT uploaded!";
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameters!";
|
||||
}
|
||||
break;
|
||||
|
||||
case stepType.listContent:
|
||||
if (item.paramList != null && item.paramList.Count > 0)
|
||||
{
|
||||
string remoteDir = item.paramList[0];
|
||||
var preTest = ftpClient.dirExists(remoteDir);
|
||||
if (preTest)
|
||||
{
|
||||
var listResult = ftpClient.listDir(remoteDir, false);
|
||||
Console.WriteLine($"Content of dir {remoteDir}:");
|
||||
foreach (var itemList in listResult)
|
||||
{
|
||||
Console.WriteLine(itemList);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: Folder doesn't exists, list not possible!";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
esitoStep = "Error: missing parameter!";
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Console.WriteLine(esitoStep);
|
||||
Console.WriteLine($"------ Done Step {item.id} ------");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Press a key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// test base su server steamware
|
||||
else
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine("Mode: base");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
|
||||
string sSkipCert = ReadSetting("skipCert");
|
||||
bool skipCert = false;
|
||||
bool.TryParse(sSkipCert, out skipCert);
|
||||
ftpClient = new Manager(ReadSetting("server"), ReadSetting("userName"), ReadSetting("passwd"), ReadSetting("rawCert"), skipCert);
|
||||
serverTest(ftpClient);
|
||||
|
||||
Console.WriteLine("--- Folder ---");
|
||||
var testExists = ftpClient.dirExists($"data/test_folder");
|
||||
if (testExists)
|
||||
{
|
||||
Console.WriteLine("Folder already exists!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("--- Create folder ---");
|
||||
var testCreate = ftpClient.createDir($"data/test_folder");
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
Console.WriteLine("Contenuto folder remota: ");
|
||||
var folderContent = ftpClient.listDir("data/", true);
|
||||
foreach (var item in folderContent)
|
||||
{
|
||||
Console.WriteLine(item);
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
Console.ReadKey();
|
||||
|
||||
Console.WriteLine("--- Upload file ---");
|
||||
ftpClient.sendFile("test/FileProva.txt", "data/test_folder/FileProva.txt");
|
||||
Console.WriteLine("Contenuto folder remota: ");
|
||||
folderContent = ftpClient.listDir("data/", true);
|
||||
foreach (var item in folderContent)
|
||||
{
|
||||
Console.WriteLine(item);
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
Console.ReadKey();
|
||||
|
||||
Console.WriteLine("--- Download File ---");
|
||||
|
||||
ftpClient.getFile("test/FileProva_02.txt", "data/test_folder/FileProva.txt");
|
||||
Console.WriteLine("Contenuto folder remota: ");
|
||||
folderContent = ftpClient.listDir("data/", true);
|
||||
foreach (var item in folderContent)
|
||||
{
|
||||
Console.WriteLine(item);
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
|
||||
private static void serverTest(Manager ftpClient)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
var testServer = ftpClient.serverOk();
|
||||
Console.WriteLine($"Test connessione: esito {testServer}");
|
||||
var srvType = ftpClient.serverType();
|
||||
Console.WriteLine($"Server: {srvType}");
|
||||
Console.WriteLine(separator);
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgwProxy.Ftp.Test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgwProxy.Ftp.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("a655a6ac-5997-46f9-9752-8c621b80516c")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.Ftp.Test
|
||||
{
|
||||
public class TestSetup
|
||||
{
|
||||
public string server { get; set; } = "";
|
||||
public string user { get; set; } = "";
|
||||
public string password { get; set; } = "";
|
||||
public string rawCert { get; set; } = "";
|
||||
public bool skipCert { get; set; } = false;
|
||||
public List<singleStep> steps { get; set; }
|
||||
}
|
||||
|
||||
public class singleStep
|
||||
{
|
||||
public string id { get; set; } = "00";
|
||||
public string description { get; set; } = "00";
|
||||
public stepType action { get; set; } = stepType.checkDir;
|
||||
|
||||
public List<string> paramList { get; set; } = new List<string>();
|
||||
}
|
||||
|
||||
public enum stepType
|
||||
{
|
||||
checkDir,
|
||||
checkFile,
|
||||
createDir,
|
||||
delDir,
|
||||
delFile,
|
||||
downloadDir,
|
||||
downloadFile,
|
||||
uploadDir,
|
||||
uploadFile,
|
||||
listContent
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"server": "ftp.steamware.net",
|
||||
"user": "testftpuser",
|
||||
"password": "we4reFromB3rghem!",
|
||||
"rawCert": "",
|
||||
"skipCert": true,
|
||||
"steps": [
|
||||
{
|
||||
"id": "01",
|
||||
"description": "Test base directory",
|
||||
"action": "checkDir",
|
||||
"paramList": [
|
||||
"data/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "02",
|
||||
"description": "Create directory",
|
||||
"action": "createDir",
|
||||
"paramList": [
|
||||
"data/test_directory"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "03",
|
||||
"description": "Upload File",
|
||||
"action": "uploadFile",
|
||||
"paramList": [
|
||||
"data/test_directory/FileProva.txt",
|
||||
"test/FileProva.txt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "04",
|
||||
"description": "Browse Directory",
|
||||
"action": "listContent",
|
||||
"paramList": [
|
||||
"data/test_directory/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "05",
|
||||
"description": "Upload File",
|
||||
"action": "uploadFile",
|
||||
"paramList": [
|
||||
"data/test_directory/FileProva_02.txt",
|
||||
"test/FileProva.txt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "06",
|
||||
"description": "Browse Directory",
|
||||
"action": "listContent",
|
||||
"paramList": [
|
||||
"data/test_directory/"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "07",
|
||||
"description": "Download Directory",
|
||||
"action": "downloadDir",
|
||||
"paramList": [
|
||||
"data/test_directory/",
|
||||
"temp/mirror"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "08",
|
||||
"description": "Delete Remote Directory",
|
||||
"action": "delDir",
|
||||
"paramList": [
|
||||
"data/test_directory/"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="FluentFTP" version="41.0.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -0,0 +1 @@
|
||||
File di prova
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{35D95ED8-E48A-434D-A305-A83E48C8FC6F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>EgwProxy.Ftp</RootNamespace>
|
||||
<AssemblyName>EgwProxy.Ftp</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentFTP, Version=41.0.0.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentFTP.41.0.0\lib\net462\FluentFTP.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Manager.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,325 @@
|
||||
using FluentFTP;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Security;
|
||||
|
||||
namespace EgwProxy.Ftp
|
||||
{
|
||||
/// <summary>
|
||||
/// Client per operazioni FTP, basato su FluentFTP: https://github.com/robinrodricks/FluentFTP/wiki/Quick-Start-Example
|
||||
/// </summary>
|
||||
public class Manager
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione di oggetto per comunicazione FTP
|
||||
/// </summary>
|
||||
/// <param name="server"></param>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="passwd"></param>
|
||||
/// <param name="rawCert"></param>
|
||||
/// <param name="skipCert"></param>
|
||||
public Manager(string server, string userName, string passwd, string rawCert, bool skipCert)
|
||||
{
|
||||
_server = server;
|
||||
_userName = userName;
|
||||
_passwd = passwd;
|
||||
_skipCert = skipCert;
|
||||
_rawCert = rawCert;
|
||||
if (!string.IsNullOrEmpty(server))
|
||||
{
|
||||
// se ho user/pwd è autenticato...
|
||||
if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(passwd))
|
||||
{
|
||||
client = new FtpClient(server, userName, passwd);
|
||||
}
|
||||
//.. altrimenti anonimo...
|
||||
else
|
||||
{
|
||||
client = new FtpClient(server);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Creazione directory remota
|
||||
/// </summary>
|
||||
/// <param name="remoteDir">Nome directory remota da creare (ad es: @"/public_html/videos")</param>
|
||||
public bool createDir(string remoteDir)
|
||||
{
|
||||
tryConnect();
|
||||
// upload della folder + files, cancellazione extra files = mirroring
|
||||
bool answ = client.CreateDirectory(remoteDir);
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazionedirectory remota
|
||||
/// </summary>
|
||||
/// <param name="remoteDir">Nome directory remota da eliminare</param>
|
||||
public bool deleteDir(string remoteDir)
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
// Elimina folder
|
||||
client.DeleteDirectory(remoteDir);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eliminazionedirectory remota
|
||||
/// </summary>
|
||||
/// <param name="remoteFile">Nome file remoto da eliminare</param>
|
||||
public bool deleteFile(string remoteFile)
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
// Elimina folder
|
||||
client.DeleteFile(remoteFile);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica esistenza directory su server FTP remoto
|
||||
/// </summary>
|
||||
/// <param name="remotePath">Percorso remoto da testare (ad es "/htdocs/extras/")</param>
|
||||
/// <returns></returns>
|
||||
public bool dirExists(string remotePath)
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = client.DirectoryExists(remotePath);
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica esistenza file su server FTP remoto
|
||||
/// </summary>
|
||||
/// <param name="remotePath">Percorso remoto da testare (ad es "/htdocs/big2.txt")</param>
|
||||
/// <returns></returns>
|
||||
public bool fileExists(string remotePath)
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = client.FileExists(remotePath);
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scaricamento intera directory, modalità MIRROR
|
||||
/// </summary>
|
||||
/// <param name="dirPath">Path directory da inviare (ad es:@"C:\website\videos\")</param>
|
||||
/// <param name="remoteDir">Nome remoto file per caricamento (ad es: @"/public_html/videos")</param>
|
||||
public bool getDir(string dirPath, string remoteDir)
|
||||
{
|
||||
bool answ = false;
|
||||
tryConnect();
|
||||
try
|
||||
{
|
||||
// upload della folder + files, cancellazione extra files = mirroring
|
||||
var result = client.DownloadDirectory(dirPath, remoteDir, FtpFolderSyncMode.Mirror);
|
||||
answ = (result != null && result.Count > 0);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download singolo file
|
||||
/// </summary>
|
||||
/// <param name="fileName">Path locale del file da inviare (ad es: @"C:\MyVideo.mp4")</param>
|
||||
/// <param name="remoteName">NOme remoto file per caricamento (ad es: "/htdocs/MyVideo.mp4")</param>
|
||||
public bool getFile(string fileName, string remoteName)
|
||||
{
|
||||
bool answ = false;
|
||||
tryConnect();
|
||||
// effettuo caricamento puntuale
|
||||
var result = client.DownloadFile(fileName, remoteName);
|
||||
answ = result == FtpStatus.Success;
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mostra contenuto directory remota
|
||||
/// </summary>
|
||||
/// <param name="remoteDir">Nome directory remota da leggere (ad es: @"/public_html/videos")</param>
|
||||
/// <param name="recurse">Indica se fare search ricorsivo</param>
|
||||
public List<string> listDir(string remoteDir, bool recurse)
|
||||
{
|
||||
tryConnect();
|
||||
// upload della folder + files, cancellazione extra files = mirroring
|
||||
FtpListItem[] dirContent;
|
||||
if (recurse)
|
||||
{
|
||||
dirContent = client.GetListing(remoteDir, FtpListOption.Recursive);
|
||||
}
|
||||
else
|
||||
{
|
||||
dirContent = client.GetListing(remoteDir);
|
||||
}
|
||||
client.Disconnect();
|
||||
var answ = dirContent.Select(x => $"{x.Type} - {x.Name}").ToList();
|
||||
// chiudo!
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Caricamento intera directory, modalità MIRROR
|
||||
/// </summary>
|
||||
/// <param name="dirPath">Path directory da inviare (ad es:@"C:\website\videos\")</param>
|
||||
/// <param name="remoteDir">Nome remoto file per caricamento (ad es: @"/public_html/videos")</param>
|
||||
public bool sendDir(string dirPath, string remoteDir)
|
||||
{
|
||||
bool answ = false;
|
||||
tryConnect();
|
||||
// upload della folder + files, cancellazione extra files = mirroring
|
||||
var result = client.UploadDirectory(dirPath, remoteDir, FtpFolderSyncMode.Mirror);
|
||||
answ = (result != null && result.Count > 0);
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Caricamento singolo file
|
||||
/// </summary>
|
||||
/// <param name="fileName">Path locale del file da inviare (ad es: @"C:\MyVideo.mp4")</param>
|
||||
/// <param name="remoteName">NOme remoto file per caricamento (ad es: "/htdocs/MyVideo.mp4")</param>
|
||||
public bool sendFile(string fileName, string remoteName)
|
||||
{
|
||||
bool answ = false;
|
||||
tryConnect();
|
||||
// effettuo caricamento puntuale
|
||||
var result = client.UploadFile(fileName, remoteName);
|
||||
answ = result == FtpStatus.Success;
|
||||
// se insuccesso --> controllo se ci sia file...
|
||||
if (!answ)
|
||||
{
|
||||
answ = fileExists(remoteName);
|
||||
}
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica connessione con server FTP remoto
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool serverOk()
|
||||
{
|
||||
tryConnect();
|
||||
bool answ = client.IsConnected;
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce tipo server remoto
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string serverType()
|
||||
{
|
||||
tryConnect();
|
||||
FtpServer srvType = client.ServerType;
|
||||
// chiudo!
|
||||
client.Disconnect();
|
||||
return $"{srvType}";
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected bool _skipCert = false;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string _passwd { get; set; } = "";
|
||||
|
||||
protected string _rawCert { get; set; } = "";
|
||||
protected string _server { get; set; } = "";
|
||||
|
||||
protected string _userName { get; set; } = "";
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private FtpClient client { get; set; }
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void Client_ValidateCertificate(FluentFTP.Client.BaseClient.BaseFtpClient control, FtpSslValidationEventArgs e)
|
||||
{
|
||||
if (e.PolicyErrors == SslPolicyErrors.None || _skipCert || e.Certificate.GetRawCertDataString() == _rawCert)
|
||||
{
|
||||
e.Accept = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"{e.PolicyErrors}");
|
||||
Console.WriteLine($"Cert:{Environment.NewLine}{e.Certificate}");
|
||||
Console.WriteLine($"RawString:{Environment.NewLine}{e.Certificate.GetRawCertDataString()}");
|
||||
throw new Exception($"{e.PolicyErrors}{Environment.NewLine}{e.Certificate.GetRawCertDataString()}");
|
||||
}
|
||||
}
|
||||
|
||||
private void tryConnect()
|
||||
{
|
||||
// connect to the server and automatically detect working FTP settings
|
||||
if (!client.IsConnected)
|
||||
{
|
||||
var profiles = client.AutoDetect();
|
||||
#if false
|
||||
// if any profiles are found, print the code to the console
|
||||
if (profiles.Count > 0)
|
||||
{
|
||||
var code = profiles[0].ToCode();
|
||||
Console.WriteLine(code);
|
||||
}
|
||||
#endif
|
||||
client.ValidateCertificate += Client_ValidateCertificate;
|
||||
client.AutoConnect();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgwProxy.Ftp")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgwProxy.Ftp")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("35d95ed8-e48a-434d-a305-a83e48c8fc6f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"metadata": [
|
||||
{
|
||||
"src": [
|
||||
{
|
||||
"files": [
|
||||
"*.csproj",
|
||||
"*.vbproj"
|
||||
],
|
||||
"cwd": ".",
|
||||
"exclude": [
|
||||
"**/obj/**",
|
||||
"**/bin/**",
|
||||
"_site/**"
|
||||
]
|
||||
}
|
||||
],
|
||||
"dest": "obj/api"
|
||||
}
|
||||
],
|
||||
"build": {
|
||||
"content": [
|
||||
{
|
||||
"files": [
|
||||
"api/**.yml"
|
||||
],
|
||||
"cwd": "obj"
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"api/*.md",
|
||||
"articles/**.md",
|
||||
"toc.yml",
|
||||
"*.md"
|
||||
],
|
||||
"exclude": [
|
||||
"obj/**",
|
||||
"_site/**"
|
||||
]
|
||||
}
|
||||
],
|
||||
"resource": [
|
||||
{
|
||||
"files": [
|
||||
"images/**"
|
||||
],
|
||||
"exclude": [
|
||||
"obj/**",
|
||||
"_site/**"
|
||||
]
|
||||
}
|
||||
],
|
||||
"overwrite": [
|
||||
{
|
||||
"files": [
|
||||
"apidoc/**.md"
|
||||
],
|
||||
"exclude": [
|
||||
"obj/**",
|
||||
"_site/**"
|
||||
]
|
||||
}
|
||||
],
|
||||
"dest": "_site",
|
||||
"template": [
|
||||
"default"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
# EgwProxy.Ftp Library
|
||||
|
||||
Documentazione relativa alla libreria di interfaccia via FTP con server generici.
|
||||
|
||||
Disponibile in forma di pacchetto nuget sul repo aziendale nexus.steamware.net: i pacchetti sono disponibili all'indirizzo
|
||||
|
||||
https://nexus.steamware.net/#browse/browse:nuget-hosted
|
||||
|
||||
Vedere la sezione Articles per maggiori informazioni sulle definizioni, l'impiego ed esempi.
|
||||
|
||||
## Articles
|
||||
|
||||
Per maggiori dettagli, definizioni e demo funzionamento si rimanda alla sezione Articles
|
||||
|
||||
## Api
|
||||
|
||||
Per ogni dettaglio e riferimento alla libreria si rimanda alla sezione Api Documentation
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="FluentFTP" version="41.0.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
- name: Articles
|
||||
href: articles/
|
||||
- name: API Documentation
|
||||
href: obj/api/
|
||||
homepage: api/index.md
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<connectionStrings>
|
||||
<add name="EntrataFrontiera" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
<add name="ExportIcoel" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
<add name="TrackerLotti" connectionString="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
<add name="SyncState" connectionString="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,132 @@
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
/*------------------------------------------------
|
||||
* Aggiunto fix come da link seguente:
|
||||
*
|
||||
* https://stackoverflow.com/questions/14033193/entity-framework-provider-type-could-not-be-loaded
|
||||
*
|
||||
* I solved this by adding an using stament on top of my DBContext class, like so:
|
||||
* using SqlProviderServices= System.Data.Entity.SqlServer.SqlProviderServices;
|
||||
*
|
||||
*/
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller accesso dati DB vari x ICOEL
|
||||
/// </summary>
|
||||
public class DbController : IDisposable
|
||||
{
|
||||
#if false
|
||||
private static EntrataDbContext dbEntrataCtx;
|
||||
private static ExportDbContext dbExportCtx;
|
||||
private static TrackerDbContext dbTrackerCtx;
|
||||
#endif
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Avvio dell'oggetto gestione DB con stringa di connessione specifica
|
||||
/// </summary>
|
||||
/// <param name="connSyncState">Connessione DB locale di SYNC</param>
|
||||
public DbController(string connSyncState)
|
||||
{
|
||||
dbSyncStateCtx = new SyncStateDbContext(connSyncState);
|
||||
Log.Info("Avviata classe dbSyncStateCtx");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Recupera la tab di CurrData corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.CurrDataModel> CurrDataGetAll()
|
||||
{
|
||||
List<DatabaseModels.CurrDataModel> dbResult = new List<DatabaseModels.CurrDataModel>();
|
||||
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetCurrData
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose classe
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
#if false
|
||||
dbEntrataCtx.Dispose();
|
||||
dbExportCtx.Dispose();
|
||||
dbTrackerCtx.Dispose();
|
||||
#endif
|
||||
dbSyncStateCtx.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue una volta la stored di ImportAll (x recupero dati da DB esterni) e poi
|
||||
/// restitusice in output la tab di SyncState x verificare lo stato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.SyncStateModel> SyncStateDoExportAll()
|
||||
{
|
||||
List<DatabaseModels.SyncStateModel> dbResult = new List<DatabaseModels.SyncStateModel>();
|
||||
|
||||
dbResult = dbSyncStateCtx
|
||||
.Database
|
||||
.SqlQuery<DatabaseModels.SyncStateModel>("EXEC stp_ExportAll")
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue una volta la stored di ImportAll (x recupero dati da DB esterni) e poi
|
||||
/// restitusice in output la tab di SyncState x verificare lo stato
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.SyncStateModel> SyncStateDoImportAll()
|
||||
{
|
||||
List<DatabaseModels.SyncStateModel> dbResult = new List<DatabaseModels.SyncStateModel>();
|
||||
|
||||
dbResult = dbSyncStateCtx
|
||||
.Database
|
||||
.SqlQuery<DatabaseModels.SyncStateModel>("EXEC stp_ImportAll")
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// recupera la tab di SyncState corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.SyncStateModel> SyncStateGetAll()
|
||||
{
|
||||
List<DatabaseModels.SyncStateModel> dbResult = new List<DatabaseModels.SyncStateModel>();
|
||||
|
||||
dbResult = dbSyncStateCtx
|
||||
.DbSetSyncState
|
||||
.ToList();
|
||||
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static SyncStateDbContext dbSyncStateCtx;
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.Spatial;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer.DatabaseModels
|
||||
{
|
||||
|
||||
[Table("CurrData")]
|
||||
public partial class CurrDataModel
|
||||
{
|
||||
[Key]
|
||||
[StringLength(50)]
|
||||
public string Topic { get; set; }
|
||||
|
||||
public decimal CurrVal { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.Spatial;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer.DatabaseModels
|
||||
{
|
||||
|
||||
[Table("DettagliConferimentoMES")]
|
||||
public partial class DettConferimentoModel
|
||||
{
|
||||
[Key]
|
||||
[Column(Order = 0)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public long PackId { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 1)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public long FillingId { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 2)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public int FilligRow { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 3)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public long ScaricoId { get; set; }
|
||||
|
||||
public string CODBARRE { get; set; }
|
||||
|
||||
public string CODICE_FORNITORE { get; set; }
|
||||
|
||||
public string NOME_FORNITORE { get; set; }
|
||||
|
||||
public string CODICE_PRODOTTO { get; set; }
|
||||
|
||||
public string DESCRIZIONE_PRODOTTO { get; set; }
|
||||
|
||||
public string CODICE_PRODOTTO_GREZZO { get; set; }
|
||||
|
||||
public string DESCRIZIONE_PRODOTTO_GREZZO { get; set; }
|
||||
|
||||
public string SIGLA_LOTTO { get; set; }
|
||||
|
||||
public string NUMERO_LOTTO { get; set; }
|
||||
|
||||
public string DATA_ENTRATA { get; set; }
|
||||
|
||||
public string QUANTITA_ENTRATA { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.Spatial;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer.DatabaseModels
|
||||
{
|
||||
|
||||
[Table("DettagliConfezioniMES")]
|
||||
public partial class DettConfezioniModel
|
||||
{
|
||||
[Key]
|
||||
[Column("Pack Id", Order = 0)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public long Pack_Id { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string EAN { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column("Batch Id", Order = 1)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public long Batch_Id { get; set; }
|
||||
|
||||
public string BatchName { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 2)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public int Lane1SizerBatchId { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 3)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public int Lane2SizerBatchId { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column("End Time", Order = 4, TypeName = "datetime2")]
|
||||
public DateTime End_Time { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 5)]
|
||||
public Guid SizerProductGUID { get; set; }
|
||||
|
||||
[Column("Product Name")]
|
||||
public string Product_Name { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 6)]
|
||||
public Guid SizerPackGUID { get; set; }
|
||||
|
||||
[Column("Pack Name")]
|
||||
[StringLength(50)]
|
||||
public string Pack_Name { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 7)]
|
||||
public decimal PesoDecigram { get; set; }
|
||||
|
||||
[StringLength(10)]
|
||||
public string FillingMode { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 8)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.Spatial;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer.DatabaseModels
|
||||
{
|
||||
|
||||
[Table("ENTRATACILIEGIE")]
|
||||
public partial class EntrataModel
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public long ID_CHIAVE { get; set; }
|
||||
|
||||
[StringLength(20)]
|
||||
public string CODBARRE { get; set; }
|
||||
|
||||
public double? CODICE_FORNITORE { get; set; }
|
||||
|
||||
[StringLength(5)]
|
||||
public string CODICE_LUOGO_PRODUZIONE { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string NOME_FORNITORE { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string INDIRIZZO_FORNITORE { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string COMUNE_FORNITORE { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string NOME_LUOGO_PRODUZIONE { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string INDIRIZZO_LUOGO_PRODUZIONE { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string COMUNE_LUOGO_PRODUZIONE { get; set; }
|
||||
|
||||
[StringLength(10)]
|
||||
public string CODICE_PRODOTTO { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string DESCRIZIONE_PRODOTTO { get; set; }
|
||||
|
||||
[StringLength(10)]
|
||||
public string CODICE_PRODOTTO_GREZZO { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string DESCRIZIONE_PRODOTTO_GREZZO { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
public string SIGLA_LOTTO { get; set; }
|
||||
|
||||
[StringLength(10)]
|
||||
public string NUMERO_LOTTO { get; set; }
|
||||
|
||||
[Column(TypeName = "datetime2")]
|
||||
public DateTime? DATA_ENTRATA { get; set; }
|
||||
|
||||
public double? QUANTITA_ENTRATA { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.Spatial;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer.DatabaseModels
|
||||
{
|
||||
|
||||
[Table("ProductsTotals")]
|
||||
public partial class ProductsTotalsModel
|
||||
{
|
||||
[Key]
|
||||
[Column(Order = 0)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public int SizerBatchId { get; set; }
|
||||
|
||||
[Key]
|
||||
[Column(Order = 1)]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public int Index { get; set; }
|
||||
|
||||
public string Nome { get; set; }
|
||||
|
||||
public string Qualities { get; set; }
|
||||
|
||||
public string Grado { get; set; }
|
||||
|
||||
public string Calibro { get; set; }
|
||||
|
||||
public int NumeroFrutti { get; set; }
|
||||
|
||||
public string Decigrammi { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.Spatial;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer.DatabaseModels
|
||||
{
|
||||
|
||||
[Table("SyncState")]
|
||||
public partial class SyncStateModel
|
||||
{
|
||||
[Key]
|
||||
[StringLength(50)]
|
||||
public string TableName { get; set; }
|
||||
|
||||
public long LastIdx { get; set; }
|
||||
|
||||
public long LastIdxIn { get; set; }
|
||||
|
||||
public long LastIdxOut { get; set; }
|
||||
|
||||
public long NumRec { get; set; }
|
||||
|
||||
public long NumRecIn { get; set; }
|
||||
|
||||
public long NumRecOut { get; set; }
|
||||
|
||||
public DateTime LastUpdate { get; set; } = DateTime.Today;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer
|
||||
{
|
||||
public static class DbConfig
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static string DATABASE_NAME = "EgtBwDb";
|
||||
|
||||
public static int DATABASE_PROCESS_TIMEOUT = 5;
|
||||
public static string DATABASE_PWD = "viacremasca";
|
||||
|
||||
// Database config
|
||||
public static string DATABASE_SERV = "127.0.0.1";
|
||||
|
||||
public static string DATABASE_USER = "EgtUser";
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// DB Connection string per azioni amministrative
|
||||
/// </summary>
|
||||
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// DB Connection string
|
||||
/// </summary>
|
||||
public static string CONNECTION_STRING { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <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";
|
||||
}
|
||||
|
||||
#if false
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{E36544CB-D699-48D8-9F81-C2758E7C7D19}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>EgwProxy.Icoel.DataLayer</RootNamespace>
|
||||
<AssemblyName>EgwProxy.Icoel.DataLayer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Azure.Core, Version=1.6.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Core.1.6.0\lib\net461\Azure.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Azure.Identity, Version=1.3.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Azure.Identity.1.3.0\lib\netstandard2.0\Azure.Identity.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>
|
||||
</Reference>
|
||||
<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="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.SqlClient, Version=4.1.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Data.SqlClient.4.1.1\lib\net461\Microsoft.Data.SqlClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Identity.Client, Version=4.22.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.4.22.0\lib\net461\Microsoft.Identity.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Identity.Client.Extensions.Msal, Version=2.16.5.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.Extensions.Msal.2.16.5\lib\net45\Microsoft.Identity.Client.Extensions.Msal.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.6.8.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Logging, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Logging.6.8.0\lib\net461\Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Protocols, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.6.8.0\lib\net461\Microsoft.IdentityModel.Protocols.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.6.8.0\lib\net461\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Tokens, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.9\lib\net45\NLog.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.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Configuration.ConfigurationManager, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Configuration.ConfigurationManager.5.0.0\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.OracleClient" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IdentityModel" />
|
||||
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=6.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.6.8.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.1.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net" />
|
||||
<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=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Security.AccessControl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.AccessControl.5.0.0\lib\net461\System.Security.AccessControl.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.ProtectedData, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.ProtectedData.4.5.0\lib\net461\System.Security.Cryptography.ProtectedData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Permissions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Permissions.5.0.0\lib\net461\System.Security.Permissions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Text.Encodings.Web, Version=4.0.5.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.4.6.0\lib\net461\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controllers\DbController.cs" />
|
||||
<Compile Include="DatabaseModels\EntrataModel.cs" />
|
||||
<Compile Include="DatabaseModels\DettConferimentoModel.cs" />
|
||||
<Compile Include="DatabaseModels\DettConfezioniModel.cs" />
|
||||
<Compile Include="DatabaseModels\CurrDataModel.cs" />
|
||||
<Compile Include="EntrataDbContext.cs" />
|
||||
<Compile Include="ExportDbContext.cs" />
|
||||
<Compile Include="DatabaseModels\ProductsTotalsModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="DatabaseModels\SyncStateModel.cs" />
|
||||
<Compile Include="SyncStateDbContext.cs" />
|
||||
<Compile Include="TrackerDbContext.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.4.0.1\build\net46\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.4.0.1\build\net46\Microsoft.Data.SqlClient.SNI.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.4.0.1\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.4.0.1\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
|
||||
</Project>
|
||||
@@ -0,0 +1,46 @@
|
||||
using EgwProxy.Icoel.DataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using SqlProviderServices = System.Data.Entity.SqlServer.SqlProviderServices;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe per accesso dati accettazione merce Agrimatica (via ICOEL)
|
||||
/// </summary>
|
||||
public partial class EntrataDbContext : DbContext
|
||||
{
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore implicito
|
||||
/// </summary>
|
||||
public EntrataDbContext() : base("name=EntrataFrontiera")
|
||||
{
|
||||
Log.Info("Init 01 EntrataDbContext - DONE");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore da connectionString
|
||||
/// </summary>
|
||||
/// <param name="connectionString"></param>
|
||||
public EntrataDbContext(string connectionString) : base(connectionString)
|
||||
{
|
||||
Log.Info("Init 02 EntrataDbContext - DONE");
|
||||
}
|
||||
/// <summary>
|
||||
/// DbSet record entrata merce
|
||||
/// </summary>
|
||||
public virtual DbSet<EntrataModel> DbSetEntrataMerce { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<EntrataModel>()
|
||||
.Property(e => e.DATA_ENTRATA)
|
||||
.HasPrecision(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using EgwProxy.Icoel.DataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using SqlProviderServices = System.Data.Entity.SqlServer.SqlProviderServices;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe per accesso dati Tacker ICOEL
|
||||
/// </summary>
|
||||
public partial class ExportDbContext : DbContext
|
||||
{
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore implicito
|
||||
/// </summary>
|
||||
public ExportDbContext() : base("name=ExportIcoel")
|
||||
{
|
||||
Log.Info("Init 01 ExportDbContext - DONE");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore da connectionString
|
||||
/// </summary>
|
||||
/// <param name="connectionString"></param>
|
||||
public ExportDbContext(string connectionString) : base(connectionString)
|
||||
{
|
||||
Log.Info("Init 02 ExportDbContext - DONE");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DbSet dati prodotti
|
||||
/// </summary>
|
||||
public virtual DbSet<ProductsTotalsModel> DbSetProductsTotals { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer
|
||||
{
|
||||
public class MainDbContext : DbContext
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
// Il contesto è stato configurato per utilizzare una stringa di connessione 'BBMModel' dal file di configurazione
|
||||
// dell'applicazione (App.config o Web.config). Per impostazione predefinita, la stringa di connessione è destinata al
|
||||
// database 'BBMModel' nell'istanza di LocalDb.
|
||||
//
|
||||
// Per destinarla a un database o un provider di database differente, modificare la stringa di connessione 'BBMModel'
|
||||
// nel file di configurazione dell'applicazione.
|
||||
[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("BBMModel")
|
||||
public MainDbContext() : base("Data Source=SQLSTEAM;Initial Catalog=SHERPA.BBM;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=EntityFramework")
|
||||
{
|
||||
}
|
||||
|
||||
public MainDbContext(string connectionString) : base(connectionString)
|
||||
{
|
||||
Log.Info($"init MainDbContext - start");
|
||||
|
||||
try
|
||||
{
|
||||
Database.CreateIfNotExists();
|
||||
Log.Error("CreateIfNotExists - DONE");
|
||||
|
||||
//Database.SetInitializer(new MigrateDatabaseToLatestVersion<StratonLocalizerDatabase, Migrations.Configuration>());
|
||||
Database.SetInitializer<MainDbContext>(null);
|
||||
Database.Initialize(false);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione in fase init MainDbContext, connectionString: {connectionString}{Environment.NewLine}{exc}");
|
||||
}
|
||||
Log.Error("init MainDbContext - DONE");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
// Aggiungere DbSet per ogni tipo di entità che si desidera includere nel modello. Per ulteriori informazioni
|
||||
// sulla configurazione e sull'utilizzo di un modello Code, vedere http://go.microsoft.com/fwlink/?LinkId=390109.
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public virtual DbSet<DatabaseModels.BasketsModel> DbSetBaskets { get; set; }
|
||||
public virtual DbSet<DatabaseModels.CompanyModel> DbSetCompanies { get; set; }
|
||||
public virtual DbSet<DatabaseModels.FluxCountersModel> DbSetCounters { get; set; }
|
||||
public virtual DbSet<DatabaseModels.CustomersModel> DbSetCustomers { get; set; }
|
||||
public virtual DbSet<DatabaseModels.DocsModel> DbSetDocs { get; set; }
|
||||
|
||||
public virtual DbSet<DatabaseModels.Fatt2DocModel> DbSetFatt2Doc { get; set; }
|
||||
|
||||
public virtual DbSet<DatabaseModels.ItemsModel> DbSetItems { get; set; }
|
||||
|
||||
public virtual DbSet<DatabaseModels.NegotiationsModel> DbSetNegotiations { get; set; }
|
||||
|
||||
public virtual DbSet<DatabaseModels.ResourcesModel> DbSetResources { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
// Precision attribute for decimals
|
||||
Precision.ConfigureModelBuilder(modelBuilder);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Le informazioni generali relative a un assembly sono controllate dal seguente
|
||||
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
|
||||
// associate a un assembly.
|
||||
[assembly: AssemblyTitle("EgwProxy.Icoel.DataLayer")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgwProxy.Icoel.DataLayer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
|
||||
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
|
||||
// COM, impostare su true l'attributo ComVisible per tale tipo.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
|
||||
[assembly: Guid("e36544cb-d699-48d8-9f81-c2758e7c7d19")]
|
||||
|
||||
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
|
||||
//
|
||||
// Versione principale
|
||||
// Versione secondaria
|
||||
// Numero di build
|
||||
// Revisione
|
||||
//
|
||||
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
|
||||
// usando l'asterisco '*' come illustrato di seguito:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,48 @@
|
||||
using EgwProxy.Icoel.DataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe per accesso dati SyncState del DB
|
||||
/// </summary>
|
||||
public partial class SyncStateDbContext : DbContext
|
||||
{
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore implicito
|
||||
/// </summary>
|
||||
public SyncStateDbContext() : base("name=SyncState")
|
||||
{
|
||||
Log.Info("Init 01 SyncStateDbContext - DONE");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore da connectionString
|
||||
/// </summary>
|
||||
/// <param name="connectionString"></param>
|
||||
public SyncStateDbContext(string connectionString) : base(connectionString)
|
||||
{
|
||||
Log.Info("Init 02 SyncStateDbContext - DONE");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DbSet dei dati stato sync DB esterni <--> locale
|
||||
/// </summary>
|
||||
public virtual DbSet<SyncStateModel> DbSetSyncState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DbSet CurrData
|
||||
/// </summary>
|
||||
public virtual DbSet<CurrDataModel> DbSetCurrData { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using EgwProxy.Icoel.DataLayer.DatabaseModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using SqlProviderServices = System.Data.Entity.SqlServer.SqlProviderServices;
|
||||
|
||||
namespace EgwProxy.Icoel.DataLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe per accesso dati Tacker ICOEL
|
||||
/// </summary>
|
||||
public partial class TrackerDbContext : DbContext
|
||||
{
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore implicito
|
||||
/// </summary>
|
||||
public TrackerDbContext() : base("name=TrackerLotti")
|
||||
{
|
||||
Log.Info("Init 01 TrackerDbContext - DONE");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Costruttore da connectionString
|
||||
/// </summary>
|
||||
/// <param name="connectionString"></param>
|
||||
public TrackerDbContext(string connectionString) : base(connectionString)
|
||||
{
|
||||
Log.Info("Init 02 TrackerDbContext - DONE");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DbSet dai dati conferimento <--> pack di uscita
|
||||
/// </summary>
|
||||
public virtual DbSet<DettConferimentoModel> DbSetConferimento { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DbSet dai dati conferimento <--> confezioni
|
||||
/// </summary>
|
||||
public virtual DbSet<DettConfezioniModel> DbSetConfezioni { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Azure.Core" version="1.6.0" targetFramework="net462" />
|
||||
<package id="Azure.Identity" version="1.3.0" targetFramework="net462" />
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net462" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Data.SqlClient" version="4.1.1" targetFramework="net462" />
|
||||
<package id="Microsoft.Data.SqlClient.SNI" version="4.0.1" targetFramework="net462" />
|
||||
<package id="Microsoft.Identity.Client" version="4.22.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Identity.Client.Extensions.Msal" version="2.16.5" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.JsonWebTokens" version="6.8.0" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.Logging" version="6.8.0" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.Protocols" version="6.8.0" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.8.0" targetFramework="net462" />
|
||||
<package id="Microsoft.IdentityModel.Tokens" version="6.8.0" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.9" targetFramework="net462" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
|
||||
<package id="System.Configuration.ConfigurationManager" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.IdentityModel.Tokens.Jwt" version="6.8.0" targetFramework="net462" />
|
||||
<package id="System.IO" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.IO.Compression" version="4.1.0" targetFramework="net462" />
|
||||
<package id="System.Memory" version="4.5.4" targetFramework="net462" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Security.AccessControl" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net462" />
|
||||
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Security.Cryptography.ProtectedData" version="4.5.0" targetFramework="net462" />
|
||||
<package id="System.Security.Permissions" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Text.Encodings.Web" version="4.7.2" targetFramework="net462" />
|
||||
<package id="System.Text.Json" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net462" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -11,6 +11,10 @@
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.Icoel EgwProxy Icoel</tags>
|
||||
<dependencies>
|
||||
<dependency id="NLog" version="4.7.9" />
|
||||
<dependency id="EntityFramework" version="6.4.4" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.Icoel\bin\Debug\EgwProxy*.dll" target="lib" />
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.Icoel EgwProxy Icoel</tags>
|
||||
<dependencies>
|
||||
<dependency id="NLog" version="4.7.9" />
|
||||
<dependency id="EntityFramework" version="6.4.4" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwProxy.Icoel\bin\Release\EgwProxy*.dll" target="lib" />
|
||||
|
||||
@@ -1,24 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.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>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<appSettings>
|
||||
<add key="IndirizzoIpSizer" value="192.168.137.50" />
|
||||
<add key="SizerTcpPort" value="8001" />
|
||||
<add key="EntrataFrontiera" value="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
<add key="ExportIcoel" value="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
<add key="TrackerLotti" value="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
<add key="SyncState" value="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" />
|
||||
</appSettings>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<netNamedPipeBinding>
|
||||
<binding name="NetNamedPipeBinding_ISizerService">
|
||||
<security mode="None"/>
|
||||
<security mode="None" />
|
||||
</binding>
|
||||
</netNamedPipeBinding>
|
||||
<wsHttpBinding>
|
||||
<binding name="WSHttpBinding_ISizerService" maxReceivedMessageSize="2147483647">
|
||||
<security mode="None"/>
|
||||
<security mode="None" />
|
||||
</binding>
|
||||
</wsHttpBinding>
|
||||
</bindings>
|
||||
<client>
|
||||
<endpoint address="http://localhost:8001/SizerService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISizerService" contract="SizerService.ISizerService" name="WSHttpBinding_ISizerService"/>
|
||||
<endpoint address="net.pipe://localhost/Compac/8001/SizerService" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ISizerService" contract="SizerService.ISizerService" name="NetNamedPipeBinding_ISizerService"/>
|
||||
<endpoint address="http://localhost:8001/SizerService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISizerService" contract="SizerService.ISizerService" name="WSHttpBinding_ISizerService" />
|
||||
<endpoint address="net.pipe://localhost/Compac/8001/SizerService" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ISizerService" contract="SizerService.ISizerService" name="NetNamedPipeBinding_ISizerService" />
|
||||
</client>
|
||||
</system.serviceModel>
|
||||
<!--
|
||||
<connectionStrings>
|
||||
<add name="EntrataFrontiera" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
<add name="ExportIcoel" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
<add name="TrackerLotti" connectionString="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
<add name="SyncState" connectionString="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=IOB-WIN-NEXT" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
-->
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
||||
@@ -34,7 +34,11 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.1.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -43,9 +47,6 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="INI\BatchDetails.cs" />
|
||||
<Compile Include="INI\IniFileCs.cs" />
|
||||
<Compile Include="INI\Settaggi.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
@@ -57,8 +58,16 @@
|
||||
<None Include="conf.ini">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="INI\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwProxy.Icoel.DataLayer\EgwProxy.Icoel.DataLayer.csproj">
|
||||
<Project>{e36544cb-d699-48d8-9f81-c2758e7c7d19}</Project>
|
||||
<Name>EgwProxy.Icoel.DataLayer</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\EgwProxy.Icoel\EgwProxy.Icoel.csproj">
|
||||
<Project>{c45f5e6e-866b-4a34-a598-29aab2d178ad}</Project>
|
||||
<Name>EgwProxy.Icoel</Name>
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
using EgwProxy.Icoel.SizerService;
|
||||
using EgwProxy.Icoel.Test.INI;
|
||||
using EgwProxy.Icoel.DataLayer.DatabaseModels;
|
||||
using EgwProxy.Icoel.SizerService;
|
||||
//using EgwProxy.Icoel.Test.INI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace EgwProxy.Icoel.Test
|
||||
{
|
||||
@@ -9,6 +12,33 @@ namespace EgwProxy.Icoel.Test
|
||||
{
|
||||
#region Internal Methods
|
||||
|
||||
/// <summary>
|
||||
/// Mostra tutte le metriche di performance ricevute
|
||||
/// </summary>
|
||||
/// <param name="perfMeter"></param>
|
||||
internal static void DisplayPerfMeter(Dictionary<string, double> perfMeter)
|
||||
{
|
||||
// mostra tutti i parametri rilevati...
|
||||
foreach (var item in perfMeter)
|
||||
{
|
||||
Console.WriteLine($"{item.Key} | {item.Value:N2}");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Mostra tutte le metriche di performance ricevute
|
||||
/// </summary>
|
||||
/// <param name="currData"></param>
|
||||
internal static void DisplayCurrBatch(Dictionary<string, string> currData)
|
||||
{
|
||||
// mostra tutti i parametri rilevati...
|
||||
foreach (var item in currData)
|
||||
{
|
||||
Console.WriteLine($"{item.Key} | {item.Value}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Generazione di una list di info sui dati variety
|
||||
/// </summary>
|
||||
@@ -162,7 +192,7 @@ namespace EgwProxy.Icoel.Test
|
||||
/// </summary>
|
||||
/// <param name="layoutList"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private static void DisplayLayout(Layout[] layoutList)
|
||||
internal static void DisplayLayout(Layout[] layoutList)
|
||||
{
|
||||
foreach (var layout in layoutList)
|
||||
{
|
||||
@@ -175,6 +205,26 @@ namespace EgwProxy.Icoel.Test
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// legge conf in formato stringa
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
protected static string ReadSetting(string key)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = $"{ConfigurationManager.AppSettings[key]}" ?? "";
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.Write("Eccezione in ReadSettings");
|
||||
Console.Write(exc.Message);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Programma principale
|
||||
/// </summary>
|
||||
@@ -183,15 +233,67 @@ namespace EgwProxy.Icoel.Test
|
||||
{
|
||||
// leggo conf da file ini (ip/port)
|
||||
Console.WriteLine("Loading Files...");
|
||||
Settaggi setup = new Settaggi();
|
||||
setup.Load();
|
||||
string userInput = "";
|
||||
// oggetto x connessione
|
||||
Connector IcoelSizer = new Connector(setup.IndirizzoIpSizer, setup.TcpPortSizerClient);
|
||||
|
||||
Console.WriteLine("------------ Test DB ------------");
|
||||
EgwProxy.Icoel.DbProxy dbProxy = new DbProxy(ReadSetting("SyncState"));
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("--- SyncState ---");
|
||||
bool needRedo = true;
|
||||
int numTry = 1;
|
||||
//int numTry = 3;
|
||||
var elencoSyncState = dbProxy.DataController.SyncStateGetAll();
|
||||
while (needRedo && numTry >= 0)
|
||||
{
|
||||
Console.WriteLine(" --- PRE --- ");
|
||||
if (elencoSyncState != null)
|
||||
{
|
||||
foreach (var item in elencoSyncState)
|
||||
{
|
||||
Console.WriteLine($"TAB: {item.TableName} | IdxIN / IdxLocal {item.LastIdxIn} / {item.LastIdx} | NumIn / NumLocal {item.NumRecIn} / {item.NumRec}");
|
||||
// verifico se serva redo..
|
||||
}
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
Console.ReadKey();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
elencoSyncState = dbProxy.DataController.SyncStateDoImportAll();
|
||||
sw.Stop();
|
||||
Console.WriteLine($" process time: {sw.ElapsedMilliseconds} ms ");
|
||||
Console.WriteLine(" --- POST --- ");
|
||||
if (elencoSyncState != null)
|
||||
{
|
||||
foreach (var item in elencoSyncState)
|
||||
{
|
||||
Console.WriteLine($"TAB: {item.TableName} | IdxIN / IdxLocal {item.LastIdxIn} / {item.LastIdx} | NumIn / NumLocal {item.NumRecIn} / {item.NumRec}");
|
||||
// verifico se serva redo..
|
||||
}
|
||||
}
|
||||
// processo
|
||||
needRedo = testNeedRedo(elencoSyncState);
|
||||
numTry--;
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
Console.ReadKey();
|
||||
|
||||
// oggetto x connessione al sizer icoel
|
||||
Connector IcoelSizer = new Connector(ReadSetting("IndirizzoIpSizer"), ReadSetting("SizerTcpPort"));
|
||||
//Connector IcoelSizer = new Connector(setup.IndirizzoIpSizer, setup.SizerTcpPort);
|
||||
|
||||
Console.WriteLine("------------ Parametri CurrBatch rilevati ------------");
|
||||
var cBatch = IcoelSizer.GetCurrBatchData();
|
||||
if (cBatch != null)
|
||||
{
|
||||
DisplayCurrBatch(cBatch);
|
||||
}
|
||||
|
||||
// ora effettua un pò di letture/scritture
|
||||
try
|
||||
{
|
||||
|
||||
Console.WriteLine("------------ TUTTE variety ------------");
|
||||
var varList = IcoelSizer.GetVarietyList(false);
|
||||
var varietyData = IcoelSizer.GetLayoutForVarietyList(varList);
|
||||
@@ -203,6 +305,17 @@ namespace EgwProxy.Icoel.Test
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
userInput = Console.ReadLine();
|
||||
|
||||
|
||||
Console.WriteLine("------------ Parametri velocità rilevati ------------");
|
||||
var perfMeter = IcoelSizer.GetPerfMeters();
|
||||
if (perfMeter != null)
|
||||
{
|
||||
DisplayPerfMeter(perfMeter);
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Premere un tasto x continuare...");
|
||||
userInput = Console.ReadLine();
|
||||
|
||||
// solo attive
|
||||
Console.WriteLine("------------ solo attive ------------");
|
||||
varList = IcoelSizer.GetVarietyList();
|
||||
@@ -234,8 +347,12 @@ namespace EgwProxy.Icoel.Test
|
||||
GrowerInfo GrowerData = new GrowerInfo();
|
||||
IcoelSizer.EnqueueBatch(GrowerData, varGuid, layGuid);
|
||||
|
||||
IcoelSizer.GetCurrentBatch();
|
||||
|
||||
currBatch = IcoelSizer.GetCurrentBatch();
|
||||
foreach (var item in currBatch)
|
||||
{
|
||||
string lato = item.Key == 1 ? "SX" : "DX";
|
||||
Console.WriteLine($"[{item.Key}-{lato}] Grower code: {item.Value.GrowerCode} | Layout Name: {item.Value.LayoutName} | Totalling: [{item.Value.TotallingVarietyCode}] {item.Value.TotallingVariety} | Sizing: {item.Value.SizingProfileName} | Start {item.Value.StartTime} | End {item.Value.EndTime}");
|
||||
}
|
||||
Console.WriteLine("Test completato");
|
||||
Console.WriteLine("Premere un tasto x chiudere");
|
||||
Console.ReadKey();
|
||||
@@ -246,6 +363,22 @@ namespace EgwProxy.Icoel.Test
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifico necessità di rifare sync
|
||||
/// </summary>
|
||||
/// <param name="elencoSyncState"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private static bool testNeedRedo(List<SyncStateModel> elencoSyncState)
|
||||
{
|
||||
bool answ = false;
|
||||
foreach (var item in elencoSyncState)
|
||||
{
|
||||
answ = answ || (item.NumRecIn > item.NumRec || item.LastIdxIn > item.LastIdx);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="System.IO.Compression" version="4.1.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Icoel", "EgwProxy.
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Icoel.Test", "EgwProxy.Icoel.Test\EgwProxy.Icoel.Test.csproj", "{A655A6AC-5997-46F9-9752-8C621B80516C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Icoel.DataLayer", "EgwProxy.Icoel.DataLayer\EgwProxy.Icoel.DataLayer.csproj", "{E36544CB-D699-48D8-9F81-C2758E7C7D19}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -21,6 +23,10 @@ Global
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A655A6AC-5997-46F9-9752-8C621B80516C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E36544CB-D699-48D8-9F81-C2758E7C7D19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E36544CB-D699-48D8-9F81-C2758E7C7D19}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E36544CB-D699-48D8-9F81-C2758E7C7D19}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E36544CB-D699-48D8-9F81-C2758E7C7D19}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
+62
-23
@@ -1,24 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
|
||||
</startup>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<netNamedPipeBinding>
|
||||
<binding name="NetNamedPipeBinding_ISizerService">
|
||||
<security mode="None"/>
|
||||
</binding>
|
||||
</netNamedPipeBinding>
|
||||
<wsHttpBinding>
|
||||
<binding name="WSHttpBinding_ISizerService" maxReceivedMessageSize="2147483647">
|
||||
<security mode="None"/>
|
||||
</binding>
|
||||
</wsHttpBinding>
|
||||
</bindings>
|
||||
<client>
|
||||
<endpoint address="http://localhost:8001/SizerService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISizerService" contract="SizerService.ISizerService" name="WSHttpBinding_ISizerService"/>
|
||||
<endpoint address="net.pipe://localhost/Compac/8001/SizerService" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ISizerService" contract="SizerService.ISizerService" name="NetNamedPipeBinding_ISizerService"/>
|
||||
</client>
|
||||
</system.serviceModel>
|
||||
</configuration>
|
||||
<configSections>
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<netNamedPipeBinding>
|
||||
<binding name="NetNamedPipeBinding_ISizerService">
|
||||
<security mode="None" />
|
||||
</binding>
|
||||
</netNamedPipeBinding>
|
||||
<wsHttpBinding>
|
||||
<binding name="WSHttpBinding_ISizerService" maxReceivedMessageSize="2147483647">
|
||||
<security mode="None" />
|
||||
</binding>
|
||||
</wsHttpBinding>
|
||||
</bindings>
|
||||
<client>
|
||||
<endpoint address="http://localhost:8001/SizerService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISizerService" contract="SizerService.ISizerService" name="WSHttpBinding_ISizerService" />
|
||||
<endpoint address="net.pipe://localhost/Compac/8001/SizerService" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ISizerService" contract="SizerService.ISizerService" name="NetNamedPipeBinding_ISizerService" />
|
||||
</client>
|
||||
</system.serviceModel>
|
||||
<entityFramework>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<connectionStrings>
|
||||
<add name="EntrataFrontiera" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,107 @@
|
||||
# Appunti impiego connesisoni ICOEL
|
||||
|
||||
## Icoel SOAP
|
||||
|
||||
Oltre ai metodi legati al batch, ci sono questi metodi x recuperare informazioni specifiche di produttività
|
||||
|
||||
| Metodo | Descrizione |
|
||||
| ---------- | ---------- |
|
||||
| GetMachineTonnesPH() | valore tonnellate/ora di velocità impianto |
|
||||
| GetMachineTotalFPM() | valore frutti per minuto |
|
||||
| GetMachineRodsPM() | velocità catena (carrellini / minuto) |
|
||||
| GetMachineCupfill() | percentuale riempimento carrellini (100% = 1 frutto x ogni carrellino) |
|
||||
|
||||
|
||||
## Icoel DB
|
||||
|
||||
Appunti sulla gestione tabelle di frontiera
|
||||
|
||||
### Products total
|
||||
|
||||
/****** Script for SelectTopNRows command from SSMS ******/
|
||||
SELECT TOP (1000) [SizerBatchId]
|
||||
,[Index]
|
||||
,[Nome]
|
||||
,[Qualities]
|
||||
,[Grado]
|
||||
,[Calibro]
|
||||
,[NumeroFrutti]
|
||||
,[Decigrammi]
|
||||
FROM [IcoelExport].[dbo].[ProductsTotals]
|
||||
|
||||
|
||||
### Entrata Ciliegie
|
||||
|
||||
SELECT *
|
||||
FROM [frontiera].[dbo].[ENTRATACILIEGIE]
|
||||
|
||||
|
||||
-- utilizzare codice e descrizione prodotto...
|
||||
|
||||
### Fine lavorazione
|
||||
select top 100 *
|
||||
from ProductsTotals
|
||||
|
||||
/*
|
||||
SizerBatch id = id del batch da WS SOAP
|
||||
Index = indice di prodotto FINITO, di cui ho il NOME
|
||||
- prodotti da matrice: colonne = gradi, righe = taglie(sizes)
|
||||
- grado a colore rosso
|
||||
- do il nome prodotto rosse 26- (che sono da 22 a 26 in grado A)
|
||||
- colonna qualities = è la "somma dei qualities" ovvero le colonne che passano nelcontrollo prodotto
|
||||
- codice in 3 parametri, che sono a,b,c
|
||||
- a = qualità interna (SEMPRE NULL x le ciliegie)
|
||||
- b grado = qualità esterna del frutto, es rosse, nere, con stelo... ricircolo = scarto per cattiva disposizione
|
||||
- c : calibri che mi definiscono la dimensione, tipicamente 22..32
|
||||
|
||||
|
||||
si scrive tutto quando è chiuso il lotto
|
||||
inizialmente 1 solo lotto x entrambe le linee
|
||||
*/
|
||||
|
||||
### Conferimento MES
|
||||
|
||||
<code>
|
||||
SELECT *
|
||||
FROM DettagliConferimentoMES
|
||||
where FillingId = 31729
|
||||
order by PackId
|
||||
</code>
|
||||
|
||||
/*
|
||||
Numero lotto = sigla giorno
|
||||
sigla lotto: incrementale giornaliero
|
||||
|
||||
in particoalre x il prodotto grosso --> seleziono da + fornitori (es fornitori grossi)
|
||||
|
||||
PackId = id univoco scatoletta
|
||||
FillingId / FillingRow NON USATI: li posso ignorare, si applicano al caso "travaso" da bins ingresso / bins uscita "tipizzati" --> serve x precalibrare
|
||||
scaricoId = operazione di scannerizzazione ( è il barcode letto)
|
||||
codice a barre è letto x ogni etichetta di conferimento
|
||||
codice e nome fornitore = grower
|
||||
codice e descrizione prodotto : sono il GREZZO specifico
|
||||
cdice prodotto grezzo è il "ceppo" / famiglia
|
||||
sigla e numero lotto: colonna di entrata ciliegie (frontiera)
|
||||
idem x data e qta entrata
|
||||
|
||||
|
||||
*/
|
||||
|
||||
### Confezioni Mes
|
||||
|
||||
<code>
|
||||
SELECT *
|
||||
FROM DettagliConfezioniMES
|
||||
</code>
|
||||
|
||||
pack id = singola cassetta/scatoal/cartone
|
||||
ean = barcode in uscita
|
||||
batch id / batch name = dati tracciabilità, legato ai lotti in entrata sul sizer
|
||||
lane [1/2]sizerBatchId = lotti del sizer
|
||||
pesoDecigram = peso netto confezionato (tolleranza +/-10g...20gr)
|
||||
|
||||
tabella scritta dal momento in cui arriva il cartone/cassetta per iniziare riempimento
|
||||
|
||||
dati live li vediamo dal sizer
|
||||
|
||||
*/
|
||||
@@ -1,5 +1,6 @@
|
||||
using EgwProxy.Icoel.SizerService;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ServiceModel;
|
||||
|
||||
@@ -174,6 +175,31 @@ namespace EgwProxy.Icoel.Compac
|
||||
SSClient.AddBatch(batch);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco parametri performance impianto
|
||||
/// </summary>
|
||||
/// <returns>Dizionario delle variabili di performance dell'impianto in formato Dictionary<string,double></returns>
|
||||
internal Dictionary<string, double> GetPerfMeters()
|
||||
{
|
||||
Dictionary<string, double> answ = new Dictionary<string, double>();
|
||||
// velocità processo indicata in tonnellate /oOra
|
||||
double velTonnOra = SSClient.GetMachineTonnesPH();
|
||||
// velocità espressa in frutti/minuto
|
||||
double velFruttiMinuto = SSClient.GetMachineTotalFPM();
|
||||
// percentuale riempimento carrellini
|
||||
double percRiemp = SSClient.GetMachineCupfill();
|
||||
// Numero confezioni/ora
|
||||
double numPackOra = SSClient.GetMachinePacksPH();
|
||||
|
||||
// accodo i valori ricavati
|
||||
answ.Add("NumPacksOra", numPackOra);
|
||||
answ.Add("PercRiemp", percRiemp);
|
||||
answ.Add("VelFruttiMinuto", velFruttiMinuto);
|
||||
answ.Add("VelTonnOra", velTonnOra);
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Private Properties
|
||||
|
||||
@@ -38,6 +38,38 @@ namespace EgwProxy.Icoel
|
||||
Client.CheckGrower(GrowerData.GrowerCode, GrowerData.GrowerName);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera array varie velocità rilevate
|
||||
/// </summary>
|
||||
/// <returns>Dictionary<string, double> delle velocità rilevate sul sizer</returns>
|
||||
public Dictionary<string, double> GetPerfMeters()
|
||||
{
|
||||
Dictionary<string, double> answ = new Dictionary<string, double>();
|
||||
using (var Client = new ComClient(ipAddress, tcpPort))
|
||||
{
|
||||
answ = Client.GetPerfMeters();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Recupera array dei batch sulle 2 linee: ID batch + layout + varietà x ogni linea...
|
||||
/// </summary>
|
||||
/// <returns>Dictionary<string, string> dei dati correnti x linea (batch, layout, variety) rilevate sul sizer</returns>
|
||||
public Dictionary<string, string> GetCurrBatchData()
|
||||
{
|
||||
Dictionary<string, string> answ = new Dictionary<string, string>();
|
||||
var batchData = GetCurrentBatch();
|
||||
foreach (var item in batchData)
|
||||
{
|
||||
answ.Add($"L{item.Key}_Batch", $"{item.Value.Id} | {item.Value.Name} | {item.Value.StartTime}");
|
||||
answ.Add($"L{item.Key}_Grower", $"{item.Value.GrowerCode}");
|
||||
answ.Add($"L{item.Key}_Layout", $"{item.Value.LayoutId} | {item.Value.LayoutName}");
|
||||
answ.Add($"L{item.Key}_Variety", $"{item.Value.VarietyId} | {item.Value.VarietyName}");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invia un lotto in coda produzione sul sizer
|
||||
@@ -47,7 +79,10 @@ namespace EgwProxy.Icoel
|
||||
{
|
||||
using (var Client = new ComClient(ipAddress, tcpPort))
|
||||
{
|
||||
// va bene anche se vuoto! come lo torna ora...
|
||||
string sizingProfile = Client.GetCurrentBatch().SizingProfileName;
|
||||
//var rawData = Client.GetCurrentBatchByLane(1);
|
||||
//var rawData2 = Client.GetCurrentBatchByLane(2);
|
||||
Batch newBatch = CreateBatch(GrowerData, varGuid, layGuid, sizingProfile);
|
||||
Client.MettiLottoInCoda(newBatch);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using EgwProxy.Icoel.DataLayer.Controllers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwProxy.Icoel
|
||||
{
|
||||
/// <summary>
|
||||
/// Proxy connessione DB
|
||||
/// </summary>
|
||||
public class DbProxy
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller DB esposto
|
||||
/// </summary>
|
||||
public DbController DataController { get; set; }
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Inizializzazione proxy
|
||||
/// </summary>
|
||||
/// <param name="connEntrata">stringa connesisone DB Entrata</param>
|
||||
/// <param name="connTracker">stringa connesisone DB Tracker</param>
|
||||
/// <param name="connExport">stringa connesisone DB Export</param>
|
||||
/// <param name="connSyncState">Connessione DB locale di SYNC</param>
|
||||
public DbProxy(string connEntrata, string connTracker, string connExport, string connSyncState)
|
||||
{
|
||||
DataController = new DbController(connEntrata, connTracker, connExport, connSyncState);
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Inizializzazione proxy
|
||||
/// </summary>
|
||||
/// <param name="connSyncState">Connessione DB locale di SYNC</param>
|
||||
public DbProxy(string connSyncState)
|
||||
{
|
||||
DataController = new DbController(connSyncState);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,12 +39,19 @@
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.9\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.1.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -54,6 +61,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Compac\ComClient.cs" />
|
||||
<Compile Include="DbProxy.cs" />
|
||||
<Compile Include="GrowerInfo.cs" />
|
||||
<Compile Include="Connected Services\SizerService\Reference.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -135,6 +143,7 @@
|
||||
</None>
|
||||
<None Include="docfx.json" />
|
||||
<None Include="index.md" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="toc.yml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -155,5 +164,11 @@
|
||||
<LastGenOutput>Reference.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EgwProxy.Icoel.DataLayer\EgwProxy.Icoel.DataLayer.csproj">
|
||||
<Project>{e36544cb-d699-48d8-9f81-c2758e7c7d19}</Project>
|
||||
<Name>EgwProxy.Icoel.DataLayer</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NLog" version="4.7.9" targetFramework="net462" />
|
||||
<package id="System.IO.Compression" version="4.1.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -1078,14 +1078,110 @@ Namespace CNC
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Legge o scrive le variabile Custom Macro
|
||||
''' </summary>
|
||||
''' <param name="bWrite">Se True SCRIVE, se False LEGGE</param>
|
||||
''' <param name="MacroIndex">Indice di memoria</param>
|
||||
''' <param name="Value">Matrice di valori da scrivere su scrittura o letti su lettura</param>
|
||||
''' <returns>True se andata a buon fine</returns>
|
||||
Public Overloads Function F_RW_Macro_Short(ByVal bWrite As Boolean, ByVal MacroIndex As Integer, ByRef Value() As Short) As Boolean
|
||||
''' <summary>
|
||||
''' Legge una variabile macro (#)
|
||||
''' </summary>
|
||||
''' <param name="nVar">Indirizzo da leggere</param>
|
||||
''' <param name="dValue">Valore letto (restituito per riferimento)</param>
|
||||
''' <returns>Boolean di eseguito/errore</returns>
|
||||
Public Function F_Read_macro(ByVal nVar As Integer, ByRef dValue As Double) As Boolean
|
||||
|
||||
Const ONE_DATA_ONLY As Integer = 1
|
||||
|
||||
Const CUSTOM_MACRO_SIZE As Integer = 10
|
||||
|
||||
Dim ODBM As Focas1.ODBM
|
||||
Dim MacroInfo3 As Focas1.IODBMRN3 = Nothing
|
||||
Dim values() As Double
|
||||
|
||||
Dim n_ret_code As Short
|
||||
|
||||
Dim sz_routine As String = "-", sz_temp As String = "", d As Double = 0.0
|
||||
|
||||
'Try
|
||||
' If nVar >= 10000 Then ' if var like 98xxx then use the other read routine .... ( :(( no comment )
|
||||
' 'If nVar >= &H8000 Then ' if var like 98xxx then use the other read routine .... ( :(( no comment )
|
||||
' n_ret_code = Focas1.cnc_rdmacror3(nLibHandle(1), nVar, ONE_DATA_ONLY, MacroInfo3)
|
||||
' If (n_ret_code = Focas1.EW_OK) Then ' no Fanuc error
|
||||
' dValue = MacroInfo3.mcr_val
|
||||
' Else
|
||||
' 'Error reading parameter :
|
||||
' dValue = 0.0
|
||||
' Return False
|
||||
' End If ' no Fanuc error
|
||||
' Else ' good ole boys
|
||||
' ' cnc_rdmacro : read custom macro variable
|
||||
' n_ret_code = Focas1.cnc_rdmacro(nLibHandle(1), nVar, CUSTOM_MACRO_SIZE, ODBM)
|
||||
' If (n_ret_code = Focas1.EW_OK) Then ' no Fanuc error
|
||||
' If ODBM.mcr_val = 0 And ODBM.dec_val = -1 Then ' variabile non definita
|
||||
' dValue = 0 '"Null"
|
||||
' Else
|
||||
' dValue = ODBM.mcr_val * (10 ^ -(ODBM.dec_val))
|
||||
' End If
|
||||
' Else
|
||||
' 'Error reading parameter :
|
||||
' dValue = 0.0
|
||||
' Return False
|
||||
' End If ' no Fanuc error
|
||||
' End If ' var > 8000h
|
||||
'Catch ex As Exception
|
||||
|
||||
' dValue = 0.0
|
||||
' Return False
|
||||
'End Try
|
||||
|
||||
Try
|
||||
If (nVar >= 98000) And (nVar <= 98499) Then ' if var like 98xxx then use the other read routine .... ( :(( no comment )
|
||||
n_ret_code = Focas1.cnc_rdmacror3(nLibHandle(1), nVar, ONE_DATA_ONLY, MacroInfo3)
|
||||
If (n_ret_code = Focas1.EW_OK) Then ' no Fanuc error
|
||||
dValue = MacroInfo3.mcr_val
|
||||
Else
|
||||
dValue = -999999.999
|
||||
Return False
|
||||
End If ' no Fanuc error
|
||||
ElseIf (((nVar >= 10000) And (nVar <= 85535)) Or
|
||||
((nVar >= 200000) And (nVar <= 986432)) Or
|
||||
((nVar >= 2000000) And (nVar <= 3999999))) Then
|
||||
ReDim values(1)
|
||||
n_ret_code = Focas1.cnc_rdpmacror2(nLibHandle(1), nVar, ONE_DATA_ONLY, 0, values)
|
||||
|
||||
If (n_ret_code = Focas1.EW_OK) Then ' no Fanuc error
|
||||
|
||||
dValue = values(0)
|
||||
Else
|
||||
dValue = -999999.999
|
||||
Return False
|
||||
End If ' no Fanuc error
|
||||
Else ' good ole boys
|
||||
' cnc_rdmacro : read custom macro variable
|
||||
'n_var_int = CShort(nVar)
|
||||
n_ret_code = Focas1.cnc_rdmacro(nLibHandle(1), nVar, CUSTOM_MACRO_SIZE, ODBM)
|
||||
If (n_ret_code = Focas1.EW_OK) Then ' no Fanuc error
|
||||
If ODBM.mcr_val = 0 And ODBM.dec_val = -1 Then ' variabile non definita
|
||||
dValue = 0 '"Null"
|
||||
Else
|
||||
dValue = ODBM.mcr_val * (10 ^ -(ODBM.dec_val))
|
||||
End If
|
||||
Else
|
||||
'Error reading parameter :
|
||||
dValue = -999999.999
|
||||
Return False
|
||||
End If ' no Fanuc error
|
||||
End If ' var > 98000
|
||||
Catch ex As Exception
|
||||
dValue = -999999.999
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Legge o scrive le variabile Custom Macro
|
||||
''' </summary>
|
||||
''' <param name="bWrite">Se True SCRIVE, se False LEGGE</param>
|
||||
''' <param name="MacroIndex">Indice di memoria</param>
|
||||
''' <param name="Value">Matrice di valori da scrivere su scrittura o letti su lettura</param>
|
||||
''' <returns>True se andata a buon fine</returns>
|
||||
Public Overloads Function F_RW_Macro_Short(ByVal bWrite As Boolean, ByVal MacroIndex As Integer, ByRef Value() As Short) As Boolean
|
||||
Dim iodbmr As Focas1.IODBMR
|
||||
Dim nlength As Integer
|
||||
Dim nReturn As Integer
|
||||
|
||||
@@ -10949,4 +10949,21 @@ Public Class Focas1
|
||||
Declare Function cnc_rdetherinfo Lib "FWLIB32.DLL" _
|
||||
(ByVal FlibHndl As Integer, ByRef a As Short, ByRef b As Short) As Short
|
||||
|
||||
'
|
||||
'-------------------------------------------------------- 28 - VI - 2019 cv ------------------------------
|
||||
'
|
||||
|
||||
' cnc_rdmacror3 :read Custom macro names(area specified)
|
||||
<StructLayout(LayoutKind.Sequential, Pack:=4)>
|
||||
Public Structure IODBMRN3
|
||||
Public mcr_val As Double
|
||||
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=36)>
|
||||
Public name As String ' var name
|
||||
End Structure
|
||||
|
||||
|
||||
' read custom macro variables:read Custom macro names(area specified)
|
||||
Declare Function cnc_rdmacror3 Lib "FWLIB32.DLL" _
|
||||
(ByVal FlibHndl As Integer, ByVal a As Integer, ByRef b As Integer, ByRef c As IODBMRN3) As Short
|
||||
|
||||
End Class 'Focas1
|
||||
|
||||
+113
-109
@@ -1,112 +1,116 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="appName" value="IOB-MAN" />
|
||||
<add key="appNameExt" value="IOB-WIN-NEXT" />
|
||||
<add key="uiPeriod" value="100" />
|
||||
<add key="checkPeriod" value="3000" />
|
||||
<add key="forceCheckPeriodMult" value="15" />
|
||||
<add key="autoRestartTimeoutMin" value="15" />
|
||||
<add key="autoStartProc" value="true" />
|
||||
<add key="closeOnChildUpdate" value="true" />
|
||||
<add key="targetExe" value="C:\Steamware\IOB-WIN-NEXT\IOB-WIN-NEXT.exe" />
|
||||
<add key="TargetNLogConf" value="C:\Steamware\IOB-WIN-NEXT\NLog.config" />
|
||||
<add key="TargetLogDir" value="C:\Steamware\IOB-WIN-NEXT\logs\" />
|
||||
<add key="ApiUrl" value="https://liman.egalware.com/ELM.Api/" />
|
||||
<!--<add key="ApiUrl" value="https://localhost:44351/" />-->
|
||||
<add key="BaseArg" value="MODE=MAN IOB=" />
|
||||
<!--<add key="ArgsList" value="SIMUL_00,SIMUL_00" />-->
|
||||
<add key="ArgsConfFile" value="/CONF/process.json" />
|
||||
<!--Gestione riavvio periodico: ora e min di avvio, periodo ripetizione in minuti -->
|
||||
<add key="fullRestartHour" value="0" />
|
||||
<add key="fullRestartMinute" value="30" />
|
||||
<add key="fullRestartIntervMin" value="1440" />
|
||||
<add key="waitForExitMsec" value="250" />
|
||||
<!--gestione REDIS-->
|
||||
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="redisDb" value="10" />
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
</appSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-0.30.0.0" newVersion="0.30.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.1" newVersion="5.0.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<probing privatePath="lib;libs" />
|
||||
<probing privatePath="lib;libs" xmlns="" />
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="DnsClient" publicKeyToken="4574bb5573c51424" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.3.3.11" newVersion="1.3.3.11" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-106.15.0.0" newVersion="106.15.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.web>
|
||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||
<providers>
|
||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||
</providers>
|
||||
</membership>
|
||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||
<providers>
|
||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
</system.web>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="appName" value="IOB-MAN" />
|
||||
<add key="appNameExt" value="IOB-WIN-NEXT" />
|
||||
<add key="uiPeriod" value="100" />
|
||||
<add key="checkPeriod" value="3000" />
|
||||
<add key="forceCheckPeriodMult" value="20" />
|
||||
<add key="autoRestartTimeoutMin" value="15" />
|
||||
<add key="autoStartProc" value="true" />
|
||||
<add key="closeOnChildUpdate" value="true" />
|
||||
<add key="targetExe" value="C:\Steamware\IOB-WIN-NEXT\IOB-WIN-NEXT.exe" />
|
||||
<add key="TargetNLogConf" value="C:\Steamware\IOB-WIN-NEXT\NLog.config" />
|
||||
<add key="TargetLogDir" value="C:\Steamware\IOB-WIN-NEXT\logs\" />
|
||||
<add key="ApiUrl" value="https://liman.egalware.com/ELM.Api/" />
|
||||
<!--<add key="ApiUrl" value="https://localhost:44351/" />-->
|
||||
<add key="BaseArg" value="MODE=MAN IOB=" />
|
||||
<!--<add key="ArgsList" value="SIMUL_00,SIMUL_00" />-->
|
||||
<add key="ArgsConfFile" value="/CONF/process.json" />
|
||||
<!--Gestione riavvio periodico: ora e min di avvio, periodo ripetizione in minuti -->
|
||||
<add key="fullRestartHour" value="0" />
|
||||
<add key="fullRestartMinute" value="30" />
|
||||
<add key="fullRestartIntervMin" value="1440" />
|
||||
<add key="waitForExitMsec" value="250" />
|
||||
<!--gestione REDIS-->
|
||||
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="redisDb" value="10" />
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
</appSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.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="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-0.31.0.0" newVersion="0.31.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.2" newVersion="6.0.0.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<probing privatePath="lib;libs" />
|
||||
<probing privatePath="lib;libs" xmlns="" />
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="DnsClient" publicKeyToken="4574bb5573c51424" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.3.3.11" newVersion="1.3.3.11" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-106.15.0.0" newVersion="106.15.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.web>
|
||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||
<providers>
|
||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||
</providers>
|
||||
</membership>
|
||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||
<providers>
|
||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -1,5 +1,5 @@
|
||||
---------------------------------------------------------------
|
||||
------- SteamWareLib SDK -------
|
||||
------- SteamWare SDK -------
|
||||
---------------------------------------------------------------
|
||||
|
||||
Libreria di utility base di SteamWare.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+44
-47
@@ -38,42 +38,38 @@
|
||||
<ApplicationIcon>IobManIcon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Crc32C.NET, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Crc32C.NET.1.0.5.0\lib\net20\Crc32C.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DnsClient, Version=1.5.0.0, Culture=neutral, PublicKeyToken=4574bb5573c51424, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DnsClient.1.5.0\lib\net45\DnsClient.dll</HintPath>
|
||||
<Reference Include="DnsClient, Version=1.6.0.0, Culture=neutral, PublicKeyToken=4574bb5573c51424, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DnsClient.1.6.0\lib\net45\DnsClient.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MapoSDK, Version=6.14.2109.2809, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MapoSDK.6.14.2109.2809\lib\net40\MapoSDK.dll</HintPath>
|
||||
<Reference Include="MapoSDK, Version=6.14.2204.2616, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MapoSDK.6.14.2204.2616\lib\MapoSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MongoDB.Bson, Version=2.13.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MongoDB.Bson.2.13.2\lib\net452\MongoDB.Bson.dll</HintPath>
|
||||
<Reference Include="MongoDB.Bson, Version=2.15.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MongoDB.Bson.2.15.0\lib\netstandard2.0\MongoDB.Bson.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MongoDB.Driver, Version=2.13.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MongoDB.Driver.2.13.2\lib\net452\MongoDB.Driver.dll</HintPath>
|
||||
<Reference Include="MongoDB.Driver, Version=2.15.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MongoDB.Driver.2.15.0\lib\netstandard2.0\MongoDB.Driver.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MongoDB.Driver.Core, Version=2.13.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MongoDB.Driver.Core.2.13.2\lib\net452\MongoDB.Driver.Core.dll</HintPath>
|
||||
<Reference Include="MongoDB.Driver.Core, Version=2.15.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MongoDB.Driver.Core.2.15.0\lib\netstandard2.0\MongoDB.Driver.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MongoDB.Libmongocrypt, Version=1.2.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MongoDB.Libmongocrypt.1.2.3\lib\netstandard2.0\MongoDB.Libmongocrypt.dll</HintPath>
|
||||
<Reference Include="MongoDB.Libmongocrypt, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MongoDB.Libmongocrypt.1.3.0\lib\netstandard2.0\MongoDB.Libmongocrypt.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=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.12\lib\net45\NLog.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\NLog.4.7.15\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.2.0\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
|
||||
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.2.2\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll</HintPath>
|
||||
@@ -81,23 +77,20 @@
|
||||
<Reference Include="RestSharp.Serializers.NewtonsoftJson, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RestSharp.Serializers.NewtonsoftJson.106.15.0\lib\net452\RestSharp.Serializers.NewtonsoftJson.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpCompress, Version=0.30.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpCompress.0.30.0\lib\net461\SharpCompress.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Snappy.NET, Version=1.1.1.8, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Snappy.NET.1.1.1.8\lib\net45\Snappy.NET.dll</HintPath>
|
||||
<Reference Include="SharpCompress, Version=0.31.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpCompress.0.31.0\lib\net461\SharpCompress.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\StackExchange.Redis.2.2.79\lib\net461\StackExchange.Redis.dll</HintPath>
|
||||
<HintPath>..\packages\StackExchange.Redis.2.5.61\lib\net461\StackExchange.Redis.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SteamWare.IO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.IO.5.1.2109.1716\lib\net462\SteamWare.IO.dll</HintPath>
|
||||
<Reference Include="SteamWare.IO, Version=5.2.2205.1719, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.IO.5.2.2205.1719\lib\net462\SteamWare.IO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SteamWare.Logger, Version=5.1.2109.1716, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.Logger.5.1.2109.1716\lib\net462\SteamWare.Logger.dll</HintPath>
|
||||
<Reference Include="SteamWare.Logger, Version=5.2.2205.1719, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.Logger.5.2.2205.1719\lib\net462\SteamWare.Logger.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Steamware.Scheduler, Version=5.1.2109.1716, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Steamware.Scheduler.5.1.2109.1716\lib\net462\Steamware.Scheduler.dll</HintPath>
|
||||
<Reference Include="SteamWare.Scheduler, Version=5.2.2205.1719, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.Scheduler.5.2.2205.1719\lib\net462\SteamWare.Scheduler.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
@@ -105,8 +98,8 @@
|
||||
</Reference>
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Diagnostics.PerformanceCounter, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.PerformanceCounter.5.0.1\lib\net461\System.Diagnostics.PerformanceCounter.dll</HintPath>
|
||||
<Reference Include="System.Diagnostics.PerformanceCounter, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.PerformanceCounter.6.0.1\lib\net461\System.Diagnostics.PerformanceCounter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
@@ -114,8 +107,8 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.IO.Pipelines, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Pipelines.5.0.1\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||
<Reference Include="System.IO.Pipelines, Version=6.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Pipelines.6.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
@@ -129,8 +122,8 @@
|
||||
<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=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<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.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||
@@ -159,11 +152,11 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Text.Encoding.CodePages, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encoding.CodePages.5.0.0\lib\net461\System.Text.Encoding.CodePages.dll</HintPath>
|
||||
<Reference Include="System.Text.Encoding.CodePages, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encoding.CodePages.6.0.0\lib\net461\System.Text.Encoding.CodePages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Channels, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Channels.5.0.0\lib\net461\System.Threading.Channels.dll</HintPath>
|
||||
<Reference Include="System.Threading.Channels, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Channels.6.0.0\lib\net461\System.Threading.Channels.dll</HintPath>
|
||||
</Reference>
|
||||
<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>
|
||||
@@ -236,6 +229,10 @@
|
||||
</None>
|
||||
<None Include="CONF\license.json" />
|
||||
<None Include="CONF\process.json" />
|
||||
<None Include="Core\Compression\Snappy\lib\linux\libsnappy64.so" />
|
||||
<None Include="Core\Compression\Snappy\lib\osx\libsnappy64.dylib" />
|
||||
<None Include="Core\Compression\Zstandard\lib\linux\libzstd.so" />
|
||||
<None Include="Core\Compression\Zstandard\lib\osx\libzstd.dylib" />
|
||||
<None Include="logs\.placeholder">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
@@ -276,13 +273,13 @@
|
||||
</ItemGroup>
|
||||
<Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" />
|
||||
</Target>
|
||||
<Import Project="..\packages\MongoDB.Libmongocrypt.1.2.3\build\MongoDB.Libmongocrypt.targets" Condition="Exists('..\packages\MongoDB.Libmongocrypt.1.2.3\build\MongoDB.Libmongocrypt.targets')" />
|
||||
<Import Project="..\packages\MongoDB.Libmongocrypt.1.3.0\build\MongoDB.Libmongocrypt.targets" Condition="Exists('..\packages\MongoDB.Libmongocrypt.1.3.0\build\MongoDB.Libmongocrypt.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
<ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\MongoDB.Libmongocrypt.1.2.3\build\MongoDB.Libmongocrypt.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MongoDB.Libmongocrypt.1.2.3\build\MongoDB.Libmongocrypt.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\MongoDB.Driver.Core.2.13.2\build\MongoDB.Driver.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MongoDB.Driver.Core.2.13.2\build\MongoDB.Driver.Core.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\MongoDB.Libmongocrypt.1.3.0\build\MongoDB.Libmongocrypt.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MongoDB.Libmongocrypt.1.3.0\build\MongoDB.Libmongocrypt.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\MongoDB.Driver.Core.2.15.0\build\MongoDB.Driver.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MongoDB.Driver.Core.2.15.0\build\MongoDB.Driver.Core.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\MongoDB.Driver.Core.2.13.2\build\MongoDB.Driver.Core.targets" Condition="Exists('..\packages\MongoDB.Driver.Core.2.13.2\build\MongoDB.Driver.Core.targets')" />
|
||||
<Import Project="..\packages\MongoDB.Driver.Core.2.15.0\build\MongoDB.Driver.Core.targets" Condition="Exists('..\packages\MongoDB.Driver.Core.2.15.0\build\MongoDB.Driver.Core.targets')" />
|
||||
</Project>
|
||||
+237
-241
@@ -1,20 +1,17 @@
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
using RestSharp.Serializers.NewtonsoftJson;
|
||||
using Steamware.Scheduler;
|
||||
using SteamWare.IO;
|
||||
using SteamWare.Logger;
|
||||
using SteamWare.Scheduler;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -24,28 +21,53 @@ namespace IOB_MAN
|
||||
{
|
||||
public partial class IOBManPanel : Form
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private const int SW_SHOWMAXIMIZED = 3;
|
||||
private const int SW_SHOWMINIMIZED = 2;
|
||||
private const int SW_SHOWNORMAL = 1;
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// Context x sync thread
|
||||
/// Elenco ARGS (uno per child da avviare)
|
||||
/// </summary>
|
||||
private readonly SynchronizationContext synchronizationContext;
|
||||
public List<string> ArgsList = new List<string>();
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto semaforico di lock
|
||||
/// Init classe
|
||||
/// </summary>
|
||||
private SemaphoreSlim _sync = new SemaphoreSlim(1);
|
||||
public IOBManPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
synchronizationContext = SynchronizationContext.Current;
|
||||
|
||||
preInit();
|
||||
loadConfig();
|
||||
|
||||
// fix log...
|
||||
cbLogLevelMin.SelectedValue = "Info";
|
||||
setLogLevel("Info");
|
||||
|
||||
initTimers();
|
||||
initControls();
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Binding source degli elementi gestiti..
|
||||
/// Cerca nell'elenco il processo corrente
|
||||
/// </summary>
|
||||
private BindingSource ElencoIOB = new BindingSource();
|
||||
/// <param name="processlist"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public static Process myGetProcByID(Process[] processlist, int id)
|
||||
{
|
||||
return processlist.FirstOrDefault(pr => pr.Id == id);
|
||||
}
|
||||
|
||||
#endregion Private Fields
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
@@ -54,6 +76,11 @@ namespace IOB_MAN
|
||||
/// </summary>
|
||||
protected static List<iobAdapt> item2rem = new List<iobAdapt>();
|
||||
|
||||
/// <summary>
|
||||
/// URL di base x l'API di gestione licenze/file upload
|
||||
/// </summary>
|
||||
protected string ApiUrl = "";
|
||||
|
||||
/// <summary>
|
||||
/// Ramo applicazione (x update)
|
||||
/// </summary>
|
||||
@@ -114,26 +141,21 @@ namespace IOB_MAN
|
||||
/// </summary>
|
||||
protected string TargetExe = "";
|
||||
|
||||
/// <summary>
|
||||
/// File target x conf NLog
|
||||
/// </summary>
|
||||
protected string TargetNLogConf = "";
|
||||
|
||||
/// <summary>
|
||||
/// Directory log generale x IOB-WIN (dentro ci sono x singoli IOB)
|
||||
/// </summary>
|
||||
protected string TargetLogDir = "";
|
||||
|
||||
/// <summary>
|
||||
/// URL di base x l'API di gestione licenze/file upload
|
||||
/// </summary>
|
||||
protected string ApiUrl = "";
|
||||
|
||||
/// <summary>
|
||||
/// Name dell'exe da chiamare
|
||||
/// </summary>
|
||||
protected string TargetName = "";
|
||||
|
||||
/// <summary>
|
||||
/// File target x conf NLog
|
||||
/// </summary>
|
||||
protected string TargetNLogConf = "";
|
||||
|
||||
/// <summary>
|
||||
/// Dataora prossima scadenza riavvio automatico
|
||||
/// </summary>
|
||||
@@ -151,39 +173,6 @@ namespace IOB_MAN
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ARGS (uno per child da avviare)
|
||||
/// </summary>
|
||||
public List<string> ArgsList = new List<string>();
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init classe
|
||||
/// </summary>
|
||||
public IOBManPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
synchronizationContext = SynchronizationContext.Current;
|
||||
|
||||
preInit();
|
||||
loadConfig();
|
||||
|
||||
// fix log...
|
||||
cbLogLevelMin.SelectedValue = "Info";
|
||||
setLogLevel("Info");
|
||||
|
||||
initTimers();
|
||||
initControls();
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
@@ -199,6 +188,29 @@ namespace IOB_MAN
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private const int SW_SHOWMAXIMIZED = 3;
|
||||
private const int SW_SHOWMINIMIZED = 2;
|
||||
private const int SW_SHOWNORMAL = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Context x sync thread
|
||||
/// </summary>
|
||||
private readonly SynchronizationContext synchronizationContext;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto semaforico di lock
|
||||
/// </summary>
|
||||
private SemaphoreSlim _sync = new SemaphoreSlim(1);
|
||||
|
||||
/// <summary>
|
||||
/// Binding source degli elementi gestiti..
|
||||
/// </summary>
|
||||
private BindingSource ElencoIOB = new BindingSource();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
@@ -375,12 +387,155 @@ namespace IOB_MAN
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
private async void btnSendLog_Click(object sender, EventArgs e)
|
||||
{
|
||||
// salvo valori button normali
|
||||
var stdColor = btnSendLog.BackColor;
|
||||
var stdText = btnSendLog.Text;
|
||||
// mostro che sto inviando dati...
|
||||
btnSendLog.Enabled = false;
|
||||
btnSendLog.BackColor = Color.OrangeRed;
|
||||
btnSendLog.Text = "fix directory";
|
||||
btnSendLog.Refresh();
|
||||
// svuoto area temp...
|
||||
string fileName = "LogFiles.zip";
|
||||
string tempDir = Path.Combine(Application.StartupPath, "temp", "logs");
|
||||
string zipPath = Path.Combine(Application.StartupPath, "temp", fileName);
|
||||
if (Directory.Exists(tempDir))
|
||||
{
|
||||
Directory.Delete(tempDir, true);
|
||||
}
|
||||
// ricreo directory...
|
||||
Directory.CreateDirectory(tempDir);
|
||||
|
||||
// definisco limite temporale alle 21 di 2 gg prima...
|
||||
DateTime minDate = DateTime.Today.AddHours(-27);
|
||||
|
||||
// SOLO SE selezionato in dgv...
|
||||
string logDir = TargetLogDir;
|
||||
if (dgvManagedItems.SelectedRows.Count > 0)
|
||||
{
|
||||
btnSendLog.Text = "zip start";
|
||||
btnSendLog.Refresh();
|
||||
// ciclo su row selezionate
|
||||
foreach (DataGridViewRow riga in dgvManagedItems.SelectedRows)
|
||||
{
|
||||
// verifico che sia già chiuso...
|
||||
var iobData = (iobAdapt)ElencoIOB[riga.Index];
|
||||
// calcolo folder
|
||||
logDir = Path.Combine(TargetLogDir, iobData.CodIOB);
|
||||
|
||||
// recupero file odierno
|
||||
DirectoryInfo dI = new DirectoryInfo(logDir);
|
||||
var files = dI.GetFiles().Where(i => i.CreationTime >= minDate);
|
||||
|
||||
// copio in area temp...
|
||||
foreach (var file in files)
|
||||
{
|
||||
Directory.CreateDirectory(Path.Combine(tempDir, iobData.CodIOB));
|
||||
file.CopyTo(Path.Combine(tempDir, iobData.CodIOB, file.Name));
|
||||
}
|
||||
}
|
||||
// creo unico ZIP
|
||||
if (File.Exists(zipPath))
|
||||
{
|
||||
File.Delete(zipPath);
|
||||
}
|
||||
ZipFile.CreateFromDirectory(tempDir, zipPath);
|
||||
btnSendLog.Text = "zip end";
|
||||
btnSendLog.Refresh();
|
||||
|
||||
// ciclo di creazione ticket e upload file
|
||||
try
|
||||
{
|
||||
// client chiamate rest
|
||||
var client = new RestClient(ApiUrl);
|
||||
client.UseNewtonsoftJson();
|
||||
|
||||
SupportRequest newSuppReq = new SupportRequest();
|
||||
string licensePath = Path.Combine(Application.StartupPath, "CONF", "license.json");
|
||||
string rawData = "";
|
||||
if (File.Exists(licensePath))
|
||||
{
|
||||
rawData = File.ReadAllText(licensePath);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
// fare: composizione richiesta da parametri chiave
|
||||
newSuppReq = JsonConvert.DeserializeObject<SupportRequest>(rawData);
|
||||
}
|
||||
else
|
||||
{
|
||||
string hostName = utils.machineName;
|
||||
string listIP = string.Join(", ", utils.machineIp);
|
||||
// genero il ticket
|
||||
newSuppReq = new SupportRequest()
|
||||
{
|
||||
CodApp = "MAPO-IOB-WIN-NEXT",
|
||||
CodImp = "",
|
||||
CodInst = "SteamWare",
|
||||
ContactEmail = "info@steamware.net",
|
||||
ContactName = "Default Config",
|
||||
ContactPhone = "035-460560",
|
||||
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
|
||||
ReqBody = $"File Upload - MISSING license file | machine: {utils.machineName} | IP: {listIP}",
|
||||
Tipo = TipologiaTicket.FileUpload,
|
||||
idxSubLic = 0
|
||||
};
|
||||
}
|
||||
|
||||
btnSendLog.Text = "LogSend start";
|
||||
btnSendLog.BackColor = Color.DarkOrange;
|
||||
btnSendLog.Refresh();
|
||||
var ticketReq = new RestRequest("/api/ticket/sendReq", DataFormat.Json).AddJsonBody(newSuppReq);
|
||||
var ticketResp = await client.PostAsync<TicketDTO>(ticketReq);
|
||||
|
||||
// preparo richiesta x upload file
|
||||
var fileUploadReq = new RestRequest("/api/filesave/single");
|
||||
fileUploadReq.AddParameter("ticketId", ticketResp.idxTicket);
|
||||
fileUploadReq.AddFile("file", zipPath);
|
||||
|
||||
// ... infine INVIA file zip che li contiene...
|
||||
//var fileUploadResp = client.Post(fileUploadReq);
|
||||
var fileUploadResp = await client.PostAsync<UploadResult>(fileUploadReq);
|
||||
btnSendLog.Text = "LogSend end";
|
||||
btnSendLog.BackColor = Color.DarkOliveGreen;
|
||||
btnSendLog.Refresh();
|
||||
|
||||
// elimino folder temporanea
|
||||
if (Directory.Exists(tempDir))
|
||||
{
|
||||
Directory.Delete(tempDir, true);
|
||||
}
|
||||
// elimino il file temporaneo...
|
||||
if (File.Exists(zipPath))
|
||||
{
|
||||
File.Delete(zipPath);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Logging.LogError($"Eccezione in fase gestione REST services{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
|
||||
btnSendLog.BackColor = stdColor;
|
||||
btnSendLog.Text = stdText;
|
||||
btnSendLog.Enabled = true;
|
||||
}
|
||||
|
||||
private void btnStartSel_Click(object sender, EventArgs e)
|
||||
{
|
||||
// riapro child (SOLO SE non era già aperto...)
|
||||
apriChildSel();
|
||||
}
|
||||
|
||||
private void cbLogLevelMin_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// aggiornato livelo di log --> chiamo procedura x riscrivere il file conf di NLog
|
||||
setLogLevel($"{cbLogLevelMin.SelectedItem}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// verifica buttons attivi data selezione su gridview...
|
||||
/// </summary>
|
||||
@@ -476,7 +631,8 @@ namespace IOB_MAN
|
||||
IList<iobAdapt> allItems = (IList<iobAdapt>)ElencoIOB.List;
|
||||
bool needRem = false;
|
||||
|
||||
// 2020.02.01 passato chiamata specifica x leggere in 1 sola volta TUTTO elenco processi (x nome)...
|
||||
// 2020.02.01 passato chiamata specifica x leggere in 1 sola volta TUTTO elenco processi
|
||||
// (x nome)...
|
||||
Process[] processList = Process.GetProcessesByName(TargetName);
|
||||
|
||||
// ciclo
|
||||
@@ -729,6 +885,12 @@ namespace IOB_MAN
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void dgvManagedItems_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkButtons();
|
||||
}
|
||||
|
||||
private void ElencoIOB_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
|
||||
{
|
||||
}
|
||||
@@ -954,9 +1116,6 @@ namespace IOB_MAN
|
||||
{
|
||||
try
|
||||
{
|
||||
//Task result = checkProcessStatusAsync();
|
||||
//result.Wait();
|
||||
|
||||
Task result = Task.Run(() => checkProcessStatusAsync().ConfigureAwait(false));
|
||||
result.Wait();
|
||||
}
|
||||
@@ -1093,6 +1252,21 @@ namespace IOB_MAN
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
private void setLogLevel(string selectedValue)
|
||||
{
|
||||
// leggo il file loglevel in resources
|
||||
string rawData = File.ReadAllText($@"{Application.StartupPath}\Resources\NLog.template.config");
|
||||
|
||||
// sostituzione livello minimo da selezione
|
||||
rawData = rawData.Replace("{{minLevel}}", selectedValue);
|
||||
|
||||
// scrivo conf x programma IOB-MAN
|
||||
File.WriteAllText($@"{Application.StartupPath}\NLog.config", rawData);
|
||||
|
||||
// scrivo conf x IOB-WIN gestiti
|
||||
File.WriteAllText(TargetNLogConf, rawData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Avvio di un child process da parametro ARG
|
||||
/// </summary>
|
||||
@@ -1239,183 +1413,5 @@ namespace IOB_MAN
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Cerca nell'elenco il processo corrente
|
||||
/// </summary>
|
||||
/// <param name="processlist"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public static Process myGetProcByID(Process[] processlist, int id)
|
||||
{
|
||||
return processlist.FirstOrDefault(pr => pr.Id == id);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
private void cbLogLevelMin_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// aggiornato livelo di log --> chiamo procedura x riscrivere il file conf di NLog
|
||||
setLogLevel($"{cbLogLevelMin.SelectedItem}");
|
||||
}
|
||||
|
||||
private void setLogLevel(string selectedValue)
|
||||
{
|
||||
// leggo il file loglevel in resources
|
||||
string rawData = File.ReadAllText($@"{Application.StartupPath}\Resources\NLog.template.config");
|
||||
|
||||
// sostituzione livello minimo da selezione
|
||||
rawData = rawData.Replace("{{minLevel}}", selectedValue);
|
||||
|
||||
// scrivo conf x programma IOB-MAN
|
||||
File.WriteAllText($@"{Application.StartupPath}\NLog.config", rawData);
|
||||
|
||||
// scrivo conf x IOB-WIN gestiti
|
||||
File.WriteAllText(TargetNLogConf, rawData);
|
||||
}
|
||||
|
||||
private void dgvManagedItems_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkButtons();
|
||||
}
|
||||
|
||||
private async void btnSendLog_Click(object sender, EventArgs e)
|
||||
{
|
||||
// salvo valori button normali
|
||||
var stdColor = btnSendLog.BackColor;
|
||||
var stdText = btnSendLog.Text;
|
||||
// mostro che sto inviando dati...
|
||||
btnSendLog.Enabled = false;
|
||||
btnSendLog.BackColor = Color.OrangeRed;
|
||||
btnSendLog.Text = "fix directory";
|
||||
btnSendLog.Refresh();
|
||||
// svuoto area temp...
|
||||
string fileName = "LogFiles.zip";
|
||||
string tempDir = Path.Combine(Application.StartupPath, "temp", "logs");
|
||||
string zipPath = Path.Combine(Application.StartupPath, "temp", fileName);
|
||||
if (Directory.Exists(tempDir))
|
||||
{
|
||||
Directory.Delete(tempDir, true);
|
||||
}
|
||||
// ricreo directory...
|
||||
Directory.CreateDirectory(tempDir);
|
||||
|
||||
// definisco limite temporale alle 21 di 2 gg prima...
|
||||
DateTime minDate = DateTime.Today.AddHours(-27);
|
||||
|
||||
// SOLO SE selezionato in dgv...
|
||||
string logDir = TargetLogDir;
|
||||
if (dgvManagedItems.SelectedRows.Count > 0)
|
||||
{
|
||||
btnSendLog.Text = "zip start";
|
||||
btnSendLog.Refresh();
|
||||
// ciclo su row selezionate
|
||||
foreach (DataGridViewRow riga in dgvManagedItems.SelectedRows)
|
||||
{
|
||||
// verifico che sia già chiuso...
|
||||
var iobData = (iobAdapt)ElencoIOB[riga.Index];
|
||||
// calcolo folder
|
||||
logDir = Path.Combine(TargetLogDir, iobData.CodIOB);
|
||||
|
||||
// recupero file odierno
|
||||
DirectoryInfo dI = new DirectoryInfo(logDir);
|
||||
var files = dI.GetFiles().Where(i => i.CreationTime >= minDate);
|
||||
|
||||
// copio in area temp...
|
||||
foreach (var file in files)
|
||||
{
|
||||
Directory.CreateDirectory(Path.Combine(tempDir, iobData.CodIOB));
|
||||
file.CopyTo(Path.Combine(tempDir, iobData.CodIOB, file.Name));
|
||||
}
|
||||
|
||||
}
|
||||
// creo unico ZIP
|
||||
if (File.Exists(zipPath))
|
||||
{
|
||||
File.Delete(zipPath);
|
||||
}
|
||||
ZipFile.CreateFromDirectory(tempDir, zipPath);
|
||||
btnSendLog.Text = "zip end";
|
||||
btnSendLog.Refresh();
|
||||
|
||||
// ciclo di creazione ticket e upload file
|
||||
try
|
||||
{
|
||||
// client chiamate rest
|
||||
var client = new RestClient(ApiUrl);
|
||||
client.UseNewtonsoftJson();
|
||||
|
||||
SupportRequest newSuppReq = new SupportRequest();
|
||||
string licensePath = Path.Combine(Application.StartupPath, "CONF", "license.json");
|
||||
string rawData = "";
|
||||
if (File.Exists(licensePath))
|
||||
{
|
||||
rawData = File.ReadAllText(licensePath);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
// fare: composizione richiesta da parametri chiave
|
||||
newSuppReq = JsonConvert.DeserializeObject<SupportRequest>(rawData);
|
||||
}
|
||||
else
|
||||
{
|
||||
string hostName = utils.machineName;
|
||||
string listIP = string.Join(", ", utils.machineIp);
|
||||
// genero il ticket
|
||||
newSuppReq = new SupportRequest()
|
||||
{
|
||||
CodApp = "MAPO-IOB-WIN-NEXT",
|
||||
CodImp = "",
|
||||
CodInst = "SteamWare",
|
||||
ContactEmail = "info@steamware.net",
|
||||
ContactName = "Default Config",
|
||||
ContactPhone = "035-460560",
|
||||
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
|
||||
ReqBody = $"File Upload - MISSING license file | machine: {utils.machineName} | IP: {listIP}",
|
||||
Tipo = TipologiaTicket.FileUpload,
|
||||
idxSubLic = 0
|
||||
};
|
||||
}
|
||||
|
||||
btnSendLog.Text = "LogSend start";
|
||||
btnSendLog.BackColor = Color.DarkOrange;
|
||||
btnSendLog.Refresh();
|
||||
var ticketReq = new RestRequest("/api/ticket/sendReq", DataFormat.Json).AddJsonBody(newSuppReq);
|
||||
var ticketResp = await client.PostAsync<TicketDTO>(ticketReq);
|
||||
|
||||
// preparo richiesta x upload file
|
||||
var fileUploadReq = new RestRequest("/api/filesave/single");
|
||||
fileUploadReq.AddParameter("ticketId", ticketResp.idxTicket);
|
||||
fileUploadReq.AddFile("file", zipPath);
|
||||
|
||||
// ... infine INVIA file zip che li contiene...
|
||||
//var fileUploadResp = client.Post(fileUploadReq);
|
||||
var fileUploadResp = await client.PostAsync<UploadResult>(fileUploadReq);
|
||||
btnSendLog.Text = "LogSend end";
|
||||
btnSendLog.BackColor = Color.DarkOliveGreen;
|
||||
btnSendLog.Refresh();
|
||||
|
||||
// elimino folder temporanea
|
||||
if (Directory.Exists(tempDir))
|
||||
{
|
||||
Directory.Delete(tempDir, true);
|
||||
}
|
||||
// elimino il file temporaneo...
|
||||
if (File.Exists(zipPath))
|
||||
{
|
||||
File.Delete(zipPath);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Logging.LogError($"Eccezione in fase gestione REST services{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
|
||||
btnSendLog.BackColor = stdColor;
|
||||
btnSendLog.Text = stdText;
|
||||
btnSendLog.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -12,7 +12,7 @@
|
||||
name="f_base"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.log"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
@@ -23,7 +23,7 @@
|
||||
name="f_error"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}${newline}${exception:format=tostring}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.log"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
|
||||
+127
-120
@@ -29,6 +29,16 @@ namespace IOB_MAN
|
||||
/// </summary>
|
||||
public float counterMAC { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Ultimo stato noto dei parametri in memoria letti dalla macchina
|
||||
/// </summary>
|
||||
public Dictionary<string, string> currParams { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Note (libere) da child a controller
|
||||
/// </summary>
|
||||
public string freeNotes { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Tipo IOB
|
||||
/// </summary>
|
||||
@@ -39,6 +49,11 @@ namespace IOB_MAN
|
||||
/// </summary>
|
||||
public DateTime lastDataIn { get; set; } = DateTime.Now.AddMinutes(-1);
|
||||
|
||||
/// <summary>
|
||||
/// DataOra ultima comunicazione OUT (con MP Server)
|
||||
/// </summary>
|
||||
public DateTime lastDataOut { get; set; } = DateTime.Now.AddDays(-1);
|
||||
|
||||
/// <summary>
|
||||
/// DataOra ultima comunicazione OUT (con MP Server)
|
||||
/// </summary>
|
||||
@@ -49,21 +64,6 @@ namespace IOB_MAN
|
||||
/// </summary>
|
||||
public bool online { get; set; } = false;
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Indica se sia correntemente in setup
|
||||
/// </summary>
|
||||
public bool inSetup { get; set; } = false;
|
||||
/// <summary>
|
||||
/// Semaforo IN (IOB-PLC)
|
||||
/// </summary>
|
||||
public Semaforo SemIn { get; set; } = Semaforo.ND;
|
||||
/// <summary>
|
||||
/// Semaforo OUT (IOB-MPserver)
|
||||
/// </summary>
|
||||
public Semaforo SemOut { get; set; } = Semaforo.ND;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Lungh coda ALLARMI in uscita
|
||||
/// </summary>
|
||||
@@ -84,73 +84,26 @@ namespace IOB_MAN
|
||||
/// </summary>
|
||||
public int queueMsLen { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
/// <summary>
|
||||
/// Semaforo IN (IOB-Macchina)
|
||||
/// </summary>
|
||||
public string semIn { get; set; } = "ND";
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// DataOra ultima comunicazione OUT (con MP Server)
|
||||
/// </summary>
|
||||
public DateTime lastDataOut { get; set; } = DateTime.Now.AddDays(-1);
|
||||
/// <summary>
|
||||
/// Ultimo stato noto dei parametri in memoria letti da PLC
|
||||
/// </summary>
|
||||
public Dictionary<string, string> currParams { get; set; } = null;
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Semaforo OUT (IOB-MPServer)
|
||||
/// </summary>
|
||||
public string semOut { get; set; } = "ND";
|
||||
|
||||
/// <summary>
|
||||
/// Parametri configurazione (es IP target, porta, ...)
|
||||
/// </summary>
|
||||
public Dictionary<string, string> setupParams { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public class RedisIobCache
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Connessione lazy a redis...
|
||||
/// </summary>
|
||||
private Lazy<ConnectionMultiplexer> lazyConnection = new Lazy<ConnectionMultiplexer>(() =>
|
||||
{
|
||||
string RedisConn = utils.CRS("RedisConn");
|
||||
if (string.IsNullOrEmpty(RedisConn))
|
||||
{
|
||||
RedisConn = "localhost,abortConnect=false,ssl=false";
|
||||
}
|
||||
|
||||
return ConnectionMultiplexer.Connect(RedisConn);
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Connessione lazy a redis...
|
||||
/// </summary>
|
||||
private Lazy<ConnectionMultiplexer> lazyConnectionAdmin = new Lazy<ConnectionMultiplexer>(() =>
|
||||
{
|
||||
string RedisConnAdmin = utils.CRS("RedisConnAdmin");
|
||||
if (string.IsNullOrEmpty(RedisConnAdmin))
|
||||
{
|
||||
RedisConnAdmin = "localhost,abortConnect=false,ssl=false,allowAdmin=true";
|
||||
}
|
||||
|
||||
return ConnectionMultiplexer.Connect(RedisConnAdmin);
|
||||
});
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Cod IOB
|
||||
/// </summary>
|
||||
protected string CodIob = "000";
|
||||
|
||||
/// <summary>
|
||||
/// Hash redis x dati IOB
|
||||
/// </summary>
|
||||
protected string redIobKey = "";
|
||||
|
||||
/// <summary>
|
||||
/// Hash redis x dati server
|
||||
/// </summary>
|
||||
protected string redServKey = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
@@ -225,15 +178,6 @@ namespace IOB_MAN
|
||||
|
||||
#endregion Public Enums
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto currentDb locale
|
||||
/// </summary>
|
||||
private IDatabase _currDB { get; set; }
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
@@ -385,36 +329,11 @@ namespace IOB_MAN
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Effettua comaprazione x CHIAVE in KVP ASC
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
private int CompareKey(KeyValuePair<string, int> x, KeyValuePair<string, int> y)
|
||||
{
|
||||
return x.Key.CompareTo(y.Key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua comaprazione x CHIAVE in KVP DESC
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
private int CompareKeyDesc(KeyValuePair<string, int> x, KeyValuePair<string, int> y)
|
||||
{
|
||||
return y.Key.CompareTo(x.Key);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da funzionalita' DbConfig) + keyName richiesto...
|
||||
/// Nome della variabile HASH da utilizzare (dato CodModulo / Server / DB impiegato da
|
||||
/// funzionalita' DbConfig) + keyName richiesto...
|
||||
/// </summary>
|
||||
public static string redHash(string keyName)
|
||||
{
|
||||
@@ -556,8 +475,7 @@ namespace IOB_MAN
|
||||
public int redCountKey(string keyPattern)
|
||||
{
|
||||
int answ = 0;
|
||||
// cerco se ci sia valore in redis...
|
||||
// se vuoto = ALL...
|
||||
// cerco se ci sia valore in redis... se vuoto = ALL...
|
||||
keyPattern = string.IsNullOrEmpty(keyPattern) ? "**" : keyPattern;
|
||||
try
|
||||
{
|
||||
@@ -607,8 +525,7 @@ namespace IOB_MAN
|
||||
public bool redFlushKey(string keyPattern)
|
||||
{
|
||||
bool answ = false;
|
||||
// cerco se ci sia valore in redis...
|
||||
// se vuoto = ALL...
|
||||
// cerco se ci sia valore in redis... se vuoto = ALL...
|
||||
keyPattern = string.IsNullOrEmpty(keyPattern) ? "**" : keyPattern;
|
||||
try
|
||||
{
|
||||
@@ -895,7 +812,9 @@ namespace IOB_MAN
|
||||
/// </summary>
|
||||
/// <param name="hashKey">chiave</param>
|
||||
/// <param name="hashFields">valori</param>
|
||||
/// <param name="expireSeconds">scadenza preimpostata hash (secondi) | defaoult = -1 (non scade)</param>
|
||||
/// <param name="expireSeconds">
|
||||
/// scadenza preimpostata hash (secondi) | defaoult = -1 (non scade)
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public bool redSaveHash(string hashKey, KeyValuePair<string, string>[] hashFields, double expireSeconds = -1)
|
||||
{
|
||||
@@ -953,7 +872,9 @@ namespace IOB_MAN
|
||||
/// </summary>
|
||||
/// <param name="hashKey">chiave</param>
|
||||
/// <param name="hashFields">valori</param>
|
||||
/// <param name="expireSeconds">scadenza preimpostata hash (secondi) | defaoult = -1 (non scade)</param>
|
||||
/// <param name="expireSeconds">
|
||||
/// scadenza preimpostata hash (secondi) | defaoult = -1 (non scade)
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public bool redSaveHashDict(string hashKey, Dictionary<string, string> hashFields, double expireSeconds = -1)
|
||||
{
|
||||
@@ -1109,7 +1030,7 @@ namespace IOB_MAN
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salva un set KVP (Key Value Pair) in RedisCache
|
||||
/// Salva un set KVP (Key Value Pair) in RedisCache
|
||||
/// </summary>
|
||||
/// <param name="valori">Set KVP chiave-valore da salvare</param>
|
||||
/// <returns></returns>
|
||||
@@ -1174,6 +1095,92 @@ namespace IOB_MAN
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Cod IOB
|
||||
/// </summary>
|
||||
protected string CodIob = "000";
|
||||
|
||||
/// <summary>
|
||||
/// Hash redis x dati IOB
|
||||
/// </summary>
|
||||
protected string redIobKey = "";
|
||||
|
||||
/// <summary>
|
||||
/// Hash redis x dati server
|
||||
/// </summary>
|
||||
protected string redServKey = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// Connessione lazy a redis...
|
||||
/// </summary>
|
||||
private Lazy<ConnectionMultiplexer> lazyConnection = new Lazy<ConnectionMultiplexer>(() =>
|
||||
{
|
||||
string RedisConn = utils.CRS("RedisConn");
|
||||
if (string.IsNullOrEmpty(RedisConn))
|
||||
{
|
||||
RedisConn = "localhost,abortConnect=false,ssl=false";
|
||||
}
|
||||
|
||||
return ConnectionMultiplexer.Connect(RedisConn);
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Connessione lazy a redis...
|
||||
/// </summary>
|
||||
private Lazy<ConnectionMultiplexer> lazyConnectionAdmin = new Lazy<ConnectionMultiplexer>(() =>
|
||||
{
|
||||
string RedisConnAdmin = utils.CRS("RedisConnAdmin");
|
||||
if (string.IsNullOrEmpty(RedisConnAdmin))
|
||||
{
|
||||
RedisConnAdmin = "localhost,abortConnect=false,ssl=false,allowAdmin=true";
|
||||
}
|
||||
|
||||
return ConnectionMultiplexer.Connect(RedisConnAdmin);
|
||||
});
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto currentDb locale
|
||||
/// </summary>
|
||||
private IDatabase _currDB { get; set; }
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Effettua comaprazione x CHIAVE in KVP ASC
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
private int CompareKey(KeyValuePair<string, int> x, KeyValuePair<string, int> y)
|
||||
{
|
||||
return x.Key.CompareTo(y.Key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua comaprazione x CHIAVE in KVP DESC
|
||||
/// </summary>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
/// <returns></returns>
|
||||
private int CompareKeyDesc(KeyValuePair<string, int> x, KeyValuePair<string, int> y)
|
||||
{
|
||||
return y.Key.CompareTo(x.Key);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -48,12 +48,12 @@
|
||||
name="f"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}|${exception:format=tostring}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.log"
|
||||
archiveNumbering="Sequence"
|
||||
archiveEvery="Day"
|
||||
archiveOldFileOnStartup="true"
|
||||
maxArchiveFiles="90"
|
||||
enableArchiveFileCompression="true"
|
||||
enableArchiveFileCompression="false"
|
||||
keepFileOpen="true"
|
||||
/>-->
|
||||
<!--<target name="fAsync" xsi:type="AsyncWrapper" queueLimit="5" overflowAction="Discard">
|
||||
@@ -61,12 +61,12 @@
|
||||
keepFileOpen="true"
|
||||
fileName="${basedir}/logs/${shortdate}_${var:codIOB:default=0000}.log"
|
||||
layout="${longdate}|${uppercase:${level}}|${var:codIOB:default=0000}|${callsite}|${message}|${exception:format=tostring}"
|
||||
archiveFileName="${basedir}/logs/${shortdate}_${var:codIOB:default=0000}.{###}.zip"
|
||||
archiveFileName="${basedir}/logs/${shortdate}_${var:codIOB:default=0000}.{###}.log"
|
||||
archiveNumbering="Sequence"
|
||||
archiveEvery="Day"
|
||||
archiveOldFileOnStartup="true"
|
||||
maxArchiveFiles="0"
|
||||
enableArchiveFileCompression="true"
|
||||
enableArchiveFileCompression="false"
|
||||
/>
|
||||
</target>-->
|
||||
</targets>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
name="f_base"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.log"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
@@ -23,7 +23,7 @@
|
||||
name="f_error"
|
||||
fileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.log"
|
||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}${newline}${exception:format=tostring}"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.zip"
|
||||
archiveFileName="${logDir}/${var:codIOB:default=0000}/${shortdate}.{###}.log"
|
||||
archiveNumbering="Sequence"
|
||||
archiveAboveSize="10240000"
|
||||
maxArchiveFiles="60"
|
||||
@@ -33,7 +33,7 @@
|
||||
</targets>
|
||||
<rules>
|
||||
<!-- Logging Levels (Trace, Debug, Info, Warn, Error, Fatal)-->
|
||||
<logger name="*" minlevel="{{minLevel}}" maxlevel="Warn" final="true" writeTo="f_base" />
|
||||
<logger name="*" minlevel="{{minLevel}}" maxlevel="Warn" final="true" writeTo="f_base" />
|
||||
<logger name="*" minlevel="Error" writeTo="f_error" />
|
||||
</rules>
|
||||
</nlog>
|
||||
|
||||
+19
-21
@@ -1,43 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Crc32C.NET" version="1.0.5.0" targetFramework="net461" />
|
||||
<package id="DnsClient" version="1.5.0" targetFramework="net462" />
|
||||
<package id="MapoSDK" version="6.14.2109.2809" targetFramework="net462" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net462" />
|
||||
<package id="MongoDB.Bson" version="2.13.2" targetFramework="net462" />
|
||||
<package id="MongoDB.Driver" version="2.13.2" targetFramework="net462" />
|
||||
<package id="MongoDB.Driver.Core" version="2.13.2" targetFramework="net462" />
|
||||
<package id="MongoDB.Libmongocrypt" version="1.2.3" targetFramework="net462" />
|
||||
<package id="DnsClient" version="1.6.0" targetFramework="net462" />
|
||||
<package id="MapoSDK" version="6.14.2204.2616" targetFramework="net462" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net462" />
|
||||
<package id="MongoDB.Bson" version="2.15.0" targetFramework="net462" />
|
||||
<package id="MongoDB.Driver" version="2.15.0" targetFramework="net462" />
|
||||
<package id="MongoDB.Driver.Core" version="2.15.0" targetFramework="net462" />
|
||||
<package id="MongoDB.Libmongocrypt" version="1.3.0" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.12" targetFramework="net462" />
|
||||
<package id="NLog" version="4.7.15" targetFramework="net462" />
|
||||
<package id="NLog.Config" version="4.7.12" targetFramework="net462" />
|
||||
<package id="NLog.Schema" version="4.7.12" targetFramework="net462" />
|
||||
<package id="Pipelines.Sockets.Unofficial" version="2.2.0" targetFramework="net462" />
|
||||
<package id="Pipelines.Sockets.Unofficial" version="2.2.2" targetFramework="net462" />
|
||||
<package id="PrettyBin" version="1.1.0" targetFramework="net461" />
|
||||
<package id="RestSharp" version="106.15.0" targetFramework="net462" />
|
||||
<package id="RestSharp.Serializers.NewtonsoftJson" version="106.15.0" targetFramework="net462" />
|
||||
<package id="SharpCompress" version="0.30.0" targetFramework="net462" />
|
||||
<package id="SharpCompress" version="0.31.0" targetFramework="net462" />
|
||||
<package id="SharpZipLib" version="1.3.3" targetFramework="net462" />
|
||||
<package id="Snappy.NET" version="1.1.1.8" targetFramework="net461" />
|
||||
<package id="StackExchange.Redis" version="2.2.79" targetFramework="net462" />
|
||||
<package id="SteamWare.IO" version="5.1.2109.1716" targetFramework="net462" />
|
||||
<package id="SteamWare.Logger" version="5.1.2109.1716" targetFramework="net462" />
|
||||
<package id="Steamware.Scheduler" version="5.1.2109.1716" targetFramework="net462" />
|
||||
<package id="StackExchange.Redis" version="2.5.61" targetFramework="net462" />
|
||||
<package id="SteamWare.IO" version="5.2.2205.1719" targetFramework="net462" />
|
||||
<package id="SteamWare.Logger" version="5.2.2205.1719" targetFramework="net462" />
|
||||
<package id="SteamWare.Scheduler" version="5.2.2205.1719" targetFramework="net462" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
|
||||
<package id="System.Diagnostics.PerformanceCounter" version="5.0.1" targetFramework="net462" />
|
||||
<package id="System.Diagnostics.PerformanceCounter" version="6.0.1" targetFramework="net462" />
|
||||
<package id="System.IO.Compression" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.IO.Pipelines" version="5.0.1" targetFramework="net462" />
|
||||
<package id="System.IO.Pipelines" version="6.0.2" targetFramework="net462" />
|
||||
<package id="System.Memory" version="4.5.4" targetFramework="net462" />
|
||||
<package id="System.Net.Http" version="4.3.4" targetFramework="net462" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net462" />
|
||||
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net462" />
|
||||
<package id="System.Text.Encoding.CodePages" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Threading.Channels" version="5.0.0" targetFramework="net462" />
|
||||
<package id="System.Text.Encoding.CodePages" version="6.0.0" targetFramework="net462" />
|
||||
<package id="System.Threading.Channels" version="6.0.0" targetFramework="net462" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -6,20 +6,6 @@ namespace IOB_UT_NEXT
|
||||
{
|
||||
public class BinaryUtils : IFormatProvider, ICustomFormatter
|
||||
{
|
||||
#region Private Methods
|
||||
|
||||
private string HandleOtherFormats(string format, object arg)
|
||||
{
|
||||
if (arg is IFormattable)
|
||||
return ((IFormattable)arg).ToString(format, CultureInfo.CurrentCulture);
|
||||
else if (arg != null)
|
||||
return arg.ToString();
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
// Format number in binary (B), octal (O), or hexadecimal (H).
|
||||
@@ -29,8 +15,7 @@ namespace IOB_UT_NEXT
|
||||
int baseNumber;
|
||||
// Handle null or empty format string, string with precision specifier.
|
||||
string thisFmt = String.Empty;
|
||||
// Extract first character of format string (precision specifiers
|
||||
// are not supported).
|
||||
// Extract first character of format string (precision specifiers are not supported).
|
||||
if (!String.IsNullOrEmpty(format))
|
||||
thisFmt = format.Length > 1 ? format.Substring(0, 1) : format;
|
||||
|
||||
@@ -140,5 +125,19 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private string HandleOtherFormats(string format, object arg)
|
||||
{
|
||||
if (arg is IFormattable)
|
||||
return ((IFormattable)arg).ToString(format, CultureInfo.CurrentCulture);
|
||||
else if (arg != null)
|
||||
return arg.ToString();
|
||||
else
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
public class BitConditionCheck
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza un oggetto da usare per testing bit condition
|
||||
/// </summary>
|
||||
/// <param name="keyName">Nome della chiave registrata</param>
|
||||
/// <param name="rawConf">Configurazione nel formato BaseAddr.BitNum=ValOk</param>
|
||||
public BitConditionCheck(string keyName, string rawConf)
|
||||
{
|
||||
Logging.Instance.Info($"Init BitConditionCheck | {keyName} | {rawConf}");
|
||||
KeyName = keyName;
|
||||
RawVal = rawConf;
|
||||
string sVal = "";
|
||||
int valDecoded = 0;
|
||||
// check preliminare
|
||||
if (rawConf.Contains(".") && rawConf.Contains("="))
|
||||
{
|
||||
// splitto per "="...
|
||||
var splitCond = rawConf.Split('=');
|
||||
sVal = splitCond[1];
|
||||
int.TryParse(sVal, out valDecoded);
|
||||
ValOk = valDecoded;
|
||||
// il restante splitto per "."
|
||||
var splitMem = splitCond[0].Split('.');
|
||||
// BaseAddr
|
||||
sVal = splitMem[0];
|
||||
int.TryParse(sVal, out valDecoded);
|
||||
BaseAddr = valDecoded;
|
||||
// BitNum
|
||||
sVal = splitMem[1];
|
||||
int.TryParse(sVal, out valDecoded);
|
||||
BitNum = valDecoded;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza un oggetto fake/empty
|
||||
/// </summary>
|
||||
public BitConditionCheck()
|
||||
{
|
||||
Logging.Instance.Info("Init empty BitConditionCheck");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza un oggetto solo per key
|
||||
/// </summary>
|
||||
/// <param name="keyName">Nome della chiave registrata</param>
|
||||
public BitConditionCheck(string keyName)
|
||||
{
|
||||
Logging.Instance.Info($"Init BitConditionCheck | {keyName}");
|
||||
KeyName = keyName;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Indirizzo base x memoria da testare come bit condition
|
||||
/// </summary>
|
||||
public int BaseAddr { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Numero bit da impiegare
|
||||
/// </summary>
|
||||
public int BitNum { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Valore chiave
|
||||
/// </summary>
|
||||
public string KeyName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Valore raw decodificato
|
||||
/// </summary>
|
||||
public string RawVal { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Valore target che porta a condizione OK = true
|
||||
/// </summary>
|
||||
public int ValOk { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static IOB_UT_NEXT.CustomObj;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
public class CustomObj
|
||||
{
|
||||
public class ArtRow
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Description("Matricola_articolo")]
|
||||
public string Matricola { get; set; } = "";
|
||||
|
||||
[Description("Articolo")]
|
||||
//[Display(Name = "Articolo", Order = 1)]
|
||||
public string Articolo { get; set; } = "";
|
||||
|
||||
[Description("Identificazione")]
|
||||
//[Display(Name = "Identificazione", Order = 2)]
|
||||
public string Descrizione { get; set; } = "";
|
||||
|
||||
|
||||
[Description("Peso_teorico_linea1[ton]")]
|
||||
public int Peso_01 { get; set; } = 0;
|
||||
|
||||
[Description("Peso_teorico_linea2[ton]")]
|
||||
public int Peso_02 { get; set; } = 0;
|
||||
|
||||
[Description("Peso_teorico_linea3[ton]")]
|
||||
public int Peso_03 { get; set; } = 0;
|
||||
|
||||
[Description("Peso_teorico_linea4[ton]")]
|
||||
public int Peso_04 { get; set; } = 0;
|
||||
|
||||
[Description("Pos. Carrello 1[mm]")]
|
||||
public int PosizCarrello_01 { get; set; } = 0;
|
||||
|
||||
[Description("Pos. Carrello 2[mm]")]
|
||||
public int PosizCarrello_02 { get; set; } = 0;
|
||||
|
||||
[Description("Pos. Carrello 3[mm]")]
|
||||
public int PosizCarrello_03 { get; set; } = 0;
|
||||
|
||||
[Description("Pos. Carrello 4[mm]")]
|
||||
public int PosizCarrello_04 { get; set; } = 0;
|
||||
|
||||
[Description("Limitazione_velocita_sollevamento[%]")]
|
||||
//[Display(Name = "Limitazione_velocita_sollevamento[%]", Order = 3)]
|
||||
public int LimiteVel { get; set; } = 100;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public class JobRow
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Description("Matricola")]
|
||||
public string Matricola { get; set; } = "";
|
||||
|
||||
[Description("Commessa")]
|
||||
public string Commessa { get; set; } = "";
|
||||
|
||||
[Description("Articolo")]
|
||||
public string Articolo { get; set; } = "";
|
||||
|
||||
[Description("Identificazione")]
|
||||
public string Descrizione { get; set; } = "";
|
||||
|
||||
[Description("Data inserimento")]
|
||||
public string DataIns { get; set; } = "";
|
||||
|
||||
[Description("Ora inserimento")]
|
||||
public string OraIns { get; set; } = "";
|
||||
|
||||
[Description("Lavorazione")]
|
||||
public string Lavorazione { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
public partial class AnagArticoli
|
||||
{
|
||||
|
||||
public string CodArticolo { get; set; }
|
||||
public string DescArticolo { get; set; }
|
||||
public string Disegno { get; set; }
|
||||
public string Tipo { get; set; }
|
||||
public string Azienda { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class PODLModel
|
||||
{
|
||||
public int IdxPromessa { get; set; } = 0;
|
||||
public string KeyRichiesta { get; set; } = "";
|
||||
public string KeyBCode { get; set; } = "";
|
||||
public bool Attivabile { get; set; } = false;
|
||||
public int IdxOdl { get; set; } = 0;
|
||||
public string CodArticolo { get; set; } = "";
|
||||
public string CodGruppo { get; set; } = "";
|
||||
public string IdxMacchina { get; set; }
|
||||
public int NumPezzi { get; set; } = 1;
|
||||
public decimal Tcassegnato { get; set; } = 1;
|
||||
public DateTime? DueDate { get; set; }
|
||||
public int Priorita { get; set; } = 1;
|
||||
public int PzPallet { get; set; } = 1;
|
||||
public string Note { get; set; } = "";
|
||||
public string CodCli { get; set; } = "";
|
||||
public DateTime InsertDate { get; set; } = DateTime.Now;
|
||||
|
||||
public string CodFase
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "*";
|
||||
var allData = KeyRichiesta.Split('_');
|
||||
if (allData.Length > 0)
|
||||
{
|
||||
answ = allData[0];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
public class DossiersModel
|
||||
{
|
||||
|
||||
public int IdxDossier { get; set; } = 0;
|
||||
|
||||
public string DataType { get; set; } = "";
|
||||
|
||||
public DateTime DtRif { get; set; } = DateTime.Now;
|
||||
|
||||
public string IdxMacchina { get; set; } = "";
|
||||
|
||||
public int IdxODL { get; set; } = 0;
|
||||
|
||||
public string CodArticolo { get; set; } = "";
|
||||
|
||||
public string Valore { get; set; } = "";
|
||||
|
||||
}
|
||||
|
||||
public class DossierFluxLogDTO
|
||||
{
|
||||
public List<FluxLog> ODL { get; set; } = new List<FluxLog>();
|
||||
}
|
||||
public class FluxLog
|
||||
{
|
||||
public string IdxMacchina { get; set; }
|
||||
|
||||
public DateTime dtEvento { get; set; }
|
||||
|
||||
public string CodFlux { get; set; }
|
||||
|
||||
public string Valore { get; set; } = "";
|
||||
|
||||
public string ValoreEdit { get; set; } = "";
|
||||
|
||||
public int Cnt { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public partial class ListVal
|
||||
{
|
||||
|
||||
public string value { get; set; }
|
||||
public string label { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
public class DataExport
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio in file di un generico oggetto in formato CSV
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="reportData"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="writeHeader">Indica se scrivere header ad inizio CSV</param>
|
||||
/// <param name="separator">Separatore da impiegare (default ";")</param>
|
||||
/// <returns></returns>
|
||||
public static bool SaveToCsv<T>(List<T> reportData, string path, bool writeHeader, char separator = ';')
|
||||
{
|
||||
bool answ = false;
|
||||
var lines = new List<string>();
|
||||
try
|
||||
{
|
||||
IEnumerable<PropertyDescriptor> props = TypeDescriptor.GetProperties(typeof(T)).OfType<PropertyDescriptor>();
|
||||
var elencoValori = props.ToList();
|
||||
var header = string.Join($"{separator}", props.ToList().Select(x => !string.IsNullOrEmpty(x.Description) ? x.Description : x.Name));
|
||||
var fieldList = string.Join($"{separator}", props.ToList().Select(x => x.Name));
|
||||
if (writeHeader)
|
||||
{
|
||||
lines.Add(header);
|
||||
}
|
||||
var valueLines = reportData.Select(row => string.Join($"{separator}", fieldList.Split(separator).Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
|
||||
//var valueLines = reportData.Select(row => string.Join(";", header.Split(';').Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
|
||||
lines.AddRange(valueLines);
|
||||
File.WriteAllLines(path, lines.ToArray());
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
+128
-45
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
@@ -11,7 +8,7 @@ namespace IOB_UT_NEXT
|
||||
public enum boolCheckMode
|
||||
{
|
||||
/// <summary>
|
||||
/// AND: tutte vere -> true
|
||||
/// AND: tutte vere -> true
|
||||
/// </summary>
|
||||
AND = 0,
|
||||
|
||||
@@ -22,14 +19,24 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modalità gestione setup macchina
|
||||
/// Modalità di calcolo tra serie di valori
|
||||
/// </summary>
|
||||
public enum MachineSetupMode
|
||||
public enum calcMode
|
||||
{
|
||||
ND=0,
|
||||
/// <summary>
|
||||
/// NEssun processing
|
||||
/// </summary>
|
||||
None = 0,
|
||||
|
||||
// Modalità Mecolpress (3 parametri IN, se variati --> porto a 1 la variabile di controllo)
|
||||
MECOLPRESS = 1
|
||||
/// <summary>
|
||||
/// somma dei valori
|
||||
/// </summary>
|
||||
sum,
|
||||
|
||||
/// <summary>
|
||||
/// produttoria
|
||||
/// </summary>
|
||||
prod
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -182,6 +189,31 @@ namespace IOB_UT_NEXT
|
||||
VLF
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modalità gestione setup macchina
|
||||
/// </summary>
|
||||
public enum MachineSetupMode
|
||||
{
|
||||
ND = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Modalità Mecolpress (3 parametri IN, se variati --> porto a 1 la variabile di controllo)
|
||||
/// </summary>
|
||||
MECOLPRESS = 1
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tipo di memoria Modbus
|
||||
/// </summary>
|
||||
public enum modbusMemType
|
||||
{
|
||||
Coil = 0,
|
||||
DiscreteInput = 1,
|
||||
NotDefined = 2,
|
||||
InputRegister = 3,
|
||||
HoldingRegister = 4
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// StFlag32: set di 32 bit (4 word) contente semaforo di variabili
|
||||
/// </summary>
|
||||
@@ -281,10 +313,20 @@ namespace IOB_UT_NEXT
|
||||
//FILE_XYLOG,
|
||||
|
||||
/// <summary>
|
||||
/// adapter KAWASAKI e-controller
|
||||
/// Adapter KAWASAKI e-controller
|
||||
/// </summary>
|
||||
KAWASAKI,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Icoel per DB (barcode, tracciatura, produzione,...)
|
||||
/// </summary>
|
||||
IcoelDb,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Icoel per WS SOAP (sizer)
|
||||
/// </summary>
|
||||
IcoelSoap,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter non specificato
|
||||
/// </summary>
|
||||
@@ -300,6 +342,16 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
MODBUS_TCP_CEDAX,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter ModBus TCP versione Centerfrigo (Giacovelli)
|
||||
/// </summary>
|
||||
MODBUS_TCP_CENTERFRIGO,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter modbus (+ file) x FIMAT (Tenditalia)
|
||||
/// </summary>
|
||||
MODBUS_TCP_FIMAT,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter ModBus TCP versione HAM (Pizzaferri)
|
||||
/// </summary>
|
||||
@@ -310,6 +362,26 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
MODBUS_TCP_HELPI,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Modubus TCP versione IMAX Aeromacchine (Jetco)
|
||||
/// </summary>
|
||||
MODBUS_TCP_IMAS_AEROMEC,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Modubus TCP versione Rimor (IMI Remosa)
|
||||
/// </summary>
|
||||
MODBUS_TCP_RIMOR,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Modubus TCP versione Saim (Giacovelli)
|
||||
/// </summary>
|
||||
MODBUS_TCP_SAIM,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Modubus TCP versione Zetapack (Giacovelli)
|
||||
/// </summary>
|
||||
MODBUS_TCP_ZETAPACK,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter MTConnect
|
||||
/// </summary>
|
||||
@@ -330,11 +402,6 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
OpcUaCMS,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA SCM
|
||||
/// </summary>
|
||||
OpcUaSCM,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per Ewon
|
||||
/// </summary>
|
||||
@@ -355,6 +422,21 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
OpcUaEwonMecolpress,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per IMAS Aeromec / Jetco
|
||||
/// </summary>
|
||||
OpcUaImasAeromec,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter MBH (es Cimolai)
|
||||
/// </summary>
|
||||
OpcUaMBH,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter MBH implementazione Cimolai x travel lift
|
||||
/// </summary>
|
||||
OpcUaMBHCimolai,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OMRON (es ICOEL)
|
||||
/// </summary>
|
||||
@@ -365,6 +447,26 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
OpcUaOmronIcoel,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA SCM
|
||||
/// </summary>
|
||||
OpcUaSCM,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA Siemens generico
|
||||
/// </summary>
|
||||
OpcUaSiemens,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA Siemens OMP
|
||||
/// </summary>
|
||||
OpcUaSiemensOMP,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA Ulma (packaging, Giacovelli)
|
||||
/// </summary>
|
||||
OpcUaUlma,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OSAI CNDEX (Cndex)
|
||||
/// </summary>
|
||||
@@ -396,7 +498,7 @@ namespace IOB_UT_NEXT
|
||||
SIEMENS_APROCHIM,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione VIPA @2001
|
||||
/// Adapter SIEMENS, interfaccia versione VIPA @2001
|
||||
/// </summary>
|
||||
SIEMENS_AT2001,
|
||||
|
||||
@@ -430,6 +532,11 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
SIEMENS_LASCO,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione NWSE (Giacovelli, impianto filtrazione NWS)
|
||||
/// </summary>
|
||||
SIEMENS_NWSE,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione PRESSOIL + CEI (Valvital, Pressa Idraulica)
|
||||
/// </summary>
|
||||
@@ -461,35 +568,6 @@ namespace IOB_UT_NEXT
|
||||
WPS
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Enumerazione tipi di semaforo
|
||||
/// </summary>
|
||||
public enum Semaforo
|
||||
{
|
||||
/// <summary>
|
||||
/// Stato non definito
|
||||
/// </summary>
|
||||
ND,
|
||||
/// <summary>
|
||||
/// Verde
|
||||
/// </summary>
|
||||
SV,
|
||||
/// <summary>
|
||||
/// Giallo
|
||||
/// </summary>
|
||||
SG,
|
||||
/// <summary>
|
||||
/// Rosso
|
||||
/// </summary>
|
||||
SR,
|
||||
/// <summary>
|
||||
/// Grigio/Spento
|
||||
/// </summary>
|
||||
SS
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Enumerazione tipi di tipi di URL x invio
|
||||
/// </summary>
|
||||
@@ -505,6 +583,11 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
SignIN,
|
||||
|
||||
/// <summary>
|
||||
/// Salvataggio RawTransf (valori raw da decodificare a valle)
|
||||
/// </summary>
|
||||
RawTransf,
|
||||
|
||||
/// <summary>
|
||||
/// Salvataggio UserLog (valori log attività utente)
|
||||
/// </summary>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
@@ -39,7 +36,8 @@ namespace IOB_UT_NEXT
|
||||
TimeSet,
|
||||
|
||||
/// <summary>
|
||||
/// Verificato il canale di comunicazione è OK, fatta pulizia con AbortAll, NON ci sono report attivi
|
||||
/// Verificato il canale di comunicazione è OK, fatta pulizia con AbortAll, NON ci sono
|
||||
/// report attivi
|
||||
/// </summary>
|
||||
ChannelOk,
|
||||
|
||||
@@ -106,7 +104,7 @@ namespace IOB_UT_NEXT
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// Array delel sessioni attive
|
||||
/// Array delle sessioni attive
|
||||
/// </summary>
|
||||
public Dictionary<int, Session> ActiveSessions = new Dictionary<int, Session>();
|
||||
|
||||
@@ -135,7 +133,8 @@ namespace IOB_UT_NEXT
|
||||
public int PzPallet { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se sia possibile impostare i pezzi pallet dal server, ed in tal caso moltiplica i pezzi letti dalla macchina per il valore pzPallet (vedi sopra)
|
||||
/// Indica se sia possibile impostare i pezzi pallet dal server, ed in tal caso
|
||||
/// moltiplica i pezzi letti dalla macchina per il valore pzPallet (vedi sopra)
|
||||
/// </summary>
|
||||
public bool SetPzPalletFromSrv { get; set; } = false;
|
||||
|
||||
@@ -170,7 +169,8 @@ namespace IOB_UT_NEXT
|
||||
public List<FileTask> FileList { get; set; } = new List<FileTask>();
|
||||
|
||||
/// <summary>
|
||||
/// Numero MAX di esecuzioni da mantenere in HIST prima di eliminare i + vecchi (fare folder HIST\SESSnnnn)
|
||||
/// Numero MAX di esecuzioni da mantenere in HIST prima di eliminare i + vecchi (fare
|
||||
/// folder HIST\SESSnnnn)
|
||||
/// </summary>
|
||||
public int Max2Keep { get; set; } = 50;
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace IOB_UT_NEXT
|
||||
public string RespOk { get; set; } = "PROCESSED";
|
||||
|
||||
/// <summary>
|
||||
/// Seconds before do a new retry (default = 0 --> no veto)
|
||||
/// Seconds before do a new retry (default = 0 --> no veto)
|
||||
/// </summary>
|
||||
public double RetrySec { get; set; } = 0;
|
||||
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
public class FileProcMan
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public FileProcMan(string archiveDir, string convertDir, string toolDir, string exeFileName, string refConfFileName, string sheetName)
|
||||
{
|
||||
this.archDir = archiveDir;
|
||||
this.convDir = convertDir;
|
||||
this.confFileNameOut = "conf.json";
|
||||
this.baseDir = toolDir;
|
||||
this.exeName = exeFileName;
|
||||
this.sheetName = sheetName;
|
||||
appPath = Path.Combine(baseDir, exeName);
|
||||
// leggo file di conf base
|
||||
string refConfFile = Path.Combine(baseDir, refConfFileName);
|
||||
this.refConf = File.ReadAllText(refConfFile);
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Processa il singolo file e riporta tempo esecuzione
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public TimeSpan doProcess(string fPath, int idxODL)
|
||||
{
|
||||
TimeSpan outVal = new TimeSpan();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
// preparo file conf
|
||||
createConfFile(fPath, idxODL);
|
||||
// avvio processing
|
||||
Console.WriteLine("calling ext app with args:");
|
||||
Console.WriteLine($"{appPath} {confFileNameOut}");
|
||||
Console.WriteLine();
|
||||
|
||||
ProcessStartInfo psi = new ProcessStartInfo
|
||||
{
|
||||
FileName = appPath,
|
||||
Arguments = $"{confFileNameOut}",
|
||||
WindowStyle = ProcessWindowStyle.Minimized,
|
||||
//WindowStyle = ProcessWindowStyle.Hidden,
|
||||
UseShellExecute = false,
|
||||
//CreateNoWindow = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardInput = true,
|
||||
};
|
||||
|
||||
sw.Start();
|
||||
|
||||
Process p = Process.Start(psi);
|
||||
|
||||
string q = "";
|
||||
while (!p.HasExited)
|
||||
{
|
||||
q += p.StandardOutput.ReadToEnd();
|
||||
}
|
||||
|
||||
sw.Stop();
|
||||
outVal = sw.Elapsed;
|
||||
|
||||
return outVal;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string appPath = "";
|
||||
protected string archDir = "";
|
||||
protected string baseDir = "";
|
||||
protected string confFileNameOut = "";
|
||||
protected string convDir = "";
|
||||
protected string exeName = "";
|
||||
protected string refConf = "";
|
||||
protected string sheetName = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void createConfFile(string item, int idxOdl)
|
||||
{
|
||||
string outFileName = Path.GetFileName(item).Replace("xlsx", "json");
|
||||
string rawContent = String.Copy(refConf);
|
||||
rawContent = rawContent.Replace("{{ArchiveDir}}", fixJsonDir(archDir));
|
||||
rawContent = rawContent.Replace("{{ConvertDir}}", fixJsonDir(convDir));
|
||||
rawContent = rawContent.Replace("{{FileInPath}}", fixJsonDir(item));
|
||||
rawContent = rawContent.Replace("{{FileOutPath}}", outFileName);
|
||||
rawContent = rawContent.Replace("{{TargetSheetName}}", sheetName);
|
||||
rawContent = rawContent.Replace("987654321", $"{idxOdl}");
|
||||
// calcolo nome file conf specifico
|
||||
confFileNameOut = $"conf_{outFileName}";
|
||||
File.WriteAllText(confFileNameOut, rawContent);
|
||||
}
|
||||
|
||||
protected string fixJsonDir(string origPath)
|
||||
{
|
||||
string answ = JsonConvert.ToString(origPath);
|
||||
answ = answ.Substring(1, answ.Length - 2);
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -55,12 +55,31 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Remote_DEBUG\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Remote_DEBUG\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.1.9, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpZipLib.1.3.1\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MapoSDK, Version=6.14.2204.2115, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MapoSDK.6.14.2204.2115\lib\net40\MapoSDK.dll</HintPath>
|
||||
<Reference Include="MapoSDK, Version=6.14.2211.3016, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MapoSDK.6.14.2211.3016\lib\MapoSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
@@ -72,10 +91,10 @@
|
||||
<HintPath>..\packages\NLog.4.7.13\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.2.0\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
|
||||
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.2.2\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\StackExchange.Redis.2.2.4\lib\net461\StackExchange.Redis.dll</HintPath>
|
||||
<HintPath>..\packages\StackExchange.Redis.2.6.80\lib\net461\StackExchange.Redis.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
@@ -122,8 +141,16 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FileProcMan.cs" />
|
||||
<Compile Include="IntConditionCheck.cs" />
|
||||
<Compile Include="BitConditionCheck.cs" />
|
||||
<Compile Include="CustomObj.cs" />
|
||||
<Compile Include="DataExport.cs" />
|
||||
<Compile Include="Eurom63.cs" />
|
||||
<Compile Include="IobWinStatus.cs" />
|
||||
<Compile Include="plcMemMapExt.cs" />
|
||||
<Compile Include="TCMan.cs" />
|
||||
<Compile Include="TimeUtils.cs" />
|
||||
<Compile Include="ToMapo.cs" />
|
||||
<Compile Include="baseUtils.cs" />
|
||||
<Compile Include="BinaryFormatter.cs" />
|
||||
@@ -134,7 +161,6 @@
|
||||
<Compile Include="Objects.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RedisMan.cs" />
|
||||
<Compile Include="val.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ExtLib\krcc.dll" />
|
||||
|
||||
+64
-25
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
@@ -16,10 +16,6 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
// INI filename
|
||||
|
||||
// import windows dll functions
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
@@ -33,25 +29,6 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Private Methods
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileInt(string section, string key, int def, string filePath);
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileSection(string section, IntPtr retVal, uint size, string filePath);
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern bool WritePrivateProfileSection(string section, string value, string filePath);
|
||||
|
||||
[DllImport("kernel32", CharSet = CharSet.Auto, BestFitMapping = false)]
|
||||
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
@@ -149,7 +126,9 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// Section name
|
||||
/// <returns>restituisce delle stringhe keys=values da suddividere appunto come key/val successivamente</returns>
|
||||
/// <returns>
|
||||
/// restituisce delle stringhe keys=values da suddividere appunto come key/val successivamente
|
||||
/// </returns>
|
||||
public string[] ReadSection(string Section)
|
||||
{
|
||||
const int bufferSize = 2048; // max is 32767
|
||||
@@ -270,5 +249,65 @@ namespace IOB_UT_NEXT
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// GetPrivateProfileInt: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="def"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileInt(string section, string key, int def, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// GetPrivateProfileSection: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="retVal"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileSection(string section, IntPtr retVal, uint size, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// GetPrivateProfileString: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="def"></param>
|
||||
/// <param name="retVal"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// WritePrivateProfileSection: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern bool WritePrivateProfileSection(string section, string value, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// WritePrivateProfileString: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="val"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32", CharSet = CharSet.Auto, BestFitMapping = false)]
|
||||
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
public class IntConditionCheck
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza un oggetto da usare per testing INT condition
|
||||
/// </summary>
|
||||
/// <param name="keyName">Nome della chiave registrata</param>
|
||||
/// <param name="rawConf">Configurazione nel formato BaseAddr|IntIndex=ValOk</param>
|
||||
public IntConditionCheck(string keyName, string rawConf)
|
||||
{
|
||||
Logging.Instance.Info($"Init IntConditionCheck | {keyName} | {rawConf}");
|
||||
KeyName = keyName;
|
||||
RawVal = rawConf;
|
||||
string sVal = "";
|
||||
int valDecoded = 0;
|
||||
// check preliminare
|
||||
if (rawConf.Contains("|") && rawConf.Contains("="))
|
||||
{
|
||||
// splitto per "="...
|
||||
var splitCond = rawConf.Split('=');
|
||||
sVal = splitCond[1];
|
||||
// i valori INT sono "," separated
|
||||
var splitValOk = sVal.Split(',');
|
||||
ValOk = new int[splitValOk.Length];
|
||||
int i = 0;
|
||||
foreach (var item in splitValOk)
|
||||
{
|
||||
int.TryParse(item, out valDecoded);
|
||||
ValOk[i] = valDecoded;
|
||||
i++;
|
||||
}
|
||||
// il restante splitto per "."
|
||||
var splitMem = splitCond[0].Split('|');
|
||||
// BaseAddr
|
||||
sVal = splitMem[0];
|
||||
int.TryParse(sVal, out valDecoded);
|
||||
BaseAddr = valDecoded;
|
||||
// BitNum
|
||||
sVal = splitMem[1];
|
||||
int.TryParse(sVal, out valDecoded);
|
||||
IntIndex = valDecoded;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza un oggetto fake/empty
|
||||
/// </summary>
|
||||
public IntConditionCheck()
|
||||
{
|
||||
Logging.Instance.Info("Init empty IntConditionCheck");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inizializza un oggetto solo per key
|
||||
/// </summary>
|
||||
/// <param name="keyName">Nome della chiave registrata</param>
|
||||
public IntConditionCheck(string keyName)
|
||||
{
|
||||
Logging.Instance.Info($"Init IntConditionCheck | {keyName}");
|
||||
KeyName = keyName;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Indirizzo base x memoria da testare come iny condition
|
||||
/// </summary>
|
||||
public int BaseAddr { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Indirizzo base x memoria da testare come int condition (0/1) dell'int[], 2=DWord
|
||||
/// </summary>
|
||||
public int IntIndex { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Valore chiave
|
||||
/// </summary>
|
||||
public string KeyName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Valore raw decodificato
|
||||
/// </summary>
|
||||
public string RawVal { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Valore target che porta a condizione OK = true
|
||||
/// </summary>
|
||||
public int[] ValOk { get; set; } = new int[1];
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user