From 12aeb0e61bc3f177a9b85a6067d4909e925c8326 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Fri, 3 May 2019 10:08:01 +0300 Subject: stub and tpf --- .../Stubs Collection/stubs/FlashFileSystemInit.cs | 23 + .../stubs/technician view files/lp4 with waste.tpf | 2069 ++++++++++++++++++++ 2 files changed, 2092 insertions(+) create mode 100644 Software/Stubs Collection/stubs/FlashFileSystemInit.cs create mode 100644 Software/Stubs Collection/stubs/technician view files/lp4 with waste.tpf diff --git a/Software/Stubs Collection/stubs/FlashFileSystemInit.cs b/Software/Stubs Collection/stubs/FlashFileSystemInit.cs new file mode 100644 index 000000000..a10bc4ed4 --- /dev/null +++ b/Software/Stubs Collection/stubs/FlashFileSystemInit.cs @@ -0,0 +1,23 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +public void OnExecute(StubManager stubManager) +{ + + +ProgressRequest progressRequest = new ProgressRequest(); +progressRequest.Amount = 10; +progressRequest.Delay = 10; + + var response = stubManager.Run(progressRequest); + +} \ No newline at end of file diff --git a/Software/Stubs Collection/stubs/technician view files/lp4 with waste.tpf b/Software/Stubs Collection/stubs/technician view files/lp4 with waste.tpf new file mode 100644 index 000000000..1dc30cb3e --- /dev/null +++ b/Software/Stubs Collection/stubs/technician view files/lp4 with waste.tpf @@ -0,0 +1,2069 @@ + + + + + + Temperatures + + + 50bae43f-8b1a-4279-9238-b976a0c72af3 + 1530 + 193.19911504424795 + 169 + 181.37610619469029 + 0 + A8DB1D27-6B25-4FB4-A3F5-46A29BA51955 + -1 + 10 + 2 + + + 88d1ed8f-752b-4eb0-9dad-b47aee34d5db + 677 + 64.513274336283189 + 575 + 201.64159292035407 + 0 + AFB7B6F7-8FFB-4A7F-B814-04F0C163CAA1 + -14774017 + 1 + 701 + true + 0 + 300 + + + ba743caa-95f2-4b20-8c32-8e5943ada3fc + 144 + 589.78318584070769 + 380 + 194.54867256637203 + 0 + 78482AA4-3DF6-421F-944C-64328D3C3EF2 + -14774017 + 0 + 70 + 10 + true + + + e4892498-fa1a-413c-9dd8-633efaade51c + 561 + 638.02654867256649 + 203 + 160.09734513274339 + 0 + 75f69efe-1c7e-4015-a6eb-2686d4f67a67 + -1 + + + 1a243586-f54c-4208-bc29-458c45acd578 + 776 + 641.06637168141606 + 215 + 159.08407079646031 + 0 + b05b8324-022b-4d61-ae4a-33c97cd1f51b + -1 + + + c399ec1f-152e-4517-b6a3-c17bb445fc79 + 57 + 853.73451327433634 + 251 + 184.41592920353969 + 0 + 6f851979-d69c-4243-9383-1517a8bdc656 + -1 + 500 + + + 211ad3c8-3c39-47a1-88c0-089fb13678a0 + 361 + 858.80088495575251 + 245 + 204.68141592920335 + 0 + C8D8FE90-0375-44A2-A6D1-E997789E065C + -1 + 1700 + Dispenser 2 + + + 07ad9c30-c4cf-461a-904e-f6661d464c26 + 665 + 870.96017699115055 + 216 + 147.93805309734523 + 0 + 3bed8c31-bcd6-479b-8a5d-92ce8a5e4d41 + -1 + 500 + + + de829cd4-0493-48d3-ac3a-4b9db77f2f42 + 969 + 866.90707964601779 + 190 + 145.91150442477886 + 0 + 08ED9044-CAD6-4492-94B2-C07206E0164B + -1 + 1700 + Dispenser 3 + + + a15665e3-af39-42d8-8c06-97d770632e10 + 1289 + 72.951327433628364 + 207 + 184.4159292035398 + 0 + 6D6CFA18-5922-4AFE-84B3-2721CE128681 + -1 + + DryerAirHeater + 0 + 97.1 + false + false + true + + 0 + + + 0ac64716-d30c-489b-939e-a26d06445866 + 450 + 54.65044247787489 + 212 + 177.32300884955754 + 0 + A5DFC2DB-3B36-4377-96A0-D492CE785C00 + -1 + + DryerMainHeater + 0 + 139.61 + false + false + true + + 0 + + + 181796d8-64f6-420a-8f37-9af9df67d6a9 + 245 + 50.159292035398948 + 199 + 180.36283185840711 + 0 + 86808B48-B7F9-43AD-840E-2A6A5987C305 + -1 + + DryerSecondaryHeater + 0 + 138.16 + false + false + true + + 0 + + + fd2bb3a3-a411-470d-bde7-0beaf84da059 + 667 + 320.19026548672576 + 186 + 195.56194690265494 + 0 + 8E764A14-0F84-4FEC-928B-32A2509CAD57 + -1 + + HeaterZone3 + 0 + 35.35 + false + false + true + + 0 + + + 7e8dd386-cca6-4d07-8a3e-af5403756002 + 894 + 321.20353982300895 + 200 + 187.45575221238937 + 0 + B4EE8CC0-EE2B-4ABE-BF09-9226860E756B + -1 + + HeaterZone2 + 0 + 32.25 + false + false + true + + 0 + + + 32a91e5f-27c8-490d-b187-8e39b6626a13 + 1128 + 326.26991150442478 + 157 + 194.54867256637175 + 0 + 27E7BB74-81C3-4EF2-80AE-962F111C441F + -1 + + HeaterZone1 + 0 + 28.049999999999997 + false + false + true + + 0 + + + c844235a-8a29-4c2e-a964-e8f546d2ced7 + 1281 + 587.69469026548677 + 173 + 183.40265486725662 + 0 + 42A62A48-F1D5-4BB6-AFEA-6A7DF6DCF626 + -1 + + MixerHeater + 0 + 37.02 + false + false + true + + 0 + + + 45b121b5-cf7c-41f7-8089-6d4d6b1ed2c8 + 469 + 324.61946902655012 + 178 + 207.41150442477846 + 0 + 94574D69-46E1-4144-A8B5-D4BF0DA96D18 + -1 + + HeaterZone4 + 0 + 35.56 + false + false + true + + 0 + + + e6b3eb18-482b-450e-b8a8-d2ac6bba4fd4 + 257 + 328.66814159291738 + 186 + 195.56194690265494 + 0 + D6771DF4-771E-4D62-B6BA-BDE361C0A0F3 + -1 + + HeaterZone5 + 0 + 36.74 + false + false + true + + 0 + + + efff2e67-e3a3-4667-9208-4704707d7cda + 65 + 331.91150442477812 + 186 + 195.56194690265494 + 0 + D2B6CAA0-055E-4871-8D91-A5370F1ACB22 + -1 + + HeaterZone6 + 0 + 30.34 + false + false + true + + 0 + + + f9936dba-cef8-41e3-a715-eb629dca1870 + 1311 + 346.53539823008856 + 199 + 114.5 + 0 + 1778C1A7-AFB5-42F9-9E00-E80D30D9FC0A + -1 + 10 + 0 + + + 217c677a-3e11-4a7c-959b-616dae1259dd + 1167 + 280.67256637168151 + 44 + 42.557522123893705 + 0 + -14774017 + A + + + f129ea0d-9abb-437f-928e-1cd1f569db2a + 980.0000000000025 + 272.39823008849913 + 44 + 42.557522123893705 + 0 + -14774017 + C + + + 5f2610dc-3b9d-4302-b8f5-77a5e1c73b8c + 739.99999999999727 + 269.79203539822839 + 44 + 42.557522123893705 + 0 + -14774017 + D + + + eadb5257-47a2-4336-a72a-f2d157fe70cb + 552.99999999999909 + 277.11946902654887 + 44 + 42.557522123893705 + 0 + -14774017 + F + + + 6c59af66-169a-46e0-89ae-a81e3e619043 + 334.00000000000153 + 280.39380530973477 + 44 + 42.557522123893705 + 0 + -14774017 + I + + + 3b32b9a8-f300-443f-950e-c49f81678bac + 133.99999999999966 + 283.84070796460247 + 44 + 42.557522123893705 + 0 + -14774017 + L + + + f6d44793-ed44-46ed-8854-eacbc11af10c + 909 + 544.12389380530976 + 219 + 97.2743362831859 + 0 + df38139e-0026-46bc-b72f-df5f9eec80f7 + -1 + + + dd8f8a58-c09f-43dc-af6f-13fe83471be4 + 1005 + 624.17256637168157 + 237 + 170.23008849557505 + 0 + cac03991-b332-4dfa-b491-c0e381b74fb9 + -1 + + + 43793f93-da64-4409-b583-bca498f641e6 + 18 + 25.3274336283186 + 203 + 107.40707964601774 + 0 + -1 + + + + + + Thread + + + 50bae43f-8b1a-4279-9238-b976a0c72af3 + 1530 + 193.19911504424795 + 169 + 181.37610619469029 + 0 + A8DB1D27-6B25-4FB4-A3F5-46A29BA51955 + -1 + 10 + 2 + + + 68eef943-2151-4df5-be61-044c3865606e + 1172 + 145.78318584070678 + 175 + 167.827433628319 + 0 + 96B89605-F999-43FE-A1CD-2645BFB33A36 + -1 + 10 + 2 + + + 6be024c6-3d1b-4267-9b77-44473aba56b7 + 988 + 143.32300884955998 + 190 + 167.09734513274049 + 0 + FC60060A-3736-4910-B41A-FF6DABDF0E9E + -1 + 10 + 2 + + + 7c720f3b-00e1-49dd-92f9-fdd1e9686623 + 817 + 142.42035398230098 + 169 + 168.31858407079625 + 0 + 4CE6A82E-D841-4D33-BBB2-11F0743A441C + -1 + 10 + 2 + + + 3ebd6759-521b-4ed1-a353-ee1ad7801f28 + 922 + 516.43362831858417 + 439 + 304.995575221239 + 0 + D126DB23-784B-4F0C-8F88-D89A65A7549F + -14774017 + 1 + 1460 + true + 0 + 16384 + + + 984b4126-3dda-4624-a79f-0646eb0e1358 + 465 + 515.420353982301 + 439 + 304.995575221239 + 0 + 10102BC3-0EAE-47FF-A8E5-8640780CAA3D + -14774017 + 1 + 1516 + true + 0 + 16384 + + + 8ebc3ab7-a02d-4b12-93b3-2563443831d7 + 15 + 518.46017699115032 + 439 + 304.995575221239 + 0 + C0BCCD5C-346B-4C4A-A080-39D28E9E1A0C + -14774017 + 1 + 1398 + true + 0 + 16384 + + + acafb268-5e97-4277-8dc8-173250a9e3f8 + 12 + 13.849557522123973 + 439 + 304.995575221239 + 0 + 9FBC5460-BA59-486B-8D85-BD7D8A959F98 + -14774017 + 1 + 1273 + true + 0 + 100 + + + 3ccb1485-b0e9-4d36-a931-a1b3865edeaa + 460 + 38.28761061946841 + 267 + 221.90707964601768 + 0 + 08d15ca1-d7d1-460f-8f37-42c37c287cd1 + -1 + 952.3546144121359 + + + be4cb8d9-b516-4604-a6a5-1638cbc50251 + 860 + -24.18584070796669 + 345 + 169.21681415929209 + 0 + 4CE6A82E-D841-4D33-BBB2-11F0743A441C + -14774017 + 1 + 514 + true + 0 + 100000 + + + 75b99507-4eba-4b11-b52e-26732d4c5479 + 19 + 324.14159292035305 + 429 + 193.26548672566258 + 0 + F1DF490B-0577-4FA7-ACA1-0EEF4F934E8F + -14774017 + 4 + 1398 + true + 0 + 100 + + + a30e48de-be76-4230-92d0-d27d6f37b940 + 474 + 320.03097345132551 + 429 + 193.26548672566258 + 0 + 5F12B974-2C9E-4DDD-9B20-733251A5D7E6 + -14774017 + 4 + 1398 + true + 0 + 100 + + + 5ac4b368-093a-4192-98d4-e9d24f229b13 + 928 + 321.64601769912122 + 429 + 193.26548672566258 + 0 + 84CF23C9-D20D-4C08-BE1D-80201FC43C06 + -14774017 + 4 + 1398 + true + 0 + 100 + + + 9c34dc69-cfaa-48b4-9d02-8f0d9bba79dd + 1303 + 34.380530973454768 + 176 + 83.05309734512457 + 0 + -1 + + 89B7B89D-8050-4188-B568-35B1910CFB6F + 96B89605-F999-43FE-A1CD-2645BFB33A36 + 84CF23C9-D20D-4C08-BE1D-80201FC43C06 + FC60060A-3736-4910-B41A-FF6DABDF0E9E + 5F12B974-2C9E-4DDD-9B20-733251A5D7E6 + 9ADF7823-B293-4275-9999-F62474D246AA + 4CE6A82E-D841-4D33-BBB2-11F0743A441C + F1DF490B-0577-4FA7-ACA1-0EEF4F934E8F + + + + + + Dispensers + + + dce78f33-c966-4848-8c6e-a4a01dbc7577 + 1321 + 214.15929203538531 + 159 + 215.8274336283186 + 0 + 2CC8E461-E91F-4D4C-A402-922477F06C87 + -1 + 1200 + Dispenser 1 + + + 2d03fc19-0502-43e1-a3ff-4012a612112b + 1136 + 209.13274336282245 + 159 + 215.8274336283186 + 0 + C8D8FE90-0375-44A2-A6D1-E997789E065C + -16724737 + 1200 + Dispenser 2 + + + 81958374-3fa3-48b3-a554-5653fe1934b1 + 959 + 210.32743362830422 + 156 + 215.8274336283186 + 0 + 08ED9044-CAD6-4492-94B2-C07206E0164B + -65325 + 1200 + Dispenser 3 + + + 8fead411-7198-4428-a364-e32f3035ed94 + 775 + 206.42920353980952 + 159 + 215.8274336283186 + 0 + 179F34BB-3252-4D3A-965C-E6EB43D6FE7C + -524544 + 1200 + Dispenser 4 + + + 31bfa89f-e64d-4a3b-8585-c4a1b2e5a139 + 585 + 208.47345132741418 + 159 + 215.8274336283186 + 0 + 716B35CF-46E0-47D5-AF85-5233D212568F + -2108246 + 1200 + Dispenser 5 + + + c2bff5f3-6dc9-4b07-87ba-9e3a5814804e + 372 + 216.75221238937439 + 159 + 215.8274336283186 + 0 + 99528449-4D76-4874-AB95-522951560E01 + -263685 + 1200 + Dispenser 6 + + + 071281a5-3569-4a62-8b68-7bea850a3c07 + 217 + 211.63716814158107 + 159 + 215.8274336283186 + 0 + E8ED07E2-7C36-459C-B9E5-6A23A1E24F03 + -723724 + 0 + Dispenser 7 + + + 7b703b9a-a626-4ae5-8e31-fa1cfe5718f4 + 45 + 216.04867256635521 + 159 + 215.8274336283186 + 0 + 8A957565-4165-49F7-854D-D21F95FFBE1B + -724238 + 0 + Dispenser 8 + + + caca40a2-310c-452e-adcf-c28ee38f6bdc + 1305 + 31.606194690259713 + 150 + 156.04424778761069 + 0 + 1F0F907A-EC16-4386-AFC8-B2B156F2A822 + -15856114 + 10 + 2 + + + af52d36f-27a2-4a31-8ceb-9c43fedbed22 + 1127 + 32.535398230081626 + 150 + 156.04424778761069 + 0 + A499E5E0-A812-4032-8F96-B38C6762C4BD + -15293470 + 10 + 2 + + + d40eada8-d22a-4521-bd2a-d998ed93106f + 955 + 32.61946902653176 + 150 + 156.04424778761069 + 0 + 6B1DF4B0-BCC2-400C-A3B7-31C5119A55BB + -1570857 + 10 + 2 + + + b2d6364d-8b5c-43d2-8838-927c85b017b1 + 774 + 31.960176991142362 + 150 + 156.04424778761069 + 0 + F33667BD-D9FA-4DC7-BC2C-0E89E60AE4BE + -1379575 + 10 + 2 + + + 3980e685-73b3-4af1-9593-9235be147322 + 596 + 32.889380530964274 + 150 + 156.04424778761069 + 0 + 19645882-6587-4A50-BD85-AF06617DC654 + -7763381 + 10 + 2 + + + 51465293-58d5-40a4-8302-81856f8b4f47 + 424 + 32.973451327414409 + 150 + 156.04424778761069 + 0 + AF3FD56C-95BF-4DE1-8EDC-8426B0DB2A26 + -1 + 10 + 2 + + + c2a8c5b2-891b-4f9f-862c-c1c294366c78 + 252 + 31.703539823006281 + 150 + 156.04424778761069 + 0 + 60DA9EA3-C8A6-4D41-8AD8-3EB1BAA79CC9 + -1 + 10 + 2 + + + 9618e441-8973-4e16-a90b-06ce5798bd29 + 80 + 31.787610619456416 + 150 + 156.04424778761069 + 0 + EF66F95A-E166-4FA2-B1AF-D6F55621817A + -1 + 10 + 2 + + + bce8c8e8-a317-4991-9aa7-cd99a45d1509 + 35 + 680.88495575221179 + 247 + 122.24778761061873 + 0 + 074b6ed8-0f87-4973-bbea-509838f9c3ed + -1 + + + 72a23702-31bb-4ab8-aee5-2a02bcb1270b + 321 + 708.02212389380554 + 200 + 94.15929203539747 + 0 + c3d1b555-3bad-4b68-84c7-7b00a0345635 + -1 + + + 2dd6ff17-e515-4d8f-814f-a9683f404a8e + 140 + 867.73893805310092 + 160 + 85.49115044247776 + 0 + 78482AA4-3DF6-421F-944C-64328D3C3EF2 + -14774017 + 0 + 70 + 10 + true + + + 06843009-1da0-4811-8e77-50576d0edcb1 + 507 + 792.77433628318749 + 219 + 125.75221238938025 + 0 + 0c5dc1e9-da17-4ff8-86aa-6b39fd796ba9 + -16777216 + + + 935dddd0-0c6f-4766-8173-f9118006a12b + 1303 + 475.87168141593065 + 160 + 124.6504424778754 + 0 + B2164815-FBF3-4CF8-81D8-20F719626664 + -1 + 10 + 2 + + + 97e39a59-dba8-4e42-a124-b37de9453baf + 648 + 602.92920353982106 + 622 + 181.74336283186938 + 0 + D023F15D-3555-48E9-A9E9-5DF99F60D791 + 0 + 1 + 1956 + 0 + 100 + true + + + 46bdfce3-1c69-45dd-bbe9-582d1ac1e6f2 + 1128 + 482.80530973451141 + 140 + 117.32300884955743 + 0 + 0FE216B2-A097-4F2C-B465-08593F2532B3 + -1 + 10 + 2 + + + 429154a5-9a16-4423-85ca-ee4bae9aec3c + 968 + 481.35398230088504 + 140 + 117.32300884955743 + 0 + 3271FD82-46D3-4789-B612-564967826C75 + -1 + 10 + 2 + + + 0f6ab8e8-99a7-4468-bde8-690a63467688 + 766 + 476.07964601769811 + 140 + 117.32300884955743 + 0 + FBB806E7-42FA-4BAA-BDA1-3B8B07913AAD + -1 + 10 + 2 + + + bc0ac903-9c1f-4580-8b9e-670a76350473 + 586 + 474.38938053097161 + 140 + 117.32300884955743 + 0 + 436A22BB-AF79-4CB2-8A7D-DD4D9E54A81E + -1 + 10 + 2 + + + f9c960b2-b93e-46d5-b892-30337c0b55af + 391 + 474.87168141592781 + 140 + 117.32300884955743 + 0 + 89EA6CC8-5363-4BEC-A370-D906611087A7 + -1 + 10 + 2 + + + 5ac157ab-2d53-4307-bf0b-b069854701ac + 226 + 471.66814159292005 + 140 + 117.32300884955743 + 0 + D5EBE52B-E2DF-4C97-80B1-F111F6B15854 + -1 + 10 + 2 + + + 65a19d7e-c524-48a0-bd70-28b99b113dd1 + 69 + 473.97787610619389 + 140 + 117.32300884955743 + 0 + FE521D1B-A0EA-4FEA-AE64-33998A6CE138 + -1 + 10 + 2 + + + 5bf7a681-ee47-477e-8b47-ba7a2eb6e115 + 1130 + 624.9557522123913 + 144 + 80.495575221237516 + 0 + 3174ADCF-5793-4B5A-A3C6-B96E146A903D + -1 + 10 + 0 + + + 29b17a4b-fd4e-49cc-a3cd-418730176bf7 + 969 + 625.95575221239 + 144 + 80.495575221237516 + 0 + AD50C358-5BAF-4A2F-8593-51A22C85B3D1 + -1 + 10 + 0 + + + 21a5429f-c3a2-4e3b-ae77-c5538f30130d + 775 + 623.66814159292062 + 144 + 82.535398230087083 + 0 + E2F0FC31-CE7E-416B-ACEA-8EB6CA9B850B + -1 + 10 + 0 + + + 96a46b0c-37b1-4457-93fb-b3dc301c5743 + 588 + 625.06637168141322 + 144 + 80.495575221237516 + 0 + 37872FE8-D68A-45BC-A441-372B7805C09F + -1 + 10 + 0 + + + d4ad8603-9929-415f-9990-1869fcff36e4 + 1310 + 628.69469026548632 + 144 + 80.495575221237516 + 0 + 84682E90-6926-42AA-BF8C-2CCCF5C26C97 + -1 + 10 + 0 + + + 25249d78-ee37-42a8-b5aa-96f60e97c3ea + 228 + 602.79646017698838 + 327 + 108.53097345133028 + 0 + 8B1FCBC3-FEEA-4F87-B56F-CE5D28B7ACA4 + -1 + + + fc1d62f7-d13b-4a7b-8f9f-c687c987c7a9 + 1065 + 788.41592920352355 + 370 + 362.10619469026585 + 0 + 1F0F907A-EC16-4386-AFC8-B2B156F2A822 + -14774017 + 3 + 1426 + true + 0 + 100 + + + cc99a514-1498-4b93-a4eb-4e0a2a2e9de6 + 202 + 216.83628318584073 + 394 + 372.88495575221242 + 0 + A499E5E0-A812-4032-8F96-B38C6762C4BD + -14774017 + 1 + 1282 + true + 0 + 100 + + + + + Thread insertion + + + 443a977c-8e89-4a56-82e4-684bac7945c9 + 25 + 22.761061946902203 + 247 + 172.25663716814159 + 0 + 08d15ca1-d7d1-460f-8f37-42c37c287cd1 + -1 + 500 + + + a821b716-cb7d-4951-84ee-e56955431099 + 355 + 20.592920353981697 + 260 + 153.00442477876106 + 0 + b90a4e78-ebbf-44db-829b-949517d6400b + -1 + 753.31858407079721 + + + e36e321b-d48d-4199-a1ee-75ac18e9de1e + 694 + 19.367256637167998 + 217 + 155.26106194690203 + 0 + b7c1aea4-32c1-41cb-bca3-4aa665529b49 + -1 + 825.30467762326157 + + + 8790db03-4dfd-4d49-aec0-706babb55af9 + 364 + 222.16814159291846 + 240 + 172.30973451327589 + 0 + 2d3eaca5-4dfd-40d9-9d1f-aa4ae794eddc + -1 + 500 + + + 69ebcb28-13d9-41b3-a9ef-b2be51584141 + 29 + 241.34955752210982 + 263 + 174.296460176989 + 0 + c6099065-a735-4cc5-b575-c31a45bb9262 + -1 + 200 + + + 4d562029-3fdf-40a4-a5a7-9a322253c912 + 1168 + 47.305309734517039 + 304 + 167.26548672566202 + 0 + -1 + 38 + + + 92607e12-2dd6-41c9-8f89-f051f386b734 + 1258 + 277.55752212389069 + 240 + 156.04424778761069 + 0 + DCE08A06-6711-43AE-AB7C-EADD5AB70EE0 + -1 + + + 7b5b6896-f626-4e59-a5cf-2600e603c0f6 + 695 + 223.44247787610908 + 228 + 175.0353982300901 + 0 + 7b6d0a93-5a91-4e1f-af47-353afd8b5ea6 + -1 + 83.833754740833143 + + + 2052a2d3-843c-4a1c-87fd-acd0832fd1b9 + 81 + 542.88495575220634 + 220 + 168.473451327436 + 0 + c9482395-35e6-4340-8dab-83d5dfe907a7 + -1 + 500 + + + 339b7d00-d688-41cf-926a-8171d5e62740 + 376 + 553.11061946903 + 240 + 159.84070796460173 + 0 + f3b5076e-cba3-4ad2-b3cc-0c4e907bd9ef + -1 + 40 + + + 7644a8f9-00a2-4e37-8f48-0667b1541114 + 1014 + 290.60619469026437 + 240 + 172.30973451327589 + 0 + 92237d83-9f85-48db-aa6f-2fc5c9e0d8cd + -1 + 500 + + + c706d31b-48b0-44cc-a9c4-11d3acdcf667 + 548 + 418.71652683599893 + 269 + 127.67256637168134 + 0 + 2a454081-bd5e-41de-ae5d-97aefe1d76de + -1 + + + 7ccff69d-50f9-4e9b-a997-72a67917df5e + 803 + 569.80530973451619 + 227 + 145.08849557522183 + 0 + 9c02effb-7deb-40a1-90c3-df1fb48e6431 + -1 + 30 + + + a88a74cb-418b-4ed0-89ec-c42ff560528e + 1107 + 573.87168141592883 + 227 + 145.08849557522183 + 0 + a359e9d0-adcc-40a5-b3d9-b9cb26eca092 + -1 + 30 + + + + + Head graphs + + + ffe980da-dbbe-4bac-9595-46f587e9df00 + 1 + 57.486725663716754 + 430 + 187.15486725663709 + 0 + D7585119-4A42-4370-8F1E-F3E62553E588 + -14774017 + 2 + 2962 + true + 0 + 300 + + + c4e19f7c-e6e9-4f45-987e-f124456b2529 + 784 + 57.265486725668495 + 412 + 195.38938053097343 + 0 + A8DB1D27-6B25-4FB4-A3F5-46A29BA51955 + -14774017 + 3 + 2817 + true + 0 + 300 + + + b8b24455-1c20-417d-bd78-5fe4c7e3d023 + 0 + 240.77433628319324 + 430 + 224.47345132743214 + 0 + 6C0C1AB0-3EE9-40D7-8424-A79436FBC804 + -14774017 + 2 + 2982 + true + 0 + 300 + + + 2129a0cd-454f-4834-8197-3b048bf4b978 + 779 + 253.09292035398954 + 414 + 208.6194690265487 + 0 + 098F7CAB-030C-46B0-B2B8-A85AF2253032 + -14774017 + 2 + 2949 + true + 0 + 100 + + + 892fabb7-01fa-4b39-a19e-a557fafae0ac + 3 + 465.50884955753315 + 423 + 226.97345132743362 + 0 + DACEBF90-E2B4-4CC9-A973-B8B429AA0089 + -14774017 + 2 + 2628 + true + 0 + 300 + + + 4859974c-7224-42d5-97ca-0e2e549372f5 + 788 + 469.56194690266409 + 409 + 220.55752212389314 + 0 + 246C2551-5EFD-48E9-94F6-6313C5E5018F + -14774017 + 2 + 3153 + true + 0 + 300 + + + 81b78212-14d8-4a66-bf3a-eeea9900e0d6 + 423 + 69.712389380530908 + 179 + 131.99999999999773 + 0 + df38139e-0026-46bc-b72f-df5f9eec80f7 + -1 + + + 34c56855-114d-4c94-b8b7-16881430d626 + 1198 + 60.787610619475856 + 144 + 147.96017699114969 + 0 + d59b64f7-a8cf-4a2b-935a-943ae35fb78c + -1 + + + 0d35c220-41f5-49e8-99ba-72d5134e4c81 + 1200 + 269.79646017698923 + 148 + 154.90265486725662 + 0 + 9de55ec4-201f-4f62-9003-f63ebea06f8f + -1 + + + e72a263a-41c2-408c-ac98-7345c787a3b0 + 1204 + 471.31858407080483 + 148 + 160.278761061948 + 0 + d28bfa3c-edce-4f19-a296-3da251fcc0e2 + -1 + + + 62fd293e-9461-4c91-a5b3-26ef7893f780 + 420 + 250.1769911504424 + 189 + 145.75221238937741 + 0 + 81a3ae80-f4ea-4857-bc4e-2055d3b5fbc7 + -1 + + + 10c62974-d2f9-4849-b88f-f223e04bacc6 + 435 + 474.43362831858008 + 178 + 153.6504424778766 + 0 + 16D0DEF7-A2E0-4163-9F4B-FBEC2573BCC7 + -1 + + + 37657a24-40d2-4c10-be0b-0587406d77bf + 10 + 691.58849557522046 + 415 + 203.57522123893648 + 0 + AFB7B6F7-8FFB-4A7F-B814-04F0C163CAA1 + -14774017 + 2 + 3153 + true + 0 + 300 + + + 9330a6be-17f1-4ecb-978d-719adf9fec1f + 781 + 692.69911504425033 + 409 + 220.55752212389314 + 0 + 9A3877B2-9F98-4A5C-9A93-DECA2836FA8A + -14774017 + 2 + 3153 + true + 0 + 300 + + + 3228b2ba-83f3-4eb2-a6d2-7200301758a4 + 1191 + 723.03539823007986 + 186 + 110.3451327433603 + 0 + 105ac1be-e6db-4a57-9f4a-bb9c780afd33 + -1 + + + 6fd0eeb3-6a2a-435f-a877-0c17c26c6692 + 411 + 727.73008849557368 + 204 + 114.92035398229848 + 0 + 9d403aad-157a-4128-874c-704da4ed9ac1 + -1 + + + f9b4095c-4e87-41f2-955c-3b572ebee370 + 611 + 269.90265486725662 + 142 + 151.99115044247787 + 0 + 94574D69-46E1-4144-A8B5-D4BF0DA96D18 + -1 + + HeaterZone4 + 0 + 35.56 + false + false + true + + 0 + + + 4fa7a50d-5155-4785-95a0-508cd40fad4d + 1360 + 77.818584070796476 + 140 + 168.77876106194691 + 0 + 27E7BB74-81C3-4EF2-80AE-962F111C441F + -1 + + HeaterZone1 + 0 + 28.049999999999997 + false + false + true + + 0 + + + 9da56601-7b5b-4f0f-afbf-2b31970b104f + 1352 + 292.19469026548552 + 166 + 148.95132743362956 + 0 + 8E764A14-0F84-4FEC-928B-32A2509CAD57 + -1 + + HeaterZone3 + 0 + 35.35 + false + false + true + + 0 + + + b700e59d-f923-4f13-9dcc-942050548c22 + 1359 + 501.84513274336314 + 160 + 139.92920353982277 + 0 + D6771DF4-771E-4D62-B6BA-BDE361C0A0F3 + -1 + + HeaterZone5 + 0 + 36.74 + false + false + true + + 0 + + + 97bf8fa2-b07f-4f0e-87ac-820ea52d236e + 1358 + 716.707964601771 + 160 + 128.73451327433531 + 0 + 42A62A48-F1D5-4BB6-AFEA-6A7DF6DCF626 + -1 + + MixerHeater + 0 + 37.02 + false + false + true + + 0 + + + 3941a557-05e6-4c1b-bb98-4f2a59892431 + 606 + 66.234513274336223 + 155 + 157.05752212389382 + 0 + B4EE8CC0-EE2B-4ABE-BF09-9226860E756B + -1 + + HeaterZone2 + 0 + 32.25 + false + false + true + + 0 + + + 3020fbc5-305e-4adf-9f1e-d7a48168e2e7 + 628 + 488.76991150442484 + 133 + 155.03097345132744 + 0 + D2B6CAA0-055E-4871-8D91-A5370F1ACB22 + -1 + + HeaterZone6 + 0 + 30.34 + false + false + true + + 0 + + + a4049a51-7417-4eab-8bc1-837574307e93 + 599 + 716.27876106194685 + 161 + 143.34955752212409 + 0 + 6D6CFA18-5922-4AFE-84B3-2721CE128681 + -1 + + DryerAirHeater + 0 + 97.1 + false + false + true + + 0 + + + + + waste + + + bb9bf273-0a3d-4202-98ce-37a5f206ed75 + 119 + 68.898230088495609 + 339 + 184.4159292035398 + 0 + 7e1f53ec-8176-4efa-ac3d-c8f2436e60d1 + -1 + + + 59678a51-f995-4952-b250-e449f1fcbeac + 468 + 80.336283185839477 + 280 + 166.17699115044252 + 0 + 78db28d0-0407-4942-bb62-c44da81c4f9e + -1 + + + 8f9ff579-0e9d-4f48-8ed0-6fa563f2aba7 + 873 + 63.831858407079665 + 174 + 133.75221238938059 + 0 + 06bd7c0b-5aef-445a-86c0-853becf8594b + -1 + + + 70d1bd1e-acdb-436a-b205-6eeb9d137120 + 1070 + 70.106194690265909 + 221 + 123.61946902654864 + 0 + 4048bf02-27dc-4049-9284-fe913a7e0ebe + -1 + + + dcc7ce16-5b89-4ff8-acd5-7fb0b9ebb6d1 + 877 + 248.24778761061947 + 186 + 126.65929203539827 + 0 + 00ea1771-efee-4f3e-a0d2-8b2a4214e9fd + -1 + + + 2b99bbf7-94da-4bb2-acc9-91b35e543c5d + 897 + 358.69469026548683 + 147 + 69.9159292035398 + 0 + -14774017 + Waste lower presence + + + c150533c-abe4-4edf-b6ad-fa475b133142 + 1112 + 253.66814159291806 + 186 + 126.65929203539827 + 0 + d2f266e3-779b-4dfe-b513-26ce61c529a4 + -1 + + + d96f2a6d-0ccb-401e-8931-09086ca81fae + 1143 + 366.78318584070507 + 147 + 69.9159292035398 + 0 + -14774017 + Waste middle presence + + + bb9847ba-9671-4613-bf23-a0c637ebc79d + 151 + 271.55309734513281 + 200 + 63.836283185840671 + 0 + -14774017 + pump + + + d13a2df4-3f54-4c31-8f9a-ee7810fb6af5 + 504 + 283.71238938053096 + 192 + 67.88938053097354 + 0 + -14774017 + valve + + + + + disp + + + f9531a72-3742-47a7-86bb-b589f8b3eb55 + 123 + 128.33628318584061 + 390 + 249.67699115047321 + 0 + A499E5E0-A812-4032-8F96-B38C6762C4BD + -14774017 + 3 + 3600 + true + 0 + 100 + + + aae29286-81b3-476a-9f58-c0fd246cae96 + 880 + 158.81415929204155 + 442 + 241.88495575221771 + 0 + F33667BD-D9FA-4DC7-BC2C-0E89E60AE4BE + -14774017 + 3 + 3600 + true + 0 + 100 + + + 7d94c7c4-1288-4f9d-b0e6-a06794829642 + 1055 + 14.181415929203524 + 161 + 111.46017699115049 + 0 + -14774017 + Y + + + c95f9ad1-b607-4606-8217-400bea76f3d6 + 384 + 23.991150442480944 + 161 + 111.46017699115049 + 0 + -14774017 + C + + + 8f141fa5-fb24-4557-adcf-a6aa55a28fb4 + 121 + -8.8495575221214722 + 169 + 132.73893805309734 + 0 + A499E5E0-A812-4032-8F96-B38C6762C4BD + -1 + 10 + 3 + + + 7eab018a-ef43-4bca-a6cf-857d69767bba + 839 + -4.7079646017762684 + 169 + 132.73893805309734 + 0 + F33667BD-D9FA-4DC7-BC2C-0E89E60AE4BE + -1 + 10 + 3 + + + 2a9e89d4-5d60-4a83-9527-cb77fdf35c14 + 1276 + 22.287610619469035 + 187 + 102.34070796460179 + 0 + -1 + + 1F0F907A-EC16-4386-AFC8-B2B156F2A822 + A499E5E0-A812-4032-8F96-B38C6762C4BD + 6B1DF4B0-BCC2-400C-A3B7-31C5119A55BB + F33667BD-D9FA-4DC7-BC2C-0E89E60AE4BE + 19645882-6587-4A50-BD85-AF06617DC654 + + + + 6d2e7962-b3ae-4682-b20e-9654f48dcffe + 587 + 5.0619469026548813 + 155 + 131.72566371681415 + 0 + 2CC8E461-E91F-4D4C-A402-922477F06C87 + -1 + 500 + Dispenser 1 + + + 5ee2718f-f068-427b-a31e-d586c7d7682c + 131 + 552.94690265486338 + 390 + 249.67699115047321 + 0 + 1F0F907A-EC16-4386-AFC8-B2B156F2A822 + -14774017 + 3 + 3600 + true + 0 + 100 + + + 1c254a92-c075-453f-9667-cdcc91cf8e6a + 399 + 455.67256637168265 + 161 + 111.46017699115049 + 0 + -14774017 + K + + + d1087b1a-c36b-4242-96f5-07c2bb602cc4 + 145 + 409.52212389380446 + 169 + 132.73893805309734 + 0 + 1F0F907A-EC16-4386-AFC8-B2B156F2A822 + -1 + 10 + 3 + + + 53fe93a2-88a5-4d4d-9cd5-eb4d8a8fefae + 604 + 561.16371681414739 + 390 + 249.67699115047321 + 0 + 6B1DF4B0-BCC2-400C-A3B7-31C5119A55BB + -14774017 + 3 + 3600 + true + 0 + 100 + + + 0bef6e9d-6da0-4f06-9e1a-c00142bde4c1 + 832 + 440.91150442477635 + 161 + 111.46017699115049 + 0 + -14774017 + M + + + 762c5a97-a3bc-45b4-aa9f-0b50afa9cb9b + 633 + 434.0132743362783 + 169 + 132.73893805309734 + 0 + 6B1DF4B0-BCC2-400C-A3B7-31C5119A55BB + -1 + 10 + 3 + + + be584f80-3250-494c-87fc-250d6deae051 + 1045 + 559.4070796459921 + 390 + 249.67699115047321 + 0 + 19645882-6587-4A50-BD85-AF06617DC654 + -14774017 + 3 + 3600 + true + 0 + 100 + + + 39f6a02c-c4d9-47d0-b92d-bdea0ed5d3ce + 1056 + 435.43805309733875 + 169 + 132.73893805309734 + 0 + 19645882-6587-4A50-BD85-AF06617DC654 + -1 + 10 + 3 + + + 5b924929-9b16-4598-94cc-b2f4bca26798 + 1304 + 448.0884955752224 + 161 + 111.46017699115049 + 0 + -14774017 + TI + + + 89ae1fa5-1ad1-469e-ae76-0a29c35805cd + 588 + 317.1504424778762 + 283 + 74.982300884955748 + 0 + E144A221-4859-4DC3-9A7E-4A2969FB0826 + -1 + + + c218cf34-74c2-41bb-8c3b-3030abce451a + 1363 + 384.02654867256643 + 156 + 94.234513274336337 + 0 + E144A221-4859-4DC3-9A7E-4A2969FB0826 + -1 + + + 75af30c6-d7f8-4745-bfb5-d6dc5d50479a + 767 + 362.74778761061958 + 283 + 74.982300884955748 + 0 + E144A221-4859-4DC3-9A7E-4A2969FB0826 + -1 + + + + + thread 2 + + + 661ffe9d-c924-45f8-a4ad-139ad5b0c76d + 783 + 13.716814159289129 + 370 + 325.26106194690266 + 0 + 96B89605-F999-43FE-A1CD-2645BFB33A36 + -14774017 + 1 + 10 + true + 0 + 100000 + + + 3d0f66be-0002-403d-8d4b-0d49d85c0570 + 778 + 357.34070796460236 + 370 + 325.26106194690266 + 0 + D126DB23-784B-4F0C-8F88-D89A65A7549F + -14774017 + 1 + 10 + true + 0 + 16384 + + + 6ce9bf4a-e710-4bc6-bcc1-e8055b77530c + 392 + 14.632743362830524 + 370 + 325.26106194690266 + 0 + FC60060A-3736-4910-B41A-FF6DABDF0E9E + -14774017 + 1 + 10 + true + 0 + 100000 + + + da0aa379-4643-40cb-b990-45574e5545df + 384 + 358.6415929203568 + 370 + 325.26106194690266 + 0 + 10102BC3-0EAE-47FF-A8E5-8640780CAA3D + -14774017 + 1 + 10 + true + 0 + 16384 + + + 09b31ecb-8eaf-4c70-8057-1a11b5f10bad + 9 + 12.004424778760324 + 370 + 325.26106194690266 + 0 + 89B7B89D-8050-4188-B568-35B1910CFB6F + -14774017 + 1 + 10 + true + 0 + 100000 + + + 2a970ff9-b593-4df4-977f-7d29ce25d0c6 + 1157 + 358.73008849558084 + 370 + 325.26106194690266 + 0 + 84CF23C9-D20D-4C08-BE1D-80201FC43C06 + -14774017 + 1 + 10 + true + 0 + 100 + + + eebe8aa9-cff0-45ef-b1dd-d71cbe3b2947 + 1190 + 18.473451327433565 + 250 + 288.54424778761074 + 0 + 457458a4-3d46-4c56-b1d5-db2a2f0e2f3b + -1 + + + a47289e5-d489-4136-8c32-d88fe44acde8 + 40 + 347.32743362831985 + 290 + 352.60176991150331 + 0 + 7cb1cbfc-50cf-4725-b15a-937626cee8a3 + -1 + + + 09068c33-62d1-45dc-891c-f645431ff5f2 + 531 + 704.22123893805315 + 232 + 103.35398230088504 + 0 + -1 + 40 + + + d2e6c2a2-7205-45d3-84c9-658bf3c15b7f + 259 + 664.7035398230089 + 183 + 142.87168141592929 + 0 + FC60060A-3736-4910-B41A-FF6DABDF0E9E + -1 + 10 + 2 + + + + + 2 + \ No newline at end of file -- cgit v1.3.1 From 61b7ed2086a8ed09e23a87d4b3720840a1b50aa7 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Fri, 3 May 2019 11:11:40 +0300 Subject: FFS rebuild stub --- Software/Stubs Collection/stubs/FFS_ReBuild.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Software/Stubs Collection/stubs/FFS_ReBuild.cs diff --git a/Software/Stubs Collection/stubs/FFS_ReBuild.cs b/Software/Stubs Collection/stubs/FFS_ReBuild.cs new file mode 100644 index 000000000..a8fc766f9 --- /dev/null +++ b/Software/Stubs Collection/stubs/FFS_ReBuild.cs @@ -0,0 +1,24 @@ +using System; +using System.Text; +using System.Linq; +using System.Drawing; +using System.Diagnostics; +using System.Windows.Forms; +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; +using Tango.PMR.Stubs; +using Tango.Stubs; + +public void OnExecute(StubManager stubManager) +{ + +//CF - initialize FFS +//DF - reset +ProgressRequest progressRequest = new ProgressRequest(); +progressRequest.Amount = 0xCF; +progressRequest.Delay = 0xCF; + + var response = stubManager.Run(progressRequest); + +} \ No newline at end of file -- cgit v1.3.1 From 910f8fd4d4f610a22fb1bbb3bd13026e7f432864 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Fri, 3 May 2019 11:16:43 +0300 Subject: reduced diagnostics - force sending once a second --- Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 7 +++++++ Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 785d9fc3c..db13f5e15 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -67,7 +67,11 @@ DiagnosticsMonitors DiagnosticsMonitor = DIAGNOSTICS_MONITORS__INIT; #define DIAGNOSTICS_LIMIT 3 #define DIAGNOSTICS_DANCER_LIMIT 30 int DiagnosticsIndex = 0; +#ifdef REDUCED_DIAGNOSTICS +int DiagnosticCollectionLimit = 1; //number of data samples to collect before sending to the host +#else int DiagnosticCollectionLimit = 2; //number of data samples to collect before sending to the host +#endif //int DiagnosticLimit = eHundredMillisecond; //frequency of data collection //int DiagnosticFastLimit = eTenMillisecond; //frequency of data collection #ifdef REDUCED_DIAGNOSTICS @@ -190,6 +194,9 @@ void SetDiagnosticCollectionLimit(int limit) { if ((limit)&&(limit<= DIAGNOSTICS_LIMIT)) DiagnosticCollectionLimit = limit; +#ifdef REDUCED_DIAGNOSTICS + DiagnosticCollectionLimit = 1; //overrule - send at least once every second +#endif } uint8_t HeaterCounterIndex[MAX_HEATERS_NUM]= {0,0,0,0,0,0,0,0,0,0}; diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index b12064915..f0ce7397c 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -118,7 +118,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters.has_breaksensorlimit = true; EmbeddedParameters.breaksensorlimit = 10; EmbeddedParameters.has_diagnosticcollectionlimit = true; - EmbeddedParameters.diagnosticcollectionlimit = 2; + EmbeddedParameters.diagnosticcollectionlimit = 1; EmbeddedParameters.has_overheatcountlimit = true; EmbeddedParameters.overheatcountlimit = 3; EmbeddedParameters.has_underheatcountlimit = true; -- cgit v1.3.1 From 84c7783b0b68c71c8a6419ca59617f956bd4b136 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Fri, 3 May 2019 11:26:11 +0300 Subject: diagnostics at least once a second. gas sensor stub --- Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 7 +++++++ Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c | 2 +- Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 785d9fc3c..db13f5e15 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -67,7 +67,11 @@ DiagnosticsMonitors DiagnosticsMonitor = DIAGNOSTICS_MONITORS__INIT; #define DIAGNOSTICS_LIMIT 3 #define DIAGNOSTICS_DANCER_LIMIT 30 int DiagnosticsIndex = 0; +#ifdef REDUCED_DIAGNOSTICS +int DiagnosticCollectionLimit = 1; //number of data samples to collect before sending to the host +#else int DiagnosticCollectionLimit = 2; //number of data samples to collect before sending to the host +#endif //int DiagnosticLimit = eHundredMillisecond; //frequency of data collection //int DiagnosticFastLimit = eTenMillisecond; //frequency of data collection #ifdef REDUCED_DIAGNOSTICS @@ -190,6 +194,9 @@ void SetDiagnosticCollectionLimit(int limit) { if ((limit)&&(limit<= DIAGNOSTICS_LIMIT)) DiagnosticCollectionLimit = limit; +#ifdef REDUCED_DIAGNOSTICS + DiagnosticCollectionLimit = 1; //overrule - send at least once every second +#endif } uint8_t HeaterCounterIndex[MAX_HEATERS_NUM]= {0,0,0,0,0,0,0,0,0,0}; diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index b12064915..f0ce7397c 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -118,7 +118,7 @@ void LoadConfigurationParameters(ConfigurationParameters *Params) EmbeddedParameters.has_breaksensorlimit = true; EmbeddedParameters.breaksensorlimit = 10; EmbeddedParameters.has_diagnosticcollectionlimit = true; - EmbeddedParameters.diagnosticcollectionlimit = 2; + EmbeddedParameters.diagnosticcollectionlimit = 1; EmbeddedParameters.has_overheatcountlimit = true; EmbeddedParameters.overheatcountlimit = 3; EmbeddedParameters.has_underheatcountlimit = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 34cb61e27..c6f2526db 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -11,6 +11,7 @@ #include "drivers/Flash_Memory/FATFS/ff.h" #include "drivers/Flash_Memory/FATFS/Control_File_System.h" +#include "drivers/adc_sampling/adc.h" //#include "graphics_adapter.h" @@ -33,6 +34,13 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) assert(iFResult); } } + else + if((request->amount == 0x0C) && (request->delay == 0x0C)) //Get Gas Sensor + { + response.progress = (double)Calculate_Gas_Power_Consumption(); + response.has_progress = true; + + } else if((request->amount == 0xDF) && (request->delay == 0xDF)) //Power off { PowerOffInit(); -- cgit v1.3.1 From 661c55343a468a9c150e8d163711567f89a02889 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 5 May 2019 09:38:33 +0300 Subject: Working on TCC... --- .../Android_Studio/ColorCapture/app/build.gradle | 61 ++++++- .../ColorCapture/app/src/main/AndroidManifest.xml | 17 +- .../colorcapture/controls/CircleActionButton.java | 91 ++++++++-- .../colorcapture/dagger/ApplicationComponent.java | 9 + .../colorcapture/dagger/ViewModelsModule.java | 40 ++++- .../dialogs/confirm/ConfirmDialog.java | 22 +++ .../dialogs/confirm/ConfirmDialogVM.java | 41 +++++ .../colorcapture/dialogs/error/ErrorDialogVM.java | 20 +-- .../dialogs/progress/ProgressDialogVM.java | 20 +-- .../dialogs/success/SuccessDialogVM.java | 20 +-- .../integration/ExternalBridgeClient.java | 1 + .../com/twine/colorcapture/logging/LogManager.java | 35 ++++ .../com/twine/colorcapture/models/ColorResult.java | 54 ++++++ .../twine/colorcapture/models/ColorResultVM.java | 40 +++++ .../mvvm/MessageDialogViewModelBase.java | 25 +++ .../navigation/AndroidNavigationProvider.java | 1 + .../navigation/NavigationActivity.java | 1 + .../navigation/NavigationFragment.java | 5 +- .../twine/colorcapture/navigation/TabState.java | 8 + .../colorcapture/navigation/TabStateManager.java | 25 +++ .../notification/AndroidNotificationProvider.java | 30 ++++ .../notification/INotificationProvider.java | 13 ++ .../colorcapture/settings/SettingsManager.java | 96 +++++++++++ .../views/capture/CaptureFragmentVM.java | 31 +++- .../colorcapture/views/main/IMainActivity.java | 1 + .../colorcapture/views/main/MainActivity.java | 9 +- .../colorcapture/views/main/MainActivityVM.java | 96 +++++------ .../views/mycolors/MyColorsFragmentVM.java | 70 +++++++- .../views/register/RegisterFragmentVM.java | 2 +- .../colorcapture/views/rename/IRenameFragment.java | 7 + .../colorcapture/views/rename/RenameFragment.java | 62 +++++++ .../views/rename/RenameFragmentVM.java | 50 ++++++ .../views/result/ResultFragmentVM.java | 44 ++++- .../views/sendtoemail/ISendToEmailActivity.java | 7 + .../views/sendtoemail/SendToEmailActivity.java | 30 ++++ .../views/sendtoemail/SendToEmailActivityVM.java | 21 +++ .../sendtomachine/SendToMachineFragmentVM.java | 27 ++- .../com/twine/colorcapture/web/ITCCService.java | 5 + .../com/twine/colorcapture/web/TCCService.java | 50 +++++- .../com/twine/colorcapture/web/WebApiFactory.java | 6 +- .../web/messages/DefinitionResponse.java | 30 ++++ .../app/src/main/res/drawable-hdpi/about.png | Bin 0 -> 1998 bytes .../app/src/main/res/drawable-hdpi/delete_thin.png | Bin 0 -> 2039 bytes .../app/src/main/res/drawable-hdpi/error.png | Bin 0 -> 6542 bytes .../app/src/main/res/drawable-hdpi/how_to.png | Bin 0 -> 2350 bytes .../src/main/res/drawable-hdpi/icon_twine_card.png | Bin 0 -> 1989 bytes .../app/src/main/res/drawable-hdpi/icons_close.png | Bin 0 -> 367 bytes .../src/main/res/drawable-hdpi/icons_delete.png | Bin 0 -> 2140 bytes .../app/src/main/res/drawable-hdpi/info.png | Bin 0 -> 1699 bytes .../app/src/main/res/drawable-hdpi/snapmatch.png | Bin 0 -> 181461 bytes .../src/main/res/drawable-hdpi/twine_card_icon.png | Bin 0 -> 5155 bytes .../app/src/main/res/drawable-mdpi/about.png | Bin 0 -> 1229 bytes .../app/src/main/res/drawable-mdpi/delete_thin.png | Bin 0 -> 1240 bytes .../app/src/main/res/drawable-mdpi/error.png | Bin 0 -> 3836 bytes .../app/src/main/res/drawable-mdpi/how_to.png | Bin 0 -> 1435 bytes .../src/main/res/drawable-mdpi/icon_twine_card.png | Bin 0 -> 1215 bytes .../app/src/main/res/drawable-mdpi/icons_close.png | Bin 0 -> 284 bytes .../src/main/res/drawable-mdpi/icons_delete.png | Bin 0 -> 1278 bytes .../app/src/main/res/drawable-mdpi/info.png | Bin 0 -> 1066 bytes .../app/src/main/res/drawable-mdpi/snapmatch.png | Bin 0 -> 98923 bytes .../src/main/res/drawable-mdpi/twine_card_icon.png | Bin 0 -> 2864 bytes .../app/src/main/res/drawable-xhdpi/about.png | Bin 0 -> 2748 bytes .../src/main/res/drawable-xhdpi/delete_thin.png | Bin 0 -> 2827 bytes .../app/src/main/res/drawable-xhdpi/error.png | Bin 0 -> 9549 bytes .../app/src/main/res/drawable-xhdpi/how_to.png | Bin 0 -> 3118 bytes .../main/res/drawable-xhdpi/icon_twine_card.png | Bin 0 -> 2661 bytes .../src/main/res/drawable-xhdpi/icons_close.png | Bin 0 -> 424 bytes .../src/main/res/drawable-xhdpi/icons_delete.png | Bin 0 -> 3094 bytes .../app/src/main/res/drawable-xhdpi/info.png | Bin 0 -> 2417 bytes .../app/src/main/res/drawable-xhdpi/snapmatch.png | Bin 0 -> 281457 bytes .../main/res/drawable-xhdpi/twine_card_icon.png | Bin 0 -> 7906 bytes .../app/src/main/res/drawable-xxhdpi/about.png | Bin 0 -> 4258 bytes .../src/main/res/drawable-xxhdpi/delete_thin.png | Bin 0 -> 4926 bytes .../app/src/main/res/drawable-xxhdpi/error.png | Bin 0 -> 16261 bytes .../app/src/main/res/drawable-xxhdpi/how_to.png | Bin 0 -> 4930 bytes .../main/res/drawable-xxhdpi/icon_twine_card.png | Bin 0 -> 4793 bytes .../src/main/res/drawable-xxhdpi/icons_close.png | Bin 0 -> 542 bytes .../src/main/res/drawable-xxhdpi/icons_delete.png | Bin 0 -> 5369 bytes .../app/src/main/res/drawable-xxhdpi/info.png | Bin 0 -> 3553 bytes .../app/src/main/res/drawable-xxhdpi/snapmatch.png | Bin 0 -> 550027 bytes .../main/res/drawable-xxhdpi/twine_card_icon.png | Bin 0 -> 14760 bytes .../app/src/main/res/drawable-xxxhdpi/about.png | Bin 0 -> 5859 bytes .../src/main/res/drawable-xxxhdpi/delete_thin.png | Bin 0 -> 7208 bytes .../app/src/main/res/drawable-xxxhdpi/error.png | Bin 0 -> 23926 bytes .../app/src/main/res/drawable-xxxhdpi/how_to.png | Bin 0 -> 6656 bytes .../main/res/drawable-xxxhdpi/icon_twine_card.png | Bin 0 -> 6794 bytes .../src/main/res/drawable-xxxhdpi/icons_close.png | Bin 0 -> 719 bytes .../src/main/res/drawable-xxxhdpi/icons_delete.png | Bin 0 -> 7523 bytes .../app/src/main/res/drawable-xxxhdpi/info.png | Bin 0 -> 5016 bytes .../src/main/res/drawable-xxxhdpi/snapmatch.png | Bin 0 -> 894264 bytes .../main/res/drawable-xxxhdpi/twine_card_icon.png | Bin 0 -> 24126 bytes .../app/src/main/res/layout/activity_main.xml | 30 ++-- .../src/main/res/layout/activity_send_to_email.xml | 66 ++++++++ .../app/src/main/res/layout/color_result_item.xml | 135 +++++++++++++++ .../app/src/main/res/layout/dialog_confirm.xml | 87 ++++++++++ .../app/src/main/res/layout/dialog_error.xml | 18 ++ .../app/src/main/res/layout/dialog_success.xml | 18 ++ .../src/main/res/layout/external_machine_item.xml | 2 +- .../app/src/main/res/layout/fragment_mycolors.xml | 39 +++-- .../app/src/main/res/layout/fragment_rename.xml | 83 +++++++++ .../app/src/main/res/layout/fragment_result.xml | 4 +- .../app/src/main/res/layout/side_menu.xml | 187 +++++++++++++++++---- .../app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 2963 -> 4407 bytes .../src/main/res/mipmap-hdpi/ic_launcher_round.png | Bin 4905 -> 6054 bytes .../app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2060 -> 2304 bytes .../src/main/res/mipmap-mdpi/ic_launcher_round.png | Bin 2783 -> 3179 bytes .../app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4490 -> 6532 bytes .../main/res/mipmap-xhdpi/ic_launcher_round.png | Bin 6895 -> 8926 bytes .../app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 6387 -> 12164 bytes .../main/res/mipmap-xxhdpi/ic_launcher_round.png | Bin 10413 -> 16791 bytes .../src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 9128 -> 21793 bytes .../main/res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 15132 -> 27968 bytes .../app/src/main/res/values/strings.xml | 2 +- .../app/src/main/res/values/styles.xml | 1 + Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes Software/DB/TCC/TCC.mdf | Bin 8388608 -> 8388608 bytes Software/DB/TCC/TCC_log.ldf | Bin 8388608 -> 8388608 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../Graphics/Mobile/zeplin/drawable-hdpi/about.png | Bin 0 -> 1998 bytes .../Mobile/zeplin/drawable-hdpi/delete_thin.png | Bin 0 -> 2039 bytes .../Graphics/Mobile/zeplin/drawable-hdpi/error.png | Bin 0 -> 6542 bytes .../Mobile/zeplin/drawable-hdpi/how_to.png | Bin 0 -> 2350 bytes .../zeplin/drawable-hdpi/icon_twine_Card.png | Bin 0 -> 1989 bytes .../Mobile/zeplin/drawable-hdpi/icons_close.png | Bin 0 -> 367 bytes .../Mobile/zeplin/drawable-hdpi/icons_delete.png | Bin 0 -> 2140 bytes .../Graphics/Mobile/zeplin/drawable-hdpi/info.png | Bin 0 -> 1699 bytes .../Mobile/zeplin/drawable-hdpi/twine_card.png | Bin 4292 -> 1989 bytes .../zeplin/drawable-hdpi/twine_card_icon.png | Bin 0 -> 5155 bytes .../Graphics/Mobile/zeplin/drawable-mdpi/about.png | Bin 0 -> 1229 bytes .../Mobile/zeplin/drawable-mdpi/delete_thin.png | Bin 0 -> 1240 bytes .../Graphics/Mobile/zeplin/drawable-mdpi/error.png | Bin 0 -> 3836 bytes .../Mobile/zeplin/drawable-mdpi/how_to.png | Bin 0 -> 1435 bytes .../zeplin/drawable-mdpi/icon_twine_Card.png | Bin 0 -> 1215 bytes .../Mobile/zeplin/drawable-mdpi/icons_close.png | Bin 0 -> 284 bytes .../Mobile/zeplin/drawable-mdpi/icons_delete.png | Bin 0 -> 1278 bytes .../Graphics/Mobile/zeplin/drawable-mdpi/info.png | Bin 0 -> 1066 bytes .../Mobile/zeplin/drawable-mdpi/twine_card.png | Bin 3305 -> 1215 bytes .../zeplin/drawable-mdpi/twine_card_icon.png | Bin 0 -> 2864 bytes .../Mobile/zeplin/drawable-xhdpi/about.png | Bin 0 -> 2748 bytes .../Mobile/zeplin/drawable-xhdpi/delete_thin.png | Bin 0 -> 2827 bytes .../Mobile/zeplin/drawable-xhdpi/error.png | Bin 0 -> 9549 bytes .../Mobile/zeplin/drawable-xhdpi/how_to.png | Bin 0 -> 3118 bytes .../zeplin/drawable-xhdpi/icon_twine_Card.png | Bin 0 -> 2661 bytes .../Mobile/zeplin/drawable-xhdpi/icons_close.png | Bin 0 -> 424 bytes .../Mobile/zeplin/drawable-xhdpi/icons_delete.png | Bin 0 -> 3094 bytes .../Graphics/Mobile/zeplin/drawable-xhdpi/info.png | Bin 0 -> 2417 bytes .../Mobile/zeplin/drawable-xhdpi/twine_card.png | Bin 5560 -> 2661 bytes .../zeplin/drawable-xhdpi/twine_card_icon.png | Bin 0 -> 7906 bytes .../Mobile/zeplin/drawable-xxhdpi/about.png | Bin 0 -> 4258 bytes .../Mobile/zeplin/drawable-xxhdpi/delete_thin.png | Bin 0 -> 4926 bytes .../Mobile/zeplin/drawable-xxhdpi/error.png | Bin 0 -> 16261 bytes .../Mobile/zeplin/drawable-xxhdpi/how_to.png | Bin 0 -> 4930 bytes .../zeplin/drawable-xxhdpi/icon_twine_Card.png | Bin 0 -> 4793 bytes .../Mobile/zeplin/drawable-xxhdpi/icons_close.png | Bin 0 -> 542 bytes .../Mobile/zeplin/drawable-xxhdpi/icons_delete.png | Bin 0 -> 5369 bytes .../Mobile/zeplin/drawable-xxhdpi/info.png | Bin 0 -> 3553 bytes .../Mobile/zeplin/drawable-xxhdpi/twine_card.png | Bin 7547 -> 4793 bytes .../zeplin/drawable-xxhdpi/twine_card_icon.png | Bin 0 -> 14760 bytes .../Mobile/zeplin/drawable-xxxhdpi/about.png | Bin 0 -> 5859 bytes .../Mobile/zeplin/drawable-xxxhdpi/delete_thin.png | Bin 0 -> 7208 bytes .../Mobile/zeplin/drawable-xxxhdpi/error.png | Bin 0 -> 23926 bytes .../Mobile/zeplin/drawable-xxxhdpi/how_to.png | Bin 0 -> 6656 bytes .../zeplin/drawable-xxxhdpi/icon_twine_Card.png | Bin 0 -> 6794 bytes .../Mobile/zeplin/drawable-xxxhdpi/icons_close.png | Bin 0 -> 719 bytes .../zeplin/drawable-xxxhdpi/icons_delete.png | Bin 0 -> 7523 bytes .../Mobile/zeplin/drawable-xxxhdpi/info.png | Bin 0 -> 5016 bytes .../Mobile/zeplin/drawable-xxxhdpi/twine_card.png | Bin 9807 -> 6794 bytes .../zeplin/drawable-xxxhdpi/twine_card_icon.png | Bin 0 -> 24126 bytes Software/Graphics/Mobile/zeplin/drawable/error.png | Bin 6291 -> 0 bytes .../Build/Shortcuts/Machine Studio.lnk | Bin 1518 -> 1581 bytes .../DeveloperModuleSettings.cs | 13 ++ .../ViewModels/MainViewVM.cs | 13 +- .../Views/JobView.xaml | 4 +- .../MachineStudioSettings.cs | 2 +- .../TCC/Tango.TCC.BL/Entities/Device.cs | 6 + .../TCC/Tango.TCC.BL/Entities/TCCEntityBase.cs | 5 + .../TCC/Tango.TCC.BL/Web/DefinitionResponse.cs | 3 + .../Controllers/ColorDetectionController.cs | 98 +++++++++-- .../TCC/Tango.TCC.Service/DB/TccDbContext.cs | 46 +++++ .../TCC/Tango.TCC.Service/TCCServiceConfig.cs | 5 + .../TCC/Tango.TCC.Service/Tango.TCC.Service.csproj | 5 + .../Visual_Studio/TCC/Tango.TCC.Service/Web.config | 3 +- .../Tango.Web/Helpers/ObservablesContextHelper.cs | 4 +- 185 files changed, 1849 insertions(+), 253 deletions(-) create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/confirm/ConfirmDialog.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/confirm/ConfirmDialogVM.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/logging/LogManager.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/models/ColorResult.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/models/ColorResultVM.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/mvvm/MessageDialogViewModelBase.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/TabState.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/TabStateManager.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/settings/SettingsManager.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/IRenameFragment.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/RenameFragment.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/RenameFragmentVM.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/ISendToEmailActivity.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/SendToEmailActivity.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/SendToEmailActivityVM.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/about.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/delete_thin.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/error.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/how_to.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icon_twine_card.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icons_close.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icons_delete.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/info.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/snapmatch.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/twine_card_icon.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/about.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/delete_thin.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/error.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/how_to.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icon_twine_card.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icons_close.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icons_delete.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/info.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/snapmatch.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/twine_card_icon.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/about.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/delete_thin.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/error.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/how_to.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icon_twine_card.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icons_close.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icons_delete.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/info.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/snapmatch.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/twine_card_icon.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/about.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/delete_thin.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/error.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/how_to.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icon_twine_card.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icons_close.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icons_delete.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/info.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/snapmatch.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/twine_card_icon.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/about.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/delete_thin.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/error.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/how_to.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icon_twine_card.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icons_close.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icons_delete.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/info.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/snapmatch.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/twine_card_icon.png create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_send_to_email.xml create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/layout/color_result_item.xml create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_confirm.xml create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_rename.xml create mode 100644 Software/Graphics/Mobile/zeplin/drawable-hdpi/about.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-hdpi/delete_thin.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-hdpi/error.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-hdpi/how_to.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-hdpi/icon_twine_Card.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-hdpi/icons_close.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-hdpi/icons_delete.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-hdpi/info.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-hdpi/twine_card_icon.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-mdpi/about.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-mdpi/delete_thin.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-mdpi/error.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-mdpi/how_to.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-mdpi/icon_twine_Card.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-mdpi/icons_close.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-mdpi/icons_delete.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-mdpi/info.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-mdpi/twine_card_icon.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xhdpi/about.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xhdpi/delete_thin.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xhdpi/error.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xhdpi/how_to.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xhdpi/icon_twine_Card.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xhdpi/icons_close.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xhdpi/icons_delete.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xhdpi/info.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xhdpi/twine_card_icon.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxhdpi/about.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxhdpi/delete_thin.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxhdpi/error.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxhdpi/how_to.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxhdpi/icon_twine_Card.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxhdpi/icons_close.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxhdpi/icons_delete.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxhdpi/info.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxhdpi/twine_card_icon.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxxhdpi/about.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxxhdpi/delete_thin.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxxhdpi/error.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxxhdpi/how_to.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxxhdpi/icon_twine_Card.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxxhdpi/icons_close.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxxhdpi/icons_delete.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxxhdpi/info.png create mode 100644 Software/Graphics/Mobile/zeplin/drawable-xxxhdpi/twine_card_icon.png delete mode 100644 Software/Graphics/Mobile/zeplin/drawable/error.png create mode 100644 Software/Visual_Studio/TCC/Tango.TCC.Service/DB/TccDbContext.cs diff --git a/Software/Android_Studio/ColorCapture/app/build.gradle b/Software/Android_Studio/ColorCapture/app/build.gradle index 7b8adc999..ae4fcfeb1 100644 --- a/Software/Android_Studio/ColorCapture/app/build.gradle +++ b/Software/Android_Studio/ColorCapture/app/build.gradle @@ -17,13 +17,13 @@ android { ndk { // Tells Gradle to build outputs for the following ABIs and package // them into your APK. - abiFilters 'armeabi-v7a' //Supported on most devices. + // abiFilters 'armeabi-v7a' //Supported on most devices. } } buildTypes { debug { - buildConfigField "String", "WEB_SERVICE_ADDRESS", "\"http://192.168.1.86:45455/api/\"" + buildConfigField "String", "WEB_SERVICE_ADDRESS", "\"http://10.100.102.46:45455/api/\"" buildConfigField "String", "WEB_SERVICE_APP_ID", "\"Tdf793i4ughsiduf8749509237885ehgfdlkghlT\"" } @@ -51,6 +51,63 @@ android { path "CMakeLists.txt" } } + + splits { + + // Configures multiple APKs based on ABI. + abi { + + // Enables building multiple APKs per ABI. + enable true + + // By default all ABIs are included, so use reset() and include to specify that we only + // want APKs for x86 and x86_64. + + // Resets the list of ABIs that Gradle should create APKs for to none. + reset() + + // Specifies a list of ABIs that Gradle should create APKs for. + include "armeabi-v7a", "arm64-v8a", "x86" + + // Specifies that we do not want to also generate a universal APK that includes all ABIs. + universalApk false + } + } +} + +// Map for the version code that gives each ABI a value. +ext.abiCodes = ['armeabi-v7a':1, 'arm64-v8a':2, 'x86':3] + +import com.android.build.OutputFile + +// For each APK output variant, override versionCode with a combination of +// ext.abiCodes * 1000 + variant.versionCode. In this example, variant.versionCode +// is equal to defaultConfig.versionCode. If you configure product flavors that +// define their own versionCode, variant.versionCode uses that value instead. +android.applicationVariants.all { variant -> + + // Assigns a different version code for each output APK + // other than the universal APK. + variant.outputs.each { output -> + + // Stores the value of ext.abiCodes that is associated with the ABI for this variant. + def baseAbiVersionCode = + // Determines the ABI for this variant and returns the mapped value. + project.ext.abiCodes.get(output.getFilter(OutputFile.ABI)) + + // Because abiCodes.get() returns null for ABIs that are not mapped by ext.abiCodes, + // the following code does not override the version code for universal APKs. + // However, because we want universal APKs to have the lowest version code, + // this outcome is desirable. + if (baseAbiVersionCode != null) { + + // Assigns the new version code to versionCodeOverride, which changes the version code + // for only the output APK, not for the variant itself. Skipping this step simply + // causes Gradle to use the value of variant.versionCode for the APK. + output.versionCodeOverride = + baseAbiVersionCode * 1000 + variant.versionCode + } + } } dependencies { diff --git a/Software/Android_Studio/ColorCapture/app/src/main/AndroidManifest.xml b/Software/Android_Studio/ColorCapture/app/src/main/AndroidManifest.xml index a03d65975..441817928 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/AndroidManifest.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/AndroidManifest.xml @@ -26,14 +26,27 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="false" android:theme="@style/AppTheme"> - + + + + + + + + + - + + \ No newline at end of file diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/controls/CircleActionButton.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/controls/CircleActionButton.java index 242702fe9..afa02c511 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/controls/CircleActionButton.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/controls/CircleActionButton.java @@ -4,14 +4,18 @@ import android.animation.Animator; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.TypedArray; +import android.databinding.BindingAdapter; +import android.databinding.InverseBindingAdapter; import android.graphics.drawable.Drawable; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.AppCompatTextView; import android.util.AttributeSet; +import android.util.TypedValue; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.view.animation.AlphaAnimation; import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; @@ -27,15 +31,18 @@ public class CircleActionButton extends FrameLayout implements View.OnTouchListe private int initial_circle_width; private ValueAnimator animationDown; private ValueAnimator animationUp; + private AlphaAnimation alphaAnimationDown; + private AlphaAnimation alphaAnimationUp; private Drawable icon; + private AppCompatTextView textView; public CircleActionButton(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); - init(context,attrs); + init(context, attrs); } - private void init(Context context,AttributeSet attrs) + private void init(Context context, AttributeSet attrs) { inflate(context, R.layout.circle_action_button, this); @@ -43,12 +50,19 @@ public class CircleActionButton extends FrameLayout implements View.OnTouchListe circleActionButton = findViewById(R.id.actionButtonCircle); frameAfterPadding = findViewById(R.id.frameAfterPadding); ImageView imageView = findViewById(R.id.circleActionButtonImageView); - AppCompatTextView textView = findViewById(R.id.circleActionButtonTextView); + textView = findViewById(R.id.circleActionButtonTextView); btn.setOnTouchListener(this); TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.CircleActionButton); + int textSize = a.getDimensionPixelSize(R.styleable.CircleActionButton_textSize, 0); + + if (textSize > 0) + { + textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); + } + icon = getContext().getDrawable(a.getResourceId(R.styleable.CircleActionButton_src, 0)); CharSequence text = a.getText(R.styleable.CircleActionButton_text); @@ -67,7 +81,7 @@ public class CircleActionButton extends FrameLayout implements View.OnTouchListe } else if (motionEvent.getAction() == MotionEvent.ACTION_UP) { - animateUp(); + //animateUp(); performClick(); } @@ -83,11 +97,21 @@ public class CircleActionButton extends FrameLayout implements View.OnTouchListe initial_circle_width = circleActionButton.getMeasuredWidth(); } + + alphaAnimationDown = new AlphaAnimation(1f, 0.5f); + alphaAnimationDown.setDuration(50); + alphaAnimationDown.setFillAfter(true); + circleActionButton.startAnimation(alphaAnimationDown); + + final CircleActionButton that = this; + ValueAnimator anim = ValueAnimator.ofInt(initial_circle_width, frameAfterPadding.getMeasuredWidth()); animationDown = anim; - anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { + anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() + { @Override - public void onAnimationUpdate(ValueAnimator valueAnimator) { + public void onAnimationUpdate(ValueAnimator valueAnimator) + { int val = (Integer) valueAnimator.getAnimatedValue(); ViewGroup.LayoutParams layoutParams = circleActionButton.getLayoutParams(); layoutParams.width = val; @@ -105,7 +129,7 @@ public class CircleActionButton extends FrameLayout implements View.OnTouchListe @Override public void onAnimationEnd(Animator animator) { - + that.animateUp(); } @Override @@ -124,22 +148,31 @@ public class CircleActionButton extends FrameLayout implements View.OnTouchListe anim.start(); } - private void animateUp() + public void animateUp() { cancelAnimations(); + + alphaAnimationUp = new AlphaAnimation(0.5f, 1f); + alphaAnimationUp.setDuration(500); + alphaAnimationUp.setFillAfter(true); + alphaAnimationUp.setStartTime(1000); + circleActionButton.startAnimation(alphaAnimationUp); + ValueAnimator anim = ValueAnimator.ofInt(circleActionButton.getMeasuredWidth(), initial_circle_width); animationUp = anim; - anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { + anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() + { @Override - public void onAnimationUpdate(ValueAnimator valueAnimator) { + public void onAnimationUpdate(ValueAnimator valueAnimator) + { int val = (Integer) valueAnimator.getAnimatedValue(); ViewGroup.LayoutParams layoutParams = circleActionButton.getLayoutParams(); layoutParams.width = val; circleActionButton.setLayoutParams(layoutParams); } }); - anim.setDuration(300); - anim.setStartDelay(200); + anim.setDuration(500); + anim.setStartDelay(1000); anim.start(); } @@ -156,5 +189,39 @@ public class CircleActionButton extends FrameLayout implements View.OnTouchListe animationUp.cancel(); animationUp = null; } + + if (alphaAnimationDown != null) + { + alphaAnimationDown.cancel(); + alphaAnimationDown = null; + } + + if (alphaAnimationUp != null) + { + alphaAnimationUp.cancel(); + alphaAnimationUp = null; + } + } + + public void setText(String text) + { + this.textView.setText(text); + } + + public String getText() + { + return this.textView.getText().toString(); + } + + @BindingAdapter("text") + public static void setText(CircleActionButton view, String value) + { + view.setText(value); + } + + @InverseBindingAdapter(attribute = "text") + public static String getText(CircleActionButton view) + { + return view.getText(); } } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dagger/ApplicationComponent.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dagger/ApplicationComponent.java index 498e3776d..db2848fa1 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dagger/ApplicationComponent.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dagger/ApplicationComponent.java @@ -1,5 +1,6 @@ package com.twine.colorcapture.dagger; +import com.twine.colorcapture.dialogs.confirm.ConfirmDialog; import com.twine.colorcapture.dialogs.error.ErrorDialog; import com.twine.colorcapture.dialogs.processing.ProcessingDialog; import com.twine.colorcapture.dialogs.progress.ProgressDialog; @@ -10,7 +11,9 @@ import com.twine.colorcapture.views.mycolors.MyColorsFragment; import com.twine.colorcapture.views.loading.LoadingActivity; import com.twine.colorcapture.views.main.MainActivity; import com.twine.colorcapture.views.register.RegisterFragment; +import com.twine.colorcapture.views.rename.RenameFragment; import com.twine.colorcapture.views.result.ResultFragment; +import com.twine.colorcapture.views.sendtoemail.SendToEmailActivity; import com.twine.colorcapture.views.sendtomachine.SendToMachineFragment; import javax.inject.Singleton; @@ -48,4 +51,10 @@ public interface ApplicationComponent void inject(SuccessDialog successDialog); void inject(SendToMachineFragment sendToMachineFragment); + + void inject(ConfirmDialog confirmDialog); + + void inject(RenameFragment renameFragment); + + void inject(SendToEmailActivity sendToEmailActivity); } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dagger/ViewModelsModule.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dagger/ViewModelsModule.java index 40a49f021..f83826b21 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dagger/ViewModelsModule.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dagger/ViewModelsModule.java @@ -1,6 +1,7 @@ package com.twine.colorcapture.dagger; import com.squareup.otto.Bus; +import com.twine.colorcapture.dialogs.confirm.ConfirmDialogVM; import com.twine.colorcapture.dialogs.error.ErrorDialogVM; import com.twine.colorcapture.dialogs.processing.ProcessingDialogVM; import com.twine.colorcapture.dialogs.progress.ProgressDialogVM; @@ -13,7 +14,9 @@ import com.twine.colorcapture.views.loading.LoadingActivityVM; import com.twine.colorcapture.views.mycolors.MyColorsFragmentVM; import com.twine.colorcapture.views.main.MainActivityVM; import com.twine.colorcapture.views.register.RegisterFragmentVM; +import com.twine.colorcapture.views.rename.RenameFragmentVM; import com.twine.colorcapture.views.result.ResultFragmentVM; +import com.twine.colorcapture.views.sendtoemail.SendToEmailActivityVM; import com.twine.colorcapture.views.sendtomachine.SendToMachineFragmentVM; import com.twine.colorcapture.web.ITCCService; @@ -44,18 +47,25 @@ public class ViewModelsModule return new LoadingActivityVM(eventBus, notificationProvider, navigationProvider, tccService); } + @Provides + @Singleton + public SendToEmailActivityVM provideSendToEmailActivityVM(Bus eventBus, INotificationProvider notificationProvider, INavigationProvider navigationProvider, ITCCService tccService) + { + return new SendToEmailActivityVM(); + } + @Provides @Singleton public MyColorsFragmentVM provideMyColorsFragmentVM(Bus eventBus, INotificationProvider notificationProvider, INavigationProvider navigationProvider) { - return new MyColorsFragmentVM(navigationProvider); + return new MyColorsFragmentVM(navigationProvider, notificationProvider); } @Provides @Singleton public CaptureFragmentVM provideCaptureFragmentVM(Bus eventBus, INotificationProvider notificationProvider, INavigationProvider navigationProvider, ITCCService tccService) { - return new CaptureFragmentVM(eventBus,tccService, navigationProvider, notificationProvider); + return new CaptureFragmentVM(eventBus, tccService, navigationProvider, notificationProvider); } @Provides @@ -67,23 +77,30 @@ public class ViewModelsModule @Provides @Singleton - public ResultFragmentVM provideResultFragmentVM(Bus eventBus,INavigationProvider navigationProvider) + public ResultFragmentVM provideResultFragmentVM(Bus eventBus, INavigationProvider navigationProvider, ITCCService tccService) { - return new ResultFragmentVM(eventBus,navigationProvider); + return new ResultFragmentVM(eventBus, navigationProvider, tccService); } @Provides @Singleton - public RegisterFragmentVM provideRegisterFragmentVM(INotificationProvider notificationProvider, INavigationProvider navigationProvider, ITCCService tccService,Bus eventBus) + public RegisterFragmentVM provideRegisterFragmentVM(INotificationProvider notificationProvider, INavigationProvider navigationProvider, ITCCService tccService, Bus eventBus) { - return new RegisterFragmentVM(notificationProvider,navigationProvider,tccService,eventBus); + return new RegisterFragmentVM(notificationProvider, navigationProvider, tccService, eventBus); } @Provides @Singleton - public SendToMachineFragmentVM provideSendMachineFragmentVM(INotificationProvider notificationProvider, INavigationProvider navigationProvider) + public RenameFragmentVM provideRenameFragmentVM(INavigationProvider navigationProvider) { - return new SendToMachineFragmentVM(notificationProvider,navigationProvider); + return new RenameFragmentVM(navigationProvider); + } + + @Provides + @Singleton + public SendToMachineFragmentVM provideSendMachineFragmentVM(INotificationProvider notificationProvider, INavigationProvider navigationProvider, ITCCService tccService) + { + return new SendToMachineFragmentVM(notificationProvider, navigationProvider, tccService); } @Provides @@ -107,6 +124,13 @@ public class ViewModelsModule return new SuccessDialogVM(); } + @Provides + @Singleton + public ConfirmDialogVM provideConfirmDialogVM() + { + return new ConfirmDialogVM(); + } + @Provides @Singleton public WelcomeDialogVM provideWelcomeDialogVM() diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/confirm/ConfirmDialog.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/confirm/ConfirmDialog.java new file mode 100644 index 000000000..9b67c2a08 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/confirm/ConfirmDialog.java @@ -0,0 +1,22 @@ +package com.twine.colorcapture.dialogs.confirm; + +import com.twine.colorcapture.App; +import com.twine.colorcapture.R; +import com.twine.colorcapture.databinding.DialogConfirmBinding; +import com.twine.colorcapture.mvvm.DialogBase; + +public class ConfirmDialog extends DialogBase +{ + + @Override + public int getLayoutId() + { + return R.layout.dialog_confirm; + } + + @Override + public void inject() + { + App.getComponent().inject(this); + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/confirm/ConfirmDialogVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/confirm/ConfirmDialogVM.java new file mode 100644 index 000000000..5fa0db57c --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/confirm/ConfirmDialogVM.java @@ -0,0 +1,41 @@ +package com.twine.colorcapture.dialogs.confirm; + +import com.twine.colorcapture.mvvm.DependencyProperty; +import com.twine.colorcapture.mvvm.MessageDialogViewModelBase; +import com.twine.colorcapture.mvvm.RelayCommand; + +public class ConfirmDialogVM extends MessageDialogViewModelBase +{ + private boolean confirmed; + + public DependencyProperty confirmText; + public RelayCommand confirmCommand; + + public ConfirmDialogVM() + { + super(); + confirmText = new DependencyProperty<>("OK"); + confirmCommand = new RelayCommand(this::onConfirmed); + } + + private void onConfirmed() + { + confirmed = true; + close(); + } + + public void setConfirmText(String confirmText) + { + this.confirmText.set(confirmText); + } + + public boolean isConfirmed() + { + return this.confirmed; + } + + public void setConfirmed(Boolean confirmed) + { + this.confirmed = confirmed; + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/error/ErrorDialogVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/error/ErrorDialogVM.java index 4bc2dbb36..6dee3dfe1 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/error/ErrorDialogVM.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/error/ErrorDialogVM.java @@ -2,25 +2,9 @@ package com.twine.colorcapture.dialogs.error; import com.twine.colorcapture.mvvm.DependencyProperty; import com.twine.colorcapture.mvvm.DialogViewModelBase; +import com.twine.colorcapture.mvvm.MessageDialogViewModelBase; -public class ErrorDialogVM extends DialogViewModelBase +public class ErrorDialogVM extends MessageDialogViewModelBase { - public DependencyProperty title; - public DependencyProperty message; - public ErrorDialogVM() - { - title = new DependencyProperty<>(""); - message = new DependencyProperty<>(""); - } - - public void setTitle(String title) - { - this.title.set(title); - } - - public void setMessage(String message) - { - this.message.set(message); - } } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/progress/ProgressDialogVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/progress/ProgressDialogVM.java index 4b7dc1d34..24d0da2ea 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/progress/ProgressDialogVM.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/progress/ProgressDialogVM.java @@ -2,25 +2,9 @@ package com.twine.colorcapture.dialogs.progress; import com.twine.colorcapture.mvvm.DependencyProperty; import com.twine.colorcapture.mvvm.DialogViewModelBase; +import com.twine.colorcapture.mvvm.MessageDialogViewModelBase; -public class ProgressDialogVM extends DialogViewModelBase +public class ProgressDialogVM extends MessageDialogViewModelBase { - public DependencyProperty title; - public DependencyProperty message; - public ProgressDialogVM() - { - title = new DependencyProperty<>(""); - message = new DependencyProperty<>(""); - } - - public void setTitle(String title) - { - this.title.set(title); - } - - public void setMessage(String message) - { - this.message.set(message); - } } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/success/SuccessDialogVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/success/SuccessDialogVM.java index b1fb00129..466f32879 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/success/SuccessDialogVM.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/dialogs/success/SuccessDialogVM.java @@ -2,25 +2,9 @@ package com.twine.colorcapture.dialogs.success; import com.twine.colorcapture.mvvm.DependencyProperty; import com.twine.colorcapture.mvvm.DialogViewModelBase; +import com.twine.colorcapture.mvvm.MessageDialogViewModelBase; -public class SuccessDialogVM extends DialogViewModelBase +public class SuccessDialogVM extends MessageDialogViewModelBase { - public DependencyProperty title; - public DependencyProperty message; - public SuccessDialogVM() - { - title = new DependencyProperty<>(""); - message = new DependencyProperty<>(""); - } - - public void setTitle(String title) - { - this.title.set(title); - } - - public void setMessage(String message) - { - this.message.set(message); - } } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/integration/ExternalBridgeClient.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/integration/ExternalBridgeClient.java index b2ccc16dc..99436a6b2 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/integration/ExternalBridgeClient.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/integration/ExternalBridgeClient.java @@ -31,6 +31,7 @@ public class ExternalBridgeClient try { Socket tcpClient = new Socket(); + tcpClient.setSoTimeout(10000); tcpClient.connect(new InetSocketAddress(machine.getIpAddress(), EXTERNAL_BRIDGE_PORT), 2000); //Create detection color diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/logging/LogManager.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/logging/LogManager.java new file mode 100644 index 000000000..a15e0752d --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/logging/LogManager.java @@ -0,0 +1,35 @@ +package com.twine.colorcapture.logging; + +import android.util.Log; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class LogManager +{ + private static final String TAG = "TCC"; + + public static void log(String message) + { + Log.d(TAG, message); + } + + public static Exception log(Exception ex) + { + Log.e(TAG, ex.toString()); + return ex; + } + + public static Exception log(Exception ex, String message) + { + Log.e(TAG, message, ex); + return ex; + } + + public static void log(String message, Object obj) + { + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String json = gson.toJson(obj); + Log.d(TAG, message + "\n" + json); + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/models/ColorResult.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/models/ColorResult.java new file mode 100644 index 000000000..a4c726ef6 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/models/ColorResult.java @@ -0,0 +1,54 @@ +package com.twine.colorcapture.models; + +import android.databinding.BaseObservable; + +import com.twine.colorcapture.mvvm.ExtendedObject; +import com.twine.colorcapture.web.messages.DetectionColor; +import com.twine.colorcapture.web.messages.DetectionResponse; + +import org.joda.time.DateTime; + +public class ColorResult extends BaseObservable +{ + private DetectionResponse detectionResponse; + private String date; + private String name; + + public DetectionResponse getDetectionResponse() + { + return detectionResponse; + } + + public void setDetectionResponse(DetectionResponse detectionResponse) + { + this.detectionResponse = detectionResponse; + } + + public String getDate() + { + return date; + } + + public void setDate(String date) + { + this.date = date; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + notifyChange(); + } + + public ColorResult(DetectionResponse detectionResponse, String date, String name) + { + this.detectionResponse = detectionResponse; + this.date = date; + this.name = name; + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/models/ColorResultVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/models/ColorResultVM.java new file mode 100644 index 000000000..02dd14b8b --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/models/ColorResultVM.java @@ -0,0 +1,40 @@ +package com.twine.colorcapture.models; + +import com.twine.colorcapture.core.IAction1; +import com.twine.colorcapture.mvvm.RelayCommand; +import com.twine.colorcapture.mvvm.ViewModelBase; + +public class ColorResultVM extends ViewModelBase +{ + private ColorResult result; + public RelayCommand deleteCommand; + private IAction1 onDeleteListener; + + public ColorResultVM() + { + deleteCommand = new RelayCommand(this::handleDeleteCommand); + } + + private void handleDeleteCommand() + { + if (onDeleteListener != null) + { + onDeleteListener.invoke(this); + } + } + + public ColorResult getResult() + { + return result; + } + + public void setResult(ColorResult result) + { + this.result = result; + } + + public void setOnDeleteListener(IAction1 listener) + { + onDeleteListener = listener; + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/mvvm/MessageDialogViewModelBase.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/mvvm/MessageDialogViewModelBase.java new file mode 100644 index 000000000..f2026ecc6 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/mvvm/MessageDialogViewModelBase.java @@ -0,0 +1,25 @@ +package com.twine.colorcapture.mvvm; + +public class MessageDialogViewModelBase extends DialogViewModelBase +{ + public DependencyProperty title; + public DependencyProperty message; + public RelayCommand closeCommand; + + public MessageDialogViewModelBase() + { + title = new DependencyProperty<>(""); + message = new DependencyProperty<>(""); + closeCommand = new RelayCommand(this::close); + } + + public void setTitle(String title) + { + this.title.set(title); + } + + public void setMessage(String message) + { + this.message.set(message); + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/AndroidNavigationProvider.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/AndroidNavigationProvider.java index 5924c17d9..07bb16ecc 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/AndroidNavigationProvider.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/AndroidNavigationProvider.java @@ -279,6 +279,7 @@ public class AndroidNavigationProvider extends ExtendedObject implements INaviga { Class cls = Class.forName(activityName); Intent intent = new Intent(context, cls); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if (!addToHistory) { diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/NavigationActivity.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/NavigationActivity.java index b03f688bc..760e0f8b6 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/NavigationActivity.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/NavigationActivity.java @@ -4,4 +4,5 @@ public enum NavigationActivity { Loading, Main, + SendToEmail, } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/NavigationFragment.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/NavigationFragment.java index 07474ec3e..0731287e8 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/NavigationFragment.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/NavigationFragment.java @@ -8,5 +8,8 @@ public enum NavigationFragment @PreventHistory Register, @PreventHistory - SendToMachine + SendToMachine, + @PreventHistory + Rename + } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/TabState.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/TabState.java new file mode 100644 index 000000000..2682ded78 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/TabState.java @@ -0,0 +1,8 @@ +package com.twine.colorcapture.navigation; + +public enum TabState +{ + Capture, + MyColors, + More +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/TabStateManager.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/TabStateManager.java new file mode 100644 index 000000000..89156af17 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/navigation/TabStateManager.java @@ -0,0 +1,25 @@ +package com.twine.colorcapture.navigation; + +import com.twine.colorcapture.mvvm.DependencyProperty; + +public class TabStateManager +{ + private static TabStateManager instance; + + public DependencyProperty state; + + public static TabStateManager getInstance() + { + if (instance == null) + { + instance = new TabStateManager(); + } + + return instance; + } + + public TabStateManager() + { + state = new DependencyProperty<>(TabState.Capture); + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/notification/AndroidNotificationProvider.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/notification/AndroidNotificationProvider.java index 307fc5edf..528bea2e2 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/notification/AndroidNotificationProvider.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/notification/AndroidNotificationProvider.java @@ -9,6 +9,8 @@ import android.widget.Toast; import com.twine.colorcapture.core.IAction; import com.twine.colorcapture.core.IAction1; +import com.twine.colorcapture.dialogs.confirm.ConfirmDialog; +import com.twine.colorcapture.dialogs.confirm.ConfirmDialogVM; import com.twine.colorcapture.dialogs.error.ErrorDialog; import com.twine.colorcapture.dialogs.error.ErrorDialogVM; import com.twine.colorcapture.dialogs.progress.ProgressDialog; @@ -152,6 +154,34 @@ public class AndroidNotificationProvider implements INotificationProvider vm.setMessage(message); } + @Override + public void showConfirm(String title, String message,String confirmText, IAction1 onDismiss) + { + closeDialog(); + ConfirmDialog dialog = new ConfirmDialog(); + dialog.inject(); + + lastDialog = dialog; + FragmentTransaction ft = activity.getFragmentManager().beginTransaction(); + Fragment prev = activity.getFragmentManager().findFragmentByTag("dialog"); + if (prev != null) { + ft.remove(prev); + } + ft.addToBackStack(null); + + dialog.setOnDismissListener(onDismiss); + + //show the dialog. + dialog.show(ft, "dialog"); + + ConfirmDialogVM vm = dialog.getVM(); + + vm.setConfirmed(false); + vm.setTitle(title); + vm.setMessage(message); + vm.setConfirmText(confirmText); + } + @Override public void closeDialog() { diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/notification/INotificationProvider.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/notification/INotificationProvider.java index b1295a8b4..121ce0919 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/notification/INotificationProvider.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/notification/INotificationProvider.java @@ -4,6 +4,7 @@ import android.app.Activity; import com.twine.colorcapture.core.IAction; import com.twine.colorcapture.core.IAction1; +import com.twine.colorcapture.dialogs.confirm.ConfirmDialogVM; import com.twine.colorcapture.dialogs.error.ErrorDialogVM; import com.twine.colorcapture.dialogs.progress.ProgressDialogVM; import com.twine.colorcapture.dialogs.success.SuccessDialog; @@ -37,6 +38,7 @@ public interface INotificationProvider /** * Displays a progress dialog... + * * @param title * @param message */ @@ -44,6 +46,7 @@ public interface INotificationProvider /** * Displays a success dialog. + * * @param title * @param message * @param onDismiss @@ -52,12 +55,22 @@ public interface INotificationProvider /** * Displays an error dialog. + * * @param title * @param message * @param onDismiss */ void showError(String title, String message, IAction1 onDismiss); + /** + * Displays a confirmation dialog. + * + * @param title + * @param message + * @param onDismiss + */ + void showConfirm(String title, String message, String confirmText, IAction1 onDismiss); + /** * Closes the last dialog. */ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/settings/SettingsManager.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/settings/SettingsManager.java new file mode 100644 index 000000000..b90f11a13 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/settings/SettingsManager.java @@ -0,0 +1,96 @@ +package com.twine.colorcapture.settings; + +import android.content.SharedPreferences; + +import com.google.gson.Gson; +import com.twine.colorcapture.logging.LogManager; +import com.twine.colorcapture.models.ColorResult; + +import java.util.ArrayList; +import java.util.List; + +import static android.content.Context.MODE_PRIVATE; +import static com.twine.colorcapture.App.getContext; + +public class SettingsManager +{ + private static final String SETTINGS_FILE_NAME = "TCC_Settings"; + private static SettingsManager instance; + private boolean isWelcomeScreenShown; + private List results; + + public boolean isWelcomeScreenShown() + { + return isWelcomeScreenShown; + } + + public void setWelcomeScreenShown(boolean welcomeScreenShown) + { + isWelcomeScreenShown = welcomeScreenShown; + } + + public List getResults() + { + return results; + } + + public static SettingsManager getInstance() + { + if (instance == null) + { + instance = load(); + } + + return instance; + } + + public static void save() + { + try + { + LogManager.log("Saving settings..."); + Gson gson = new Gson(); + String value = gson.toJson(getInstance()); + SharedPreferences.Editor editor = getContext().getSharedPreferences(SETTINGS_FILE_NAME, MODE_PRIVATE).edit(); + editor.putString("settings", value); + editor.apply(); + + LogManager.log("Settings:", getInstance()); + } + catch (Exception ex) + { + LogManager.log(ex, "Error saving settings."); + } + } + + private static SettingsManager load() + { + SettingsManager result = new SettingsManager(); + + try + { + LogManager.log("Loading settings..."); + SharedPreferences prefs = getContext().getSharedPreferences(SETTINGS_FILE_NAME, MODE_PRIVATE); + String value = prefs.getString("settings", null); + + if (value != null) + { + Gson gson = new Gson(); + result = gson.fromJson(value, SettingsManager.class); + } + } + catch (Exception ex) + { + LogManager.log(ex, "Error loading settings."); + } + + LogManager.log("Settings:", result); + + return result; + } + + public SettingsManager() + { + results = new ArrayList<>(); + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/capture/CaptureFragmentVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/capture/CaptureFragmentVM.java index b043bef9f..c0b89fba8 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/capture/CaptureFragmentVM.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/capture/CaptureFragmentVM.java @@ -8,12 +8,16 @@ import com.squareup.otto.Bus; import com.twine.colorcapture.core.Task.TaskBuilder; import com.twine.colorcapture.dialogs.processing.ProcessingDialog; import com.twine.colorcapture.dialogs.welcome.WelcomeDialog; +import com.twine.colorcapture.models.ColorResult; import com.twine.colorcapture.mvvm.DependencyProperty; import com.twine.colorcapture.mvvm.ViewModelBase; import com.twine.colorcapture.navigation.INavigationProvider; import com.twine.colorcapture.navigation.NavigationFragment; +import com.twine.colorcapture.navigation.TabState; +import com.twine.colorcapture.navigation.TabStateManager; import com.twine.colorcapture.notification.INotificationProvider; import com.twine.colorcapture.opencv.ImageProcessor; +import com.twine.colorcapture.settings.SettingsManager; import com.twine.colorcapture.utils.ThreadingUtils; import com.twine.colorcapture.views.capture.ICaptureFragment.ICaptureFragmentListener; import com.twine.colorcapture.web.ITCCService; @@ -24,6 +28,11 @@ import com.yanzhenjie.zbar.ImageScanner; import com.yanzhenjie.zbar.Symbol; import com.yanzhenjie.zbar.SymbolSet; +import org.joda.time.LocalDateTime; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + +import java.util.Locale; import java.util.concurrent.atomic.AtomicBoolean; public class CaptureFragmentVM extends ViewModelBase implements ICaptureFragmentListener @@ -42,7 +51,6 @@ public class CaptureFragmentVM extends ViewModelBase implement private DefinitionResponse definition; private INavigationProvider navigationProvider; private INotificationProvider notificationProvider; - private boolean startDialogShown; private boolean preventDetection; private Bus eventBus; @@ -161,8 +169,17 @@ public class CaptureFragmentVM extends ViewModelBase implement if (!abort.get()) { + LocalDateTime date = LocalDateTime.now(); + DateTimeFormatter fmt = DateTimeFormat.forPattern("d MMMM, yyyy, hh:mm:ss").withLocale(Locale.ENGLISH); + String name = date.toString(fmt); + + ColorResult colorResult = new ColorResult(response, date.toString(), name); + + SettingsManager.getInstance().getResults().add(colorResult); + SettingsManager.save(); + notificationProvider.closeDialog(); - navigationProvider.navigateWithObjectTo(NavigationFragment.Result, true, false, response); + navigationProvider.navigateWithObjectTo(NavigationFragment.Result, true, false, colorResult); } else { @@ -203,18 +220,22 @@ public class CaptureFragmentVM extends ViewModelBase implement protected void onNavigatedTo() { super.onNavigatedTo(); + TabStateManager.getInstance().state.set(TabState.Capture); preventDetection = false; - if (!startDialogShown) - { - startDialogShown = true; + boolean showDialog = !SettingsManager.getInstance().isWelcomeScreenShown(); + if (showDialog) + { notificationProvider.showDialog(new WelcomeDialog(), (vm) -> { isCardDetected.set(false); view.startCamera(); }); + + SettingsManager.getInstance().setWelcomeScreenShown(true); + SettingsManager.save(); } else { diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/IMainActivity.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/IMainActivity.java index 866a0ece7..0835d4eef 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/IMainActivity.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/IMainActivity.java @@ -4,4 +4,5 @@ import com.twine.colorcapture.mvvm.IView; public interface IMainActivity extends IView { + void cloneMenu(); } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivity.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivity.java index e0eaca38c..f40b78a4b 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivity.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivity.java @@ -10,6 +10,7 @@ import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageButton; import android.widget.LinearLayout; import com.twine.colorcapture.App; @@ -38,7 +39,7 @@ public class MainActivity extends ActivityBase private INotificationProvider notificationProvider; private CurrentTab currentTab; - public DependencyProperty isMoreToggled; - public DependencyProperty isCaptureToggled; - public DependencyProperty isMyColorsToggled; + public TabStateManager tabStateManager; + + public RelayCommand captureCommand; + public RelayCommand myColorsCommand; + public RelayCommand moreCommand; + + public RelayCommand howToUseCommand; @Inject public MainActivityVM(Bus eventBus, INotificationProvider notificationProvider, INavigationProvider navigationProvider) { + tabStateManager = TabStateManager.getInstance(); + this.navigationProvider = navigationProvider; this.notificationProvider = notificationProvider; - isMoreToggled = new DependencyProperty(false, this::onMoreToggled); - isCaptureToggled = new DependencyProperty(false, this::onCaptureToggled); - isMyColorsToggled = new DependencyProperty(false, this::onMyColorsToggled); currentTab = CurrentTab.Capture; - setCurrentTab(currentTab); navigationProvider.addFragmentNavigationListener(this::onNavigation); + + howToUseCommand = new RelayCommand(this::handleHowToUseCommand); + + captureCommand = new RelayCommand(this::handleCaptureCommand); + myColorsCommand = new RelayCommand(this::handleMyColorsCommand); + moreCommand = new RelayCommand(this::handleMoreCommand); } - private void onNavigation(NavigationFragment navigationFragment) + private void handleMoreCommand() + { + + } + + private void handleMyColorsCommand() { - if (navigationFragment == NavigationFragment.Capture || navigationFragment == NavigationFragment.Result && currentTab != CurrentTab.Capture) + if (navigationProvider.getCurrentFragment() != NavigationFragment.MyColors) { - isMoreToggled.setNoCallback(false); - isMyColorsToggled.setNoCallback(false); - isCaptureToggled.setNoCallback(true); + navigationProvider.navigateTo(NavigationFragment.MyColors, true, false); } } - @Override - protected void onViewAttached(IMainActivity view) + private void handleCaptureCommand() { - super.onViewAttached(view); + if (navigationProvider.getCurrentFragment() != NavigationFragment.Capture) + { + navigationProvider.navigateTo(NavigationFragment.Capture, false, true); + } } - private void onMyColorsToggled(DependencyProperty booleanDependencyProperty, Boolean value) + @Override + protected void onNavigatedTo() { - setCurrentTab(CurrentTab.MyColors); + super.onNavigatedTo(); + tabStateManager.state.set(TabState.Capture); } - private void onCaptureToggled(DependencyProperty booleanDependencyProperty, Boolean value) + private void handleHowToUseCommand() { - setCurrentTab(CurrentTab.Capture); + view.cloneMenu(); + notificationProvider.showDialog(new WelcomeDialog(), (vm) -> { }); } - private void onMoreToggled(DependencyProperty booleanDependencyProperty, Boolean value) + private void onNavigation(NavigationFragment navigationFragment) { - setCurrentTab(CurrentTab.More); + } - private void setCurrentTab(CurrentTab tab) + @Override + protected void onViewAttached(IMainActivity view) { - currentTab = tab; - - if (tab == CurrentTab.More) - { - if (isMoreToggled.get()) - { - isCaptureToggled.setNoCallback(false); - isMyColorsToggled.setNoCallback(false); - } - isMoreToggled.setNoCallback(true); - } - else if (tab == CurrentTab.Capture) - { - if (isCaptureToggled.get()) - { - isMoreToggled.setNoCallback(false); - isMyColorsToggled.setNoCallback(false); - navigationProvider.navigateTo(NavigationFragment.Capture, false, true); - } - isCaptureToggled.setNoCallback(true); - } - else if (tab == CurrentTab.MyColors) - { - if (isMyColorsToggled.get()) - { - isMoreToggled.setNoCallback(false); - isCaptureToggled.setNoCallback(false); - navigationProvider.navigateTo(NavigationFragment.MyColors, true, false); - } - isMyColorsToggled.setNoCallback(true); - } + super.onViewAttached(view); } } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/mycolors/MyColorsFragmentVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/mycolors/MyColorsFragmentVM.java index 9a2358516..6b0fc7b27 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/mycolors/MyColorsFragmentVM.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/mycolors/MyColorsFragmentVM.java @@ -1,17 +1,83 @@ package com.twine.colorcapture.views.mycolors; +import android.databinding.ObservableArrayList; +import android.databinding.ObservableList; +import android.view.View; +import android.widget.AdapterView; + +import com.twine.colorcapture.BR; +import com.twine.colorcapture.R; +import com.twine.colorcapture.integration.ExternalBridgeMachine; +import com.twine.colorcapture.logging.LogManager; +import com.twine.colorcapture.models.ColorResult; +import com.twine.colorcapture.models.ColorResultVM; import com.twine.colorcapture.mvvm.ViewModelBase; import com.twine.colorcapture.navigation.INavigationProvider; +import com.twine.colorcapture.navigation.NavigationFragment; +import com.twine.colorcapture.navigation.TabState; +import com.twine.colorcapture.navigation.TabStateManager; +import com.twine.colorcapture.notification.INotificationProvider; +import com.twine.colorcapture.settings.SettingsManager; + +import java.util.Collections; import javax.inject.Inject; +import me.tatarka.bindingcollectionadapter2.ItemBinding; + +import static br.com.zbra.androidlinq.Linq.stream; + public class MyColorsFragmentVM extends ViewModelBase { private INavigationProvider navigationProvider; - + private INotificationProvider notificationProvider; + public ObservableList results; + public ItemBinding resultBinding; + @Inject - public MyColorsFragmentVM(INavigationProvider navigationProvider) + public MyColorsFragmentVM(INavigationProvider navigationProvider, INotificationProvider notificationProvider) { + this.notificationProvider = notificationProvider; this.navigationProvider = navigationProvider; + + results = new ObservableArrayList<>(); + resultBinding = ItemBinding.of(BR.result, R.layout.color_result_item); + } + + public void onResultSelected(AdapterView adapterView, View view, int i, long l) + { + ColorResultVM colorResultVM = (ColorResultVM) adapterView.getAdapter().getItem(i); + navigationProvider.navigateWithObjectTo(NavigationFragment.Result, true, false, colorResultVM.getResult()); + } + + @Override + protected void onNavigatedTo() + { + super.onNavigatedTo(); + + TabStateManager.getInstance().state.set(TabState.MyColors); + + results.clear(); + + for (ColorResult result : stream(SettingsManager.getInstance().getResults()).reverse()) + { + ColorResultVM vm = new ColorResultVM(); + vm.setResult(result); + results.add(vm); + vm.setOnDeleteListener(this::onResultDeleted); + } + } + + private void onResultDeleted(ColorResultVM colorResultVM) + { + notificationProvider.showConfirm("Delete color", "Are you sure you want to delete the selected color?", "Delete", (vm) -> + { + if (vm.isConfirmed()) + { + results.remove(colorResultVM); + SettingsManager.getInstance().getResults().remove(colorResultVM.getResult()); + SettingsManager.save(); + } + }); } } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/register/RegisterFragmentVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/register/RegisterFragmentVM.java index 3641e89ee..3002bf243 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/register/RegisterFragmentVM.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/register/RegisterFragmentVM.java @@ -81,7 +81,7 @@ public class RegisterFragmentVM extends ViewModelBase catch (Exception ex) { pVM.close(); - //TODO: display error message! + notificationProvider.showError("Registering your system","Device registration failed.\nPlease check your serial number.",(e) -> {}); Log.i("REGISTER", ex.getMessage()); } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/IRenameFragment.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/IRenameFragment.java new file mode 100644 index 000000000..9cd9e9a54 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/IRenameFragment.java @@ -0,0 +1,7 @@ +package com.twine.colorcapture.views.rename; + +import com.twine.colorcapture.mvvm.IView; + +public interface IRenameFragment extends IView +{ +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/RenameFragment.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/RenameFragment.java new file mode 100644 index 000000000..228ccd66d --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/RenameFragment.java @@ -0,0 +1,62 @@ +package com.twine.colorcapture.views.rename; + +import android.content.Context; +import android.databinding.Bindable; +import android.support.v7.widget.AppCompatEditText; +import android.view.View; +import android.view.inputmethod.InputMethodManager; + +import com.twine.colorcapture.App; +import com.twine.colorcapture.R; +import com.twine.colorcapture.databinding.FragmentRenameBinding; +import com.twine.colorcapture.mvvm.FragmentBase; + +import butterknife.BindView; + +public class RenameFragment extends FragmentBase +{ + @BindView(R.id.txtName) + public AppCompatEditText txtName; + + @Override + protected int getLayoutId() + { + return R.layout.fragment_rename; + } + + @Override + protected void inject() + { + App.getComponent().inject(this); + } + + @Override + public String getTitle() + { + return "Rename"; + } + + @Override + protected void onCreated() + { + super.onCreated(); + + InputMethodManager imgr = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); + txtName.requestFocus(); + txtName.selectAll(); + imgr.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_NOT_ALWAYS); + } + + @Override + public void onPause() + { + super.onPause(); + + // Check if no view has focus: + View view = getActivity().getCurrentFocus(); + if (view != null) { + InputMethodManager inputManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); + inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); + } + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/RenameFragmentVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/RenameFragmentVM.java new file mode 100644 index 000000000..e860d0aac --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/rename/RenameFragmentVM.java @@ -0,0 +1,50 @@ +package com.twine.colorcapture.views.rename; + +import com.twine.colorcapture.models.ColorResult; +import com.twine.colorcapture.models.ColorResultVM; +import com.twine.colorcapture.mvvm.DependencyProperty; +import com.twine.colorcapture.mvvm.RelayCommand; +import com.twine.colorcapture.mvvm.ViewModelBase; +import com.twine.colorcapture.navigation.INavigationObjectReceiver; +import com.twine.colorcapture.navigation.INavigationProvider; +import com.twine.colorcapture.navigation.TabState; +import com.twine.colorcapture.navigation.TabStateManager; +import com.twine.colorcapture.settings.SettingsManager; + +public class RenameFragmentVM extends ViewModelBase implements INavigationObjectReceiver +{ + private INavigationProvider navigationProvider; + + public DependencyProperty colorResult; + public DependencyProperty name; + public RelayCommand renameCommand; + + public RenameFragmentVM(INavigationProvider navigationProvider) + { + this.navigationProvider = navigationProvider; + colorResult = new DependencyProperty<>(); + renameCommand = new RelayCommand(this::handleRenameCommand); + name = new DependencyProperty<>(""); + } + + private void handleRenameCommand() + { + colorResult.get().setName(name.get()); + SettingsManager.save(); + navigationProvider.navigateBack(); + } + + @Override + protected void onNavigatedTo() + { + super.onNavigatedTo(); + TabStateManager.getInstance().state.set(TabState.MyColors); + } + + @Override + public void onNavigationObjectReceived(ColorResult colorResult) + { + this.colorResult.set(colorResult); + this.name.set(colorResult.getName()); + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/result/ResultFragmentVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/result/ResultFragmentVM.java index 2e5639154..2e58e2777 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/result/ResultFragmentVM.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/result/ResultFragmentVM.java @@ -5,19 +5,34 @@ import android.util.Log; import com.squareup.otto.Bus; import com.squareup.otto.Subscribe; import com.twine.colorcapture.messages.MachineRegisteredMessage; +import com.twine.colorcapture.models.ColorResult; +import com.twine.colorcapture.models.ColorResultVM; import com.twine.colorcapture.mvvm.DependencyProperty; import com.twine.colorcapture.mvvm.RelayCommand; import com.twine.colorcapture.mvvm.ViewModelBase; import com.twine.colorcapture.navigation.INavigationObjectReceiver; import com.twine.colorcapture.navigation.INavigationProvider; +import com.twine.colorcapture.navigation.NavigationActivity; import com.twine.colorcapture.navigation.NavigationFragment; +import com.twine.colorcapture.navigation.TabState; +import com.twine.colorcapture.navigation.TabStateManager; +import com.twine.colorcapture.settings.SettingsManager; +import com.twine.colorcapture.web.ITCCService; import com.twine.colorcapture.web.messages.DetectionResponse; +import org.joda.time.LocalDateTime; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + +import java.util.Locale; + import javax.inject.Inject; -public class ResultFragmentVM extends ViewModelBase implements INavigationObjectReceiver +public class ResultFragmentVM extends ViewModelBase implements INavigationObjectReceiver { private INavigationProvider navigationProvider; + private ITCCService tccService; + public ColorResult colorResult; public DependencyProperty isCameraColorToggled; public DependencyProperty detectionResponse; @@ -28,10 +43,12 @@ public class ResultFragmentVM extends ViewModelBase implements public RelayCommand sendToMachineCommand; public RelayCommand registerMachineCommand; + @Inject - public ResultFragmentVM(Bus eventBus, INavigationProvider navigationProvider) + public ResultFragmentVM(Bus eventBus, INavigationProvider navigationProvider, ITCCService tccService) { this.navigationProvider = navigationProvider; + this.tccService = tccService; isCameraColorToggled = new DependencyProperty<>(false); isMachineRegistred = new DependencyProperty<>(false); @@ -63,11 +80,12 @@ public class ResultFragmentVM extends ViewModelBase implements private void handleRenameCommand() { + navigationProvider.navigateWithObjectTo(NavigationFragment.Rename, true, false, colorResult); } private void handleEmailCommand() { - Log.d("RESULT", "handleEmailCommand: "); + navigationProvider.navigateTo(NavigationActivity.SendToEmail, false); } private void toggleCameraColor() @@ -76,8 +94,24 @@ public class ResultFragmentVM extends ViewModelBase implements } @Override - public void onNavigationObjectReceived(DetectionResponse detectionResponse) + public void onNavigationObjectReceived(ColorResult colorResult) + { + this.colorResult = colorResult; + this.detectionResponse.set(colorResult.getDetectionResponse()); + } + + @Override + protected void onNavigatedTo() { - this.detectionResponse.set(detectionResponse); + super.onNavigatedTo(); + + try + { + isMachineRegistred.set(tccService.getDefinition().isRegistered()); + } + catch (Exception e) + { + e.printStackTrace(); + } } } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/ISendToEmailActivity.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/ISendToEmailActivity.java new file mode 100644 index 000000000..980d2eb49 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/ISendToEmailActivity.java @@ -0,0 +1,7 @@ +package com.twine.colorcapture.views.sendtoemail; + +import com.twine.colorcapture.mvvm.IView; + +public interface ISendToEmailActivity extends IView +{ +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/SendToEmailActivity.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/SendToEmailActivity.java new file mode 100644 index 000000000..d886de513 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/SendToEmailActivity.java @@ -0,0 +1,30 @@ +package com.twine.colorcapture.views.sendtoemail; + +import android.app.Activity; +import android.os.Bundle; + +import com.twine.colorcapture.App; +import com.twine.colorcapture.R; +import com.twine.colorcapture.databinding.ActivitySendToEmailBinding; +import com.twine.colorcapture.mvvm.ActivityBase; + +public class SendToEmailActivity extends ActivityBase implements ISendToEmailActivity +{ + @Override + protected void onCreating(Bundle savedInstanceState) + { + + } + + @Override + protected int getLayoutId() + { + return R.layout.activity_send_to_email; + } + + @Override + protected void inject() + { + App.getComponent().inject(this); + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/SendToEmailActivityVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/SendToEmailActivityVM.java new file mode 100644 index 000000000..77467fff4 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtoemail/SendToEmailActivityVM.java @@ -0,0 +1,21 @@ +package com.twine.colorcapture.views.sendtoemail; + +import com.twine.colorcapture.models.ColorResult; +import com.twine.colorcapture.mvvm.RelayCommand; +import com.twine.colorcapture.mvvm.ViewModelBase; + +public class SendToEmailActivityVM extends ViewModelBase +{ + public RelayCommand sendCommand; + public ColorResult colorResult; + + public SendToEmailActivityVM() + { + sendCommand = new RelayCommand(this::handleSendCommand); + } + + private void handleSendCommand() + { + + } +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtomachine/SendToMachineFragmentVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtomachine/SendToMachineFragmentVM.java index 0d415b498..a51d0eb71 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtomachine/SendToMachineFragmentVM.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/sendtomachine/SendToMachineFragmentVM.java @@ -2,8 +2,6 @@ package com.twine.colorcapture.views.sendtomachine; import android.databinding.ObservableArrayList; import android.databinding.ObservableList; -import android.os.Handler; -import android.os.Looper; import android.view.View; import android.widget.AdapterView; @@ -16,6 +14,7 @@ import com.twine.colorcapture.mvvm.ViewModelBase; import com.twine.colorcapture.navigation.INavigationObjectReceiver; import com.twine.colorcapture.navigation.INavigationProvider; import com.twine.colorcapture.notification.INotificationProvider; +import com.twine.colorcapture.web.ITCCService; import com.twine.colorcapture.web.messages.DetectionColor; import java.util.concurrent.atomic.AtomicBoolean; @@ -24,21 +23,25 @@ import javax.inject.Inject; import me.tatarka.bindingcollectionadapter2.ItemBinding; +import static br.com.zbra.androidlinq.Linq.stream; + public class SendToMachineFragmentVM extends ViewModelBase implements INavigationObjectReceiver { private ExternalBridgeScanner scanner; private DetectionColor detectionColor; private INotificationProvider notificationProvider; private INavigationProvider navigationProvider; + private ITCCService tccService; public ObservableList machines; public ItemBinding machineBinding; @Inject - public SendToMachineFragmentVM(INotificationProvider notificationProvider, INavigationProvider navigationProvider) + public SendToMachineFragmentVM(INotificationProvider notificationProvider, INavigationProvider navigationProvider, ITCCService tccService) { this.notificationProvider = notificationProvider; this.navigationProvider = navigationProvider; + this.tccService = tccService; machines = new ObservableArrayList<>(); scanner = new ExternalBridgeScanner(); @@ -50,18 +53,24 @@ public class SendToMachineFragmentVM extends ViewModelBase + if (stream(tccService.getOrganizationMachines()).any(x -> x.equals(machine.getSerialNumber()))) { - machines.remove(machine); - }); + invokeUI(() -> + { + machines.remove(machine); + }); + } } private void onMachineDiscovered(Object o, ExternalBridgeMachine machine) { - invokeUI(() -> + if (stream(tccService.getOrganizationMachines()).any(x -> x.equals(machine.getSerialNumber()))) { - machines.add(0, machine); - }); + invokeUI(() -> + { + machines.add(0, machine); + }); + } } @Override diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/ITCCService.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/ITCCService.java index feefe86f8..362abe121 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/ITCCService.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/ITCCService.java @@ -8,6 +8,7 @@ import com.twine.colorcapture.web.messages.DetectionResponse; import com.twine.colorcapture.web.messages.MachineRegistrationResponse; import java.io.IOException; +import java.util.List; public interface ITCCService { @@ -16,4 +17,8 @@ public interface ITCCService DetectionResponse detect(Bitmap bitmap, String barcode) throws Exception; MachineRegistrationResponse register(String serialNumber) throws Exception; + + boolean isRegistered(); + + List getOrganizationMachines(); } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/TCCService.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/TCCService.java index 6e03755b8..6999d2f0e 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/TCCService.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/TCCService.java @@ -7,6 +7,7 @@ import android.provider.Settings; import android.util.Base64; import com.twine.colorcapture.BuildConfig; +import com.twine.colorcapture.logging.LogManager; import com.twine.colorcapture.utils.BitmapUtils; import com.twine.colorcapture.web.messages.DefinitionRequest; import com.twine.colorcapture.web.messages.DefinitionResponse; @@ -18,6 +19,7 @@ import com.twine.colorcapture.web.messages.MachineRegistrationRequest; import com.twine.colorcapture.web.messages.MachineRegistrationResponse; import java.io.IOException; +import java.util.List; import java.util.UUID; import javax.inject.Inject; @@ -34,6 +36,8 @@ public class TCCService implements ITCCService private IWebServiceAPI webAPI; private LoginResponse loginResponse; private static final String DEVICE_ID_PREF_NAME = "DeviceIdFile"; + private boolean isRegistered; + private List organizationMachines; @Inject public TCCService(IWebServiceAPI webServiceAPI) @@ -44,6 +48,8 @@ public class TCCService implements ITCCService @Override public DefinitionResponse getDefinition() throws Exception { + LogManager.log("Retrieving definition..."); + ensureAuthenticated(); if (definition == null) @@ -52,11 +58,15 @@ public class TCCService implements ITCCService if (response.isSuccessful()) { - definition = webAPI.getDefinition(new DefinitionRequest()).execute().body(); + definition = response.body(); + isRegistered = definition.isRegistered(); + organizationMachines = definition.getOrganizationMachines(); + + LogManager.log("Definition retrieved.", definition); } else { - throw new Exception(response.message()); + throw LogManager.log(new Exception(response.message())); } } @@ -88,20 +98,30 @@ public class TCCService implements ITCCService @Override public MachineRegistrationResponse register(String serialNumber) throws Exception { + LogManager.log("Registering machine..."); + ensureAuthenticated(); MachineRegistrationRequest request = new MachineRegistrationRequest(); request.setSerialnumber(serialNumber); + LogManager.log("Sending machine registration request:", request); + Response response = webAPI.register(request).execute(); if (response.isSuccessful()) { - return response.body(); + MachineRegistrationResponse r = response.body(); + + LogManager.log("Machine registration successful.", r); + + isRegistered = true; + organizationMachines = r.getOrganizationMachines(); + return r; } else { - throw new Exception(response.message()); + throw LogManager.log(new Exception(response.message()), "Machine registration failed."); } } @@ -115,37 +135,57 @@ public class TCCService implements ITCCService private LoginResponse login() throws Exception { + LogManager.log("Logging in to TCC service..."); + LoginRequest request = new LoginRequest(); request.setAppId(BuildConfig.WEB_SERVICE_APP_ID); String deviceId; + LogManager.log("Getting device id from shared preferences..."); + SharedPreferences prefs = getContext().getSharedPreferences(DEVICE_ID_PREF_NAME, MODE_PRIVATE); deviceId = prefs.getString("DeviceId", null); if (deviceId == null) { + LogManager.log("Device id was not found in shared preferences. Generating device id..."); deviceId = UUID.randomUUID().toString(); SharedPreferences.Editor editor = getContext().getSharedPreferences(DEVICE_ID_PREF_NAME, MODE_PRIVATE).edit(); editor.putString("DeviceId", deviceId); editor.apply(); } + LogManager.log("Device id: " + deviceId + "."); + request.setDeviceId(deviceId); request.setDevice(Build.MANUFACTURER + " " + Build.MODEL); request.setOsVersion(Build.VERSION_CODES.class.getFields()[android.os.Build.VERSION.SDK_INT].getName()); + LogManager.log("Sending log-in request:", request); + Response response = webAPI.login(request).execute(); if (response.isSuccessful()) { loginResponse = response.body(); + LogManager.log("Login response received:", loginResponse); WebApiFactory.setAuthenticationToken(loginResponse.getAccessToken()); return loginResponse; } else { - throw new Exception(response.message()); + throw LogManager.log(new Exception(response.message()), "LogIn request failed."); } } + + public boolean isRegistered() + { + return isRegistered; + } + + public List getOrganizationMachines() + { + return organizationMachines; + } } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/WebApiFactory.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/WebApiFactory.java index 3aeaccd14..17c4f2d43 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/WebApiFactory.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/WebApiFactory.java @@ -3,6 +3,7 @@ package com.twine.colorcapture.web; import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.twine.colorcapture.logging.LogManager; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -47,6 +48,7 @@ public class WebApiFactory /** * Creates the specified API interface instance. + * * @param cls * @param timeout * @param @@ -55,7 +57,8 @@ public class WebApiFactory private static T createAPI(Class cls, int timeout) { OkHttpClient.Builder httpClient = new OkHttpClient.Builder(); - httpClient.addInterceptor(new Interceptor() { + httpClient.addInterceptor(new Interceptor() + { @Override public Response intercept(Chain chain) throws IOException { @@ -69,6 +72,7 @@ public class WebApiFactory { request = chain.request().newBuilder().build(); } + return chain.proceed(request); } }); diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/messages/DefinitionResponse.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/messages/DefinitionResponse.java index 2dde27e09..d5da8ffe6 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/messages/DefinitionResponse.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/web/messages/DefinitionResponse.java @@ -1,5 +1,8 @@ package com.twine.colorcapture.web.messages; +import java.util.ArrayList; +import java.util.List; + public class DefinitionResponse { private String templateString; @@ -11,6 +14,28 @@ public class DefinitionResponse private double similarityTolerance; private boolean enableDoubleChecking; private boolean enforceBarcodeDetection; + private boolean isRegistered; + private List organizationMachines; + + public boolean isRegistered() + { + return isRegistered; + } + + public void setRegistered(boolean registered) + { + isRegistered = registered; + } + + public List getOrganizationMachines() + { + return organizationMachines; + } + + public void setOrganizationMachines(List organizationMachines) + { + this.organizationMachines = organizationMachines; + } public String getTemplateString() { @@ -102,4 +127,9 @@ public class DefinitionResponse { this.enforceBarcodeDetection = enforceBarcodeDetection; } + + public DefinitionResponse() + { + organizationMachines = new ArrayList<>(); + } } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/about.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/about.png new file mode 100644 index 000000000..69ff01eea Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/about.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/delete_thin.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/delete_thin.png new file mode 100644 index 000000000..c1a9b62a9 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/delete_thin.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/error.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/error.png new file mode 100644 index 000000000..bc9aeb86b Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/error.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/how_to.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/how_to.png new file mode 100644 index 000000000..50aca55cb Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/how_to.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icon_twine_card.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icon_twine_card.png new file mode 100644 index 000000000..188126db8 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icon_twine_card.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icons_close.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icons_close.png new file mode 100644 index 000000000..89c3b1653 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icons_close.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icons_delete.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icons_delete.png new file mode 100644 index 000000000..c04a02d4d Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/icons_delete.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/info.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/info.png new file mode 100644 index 000000000..79a64c487 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/info.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/snapmatch.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/snapmatch.png new file mode 100644 index 000000000..05656ffdc Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/snapmatch.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/twine_card_icon.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/twine_card_icon.png new file mode 100644 index 000000000..ec9ae5576 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-hdpi/twine_card_icon.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/about.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/about.png new file mode 100644 index 000000000..65e278cd4 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/about.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/delete_thin.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/delete_thin.png new file mode 100644 index 000000000..524997a78 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/delete_thin.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/error.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/error.png new file mode 100644 index 000000000..db3db4966 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/error.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/how_to.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/how_to.png new file mode 100644 index 000000000..59ba0e181 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/how_to.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icon_twine_card.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icon_twine_card.png new file mode 100644 index 000000000..bad44f686 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icon_twine_card.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icons_close.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icons_close.png new file mode 100644 index 000000000..4e9940432 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icons_close.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icons_delete.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icons_delete.png new file mode 100644 index 000000000..e9a9a108e Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/icons_delete.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/info.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/info.png new file mode 100644 index 000000000..a9bec6997 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/info.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/snapmatch.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/snapmatch.png new file mode 100644 index 000000000..bbd2be018 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/snapmatch.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/twine_card_icon.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/twine_card_icon.png new file mode 100644 index 000000000..e7ff93a39 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-mdpi/twine_card_icon.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/about.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/about.png new file mode 100644 index 000000000..d5701a483 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/about.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/delete_thin.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/delete_thin.png new file mode 100644 index 000000000..b6b951c0a Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/delete_thin.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/error.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/error.png new file mode 100644 index 000000000..41fa3df55 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/error.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/how_to.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/how_to.png new file mode 100644 index 000000000..fbeb31818 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/how_to.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icon_twine_card.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icon_twine_card.png new file mode 100644 index 000000000..48e6595fa Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icon_twine_card.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icons_close.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icons_close.png new file mode 100644 index 000000000..f4e9e1c50 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icons_close.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icons_delete.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icons_delete.png new file mode 100644 index 000000000..55753d24a Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/icons_delete.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/info.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/info.png new file mode 100644 index 000000000..3e33de5a6 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/info.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/snapmatch.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/snapmatch.png new file mode 100644 index 000000000..994d77ffe Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/snapmatch.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/twine_card_icon.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/twine_card_icon.png new file mode 100644 index 000000000..ff3f1c99c Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xhdpi/twine_card_icon.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/about.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/about.png new file mode 100644 index 000000000..06fedcd88 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/about.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/delete_thin.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/delete_thin.png new file mode 100644 index 000000000..f1e190f1c Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/delete_thin.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/error.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/error.png new file mode 100644 index 000000000..019edf5c7 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/error.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/how_to.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/how_to.png new file mode 100644 index 000000000..bae6374b6 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/how_to.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icon_twine_card.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icon_twine_card.png new file mode 100644 index 000000000..e399b466b Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icon_twine_card.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icons_close.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icons_close.png new file mode 100644 index 000000000..91ba9167d Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icons_close.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icons_delete.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icons_delete.png new file mode 100644 index 000000000..8e54c739c Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/icons_delete.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/info.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/info.png new file mode 100644 index 000000000..3727e7129 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/info.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/snapmatch.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/snapmatch.png new file mode 100644 index 000000000..198fb9f6f Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/snapmatch.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/twine_card_icon.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/twine_card_icon.png new file mode 100644 index 000000000..e8c54a75f Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxhdpi/twine_card_icon.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/about.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/about.png new file mode 100644 index 000000000..85234de5d Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/about.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/delete_thin.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/delete_thin.png new file mode 100644 index 000000000..33b633fcc Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/delete_thin.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/error.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/error.png new file mode 100644 index 000000000..f386b553d Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/error.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/how_to.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/how_to.png new file mode 100644 index 000000000..0569f95f7 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/how_to.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icon_twine_card.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icon_twine_card.png new file mode 100644 index 000000000..589cf908d Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icon_twine_card.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icons_close.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icons_close.png new file mode 100644 index 000000000..f37a9bbbc Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icons_close.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icons_delete.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icons_delete.png new file mode 100644 index 000000000..ccc594f43 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/icons_delete.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/info.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/info.png new file mode 100644 index 000000000..07af24775 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/info.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/snapmatch.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/snapmatch.png new file mode 100644 index 000000000..7bf802396 Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/snapmatch.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/twine_card_icon.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/twine_card_icon.png new file mode 100644 index 000000000..e2b2bf09f Binary files /dev/null and b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-xxxhdpi/twine_card_icon.png differ diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_main.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_main.xml index d2e2f89c1..7c55188cc 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_main.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_main.xml @@ -6,6 +6,7 @@ + - + android:background="@drawable/button_transparent_fill_ripple" + android:src="@{vm.tabStateManager.state == TabState.More ? @drawable/more_selected : @drawable/more_normal}" /> - + android:background="@drawable/button_transparent_fill_ripple" + android:src="@{vm.tabStateManager.state == TabState.Capture ? @drawable/twinesnap_selected : @drawable/twinesnap_normal}" + bind:command="@{vm.captureCommand}"/> - + android:background="@drawable/button_transparent_fill_ripple" + android:src="@{vm.tabStateManager.state == TabState.MyColors ? @drawable/selected : @drawable/my_colors}" + bind:command="@{vm.myColorsCommand}"/> + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/color_result_item.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/color_result_item.xml new file mode 100644 index 000000000..9be44f3da --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/color_result_item.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +