├── .gitignore ├── LICENSE ├── README.MD ├── rrr-api ├── Cargo.lock ├── Cargo.toml └── src │ └── lib.rs ├── rrr-embedded ├── .cargo │ └── config.toml ├── Cargo.lock ├── Cargo.toml ├── build.rs ├── partitions.csv ├── sdkconfig.defaults └── src │ ├── led_driver.rs │ ├── main.rs │ ├── nvs.rs │ ├── ota.rs │ ├── server.rs │ └── wifi.rs ├── rrr-frontend ├── Cargo.lock ├── Cargo.toml ├── favicon.ico ├── index.html ├── index.scss ├── resources │ ├── LICENSE.txt │ ├── Roboto-Regular.ttf │ └── material-icons.woff2 └── src │ ├── components.rs │ └── main.rs └── rrr-simulation ├── Cargo.lock ├── Cargo.toml └── src ├── cone.rs ├── main.rs ├── simulation.rs └── visual_objects.rs /.gitignore: -------------------------------------------------------------------------------- 1 | # Project exclude paths 2 | /rrr-embedded/target/ 3 | /rrr-frontend/target/ 4 | /rrr-simulation/target/ 5 | /rrr-embedded/wifi-password.secret 6 | /rrr-embedded/wifi-ssid.secret 7 | /rrr-embedded/.embuild/ 8 | /rrr-frontend/dist/ 9 | /.idea/ 10 | /rrr-frontend/dist-gz/ 11 | /rrr-api/target/ 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | # TODO -------------------------------------------------------------------------------- /rrr-api/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "proc-macro2" 7 | version = "1.0.66" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" 10 | dependencies = [ 11 | "unicode-ident", 12 | ] 13 | 14 | [[package]] 15 | name = "quote" 16 | version = "1.0.33" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" 19 | dependencies = [ 20 | "proc-macro2", 21 | ] 22 | 23 | [[package]] 24 | name = "rrr-api" 25 | version = "0.0.1" 26 | dependencies = [ 27 | "serde", 28 | ] 29 | 30 | [[package]] 31 | name = "serde" 32 | version = "1.0.188" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" 35 | dependencies = [ 36 | "serde_derive", 37 | ] 38 | 39 | [[package]] 40 | name = "serde_derive" 41 | version = "1.0.188" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" 44 | dependencies = [ 45 | "proc-macro2", 46 | "quote", 47 | "syn", 48 | ] 49 | 50 | [[package]] 51 | name = "syn" 52 | version = "2.0.29" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" 55 | dependencies = [ 56 | "proc-macro2", 57 | "quote", 58 | "unicode-ident", 59 | ] 60 | 61 | [[package]] 62 | name = "unicode-ident" 63 | version = "1.0.11" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" 66 | -------------------------------------------------------------------------------- /rrr-api/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rrr-api" 3 | version = "0.0.1" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | serde = {version = "1.0.185", features = ["derive"]} -------------------------------------------------------------------------------- /rrr-api/src/lib.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | 3 | #[derive(Clone, PartialEq, Default, Serialize, Deserialize)] 4 | pub struct State { 5 | pub battery: BatteryState, 6 | pub pyro: PyroState, 7 | pub wifi_state: WifiConnectionConfiguration, 8 | pub barometer: BarometerState, 9 | pub servo: ServoState, 10 | } 11 | 12 | #[derive(Clone, PartialEq, Default, Serialize, Deserialize)] 13 | pub struct ServoState { 14 | pub servo1_duty: Option, 15 | pub servo2_duty: Option, 16 | } 17 | 18 | #[derive(Clone, PartialEq, Default, Serialize, Deserialize)] 19 | pub struct BatteryState { 20 | pub soc: f32, 21 | pub voltage: f32, 22 | pub charge_rate: f32, 23 | } 24 | 25 | #[derive(Clone, PartialEq, Default, Serialize, Deserialize, Debug)] 26 | pub struct WifiCredentials { 27 | pub ssid: String, 28 | pub password: String, 29 | } 30 | 31 | #[derive(Clone, PartialEq, Default, Serialize, Deserialize, Debug)] 32 | pub struct WifiConnectionConfiguration { 33 | pub connection_type: WifiConnectionType, 34 | pub credentials: WifiCredentials, 35 | } 36 | 37 | #[derive(Clone, PartialEq, Serialize, Deserialize, Debug)] 38 | pub enum WifiConnectionType { 39 | ConnectToExternal, 40 | StartAccessPoint, 41 | } 42 | 43 | impl Default for WifiConnectionType { 44 | fn default() -> Self { WifiConnectionType::StartAccessPoint } 45 | } 46 | 47 | #[derive(Clone, PartialEq, Default, Serialize, Deserialize)] 48 | pub struct PyroChannelState { 49 | pub fire: bool, 50 | pub test_voltage: f32, 51 | } 52 | 53 | #[derive(Clone, PartialEq, Default, Serialize, Deserialize)] 54 | pub struct PyroState { 55 | pub channel1: PyroChannelState, 56 | pub channel2: PyroChannelState, 57 | } 58 | 59 | #[derive(Clone, PartialEq, Default, Serialize, Deserialize)] 60 | pub struct BarometerState { 61 | pub altitude: f32, 62 | pub temperature: f32, 63 | } 64 | 65 | 66 | #[derive(Clone, PartialEq, Serialize, Deserialize)] 67 | pub enum Command { 68 | Reset, 69 | SetWifi { ssid: String, password: String }, 70 | ResetNvs, 71 | SetLedColor { r: u8, g: u8, b: u8 }, 72 | SetPwmDutyCycle { duty_1: Option, duty_2: Option }, 73 | } -------------------------------------------------------------------------------- /rrr-embedded/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | target = "riscv32imc-esp-espidf" 3 | 4 | [target.riscv32imc-esp-espidf] 5 | linker = "ldproxy" 6 | runner = "espflash flash --monitor" 7 | 8 | [unstable] 9 | build-std = ["std", "panic_abort"] 10 | 11 | [env] 12 | ESP_IDF_VERSION = "release/v4.4" 13 | ESP_IDF_SDKCONFIG_DEFAULTS = "sdkconfig.defaults" 14 | -------------------------------------------------------------------------------- /rrr-embedded/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rrr-embedded" 3 | version = "0.0.1" 4 | edition = "2021" 5 | build = "build.rs" 6 | 7 | [profile.release] 8 | opt-level = "s" 9 | strip = true 10 | lto = true 11 | codegen-units = 1 12 | panic = "abort" 13 | 14 | [profile.dev] 15 | debug = true 16 | lto = true 17 | opt-level = "s" 18 | 19 | [dependencies] 20 | rrr-api = {path = "../rrr-api"} 21 | 22 | anyhow = {version = "1", features = ["backtrace"]} 23 | thiserror = "1" 24 | log = "0.4" 25 | url = "2" 26 | esp-idf-sys = { version = "0.33", features = ["binstart"] } 27 | esp-idf-svc = "0.46.2" 28 | esp-idf-hal = "0.41.2" 29 | embedded-svc = "0.25" 30 | embedded-hal = "0.2.7" 31 | embedded-io = "0.4.0" 32 | heapless = "0.7.16" 33 | 34 | ws2812-esp32-rmt-driver = "0.6.0" 35 | serde = "1.0.185" 36 | serde_json = "1.0.105" 37 | max170xx = "0.1.0" 38 | bmp280-ehal = "0.0.6" 39 | shared-bus = { version="0.3.0", features = ["std"]} 40 | 41 | include_dir = "0.7.3" 42 | map_for = "0.3.0" 43 | 44 | [build-dependencies] 45 | embuild = { version = "0.31.2", features = ["elf"] } 46 | anyhow = "1" 47 | trunk-build-time = "0.17.3" 48 | async-std = { version = "1", features = ["attributes", "tokio1"] } 49 | tokio = "1.32.0" 50 | flate2 = "1.0.27" -------------------------------------------------------------------------------- /rrr-embedded/build.rs: -------------------------------------------------------------------------------- 1 | use std::fs::{create_dir_all, File, read_dir, remove_dir_all, DirEntry}; 2 | use std::io::{BufReader, copy}; 3 | use std::path::{Path, PathBuf}; 4 | use trunk_build_time::cmd::build; 5 | use trunk_build_time::config; 6 | use embuild::{ 7 | build::LinkArgs, 8 | }; 9 | use flate2::Compression; 10 | use tokio; 11 | use flate2::write::GzEncoder; 12 | 13 | #[tokio::main] 14 | async fn main() -> anyhow::Result<()> { 15 | println!("cargo:rerun-if-changed=../"); 16 | 17 | let mut cfg = config::ConfigOptsBuild::default(); 18 | cfg.release = true; 19 | cfg.target = Some(PathBuf::from("../rrr-frontend/index.html")); 20 | cfg.filehash = Some(false); 21 | println!("{:?}", cfg); 22 | build::Build { build: cfg }.run(None).await.unwrap(); 23 | 24 | let _ = remove_dir_all("../rrr-frontend/dist-gz"); 25 | create_dir_all("../rrr-frontend/dist-gz").unwrap(); 26 | 27 | 28 | fn visit_dirs(dir: &Path, cb: &dyn Fn(&DirEntry)) -> std::io::Result<()> { 29 | if dir.is_dir() { 30 | for entry in read_dir(dir)? { 31 | let entry = entry?; 32 | let path = entry.path(); 33 | if path.is_dir() { 34 | visit_dirs(&path, cb)?; 35 | } else { 36 | cb(&entry); 37 | } 38 | } 39 | } 40 | Ok(()) 41 | } 42 | 43 | //TODO: dirty code here 44 | 45 | visit_dirs(Path::new("../rrr-frontend/dist/"), &|file_path: &DirEntry| { 46 | let source_path = file_path.path().as_os_str().to_owned(); 47 | let mut input = BufReader::new(File::open(&source_path).unwrap()); 48 | create_dir_all(Path::new(&source_path.to_str().unwrap() 49 | .replace("rrr-frontend/dist", "rrr-frontend/dist-gz")).parent().unwrap()).unwrap(); 50 | let output = File::create(Path::new(&source_path.to_str().unwrap() 51 | .replace("rrr-frontend/dist", "rrr-frontend/dist-gz"))).unwrap(); 52 | let mut encoder = GzEncoder::new(output, Compression::default()); 53 | copy(&mut input, &mut encoder).unwrap(); 54 | encoder.finish().unwrap(); 55 | () 56 | })?; 57 | 58 | LinkArgs::output_propagated("ESP_IDF")?; 59 | Ok(()) 60 | } -------------------------------------------------------------------------------- /rrr-embedded/partitions.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap 3 | nvs, data, nvs, , 0x6000, 4 | phy_init, data, phy, , 0x1000, 5 | otadata, data, ota, , 0x2000, 6 | factory, app, factory, , 0x1E0000, 7 | ota_0, app, ota_0, , 0x1E0000, -------------------------------------------------------------------------------- /rrr-embedded/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=20000 2 | CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 3 | CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=ESP_DEFAULT_CPU_FREQ_MHZ_160 4 | CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y 5 | CONFIG_PARTITION_TABLE_CUSTOM=y 6 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="../../../../../../partitions.csv" 7 | CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -------------------------------------------------------------------------------- /rrr-embedded/src/led_driver.rs: -------------------------------------------------------------------------------- 1 | use ws2812_esp32_rmt_driver::*; 2 | use ws2812_esp32_rmt_driver::driver::color::*; 3 | 4 | 5 | pub struct LedDriver { 6 | ws2812: Ws2812Esp32RmtDriver, 7 | } 8 | 9 | impl LedDriver { 10 | pub fn new( 11 | led_pin: u32, 12 | rmt_channel: u8, 13 | ) -> Result { 14 | let ws = 15 | Ws2812Esp32RmtDriver::new(rmt_channel, led_pin); 16 | 17 | ws.map(|ws| Self { ws2812: ws }) 18 | } 19 | 20 | pub fn set_rgb(&mut self,r: u8, g: u8, b: u8) -> Result<(), Ws2812Esp32RmtDriverError> { 21 | self.ws2812.write(LedPixelColorGrb24::new_with_rgb(r, g, b).as_ref()) 22 | } 23 | pub fn off(&mut self) -> Result<(), Ws2812Esp32RmtDriverError> { 24 | self.ws2812.write(LedPixelColorGrb24::new_with_rgb(0, 0, 0).as_ref()) 25 | } 26 | } -------------------------------------------------------------------------------- /rrr-embedded/src/main.rs: -------------------------------------------------------------------------------- 1 | mod led_driver; 2 | mod ota; 3 | mod wifi; 4 | mod server; 5 | mod nvs; 6 | 7 | use crate::led_driver::LedDriver; 8 | use crate::ota::OtaDriver; 9 | 10 | use rrr_api as api; 11 | 12 | use std::sync::{Arc, Mutex}; 13 | use std::time::Duration; 14 | use std::thread; 15 | use log::*; 16 | use anyhow::Result; 17 | use embedded_svc::http::server::Connection; 18 | use embedded_svc::io::Read; 19 | use embedded_svc::wifi::*; 20 | use esp_idf_hal::adc::{ADC1, AdcChannelDriver, Atten11dB}; 21 | use esp_idf_hal::adc::config::Resolution; 22 | 23 | use esp_idf_svc::eventloop::*; 24 | use esp_idf_svc::wifi::*; 25 | use esp_idf_hal::peripheral::Peripheral; 26 | use esp_idf_hal::prelude::*; 27 | use esp_idf_hal::gpio::{Gpio1}; 28 | use esp_idf_hal::i2c::I2cDriver; 29 | use esp_idf_hal::ledc; 30 | use esp_idf_hal::ledc::{LedcDriver, LedcTimerDriver}; 31 | use esp_idf_hal::ledc::config::TimerConfig; 32 | use esp_idf_sys::esp_intr_disable; 33 | use max170xx::Max17048; 34 | use rrr_api::WifiCredentials; 35 | use crate::api::{Command, WifiConnectionConfiguration, WifiConnectionType}; 36 | use crate::server::Server; 37 | use crate::wifi::WiFi; 38 | 39 | const BMP_280_FILTER_GAIN: f32 = 0.05f32; 40 | 41 | fn main() -> Result<()> { 42 | esp_idf_sys::link_patches(); 43 | esp_idf_svc::log::EspLogger::initialize_default(); 44 | 45 | let state = Arc::new(Mutex::new(api::State::default())); 46 | 47 | let peripherals = Peripherals::take().unwrap(); 48 | let sysloop = EspSystemEventLoop::take()?; 49 | 50 | let i2c = esp_idf_hal::i2c::I2cDriver::new( 51 | peripherals.i2c0.into_ref(), 52 | peripherals.pins.gpio7, 53 | peripherals.pins.gpio8, 54 | &esp_idf_hal::i2c::I2cConfig::default(), 55 | )?; 56 | 57 | let shared_i2c = shared_bus::new_std!(I2cDriver = i2c).unwrap(); 58 | 59 | 60 | let _pyro = esp_idf_hal::gpio::PinDriver::output(peripherals.pins.gpio6)?; 61 | 62 | 63 | let timer_driver = 64 | LedcTimerDriver::new( 65 | peripherals.ledc.timer0, 66 | &TimerConfig::default() 67 | .frequency(50.Hz().into()) 68 | .resolution(ledc::Resolution::Bits14), 69 | )?; 70 | 71 | let mut pwm_driver_1 = LedcDriver::new(peripherals.ledc.channel0, &timer_driver , peripherals.pins.gpio4)?; 72 | let mut pwm_driver_2 = LedcDriver::new(peripherals.ledc.channel1, &timer_driver, peripherals.pins.gpio5)?; 73 | 74 | let mut pwm = Arc::new(Mutex::new((pwm_driver_1, pwm_driver_2))); 75 | 76 | 77 | let mut max17048 = Max17048::new(shared_i2c.acquire_i2c()); 78 | 79 | max17048.version().unwrap(); 80 | info!("SOC: {:.2}", max17048.soc().unwrap()); 81 | info!("MAX -- OK"); 82 | 83 | let max17048 = Arc::new(Mutex::new(max17048)); 84 | 85 | esp_idf_hal::task::thread::ThreadSpawnConfiguration { 86 | name: Some(b"max-thread\0"), 87 | ..Default::default() 88 | }.set().unwrap(); 89 | 90 | let max1 = max17048.clone(); 91 | let max2 = max17048.clone(); 92 | 93 | let state1 = state.clone(); 94 | let state2 = state.clone(); 95 | 96 | thread::spawn(move || { 97 | loop { 98 | thread::sleep(Duration::from_millis(1000)); 99 | let mut state = state1.lock().unwrap(); 100 | let mut max = max1.lock().unwrap(); 101 | state.battery.soc = max.soc().unwrap(); 102 | state.battery.voltage = max.voltage().unwrap(); 103 | state.battery.charge_rate = max.charge_rate().unwrap(); 104 | } 105 | }); 106 | 107 | let bmp280 = bmp280_ehal::BMP280::new(shared_i2c.acquire_i2c())?; 108 | let bmp280 = Arc::new(Mutex::new(bmp280)); 109 | 110 | let state_ = state.clone(); 111 | 112 | thread::spawn(move || { 113 | loop { 114 | thread::sleep(Duration::from_millis(20)); 115 | let mut bmp280 = bmp280.lock().unwrap(); 116 | let temperature: f32 = bmp280.temp() as f32; 117 | let p0 = 101325f32; 118 | let pressure: f32 = bmp280.pressure_one_shot() as f32; 119 | //-44330f32 * (1f32 - f32::powf (pressure / 101325f32).po powf(1f32/5.255f32)); 120 | let altitude: f32 = -8435.775 * (pressure / p0 - 1f32); 121 | let mut state = state_.lock().unwrap(); 122 | let new_altitude = state.barometer.altitude + 123 | (altitude - state.barometer.altitude) * BMP_280_FILTER_GAIN; 124 | state.barometer.temperature = temperature; 125 | state.barometer.altitude = new_altitude; 126 | } 127 | }); 128 | 129 | 130 | 131 | let mut adc_driver_config = esp_idf_hal::adc::AdcConfig::default(); 132 | adc_driver_config.resolution = Resolution::Resolution12Bit; 133 | adc_driver_config.calibration = true; 134 | 135 | let mut adc_driver = esp_idf_hal::adc::AdcDriver::new(peripherals.adc1, &esp_idf_hal::adc::AdcConfig::default())?; 136 | let mut adc_channel_driver: AdcChannelDriver<'_, Gpio1, Atten11dB> = esp_idf_hal::adc::AdcChannelDriver::new(peripherals.pins.gpio1)?; 137 | 138 | adc_driver.read(&mut adc_channel_driver)?; 139 | 140 | thread::spawn(move || { 141 | loop { 142 | thread::sleep(Duration::from_millis(1000)); 143 | let adc_reading = adc_driver.read(&mut adc_channel_driver).unwrap(); 144 | let voltage = adc_reading as f32; 145 | let mut state = state2.lock().unwrap(); 146 | state.pyro.channel1.test_voltage = voltage / 1000f32; 147 | } 148 | }); 149 | 150 | 151 | //Drivers 152 | let mut led_driver = LedDriver::new(9, 0)?; 153 | info!("LED -- OK"); 154 | led_driver.set_rgb(20, 0, 0)?; 155 | 156 | let mut nvs = nvs::Nvs::new()?; 157 | 158 | let nvs_arc0 = Arc::new(Mutex::new(nvs)); 159 | let nvs_arc1 = nvs_arc0.clone(); 160 | 161 | 162 | let wifi_configuration = match nvs_arc0.lock().unwrap().get_wifi_connection()? { 163 | None => { 164 | WifiConnectionConfiguration { 165 | connection_type: WifiConnectionType::StartAccessPoint, 166 | credentials: WifiCredentials { 167 | ssid: String::from("RRR-wifi-0"), 168 | password: String::from("12345678"), 169 | }, 170 | } 171 | } 172 | Some(creds) => { 173 | WifiConnectionConfiguration { 174 | connection_type: WifiConnectionType::ConnectToExternal, 175 | credentials: WifiCredentials { 176 | ssid: creds.ssid, 177 | password: creds.password, 178 | }, 179 | } 180 | } 181 | }; 182 | 183 | info!("wifi config {:?}", wifi_configuration); 184 | 185 | #[allow(unused_variables)] 186 | let wifi = WiFi::new(wifi_configuration, peripherals.modem, sysloop.clone(), state.clone())?; 187 | 188 | match state.lock().unwrap().wifi_state.connection_type { 189 | WifiConnectionType::ConnectToExternal => led_driver.set_rgb(0, 20, 0)?, 190 | _ => led_driver.set_rgb(10, 10, 0)?, 191 | } 192 | 193 | #[allow(unused_variables)] 194 | let mut ota_driver = OtaDriver::new()?; 195 | 196 | 197 | let ld = Arc::new(Mutex::new(led_driver)); 198 | 199 | let state_ = state.clone(); 200 | 201 | let command_handler = move |c: &Command| -> Result<()> { 202 | match c { 203 | Command::Reset => {} 204 | Command::SetWifi { ssid, password } => { 205 | let creds = WifiCredentials { ssid: ssid.clone(), password: password.clone() }; 206 | nvs_arc1.lock().unwrap().set_wifi_connection(creds).unwrap(); 207 | nvs_arc1.lock().unwrap().get_wifi_connection().unwrap(); 208 | } 209 | Command::SetLedColor { r, g, b } => 210 | { ld.lock().unwrap().set_rgb(r.clone(), g.clone(), b.clone())? } 211 | Command::SetPwmDutyCycle {duty_1, duty_2} => 212 | { 213 | info!("setting pwm"); 214 | fn duty_opt_to_servo_duty(d: &Option, max_duty: u32) -> u32 { 215 | match d { 216 | None => {0} 217 | Some(i) => {(max_duty as f32 * (10f32 * (i + 1f32)) / 200f32) as u32} 218 | } 219 | } 220 | 221 | let mut pwm = pwm.lock().unwrap(); 222 | let d = duty_opt_to_servo_duty(duty_1, pwm.0.get_max_duty()); 223 | pwm.0.set_duty(d)?; 224 | info!("d1: {}", d); 225 | let d = duty_opt_to_servo_duty(duty_2, pwm.1.get_max_duty()); 226 | pwm.1.set_duty(d)?; 227 | info!("d2: {}", d); 228 | let mut state = state_.lock().unwrap(); 229 | state.servo.servo1_duty = *duty_1; 230 | state.servo.servo2_duty = *duty_2; 231 | } 232 | 233 | _ => {} 234 | } 235 | Ok(()) 236 | }; 237 | 238 | #[allow(unused_variables)] 239 | let server = Server::new(state, command_handler)?; 240 | 241 | info!("HTTP server -- OK"); 242 | info!("mDNS -- OK"); 243 | 244 | let mut mdns = esp_idf_svc::mdns::EspMdns::take()?; 245 | mdns.set_hostname("rrr")?; 246 | mdns.set_instance_name("RRR web server")?; 247 | mdns.add_service(None, "_http", "_tcp", 80, &[("board", "{esp32}")])?; 248 | 249 | loop { 250 | thread::sleep(Duration::from_millis(1000)); 251 | } 252 | 253 | #[allow(unreachable_code)] 254 | Ok(()) 255 | } -------------------------------------------------------------------------------- /rrr-embedded/src/nvs.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use esp_idf_svc::nvs::{EspDefaultNvs, EspDefaultNvsPartition, EspNvs, NvsDefault, NvsPartitionId}; 3 | use log::info; 4 | use rrr_api::*; 5 | 6 | pub struct Nvs { 7 | espnvs: EspNvs, 8 | } 9 | 10 | const WIFI_SSID_NAME: &str = "wifi_ssid"; 11 | const WIFI_SSID_LENGTH_NAME: &str = "wifi_ssid_l"; 12 | const WIFI_PASSWORD_NAME: &str = "wifi_pass"; 13 | const WIFI_PASSWORD_LENGTH_NAME: &str = "wifi_pass_l"; 14 | const WIFI_SET_NAME: &str = "wifi_set"; 15 | 16 | 17 | impl Nvs { 18 | pub fn new() -> Result<(Nvs)> { 19 | let nvs = 20 | EspDefaultNvs::new(EspDefaultNvsPartition::take()?, "", true)?; 21 | Ok(Self { espnvs: nvs }) 22 | } 23 | 24 | pub fn set_wifi_connection(&mut self, wifi: WifiCredentials) -> Result<()> { 25 | self.espnvs.set_u8(WIFI_SET_NAME, 0)?; 26 | self.espnvs.set_blob(WIFI_SSID_NAME, wifi.ssid.as_bytes())?; 27 | let ssid_length = wifi.password.len() as u8; 28 | self.espnvs.set_u8(WIFI_SSID_LENGTH_NAME, wifi.ssid.len() as u8)?; 29 | self.espnvs.set_blob(WIFI_PASSWORD_NAME, wifi.password.as_bytes())?; 30 | let pass_length = wifi.password.len() as u8; 31 | self.espnvs.set_u8(WIFI_PASSWORD_LENGTH_NAME, wifi.password.len() as u8)?; 32 | self.espnvs.set_u8(WIFI_SET_NAME, 1)?; 33 | Ok(()) 34 | } 35 | 36 | pub fn get_wifi_connection(&mut self) -> Result> { 37 | match self.espnvs.get_u8(WIFI_SET_NAME)? { 38 | None => { Ok(None) } 39 | Some(0) => { Ok(None) } 40 | Some(_) => { 41 | let ssid_length = self.espnvs.get_u8(WIFI_SSID_LENGTH_NAME)?; 42 | let pass_length = self.espnvs.get_u8(WIFI_PASSWORD_LENGTH_NAME)?; 43 | 44 | match (ssid_length, pass_length) { 45 | (Some(sl), Some(pl)) => { 46 | let mut ssid = vec![0u8; sl as usize]; 47 | let mut pass = vec![0u8; pl as usize]; 48 | self.espnvs.get_blob(WIFI_SSID_NAME, ssid.as_mut_slice())?; 49 | self.espnvs.get_blob(WIFI_PASSWORD_NAME, pass.as_mut_slice())?; 50 | 51 | let ssid = String::from_utf8(ssid)?; 52 | let password = String::from_utf8(pass)?; 53 | 54 | Ok(Some(WifiCredentials { ssid, password })) 55 | } 56 | _ => { Ok(None) } 57 | } 58 | } 59 | } 60 | } 61 | 62 | pub fn wipe_data(&mut self) -> Result<()> { 63 | self.espnvs.remove(WIFI_SET_NAME)?; 64 | self.espnvs.remove(WIFI_SSID_NAME)?; 65 | self.espnvs.remove(WIFI_SSID_LENGTH_NAME)?; 66 | self.espnvs.remove(WIFI_PASSWORD_NAME)?; 67 | self.espnvs.remove(WIFI_PASSWORD_LENGTH_NAME)?; 68 | 69 | Ok(()) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /rrr-embedded/src/ota.rs: -------------------------------------------------------------------------------- 1 | use thiserror::Error; 2 | use embedded_svc::io::Write; 3 | use esp_idf_hal::reset::restart; 4 | use esp_idf_svc::http::client::{Configuration, EspHttpConnection}; 5 | use embedded_svc::http::client::Client; 6 | use esp_idf_svc::ota::EspOta; 7 | use esp_idf_sys::EspError; 8 | use log::{error, info}; 9 | use crate::ota::OtaError::UrlUnavailable; 10 | 11 | 12 | pub struct OtaDriver { 13 | ota: EspOta, 14 | } 15 | 16 | #[derive(Error, Debug)] 17 | pub enum OtaError { 18 | #[error("Url is unavailable")] 19 | UrlUnavailable, 20 | #[error("Firmware download was interrupted")] 21 | ConnectionInterrupted, 22 | #[error("ESP-IDF stack error")] 23 | EspBackendFailure, 24 | #[error("Firmware does not fit the partition")] 25 | FileTooBig 26 | } 27 | 28 | 29 | impl OtaDriver { 30 | pub fn new() -> Result { 31 | let ota = EspOta::new(); 32 | ota.map(|ota| { Self { ota } }) 33 | } 34 | 35 | //TODO: handle size too big issue 36 | pub fn run(&mut self, url: &str) -> Result{ 37 | 38 | use OtaError::*; 39 | 40 | let mut upd = self.ota.initiate_update().map_err(|_| EspBackendFailure)?; 41 | 42 | let cfg = Configuration::default(); 43 | let conn = EspHttpConnection::new(&cfg).map_err(|_| EspBackendFailure)?; 44 | let mut client = Client::::wrap(conn); 45 | let mut resp = client 46 | .get(url).map_err(|_| UrlUnavailable)? 47 | .submit().map_err(|_| UrlUnavailable)?; 48 | 49 | let mut data_transferred = 0; 50 | 51 | loop { 52 | let mut buf = [0u8; 100]; 53 | let size = resp.read(buf.as_mut_slice()).unwrap(); 54 | data_transferred = data_transferred + size; 55 | upd.write_all(&buf[0..size]).unwrap(); 56 | if size < 100 {break} 57 | } 58 | 59 | upd.complete().map_err(|_| EspBackendFailure)?; 60 | 61 | Ok(data_transferred) 62 | } 63 | 64 | pub fn restart(self) { 65 | restart(); 66 | } 67 | } -------------------------------------------------------------------------------- /rrr-embedded/src/server.rs: -------------------------------------------------------------------------------- 1 | use crate::api; 2 | use std::io; 3 | use std::io::ErrorKind; 4 | 5 | use std::sync::{Arc, Mutex}; 6 | use anyhow::Result; 7 | use embedded_svc::http::server::{Connection, Request}; 8 | use esp_idf_svc::http::server::EspHttpServer; 9 | use esp_idf_sys::EspError; 10 | use include_dir::{Dir, include_dir}; 11 | 12 | 13 | static DIST: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/../rrr-frontend/dist-gz/"); 14 | 15 | pub struct Server { 16 | server: EspHttpServer, 17 | } 18 | 19 | impl Server { 20 | pub fn new( 21 | state: Arc>, 22 | mut command_handler: F, 23 | ) -> Result 24 | where F: Fn(&api::Command) -> Result<()> + Send + 'static 25 | { 26 | use embedded_svc::http::server::{Method}; 27 | use embedded_svc::io::Write; 28 | use esp_idf_svc::http::server::{EspHttpServer}; 29 | 30 | let mut conf = esp_idf_svc::http::server::Configuration::default(); 31 | conf.max_resp_handlers = 100; 32 | conf.max_uri_handlers = 100; 33 | 34 | let mut server = EspHttpServer::new(&conf)?; 35 | 36 | fn serve_file<'a>(server: &'a mut EspHttpServer, path: &'static str, content: &'static [u8]) -> Result<(), EspError> { 37 | server.fn_handler(format!("/{}", path).as_ref(), Method::Get, move |req| { 38 | let content_type = if path.ends_with(".js") { "application/javascript" } else if path.ends_with(".wasm") { "application/wasm" } else if path.ends_with(".html") { "text/html" } else if path.ends_with(".htm") { "text/html" } else if path.ends_with(".html") { "text/html" } else if path.ends_with(".css") { "text/css" } else { "text/html" }; 39 | 40 | req.into_response(200, None, &[ 41 | ("Content-Type", content_type), 42 | ("Content-Encoding", "gzip"), 43 | ("Access-Control-Allow-Origin", "*"), 44 | ])?.write_all(content)?; 45 | Ok(()) 46 | })?; 47 | Ok(()) 48 | } 49 | 50 | server 51 | .fn_handler("/state", Method::Get, move |req| { 52 | let state = state.lock().unwrap().to_owned(); 53 | 54 | req.into_response(200, None, &[("Content-Type", "application/json"), 55 | ("Access-Control-Allow-Origin", "*"), 56 | ])?.write_all(serde_json::to_string(&state).unwrap().as_bytes())?; 57 | Ok(()) 58 | })? 59 | .fn_handler("/command", Method::Post, move |mut req| { 60 | struct ReqRead<'a, A> 61 | { 62 | req: &'a mut Request, 63 | } 64 | 65 | impl<'a, A> io::Read for ReqRead<'a, A> 66 | where A: Connection 67 | { 68 | fn read(&mut self, buf: &mut [u8]) -> io::Result { 69 | self.req.read(buf).map_err(|e| { io::Error::new(ErrorKind::BrokenPipe, "") }) 70 | } 71 | } 72 | 73 | let command = serde_json::from_reader::<_, api::Command>(ReqRead { req: &mut req }); 74 | 75 | //TODO headers (cross-origin, content-type) 76 | match command { 77 | Ok(command) => { 78 | match command_handler(&command) { 79 | Ok(_) => { req.into_ok_response()?; } 80 | Err(_) => { req.into_status_response(500)?; } 81 | } 82 | 83 | Ok(()) 84 | } 85 | Err(_) => { req.into_response(400, Some("Unable to parse command"), &[]).map(|_| ()) } 86 | }?; 87 | 88 | Ok(()) 89 | })? 90 | ; 91 | 92 | let f = DIST.get_file("index.html").unwrap(); 93 | serve_file(&mut server, "", f.contents())?; 94 | 95 | fn serve_dir(server: &mut EspHttpServer, dir: &'static Dir) -> Result<()> { 96 | dir.files().for_each(|f| { 97 | serve_file(server, f.path().to_str().unwrap(), f.contents()).unwrap(); 98 | }); 99 | if dir.dirs().next().is_some() { for dir in dir.dirs() { serve_dir(server, dir).unwrap(); } } 100 | Ok(()) 101 | } 102 | 103 | DIST.files().for_each(|f| { serve_file(&mut server, f.path().to_str().unwrap(), f.contents()).unwrap(); }); 104 | for dir in DIST.dirs() { serve_dir(&mut server, dir).unwrap(); } 105 | 106 | Ok(Self { server }) 107 | } 108 | } -------------------------------------------------------------------------------- /rrr-embedded/src/wifi.rs: -------------------------------------------------------------------------------- 1 | use std::sync::{Arc, Mutex}; 2 | use embedded_svc::wifi::{Configuration, AccessPointConfiguration, ClientConfiguration, AuthMethod}; 3 | use esp_idf_hal::peripheral::Peripheral; 4 | use esp_idf_svc::eventloop::EspSystemEventLoop; 5 | use esp_idf_svc::wifi::{BlockingWifi, EspWifi}; 6 | use log::info; 7 | use anyhow::Result; 8 | use crate::api::*; 9 | 10 | 11 | pub struct WiFi<'a> { 12 | wifi: BlockingWifi>, 13 | state: Arc>, 14 | } 15 | 16 | impl<'a> WiFi<'a> { 17 | pub fn new( 18 | configuration: WifiConnectionConfiguration, 19 | modem: impl Peripheral + 'static, 20 | sysloop: EspSystemEventLoop, 21 | state: Arc>, 22 | ) -> Result { 23 | let esp_wifi = EspWifi::new(modem, sysloop.clone(), None)?; 24 | let mut wifi = BlockingWifi::wrap(esp_wifi, sysloop)?; 25 | 26 | let cfg = match configuration.clone() { 27 | WifiConnectionConfiguration { 28 | connection_type: WifiConnectionType::StartAccessPoint, 29 | credentials: WifiCredentials { ssid, password } 30 | } => { 31 | Configuration::AccessPoint( 32 | AccessPointConfiguration { 33 | ssid: heapless::String::from(ssid.as_str()), 34 | channel: 1, 35 | password: heapless::String::from(password.as_str()), 36 | auth_method: AuthMethod::WPA2Personal, 37 | ..Default::default() 38 | }) 39 | } 40 | WifiConnectionConfiguration { 41 | connection_type: WifiConnectionType::ConnectToExternal, 42 | credentials: WifiCredentials { ssid, password } 43 | } => { 44 | Configuration::Client( 45 | ClientConfiguration { 46 | ssid: heapless::String::from(ssid.as_str()), 47 | password: heapless::String::from(password.as_str()), 48 | channel: None, 49 | ..Default::default() 50 | }, 51 | ) 52 | } 53 | }; 54 | 55 | let client_configuration_result = wifi.set_configuration(&cfg); 56 | 57 | let connection_result = client_configuration_result.and_then(|_| { 58 | wifi.start()?; 59 | wifi.connect()?; 60 | info!("WIFI Connect -- OK"); 61 | let mut configuration = configuration.clone(); 62 | configuration.credentials.password = "".into(); 63 | state.lock().unwrap().wifi_state = configuration; 64 | Ok(()) 65 | }); 66 | 67 | match connection_result { 68 | Ok(_) => (), 69 | Err(_) => { 70 | info!("WIFI Connect -- FAIL"); 71 | let ap_configuration_result = wifi.set_configuration(&Configuration::AccessPoint( 72 | AccessPointConfiguration { 73 | ssid: "RRR-wifi".into(), 74 | channel: 1, 75 | ..Default::default() 76 | }, 77 | )); 78 | ap_configuration_result.and_then(|_| { 79 | wifi.start()?; 80 | info!("WIFI AP Start -- OK"); 81 | state.lock().unwrap().wifi_state = 82 | WifiConnectionConfiguration { 83 | connection_type: WifiConnectionType::StartAccessPoint, 84 | credentials: WifiCredentials { 85 | ssid: "RRR-wifi".into(), 86 | password: "".into(), 87 | }, 88 | }; 89 | Ok(()) 90 | })?; 91 | } 92 | }; 93 | 94 | wifi.wait_netif_up()?; 95 | let ip_info = wifi.wifi().ap_netif().get_ip_info()?; 96 | info!("DHCP -- OK"); 97 | info!("DHCP info: {:?}", ip_info); 98 | Ok(Self { wifi, state }) 99 | } 100 | } -------------------------------------------------------------------------------- /rrr-frontend/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.21.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "android-tzdata" 22 | version = "0.1.1" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 25 | 26 | [[package]] 27 | name = "android_system_properties" 28 | version = "0.1.5" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 31 | dependencies = [ 32 | "libc", 33 | ] 34 | 35 | [[package]] 36 | name = "anyhow" 37 | version = "1.0.75" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" 40 | 41 | [[package]] 42 | name = "anymap2" 43 | version = "0.13.0" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" 46 | 47 | [[package]] 48 | name = "atomic-polyfill" 49 | version = "0.1.11" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" 52 | dependencies = [ 53 | "critical-section", 54 | ] 55 | 56 | [[package]] 57 | name = "autocfg" 58 | version = "1.1.0" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 61 | 62 | [[package]] 63 | name = "backtrace" 64 | version = "0.3.69" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" 67 | dependencies = [ 68 | "addr2line", 69 | "cc", 70 | "cfg-if", 71 | "libc", 72 | "miniz_oxide", 73 | "object", 74 | "rustc-demangle", 75 | ] 76 | 77 | [[package]] 78 | name = "bincode" 79 | version = "1.3.3" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" 82 | dependencies = [ 83 | "serde", 84 | ] 85 | 86 | [[package]] 87 | name = "boolinator" 88 | version = "2.4.0" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" 91 | 92 | [[package]] 93 | name = "bumpalo" 94 | version = "3.13.0" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" 97 | 98 | [[package]] 99 | name = "byteorder" 100 | version = "1.4.3" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 103 | 104 | [[package]] 105 | name = "bytes" 106 | version = "1.4.0" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 109 | 110 | [[package]] 111 | name = "cc" 112 | version = "1.0.83" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 115 | dependencies = [ 116 | "libc", 117 | ] 118 | 119 | [[package]] 120 | name = "cfg-if" 121 | version = "1.0.0" 122 | source = "registry+https://github.com/rust-lang/crates.io-index" 123 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 124 | 125 | [[package]] 126 | name = "chrono" 127 | version = "0.4.27" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | checksum = "f56b4c72906975ca04becb8a30e102dfecddd0c06181e3e95ddc444be28881f8" 130 | dependencies = [ 131 | "android-tzdata", 132 | "iana-time-zone", 133 | "js-sys", 134 | "num-traits", 135 | "time", 136 | "wasm-bindgen", 137 | "windows-targets", 138 | ] 139 | 140 | [[package]] 141 | name = "console_error_panic_hook" 142 | version = "0.1.7" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" 145 | dependencies = [ 146 | "cfg-if", 147 | "wasm-bindgen", 148 | ] 149 | 150 | [[package]] 151 | name = "core-foundation-sys" 152 | version = "0.8.4" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" 155 | 156 | [[package]] 157 | name = "critical-section" 158 | version = "1.1.2" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" 161 | 162 | [[package]] 163 | name = "equivalent" 164 | version = "1.0.1" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 167 | 168 | [[package]] 169 | name = "fnv" 170 | version = "1.0.7" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 173 | 174 | [[package]] 175 | name = "form_urlencoded" 176 | version = "1.2.0" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 179 | dependencies = [ 180 | "percent-encoding", 181 | ] 182 | 183 | [[package]] 184 | name = "futures" 185 | version = "0.3.28" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" 188 | dependencies = [ 189 | "futures-channel", 190 | "futures-core", 191 | "futures-io", 192 | "futures-sink", 193 | "futures-task", 194 | "futures-util", 195 | ] 196 | 197 | [[package]] 198 | name = "futures-channel" 199 | version = "0.3.28" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 202 | dependencies = [ 203 | "futures-core", 204 | "futures-sink", 205 | ] 206 | 207 | [[package]] 208 | name = "futures-core" 209 | version = "0.3.28" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 212 | 213 | [[package]] 214 | name = "futures-io" 215 | version = "0.3.28" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" 218 | 219 | [[package]] 220 | name = "futures-macro" 221 | version = "0.3.28" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" 224 | dependencies = [ 225 | "proc-macro2", 226 | "quote", 227 | "syn 2.0.29", 228 | ] 229 | 230 | [[package]] 231 | name = "futures-sink" 232 | version = "0.3.28" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 235 | 236 | [[package]] 237 | name = "futures-task" 238 | version = "0.3.28" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 241 | 242 | [[package]] 243 | name = "futures-util" 244 | version = "0.3.28" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 247 | dependencies = [ 248 | "futures-channel", 249 | "futures-core", 250 | "futures-io", 251 | "futures-macro", 252 | "futures-sink", 253 | "futures-task", 254 | "memchr", 255 | "pin-project-lite", 256 | "pin-utils", 257 | "slab", 258 | ] 259 | 260 | [[package]] 261 | name = "gimli" 262 | version = "0.28.0" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" 265 | 266 | [[package]] 267 | name = "gloo" 268 | version = "0.4.2" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "23947965eee55e3e97a5cd142dd4c10631cc349b48cecca0ed230fd296f568cd" 271 | dependencies = [ 272 | "gloo-console 0.2.3", 273 | "gloo-dialogs 0.1.1", 274 | "gloo-events 0.1.2", 275 | "gloo-file 0.2.3", 276 | "gloo-render 0.1.1", 277 | "gloo-storage 0.2.2", 278 | "gloo-timers 0.2.6", 279 | "gloo-utils 0.1.7", 280 | ] 281 | 282 | [[package]] 283 | name = "gloo" 284 | version = "0.8.1" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "28999cda5ef6916ffd33fb4a7b87e1de633c47c0dc6d97905fee1cdaa142b94d" 287 | dependencies = [ 288 | "gloo-console 0.2.3", 289 | "gloo-dialogs 0.1.1", 290 | "gloo-events 0.1.2", 291 | "gloo-file 0.2.3", 292 | "gloo-history 0.1.5", 293 | "gloo-net 0.3.1", 294 | "gloo-render 0.1.1", 295 | "gloo-storage 0.2.2", 296 | "gloo-timers 0.2.6", 297 | "gloo-utils 0.1.7", 298 | "gloo-worker 0.2.1", 299 | ] 300 | 301 | [[package]] 302 | name = "gloo" 303 | version = "0.10.0" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "cd35526c28cc55c1db77aed6296de58677dbab863b118483a27845631d870249" 306 | dependencies = [ 307 | "gloo-console 0.3.0", 308 | "gloo-dialogs 0.2.0", 309 | "gloo-events 0.2.0", 310 | "gloo-file 0.3.0", 311 | "gloo-history 0.2.0", 312 | "gloo-net 0.4.0", 313 | "gloo-render 0.2.0", 314 | "gloo-storage 0.3.0", 315 | "gloo-timers 0.3.0", 316 | "gloo-utils 0.2.0", 317 | "gloo-worker 0.4.0", 318 | ] 319 | 320 | [[package]] 321 | name = "gloo-console" 322 | version = "0.2.3" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "82b7ce3c05debe147233596904981848862b068862e9ec3e34be446077190d3f" 325 | dependencies = [ 326 | "gloo-utils 0.1.7", 327 | "js-sys", 328 | "serde", 329 | "wasm-bindgen", 330 | "web-sys", 331 | ] 332 | 333 | [[package]] 334 | name = "gloo-console" 335 | version = "0.3.0" 336 | source = "registry+https://github.com/rust-lang/crates.io-index" 337 | checksum = "2a17868f56b4a24f677b17c8cb69958385102fa879418052d60b50bc1727e261" 338 | dependencies = [ 339 | "gloo-utils 0.2.0", 340 | "js-sys", 341 | "serde", 342 | "wasm-bindgen", 343 | "web-sys", 344 | ] 345 | 346 | [[package]] 347 | name = "gloo-dialogs" 348 | version = "0.1.1" 349 | source = "registry+https://github.com/rust-lang/crates.io-index" 350 | checksum = "67062364ac72d27f08445a46cab428188e2e224ec9e37efdba48ae8c289002e6" 351 | dependencies = [ 352 | "wasm-bindgen", 353 | "web-sys", 354 | ] 355 | 356 | [[package]] 357 | name = "gloo-dialogs" 358 | version = "0.2.0" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "bf4748e10122b01435750ff530095b1217cf6546173459448b83913ebe7815df" 361 | dependencies = [ 362 | "wasm-bindgen", 363 | "web-sys", 364 | ] 365 | 366 | [[package]] 367 | name = "gloo-events" 368 | version = "0.1.2" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "68b107f8abed8105e4182de63845afcc7b69c098b7852a813ea7462a320992fc" 371 | dependencies = [ 372 | "wasm-bindgen", 373 | "web-sys", 374 | ] 375 | 376 | [[package]] 377 | name = "gloo-events" 378 | version = "0.2.0" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "27c26fb45f7c385ba980f5fa87ac677e363949e065a083722697ef1b2cc91e41" 381 | dependencies = [ 382 | "wasm-bindgen", 383 | "web-sys", 384 | ] 385 | 386 | [[package]] 387 | name = "gloo-file" 388 | version = "0.2.3" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" 391 | dependencies = [ 392 | "gloo-events 0.1.2", 393 | "js-sys", 394 | "wasm-bindgen", 395 | "web-sys", 396 | ] 397 | 398 | [[package]] 399 | name = "gloo-file" 400 | version = "0.3.0" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "97563d71863fb2824b2e974e754a81d19c4a7ec47b09ced8a0e6656b6d54bd1f" 403 | dependencies = [ 404 | "gloo-events 0.2.0", 405 | "js-sys", 406 | "wasm-bindgen", 407 | "web-sys", 408 | ] 409 | 410 | [[package]] 411 | name = "gloo-history" 412 | version = "0.1.5" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "85725d90bf0ed47063b3930ef28e863658a7905989e9929a8708aab74a1d5e7f" 415 | dependencies = [ 416 | "gloo-events 0.1.2", 417 | "gloo-utils 0.1.7", 418 | "serde", 419 | "serde-wasm-bindgen", 420 | "serde_urlencoded", 421 | "thiserror", 422 | "wasm-bindgen", 423 | "web-sys", 424 | ] 425 | 426 | [[package]] 427 | name = "gloo-history" 428 | version = "0.2.0" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "91be9f3dd048f35a59c8de3d716ef6d568360078c73ed35a7700776ed53153c8" 431 | dependencies = [ 432 | "gloo-events 0.2.0", 433 | "gloo-utils 0.2.0", 434 | "serde", 435 | "serde-wasm-bindgen", 436 | "serde_urlencoded", 437 | "thiserror", 438 | "wasm-bindgen", 439 | "web-sys", 440 | ] 441 | 442 | [[package]] 443 | name = "gloo-net" 444 | version = "0.1.0" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "2899cb1a13be9020b010967adc6b2a8a343b6f1428b90238c9d53ca24decc6db" 447 | dependencies = [ 448 | "futures-channel", 449 | "futures-core", 450 | "futures-sink", 451 | "gloo-utils 0.1.7", 452 | "js-sys", 453 | "pin-project", 454 | "serde", 455 | "serde_json", 456 | "thiserror", 457 | "wasm-bindgen", 458 | "wasm-bindgen-futures", 459 | "web-sys", 460 | ] 461 | 462 | [[package]] 463 | name = "gloo-net" 464 | version = "0.3.1" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "a66b4e3c7d9ed8d315fd6b97c8b1f74a7c6ecbbc2320e65ae7ed38b7068cc620" 467 | dependencies = [ 468 | "futures-channel", 469 | "futures-core", 470 | "futures-sink", 471 | "gloo-utils 0.1.7", 472 | "http", 473 | "js-sys", 474 | "pin-project", 475 | "serde", 476 | "serde_json", 477 | "thiserror", 478 | "wasm-bindgen", 479 | "wasm-bindgen-futures", 480 | "web-sys", 481 | ] 482 | 483 | [[package]] 484 | name = "gloo-net" 485 | version = "0.4.0" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4" 488 | dependencies = [ 489 | "futures-channel", 490 | "futures-core", 491 | "futures-sink", 492 | "gloo-utils 0.2.0", 493 | "http", 494 | "js-sys", 495 | "pin-project", 496 | "serde", 497 | "serde_json", 498 | "thiserror", 499 | "wasm-bindgen", 500 | "wasm-bindgen-futures", 501 | "web-sys", 502 | ] 503 | 504 | [[package]] 505 | name = "gloo-render" 506 | version = "0.1.1" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "2fd9306aef67cfd4449823aadcd14e3958e0800aa2183955a309112a84ec7764" 509 | dependencies = [ 510 | "wasm-bindgen", 511 | "web-sys", 512 | ] 513 | 514 | [[package]] 515 | name = "gloo-render" 516 | version = "0.2.0" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "56008b6744713a8e8d98ac3dcb7d06543d5662358c9c805b4ce2167ad4649833" 519 | dependencies = [ 520 | "wasm-bindgen", 521 | "web-sys", 522 | ] 523 | 524 | [[package]] 525 | name = "gloo-storage" 526 | version = "0.2.2" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "5d6ab60bf5dbfd6f0ed1f7843da31b41010515c745735c970e821945ca91e480" 529 | dependencies = [ 530 | "gloo-utils 0.1.7", 531 | "js-sys", 532 | "serde", 533 | "serde_json", 534 | "thiserror", 535 | "wasm-bindgen", 536 | "web-sys", 537 | ] 538 | 539 | [[package]] 540 | name = "gloo-storage" 541 | version = "0.3.0" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "fbc8031e8c92758af912f9bc08fbbadd3c6f3cfcbf6b64cdf3d6a81f0139277a" 544 | dependencies = [ 545 | "gloo-utils 0.2.0", 546 | "js-sys", 547 | "serde", 548 | "serde_json", 549 | "thiserror", 550 | "wasm-bindgen", 551 | "web-sys", 552 | ] 553 | 554 | [[package]] 555 | name = "gloo-timers" 556 | version = "0.2.6" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" 559 | dependencies = [ 560 | "js-sys", 561 | "wasm-bindgen", 562 | ] 563 | 564 | [[package]] 565 | name = "gloo-timers" 566 | version = "0.3.0" 567 | source = "registry+https://github.com/rust-lang/crates.io-index" 568 | checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" 569 | dependencies = [ 570 | "js-sys", 571 | "wasm-bindgen", 572 | ] 573 | 574 | [[package]] 575 | name = "gloo-utils" 576 | version = "0.1.7" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e" 579 | dependencies = [ 580 | "js-sys", 581 | "serde", 582 | "serde_json", 583 | "wasm-bindgen", 584 | "web-sys", 585 | ] 586 | 587 | [[package]] 588 | name = "gloo-utils" 589 | version = "0.2.0" 590 | source = "registry+https://github.com/rust-lang/crates.io-index" 591 | checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" 592 | dependencies = [ 593 | "js-sys", 594 | "serde", 595 | "serde_json", 596 | "wasm-bindgen", 597 | "web-sys", 598 | ] 599 | 600 | [[package]] 601 | name = "gloo-worker" 602 | version = "0.2.1" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "13471584da78061a28306d1359dd0178d8d6fc1c7c80e5e35d27260346e0516a" 605 | dependencies = [ 606 | "anymap2", 607 | "bincode", 608 | "gloo-console 0.2.3", 609 | "gloo-utils 0.1.7", 610 | "js-sys", 611 | "serde", 612 | "wasm-bindgen", 613 | "wasm-bindgen-futures", 614 | "web-sys", 615 | ] 616 | 617 | [[package]] 618 | name = "gloo-worker" 619 | version = "0.4.0" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "76495d3dd87de51da268fa3a593da118ab43eb7f8809e17eb38d3319b424e400" 622 | dependencies = [ 623 | "bincode", 624 | "futures", 625 | "gloo-utils 0.2.0", 626 | "gloo-worker-macros", 627 | "js-sys", 628 | "pinned", 629 | "serde", 630 | "thiserror", 631 | "wasm-bindgen", 632 | "wasm-bindgen-futures", 633 | "web-sys", 634 | ] 635 | 636 | [[package]] 637 | name = "gloo-worker-macros" 638 | version = "0.1.0" 639 | source = "registry+https://github.com/rust-lang/crates.io-index" 640 | checksum = "956caa58d4857bc9941749d55e4bd3000032d8212762586fa5705632967140e7" 641 | dependencies = [ 642 | "proc-macro-crate", 643 | "proc-macro2", 644 | "quote", 645 | "syn 2.0.29", 646 | ] 647 | 648 | [[package]] 649 | name = "hash32" 650 | version = "0.2.1" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" 653 | dependencies = [ 654 | "byteorder", 655 | ] 656 | 657 | [[package]] 658 | name = "hashbrown" 659 | version = "0.12.3" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 662 | 663 | [[package]] 664 | name = "hashbrown" 665 | version = "0.14.0" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" 668 | 669 | [[package]] 670 | name = "heapless" 671 | version = "0.7.16" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" 674 | dependencies = [ 675 | "atomic-polyfill", 676 | "hash32", 677 | "rustc_version", 678 | "spin", 679 | "stable_deref_trait", 680 | ] 681 | 682 | [[package]] 683 | name = "hermit-abi" 684 | version = "0.3.2" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" 687 | 688 | [[package]] 689 | name = "http" 690 | version = "0.2.9" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 693 | dependencies = [ 694 | "bytes", 695 | "fnv", 696 | "itoa", 697 | ] 698 | 699 | [[package]] 700 | name = "iana-time-zone" 701 | version = "0.1.57" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" 704 | dependencies = [ 705 | "android_system_properties", 706 | "core-foundation-sys", 707 | "iana-time-zone-haiku", 708 | "js-sys", 709 | "wasm-bindgen", 710 | "windows", 711 | ] 712 | 713 | [[package]] 714 | name = "iana-time-zone-haiku" 715 | version = "0.1.2" 716 | source = "registry+https://github.com/rust-lang/crates.io-index" 717 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 718 | dependencies = [ 719 | "cc", 720 | ] 721 | 722 | [[package]] 723 | name = "implicit-clone" 724 | version = "0.3.6" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "7c6ecbd987bb94f1f3c76c6787879756cf4b6f73bfff48d79308e8c56b46f65f" 727 | dependencies = [ 728 | "indexmap 1.9.3", 729 | ] 730 | 731 | [[package]] 732 | name = "indexmap" 733 | version = "1.9.3" 734 | source = "registry+https://github.com/rust-lang/crates.io-index" 735 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 736 | dependencies = [ 737 | "autocfg", 738 | "hashbrown 0.12.3", 739 | ] 740 | 741 | [[package]] 742 | name = "indexmap" 743 | version = "2.0.0" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" 746 | dependencies = [ 747 | "equivalent", 748 | "hashbrown 0.14.0", 749 | ] 750 | 751 | [[package]] 752 | name = "itoa" 753 | version = "1.0.9" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 756 | 757 | [[package]] 758 | name = "js-sys" 759 | version = "0.3.64" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" 762 | dependencies = [ 763 | "wasm-bindgen", 764 | ] 765 | 766 | [[package]] 767 | name = "lazy_static" 768 | version = "1.4.0" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 771 | 772 | [[package]] 773 | name = "libc" 774 | version = "0.2.147" 775 | source = "registry+https://github.com/rust-lang/crates.io-index" 776 | checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 777 | 778 | [[package]] 779 | name = "lock_api" 780 | version = "0.4.10" 781 | source = "registry+https://github.com/rust-lang/crates.io-index" 782 | checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" 783 | dependencies = [ 784 | "autocfg", 785 | "scopeguard", 786 | ] 787 | 788 | [[package]] 789 | name = "log" 790 | version = "0.4.20" 791 | source = "registry+https://github.com/rust-lang/crates.io-index" 792 | checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" 793 | 794 | [[package]] 795 | name = "material-yew" 796 | version = "0.3.0" 797 | source = "registry+https://github.com/rust-lang/crates.io-index" 798 | checksum = "2d97e47862c4107a7c543d89690ecad1364f871d5708076eba10b89121096956" 799 | dependencies = [ 800 | "gloo 0.8.1", 801 | "js-sys", 802 | "paste", 803 | "wasm-bindgen", 804 | "web-sys", 805 | "yew 0.20.0", 806 | ] 807 | 808 | [[package]] 809 | name = "memchr" 810 | version = "2.5.0" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 813 | 814 | [[package]] 815 | name = "miniz_oxide" 816 | version = "0.7.1" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 819 | dependencies = [ 820 | "adler", 821 | ] 822 | 823 | [[package]] 824 | name = "num-traits" 825 | version = "0.2.16" 826 | source = "registry+https://github.com/rust-lang/crates.io-index" 827 | checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" 828 | dependencies = [ 829 | "autocfg", 830 | ] 831 | 832 | [[package]] 833 | name = "num_cpus" 834 | version = "1.16.0" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 837 | dependencies = [ 838 | "hermit-abi", 839 | "libc", 840 | ] 841 | 842 | [[package]] 843 | name = "object" 844 | version = "0.32.0" 845 | source = "registry+https://github.com/rust-lang/crates.io-index" 846 | checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" 847 | dependencies = [ 848 | "memchr", 849 | ] 850 | 851 | [[package]] 852 | name = "once_cell" 853 | version = "1.18.0" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 856 | 857 | [[package]] 858 | name = "paste" 859 | version = "1.0.14" 860 | source = "registry+https://github.com/rust-lang/crates.io-index" 861 | checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" 862 | 863 | [[package]] 864 | name = "percent-encoding" 865 | version = "2.3.0" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" 868 | 869 | [[package]] 870 | name = "pin-project" 871 | version = "1.1.3" 872 | source = "registry+https://github.com/rust-lang/crates.io-index" 873 | checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" 874 | dependencies = [ 875 | "pin-project-internal", 876 | ] 877 | 878 | [[package]] 879 | name = "pin-project-internal" 880 | version = "1.1.3" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" 883 | dependencies = [ 884 | "proc-macro2", 885 | "quote", 886 | "syn 2.0.29", 887 | ] 888 | 889 | [[package]] 890 | name = "pin-project-lite" 891 | version = "0.2.13" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 894 | 895 | [[package]] 896 | name = "pin-utils" 897 | version = "0.1.0" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 900 | 901 | [[package]] 902 | name = "pinned" 903 | version = "0.1.0" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "a829027bd95e54cfe13e3e258a1ae7b645960553fb82b75ff852c29688ee595b" 906 | dependencies = [ 907 | "futures", 908 | "rustversion", 909 | "thiserror", 910 | ] 911 | 912 | [[package]] 913 | name = "prettyplease" 914 | version = "0.1.25" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" 917 | dependencies = [ 918 | "proc-macro2", 919 | "syn 1.0.109", 920 | ] 921 | 922 | [[package]] 923 | name = "proc-macro-crate" 924 | version = "1.3.1" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" 927 | dependencies = [ 928 | "once_cell", 929 | "toml_edit", 930 | ] 931 | 932 | [[package]] 933 | name = "proc-macro-error" 934 | version = "1.0.4" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 937 | dependencies = [ 938 | "proc-macro-error-attr", 939 | "proc-macro2", 940 | "quote", 941 | "syn 1.0.109", 942 | "version_check", 943 | ] 944 | 945 | [[package]] 946 | name = "proc-macro-error-attr" 947 | version = "1.0.4" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 950 | dependencies = [ 951 | "proc-macro2", 952 | "quote", 953 | "version_check", 954 | ] 955 | 956 | [[package]] 957 | name = "proc-macro2" 958 | version = "1.0.66" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" 961 | dependencies = [ 962 | "unicode-ident", 963 | ] 964 | 965 | [[package]] 966 | name = "prokio" 967 | version = "0.1.0" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "03b55e106e5791fa5a13abd13c85d6127312e8e09098059ca2bc9b03ca4cf488" 970 | dependencies = [ 971 | "futures", 972 | "gloo 0.8.1", 973 | "num_cpus", 974 | "once_cell", 975 | "pin-project", 976 | "pinned", 977 | "tokio", 978 | "tokio-stream", 979 | "wasm-bindgen-futures", 980 | ] 981 | 982 | [[package]] 983 | name = "quote" 984 | version = "1.0.33" 985 | source = "registry+https://github.com/rust-lang/crates.io-index" 986 | checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" 987 | dependencies = [ 988 | "proc-macro2", 989 | ] 990 | 991 | [[package]] 992 | name = "reqwasm" 993 | version = "0.5.0" 994 | source = "registry+https://github.com/rust-lang/crates.io-index" 995 | checksum = "05b89870d729c501fa7a68c43bf4d938bbb3a8c156d333d90faa0e8b3e3212fb" 996 | dependencies = [ 997 | "gloo-net 0.1.0", 998 | ] 999 | 1000 | [[package]] 1001 | name = "rrr-api" 1002 | version = "0.0.1" 1003 | dependencies = [ 1004 | "serde", 1005 | ] 1006 | 1007 | [[package]] 1008 | name = "rrr-frontend" 1009 | version = "0.0.1" 1010 | dependencies = [ 1011 | "anyhow", 1012 | "gloo 0.10.0", 1013 | "heapless", 1014 | "material-yew", 1015 | "reqwasm", 1016 | "rrr-api", 1017 | "serde", 1018 | "serde_json", 1019 | "wasm-bindgen", 1020 | "wasm-bindgen-futures", 1021 | "web-sys", 1022 | "yew 0.20.0", 1023 | "yew-chart", 1024 | "yew-hooks", 1025 | ] 1026 | 1027 | [[package]] 1028 | name = "rustc-demangle" 1029 | version = "0.1.23" 1030 | source = "registry+https://github.com/rust-lang/crates.io-index" 1031 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 1032 | 1033 | [[package]] 1034 | name = "rustc_version" 1035 | version = "0.4.0" 1036 | source = "registry+https://github.com/rust-lang/crates.io-index" 1037 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 1038 | dependencies = [ 1039 | "semver", 1040 | ] 1041 | 1042 | [[package]] 1043 | name = "rustversion" 1044 | version = "1.0.14" 1045 | source = "registry+https://github.com/rust-lang/crates.io-index" 1046 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 1047 | 1048 | [[package]] 1049 | name = "ryu" 1050 | version = "1.0.15" 1051 | source = "registry+https://github.com/rust-lang/crates.io-index" 1052 | checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" 1053 | 1054 | [[package]] 1055 | name = "scoped-tls-hkt" 1056 | version = "0.1.4" 1057 | source = "registry+https://github.com/rust-lang/crates.io-index" 1058 | checksum = "3ddc765d3410d9f6c6ca071bf0b67f6b01e3ec4595dc3892f02677e75819dddc" 1059 | 1060 | [[package]] 1061 | name = "scopeguard" 1062 | version = "1.2.0" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1065 | 1066 | [[package]] 1067 | name = "semver" 1068 | version = "1.0.18" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" 1071 | 1072 | [[package]] 1073 | name = "serde" 1074 | version = "1.0.188" 1075 | source = "registry+https://github.com/rust-lang/crates.io-index" 1076 | checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" 1077 | dependencies = [ 1078 | "serde_derive", 1079 | ] 1080 | 1081 | [[package]] 1082 | name = "serde-wasm-bindgen" 1083 | version = "0.5.0" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" 1086 | dependencies = [ 1087 | "js-sys", 1088 | "serde", 1089 | "wasm-bindgen", 1090 | ] 1091 | 1092 | [[package]] 1093 | name = "serde_derive" 1094 | version = "1.0.188" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" 1097 | dependencies = [ 1098 | "proc-macro2", 1099 | "quote", 1100 | "syn 2.0.29", 1101 | ] 1102 | 1103 | [[package]] 1104 | name = "serde_json" 1105 | version = "1.0.105" 1106 | source = "registry+https://github.com/rust-lang/crates.io-index" 1107 | checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" 1108 | dependencies = [ 1109 | "itoa", 1110 | "ryu", 1111 | "serde", 1112 | ] 1113 | 1114 | [[package]] 1115 | name = "serde_urlencoded" 1116 | version = "0.7.1" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1119 | dependencies = [ 1120 | "form_urlencoded", 1121 | "itoa", 1122 | "ryu", 1123 | "serde", 1124 | ] 1125 | 1126 | [[package]] 1127 | name = "slab" 1128 | version = "0.4.9" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1131 | dependencies = [ 1132 | "autocfg", 1133 | ] 1134 | 1135 | [[package]] 1136 | name = "spin" 1137 | version = "0.9.8" 1138 | source = "registry+https://github.com/rust-lang/crates.io-index" 1139 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 1140 | dependencies = [ 1141 | "lock_api", 1142 | ] 1143 | 1144 | [[package]] 1145 | name = "stable_deref_trait" 1146 | version = "1.2.0" 1147 | source = "registry+https://github.com/rust-lang/crates.io-index" 1148 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1149 | 1150 | [[package]] 1151 | name = "syn" 1152 | version = "1.0.109" 1153 | source = "registry+https://github.com/rust-lang/crates.io-index" 1154 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1155 | dependencies = [ 1156 | "proc-macro2", 1157 | "quote", 1158 | "unicode-ident", 1159 | ] 1160 | 1161 | [[package]] 1162 | name = "syn" 1163 | version = "2.0.29" 1164 | source = "registry+https://github.com/rust-lang/crates.io-index" 1165 | checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" 1166 | dependencies = [ 1167 | "proc-macro2", 1168 | "quote", 1169 | "unicode-ident", 1170 | ] 1171 | 1172 | [[package]] 1173 | name = "thiserror" 1174 | version = "1.0.47" 1175 | source = "registry+https://github.com/rust-lang/crates.io-index" 1176 | checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" 1177 | dependencies = [ 1178 | "thiserror-impl", 1179 | ] 1180 | 1181 | [[package]] 1182 | name = "thiserror-impl" 1183 | version = "1.0.47" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" 1186 | dependencies = [ 1187 | "proc-macro2", 1188 | "quote", 1189 | "syn 2.0.29", 1190 | ] 1191 | 1192 | [[package]] 1193 | name = "time" 1194 | version = "0.1.45" 1195 | source = "registry+https://github.com/rust-lang/crates.io-index" 1196 | checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" 1197 | dependencies = [ 1198 | "libc", 1199 | "wasi", 1200 | "winapi", 1201 | ] 1202 | 1203 | [[package]] 1204 | name = "tokio" 1205 | version = "1.32.0" 1206 | source = "registry+https://github.com/rust-lang/crates.io-index" 1207 | checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" 1208 | dependencies = [ 1209 | "backtrace", 1210 | "pin-project-lite", 1211 | ] 1212 | 1213 | [[package]] 1214 | name = "tokio-stream" 1215 | version = "0.1.14" 1216 | source = "registry+https://github.com/rust-lang/crates.io-index" 1217 | checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" 1218 | dependencies = [ 1219 | "futures-core", 1220 | "pin-project-lite", 1221 | "tokio", 1222 | ] 1223 | 1224 | [[package]] 1225 | name = "toml_datetime" 1226 | version = "0.6.3" 1227 | source = "registry+https://github.com/rust-lang/crates.io-index" 1228 | checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" 1229 | 1230 | [[package]] 1231 | name = "toml_edit" 1232 | version = "0.19.14" 1233 | source = "registry+https://github.com/rust-lang/crates.io-index" 1234 | checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" 1235 | dependencies = [ 1236 | "indexmap 2.0.0", 1237 | "toml_datetime", 1238 | "winnow", 1239 | ] 1240 | 1241 | [[package]] 1242 | name = "tracing" 1243 | version = "0.1.37" 1244 | source = "registry+https://github.com/rust-lang/crates.io-index" 1245 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1246 | dependencies = [ 1247 | "cfg-if", 1248 | "pin-project-lite", 1249 | "tracing-attributes", 1250 | "tracing-core", 1251 | ] 1252 | 1253 | [[package]] 1254 | name = "tracing-attributes" 1255 | version = "0.1.26" 1256 | source = "registry+https://github.com/rust-lang/crates.io-index" 1257 | checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" 1258 | dependencies = [ 1259 | "proc-macro2", 1260 | "quote", 1261 | "syn 2.0.29", 1262 | ] 1263 | 1264 | [[package]] 1265 | name = "tracing-core" 1266 | version = "0.1.31" 1267 | source = "registry+https://github.com/rust-lang/crates.io-index" 1268 | checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 1269 | dependencies = [ 1270 | "once_cell", 1271 | ] 1272 | 1273 | [[package]] 1274 | name = "unicode-ident" 1275 | version = "1.0.11" 1276 | source = "registry+https://github.com/rust-lang/crates.io-index" 1277 | checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" 1278 | 1279 | [[package]] 1280 | name = "version_check" 1281 | version = "0.9.4" 1282 | source = "registry+https://github.com/rust-lang/crates.io-index" 1283 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1284 | 1285 | [[package]] 1286 | name = "wasi" 1287 | version = "0.10.0+wasi-snapshot-preview1" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" 1290 | 1291 | [[package]] 1292 | name = "wasm-bindgen" 1293 | version = "0.2.87" 1294 | source = "registry+https://github.com/rust-lang/crates.io-index" 1295 | checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" 1296 | dependencies = [ 1297 | "cfg-if", 1298 | "serde", 1299 | "serde_json", 1300 | "wasm-bindgen-macro", 1301 | ] 1302 | 1303 | [[package]] 1304 | name = "wasm-bindgen-backend" 1305 | version = "0.2.87" 1306 | source = "registry+https://github.com/rust-lang/crates.io-index" 1307 | checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" 1308 | dependencies = [ 1309 | "bumpalo", 1310 | "log", 1311 | "once_cell", 1312 | "proc-macro2", 1313 | "quote", 1314 | "syn 2.0.29", 1315 | "wasm-bindgen-shared", 1316 | ] 1317 | 1318 | [[package]] 1319 | name = "wasm-bindgen-futures" 1320 | version = "0.4.37" 1321 | source = "registry+https://github.com/rust-lang/crates.io-index" 1322 | checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" 1323 | dependencies = [ 1324 | "cfg-if", 1325 | "js-sys", 1326 | "wasm-bindgen", 1327 | "web-sys", 1328 | ] 1329 | 1330 | [[package]] 1331 | name = "wasm-bindgen-macro" 1332 | version = "0.2.87" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" 1335 | dependencies = [ 1336 | "quote", 1337 | "wasm-bindgen-macro-support", 1338 | ] 1339 | 1340 | [[package]] 1341 | name = "wasm-bindgen-macro-support" 1342 | version = "0.2.87" 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" 1344 | checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" 1345 | dependencies = [ 1346 | "proc-macro2", 1347 | "quote", 1348 | "syn 2.0.29", 1349 | "wasm-bindgen-backend", 1350 | "wasm-bindgen-shared", 1351 | ] 1352 | 1353 | [[package]] 1354 | name = "wasm-bindgen-shared" 1355 | version = "0.2.87" 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" 1357 | checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" 1358 | 1359 | [[package]] 1360 | name = "web-sys" 1361 | version = "0.3.64" 1362 | source = "registry+https://github.com/rust-lang/crates.io-index" 1363 | checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" 1364 | dependencies = [ 1365 | "js-sys", 1366 | "wasm-bindgen", 1367 | ] 1368 | 1369 | [[package]] 1370 | name = "winapi" 1371 | version = "0.3.9" 1372 | source = "registry+https://github.com/rust-lang/crates.io-index" 1373 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1374 | dependencies = [ 1375 | "winapi-i686-pc-windows-gnu", 1376 | "winapi-x86_64-pc-windows-gnu", 1377 | ] 1378 | 1379 | [[package]] 1380 | name = "winapi-i686-pc-windows-gnu" 1381 | version = "0.4.0" 1382 | source = "registry+https://github.com/rust-lang/crates.io-index" 1383 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1384 | 1385 | [[package]] 1386 | name = "winapi-x86_64-pc-windows-gnu" 1387 | version = "0.4.0" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1390 | 1391 | [[package]] 1392 | name = "windows" 1393 | version = "0.48.0" 1394 | source = "registry+https://github.com/rust-lang/crates.io-index" 1395 | checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" 1396 | dependencies = [ 1397 | "windows-targets", 1398 | ] 1399 | 1400 | [[package]] 1401 | name = "windows-targets" 1402 | version = "0.48.5" 1403 | source = "registry+https://github.com/rust-lang/crates.io-index" 1404 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1405 | dependencies = [ 1406 | "windows_aarch64_gnullvm", 1407 | "windows_aarch64_msvc", 1408 | "windows_i686_gnu", 1409 | "windows_i686_msvc", 1410 | "windows_x86_64_gnu", 1411 | "windows_x86_64_gnullvm", 1412 | "windows_x86_64_msvc", 1413 | ] 1414 | 1415 | [[package]] 1416 | name = "windows_aarch64_gnullvm" 1417 | version = "0.48.5" 1418 | source = "registry+https://github.com/rust-lang/crates.io-index" 1419 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1420 | 1421 | [[package]] 1422 | name = "windows_aarch64_msvc" 1423 | version = "0.48.5" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1426 | 1427 | [[package]] 1428 | name = "windows_i686_gnu" 1429 | version = "0.48.5" 1430 | source = "registry+https://github.com/rust-lang/crates.io-index" 1431 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1432 | 1433 | [[package]] 1434 | name = "windows_i686_msvc" 1435 | version = "0.48.5" 1436 | source = "registry+https://github.com/rust-lang/crates.io-index" 1437 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1438 | 1439 | [[package]] 1440 | name = "windows_x86_64_gnu" 1441 | version = "0.48.5" 1442 | source = "registry+https://github.com/rust-lang/crates.io-index" 1443 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1444 | 1445 | [[package]] 1446 | name = "windows_x86_64_gnullvm" 1447 | version = "0.48.5" 1448 | source = "registry+https://github.com/rust-lang/crates.io-index" 1449 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1450 | 1451 | [[package]] 1452 | name = "windows_x86_64_msvc" 1453 | version = "0.48.5" 1454 | source = "registry+https://github.com/rust-lang/crates.io-index" 1455 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1456 | 1457 | [[package]] 1458 | name = "winnow" 1459 | version = "0.5.15" 1460 | source = "registry+https://github.com/rust-lang/crates.io-index" 1461 | checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" 1462 | dependencies = [ 1463 | "memchr", 1464 | ] 1465 | 1466 | [[package]] 1467 | name = "yew" 1468 | version = "0.19.3" 1469 | source = "registry+https://github.com/rust-lang/crates.io-index" 1470 | checksum = "2a1ccb53e57d3f7d847338cf5758befa811cabe207df07f543c06f502f9998cd" 1471 | dependencies = [ 1472 | "console_error_panic_hook", 1473 | "gloo 0.4.2", 1474 | "gloo-utils 0.1.7", 1475 | "indexmap 1.9.3", 1476 | "js-sys", 1477 | "scoped-tls-hkt", 1478 | "slab", 1479 | "wasm-bindgen", 1480 | "wasm-bindgen-futures", 1481 | "web-sys", 1482 | "yew-macro 0.19.3", 1483 | ] 1484 | 1485 | [[package]] 1486 | name = "yew" 1487 | version = "0.20.0" 1488 | source = "registry+https://github.com/rust-lang/crates.io-index" 1489 | checksum = "5dbecfe44343b70cc2932c3eb445425969ae21754a8ab3a0966981c1cf7af1cc" 1490 | dependencies = [ 1491 | "console_error_panic_hook", 1492 | "futures", 1493 | "gloo 0.8.1", 1494 | "implicit-clone", 1495 | "indexmap 1.9.3", 1496 | "js-sys", 1497 | "prokio", 1498 | "rustversion", 1499 | "serde", 1500 | "slab", 1501 | "thiserror", 1502 | "tokio", 1503 | "tracing", 1504 | "wasm-bindgen", 1505 | "wasm-bindgen-futures", 1506 | "web-sys", 1507 | "yew-macro 0.20.0", 1508 | ] 1509 | 1510 | [[package]] 1511 | name = "yew-chart" 1512 | version = "0.5.0" 1513 | source = "registry+https://github.com/rust-lang/crates.io-index" 1514 | checksum = "e886d189c07ccbaee21f576dce4524926a6fbacbe3f5a80746fff5ffdc436b6e" 1515 | dependencies = [ 1516 | "chrono", 1517 | "gloo-events 0.1.2", 1518 | "gloo-utils 0.1.7", 1519 | "wasm-bindgen", 1520 | "web-sys", 1521 | "yew 0.19.3", 1522 | ] 1523 | 1524 | [[package]] 1525 | name = "yew-hooks" 1526 | version = "0.2.0" 1527 | source = "registry+https://github.com/rust-lang/crates.io-index" 1528 | checksum = "268e2367720311f19582235f5c021702d6be8ded13b7ee8dcacc71019d055d15" 1529 | dependencies = [ 1530 | "gloo 0.8.1", 1531 | "js-sys", 1532 | "log", 1533 | "serde", 1534 | "wasm-bindgen", 1535 | "wasm-bindgen-futures", 1536 | "web-sys", 1537 | "yew 0.20.0", 1538 | ] 1539 | 1540 | [[package]] 1541 | name = "yew-macro" 1542 | version = "0.19.3" 1543 | source = "registry+https://github.com/rust-lang/crates.io-index" 1544 | checksum = "5fab79082b556d768d6e21811869c761893f0450e1d550a67892b9bce303b7bb" 1545 | dependencies = [ 1546 | "boolinator", 1547 | "lazy_static", 1548 | "proc-macro-error", 1549 | "proc-macro2", 1550 | "quote", 1551 | "syn 1.0.109", 1552 | ] 1553 | 1554 | [[package]] 1555 | name = "yew-macro" 1556 | version = "0.20.0" 1557 | source = "registry+https://github.com/rust-lang/crates.io-index" 1558 | checksum = "b64c253c1d401f1ea868ca9988db63958cfa15a69f739101f338d6f05eea8301" 1559 | dependencies = [ 1560 | "boolinator", 1561 | "once_cell", 1562 | "prettyplease", 1563 | "proc-macro-error", 1564 | "proc-macro2", 1565 | "quote", 1566 | "syn 1.0.109", 1567 | ] 1568 | -------------------------------------------------------------------------------- /rrr-frontend/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rrr-frontend" 3 | version = "0.0.1" 4 | edition = "2021" 5 | 6 | [profile.release] 7 | opt-level = "s" 8 | strip = true 9 | lto = true 10 | codegen-units = 1 11 | 12 | [dependencies] 13 | rrr-api = {path = "../rrr-api"} 14 | 15 | yew = { version = "0.20", features = ["csr"] } 16 | #yew-mdc = {git = "https://github.com/lukepfeiffer10/yew-mdc.git"} 17 | yew-hooks = "0.2.0" 18 | yew-chart = "0.5.0" 19 | material-yew = { version = "0.3.0", features = ["full"] } 20 | web-sys = "0.3.64" 21 | reqwasm = "0.5.0" 22 | wasm-bindgen = "0.2.87" 23 | wasm-bindgen-futures = "0.4.37" 24 | serde = "1.0.185" 25 | serde_json = "1.0.105" 26 | gloo = "0.10.0" 27 | heapless = "0.7.16" 28 | anyhow = "1.0.75" -------------------------------------------------------------------------------- /rrr-frontend/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PositiveAltitude/rrr-software/7b4ea8623cc9be9cdf652bb8531004e044c8d317/rrr-frontend/favicon.ico -------------------------------------------------------------------------------- /rrr-frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | RRR 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /rrr-frontend/index.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Roboto'; 3 | font-style: normal; 4 | font-weight: 300; 5 | src: url(Roboto-Regular.ttf) format('truetype'); 6 | } 7 | 8 | /* fallback */ 9 | @font-face { 10 | font-family: 'Material Icons'; 11 | font-style: normal; 12 | font-weight: 400; 13 | font-display: block; 14 | src: url(material-icons.woff2) format('woff2'); 15 | } 16 | 17 | .material-icons { 18 | font-family: 'Material Icons'; 19 | font-weight: normal; 20 | font-style: normal; 21 | font-size: 24px; 22 | line-height: 1; 23 | letter-spacing: normal; 24 | text-transform: none; 25 | display: inline-block; 26 | white-space: nowrap; 27 | word-wrap: normal; 28 | direction: ltr; 29 | -webkit-font-feature-settings: 'liga'; 30 | -webkit-font-smoothing: antialiased; 31 | } 32 | 33 | html, 34 | body { 35 | height: 100%; 36 | margin: 0; 37 | font-size: 16px; 38 | font-family: Roboto, sans-serif; 39 | overflow: hidden; 40 | /* TODO: fix for text fields */ 41 | text-transform: uppercase; 42 | font-weight: 500; 43 | } 44 | 45 | html { 46 | --mdc-theme-primary: #3f51b5; 47 | --mdc-tab-horizontal-padding: 12px; 48 | } 49 | 50 | .content-frame { 51 | display: flex; 52 | height: 100%; 53 | width: 100%; 54 | justify-content: space-around; 55 | overflow: auto; 56 | } 57 | 58 | .content-root { 59 | display: flex; 60 | height: 100%; 61 | width: 100%; 62 | max-width: 500px; 63 | min-width: 374px; 64 | flex-direction: column; 65 | } 66 | 67 | .tab-page { 68 | margin-top: 10px; 69 | overflow: auto; 70 | } 71 | 72 | .horizontal-layout { 73 | display: flex; 74 | flex-direction: row; 75 | align-items: center; 76 | } 77 | 78 | .vertical-layout { 79 | display: flex; 80 | flex-direction: column; 81 | } 82 | 83 | .equal-size { 84 | flex: 1 1 0px; 85 | } 86 | 87 | mwc-button { 88 | width: 100%; 89 | } 90 | 91 | .card { 92 | display: flex; 93 | justify-content: flex-start; 94 | flex-direction: column; 95 | margin: 5px; 96 | border: 2px solid #CCC; 97 | border-radius: 10px; 98 | padding: 0px 20px 10px 20px; 99 | } 100 | 101 | .card .header { 102 | display: flex; 103 | justify-content: flex-start; 104 | align-item: center; 105 | } 106 | 107 | .card .header mwc-icon { 108 | font-size: 50px; 109 | align-self: center; 110 | margin: 0px 15px 0px 0px; 111 | } 112 | 113 | .card-content { 114 | font-weight: 400; 115 | } 116 | 117 | .horizontal-layout .separator { 118 | margin-left: 20px; 119 | } 120 | 121 | /* content-specific */ 122 | 123 | .card-content .first-column { 124 | width: 60%; 125 | } -------------------------------------------------------------------------------- /rrr-frontend/resources/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /rrr-frontend/resources/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PositiveAltitude/rrr-software/7b4ea8623cc9be9cdf652bb8531004e044c8d317/rrr-frontend/resources/Roboto-Regular.ttf -------------------------------------------------------------------------------- /rrr-frontend/resources/material-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PositiveAltitude/rrr-software/7b4ea8623cc9be9cdf652bb8531004e044c8d317/rrr-frontend/resources/material-icons.woff2 -------------------------------------------------------------------------------- /rrr-frontend/src/components.rs: -------------------------------------------------------------------------------- 1 | use yew::prelude::*; 2 | use yew_hooks::prelude::*; 3 | use material_yew::*; 4 | 5 | #[derive(Properties, PartialEq)] 6 | pub struct ChildrenProps { 7 | pub children: Children, 8 | } 9 | 10 | #[function_component] 11 | pub fn HorizontalLayout(props: &ChildrenProps) -> Html { 12 | html!( 13 |
14 | {props.children.clone()} 15 |
16 | ) 17 | } 18 | 19 | #[function_component] 20 | pub fn VerticalLayout(props: &ChildrenProps) -> Html { 21 | html!( 22 |
23 | {props.children.clone()} 24 |
25 | ) 26 | } 27 | 28 | #[derive(Properties, PartialEq)] 29 | pub struct CardProps { 30 | pub children: Children, 31 | pub title: String, 32 | #[prop_or_default] 33 | pub icon: Option, 34 | } 35 | 36 | #[function_component] 37 | pub fn Card(props: &CardProps) -> Html { 38 | html!( 39 |
40 |
41 | if(props.icon.is_some()) {{props.icon.clone().unwrap()}} 42 |

{props.title.clone()}

43 |
44 |
{props.children.clone()}
45 |
46 | ) 47 | } 48 | 49 | #[derive(Properties, PartialEq)] 50 | pub struct TabPageProps { 51 | pub children: Children, 52 | pub id: usize, 53 | pub current_id: usize, 54 | } 55 | 56 | #[function_component] 57 | pub fn TabPage(props: &TabPageProps) -> Html { 58 | html! { 59 | 60 | } 61 | } -------------------------------------------------------------------------------- /rrr-frontend/src/main.rs: -------------------------------------------------------------------------------- 1 | mod components; 2 | 3 | use crate::components::*; 4 | 5 | use std::process::Child; 6 | use rrr_api::*; 7 | 8 | use gloo::console::log; 9 | use yew::prelude::*; 10 | use yew_hooks::prelude::*; 11 | use reqwasm::http::Request; 12 | use wasm_bindgen_futures::spawn_local; 13 | use serde::{Serialize, Deserialize}; 14 | use serde::de::DeserializeOwned; 15 | use material_yew::*; 16 | use material_yew::text_inputs::TextFieldType; 17 | 18 | use gloo::timers::callback::{Timeout}; 19 | use wasm_bindgen::JsCast; 20 | use web_sys::console::log; 21 | use web_sys::HtmlInputElement; 22 | 23 | #[derive(Properties, PartialEq)] 24 | struct RestButtonProps { 25 | text: String, 26 | command: Command, 27 | #[prop_or_default] 28 | equal_size: bool, 29 | } 30 | 31 | #[function_component] 32 | fn RestButton(props: &RestButtonProps) -> Html { 33 | let text = props.text.clone(); 34 | let commmand: Command = props.command.clone(); 35 | 36 | let onclick: Callback = Callback::from(move |_| { 37 | let s = "http://rrr.local/command".to_owned(); 38 | let s = s.clone(); 39 | let commmand = commmand.clone(); 40 | spawn_local(async move { 41 | Request::post(&s) 42 | .body(serde_json::to_string(&commmand).unwrap()) 43 | .send() 44 | .await 45 | .unwrap(); 46 | }); 47 | () 48 | }); 49 | 50 | html! {} 51 | } 52 | 53 | static command_uri: &str = "http://rrr.local/command"; 54 | 55 | fn send_command(command: Command) { 56 | spawn_local(async move { 57 | Request::post(command_uri) 58 | .body(serde_json::to_string(&command).unwrap()) 59 | .send() 60 | .await 61 | .unwrap(); 62 | }); 63 | } 64 | 65 | #[function_component] 66 | fn WifiSettings() -> Html { 67 | let ssid = use_state(|| String::new()); 68 | let password = use_state(|| String::new()); 69 | 70 | let ssid1 = ssid.clone(); 71 | let password1 = password.clone(); 72 | let onclick = move |_| { 73 | let cmd = Command::SetWifi { ssid: (*ssid1).clone(), password: (*password1).clone() }; 74 | send_command(cmd); 75 | }; 76 | 77 | html! {
78 | 79 | 80 | 81 |
82 | } 83 | } 84 | 85 | #[function_component] 86 | fn App() -> Html { 87 | let current_tab = use_state(|| 0); 88 | 89 | let current_tab_ = current_tab.clone(); 90 | let onactivated = move |current_id: usize| { current_tab_.set(current_id) }; 91 | 92 | html! { 93 |
94 |
95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 |
119 |
120 | } 121 | } 122 | 123 | #[function_component] 124 | fn StateComponent() -> Html { 125 | let state = use_state_eq(|| State::default()); 126 | let update_required = use_state_eq(|| true); 127 | 128 | async fn fetch_state() -> Result { 129 | fetch::("http://rrr.local/state".to_string()).await 130 | } 131 | 132 | async fn fetch(url: String) -> Result 133 | where 134 | T: DeserializeOwned, 135 | { 136 | let response = Request::get(&url).send().await; 137 | if let Ok(data) = response { 138 | (data.json::().await).map_or(Err(Error::DeserializeError), |repo| Ok(repo)) 139 | } else { 140 | Err(Error::RequestError) 141 | } 142 | } 143 | 144 | let u3 = update_required.clone(); 145 | 146 | let state2 = state.clone(); 147 | 148 | let async_request: UseAsyncHandle = use_async(async move { 149 | let ans = fetch_state().await; 150 | let ans2 = ans.clone(); 151 | if ans.is_ok() { state2.set(ans.unwrap()) }; 152 | Timeout::new(1000, move || { 153 | log!("request"); 154 | u3.set(true); 155 | }).forget(); 156 | ans2 157 | }); 158 | 159 | let u2 = update_required.clone(); 160 | if *u2 { 161 | async_request.run(); 162 | u2.set(false); 163 | } 164 | 165 | let battery_icon = match state.battery.soc { 166 | x if x < 0.1 => "battery_0_bar", 167 | x if x < 0.233 => "battery_1_bar", 168 | x if x < 0.366 => "battery_2_bar", 169 | x if x < 0.50 => "battery_3_bar", 170 | x if x < 0.633 => "battery_4_bar", 171 | x if x < 0.766 => "battery_5_bar", 172 | x if x <= 0.90 => "battery_6_bar", 173 | x if x > 0.90 => "battery_full", 174 | _ => "battery_unknown", 175 | }; 176 | 177 | fn pyro_status(pyro: &PyroChannelState) -> &'static str { 178 | match pyro { 179 | PyroChannelState { fire: true, test_voltage: _ } => { "active!!!" } 180 | PyroChannelState { fire: false, test_voltage: tv } if *tv > 1.0f32 => { "connected" } 181 | _ => { "not connected" } 182 | } 183 | } 184 | 185 | fn servo_state(servo: &Option) -> String { 186 | match servo { 187 | None => String::from("off"), 188 | Some(a) => format!("{:.4}", a), 189 | } 190 | } 191 | 192 | html! { 193 |
194 | 195 | 196 | 197 |
{"Battery charge"}
198 |
{"Battery voltage"}
199 |
{"Battery charge rate"}
200 |
201 | 202 |
{format!("{:.0}", state.battery.soc)}
203 |
{format!("{:.2}", state.battery.voltage)}
204 |
{format!("{:.1}", state.battery.charge_rate)}
205 |
206 |
207 | 208 |
{"%"}
209 |
{"V"}
210 |
{"%/hr"}
211 |
212 | 213 | 214 | 215 | 216 | 217 |
{"channel 1"}
218 |
{"channel 2"}
219 |
220 | 221 |
{pyro_status(&state.pyro.channel1)}
222 |
{pyro_status(&state.pyro.channel2)}
223 |
224 |
225 |
226 | 227 | 228 | 229 |
{"Altitude"}
230 |
{"temperature"}
231 |
232 | 233 |
{format!("{:.1}", state.barometer.altitude)}
234 |
{format!("{:.1}", state.barometer.temperature)}
235 |
236 |
237 | 238 |
{"M"}
239 |
{"°C"}
240 |
241 | 242 | 243 | 244 | 245 | 246 |
{"servo 1"}
247 |
{"servo 2"}
248 |
249 | 250 |
{servo_state(&state.servo.servo1_duty)}
251 |
{servo_state(&state.servo.servo2_duty)}
252 |
253 |
254 |
255 |
256 | } 257 | } 258 | 259 | #[function_component] 260 | fn ServoComponent() -> Html { 261 | let duty1_enabled = use_state(|| false); 262 | let duty2_enabled = use_state(|| false); 263 | 264 | let duty1 = use_state(|| 0i32); 265 | let duty2 = use_state(|| 0i32); 266 | 267 | fn str_to_f32(s: String) -> Option { 268 | if s.is_empty() {None} else 269 | { 270 | log!("parsing"); 271 | s.parse::().ok().filter(|i| {(*i >= 0 && *i <= 100)}).or_else(|| {Some(0)}) 272 | } 273 | } 274 | 275 | let duty1_enabled_ = duty1_enabled.clone(); 276 | let duty2_enabled_ = duty2_enabled.clone(); 277 | let duty1_ = duty1.clone(); 278 | let duty2_ = duty2.clone(); 279 | 280 | let submit = move |_| { 281 | let duty_1 = if (*duty1_enabled_) 282 | {Some(((*duty1_) as f32) * 0.01f32)} else {None}; 283 | 284 | let duty_2 = if (*duty2_enabled_) 285 | {Some(((*duty2_) as f32) * 0.01f32)} else {None}; 286 | 287 | let command = Command::SetPwmDutyCycle {duty_1, duty_2}; 288 | send_command(command); 289 | }; 290 | 291 | html! { 292 | 293 | 294 | 295 |
{"servo 1"}
296 | 297 | 301 |
302 | 303 |
{"servo 2"}
304 | 305 | 309 |
310 |
311 |
312 | 313 | 314 | } 315 | } 316 | 317 | fn main() { 318 | yew::Renderer::::new().render(); 319 | } 320 | 321 | #[derive(Clone, Debug, PartialEq)] 322 | enum Error { 323 | RequestError, 324 | DeserializeError, 325 | } -------------------------------------------------------------------------------- /rrr-simulation/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rrr-simulation" 3 | version = "0.0.1" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | bevy = "0.12.1" 8 | 9 | -------------------------------------------------------------------------------- /rrr-simulation/src/cone.rs: -------------------------------------------------------------------------------- 1 | use bevy::render::mesh::{Indices, Mesh, PrimitiveTopology}; 2 | 3 | 4 | #[derive(Clone, Copy, Debug)] 5 | pub struct Cone { 6 | pub radius: f32, 7 | pub height: f32, 8 | pub resolution: u32, 9 | } 10 | 11 | impl Default for Cone { 12 | fn default() -> Self { 13 | Self { 14 | radius: 0.5, 15 | height: 1.0, 16 | resolution: 16, 17 | } 18 | } 19 | } 20 | 21 | impl From for Mesh { 22 | fn from(c: Cone) -> Self { 23 | debug_assert!(c.radius > 0.0); 24 | debug_assert!(c.height > 0.0); 25 | debug_assert!(c.resolution > 2); 26 | 27 | let num_vertices = c.resolution + 2; 28 | let num_polygons = c.resolution * 2; 29 | let num_indices = num_polygons * 3; 30 | 31 | let mut positions = Vec::with_capacity(num_vertices as usize); 32 | let mut normals = Vec::with_capacity(num_vertices as usize); 33 | let mut indices = Vec::with_capacity(num_indices as usize); 34 | 35 | let step_theta = std::f32::consts::TAU / c.resolution as f32; 36 | 37 | let center_vertex_index = num_vertices - 2; 38 | let top_vertex_index = num_vertices - 1; 39 | 40 | for i in 0..c.resolution { 41 | let theta = i as f32 * step_theta; 42 | let (sin, cos) = theta.sin_cos(); 43 | 44 | positions.push([cos * c.radius, sin * c.radius, 0.0]); 45 | normals.push([cos, sin, 0.0]); 46 | } 47 | 48 | positions.push([0.0, 0.0, 0.0]); 49 | positions.push([0.0, 0.0, c.height]); 50 | normals.push([0.0, 0.0, -1.0]); 51 | normals.push([0.0, 0.0, 1.0]); 52 | 53 | for i in 1..c.resolution { 54 | indices.extend_from_slice(&[center_vertex_index, i, i - 1]); 55 | indices.extend_from_slice(&[top_vertex_index, i - 1, i]); 56 | } 57 | indices.extend_from_slice(&[center_vertex_index, 0, c.resolution - 1]); 58 | indices.extend_from_slice(&[top_vertex_index, c.resolution - 1, 0]); 59 | 60 | 61 | Mesh::new(PrimitiveTopology::TriangleList) 62 | .with_indices(Some(Indices::U32(indices))) 63 | .with_inserted_attribute(Mesh::ATTRIBUTE_POSITION, positions) 64 | .with_inserted_attribute(Mesh::ATTRIBUTE_NORMAL, normals) 65 | } 66 | } -------------------------------------------------------------------------------- /rrr-simulation/src/main.rs: -------------------------------------------------------------------------------- 1 | use bevy::core_pipeline::bloom::BloomSettings; 2 | use bevy::core_pipeline::tonemapping::Tonemapping; 3 | use bevy::pbr::DirectionalLightShadowMap; 4 | use bevy::prelude::*; 5 | use crate::visual_objects::{Rocket3DObject, spawn_all_entities}; 6 | use std::thread; 7 | use std::sync::mpsc::channel; 8 | 9 | 10 | mod simulation; 11 | mod visual_objects; 12 | mod cone; 13 | 14 | fn main() { 15 | let (tx, rx) = channel::(); 16 | 17 | App::new() 18 | .insert_resource(Msaa::Sample8) 19 | .insert_resource(DirectionalLightShadowMap { size: 4096 }) 20 | .add_plugins(DefaultPlugins) 21 | .add_systems(Startup, setup) 22 | .add_systems(Update, update) 23 | .run(); 24 | } 25 | 26 | fn setup( 27 | mut commands: Commands, 28 | mut meshes: ResMut>, 29 | mut materials: ResMut>, 30 | ) { 31 | commands.insert_resource(AmbientLight { 32 | color: Color::WHITE, 33 | brightness: 0.1, 34 | }); 35 | 36 | commands.spawn(PointLightBundle { 37 | point_light: PointLight { 38 | intensity: 1800.0, 39 | radius: 0.1, 40 | shadows_enabled: true, 41 | ..default() 42 | }, 43 | transform: Transform::from_xyz(6.0, 2.0, 10.0), 44 | ..default() 45 | }); 46 | 47 | commands.spawn(PointLightBundle { 48 | point_light: PointLight { 49 | intensity: 1100.0, 50 | radius: 0.1, 51 | shadows_enabled: true, 52 | ..default() 53 | }, 54 | transform: Transform::from_xyz(-6.0, 1.0, 10.0), 55 | ..default() 56 | }); 57 | 58 | 59 | commands.spawn((Camera3dBundle { 60 | camera: Camera { 61 | hdr: true, // 1. HDR is required for bloom 62 | ..default() 63 | }, 64 | tonemapping: Tonemapping::TonyMcMapface, 65 | transform: Transform::from_xyz(3.0, -9.0, 5.0) //(16.0, -32.0, 15.5) 66 | .looking_at(Vec3::new(0.0, 0.0, 3.0), Vec3::Z), 67 | ..default() 68 | }, BloomSettings{ 69 | intensity: 0.15, 70 | // low_frequency_boost: 1.0, 71 | // low_frequency_boost_curvature:1.0, 72 | //composite_mode: Additive, 73 | ..default() 74 | })); 75 | 76 | spawn_all_entities( 77 | &mut commands, &mut meshes, &mut materials, 78 | ); 79 | } 80 | 81 | pub fn update( 82 | time: Res