[
  {
    "path": ".gitattributes",
    "content": "# Auto detect text files and perform LF normalization\n* text=auto\n"
  },
  {
    "path": ".gitignore",
    "content": "# C++ objects and libs\n*.slo\n*.lo\n*.o\n*.a\n*.la\n*.lai\n*.so\n*.so.*\n*.dll\n*.dylib\n\n# Qt-es\nobject_script.*.Release\nobject_script.*.Debug\n*_plugin_import.cpp\n/.qmake.cache\n/.qmake.stash\n*.pro.user\n*.pro.user.*\n*.qbs.user\n*.qbs.user.*\n*.moc\nmoc_*.cpp\nmoc_*.h\nqrc_*.cpp\nui_*.h\n*.qmlc\n*.jsc\nMakefile*\n*build-*\n*.qm\n*.prl\n\n# Qt unit tests\ntarget_wrapper.*\n\n# QtCreator\n*.autosave\n\n# QtCreator Qml\n*.qmlproject.user\n*.qmlproject.user.*\n\n# QtCreator CMake\nCMakeLists.txt.user*\n\n# QtCreator 4.8< compilation database \ncompile_commands.json\n\n# QtCreator local machine specific files for imported projects\n*creator.user*\n\n# OS-specific files\n.DS_Store\n*.DS_Store\n\n# Custom\n.DS_Store\nassets/.DS_Store\nassets/icon/.DS_Store\n"
  },
  {
    "path": "LICENSE",
    "content": "GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "OctoBTT.pro",
    "content": "QT += core gui svg\n#QT += multimedia\n#QT += multimediawidgets\nQT += network websockets\n#QT += multimedia\n#QT += script\n#QT += webenginewidgets\n\ngreaterThan(QT_MAJOR_VERSION, 4): QT += widgets\n\nCONFIG += c++11\nCONFIG += lang-zh_CN\nCONFIG += console\n\n# The following define makes your compiler emit warnings if you use\n# any Qt feature that has been marked deprecated (the exact warnings\n# depend on your compiler). Please consult the documentation of the\n# deprecated API in order to know how to port your code away from it.\nDEFINES += QT_DEPRECATED_WARNINGS\n\nVERSION = 2.0.0\nQMAKE_TARGET_COMPANY = BigtreeTech\nQMAKE_TARGET_PRODUCT = OctoBTT\nQMAKE_TARGET_COPYRIGHT = Copyright(C) 2020 By BigtreeTech\nQMAKE_TARGET_DESCRIPTION = First suggested for OctoPi\n\n\n# You can also make your code fail to compile if it uses deprecated APIs.\n# In order to do so, uncomment the following line.\n# You can also select to disable deprecated APIs only up to a certain version of Qt.\n#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0\n\nSOURCES += \\\n    accesscontrol.cpp \\\n    cameradialog.cpp \\\n    configuration.cpp \\\n    controlpanel.cpp \\\n    customdialog.cpp \\\n    filedialog.cpp \\\n    gcodedialog.cpp \\\n    inputdialog.cpp \\\n    liblog.cpp \\\n    main.cpp \\\n    mainwindow.cpp \\\n    materialctrlpanel.cpp \\\n    mylineedit.cpp \\\n    octonetwork.cpp \\\n    terminaldialog.cpp \\\n#    webdialog.cpp \\\n    wlanconfig.cpp\n\nHEADERS += \\\n    accesscontrol.h \\\n    cameradialog.h \\\n    configuration.h \\\n    controlpanel.h \\\n    customdialog.h \\\n    filedialog.h \\\n    gcodedialog.h \\\n    inputdialog.h \\\n    liblog.h \\\n    mainwindow.h \\\n    materialctrlpanel.h \\\n    mylineedit.h \\\n    octonetwork.h \\\n    terminaldialog.h \\\n#    webdialog.h \\\n    wlanconfig.h\n\nFORMS += \\\n    cameradialog.ui \\\n    configuration.ui \\\n    controlpanel.ui \\\n    filedialog.ui \\\n    gcodedialog.ui \\\n    inputdialog.ui \\\n    mainwindow.ui \\\n    materialctrlpanel.ui \\\n    terminaldialog.ui \\\n#    webdialog.ui \\\n    wlanconfig.ui\n\nTRANSLATIONS += \\\n    OctoBTT_zh_CN.ts\n\n# Default rules for deployment.\nqnx: target.path = /tmp/$${TARGET}/bin\nelse: unix:!android: target.path = /opt/$${TARGET}/bin\n!isEmpty(target.path): INSTALLS += target\n\nRESOURCES += \\\n    assets.qrc\n\nDISTFILES += \\\n    start.sh \\\n    wav/KBClick.wav\n"
  },
  {
    "path": "OctoBTT.sudoers.d",
    "content": "pi ALL=(ALL) NOPASSWD: /sbin/iwlist, /sbin/wpa_cli, /sbin/iwconfig, /sbins/ifconfig\n"
  },
  {
    "path": "OctoBTT_zh_CN.ts",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE TS>\n<TS version=\"2.1\" language=\"OctoBTT_zh_CN\"></TS>\n"
  },
  {
    "path": "README.md",
    "content": "# OctoBTT\n\n![OctoBTT](assets/icon/BTT_Duck.svg \"OctoBTT\")\n\n## Introduce\n* A UI that matches OctoPrint printer\n\n## Software architecture\n* Client and server architecture solution\n* OctoPi -> OctoPrint service -> Printer\n\n## Install the tutorial\n\n### One-click installation based on image mode\n### [OctoPi-0.17.0 with OctoBTT](https://drive.google.com/file/d/1pR2fpxu22XdM08EMIsEXZj7D5zPRO70z/view?usp=sharing)\n\n### Manual installation based on source code\n> (The update and upgrade operations are not redundant)\n### 1.  Install OctoPrint(direct use of OctoPi is recommended , Up to [Octopi 0.17](https://drive.google.com/file/d/1F3xRiC6GXkHNvPAKEho4P9ylevF9G_HR/view?usp=sharing) is supported, and you need to go to OctoprInt's Web page to complete the initialization, need to be disable access control)-- (install under directory)\n### [OctoPi-0.17.0](https://drive.google.com/file/d/1F3xRiC6GXkHNvPAKEho4P9ylevF9G_HR/view?usp=sharing)\n\n![Flash](IMG/Ready/Flash.png \"Flash\")\n\n* You can create a WPA profile in the boot directory **boot/wpa_supplicant.txt** to add WiFi connections\n![ConfigWPA](IMG/Ready/ConfigWPA.png \"ConfigWPA\")\n\n* If you are a BX machine model user, you will need to add the following fragment lines to the RaspberryPi **boot/config.txt** file to display them correctly on screen:\n> * max_usb_current=1\n> * hdmi_group=2\n> * hdmi_mode=87\n> * hdmi_cvt 1024 600 60\n> * hdmi_drive=1\n\n![ConfigDisplayMode](IMG/Ready/ConfigDisplayMode.jpg \"ConfigDisplayMode\")\n\n* SSH your PI on your computer for further action\n> After Pi boot you can get the IP address of Pi from the screen\n![RaspiShowIP](IMG/Login/RaspiShowIP.jpeg \"RaspiShowIP\")\n\n> If you connect with console\n![ConfigConsole](IMG/Login/ConfigConsole.png \"ConfigConsole\")\n\n![ConsoleShow](IMG/Login/ConsoleShow.png \"ConsoleShow\")\n> If you connect with terminal\n\n![ConfigTermius](IMG/Login/ConfigTermius.jpeg \"ConfigTermius\")\n\n![TermiusShow](IMG/Login/TermiusShow.jpeg \"TermiusShow\")\n\n### 2. Install OctoBTT : \n> Run Command (Installation):\n* rm -f startup.sh ; wget --no-check-certificate https://raw.githubusercontent.com/bigtreetech/OctoBTT/master/startup.sh && sudo /bin/sh startup.sh\n\n<!-- > Run Command (Upgrade):\n* rm -f upgrade.sh ; wget --no-check-certificate https://raw.githubusercontent.com/bigtreetech/OctoBTT/master/upgrade.sh && sudo /bin/sh upgrade.sh -->\n\n<!-- > Contact Email: developer01@biqu3d.com -->\n\n![InstallOctoBTT.png](IMG/2_InstallOctoBTT.png \"InstallOctoBTT\")\n\n### 3. OctoBTT is entered automatically after you wait for the auto setup to complete and then restart\n![Show](IMG/Show.png \"Show\")\n\n## Instructions for use\n\n> 1.  Used with OctoPrint\n\n![Show](IMG/All.png \"Show\")\n\n## Notes\n> 1. Because the serial port delay is long, the background has blocked the serial port connection, we only use the USB automatic connection\n\n> 2. It is recommended to run with Marlin firmware. Currently there may be some unknown problems due to non-marlin firmware\n\n> 3. If you want to use octoprint online , you can use the network cable to connect to the router.\n\n## Contribute\n\n> 1. Fork the repository\n> 2. New Feat_ XXX branch\n> 3. Submit code\n> 4. New Pull Request\n"
  },
  {
    "path": "StyleSheet/globalStyleSheet.qss",
    "content": "﻿/*1.0.0*/\n\n/*\n=================================\n上述为版本号，如您自己更换了新的样式表，\n请将版本号首位改为0，例如：0.5.6\n=================================\n*/\n\n/*\n============================================\nThe above is the version number.\nIf you change the new style sheet yourself,\nchange the first part of the version\nnumber to 0, for example: 0.5.6\n============================================\n*/\n\nQWidget\n{\n    background-color:rgb(25, 25, 25);\n}\n\n\n\n/*按钮静止无操作样式*/\nQPushButton[whatsThis=\"BTStyleSheet\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 5px;\n    border-radius: 20px;\n    border-color: rgb(255, 0, 0);\n    color: rgb(245, 246, 250);\n}\n\n/*鼠标悬停在按钮样式*/\nQPushButton:hover[whatsThis=\"BTStyleSheet\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 5px;\n    border-radius: 20px;\n    border-color: rgb(0, 255, 0);\n    background-color: rgba(128, 128, 128, 25%);\n    color: rgb(245, 246, 250);\n}\n\n/*鼠标按下按钮样式*/\nQPushButton:pressed[whatsThis=\"BTStyleSheet\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 5px;\n    border-radius: 20px;\n    border-color: rgb(0, 255, 0);\n    background-color: rgba(128, 128, 128, 25%);\n    color: rgb(245, 246, 250);\n    padding-right:4px;\n    padding-bottom:4px;\n}\n\n\n/*按钮静止无操作样式*/\nQPushButton[whatsThis=\"BTStyleSheet1\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 5px;\n    border-radius: 20px;\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标悬停在按钮样式*/\nQPushButton:hover[whatsThis=\"BTStyleSheet1\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 5px;\n    border-radius: 20px;\n    background-color:rgb(128, 128, 128, 25%);\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标按下按钮样式*/\nQPushButton:pressed[whatsThis=\"BTStyleSheet1\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 5px;\n    border-radius: 20px;\n    background-color:rgba(128, 128, 128, 25%);\n    color: rgb(245, 246, 255);\n    padding-right:4px;\n    padding-bottom:4px;\n}\n\n\n/*按钮静止无操作样式*/\nQPushButton[whatsThis=\"BTStyleSheet2\"] \n{\n    border:none;\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标悬停在按钮样式*/\nQPushButton:hover[whatsThis=\"BTStyleSheet2\"] \n{\n    border:none;\n    background-color:rgba(128, 128, 128, 25%);\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标按下按钮样式*/\nQPushButton:pressed[whatsThis=\"BTStyleSheet2\"] \n{\n    border:none;\n    background-color:rgba(128, 128, 128, 25%);\n    padding-left:4px; padding-top:4px;\n    color: rgb(245, 246, 255); \n}\n\n/*按钮静止无操作样式*/\nQPushButton[whatsThis=\"BTStyleSheet3\"] \n{\n    border:none;\n    font: 75 30pt Gill Sans MT;\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标悬停在按钮样式*/\nQPushButton:hover[whatsThis=\"BTStyleSheet3\"] \n{\n    border:none;\n    background-color: rgba(128, 128, 128, 25%);\n    font: 75 30pt Gill Sans MT;\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标按下按钮样式*/\nQPushButton:pressed[whatsThis=\"BTStyleSheet3\"] \n{\n    border:none;\n    background-color: rgba(128, 128, 128, 25%);\n    font: 75 30pt Gill Sans MT;\n    color: rgb(245, 246, 255);\n    padding-left:4px;\n    padding-top:4px;\n}\n\n\n/*按钮静止无操作样式*/\nQPushButton[whatsThis=\"BTStyleSheet4\"] \n{\n    border:none;\n}\n\n/*鼠标悬停在按钮样式*/\nQPushButton:hover[whatsThis=\"BTStyleSheet4\"] \n{\n    border:none;\n    background-color: rgba(128, 128, 128, 25%);\n}\n\n/*鼠标按下按钮样式*/\nQPushButton:pressed[whatsThis=\"BTStyleSheet4\"] \n{\n    border:none;\n    background-color: rgba(128, 128, 128, 25%);\n    padding-left:4px;\n    padding-top:4px;\n}\n\n\n/*按钮静止无操作样式*/\nQPushButton[whatsThis=\"BTStyleSheet5\"] \n{\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标悬停在按钮样式*/\nQPushButton:hover[whatsThis=\"BTStyleSheet5\"] \n{\n    background-color:rgba(128, 128, 128, 25%);\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标按下按钮样式*/\nQPushButton:pressed[whatsThis=\"BTStyleSheet5\"] \n{\n    background-color:rgba(128, 128, 128, 25%);\n    padding-left:4px; padding-top:4px; \n    color: rgb(245, 246, 255);\n}\n\n\n/*按钮静止无操作样式*/\nQPushButton[whatsThis=\"BTStyleSheet6\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 1px;border-radius: 20px;\n    border-color: rgb(245, 246, 255);\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标悬停在按钮样式*/\nQPushButton:hover[whatsThis=\"BTStyleSheet6\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 1px;\n    border-radius: 20px;border-color: rgb(245,246,255); \n    background-color:rgba(128, 128, 128, 25%);\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标按下按钮样式*/\nQPushButton:pressed[whatsThis=\"BTStyleSheet6\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 1px;border-radius: 20px;\n    border-color: rgb(245,246,255); \n    background-color:rgb(128, 128, 128, 25%);\n    color: rgb(245, 246, 255);padding-right:4px;\n    padding-bottom:4px;\n}\n\n/*按钮静止无操作样式*/\nQPushButton[whatsThis=\"BTStyleSheet7\"] \n{\n    background-color: rgb(0, 0, 0); \n    color: rgb(255, 255, 10);\n}\n\n/*鼠标悬停在按钮样式*/\nQPushButton:hover[whatsThis=\"BTStyleSheet7\"] \n{\n    color: rgb(255, 255, 10); \n    background-color: rgba(128, 128, 128, 25%);\n}\n\n/*鼠标按下按钮样式*/\nQPushButton:pressed[whatsThis=\"BTStyleSheet7\"] \n{\n    color: rgb(255, 255, 10); \n    background-color: rgba(128, 128, 128, 25%);\n    padding-left:4px;padding-top:4px;\n}\n\n\n/*按钮静止无操作样式*/\nQToolButton[whatsThis=\"BTStyleSheet8\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 2px;border-radius: 20px;\n    border-color: rgb(245, 246, 255);\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标悬停在按钮样式*/\nQToolButton:hover[whatsThis=\"BTStyleSheet8\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 2px;border-radius: 20px;\n    background-color:rgba(128, 128, 128, 25%);\n    color: rgb(245, 246, 255);\n}\n\n/*鼠标按下按钮样式*/\nQToolButton:pressed[whatsThis=\"BTStyleSheet8\"] \n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 2px;\n    border-radius: 20px;\n    background-color:rgba(128, 128, 128, 25%);\n    color: rgb(245, 246, 255); \n    padding-right:4px;\n    padding-bottom:4px;\n}\n\n/*按钮静止无操作样式*/\nQToolButton[whatsThis=\"BTStyleSheet9\"]\n{\n    border:none;\n    font: 20pt \"Gill Sans Ultra Bold Condensed\";\n    color: rgb(245, 246, 250);\n}\n\n/*鼠标悬停在按钮样式*/\nQToolButton:hover[whatsThis=\"BTStyleSheet9\"]\n{\n    border:none;\n    background-color: rgba(128, 128, 128, 25%);\n    font: 20pt \"Gill Sans Ultra Bold Condensed\";\n    color: rgb(245, 246, 250);\n}\n\n/*鼠标按下按钮样式*/\nQToolButton:pressed[whatsThis=\"BTStyleSheet9\"]\n{\n    border:none;\n    background-color: rgba(128, 128, 128, 25%);\n    padding-left:4px;\n    padding-top:4px;\n    font: 20pt \"Gill Sans Ultra Bold Condensed\";\n    color: rgb(245, 246, 250);\n}\n\n/*按钮静止无操作样式*/\nQPushButton[whatsThis=\"BTStyleSheet10\"]\n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 2px;\n    border-radius: 20px;\n    border: rgba(60, 255, 138, 25%);\n}\n\n/*鼠标悬停在按钮样式*/\nQPushButton:hover[whatsThis=\"BTStyleSheet10\"]\n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 2px;\n    border-radius: 20px;\n    border: rgba(60, 255, 138, 25%);\n    background-color:rgba(128, 128, 128, 25%);\n}\n\n/*鼠标按下按钮样式*/\nQPushButton:pressed[whatsThis=\"BTStyleSheet10\"]\n{\n    padding: 10px;\n    border-style: solid;\n    border-width: 2px;\n    border-radius: 20px;\n    border: rgba(60, 255, 138, 25%);\n    background-color:rgba(128, 128, 128, 25%);\n    padding-right:4px;\n    padding-bottom:4px;\n}\n\n\n\n/*滑动条样式表*/\nQScrollBar:vertical\n{\n    width:40px;\n    background:rgba(0,128,255,0%);\n    margin:0px,0px,0px,0px;\n    padding-top:40px;\n    padding-bottom:40px;\n}\n\nQScrollBar::handle:vertical\n{\n    width:40px;\n    background:rgba(0,128,255,25%);\n    border-radius:10px;\n    min-height:40;\n}\n\nQScrollBar::handle:vertical:hover\n{\n    width:40px;\n    background:rgba(0,128,255,50%);\n    border-radius:10px;\n    min-height:40;\n}\n\nQScrollBar::add-page:vertical,QScrollBar::sub-page:vertical\n{\n    background:rgba(0,128,255,10%);\n    border-radius:0px;\n}\n\n\nQScrollBar:horizontal\n{\n    height:40px;\n    background:rgba(0,128,255,0%);\n    margin:0px,0px,0px,0px;\n    padding-left:40px;\n    padding-right:40px;\n}\n\nQScrollBar::handle:horizontal\n{\n    height:40x;\n    background:rgba(0,128,255,25%);\n    border-radius:10px;\n    min-width:40;\n}\n\nQScrollBar::handle:horizontal:hover\n{\n    height:40px;\n    background:rgba(0,128,255,50%);\n    border-radius:10px;\n    min-width:40;\n}\n\nQScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal\n{\n    background:rgba(0,128,255,10%);\n    border-radius:0px;\n}\n\n/* 未下拉时，QComboBox的样式 */\nQComboBox {\n    border: none;\n}\n\nQComboBox::showPopup QAbstractItemView\n{\n    outline: 0px solid gray;   /* 选定项的虚框 */\n    color: rgb(255, 255, 255);   /* 整个下拉窗体被选中项的背景色 */\n    background-color: rgb(128, 128, 128);   /* 整个下拉窗体的背景色 */\n    selection-background-color: rgb(64, 64, 192);   /* 整个下拉窗体被选中项的背景色 */\n    selection-color: rgb(0, 0, 0);   /* 整个下拉窗体被选中项的背景色 */\n}\n"
  },
  {
    "path": "accesscontrol.cpp",
    "content": "﻿#include \"accesscontrol.h\"\n//#include \"octonetwork.h\"//Global prama\n#include <QJsonDocument>\n#include <QJsonObject>\n#include <QNetworkReply>\n#include <QJsonArray>\n//#include <filedialog.h>\n//#include <mainwindow.h>\n\nAccessControl::AccessControl()\n{\n//    GetACRequest.setUrl(QUrl(MainUrl));//http://IP/api/login\n    GetACRequest.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n}\n\n//login\nvoid AccessControl::acLogin()\n{\n    if(userinfo.uid == NULL || userinfo.uid.trimmed() == \"\" || userinfo.pwd == NULL)\n    {\n        emit CommunicationStateChange(false);\n        return;\n    }\n    GetACRequest.setUrl(QUrl(MainUrl + \"login\"));//http://IP/api/login\n    QJsonObject TemperatureJsonObj;\n\n//    {\n//        \"user\": \"uid\",\n//        \"pass\": \"pwd\",\n//        \"remember\": \"remember me\"\n//    }\n    TemperatureJsonObj.insert(\"user\",userinfo.uid);\n    TemperatureJsonObj.insert(\"pass\",userinfo.pwd);\n    TemperatureJsonObj.insert(\"remember\",\"remember me\");\n    TemperatureJsonObj.insert(\"passive\",true);//被动模式登录，如果免登录依旧能够获取session///需要允许被动登录才可以获得免登录方式\n    QJsonDocument _SenderJson;\n    _SenderJson.setObject(TemperatureJsonObj);\n\n    ACManager->disconnect(SIGNAL(finished(QNetworkReply*)));\n    connect(ACManager,&QNetworkAccessManager::finished,this,&AccessControl::LoginReply);\n\n    ACManager->post(GetACRequest,_SenderJson.toJson());\n}\n\nvoid AccessControl::LoginReply(QNetworkReply *reply)\n{\n    bool _return=false;\n//    ACManager->disconnect(SIGNAL(finished(QNetworkReply*)));\n    if(reply->error() == QNetworkReply::NoError)\n    {\n        int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();\n        if(statusCode == 200)//Have receive\n        {\n//            userinfo.login = true;\n            //创建接收对象\n            QByteArray replyArray = reply->readAll();\n            QJsonDocument loadDoc(QJsonDocument::fromJson(replyArray));\n            QJsonObject QObj = loadDoc.object();\n            //获取登录反馈内容\n            QList<QJsonValue> result = SearchJsonValue(LoginMsg , QObj);//{{\"active\"},{\"admin\"},{\"apikey\"},{\"name\"},{\"session\"}};\n            userinfo.login = result[0].toBool();\n            userinfo.admin = result[1].toBool();\n            userinfo.API_Key = result[2].toString().toUtf8();\n            userinfo.onlineUid = result[3].toString();\n            userinfo.session = result[4].toString().toUtf8();\n            _return = true;\n        }\n    }\n    ACManager->disconnect(SIGNAL(finished(QNetworkReply*)));\n    emit CommunicationStateChange(_return);\n}\n\n//logout\nvoid AccessControl::acLogout()\n{\n    GetACRequest.setUrl(QUrl(MainUrl + \"logout\"));//http://IP/api/logout\n    ACManager->disconnect(SIGNAL(finished(QNetworkReply*)));\n    connect(ACManager,&QNetworkAccessManager::finished,this,&AccessControl::LogoutReply);\n}\n\nvoid AccessControl::LogoutReply(QNetworkReply *reply)\n{\n    bool _return=false;\n    if(reply->error() == QNetworkReply::NoError)\n    {\n        int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();\n        if(statusCode == 200)//Have receive\n        {\n            //重置登录参数\n            userinfo = UserInfo(userinfo.uid,userinfo.pwd);\n            //创建接收对象\n            QByteArray replyArray = reply->readAll();\n            QJsonDocument loadDoc(QJsonDocument::fromJson(replyArray));\n            QJsonObject QObj = loadDoc.object();\n//            QList<QString> SearchLink ;\n            //获取登录反馈内容\n            QList<QJsonValue> result = SearchJsonValue(LoginMsg , QObj);//{{\"active\"},{\"admin\"},{\"apikey\"},{\"name\"},{\"session\"}};///被动账户执行退出登录才会返回账户信息\n            if(!result[3].isNull() && result[3].isString() && result[3].toString() == \"_admin\")\n            {\n                userinfo.login = result[0].toBool();\n                userinfo.admin = result[1].toBool();\n                userinfo.onlineUid = result[3].toString();//判定免登录账户:_admin\n            }\n            _return = true;\n        }\n    }\n    ACManager->disconnect(SIGNAL(finished(QNetworkReply*)));\n    emit CommunicationStateChange(_return);\n}\n\n//Function\n//Find_List_Name : Retrieved List Sequence --> [Grandma,Mother,Me]\n//_QObj:Retrieved Retrieved Json Objecet\nQJsonValue AccessControl::SearchJsonValue(QList<QString> Find_List_Name , QJsonObject _QObj)\n{\n    QJsonValue returnValue;\n    QList<QString> SearchLink ;\n    SearchLink << Find_List_Name;\n    if(SearchLink.count() > 1)\n    {\n        QString MotherKey = SearchLink[0];\n        SearchLink.removeFirst();\n        if(MotherKey.indexOf(\"*\") >= 0)//wildcard\n        {\n            QJsonArray ArrayValue;\n            for(int i = 0 ; i <= 9 ; i++)\n            {\n                QString TempMotherKey = MotherKey;\n                if(_QObj.find(TempMotherKey.replace(\"*\",QString::number(i))).value().isUndefined())continue;\n                //                if(QSysInfo::productType() != \"raspbian\"){qDebug()<<_QObj.find(TempMotherKey.replace(\"*\",QString::number(i))).value().isUndefined();};\n                QJsonValue data = SearchJsonValue(SearchLink , _QObj.constFind(TempMotherKey.replace(\"*\",QString::number(i))).value().toObject());\n                ArrayValue.append(data);\n            }\n            returnValue = ArrayValue;\n        }\n        else\n            returnValue = SearchJsonValue(SearchLink , _QObj.constFind(MotherKey).value().toObject());\n    }\n    else\n    {\n        if(SearchLink[0].indexOf(\"*\") >= 0)//wildcard\n        {\n\n        }\n        else\n            returnValue = _QObj.constFind(SearchLink[0]).value();\n    }\n    return returnValue;\n}\nQList<QJsonValue> AccessControl::SearchJsonValue(QList<QList<QString>> Find_List_Names , QJsonObject _QObj)\n{\n    QList<QJsonValue> _returnValue ;\n    foreach(QList<QString> item , Find_List_Names)\n    {\n        _returnValue.append(SearchJsonValue(item,_QObj));\n    }\n    return _returnValue;\n}\n"
  },
  {
    "path": "accesscontrol.h",
    "content": "﻿#ifndef ACCESSCONTROL_H\n#define ACCESSCONTROL_H\n\n#include <QJsonDocument>\n#include <QJsonObject>\n#include <QMetaType>\n\n#include <QNetworkReply>\n\nstruct UserInfo{\n    QString uid;//用户设置登录账号\n    QString onlineUid;//当前登录账号\n    QString pwd;//账户密码\n    bool admin;//{\"admin\"}//判断权限是否充足，仅仅高级账户才能运行UI运作\n    bool login;//{\"active\"}//登录失败403拒绝访问，布尔值归位默认false\n    QByteArray API_Key;//{\"apikey\"}//如果没设置就不存在，引用全局Key\n    QByteArray session;//{\"session\"}//每次登录成功会获得新的对话ID，不区分超级账户和用户账户///为websocket提供接入ID\n    UserInfo(QString _uid = NULL , QString _pwd = NULL)\n    {\n        if(_uid != NULL && _pwd != NULL)\n        {\n            uid = _uid;\n            pwd = _pwd;\n        }\n        admin = false;\n        login = false;\n        API_Key = \"\";\n        session = \"\";\n    }\n};\nQ_DECLARE_METATYPE(UserInfo);\n\nclass AccessControl: public QObject\n{\n    Q_OBJECT\npublic:\n    AccessControl();\n    QNetworkAccessManager *ACManager = new QNetworkAccessManager();\n    QNetworkRequest GetACRequest;\n\n    void acLogin();\n    void acLogout();\n    UserInfo userinfo = UserInfo();\n//    QByteArray user_X_API_Key = \"\";\nsignals:\n    void CommunicationStateChange(bool);\nprivate:\n//    QWidget *FUI;\n    QString MainIP = \"127.0.0.1\";\n    QString MainAddress = \"http://\"+MainIP+\"/\";\n    QString MainUrl = MainAddress + \"api/\";\n\n    QJsonValue SearchJsonValue(QList<QString> Find_List_Name , QJsonObject _QObj);\n    QList<QJsonValue> SearchJsonValue(QList<QList<QString>> Find_List_Names , QJsonObject _QObj);\n\n    const QList<QList<QString>> LoginMsg = {{\"active\"},{\"admin\"},{\"apikey\"},{\"name\"},{\"session\"}};\n\nprivate slots:\n    void LoginReply(QNetworkReply *reply);\n    void LogoutReply(QNetworkReply *reply);\n};\n\n#endif // ACCESSCONTROL_H\n"
  },
  {
    "path": "assets.qrc",
    "content": "﻿<RCC>\n    <qresource prefix=\"/\">\n        <file>assets/adjust.svg</file>\n        <file>assets/back.svg</file>\n        <file>assets/cancel.svg</file>\n        <file>assets/checkmark.svg</file>\n        <file>assets/confirm.svg</file>\n        <file>assets/control.svg</file>\n        <file>assets/delete.svg</file>\n        <file>assets/error.svg</file>\n        <file>assets/fan.svg</file>\n        <file>assets/filament.svg</file>\n        <file>assets/folder.svg</file>\n        <file>assets/heat-bed.svg</file>\n        <file>assets/help.svg</file>\n        <file>assets/invalid-config.svg</file>\n        <file>assets/next.svg</file>\n        <file>assets/nozzle.svg</file>\n        <file>assets/object.svg</file>\n        <file>assets/pause.svg</file>\n        <file>assets/print.svg</file>\n        <file>assets/resume.svg</file>\n        <file>assets/settings.svg</file>\n        <file>assets/sort.svg</file>\n        <file>assets/thermometer.svg</file>\n        <file>assets/upload.svg</file>\n        <file>assets/sync-alt.svg</file>\n        <file>assets/arrow_down.svg</file>\n        <file>assets/arrow_up.svg</file>\n        <file>assets/camera.svg</file>\n        <file>assets/daochu.svg</file>\n        <file>assets/daoru.svg</file>\n        <file>assets/emoji.svg</file>\n        <file>assets/guanji.svg</file>\n        <file>assets/info.svg</file>\n        <file>assets/more.svg</file>\n        <file>assets/off.svg</file>\n        <file>assets/rizhi.svg</file>\n        <file>assets/setting.svg</file>\n        <file>assets/shanchu.svg</file>\n        <file>assets/shangchuan.svg</file>\n        <file>assets/shezhi.svg</file>\n        <file>assets/shuaxin.svg</file>\n        <file>assets/video.svg</file>\n        <file>assets/xiazai.svg</file>\n        <file>assets/xinzeng.svg</file>\n        <file>assets/yuanchengkongzhi.svg</file>\n        <file>assets/zhongqi.svg</file>\n        <file>assets/chupeng.svg</file>\n        <file>assets/re.svg</file>\n        <file>assets/Wifi.svg</file>\n        <file>assets/penzui.svg</file>\n        <file>assets/heat.svg</file>\n        <file>assets/Network.svg</file>\n        <file>assets/heat-gas.svg</file>\n        <file>assets/nib.svg</file>\n        <file>assets/icon/icon-main-btt.svg</file>\n        <file>assets/icon/icon-main-btt-blue.svg</file>\n        <file>assets/3ddayin.svg</file>\n        <file>assets/Ddayin.svg</file>\n        <file>assets/huidaoyuandian.svg</file>\n        <file>assets/kongzhiqi_fengji.svg</file>\n        <file>assets/sanweidianyunsaomiao.svg</file>\n        <file>assets/sanweizuobiao.svg</file>\n        <file>assets/shanchuwenjian.svg</file>\n        <file>assets/shangchuanwenjian.svg</file>\n        <file>assets/wenjian.svg</file>\n        <file>assets/xiazaiwenjian.svg</file>\n        <file>assets/xitongpeizhi.svg</file>\n        <file>assets/yuandian.svg</file>\n        <file>assets/zhouxiang.svg</file>\n        <file>assets/haocaiguanli.svg</file>\n        <file>assets/jinggao.svg</file>\n        <file>assets/icon/BTT_Duck.svg</file>\n        <file>assets/dangxinjixieshangren.svg</file>\n        <file>assets/jixiezhizao.svg</file>\n        <file>assets/shebeiweilianjie-copy.svg</file>\n        <file>assets/fanhuiyemian.svg</file>\n        <file>assets/hazard.svg</file>\n        <file>assets/huijia.svg</file>\n        <file>assets/icon_liangchi.svg</file>\n        <file>assets/jiareqi.svg</file>\n        <file>assets/shuangdong.svg</file>\n        <file>assets/zhongzhi.svg</file>\n        <file>assets/kongzhimianban.svg</file>\n        <file>assets/kongzhimianban_B.svg</file>\n        <file>assets/kongzhimianban_L.svg</file>\n        <file>assets/kongzhimianban_W.svg</file>\n        <file>assets/xiangxiaji.svg</file>\n        <file>assets/jiare.svg</file>\n        <file>assets/huitui.svg</file>\n        <file>assets/shang.svg</file>\n        <file>assets/shangsheng.svg</file>\n        <file>assets/xia.svg</file>\n        <file>assets/xiajiang.svg</file>\n        <file>assets/you.svg</file>\n        <file>assets/yuandian_W.svg</file>\n        <file>assets/zuo.svg</file>\n        <file>assets/shangxiajuzhong.svg</file>\n        <file>assets/zuoyoujuzhong.svg</file>\n        <file>assets/chuizhijuzhong.svg</file>\n        <file>assets/youshang.svg</file>\n        <file>assets/zuoxia.svg</file>\n        <file>assets/tingzhi.svg</file>\n        <file>assets/hold__easyico.svg</file>\n        <file>assets/jiesuo.svg</file>\n        <file>assets/terminal.svg</file>\n        <file>assets/usb.svg</file>\n        <file>assets/queren.svg</file>\n        <file>assets/wangluo.svg</file>\n        <file>assets/wangluolianjiechaoshi.svg</file>\n        <file>assets/Wifi_Lock.svg</file>\n        <file>assets/Wifi_Unlock.svg</file>\n        <file>assets/WiFi2.svg</file>\n        <file>assets/kongzhimianban2.svg</file>\n        <file>assets/xiangji.svg</file>\n        <file>assets/yuanchengkongzhi2.svg</file>\n        <file>assets/terminal-box-line.svg</file>\n        <file>assets/ceshi.gif</file>\n        <file>assets/start.svg</file>\n        <file>assets/stop.svg</file>\n        <file>assets/flip-2.svg</file>\n        <file>assets/flip.svg</file>\n        <file>assets/webside.svg</file>\n        <file>assets/webside2.svg</file>\n        <file>config.conf</file>\n        <file>StyleSheet/globalStyleSheet.qss</file>\n        <file>assets/kongge.svg</file>\n        <file>assets/deleteBtn.svg</file>\n        <file>assets/icon/BingoTouch_Logo_H.svg</file>\n    </qresource>\n</RCC>\n"
  },
  {
    "path": "cameradialog.cpp",
    "content": "#include \"cameradialog.h\"\n#include \"ui_cameradialog.h\"\n#include <mainwindow.h>\n//#include <QSizeF>\n\n//#include \"QList\"\n//#include \"QCamera\"\n//#include \"QCameraInfo\"\n\n\n\nCameraDialog::CameraDialog(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::CameraDialog)\n{\n    ui->setupUi(this);\n\n    FUI = (MainWindow*)parent;\n\n//    QList<QCameraInfo> list;\n//    list = QCameraInfo::availableCameras();\n//    ui->Box_CameraId->clear();\n//    for (int i = 0; i < list.size(); i++)\n//    {\n//        ui->Box_CameraId->addItem(list.at(i).description());\n//    }\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n\n    QFont _font = ui->Btn_Sensor->font();\n    _font.setPointSize(this->maximumWidth() > this->maximumHeight() ? (int)this->maximumHeight()/30 : (int)this->maximumWidth()/30);\n     ui->Btn_Sensor->setFont(_font);\n     ui->Btn_FlipH->setFont(_font);\n     ui->Btn_FlipV->setFont(_font);\n\n//     if(ui->Windows->geometry().width() > ui->Windows->geometry().height())\n//         ui->Windows->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Expanding);\n//     else\n//         ui->Windows->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);\n\n    /* 创建一个用于应用程序发送网络请求和接收网络应答的\"管理员\" */\n    manager = new QNetworkAccessManager(this);\n    /* 创建一个要发送的请求实例 */\n    request = new QNetworkRequest(QUrl(((MainWindow*)FUI)->octonetwork.MainAddress +\"/webcam/?action=snapshot\"));\n    request->setRawHeader(\"X_Api_Key\",((MainWindow*)FUI)->octonetwork.X_API_Key);\n\n    ui->Btn_Sensor->setChecked(false);\n}\n\nCameraDialog::~CameraDialog()\n{\n    delete ui;\n}\n\nvoid CameraDialog::showEvent(QShowEvent *event)\n{\n    Q_UNUSED(event);\n    ui->Btn_Sensor->setChecked(true);\n}\n\nvoid CameraDialog::on_Btn_Back_clicked()\n{\n//    ui->Btn_Sensor->setText(\"Start\");\n//    ui->Windows->clear();\n//    /* 解除关联，这样就不显示了 */\n//    disconnect(manager, SIGNAL(finished(QNetworkReply*)), this, NULL);\n    ui->Btn_Sensor->setChecked(false);\n\n    this->close();\n}\n\n/* 实现槽函数 */\nvoid CameraDialog::mjpeg_streamer_reply(QNetworkReply *reply)\n{\n    /* 读出全部数据 */\n    QByteArray byteArr = reply->readAll();\n    //    qDebug() << byteArr;\n\n    /* 构建pixmap */\n    //    QPixmap pixmap;\n    //    pixmap.loadFromData(byteArr);\n    QImage image;\n    image.loadFromData(byteArr);\n    //    QPixmap pixmap = QPixmap::fromImage(mirroredImage);\n\n\n    /* Label显示图像 */\n    ui->Windows->clear();\n    ui->Windows->setPixmap(QPixmap::fromImage(image.mirrored(ui->Btn_FlipH->isChecked(), ui->Btn_FlipV->isChecked())));\n//    ui->Windows->setScaledContents(true);\n    ui->Windows->show();\n    delete(reply);\n\n    /* 继续请求URL */\n    manager->get(*request);\n}\n\nvoid CameraDialog::on_Btn_Sensor_toggled(bool checked)\n{\n    if(checked)\n    {\n        ui->Btn_Sensor->setText(\"Stop\");\n        ui->Btn_Sensor->setIcon(QIcon(\":/assets/stop.svg\"));\n        request->setUrl(QUrl(((MainWindow*)FUI)->octonetwork.MainAddress +\"/webcam/?action=snapshot\"));\n\n        /* 设置\"请求完成\"与mjpeg_streamer_reply()这个槽关联 */\n        connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(mjpeg_streamer_reply(QNetworkReply*)));\n\n        /* 开始请求URL */\n        manager->get(*request);\n    }\n    else\n    {\n        ui->Btn_Sensor->setText(\"Start\");\n\n        ui->Btn_Sensor->setIcon(QIcon(\":/assets/start.svg\"));\n        ui->Windows->clear();\n\n        /* 解除关联，这样就不显示了 */\n        disconnect(manager, SIGNAL(finished(QNetworkReply*)), this, NULL);\n    }\n}\n"
  },
  {
    "path": "cameradialog.h",
    "content": "#ifndef CAMERADIALOG_H\n#define CAMERADIALOG_H\n\n#include <QDialog>\n#include <QSizeF>\n#include <QNetworkReply>\n\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n//#include <QCamera>\n//#include <QCameraImageCapture>\n//#include <QMediaRecorder>\n\nnamespace Ui {\n    class CameraDialog;\n}\n\n//class QCamera;\n//class QCameraViewfinder;\n//class QCameraImageCapture;\nclass CameraDialog : public QDialog\n{\n        Q_OBJECT\n\n    public:\n        explicit CameraDialog(QWidget *parent = nullptr);\n        ~CameraDialog();\n\n    private slots:\n        virtual void on_Btn_Back_clicked();\n\n        void mjpeg_streamer_reply(QNetworkReply *reply);\n\n        void on_Btn_Sensor_toggled(bool checked);\n\n    private:\n        Ui::CameraDialog *ui;\n        QNetworkAccessManager *manager = new QNetworkAccessManager();\n        QNetworkRequest *request;\n        QWidget *FUI;\n    protected:\n        void showEvent(QShowEvent *event);\n};\n\n#endif // CAMERADIALOG_H\n"
  },
  {
    "path": "cameradialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>CameraDialog</class>\n <widget class=\"QDialog\" name=\"CameraDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"font\">\n   <font>\n    <family>.AppleSystemUIFont</family>\n   </font>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Camera</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/xiangji.svg</normaloff>:/assets/xiangji.svg</iconset>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"1,0,7\">\n   <property name=\"spacing\">\n    <number>3</number>\n   </property>\n   <property name=\"leftMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>5</number>\n   </property>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3\">\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Back\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/huitui.svg</normaloff>:/assets/huitui.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_3\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Logo\">\n       <property name=\"styleSheet\">\n        <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\n</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/camera.svg</normaloff>:/assets/camera.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_4\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QLabel\" name=\"label_null\">\n       <property name=\"minimumSize\">\n        <size>\n         <width>76</width>\n         <height>72</height>\n        </size>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <spacer name=\"verticalSpacer\">\n     <property name=\"orientation\">\n      <enum>Qt::Vertical</enum>\n     </property>\n     <property name=\"sizeType\">\n      <enum>QSizePolicy::Fixed</enum>\n     </property>\n     <property name=\"sizeHint\" stdset=\"0\">\n      <size>\n       <width>20</width>\n       <height>2</height>\n      </size>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <layout class=\"QGridLayout\" name=\"gridLayout\" rowstretch=\"0,0\" columnstretch=\"1\">\n     <property name=\"leftMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"topMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"rightMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"bottomMargin\">\n      <number>5</number>\n     </property>\n     <item row=\"0\" column=\"0\">\n      <layout class=\"QHBoxLayout\" name=\"horizontalLayout\" stretch=\"0,4,0,1\">\n       <property name=\"topMargin\">\n        <number>0</number>\n       </property>\n       <item>\n        <spacer name=\"horizontalSpacer\">\n         <property name=\"orientation\">\n          <enum>Qt::Horizontal</enum>\n         </property>\n         <property name=\"sizeType\">\n          <enum>QSizePolicy::Fixed</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>10</width>\n           <height>5</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n       <item>\n        <layout class=\"QGridLayout\" name=\"gridLayout_2\" rowstretch=\"0,0,0\" rowminimumheight=\"0,0,0\">\n         <item row=\"0\" column=\"0\">\n          <spacer name=\"verticalSpacer_3\">\n           <property name=\"orientation\">\n            <enum>Qt::Vertical</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Preferred</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>20</width>\n             <height>5</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item row=\"1\" column=\"0\">\n          <widget class=\"QLabel\" name=\"Windows\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"scaledContents\">\n            <bool>true</bool>\n           </property>\n          </widget>\n         </item>\n         <item row=\"2\" column=\"0\">\n          <spacer name=\"verticalSpacer_4\">\n           <property name=\"orientation\">\n            <enum>Qt::Vertical</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Preferred</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>20</width>\n             <height>5</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <spacer name=\"horizontalSpacer_2\">\n         <property name=\"orientation\">\n          <enum>Qt::Horizontal</enum>\n         </property>\n         <property name=\"sizeType\">\n          <enum>QSizePolicy::Fixed</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>10</width>\n           <height>20</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n       <item>\n        <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\" stretch=\"0,0,0\">\n         <property name=\"spacing\">\n          <number>7</number>\n         </property>\n         <item>\n          <widget class=\"QToolButton\" name=\"Btn_Sensor\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>SimSun</family>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet8</string>\n           </property>\n           <property name=\"text\">\n            <string>Stop</string>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/stop.svg</normaloff>:/assets/stop.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>140</width>\n             <height>80</height>\n            </size>\n           </property>\n           <property name=\"checkable\">\n            <bool>true</bool>\n           </property>\n           <property name=\"checked\">\n            <bool>true</bool>\n           </property>\n           <property name=\"toolButtonStyle\">\n            <enum>Qt::ToolButtonTextUnderIcon</enum>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QToolButton\" name=\"Btn_FlipH\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>SimSun</family>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet8</string>\n           </property>\n           <property name=\"text\">\n            <string>Flip Horizontal</string>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/flip-2.svg</normaloff>:/assets/flip-2.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>140</width>\n             <height>80</height>\n            </size>\n           </property>\n           <property name=\"checkable\">\n            <bool>true</bool>\n           </property>\n           <property name=\"toolButtonStyle\">\n            <enum>Qt::ToolButtonTextUnderIcon</enum>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QToolButton\" name=\"Btn_FlipV\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>SimSun</family>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet8</string>\n           </property>\n           <property name=\"text\">\n            <string>Flip Vertical</string>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/flip.svg</normaloff>:/assets/flip.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>140</width>\n             <height>80</height>\n            </size>\n           </property>\n           <property name=\"checkable\">\n            <bool>true</bool>\n           </property>\n           <property name=\"toolButtonStyle\">\n            <enum>Qt::ToolButtonTextUnderIcon</enum>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </item>\n     <item row=\"1\" column=\"0\">\n      <spacer name=\"verticalSpacer_2\">\n       <property name=\"orientation\">\n        <enum>Qt::Vertical</enum>\n       </property>\n       <property name=\"sizeType\">\n        <enum>QSizePolicy::Fixed</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>20</width>\n         <height>2</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "config.conf",
    "content": "/*1.0.0*/"
  },
  {
    "path": "configuration.cpp",
    "content": "﻿#include \"configuration.h\"\n#include \"ui_configuration.h\"\n#include <mainwindow.h>\n//#include <QSizeF>\n\nConfiguration::Configuration(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::Configuration)\n{\n    ui->setupUi(this);\n    FUI = (MainWindow*)parent;//((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_Setting);\n\n    //各个窗体名字\n    QStringList strList;\n    strList.append(\"Wifi\");\n//    strList.append(\"GConde\");\n    strList.append(\"RPI Terminal\");\n    strList.append(\"Gcode Terminal\");\n//    strList.append(\"OctoPrint Webside\");\n\n    foreach(QString item,strList)\n    {\n        QStandardItem *menulist = new QStandardItem(static_cast<QString>(item));\n        menulist->setForeground(QColor(255,255,255));\n        menulist->setTextAlignment(Qt::AlignCenter);\n        if(item == \"Wifi\")\n        {\n            menulist->setIcon(QIcon(\":/assets/Wifi.svg\"));\n        }\n        else if(item == \"RPI Terminal\")\n        {\n            menulist->setIcon(QIcon(\":/assets/terminal.svg\"));\n        }\n        else if(item == \"Gcode Terminal\")\n        {\n            menulist->setIcon(QIcon(\":/assets/yuanchengkongzhi.svg\"));\n        }\n//        else if(item == \"OctoPrint Webside\")\n//        {\n//            menulist->setIcon(QIcon(\":/assets/webside.svg\"));\n//            menulist->setBackground(QBrush(Qt::blue));\n//        }\n\n        ItemModel->appendRow(menulist);\n    }\n    ui->Frm_ListView->setModel(ItemModel);\n    ui->Frm_ListView->setIconSize(QSize((int)(SizePercent.width()*72),(int)(SizePercent.height()*72)));\n\n    QFont font;\n    font.setPointSize((int)(ui->Frm_ListView->font().pointSize()*(SizePercent.width() < SizePercent.height() ? SizePercent.width():SizePercent.height())));\n    ui->Frm_ListView->setFont(font);\n\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n}\n\nConfiguration::~Configuration()\n{\n    delete ui;\n}\n\nvoid Configuration::on_Btn_Back_clicked()\n{\n    this->close();\n}\n\nvoid Configuration::showEvent(QShowEvent *event)\n{\n    Q_UNUSED(event);\n}\n\nvoid Configuration::on_Frm_ListView_clicked(const QModelIndex &index)\n{\n    //ui->Btn_Help->setText(index.data().toString());\n    if(index.data().toString() == \"Wifi\")\n        ((MainWindow*)FUI)->wlanconfig->show();\n    if(index.data().toString() == \"RPI Terminal\")\n        ((MainWindow*)FUI)->terminaldialog->show();\n    if(index.data().toString() == \"Gcode Terminal\")//GCode 控制台\n        ((MainWindow*)FUI)->gcodedialog->show();\n//    if(index.data().toString() == \"OctoPrint Webside\")\n//        ((MainWindow*)FUI)->webdialog->show();\n}\n\nvoid Configuration::on_Btn_Help_clicked()\n{\n    ((MainWindow*)FUI)->wlanconfig->GetNetworkInfo();\n}\n"
  },
  {
    "path": "configuration.h",
    "content": "#ifndef CONFIGURATION_H\n#define CONFIGURATION_H\n\n#include <QDialog>\n#include <QSizeF>\n#include <QStandardItemModel>\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n\nnamespace Ui {\nclass Configuration;\n}\n\nclass Configuration : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit Configuration(QWidget *parent = nullptr);\n    ~Configuration();\n\nprivate slots:\n    virtual void on_Btn_Back_clicked();\n\n    void on_Frm_ListView_clicked(const QModelIndex &index);\n\n    void on_Btn_Help_clicked();\n\nprivate:\n    Ui::Configuration *ui;\n    QWidget *FUI;\n\n    QStandardItemModel *ItemModel = new QStandardItemModel(this);\nprotected:\n    void showEvent(QShowEvent *event);\n};\n\n#endif // CONFIGURATION_H\n"
  },
  {
    "path": "configuration.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>Configuration</class>\n <widget class=\"QDialog\" name=\"Configuration\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Configuration</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/xitongpeizhi.svg</normaloff>:/assets/xitongpeizhi.svg</iconset>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"1,7\">\n   <property name=\"spacing\">\n    <number>3</number>\n   </property>\n   <property name=\"leftMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>5</number>\n   </property>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3\">\n     <property name=\"leftMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"topMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"rightMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"bottomMargin\">\n      <number>5</number>\n     </property>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Back\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/huitui.svg</normaloff>:/assets/huitui.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_3\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Logo\">\n       <property name=\"styleSheet\">\n        <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\n</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/xitongpeizhi.svg</normaloff>:/assets/xitongpeizhi.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_4\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Help\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"layoutDirection\">\n        <enum>Qt::RightToLeft</enum>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/help.svg</normaloff>:/assets/help.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <layout class=\"QGridLayout\" name=\"gridLayout\">\n     <item row=\"0\" column=\"0\">\n      <widget class=\"QListView\" name=\"Frm_ListView\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>50</pointsize>\n        </font>\n       </property>\n       <property name=\"editTriggers\">\n        <set>QAbstractItemView::NoEditTriggers</set>\n       </property>\n       <property name=\"resizeMode\">\n        <enum>QListView::Adjust</enum>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "controlpanel.cpp",
    "content": "﻿#include \"controlpanel.h\"\n#include \"ui_controlpanel.h\"\n#include <QProcess>\n#include <mainwindow.h>\n#include <QDialog>\n//#include <QSizeF>\n#include <QPalette>\n#include <QBitmap>\n#include <QPainter>\n#include <QTextBrowser>\n#include <QDesktopWidget>\n\n\nControlPanel::ControlPanel(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::ControlPanel)\n{\n    ui->setupUi(this);\n    FUI = (MainWindow*)parent;//((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_Setting);\n\n    //使控件适应屏幕的大小\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));   //将控件大小固定为800*480\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n\n    //设置冷热按键的样式表\n    ui->Btn_Cool->setStyleSheet(\"QPushButton        {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(36, 148, 251);color: rgb(245, 246, 250);}\"\\\n                                \"QPushButton:hover  {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(36, 148, 251); background-color: rgb(18, 74, 125);}\"\\\n                                \"QPushButton:pressed{padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(36, 148, 251); background-color: rgb(18, 74, 125); padding-right:4px;padding-bottom:4px;}\");\n    ui->Btn_Heat->setStyleSheet(\"QPushButton        {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(216, 30, 6);color: rgb(245, 246, 250);}\"\\\n                                \"QPushButton:hover  {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(216, 30, 6); background-color: rgb(108, 15, 3);}\"\\\n                                \"QPushButton:pressed{padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(216, 30, 6); background-color: rgb(108, 15, 3); padding-right:4px;padding-bottom:4px;}\");\n\n    ui->Btn_Axle_Home->setStyleSheet(\"border-color: rgb(230, 230, 230);\");\n    ui->Btn_Unlock->setStyleSheet(\"border-color: rgb(43, 166, 56);\");\n    ui->Btn_Restore->setStyleSheet(\"border-color: rgb(205, 205, 205);\");\n    ui->Btn_Shutdown->setStyleSheet(\"border-color: rgb(216, 30, 6);\");\n    ui->Btn_Extruder_E->setStyleSheet(\"border-color: rgb(245, 246, 255);\");\n    ui->Btn_Extruder_R->setStyleSheet(\"border-color: rgb(245, 246, 255);\");\n}\n\nControlPanel::~ControlPanel()\n{\n    delete ui;\n}\n\nvoid ControlPanel::on_Btn_Back_clicked()\n{\n    this->close();//关闭窗口\n}\n\nvoid ControlPanel::on_Btn_R_1_clicked()\n{\n    MoveSpeed = 1;\n    ui->Btn_R_1->setStyleSheet(SelectKey);\n    ui->Btn_R_5->setStyleSheet(UnSelectKey);\n    ui->Btn_R_10->setStyleSheet(UnSelectKey);\n    ui->Btn_R_50->setStyleSheet(UnSelectKey);\n    ui->Btn_R_100->setStyleSheet(UnSelectKey);\n}\n\nvoid ControlPanel::on_Btn_R_5_clicked()\n{\n    MoveSpeed = 5;\n    ui->Btn_R_1->setStyleSheet(UnSelectKey);\n    ui->Btn_R_5->setStyleSheet(SelectKey);\n    ui->Btn_R_10->setStyleSheet(UnSelectKey);\n    ui->Btn_R_50->setStyleSheet(UnSelectKey);\n    ui->Btn_R_100->setStyleSheet(UnSelectKey);\n}\n\nvoid ControlPanel::on_Btn_R_10_clicked()\n{\n    MoveSpeed = 10;\n    ui->Btn_R_1->setStyleSheet(UnSelectKey);\n    ui->Btn_R_5->setStyleSheet(UnSelectKey);\n    ui->Btn_R_10->setStyleSheet(SelectKey);\n    ui->Btn_R_50->setStyleSheet(UnSelectKey);\n    ui->Btn_R_100->setStyleSheet(UnSelectKey);\n}\n\nvoid ControlPanel::on_Btn_R_50_clicked()\n{\n    MoveSpeed = 50;\n    ui->Btn_R_1->setStyleSheet(UnSelectKey);\n    ui->Btn_R_5->setStyleSheet(UnSelectKey);\n    ui->Btn_R_10->setStyleSheet(UnSelectKey);\n    ui->Btn_R_50->setStyleSheet(SelectKey);\n    ui->Btn_R_100->setStyleSheet(UnSelectKey);\n}\n\nvoid ControlPanel::on_Btn_R_100_clicked()\n{\n    MoveSpeed = 100;\n    ui->Btn_R_1->setStyleSheet(UnSelectKey);\n    ui->Btn_R_5->setStyleSheet(UnSelectKey);\n    ui->Btn_R_10->setStyleSheet(UnSelectKey);\n    ui->Btn_R_50->setStyleSheet(UnSelectKey);\n    ui->Btn_R_100->setStyleSheet(SelectKey);\n}\n\nvoid ControlPanel::on_Btn_Heat_toggled(bool checked)\n{\n\n    if(checked)//如果升温按钮被点击，关闭降温按钮\n    {\n        ui->Btn_Cool->setStyleSheet(\"QPushButton        {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(36, 148, 251);}\"\\\n                                    \"QPushButton:hover  {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(36, 148, 251); background-color: rgb(18, 74, 125);}\"\\\n                                    \"QPushButton:pressed{padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(36, 148, 251); background-color: rgb(18, 74, 125); padding-right:4px;padding-bottom:4px;}\");\n\n        ui->Btn_Heat->setStyleSheet(\"QPushButton        {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(216, 30, 6); background-color: rgb(108, 15, 3); padding-right:4px;padding-bottom:4px;}\"\\\n                                    \"QPushButton:hover  {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(216, 30, 6); background-color: rgb(108, 15, 3); padding-right:4px;padding-bottom:4px;}\"\\\n                                    \"QPushButton:pressed{padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(216, 30, 6); background-color: rgb(108, 15, 3); padding-right:4px;padding-bottom:4px;}\");\n        if(ui->Btn_Cool->isChecked())\n        {\n            ui->Btn_Cool->setChecked(false);\n            //发送升温指令\n            QList<QString> _GCode_Setting;\n            _GCode_Setting.append(\"M140 S60\");\n            _GCode_Setting.append(\"M104 S200\");\n            ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_Setting);\n        }\n\n    }\n}\n\nvoid ControlPanel::on_Btn_Cool_toggled(bool checked)\n{\n\n    if(checked)\n    {\n        ui->Btn_Heat->setStyleSheet(\"QPushButton        {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(216, 30, 6);}\"\\\n                                    \"QPushButton:hover  {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(216, 30, 6); background-color: rgb(108, 15, 3);}\"\\\n                                    \"QPushButton:pressed{padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(216, 30, 6); background-color: rgb(108, 15, 3); padding-right:4px;padding-bottom:4px;}\");\n        ui->Btn_Cool->setStyleSheet(\"QPushButton        {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(36, 148, 251); background-color: rgb(18, 74, 125); padding-right:4px;padding-bottom:4px;}\"\\\n                                    \"QPushButton:hover  {padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(36, 148, 251); background-color: rgb(18, 74, 125); padding-right:4px;padding-bottom:4px;}\"\\\n                                    \"QPushButton:pressed{padding: 10px;border-style: solid;border-width: 5px;border-radius: 20px;border-color: rgb(36, 148, 251); background-color: rgb(18, 74, 125); padding-right:4px;padding-bottom:4px;}\");\n    }\n\n//    ui->Btn_Cool->setStyleSheet(checked?ui->Btn_Cool->styleSheet()+\"background-color:rgb(18, 74, 125);\":\"padding: 10px;\\nborder-style: solid;\\nborder-width: 5px;\\nborder-radius: 20px;\\nborder-color: rgb(36, 148, 251);\");\n\n\n    QList<QString> _GCode_;\n    if(checked)//如果降下温按钮被点击，关闭升温按钮\n    {\n        if(ui->Btn_Heat->isChecked())\n            ui->Btn_Heat->setChecked(false);\n        //发送降温指令\n        _GCode_.append(\"M106 S255\");\n        _GCode_.append(\"M104 S0\");\n        _GCode_.append(\"M140 S0\");\n    }\n    else\n    {\n        _GCode_.append(\"M106 S0\");//?\n    }\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\n//坐标归位按键按下所有坐标归位，按键变色\nvoid ControlPanel::on_Btn_Axle_Home_clicked()\n{\n    //发送归位指令\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G28\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\n//Unlock Motors 锁定喷头温度和工床温度\nvoid ControlPanel::on_Btn_Unlock_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"M18\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\n//重启 OctoBTT、重启OctoPrint以及取消\nvoid ControlPanel::on_Btn_Restore_clicked()\n{\n//    StyleSheet_Temp = ui->Btn_Restore->styleSheet();//获取按键的样式表用以恢复颜色\n//    ui->Btn_Restore->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n\n    QStringList btnName = {\"Restart OctoBTT\" , \"Restart OctoPrint\", \"Cancel\"} ;\n    CustomDialog *newDialog = new CustomDialog();\n    QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n    {\n        if(instruct == \"Restart OctoBTT\")\n        {\n            //重启OctoBTT\n            qApp->exit(Base_Restart);\n        }\n        else if(instruct == \"Restart OctoPrint\")\n        {\n            //重启Octoprint\n            QProcess P(0);\n            P.start(\"sudo service octoprint restart\");\n            P.waitForStarted();\n            P.waitForFinished();\n            qApp->exit(Base_Restart);\n        }\n    });\n    newDialog->showCustomDialog(\"what do you want ?\",\":/assets/zhongzhi.svg\",btnName,this);\n}\n\n//紧急制停、关机以及取消\nvoid ControlPanel::on_Btn_Shutdown_clicked()\n{\n    QStringList btnName = {\"Emergency Stop\" , \"Shutdown\", \"Cancel\"} ;\n    CustomDialog *newDialog = new CustomDialog();\n    QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n    {\n        if(instruct == \"Emergency Stop\")\n        {\n            //紧急制停\n            QList<QString> _GCode_;\n            //        _GCode_.append(\"M110 N0\");\n            _GCode_.append(\"M112\");\n            ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n        }\n        else if(instruct == \"Shutdown\")\n        {\n            //关机\n            QProcess P(0);\n            P.start(\"xset dpms force off\");\n            P.waitForStarted();\n            P.waitForFinished();\n            qApp->exit(Base_Shutdown);\n        }\n    });\n    newDialog->showCustomDialog(\"what do you want ?\",\":/assets/hazard.svg\",btnName,this);\n}\n\nvoid ControlPanel::on_Btn_Axle_X_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G28 X\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_Axle_Y_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G28 Y\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_Axle_Z_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G28 Z\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_XY_Res_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G28 X Y\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_Y_Add_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G1 Y\"+QString::number(MoveSpeed)+\" F6000\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_Y_Dec_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G1 Y-\"+QString::number(MoveSpeed)+\" F6000\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_X_Dec_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G1 X-\"+QString::number(MoveSpeed)+\" F6000\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_X_Add_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G1 X\"+QString::number(MoveSpeed)+\" F6000\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_Z_Add_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G1 Z\"+QString::number(MoveSpeed)+\" F200\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_Z_Dec_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G1 Z-\"+QString::number(MoveSpeed)+\" F200\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_Extruder_R_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G1 E-\"+QString::number(MoveSpeed)+\" F300\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_Extruder_E_clicked()\n{\n    QList<QString> _GCode_;\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"G1 E\"+QString::number(MoveSpeed)+\" F300\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\n\nvoid ControlPanel::on_Btn_Z_BS_Add_clicked()\n{\n    QList<QString> _GCode_;\n//    _GCode_.append(\"M110 N0\");\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"M290 Z\"+QString::number((double)MoveSpeed/100));\n    _GCode_.append(\"M500\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\nvoid ControlPanel::on_Btn_Z_BS_Dec_clicked()\n{\n    QList<QString> _GCode_;\n//    _GCode_.append(\"M110 N0\");\n    _GCode_.append(\"G91\");\n    _GCode_.append(\"M290 Z-\"+QString::number((double)MoveSpeed/100));\n    _GCode_.append(\"M500\");\n    _GCode_.append(\"G90\");\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n}\n\n//自动调平按键\nvoid ControlPanel::on_Btn_Level_clicked()\n{  \n    //如果点击退出，关闭弹窗\n    if(((MainWindow*)FUI)->octonetwork.ConnectState == \"Operational\")\n    {\n        QStringList btnName = {\"Yes\", \"No\"} ;\n        CustomDialog *newDialog = new CustomDialog();\n        QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n        {\n            if(instruct == \"Yes\")\n            {\n                QList<QString> _GCode_;\n                _GCode_.append(\"M502\");\n                _GCode_.append(\"M500\");\n                _GCode_.append(\"G91\");\n                _GCode_.append(\"G28\");\n                _GCode_.append(\"G29\");\n                _GCode_.append(\"G90\");\n                _GCode_.append(\"M500\");\n                ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_);\n            }\n        });\n        newDialog->showCustomDialog(\"Self-leveling\",\":/assets/kongzhimianban_B.svg\",btnName,\"Whether the automatic leveling sensor has been installed ?\",this);\n    }\n    else\n    {\n        CustomDialog *newDialog = new CustomDialog();\n        newDialog->showCustomDialog(\"Self-leveling\",\":/assets/kongzhimianban_B.svg\",\"Current state not supported !\",this);\n    }\n}\n\n"
  },
  {
    "path": "controlpanel.h",
    "content": "﻿#ifndef CONTROLPANEL_H\n#define CONTROLPANEL_H\n\n#include <QDialog>\n#include <QSizeF>\n#include <QResizeEvent>\n#include \"customdialog.h\"\n\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n\nconst static int Base_Restart = 773;\nconst static int Base_Shutdown = 772;\nconst static int Base_OnlyExitApp = 770;\n\nnamespace Ui {\n    class ControlPanel;\n}\n\nclass ControlPanel : public QDialog\n{\n        Q_OBJECT\n\n    public:\n        explicit ControlPanel(QWidget *parent = nullptr);\n        ~ControlPanel();\n\n    private slots:\n        virtual void on_Btn_Back_clicked();\n\n        virtual void on_Btn_R_1_clicked();\n\n        virtual void on_Btn_R_5_clicked();\n\n        virtual void on_Btn_R_10_clicked();\n\n        virtual void on_Btn_R_50_clicked();\n\n        virtual void on_Btn_R_100_clicked();\n\n        virtual void on_Btn_Heat_toggled(bool checked);\n\n        virtual void on_Btn_Cool_toggled(bool checked);\n\n        virtual void on_Btn_Axle_Home_clicked();\n\n        virtual void on_Btn_Unlock_clicked();\n\n        virtual void on_Btn_Restore_clicked();\n\n        virtual void on_Btn_Shutdown_clicked();\n\n        virtual void on_Btn_Axle_X_clicked();\n\n        virtual void on_Btn_Axle_Y_clicked();\n\n        virtual void on_Btn_Axle_Z_clicked();\n\n        virtual void on_Btn_XY_Res_clicked();\n\n        virtual void on_Btn_Y_Add_clicked();\n\n        virtual void on_Btn_Y_Dec_clicked();\n\n        virtual void on_Btn_X_Dec_clicked();\n\n        virtual void on_Btn_X_Add_clicked();\n\n        virtual void on_Btn_Z_Add_clicked();\n\n        virtual void on_Btn_Z_Dec_clicked();\n\n        virtual void on_Btn_Extruder_R_clicked();\n\n        virtual void on_Btn_Extruder_E_clicked();\n\n        virtual void on_Btn_Z_BS_Add_clicked();\n\n        virtual void on_Btn_Z_BS_Dec_clicked();\n\n        virtual void on_Btn_Level_clicked();\n\n    private:\n        Ui::ControlPanel *ui;\n        QString UnSelectKey = \"QPushButton{color: rgb(245, 246, 250); border-color:rgb(245, 246, 250); border-style: solid; border-width: 5px; border-radius: 20px;}\"\\\n                              \"QPushButton:hover{border:none;background-color:rgb(128,128,128,128); border-color:rgb(245, 246, 250); border-style: solid; border-width: 5px; border-radius: 20px;}\"\\\n                              \"QPushButton:pressed{border:none; padding-right:4px; padding-bottom:4px; border-color:rgb(245, 246, 250); border-style: solid; border-width: 5px; border-radius: 20px;}\";\n        QString SelectKey = \"background-color: rgb(128,128,128);\\ncolor: rgb(245, 246, 250);\\nborder-color:rgb(0, 255, 0)\";\n        QString StyleSheet_Temp;\n        int MoveSpeed = 10;\n        QWidget *FUI;\n        int RestoreFlag = 0;\n};\n\n\n\n#endif // CONTROLPANEL_H\n"
  },
  {
    "path": "controlpanel.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>ControlPanel</class>\n <widget class=\"QDialog\" name=\"ControlPanel\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Control</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/Ddayin.svg</normaloff>:/assets/Ddayin.svg</iconset>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"1,7\">\n   <property name=\"spacing\">\n    <number>3</number>\n   </property>\n   <property name=\"leftMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>5</number>\n   </property>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3\">\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Back\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/huitui.svg</normaloff>:/assets/huitui.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_3\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Logo\">\n       <property name=\"styleSheet\">\n        <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\n</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/jixiezhizao.svg</normaloff>:/assets/jixiezhizao.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_4\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QLabel\" name=\"label\">\n       <property name=\"minimumSize\">\n        <size>\n         <width>84</width>\n         <height>78</height>\n        </size>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout\" stretch=\"3,0\">\n     <property name=\"spacing\">\n      <number>2</number>\n     </property>\n     <item>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_3\" stretch=\"7,0,1\">\n       <property name=\"spacing\">\n        <number>5</number>\n       </property>\n       <item>\n        <layout class=\"QGridLayout\" name=\"gridLayout\" rowstretch=\"0,1,0,1,0,1,0,0\" columnstretch=\"0,1,0,1,1,1,0,1\">\n         <property name=\"sizeConstraint\">\n          <enum>QLayout::SetDefaultConstraint</enum>\n         </property>\n         <property name=\"spacing\">\n          <number>2</number>\n         </property>\n         <item row=\"6\" column=\"6\">\n          <spacer name=\"horizontalSpacer_8\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Fixed</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>10</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item row=\"3\" column=\"5\" alignment=\"Qt::AlignLeft|Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"Btn_X_Add\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/you.svg</normaloff>:/assets/you.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">Btn_Axle</string>\n           </attribute>\n          </widget>\n         </item>\n         <item row=\"3\" column=\"1\" alignment=\"Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"Btn_Axle_Y\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"layoutDirection\">\n            <enum>Qt::LeftToRight</enum>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/shangxiajuzhong.svg</normaloff>:/assets/shangxiajuzhong.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n          </widget>\n         </item>\n         <item row=\"0\" column=\"2\">\n          <spacer name=\"horizontalSpacer_15\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Fixed</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>10</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item row=\"1\" column=\"3\" alignment=\"Qt::AlignRight|Qt::AlignBottom\">\n          <widget class=\"QPushButton\" name=\"Btn_Z_Add\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/youshang.svg</normaloff>:/assets/youshang.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">Btn_Axle</string>\n           </attribute>\n          </widget>\n         </item>\n         <item row=\"2\" column=\"2\">\n          <spacer name=\"horizontalSpacer_14\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Fixed</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>10</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item row=\"7\" column=\"3\" colspan=\"3\">\n          <widget class=\"QPushButton\" name=\"pushButton_12\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>15</pointsize>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">border: none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>Z BabyStep</string>\n           </property>\n          </widget>\n         </item>\n         <item row=\"5\" column=\"0\" alignment=\"Qt::AlignRight|Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"pushButton_14\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>15</pointsize>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">border: none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>Z</string>\n           </property>\n          </widget>\n         </item>\n         <item row=\"1\" column=\"0\" alignment=\"Qt::AlignRight|Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"pushButton_16\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>15</pointsize>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">border: none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>X</string>\n           </property>\n          </widget>\n         </item>\n         <item row=\"7\" column=\"0\" colspan=\"2\">\n          <widget class=\"QPushButton\" name=\"pushButton_13\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>15</pointsize>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">border: none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>Restore</string>\n           </property>\n          </widget>\n         </item>\n         <item row=\"5\" column=\"7\" alignment=\"Qt::AlignHCenter|Qt::AlignTop\">\n          <widget class=\"QPushButton\" name=\"Btn_Extruder_E\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>20</pointsize>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet1</string>\n           </property>\n           <property name=\"text\">\n            <string>Ext.</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n          </widget>\n         </item>\n         <item row=\"2\" column=\"6\">\n          <spacer name=\"horizontalSpacer_11\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Fixed</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>10</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item row=\"1\" column=\"1\" alignment=\"Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"Btn_Axle_X\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"layoutDirection\">\n            <enum>Qt::LeftToRight</enum>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/zuoyoujuzhong.svg</normaloff>:/assets/zuoyoujuzhong.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n          </widget>\n         </item>\n         <item row=\"7\" column=\"7\" alignment=\"Qt::AlignHCenter\">\n          <widget class=\"QPushButton\" name=\"pushButton_15\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>15</pointsize>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">border: none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>Level</string>\n           </property>\n          </widget>\n         </item>\n         <item row=\"4\" column=\"6\">\n          <spacer name=\"horizontalSpacer_12\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Fixed</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>10</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item row=\"5\" column=\"4\" alignment=\"Qt::AlignHCenter|Qt::AlignTop\">\n          <widget class=\"QPushButton\" name=\"Btn_XY_Res\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"toolTip\">\n            <string>XY Axle Restore</string>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/yuandian_W.svg</normaloff>:/assets/yuandian_W.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">Btn_Axle</string>\n           </attribute>\n          </widget>\n         </item>\n         <item row=\"5\" column=\"3\" alignment=\"Qt::AlignRight|Qt::AlignTop\">\n          <widget class=\"QPushButton\" name=\"Btn_Z_BS_Add\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"toolTip\">\n            <string>BabyStep : Speed Value Divided By One Hundred</string>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/shangsheng.svg</normaloff>:/assets/shangsheng.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n          </widget>\n         </item>\n         <item row=\"1\" column=\"4\" alignment=\"Qt::AlignHCenter|Qt::AlignBottom\">\n          <widget class=\"QPushButton\" name=\"Btn_Y_Add\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/shang.svg</normaloff>:/assets/shang.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">Btn_Axle</string>\n           </attribute>\n          </widget>\n         </item>\n         <item row=\"3\" column=\"0\" alignment=\"Qt::AlignRight|Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"pushButton_17\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>15</pointsize>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">border: none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>Y</string>\n           </property>\n          </widget>\n         </item>\n         <item row=\"3\" column=\"4\" alignment=\"Qt::AlignHCenter|Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"Btn_Y_Dec\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/xia.svg</normaloff>:/assets/xia.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">Btn_Axle</string>\n           </attribute>\n          </widget>\n         </item>\n         <item row=\"4\" column=\"2\">\n          <spacer name=\"horizontalSpacer_13\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Fixed</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>10</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item row=\"1\" column=\"7\" alignment=\"Qt::AlignHCenter|Qt::AlignBottom\">\n          <widget class=\"QPushButton\" name=\"Btn_Extruder_R\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>20</pointsize>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet1</string>\n           </property>\n           <property name=\"text\">\n            <string>Ret.</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n          </widget>\n         </item>\n         <item row=\"6\" column=\"2\">\n          <spacer name=\"horizontalSpacer_16\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Fixed</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>10</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item row=\"3\" column=\"7\" alignment=\"Qt::AlignHCenter|Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"Btn_Level\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/kongzhimianban.svg</normaloff>:/assets/kongzhimianban.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">Btn_Axle</string>\n           </attribute>\n          </widget>\n         </item>\n         <item row=\"0\" column=\"6\">\n          <spacer name=\"horizontalSpacer_10\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeType\">\n            <enum>QSizePolicy::Fixed</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>10</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item row=\"5\" column=\"5\" alignment=\"Qt::AlignLeft|Qt::AlignTop\">\n          <widget class=\"QPushButton\" name=\"Btn_Z_BS_Dec\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"toolTip\">\n            <string>BabyStep : Speed Value Divided By One Hundred</string>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/xiajiang.svg</normaloff>:/assets/xiajiang.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n          </widget>\n         </item>\n         <item row=\"1\" column=\"5\" alignment=\"Qt::AlignLeft|Qt::AlignBottom\">\n          <widget class=\"QPushButton\" name=\"Btn_Z_Dec\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/zuoxia.svg</normaloff>:/assets/zuoxia.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">Btn_Axle</string>\n           </attribute>\n          </widget>\n         </item>\n         <item row=\"3\" column=\"3\" alignment=\"Qt::AlignRight|Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"Btn_X_Dec\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"layoutDirection\">\n            <enum>Qt::LeftToRight</enum>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/zuo.svg</normaloff>:/assets/zuo.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">Btn_Axle</string>\n           </attribute>\n          </widget>\n         </item>\n         <item row=\"5\" column=\"1\" alignment=\"Qt::AlignVCenter\">\n          <widget class=\"QPushButton\" name=\"Btn_Axle_Z\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"whatsThis\">\n            <string>BTStyleSheet2</string>\n           </property>\n           <property name=\"layoutDirection\">\n            <enum>Qt::LeftToRight</enum>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"assets.qrc\">\n             <normaloff>:/assets/chuizhijuzhong.svg</normaloff>:/assets/chuizhijuzhong.svg</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <widget class=\"QPushButton\" name=\"pushButton_18\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"font\">\n          <font>\n           <family>Gill Sans MT</family>\n           <pointsize>15</pointsize>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"styleSheet\">\n          <string notr=\"true\">border: none;\ncolor: rgb(245, 246, 250);</string>\n         </property>\n         <property name=\"text\">\n          <string>Speed</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QWidget\" name=\"widget_2\" native=\"true\">\n         <property name=\"styleSheet\">\n          <string notr=\"true\"> padding: 10px;\n border-style: solid;\n border-width: 5px;\n border-radius: 20px;</string>\n         </property>\n         <layout class=\"QHBoxLayout\" name=\"horizontalLayout_4\">\n          <item>\n           <widget class=\"QPushButton\" name=\"Btn_R_1\">\n            <property name=\"font\">\n             <font>\n              <family>Gill Sans MT</family>\n              <pointsize>20</pointsize>\n              <weight>75</weight>\n              <bold>true</bold>\n             </font>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\">\ncolor: rgb(245, 246, 250);</string>\n            </property>\n            <property name=\"text\">\n             <string>1</string>\n            </property>\n            <property name=\"checkable\">\n             <bool>true</bool>\n            </property>\n            <property name=\"checked\">\n             <bool>false</bool>\n            </property>\n            <attribute name=\"buttonGroup\">\n             <string notr=\"true\">Btn_Rate</string>\n            </attribute>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QPushButton\" name=\"Btn_R_5\">\n            <property name=\"font\">\n             <font>\n              <family>Gill Sans MT</family>\n              <pointsize>20</pointsize>\n              <weight>75</weight>\n              <bold>true</bold>\n             </font>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\">\ncolor: rgb(245, 246, 250);</string>\n            </property>\n            <property name=\"text\">\n             <string>5</string>\n            </property>\n            <property name=\"checkable\">\n             <bool>true</bool>\n            </property>\n            <property name=\"checked\">\n             <bool>false</bool>\n            </property>\n            <attribute name=\"buttonGroup\">\n             <string notr=\"true\">Btn_Rate</string>\n            </attribute>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QPushButton\" name=\"Btn_R_10\">\n            <property name=\"font\">\n             <font>\n              <family>Gill Sans MT</family>\n              <pointsize>20</pointsize>\n              <weight>75</weight>\n              <bold>true</bold>\n             </font>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\">color: rgb(245, 246, 250);\nborder-color:rgb(0, 255, 0);\nbackground-color: rgb(128, 128, 128);</string>\n            </property>\n            <property name=\"text\">\n             <string>10</string>\n            </property>\n            <property name=\"checkable\">\n             <bool>true</bool>\n            </property>\n            <property name=\"checked\">\n             <bool>true</bool>\n            </property>\n            <attribute name=\"buttonGroup\">\n             <string notr=\"true\">Btn_Rate</string>\n            </attribute>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QPushButton\" name=\"Btn_R_50\">\n            <property name=\"font\">\n             <font>\n              <family>Gill Sans MT</family>\n              <pointsize>20</pointsize>\n              <weight>75</weight>\n              <bold>true</bold>\n             </font>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\">\ncolor: rgb(245, 246, 250);</string>\n            </property>\n            <property name=\"text\">\n             <string>50</string>\n            </property>\n            <property name=\"checkable\">\n             <bool>true</bool>\n            </property>\n            <property name=\"checked\">\n             <bool>false</bool>\n            </property>\n            <attribute name=\"buttonGroup\">\n             <string notr=\"true\">Btn_Rate</string>\n            </attribute>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QPushButton\" name=\"Btn_R_100\">\n            <property name=\"font\">\n             <font>\n              <family>Gill Sans MT</family>\n              <pointsize>20</pointsize>\n              <weight>75</weight>\n              <bold>true</bold>\n             </font>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\">\ncolor: rgb(245, 246, 250);</string>\n            </property>\n            <property name=\"text\">\n             <string>100</string>\n            </property>\n            <property name=\"checkable\">\n             <bool>true</bool>\n            </property>\n            <property name=\"checked\">\n             <bool>false</bool>\n            </property>\n            <attribute name=\"buttonGroup\">\n             <string notr=\"true\">Btn_Rate</string>\n            </attribute>\n           </widget>\n          </item>\n         </layout>\n        </widget>\n       </item>\n      </layout>\n     </item>\n     <item>\n      <widget class=\"QWidget\" name=\"widgetR\" native=\"true\">\n       <layout class=\"QGridLayout\" name=\"gridLayout_2\" rowstretch=\"1,1,1\" columnstretch=\"1,1\">\n        <property name=\"sizeConstraint\">\n         <enum>QLayout::SetDefaultConstraint</enum>\n        </property>\n        <property name=\"spacing\">\n         <number>3</number>\n        </property>\n        <item row=\"2\" column=\"0\">\n         <widget class=\"QPushButton\" name=\"Btn_Restore\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"whatsThis\">\n           <string>BTStyleSheet1</string>\n          </property>\n          <property name=\"text\">\n           <string/>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/zhongzhi.svg</normaloff>:/assets/zhongzhi.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>64</width>\n            <height>64</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item row=\"2\" column=\"1\">\n         <widget class=\"QPushButton\" name=\"Btn_Shutdown\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"whatsThis\">\n           <string>BTStyleSheet1</string>\n          </property>\n          <property name=\"text\">\n           <string/>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/hazard.svg</normaloff>:/assets/hazard.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>64</width>\n            <height>64</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item row=\"1\" column=\"1\">\n         <widget class=\"QPushButton\" name=\"Btn_Cool\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"text\">\n           <string/>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/shuangdong.svg</normaloff>:/assets/shuangdong.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>64</width>\n            <height>64</height>\n           </size>\n          </property>\n          <property name=\"checkable\">\n           <bool>true</bool>\n          </property>\n          <property name=\"checked\">\n           <bool>false</bool>\n          </property>\n         </widget>\n        </item>\n        <item row=\"0\" column=\"0\">\n         <widget class=\"QPushButton\" name=\"Btn_Axle_Home\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"whatsThis\">\n           <string>BTStyleSheet1</string>\n          </property>\n          <property name=\"text\">\n           <string/>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/huijia.svg</normaloff>:/assets/huijia.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>64</width>\n            <height>64</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item row=\"0\" column=\"1\">\n         <widget class=\"QPushButton\" name=\"Btn_Unlock\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"whatsThis\">\n           <string>BTStyleSheet1</string>\n          </property>\n          <property name=\"text\">\n           <string/>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/jiesuo.svg</normaloff>:/assets/jiesuo.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>64</width>\n            <height>64</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item row=\"1\" column=\"0\">\n         <widget class=\"QPushButton\" name=\"Btn_Heat\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"text\">\n           <string/>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/jiare.svg</normaloff>:/assets/jiare.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>64</width>\n            <height>64</height>\n           </size>\n          </property>\n          <property name=\"checkable\">\n           <bool>true</bool>\n          </property>\n          <property name=\"checked\">\n           <bool>false</bool>\n          </property>\n         </widget>\n        </item>\n       </layout>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections/>\n <buttongroups>\n  <buttongroup name=\"Btn_Rate\"/>\n  <buttongroup name=\"Btn_Axle\"/>\n </buttongroups>\n</ui>\n"
  },
  {
    "path": "customdialog.cpp",
    "content": "﻿#include \"customdialog.h\"\n\n/// windowName:窗体标题\n/// windowIcon:窗体标识图片路径\n/// buttonName：按键水平布局---纯按键(垂直布局)\n/// textContent：文本垂直布局\nvoid CustomDialog::showCustomDialog(QString windowName, QString windowIcon, QStringList buttonName, QString textContent, QWidget *parent)\n{\n    //传参\n    _WindowName = windowName;\n    _WindowIcon = windowIcon;\n    _ButtonName = buttonName;\n    _TextContent = textContent;\n    _Parent = parent;\n\n     //背景颜色\n    this->setWindowOpacity(0.9);    //透明度\n    this->setStyleSheet(\"background-color: rgba(128, 128, 128, 25%)\");  //背景\n\n    //设置窗口的标题和标识\n    this->setWindowTitle(_WindowName);\n    this->setWindowIcon(QIcon(_WindowIcon));\n    //适应屏幕大小\n    this->resize(_Parent->width()*0.9,_Parent->height()*0.9);\n    this->setFixedSize(_Parent->width()*0.9,_Parent->height()*0.9);\n\n    //使弹窗居中显示\n    this->move(_Parent->pos().x() + (_Parent->width() - this->width()) / 2,_Parent->pos().y() + (_Parent->height() - this->height()) / 2);\n\n    //设置文本显示\n    QTextBrowser textBrowser;\n    textBrowser.setStyleSheet(\"border: none; color: rgb(245, 246, 255);background-color: rgba(128, 128, 128, 0%);\");\n    textBrowser.setText(_TextContent);\n    textBrowser.setFixedSize(_Parent->width()*0.877,_Parent->height()*0.5);\n//    textBrowser.move();\n//    textBrowser.setGeometry(50,50,_Parent->width()*800*0.8,_Parent->height()*480*0.5);\n    textBrowser.setAlignment(Qt::AlignCenter);\n\n    //根据QStringList buttonName创建按键\n    QList<QPushButton*> btn;\n    for(int i = 0;i < _ButtonName.count() ;i++)\n    {\n        btn.append(new QPushButton(_ButtonName[i]));\n        btn[i] = new QPushButton(_ButtonName[i]);\n        //指定按键样式\n        btn[i]->setWhatsThis(\"BTStyleSheet\");\n\n        //调整字体大小\n        QFont _font = btn[i]->font();\n        _font.setPointSize(_Parent->maximumWidth() > _Parent->maximumHeight() ? (int)_Parent->maximumHeight()/30 : (int)_Parent->maximumWidth()/30);\n        btn[i]->setFont(_font);\n        textBrowser.setFont(_font);\n    }\n\n    //调整按键和文本的位置\n\n    //文本垂直布局\n    QVBoxLayout VLayout(this);\n    VLayout.addSpacing(150);\n    VLayout.addWidget(&textBrowser);\n    VLayout.addSpacing(300);\n\n    //按键水平布局\n    QHBoxLayout RestartBT;\n    foreach(QPushButton *item , btn)\n    {\n        RestartBT.addWidget(item);\n\n        //按键信号连接槽\n        QObject::connect(item, &QPushButton::clicked, this,[=]()\n        {\n            QPushButton *optBtn = qobject_cast<QPushButton *>(sender());\n            emit OutputEvent(optBtn->text());\n            this->close();\n        });\n    }\n    VLayout.addLayout(&RestartBT);\n\n    //模态显示\n    this->exec();\n}\n\nvoid CustomDialog::showCustomDialog(QString windowName, QString windowIcon, QStringList buttonName, QWidget *parent)\n{\n    //传参\n    _WindowName = windowName;\n    _WindowIcon = windowIcon;\n    _ButtonName = buttonName;\n    _Parent = parent;\n\n     //背景颜色\n    this->setWindowOpacity(0.9);    //透明度\n    this->setStyleSheet(\"background-color: rgba(128, 128, 128, 25%)\");  //背景\n\n    //设置窗口的标题和标识\n    this->setWindowTitle(_WindowName);\n    this->setWindowIcon(QIcon(_WindowIcon));\n    //适应屏幕大小\n    this->resize(_Parent->width()*0.9,_Parent->height()*0.9);\n    this->setFixedSize(_Parent->width()*0.9,_Parent->height()*0.9);\n\n    //使弹窗居中显示\n    this->move(_Parent->pos().x() + (_Parent->width() - this->width()) / 2,_Parent->pos().y() + (_Parent->height() - this->height()) / 2);\n\n    //根据QStringList buttonName创建按键\n    QList<QPushButton*> btn;\n    for(int i = 0;i < _ButtonName.count() ;i++)\n    {\n        btn.append(new QPushButton(_ButtonName[i]));\n        btn[i] = new QPushButton(_ButtonName[i]);\n        //指定按键样式\n        btn[i]->setWhatsThis(\"BTStyleSheet\");\n\n        //调整字体大小\n        QFont _font = btn[i]->font();\n        _font.setPointSize(_Parent->maximumWidth() > _Parent->maximumHeight() ? (int)_Parent->maximumHeight()/30 : (int)_Parent->maximumWidth()/30);\n        btn[i]->setFont(_font);\n    }\n\n    //调整按键的位置\n    QVBoxLayout VLayout(this);\n\n    //按键水平布局\n\n    foreach(QPushButton *item , btn)\n    {\n        VLayout.addWidget(item);\n\n        //按键信号连接槽\n        QObject::connect(item, &QPushButton::clicked, this,[=]()\n        {\n            QPushButton *optBtn = qobject_cast<QPushButton *>(sender());\n            emit OutputEvent(optBtn->text());\n            this->close();\n        });\n    }\n\n    //模态显示\n    this->exec();\n}\n\nvoid CustomDialog::showCustomDialog(QString windowName, QString windowIcon, QString textContent, QWidget *parent)\n{\n    QStringList btnName = {\"Ok\"};\n    showCustomDialog(windowName, windowIcon, btnName, textContent, parent);\n}\n\n"
  },
  {
    "path": "customdialog.h",
    "content": "﻿#ifndef CUSTOMDIALOG_H\n#define CUSTOMDIALOG_H\n\n#include <QWidget>\n#include <QDialog>\n#include <QPushButton>\n#include <QTextBrowser>\n#include <QLayout>\n\nclass CustomDialog : public QDialog\n{\n    Q_OBJECT\npublic:\n    //文本加按键(按键属于水平布局，文本和按键属于垂直布局)\n    void showCustomDialog(QString windowName, QString windowIcon, QStringList buttonName, QString textContent, QWidget *parent = nullptr);\n\n    //纯按键(垂直布局)\n    void showCustomDialog(QString windowName, QString windowIcon, QStringList buttonName, QWidget *parent = nullptr);\n\n    //纯文本(居中显示,提醒语句)\n    void showCustomDialog(QString windowName, QString windowIcon, QString textContent, QWidget *parent = nullptr);\n\nprivate:\n    QString _WindowName;\n    QString _WindowIcon;\n    QStringList _ButtonName;\n    QString _TextContent;\n    QWidget *_Parent;\n\nsignals:\n    void OutputEvent(QString);\n\n};\n\n#endif // CUSTOMDIALOG_H\n"
  },
  {
    "path": "filedialog.cpp",
    "content": "﻿#include \"filedialog.h\"\n#include \"ui_filedialog.h\"\n//MY Dialog\n#include <mainwindow.h>\n#include <QNetworkReply>\n#include <QJsonArray>\n#include <QTreeWidgetItem>\n#include <QScrollBar>\n#include <QThread>\n#include <QDir>\n#include <QHttpMultiPart>\n#include <QDirIterator>\n#include <QTextBrowser>\n#include <QDesktopWidget>\n//#include <QSizeF>\n\nFileDialog::FileDialog(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::FileDialog)\n{\n    ui->setupUi(this);\n    FUI = (MainWindow*)parent;\n\n//    SelectURL = QUrl(((MainWindow*)FUI)->octonetwork.MainUrl + \"files/local/Demo.gcode\");\n\n    //Init File\n//    QObject::connect(((MainWindow*)FUI)->octonetwork.FSnetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(FSReply(QNetworkReply*)),Qt::UniqueConnection);\n//    ((MainWindow*)FUI)->octonetwork.FSnetworkAccessManager->get(((MainWindow*)FUI)->octonetwork.FileRequest);\n\n    terminal_timer = new QTimer(this);\n\n    terminal_timer->setSingleShot(true);\n\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n\n    QFont _font = ui->Btn_Upload->font();\n    _font.setPointSize(this->maximumWidth() > this->maximumHeight() ? (int)this->maximumHeight()/30 : (int)this->maximumWidth()/30);\n    ui->Btn_Upload->setFont(_font);\n    ui->Btn_Print->setFont(_font);\n    ui->Btn_Delete->setFont(_font);\n\n    /* 创建一个用于应用程序发送网络请求和接收网络应答的\"管理员\" */\n    manager = new QNetworkAccessManager(this);\n    /* 创建一个要发送的请求实例 */\n    request = new QNetworkRequest(QUrl(((MainWindow*)FUI)->octonetwork.MainUrl +\"/files\"));\n    request->setRawHeader(\"X_Api_Key\",((MainWindow*)FUI)->octonetwork.X_API_Key);\n\n//    InitializeUSBDrive();\n\n}\n\nFileDialog::~FileDialog()\n{\n    delete ui;\n}\n\nvoid FileDialog::showEvent(QShowEvent *event)\n{\n    Q_UNUSED(event);\n    RefreshFileList();\n//    ui->Btn_Upload->setEnabled(true);\n}\n\nvoid FileDialog::on_Btn_back_clicked()\n{\n    this->close();\n}\n\nvoid FileDialog::on_Btn_Refresh_pressed()\n{\n    StyleSheet_Temp = ui->Btn_Refresh->styleSheet();\n    ui->Btn_Refresh->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n}\n\nvoid FileDialog::on_Btn_Refresh_released()\n{\n    ui->Btn_Refresh->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid FileDialog::RefreshFileList()\n{\n    ReFreshJson();\n\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n//    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,SLOT(GetDirlist(QStringList)));\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n    {\n        GetDirlist(CommandLine);\n    });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(\"cd /home/pi/USB && find [s,h]d[a-z]* -maxdepth 0 -type d -regex \\\"[s,h]d[a-z][0-9]+$\\\"; cd /home/pi\",TeminalState);\n\n    QObject::connect(terminal_timer,SIGNAL(timeout()),this,SLOT(GetDirlistTimeout()));\n    terminal_timer->start(500);\n}\n\nvoid FileDialog::ReFreshJson()\n{\n    //ReFresh Json\n    ((MainWindow*)FUI)->octonetwork.SD_ReLoad();\n    //Reload FileList\n    //    if(((MainWindow*)FUI)->octonetwork.ConnectState == \"Operational\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Pausing\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Starting\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Printing\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Cancelling\")\n    //    {}\n    ((MainWindow*)FUI)->octonetwork.FSnetworkAccessManager->disconnect(SIGNAL(finished(QNetworkReply*)));//disconnect\n    QObject::connect(((MainWindow*)FUI)->octonetwork.FSnetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(FSReply(QNetworkReply*)),Qt::UniqueConnection);\n    ((MainWindow*)FUI)->octonetwork.FSnetworkAccessManager->get(((MainWindow*)FUI)->octonetwork.FileRequest);\n}\n\nvoid FileDialog::on_Btn_Refresh_clicked()\n{\n    RefreshFileList();\n}\n\nvoid FileDialog::FSReply(QNetworkReply *reply)\n{\n    int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();\n\n    if(reply->error() == QNetworkReply::NoError)\n    {\n        QByteArray replyArray = reply->readAll();\n        QJsonDocument loadDoc(QJsonDocument::fromJson(replyArray));\n        QJsonObject QObj = loadDoc.object();\n        //建立列表\n        ui->treeWidget->clear();\n\n        QTreeWidgetItem *RootItem = new QTreeWidgetItem(ui->treeWidget,QStringList(QString(\"Local\")));\n        RootItem->setIcon(0,QIcon(\":/assets/wenjian.svg\"));\n\n//        QTreeWidgetItem *USBItem = new QTreeWidgetItem(ui->treeWidget,QStringList(QString(\"USB\")));\n//        USBItem->setIcon(0,QIcon(\":/assets/usb.svg\"));\n//        QList<QTreeWidgetItem *> *USBItem;\n\n        SDcardItem = new QTreeWidgetItem(ui->treeWidget,QStringList(QString(\"Board\")));\n        SDcardItem->setIcon(0,QIcon(\":/assets/wenjian.svg\"));\n\n        FilesPraser(RootItem , QObj.constFind(\"files\").value().toArray());\n        QCoreApplication::processEvents();//update Dir\n        QList<QTreeWidgetItem *> USBDev = LoadUSBPath(\"/home/pi/USB\");\n\n        QList<QTreeWidgetItem *> AllItems;\n        AllItems.append(RootItem);\n        AllItems.append(USBDev);\n        AllItems.append(SDcardItem);\n        if(SDcardItem->childCount() <= 0)\n        {\n            SDcardItem->setHidden(true);\n        }\n\n        ui->treeWidget->insertTopLevelItems(0,AllItems);\n        ui->treeWidget->setItemsExpandable(true);\n        ui->treeWidget->expandAll();\n\n        if(QSysInfo::productType() != \"raspbian\"){\n\n            LibLog::LogRec(QString(\"%1___%2___%3\").arg(QString(replyArray)).arg(__FILE__).arg(__LINE__), \"connect\");\n            }\n    }\n    if(QSysInfo::productType() != \"raspbian\")\n    {\n        LibLog::LogRec(QString(\"statusCode : %1___%2___%3\").arg(statusCode).arg(__FILE__).arg(__LINE__), \"connect\");\n        LibLog::LogRec(\"***************************************\" ,\"connect\");\n    }\n    reply->deleteLater();\n    ui->Btn_Delete->setEnabled(false);\n    ui->Btn_Print->setEnabled(false);\n    ui->Btn_Upload->setEnabled(false);\n    ((MainWindow*)FUI)->octonetwork.FSnetworkAccessManager->disconnect(SIGNAL(finished(QNetworkReply*)));//disconnect\n}\nQList<QTreeWidgetItem *> FileDialog::LoadUSBPath(QString USBPath)\n{\n    QList<QTreeWidgetItem *> USBDev;\n    QDir RootDir = QDir(USBPath);\n    if(RootDir.exists() && RootDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot).count() > 0)//文件夹存在，并且包含内容\n    {\n        QDirIterator dir_iterator(USBPath, QDir::Dirs | QDir::NoDotAndDotDot/*,QDirIterator::Subdirectories*/);\n        while(dir_iterator.hasNext())\n        {\n            dir_iterator.next();    \n//            dir_iterator.fileInfo().dir().path();\n            QTreeWidgetItem *USBItem = new QTreeWidgetItem(ui->treeWidget,QStringList(QString(dir_iterator.fileName().toUpper())));\n            USBItem->setIcon(0,QIcon(\":/assets/usb.svg\"));\n\n//            QStringList chilData;\n//            chilData.append(dir_iterator.fileName().toUpper());\n//            QTreeWidgetItem *chilItem = new QTreeWidgetItem(MotherItem,chilData);\n//            chilItem->setIcon(0,QIcon(\":/assets/usb.svg\"));\n            LoadFiles(USBItem , dir_iterator.filePath());\n            USBDev.append(USBItem);\n//            MotherItem->addChild(chilItem);\n        }\n    }\n    return USBDev;\n}\n\nvoid FileDialog::LoadFiles(QTreeWidgetItem *MotherItem , QString DirPath)\n{\n    QDirIterator dir_iterator(DirPath,QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot/*,QDirIterator::Subdirectories*/);\n    while(dir_iterator.hasNext())\n    {\n        dir_iterator.next();\n//        QFileInfo file_info = dir_iterator.fileInfo();\n//        QString files = file_info.absoluteFilePath();\n\n        if(dir_iterator.fileInfo().isDir())\n        {\n            if(dir_iterator.fileInfo().fileName() == \"System Volume Information\")\n                continue;\n            QStringList chilData;\n            chilData.append(dir_iterator.fileName());\n            QTreeWidgetItem *chilItem = new QTreeWidgetItem(MotherItem,chilData);\n            chilItem->setIcon(0,QIcon(\":/assets/wenjian.svg\"));\n            LoadFiles(chilItem , dir_iterator.filePath());\n            MotherItem->addChild(chilItem);\n        }\n        else if(dir_iterator.fileInfo().isFile())\n        {\n            QStringList chilData;\n            chilData.append(dir_iterator.fileName());\n            chilData.append(dir_iterator.filePath());\n            QTreeWidgetItem *chilItem = new QTreeWidgetItem(MotherItem,chilData);\n\n            QString ext = dir_iterator.fileInfo().suffix().toLower();\n            if(ext == \"gco\" || ext == \"gcode\" || ext == \"g\")//machinecode\n            {\n                chilItem->setIcon(0,QIcon(\":/assets/3ddayin.svg\"));\n            }\n            else if(ext == \"stl\" || ext == \"obj\" )//model object\n            {\n                chilItem->setIcon(0,QIcon(\":/assets/object.svg\"));\n            }\n            else\n            {\n                chilItem->setIcon(0,QIcon(\":/assets/rizhi.svg\"));\n            }\n            MotherItem->addChild(chilItem);\n        }\n    }\n}\n\nvoid FileDialog::FilesPraser(QTreeWidgetItem *MotherItem , QJsonArray Data)\n{\n    //QList<QTreeWidgetItem *> _return;\n    foreach(QJsonValue item,Data)\n    {\n        if(item.toObject().constFind(\"origin\").value().toString() == \"local\")\n        {\n            QStringList chilData;\n            chilData.append(Hex2QString(item.toObject().constFind(\"display\").value().toString()));\n            chilData.append(item.toObject().constFind(\"refs\").value().toObject().constFind(\"resource\").value().toString());\n            QTreeWidgetItem *chilItem = new QTreeWidgetItem(MotherItem,chilData);\n            chilItem->setIcon(0,\n                              item.toObject().constFind(\"type\").value().toString() == \"machinecode\" ? QIcon(\":/assets/3ddayin.svg\") :\n                              item.toObject().constFind(\"type\").value().toString() == \"model\" ? QIcon(\":/assets/object.svg\") : QIcon(\":/assets/rizhi.svg\"));\n            MotherItem->addChild(chilItem);\n        }\n        else if(item.toObject().constFind(\"origin\").value().toString() == \"sdcard\")\n        {\n            QStringList chilData;\n            chilData.append(Hex2QString(item.toObject().constFind(\"display\").value().toString()));\n            chilData.append(item.toObject().constFind(\"refs\").value().toObject().constFind(\"resource\").value().toString());\n            QTreeWidgetItem *chilItem = new QTreeWidgetItem(SDcardItem,chilData);\n            chilItem->setIcon(0,\n                              item.toObject().constFind(\"type\").value().toString() == \"machinecode\" ? QIcon(\":/assets/3ddayin.svg\") :\n                              item.toObject().constFind(\"type\").value().toString() == \"model\" ? QIcon(\":/assets/object.svg\") : QIcon(\":/assets/rizhi.svg\"));\n            SDcardItem->addChild(chilItem);\n        }\n        else if(item.toObject().constFind(\"type\").value().toString() == \"folder\")\n        {\n            QStringList chilData;\n            chilData.append(item.toObject().constFind(\"display\").value().toString());\n            QTreeWidgetItem *chilItem = new QTreeWidgetItem(MotherItem,chilData);\n            chilItem->setIcon(0,QIcon(\":/assets/wenjian.svg\"));\n//            if(item.toObject().constFind(\"display\").value().toString().contains(QRegExp(\"[s,h]d[a-z][0-9]+\")))\n//                chilItem->setIcon(0,QIcon(\":/assets/usb.svg\"));\n//            else\n//                chilItem->setIcon(0,QIcon(\":/assets/wenjian.svg\"));\n            FilesPraser(chilItem , item.toObject().constFind(\"children\").value().toArray());\n            MotherItem->addChild(chilItem);\n        }\n    }\n}\n\nvoid FileDialog::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)\n{\n    if(QSysInfo::productType() != \"raspbian\")\n    {       \n        LibLog::LogRec(QString(\"%1:%2___%3___%4\").arg(column).arg(item->text(column)).arg(__FILE__).arg(__LINE__), \"connect\");\n\n        LibLog::LogRec(QString(\"%1___%3___%4\").arg(item->data(1,0).toString()).arg(__FILE__).arg(__LINE__), \"connect\");\n    }\n\n    if(((MainWindow*)FUI)->octonetwork.ConnectState.contains(\"Printing\") ||((MainWindow*)FUI)->octonetwork.ConnectState == \"Starting print from SD\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Starting\")\n        return;\n    QString ext = item->data(1,0).toString().split('.').last();\n    if(ext.toLower() == \"gcode\" || ext.toLower() == \"gco\" || ext.toLower() == \"g\")\n    {\n        SelectURL = QUrl(item->data(1,0).toString());\n        DisplayName = item->data(0,0).toString();\n        ui->Btn_Delete->setEnabled(true);\n        ui->Btn_Print->setEnabled(true);\n        if(!SelectURL.url().startsWith(\"http://\"))\n            ui->Btn_Upload->setEnabled(true);\n        else\n            ui->Btn_Upload->setEnabled(false);\n    }\n    else\n    {\n        ui->Btn_Delete->setEnabled(false);\n        ui->Btn_Print->setEnabled(false);\n        ui->Btn_Upload->setEnabled(false);\n    }\n}\n\n//quick print\nvoid FileDialog::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)\n{\n    Q_UNUSED(column);\n    QString ext = item->data(1,0).toString().split('.').last();\n    if(ext.toLower() == \"gcode\"  || ext.toLower() == \"gco\" || ext.toLower() == \"g\")\n    {\n        ((MainWindow*)FUI)->octonetwork.JobSwitch(SelectURL);\n        this->close();\n    }\n}\n\nQUrl FileDialog::GetRealURL(QUrl URL)\n{\n    QUrl _URL;\n    if(!URL.url().startsWith(\"http://\"))\n    {\n//        QString newFileName = QString2Hex(URL.url() , false);\n//        //构建新文件名称\n//        if(!QDir(\"/home/pi\").exists(\"temp\"))\n//            QDir(\"/home/pi\").mkdir(\"temp\");\n//        if(QFile::exists(\"/home/pi/temp/\"+newFileName))\n//            QFile::remove(\"/home/pi/temp/\"+newFileName);\n//        //检查同名堆积\n//        QFile::copy(URL.url(),\"/home/pi/temp/\"+newFileName);\n//        //复制外部路径文件到临时文件夹\n//        _URL = UploadFile(\"/home/pi/temp/\"+newFileName);\n//        //上传临时文件至Octoprint并索取真实URL\n//        QFile::remove(\"/home/pi/temp/\"+newFileName);\n//        //删除临时文件\n\n        _URL = UploadFile(URL.url());\n    }\n    else\n    {\n        _URL = URL;\n    }\n    return _URL;\n}\n\nvoid FileDialog::DeleteURL(QUrl URL)\n{\n    QString FileName = Hex2QString(URL.url(),false);\n\n    QStringList btnName = {\"Yes\", \"No\",} ;\n    CustomDialog *newDialog = new CustomDialog();\n    QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n    {\n        if(instruct == \"Yes\")\n        {\n            if(URL.url().toLower().startsWith(\"http://\"))\n            {\n                request->setUrl(URL);\n                if(manager->deleteResource(*request)->error() == QNetworkReply::NoError)\n                    RefreshFileList();\n            }\n            else\n            {\n                DeleteFile(URL.url());\n            }\n            SelectURL.setUrl(\"\");\n        }\n    });\n    newDialog->showCustomDialog(\"Delete\",\":/assets/delete.svg\",btnName,\"Do you want to Delete \"+FileName+\" ?\",this);\n}\n\nvoid FileDialog::DeleteFile(QString FilePath)\n{\n    if(QFile::exists(FilePath))\n    {\n        QFile::remove(FilePath);\n        RefreshFileList();\n    }\n}\n\nQUrl FileDialog::UploadFile(QString FilePath)\n{\n    QUrl _return;\n    //设置发送的数据\n    QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType);\n\n    QFile *file = new QFile(FilePath);      //由于是异步，所以记得一定要new\n    file->open(QIODevice::ReadOnly);\n\n    QHttpPart contentPart;\n    contentPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant(QString(\"form-data; name=\\\"file\\\"; filename=\\\"%1\\\"\").arg(QFileInfo(FilePath).fileName())));\n    contentPart.setBodyDevice(file);\n    file->setParent(multiPart);\n    multiPart->append(contentPart);\n\n    request->setUrl(QUrl(((MainWindow*)FUI)->octonetwork.MainUrl +\"/files/local\"));\n\n    QNetworkReply *reply = manager->post(*request,multiPart);\n\n    while(!reply->isFinished())\n        QCoreApplication::processEvents();//update http post\n\n//    QMessageBox::information(NULL, \"item.dir().path()\", \"reply statusCode:\" + QString::number(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()), QMessageBox::Ok, QMessageBox::Ok);//Debug\n    file->close();\n    if(reply->error() == QNetworkReply::NoError)\n    {\n        QByteArray replyArray = reply->readAll();\n        QJsonDocument loadDoc(QJsonDocument::fromJson(replyArray));\n        QJsonObject QObj = loadDoc.object();\n\n        QList<QString> ResourcesLocation = {\"files\",\"local\",\"refs\",\"resource\"};\n        _return = QUrl(((MainWindow*)FUI)->octonetwork.SearchJsonValue( ResourcesLocation, QObj).toString());\n    }\n    reply->deleteLater();\n    return _return;\n}\n\nQUrl FileDialog::GetRealURL()\n{\n    return GetRealURL(SelectURL);\n}\n\nvoid FileDialog::GetDirlist(QStringList CommandLine)\n{\n    disconnect(terminal_timer,SIGNAL(timeout()),0,0);\n    terminal_timer->stop();\n    DirList.clear();\n    foreach(QString Dir , CommandLine)\n    {\n        DirList.append(Dir.split(\"\\t\", QString::SkipEmptyParts));\n    }\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n\n//        QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,SLOT(GetDevlist(QStringList)));\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n    {\n        GetDevlist(CommandLine);\n    });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(\"cd /dev/ && find [s,h]d[a-z]* -maxdepth 0 -type b -regex \\\"[s,h]d[a-z][0-9]+$\\\"; cd /home/pi\",TeminalState);\n\n    QObject::connect(terminal_timer,SIGNAL(timeout()),this,SLOT(GetDevlistTimeout()));\n    terminal_timer->start(500);\n}\n\nvoid FileDialog::GetDirlistTimeout()\n{\n    DirList.clear();\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n\n//    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,SLOT(GetDevlist(QStringList)));\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n    {\n        GetDevlist(CommandLine);\n    });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(\"cd /dev/ && find [s,h]d[a-z]* -maxdepth 0 -type b -regex \\\"[s,h]d[a-z][0-9]+$\\\"; cd /home/pi\",TeminalState);\n\n    disconnect(terminal_timer,SIGNAL(timeout()),0,0);\n    QObject::connect(terminal_timer,SIGNAL(timeout()),this,SLOT(GetDevlistTimeout()));\n    terminal_timer->start(500);\n}\n\nvoid FileDialog::GetDevlist(QStringList CommandLine)\n{\n    disconnect(terminal_timer,SIGNAL(timeout()),0,0);\n    terminal_timer->stop();\n\n    DevList.clear();\n    foreach(QString Dev , CommandLine)\n    {\n        DevList.append(Dev.split(\"\\t\", QString::SkipEmptyParts));\n    }\n\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n\n    RmList.clear();\n    foreach(QString Dir , DirList)\n    {\n        if(!DevList.contains(Dir))\n            RmList.append(Dir);\n    }\n    NewList.clear();\n    foreach(QString Dev , DevList)\n    {\n        if(!DirList.contains(Dev))\n            NewList.append(Dev);\n    }\n    if(!RmList.isEmpty())\n    {\n        QString RmCMD = \"cd /home/pi/USB ; sudo umount \";\n//        RmCMD = RmCMD + RmList.join(\" \") + \" ; rm -rf \" + RmList.join(\" \") + \" ; cd /home/pi\";\n        RmCMD = RmCMD + RmList.join(\" \")  + \" ; cd /home/pi\";\n        ((MainWindow*)FUI)->terminaldialog->SendCMD(RmCMD,TeminalState);\n        QCoreApplication::processEvents();\n        QThread::msleep(500);\n        QCoreApplication::processEvents();\n\n        RmCMD = \"cd /home/pi/USB ; rm -rf \" + RmList.join(\" \") + \" ; cd /home/pi\";\n        ((MainWindow*)FUI)->terminaldialog->SendCMD(RmCMD,TeminalState);\n        QCoreApplication::processEvents();\n        QThread::msleep(500);\n        QCoreApplication::processEvents();\n\n        if(!SelectURL.url().startsWith(\"http://\"))\n        {\n            SelectURL = QUrl();\n        }\n    }\n\n    if(!NewList.isEmpty())//sudo mount -o uid=pi,gid=pi /dev/sda1 /mnt/1GB_USB_flash\n    {\n        QString NewCMD = \"\";\n        QDir dir(\"/home/pi/USB\");//Load USB Path\n        if(QSysInfo::productType() == \"raspbian\" && !dir.exists())\n        {\n            NewCMD = \"mkdir /home/pi/USB ; \";\n        }\n        NewCMD = NewCMD + \"cd /home/pi/USB ; mkdir \" + NewList.join(\" \");\n        foreach(QString Newitem , NewList)\n        {\n            NewCMD = NewCMD + \" ; sudo mount -o uid=pi,gid=pi,utf8=true,iocharset=utf8 /dev/\" + Newitem + \" \" + Newitem;//字符集编码异常Debug文件夹被破坏\n        }\n        NewCMD = NewCMD + \" ; cd /home/pi\";\n\n        ((MainWindow*)FUI)->terminaldialog->SendCMD(NewCMD,TeminalState);\n        QCoreApplication::processEvents();\n        QThread::msleep(500);\n        QCoreApplication::processEvents();\n    }\n\n    if(!RmList.isEmpty() || !NewList.isEmpty())\n    {\n        QThread::msleep(500);\n        ReFreshJson();\n    }\n}\n\nvoid FileDialog::GetDevlistTimeout()\n{\n    DevList.clear();\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    disconnect(terminal_timer,SIGNAL(timeout()),0,0);\n\n    RmList.clear();\n    foreach(QString Dir , DirList)\n    {\n        if(!DevList.contains(Dir))\n            RmList.append(Dir);\n    }\n    NewList.clear();\n    foreach(QString Dev , DevList)\n    {\n        if(!DirList.contains(Dev))\n            NewList.append(Dev);\n    }\n\n    if(!RmList.isEmpty())\n    {\n        QString RmCMD = \"cd /home/pi/USB ; sudo umount \";\n//        RmCMD = RmCMD + RmList.join(\" \") + \" ; rm -rf \" + RmList.join(\" \") + \" ; cd /home/pi\";\n        RmCMD = RmCMD + RmList.join(\" \")  + \" ; cd /home/pi\";\n        ((MainWindow*)FUI)->terminaldialog->SendCMD(RmCMD,TeminalState);\n        QCoreApplication::processEvents();\n        QThread::msleep(500);\n        QCoreApplication::processEvents();\n\n        RmCMD = \"cd /home/pi/USB ; rm -rf \" + RmList.join(\" \") + \" ; cd /home/pi\";\n        ((MainWindow*)FUI)->terminaldialog->SendCMD(RmCMD,TeminalState);\n        QCoreApplication::processEvents();\n        QThread::msleep(500);\n        QCoreApplication::processEvents();\n\n        if(!SelectURL.url().startsWith(\"http://\"))\n        {\n            SelectURL = QUrl();\n        }\n    }\n\n    if(!NewList.isEmpty())\n    {\n        QString NewCMD = \"\";\n        QDir dir(\"/home/pi/USB\");//Load USB Path\n        if(QSysInfo::productType() == \"raspbian\" && !dir.exists())\n        {\n            NewCMD = \"mkdir /home/pi/USB ; \";\n        }\n        NewCMD = NewCMD + \"cd /home/pi/.octoprint/uploads  ;  mkdir \" + NewList.join(\" \");\n        foreach(QString Newitem , NewList)\n        {\n            NewCMD = NewCMD + \" ; sudo mount -o uid=pi,gid=pi,utf8=true,iocharset=utf8 /dev/\" + Newitem + \" \" + Newitem;\n            //字符集编码异常（iocharset=cp936,codepage=cp936） posix=true utf8=true uid=pi,gid=pi nls=utf8\n        }\n        NewCMD = NewCMD + \" ; cd /home/pi\";\n        ((MainWindow*)FUI)->terminaldialog->SendCMD(NewCMD,TeminalState);\n        QCoreApplication::processEvents();\n        QThread::msleep(500);\n        QCoreApplication::processEvents();\n    }\n\n    if(!RmList.isEmpty() || !NewList.isEmpty())\n    {\n//        QThread::msleep(500);\n        ReFreshJson();\n    }\n}\n\nvoid FileDialog::InitializeUSBDrive()\n{\n    QDir dir(\"/home/pi/USB\");//Load USB Path\n    if(QSysInfo::productType() == \"raspbian\" && dir.exists())\n    {\n        QStringList DirList = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);\n        QString RmCMD = \"cd /home/pi/USB ; \";\n        RmCMD = RmCMD + \"sudo umount \" + DirList.join(\" \") + \" ; cd /home/pi\";\n        ((MainWindow*)FUI)->terminaldialog->SendCMD(RmCMD,TeminalState);\n\n//        QStringList DirList = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);\n//        QString RmCMD = \"cd /home/pi/USB ; \";\n//        RmCMD = RmCMD + \"sudo umount \" + DirList.join(\" \") + \" ;  rm -rf \" + DirList.join(\" \") + \" ; cd /home/pi\";\n//        ((MainWindow*)FUI)->terminaldialog->SendCMD(RmCMD,TeminalState);\n\n        QCoreApplication::processEvents();\n        QThread::msleep(500);\n        QCoreApplication::processEvents();\n\n        RmCMD = \"cd /home/pi/USB ; \";\n        RmCMD = RmCMD + \"  rm -rf \" + DirList.join(\" \") + \" ; cd /home/pi\";\n        ((MainWindow*)FUI)->terminaldialog->SendCMD(RmCMD,TeminalState);\n        QCoreApplication::processEvents();\n        QThread::msleep(500);\n        QCoreApplication::processEvents();\n    }\n    RefreshFileList();\n}\n\nQString FileDialog::QString2Hex(QString str ,bool FullPath)\n{\n    QString _returnData = \"--BTT--\";\n    QStringList strList = str.split('.');\n    if(str.contains(QRegExp(\"([a-z]|[A-Z])+:\\\\\\\\\")))//windows path mode\n    {\n        if(FullPath)\n            _returnData = str.left(str.length() - str.split(\"\\\\\").last().length()) + _returnData;\n        str = str.split(\"\\\\\").last();\n    }\n    else if(str.startsWith(\"/\"))//unix path mode\n    {\n        if(FullPath)\n            _returnData = str.left(str.length() - str.split(\"/\").last().length()) + _returnData;\n        str = str.split(\"/\").last();\n    }\n    QByteArray hexData = str.left(str.length() - strList.last().length() - 1).toUtf8();\n    _returnData = _returnData + hexData.toHex('-').toUpper()  + (strList.length() >= 2 ? (\".\" + strList.last()) : \"\");\n    return _returnData;\n}\n\nQString FileDialog::Hex2QString(QString hx,bool FullPath)\n{\n    QString _returnData = \"\";\n    if(hx.contains((\"--BTT--\")))\n    {\n        QString fileNameWExt = hx.split(\"--BTT--\").last();\n        QStringList strList = fileNameWExt.split('.');\n        QByteArray hexData = QByteArray::fromHex(fileNameWExt.left(fileNameWExt.length() - strList.last().length() - 1).replace(\"-\",\"\").toLocal8Bit());\n        _returnData = FullPath ? hx.left(hx.length()-fileNameWExt.length() - 7) : \"\" + QString::fromUtf8(hexData.data(),hexData.size()) + (strList.length() >= 2 ? (\".\" + strList.last()) : \"\");\n    }\n    else\n    {\n        if(FullPath)\n            _returnData=hx;\n        else\n        {\n            if(hx.contains(QRegExp(\"([a-z]|[A-Z])+:\\\\\\\\\")))//windows path mode\n            {\n                _returnData = hx.split(\"\\\\\").last();\n            }\n            else if(hx.startsWith(\"/\"))//unix path mode\n            {\n                _returnData = hx.split(\"/\").last();\n            }\n            else if(hx.startsWith(\"http://\"))//url mode\n            {\n                _returnData = hx.split(\"/\").last();\n            }\n            else\n                _returnData=hx;\n        }\n    }\n    return _returnData;\n}\n\nvoid FileDialog::on_Btn_Upload_clicked()\n{\n    if(!SelectURL.url().startsWith(\"http://\") && !SelectURL.url().isEmpty())\n    {\n        SelectURL=UploadFile(SelectURL.url());\n        RefreshFileList();\n    }\n}\n\nvoid FileDialog::on_Btn_Print_clicked()\n{\n    if(!SelectURL.url().isEmpty())\n    {\n        ((MainWindow*)FUI)->octonetwork.JobSwitch(SelectURL);\n        this->close();\n    }\n}\n\nvoid FileDialog::on_Btn_Delete_clicked()\n{\n    if(!SelectURL.url().isEmpty())\n    {\n        DeleteURL(SelectURL);\n    }\n}\n"
  },
  {
    "path": "filedialog.h",
    "content": "﻿#ifndef FILEDIALOG_H\n#define FILEDIALOG_H\n\n#include <QDialog>\n#include <QSizeF>\n//MY Dialog\n#include <QNetworkReply>\n#include <QTreeWidgetItem>\n#include <QTimer>\n#include <QNetworkReply>\n#include \"liblog.h\"\n\n#define BTSTYLE6 \"QPushButton        {padding: 10px;border-style: solid;border-width: 1px;border-radius: 20px;border-color: rgb(245,246,255); color: rgb(245, 246, 255);}\"\\\n                \"QPushButton:hover  {padding: 10px;border-style: solid;border-width: 1px;border-radius: 20px;border-color: rgb(245,246,255); background-color:rgb(128,128,128,128);color: rgb(245, 246, 255);}\"\\\n                \"QPushButton:pressed{padding: 10px;border-style: solid;border-width: 1px;border-radius: 20px;border-color: rgb(245,246,255); background-color:rgb(128,128,128,128);color: rgb(245, 246, 255);padding-right:4px;padding-bottom:4px;}\"\n\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n\nnamespace Ui {\n    class FileDialog;\n}\n\nclass FileDialog : public QDialog\n{\n        Q_OBJECT\n\n    public:\n        explicit FileDialog(QWidget *parent = nullptr);\n        ~FileDialog();\n\n    private slots:\n        virtual void on_Btn_back_clicked();\n        virtual void on_Btn_Refresh_pressed();\n        virtual void on_Btn_Refresh_released();\n        virtual void on_Btn_Refresh_clicked();\n        virtual void FSReply(QNetworkReply *reply);\n        virtual void ReFreshJson();\n        virtual void GetDirlistTimeout();\n        virtual void GetDevlistTimeout();\n        virtual void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);\n        virtual void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);\n        void on_Btn_Upload_clicked();\n        void on_Btn_Print_clicked();\n        void on_Btn_Delete_clicked();\n\n    private:\n        Ui::FileDialog *ui;\n\n    public:\n        QUrl SelectURL;\n        QString DisplayName;\n        QUrl GetRealURL(QUrl URL);\n        QUrl GetRealURL();\n        static QString QString2Hex(QString str,bool FullPath = true);\n        static QString Hex2QString(QString hx,bool FullPath = true);\n        void InitializeUSBDrive();\n\n    private:\n        virtual void FilesPraser(QTreeWidgetItem *MotherItem , QJsonArray Data);\n        virtual QList<QTreeWidgetItem *> LoadUSBPath(QString USBPath);\n        virtual void LoadFiles(QTreeWidgetItem *MotherItem , QString DirPath);\n        virtual void RefreshFileList();\n        virtual void GetDirlist(QStringList CommandLine);\n        virtual void GetDevlist(QStringList CommandLine);\n        void DeleteURL(QUrl URL);\n        void DeleteFile(QString FilePath);\n        QUrl UploadFile(QString FilePath);\n\n    private:\n        QNetworkAccessManager *manager = new QNetworkAccessManager();\n        QNetworkRequest *request;\n        QString StyleSheet_Temp;\n        QWidget *FUI;\n        QTreeWidgetItem *SDcardItem;\n        QStringList DirList;\n        QStringList DevList;\n        QStringList RmList;\n        QStringList NewList;\n        QTimer *terminal_timer;\n\n        QString TeminalState = \"-q-e\";\n\n    protected:\n        void showEvent(QShowEvent *event);\n};\n\n#endif // FILEDIALOG_H\n"
  },
  {
    "path": "filedialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>FileDialog</class>\n <widget class=\"QDialog\" name=\"FileDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Files</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/wenjian.svg</normaloff>:/assets/wenjian.svg</iconset>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"1,7\">\n   <property name=\"spacing\">\n    <number>3</number>\n   </property>\n   <property name=\"sizeConstraint\">\n    <enum>QLayout::SetDefaultConstraint</enum>\n   </property>\n   <property name=\"leftMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>5</number>\n   </property>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2\" stretch=\"0,0,0,0,0\">\n     <property name=\"spacing\">\n      <number>6</number>\n     </property>\n     <property name=\"sizeConstraint\">\n      <enum>QLayout::SetDefaultConstraint</enum>\n     </property>\n     <property name=\"topMargin\">\n      <number>0</number>\n     </property>\n     <property name=\"rightMargin\">\n      <number>0</number>\n     </property>\n     <property name=\"bottomMargin\">\n      <number>0</number>\n     </property>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_back\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/huitui.svg</normaloff>:/assets/huitui.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeType\">\n        <enum>QSizePolicy::Expanding</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Logo\">\n       <property name=\"styleSheet\">\n        <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\n</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/folder.svg</normaloff>:/assets/folder.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_2\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeType\">\n        <enum>QSizePolicy::Expanding</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Refresh\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Minimum\" vsizetype=\"Fixed\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"maximumSize\">\n        <size>\n         <width>76</width>\n         <height>72</height>\n        </size>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"layoutDirection\">\n        <enum>Qt::RightToLeft</enum>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/sync-alt.svg</normaloff>:/assets/sync-alt.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <layout class=\"QVBoxLayout\" name=\"verticalLayout_3\" stretch=\"1,0,0,0\">\n     <property name=\"spacing\">\n      <number>3</number>\n     </property>\n     <property name=\"bottomMargin\">\n      <number>0</number>\n     </property>\n     <item>\n      <widget class=\"QTreeWidget\" name=\"treeWidget\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>30</pointsize>\n        </font>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"editTriggers\">\n        <set>QAbstractItemView::NoEditTriggers</set>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>64</width>\n         <height>64</height>\n        </size>\n       </property>\n       <property name=\"animated\">\n        <bool>true</bool>\n       </property>\n       <property name=\"wordWrap\">\n        <bool>true</bool>\n       </property>\n       <attribute name=\"headerVisible\">\n        <bool>false</bool>\n       </attribute>\n       <column>\n        <property name=\"text\">\n         <string notr=\"true\">1</string>\n        </property>\n       </column>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"verticalSpacer\">\n       <property name=\"orientation\">\n        <enum>Qt::Vertical</enum>\n       </property>\n       <property name=\"sizeType\">\n        <enum>QSizePolicy::Maximum</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>20</width>\n         <height>5</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <layout class=\"QHBoxLayout\" name=\"horizontalLayout_4\" stretch=\"0,1,0,1,0,1,0\">\n       <property name=\"spacing\">\n        <number>6</number>\n       </property>\n       <item>\n        <spacer name=\"horizontalSpacer_3\">\n         <property name=\"orientation\">\n          <enum>Qt::Horizontal</enum>\n         </property>\n         <property name=\"sizeType\">\n          <enum>QSizePolicy::Fixed</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>10</width>\n           <height>20</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n       <item>\n        <widget class=\"QPushButton\" name=\"Btn_Upload\">\n         <property name=\"minimumSize\">\n          <size>\n           <width>0</width>\n           <height>50</height>\n          </size>\n         </property>\n         <property name=\"whatsThis\">\n          <string>BTStyleSheet6</string>\n         </property>\n         <property name=\"text\">\n          <string>UpLoad to OctoPrint</string>\n         </property>\n         <property name=\"icon\">\n          <iconset resource=\"assets.qrc\">\n           <normaloff>:/assets/upload.svg</normaloff>:/assets/upload.svg</iconset>\n         </property>\n         <property name=\"iconSize\">\n          <size>\n           <width>40</width>\n           <height>40</height>\n          </size>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <spacer name=\"horizontalSpacer_4\">\n         <property name=\"orientation\">\n          <enum>Qt::Horizontal</enum>\n         </property>\n         <property name=\"sizeType\">\n          <enum>QSizePolicy::Fixed</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>10</width>\n           <height>20</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n       <item>\n        <widget class=\"QPushButton\" name=\"Btn_Print\">\n         <property name=\"minimumSize\">\n          <size>\n           <width>0</width>\n           <height>50</height>\n          </size>\n         </property>\n         <property name=\"whatsThis\">\n          <string>BTStyleSheet6</string>\n         </property>\n         <property name=\"text\">\n          <string>Print</string>\n         </property>\n         <property name=\"icon\">\n          <iconset resource=\"assets.qrc\">\n           <normaloff>:/assets/print.svg</normaloff>:/assets/print.svg</iconset>\n         </property>\n         <property name=\"iconSize\">\n          <size>\n           <width>40</width>\n           <height>40</height>\n          </size>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <spacer name=\"horizontalSpacer_5\">\n         <property name=\"orientation\">\n          <enum>Qt::Horizontal</enum>\n         </property>\n         <property name=\"sizeType\">\n          <enum>QSizePolicy::Fixed</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>10</width>\n           <height>20</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n       <item>\n        <widget class=\"QPushButton\" name=\"Btn_Delete\">\n         <property name=\"minimumSize\">\n          <size>\n           <width>0</width>\n           <height>50</height>\n          </size>\n         </property>\n         <property name=\"whatsThis\">\n          <string>BTStyleSheet6</string>\n         </property>\n         <property name=\"text\">\n          <string>Delete</string>\n         </property>\n         <property name=\"icon\">\n          <iconset resource=\"assets.qrc\">\n           <normaloff>:/assets/delete.svg</normaloff>:/assets/delete.svg</iconset>\n         </property>\n         <property name=\"iconSize\">\n          <size>\n           <width>40</width>\n           <height>40</height>\n          </size>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <spacer name=\"horizontalSpacer_6\">\n         <property name=\"orientation\">\n          <enum>Qt::Horizontal</enum>\n         </property>\n         <property name=\"sizeType\">\n          <enum>QSizePolicy::Fixed</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>10</width>\n           <height>20</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </item>\n     <item>\n      <spacer name=\"verticalSpacer_2\">\n       <property name=\"orientation\">\n        <enum>Qt::Vertical</enum>\n       </property>\n       <property name=\"sizeType\">\n        <enum>QSizePolicy::Fixed</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>10</width>\n         <height>5</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "gcodedialog.cpp",
    "content": "﻿#include \"gcodedialog.h\"\n#include \"ui_gcodedialog.h\"\n#include <QTreeWidgetItem>\n#include <QScrollBar>\n//#include <QSizeF>\n#include <QTimer>\n#include <QStringList>\n#include <mainwindow.h>\n#include <QTextCodec>\n#include \"inputdialog.h\"\n\n#include <QWebSocket>\n#include <QJsonArray>\n#include <QJsonDocument>\n#include <QJsonObject>\n\nGcodeDialog::GcodeDialog(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::GcodeDialog)\n{\n    ui->setupUi(this);\n\n    FUI = (MainWindow*)parent;//((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_Setting);\n\n    ui->Sender->setFocus();\n\n\n    _ptimer = new QTimer();\n    connect(_pdataRecvWS,SIGNAL(disconnected()),this,SLOT(onWSDisconnected()),Qt::AutoConnection);\n    connect(_pdataRecvWS,SIGNAL(textMessageReceived(QString)),this,SLOT(onWSTextReceived(QString)),Qt::AutoConnection);\n    connect(_pdataRecvWS,SIGNAL(connected()),this,SLOT(onWSConnected()),Qt::AutoConnection);\n    connect(_ptimer,SIGNAL(timeout()),this,SLOT(onWSReconnect()),Qt::AutoConnection);\n    _pdataRecvWS->open(QUrl(\"ws://\"+((MainWindow*)FUI)->octonetwork.MainIP+\"/sockjs/websocket\"));\n//    _pdataRecvWS->open(QUrl(\"ws://192.168.100.111/sockjs/websocket\"));\n\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n}\n\nGcodeDialog::~GcodeDialog()\n{\n    delete ui;\n}\n\nvoid GcodeDialog::showEvent(QShowEvent *event)\n{\n    Q_UNUSED(event);\n}\n\nvoid GcodeDialog::on_Btn_Back_clicked()\n{\n    this->close();\n}\n\nvoid GcodeDialog::on_Btn_Send_clicked()\n{\n    if(ui->Sender->text().isEmpty())\n    {\n//        ui->Sender->setFocus();\n        return;\n    }\n    ui->Sender->setText(ui->Sender->text().trimmed());\n\n//    SendCMD(ui->Sender->text());\n    ((MainWindow*)FUI)->octonetwork.SendGCode(ui->Sender->text());\n\n    ui->Sender->setFocus();\n}\n\nvoid GcodeDialog::on_pushButton_clicked()\n{\n    ui->Receiver->clear();\n}\n\nvoid GcodeDialog::on_Btn_Logo_clicked()\n{\n\n}\n\n//断开连接会触发这个槽函数\nvoid GcodeDialog::onWSDisconnected()\n{\n    _ptimer->start();\n}\n//连接成功会触发这个槽函数\nvoid GcodeDialog::onWSConnected()\n{\n    _ptimer->stop();\n}\n//收到服务发来的消息会触发这个槽函数\nvoid GcodeDialog::onWSTextReceived(QString msg)\n{\n//    msg = msg.replace(\"\\\\\",\"\\\"\");\n    if(!msg.trimmed().startsWith(\"{\\\"current\\\":\") || msg.trimmed().length() == 0)\n        return;\n    QJsonDocument loadDoc(QJsonDocument::fromJson(msg.toUtf8()));\n    QJsonObject QObj = loadDoc.object();\n    QList<QString> SearchLink ;\n    SearchLink << \"current\" << \"logs\";\n    foreach(QJsonValue _value, SearchWSJsonValue(SearchLink , QObj).toArray())\n    {\n        ui->Receiver->append(_value.toString());\n        //        recveData(_value.toString());\n    }\n    //    recveData(SearchWSJsonValue(SearchLink , QObj)[0].toString());\n    //    recvData(SearchJsonValue(SearchLink , QObj).toString());\n}\n//断开连接会启动定时器，触发这个槽函数重新连接\nvoid GcodeDialog::onWSReconnect()\n{\n    _pdataRecvWS->abort();\n    _pdataRecvWS->open(QUrl(\"ws://\"+((MainWindow*)FUI)->octonetwork.MainIP+\"/sockjs/websocket\"));\n}\n\n\n//Find_List_Name : Retrieved List Sequence --> [Grandma,Mother,Me]\n//_QObj:Retrieved Retrieved Json Objecet\nQJsonValue GcodeDialog::SearchWSJsonValue(QList<QString> Find_List_Name , QJsonObject _QObj)\n{\n    QJsonValue returnValue;\n    QList<QString> SearchLink ;\n    SearchLink << Find_List_Name;\n    if(SearchLink.count() > 1)\n    {\n        QString MotherKey = SearchLink[0];\n        SearchLink.removeFirst();\n        if(MotherKey.indexOf(\"*\") >= 0)//wildcard\n        {\n            QJsonArray ArrayValue;\n            for(int i = 0 ; i <= 9 ; i++)\n            {\n                QString TempMotherKey = MotherKey;\n                if(_QObj.find(TempMotherKey.replace(\"*\",QString::number(i))).value().isUndefined())continue;\n                //                if(QSysInfo::productType() != \"raspbian\"){qDebug()<<_QObj.find(TempMotherKey.replace(\"*\",QString::number(i))).value().isUndefined();};\n                QJsonValue data = SearchWSJsonValue(SearchLink , _QObj.constFind(TempMotherKey.replace(\"*\",QString::number(i))).value().toObject());\n                ArrayValue.append(data);\n            }\n            returnValue = ArrayValue;\n        }\n        else\n            returnValue = SearchWSJsonValue(SearchLink , _QObj.constFind(MotherKey).value().toObject());\n    }\n    else\n    {\n        if(SearchLink[0].indexOf(\"*\") >= 0)//wildcard\n        {\n\n        }\n        else\n            returnValue = _QObj.constFind(SearchLink[0]).value();\n    }\n    return returnValue;\n}\nQList<QJsonValue> GcodeDialog::SearchWSJsonValue(QList<QList<QString>> Find_List_Names , QJsonObject _QObj)\n{\n    QList<QJsonValue> _returnValue ;\n    foreach(QList<QString> item , Find_List_Names)\n    {\n        _returnValue.append(SearchWSJsonValue(item,_QObj));\n    }\n    return _returnValue;\n}\n"
  },
  {
    "path": "gcodedialog.h",
    "content": "﻿#ifndef GCODEDIALOG_H\n#define GCODEDIALOG_H\n\n#include <QDialog>\n#include <QProcess>\n#include <QShowEvent>\n#include <QSizeF>\n//#include <QEvent>\n\n#include <QWebSocket>\n#include <QTimer>\n#include <QJsonDocument>\n#include <QJsonObject>\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n\nnamespace Ui {\nclass GcodeDialog;\n}\n\nclass GcodeDialog : public QDialog\n{\n    Q_OBJECT\nsignals:\n\nprivate slots:\n    void onWSDisconnected();\n    void onWSConnected();\n    void onWSTextReceived(QString msg);\n    void onWSReconnect();\n\npublic:\n    explicit GcodeDialog(QWidget *parent = nullptr);\n    ~GcodeDialog();\n\nprivate slots:\n    virtual void on_Btn_Back_clicked();\n\n    virtual void on_Btn_Send_clicked();\n\n    virtual void on_pushButton_clicked();\n\n    virtual void on_Btn_Logo_clicked();\n\nprivate:\n    Ui::GcodeDialog *ui;\n    QWidget *FUI;\n\nprivate:\n    QJsonValue SearchWSJsonValue(QList<QString> Find_List_Name , QJsonObject _QObj);\n    QList<QJsonValue> SearchWSJsonValue(QList<QList<QString>> Find_List_Names , QJsonObject _QObj);\n\n    QTimer* _ptimer;\n\npublic:\n    QWebSocket* _pdataRecvWS = new QWebSocket();\n\nprotected:\n    void showEvent(QShowEvent *event);\n};\n\n#endif // GCODEDIALOG_H\n"
  },
  {
    "path": "gcodedialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>GcodeDialog</class>\n <widget class=\"QDialog\" name=\"GcodeDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Gcode</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/yuanchengkongzhi2.svg</normaloff>:/assets/yuanchengkongzhi2.svg</iconset>\n  </property>\n  <layout class=\"QGridLayout\" name=\"gridLayout\">\n   <property name=\"leftMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>5</number>\n   </property>\n   <item row=\"1\" column=\"1\">\n    <widget class=\"QPushButton\" name=\"Btn_Send\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Minimum\" vsizetype=\"Preferred\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"minimumSize\">\n      <size>\n       <width>150</width>\n       <height>50</height>\n      </size>\n     </property>\n     <property name=\"font\">\n      <font>\n       <pointsize>15</pointsize>\n       <weight>75</weight>\n       <bold>true</bold>\n      </font>\n     </property>\n     <property name=\"whatsThis\">\n      <string>BTStyleSheet7</string>\n     </property>\n     <property name=\"autoFillBackground\">\n      <bool>false</bool>\n     </property>\n     <property name=\"text\">\n      <string>Send gcode</string>\n     </property>\n     <property name=\"default\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item row=\"1\" column=\"0\">\n    <widget class=\"MyLineEdit\" name=\"Sender\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Preferred\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"font\">\n      <font>\n       <pointsize>25</pointsize>\n      </font>\n     </property>\n     <property name=\"focusPolicy\">\n      <enum>Qt::ClickFocus</enum>\n     </property>\n     <property name=\"acceptDrops\">\n      <bool>false</bool>\n     </property>\n     <property name=\"autoFillBackground\">\n      <bool>false</bool>\n     </property>\n     <property name=\"styleSheet\">\n      <string notr=\"true\">background-color: rgb(0, 0, 0);\ncolor: rgb(0, 255, 0);</string>\n     </property>\n     <property name=\"text\">\n      <string/>\n     </property>\n    </widget>\n   </item>\n   <item row=\"0\" column=\"0\" colspan=\"2\">\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3\">\n     <property name=\"leftMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"topMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"rightMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"bottomMargin\">\n      <number>5</number>\n     </property>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Back\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/huitui.svg</normaloff>:/assets/huitui.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_3\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Logo\">\n       <property name=\"styleSheet\">\n        <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\n</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/yuanchengkongzhi.svg</normaloff>:/assets/yuanchengkongzhi.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_4\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QLabel\" name=\"label\">\n       <property name=\"minimumSize\">\n        <size>\n         <width>84</width>\n         <height>78</height>\n        </size>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item row=\"2\" column=\"0\" colspan=\"2\">\n    <widget class=\"QTextEdit\" name=\"Receiver\">\n     <property name=\"font\">\n      <font>\n       <pointsize>15</pointsize>\n      </font>\n     </property>\n     <property name=\"autoFillBackground\">\n      <bool>true</bool>\n     </property>\n     <property name=\"styleSheet\">\n      <string notr=\"true\">background-color: rgb(0, 0, 0);\ncolor: rgb(0, 255, 0);</string>\n     </property>\n     <property name=\"undoRedoEnabled\">\n      <bool>false</bool>\n     </property>\n     <property name=\"readOnly\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item row=\"3\" column=\"0\" colspan=\"2\">\n    <widget class=\"QPushButton\" name=\"pushButton\">\n     <property name=\"font\">\n      <font>\n       <pointsize>20</pointsize>\n      </font>\n     </property>\n     <property name=\"whatsThis\">\n      <string>BTStyleSheet7</string>\n     </property>\n     <property name=\"text\">\n      <string>Clean Window</string>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MyLineEdit</class>\n   <extends>QLineEdit</extends>\n   <header>mylineedit.h</header>\n  </customwidget>\n </customwidgets>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "inputdialog.cpp",
    "content": "﻿#include \"inputdialog.h\"\n#include \"ui_inputdialog.h\"\n#include <mainwindow.h>\n//#include <QSizeF>\n//#include <QSound>\n//#include <QSoundEffect>\n\nInputDialog::InputDialog(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::InputDialog)\n{\n    ui->setupUi(this);\n//    FUI = (MainWindow*)parent;//((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_Setting);\n\n    AllBtns = this->findChildren<QPushButton *>();\n    NumBtns = this->findChildren<QPushButton *>(QRegExp(\"Num_[0-9]\"));\n    CharBtns = this->findChildren<QPushButton *>(QRegExp(\"Char_[A-Z]\"));\n    SymbBtns = this->findChildren<QPushButton *>(QRegExp(\"Symb_[.]*\"));\n\n    foreach(QPushButton *item , CharBtns)\n    {\n        connect(item,SIGNAL(clicked()),this,SLOT(on_CharKey_click()));\n    }\n    foreach(QPushButton *item , NumBtns)\n    {\n        connect(item,SIGNAL(clicked()),this,SLOT(on_NumKey_click()));\n    }\n    foreach(QPushButton *item , SymbBtns)\n    {\n        connect(item,SIGNAL(clicked()),this,SLOT(on_SymbKey_click()));\n    }\n    foreach(QPushButton *item , AllBtns)\n    {\n        if(item->objectName()!=ui->Btn_Undo->objectName()&&item->objectName()!=ui->Btn_Confirm->objectName())\n            connect(item,SIGNAL(clicked()),this,SLOT(on_Beep_clicked()));\n\n        connect(item,SIGNAL(released()),this,SLOT(released_clicked()));\n    }\n\n    QFont font;\n    //font.setPointSize(32*(SizePercent.width() < SizePercent.height() ? SizePercent.width():SizePercent.height()));\n    foreach(QPushButton *item , AllBtns)\n    {\n//        if(item->objectName() == ui->Btn_Back->objectName()\n//            || item->objectName() == ui->Btn_Confirm->objectName())\n//            item->setIconSize(QSize(72*SizePercent.width(),72*SizePercent.height()));\n//        if(item->objectName() == ui->Space->objectName()\n//            || item->objectName() == ui->Key_Left->objectName()\n//            || item->objectName() == ui->Key_Right->objectName()\n//            || item->objectName() == ui->Symb_Wave->objectName()\n//            || item->objectName() == ui->Symb_Semi->objectName()\n//            || item->objectName() == ui->Symb_Quo->objectName())\n        item->setIconSize(QSize((int)(item->iconSize().width()*SizePercent.width()),(int)(item->iconSize().height()*SizePercent.height())));\n        font.setPointSize((int)(item->font().pointSize()*(SizePercent.width() < SizePercent.height() ? SizePercent.width():SizePercent.height())));\n        item->setFont(font);\n    }\n    font.setPointSize((int)(ui->TextBlock->font().pointSize()*(SizePercent.width() < SizePercent.height() ? SizePercent.width():SizePercent.height())));\n    ui->TextBlock->setFont(font);\n\n    //窗体自适应屏幕大小\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n}\n\nInputDialog::~InputDialog()\n{\n    delete ui;\n}\n\nvoid InputDialog::setvalue(QString PlaceholdText , QString InputMode , QString DefaultValue)\n{\n    ui->TextBlock->setPlaceholderText(PlaceholdText);\n    if(!DefaultValue.isNull() && !DefaultValue.trimmed().isEmpty())\n        ui->TextBlock->setText(DefaultValue);\n\n    InputMode = InputMode.trimmed();\n    QRegExp MyRegExp;\n    if(InputMode.toLower().contains(\"-int\"))//Multi Validator\n    {\n        MyRegExp.setPattern((MyRegExp.pattern().count() > 0 ? MyRegExp.pattern() +\"|\" : \"\") + \"[+,-]?(0|[0-9]+)\");\n    }\n    if(InputMode.toLower().contains(\"-double\"))//Multi Validator\n    {\n        MyRegExp.setPattern((MyRegExp.pattern().count() > 0 ? MyRegExp.pattern() +\"|\" : \"\") + \"[+,-]?(0|[0-9]+)[.]?[0-9]*\");\n    }\n    if(InputMode.toLower().contains(\"-lower\"))//Multi Validator\n    {\n        MyRegExp.setPattern((MyRegExp.pattern().count() > 0 ? MyRegExp.pattern() +\"|\" : \"\") + \"[a-z]*\");\n    }\n    if(InputMode.toLower().contains(\"-upper\"))//Multi Validator\n    {\n        MyRegExp.setPattern((MyRegExp.pattern().count() > 0 ? MyRegExp.pattern() +\"|\" : \"\") + \"[A-Z]*\");\n    }\n    if(InputMode.toLower().contains(\" int\"))//single Validator\n    {\n        MyRegExp.setPattern(\"0|[0-9]+\");\n    }\n    if(InputMode.toLower().contains(\" double\"))//single Validator\n    {\n        MyRegExp.setPattern(\"(0|[0-9]+)[.]?[0-9]*\");\n    }\n    if(InputMode.toLower().contains(\"-ip\"))//single Validator\n    {\n        MyRegExp.setPattern(\"((?:(?:25[0-5]|2[0-4]\\\\d|[01]?\\\\d?\\\\d)\\\\.){3}(?:25[0-5]|2[0-4]\\\\d|[01]?\\\\d?\\\\d))\");\n    }\n    if(!InputMode.toLower().contains(\"-all\") && InputMode != \"\")//single Validator\n    {\n        ui->TextBlock->setValidator(new QRegExpValidator(MyRegExp,this));\n    }\n\n    this->show();\n}\n\n\nvoid InputDialog::on_Btn_Undo_clicked()\n{\n    bool SettingMark = false;\n    QString ReturnValue = ui->TextBlock->text();\n\n    this->close();\n    emit closedialog(ReturnValue,SettingMark);\n}\n\nvoid InputDialog::on_CharKey_click()\n{\n    //发送信号者的对象\n    QPushButton *optBtn = qobject_cast<QPushButton *>(sender());\n    //发送信号者的对象名\n    //QString name = sender()->objectName();\n    QKeySequence Key = QKeySequence(QString(optBtn->text().toUpper()[0]));\n//    Qt::Key key = Qt::Key();\n\n//    Qt::KeyboardModifier Key_Modifier = Func_Ang_State ? Qt::ShiftModifier : Qt::NoModifier;\n\n//    ui->TextBlock->setFocus();\n    QKeyEvent keyPress(QEvent::KeyPress, Key[0], Key_Modifier, QString(optBtn->text()[0]));\n//    QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, optBtn->text());\n    QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n\n    ui->TextBlock->setFocus();\n}\n\nvoid InputDialog::on_NumKey_click()\n{\n    QPushButton *optBtn = qobject_cast<QPushButton *>(sender());\n    QKeySequence Key = QKeySequence(QString(optBtn->text().toUpper()[0]));\n//    Qt::KeyboardModifier Key_Modifier = Func_Ang_State ? Qt::ShiftModifier : Qt::NoModifier;\n\n    int KeyData;\n    if(Func_UL_State)\n    {\n        KeyData = Qt::Key();\n    }\n    else\n    {\n        KeyData = Key[0];\n    }\n\n    QKeyEvent keyPress(QEvent::KeyPress, KeyData, Key_Modifier, QString(optBtn->text()[0]));\n    QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n\n    ui->TextBlock->setFocus();\n}\n\nvoid InputDialog::on_SymbKey_click()\n{\n    QPushButton *optBtn = qobject_cast<QPushButton *>(sender());\n//    QKeySequence Key = QKeySequence(QString(optBtn->text()[0]));\n//    Qt::KeyboardModifier Key_Modifier = Func_Ang_State ? Qt::ShiftModifier : Qt::NoModifier;\n\n    QKeyEvent keyPress(QEvent::KeyPress, Qt::Key(), Key_Modifier, QString(optBtn->text()[0]));\n    QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n\n    ui->TextBlock->setFocus();\n}\n\nvoid InputDialog::released_clicked()\n{\n    ui->TextBlock->setFocus();\n}\n\nvoid InputDialog::on_Beep_clicked()\n{\n    //QApplication::beep();\n//    QSoundEffect effect;\n//    effect.setSource(QUrl::fromLocalFile(QCoreApplication ::applicationDirPath() + \"/wav/KBClick.wav\"));//获取资源文件中的声音文件\n//    effect.setLoopCount(1);//设置循环次数\n//    effect.setVolume(1.0);\n//    effect.play();//播放\n\n//    QSound::play(QCoreApplication ::applicationDirPath() + \"/wav/KBClick.wav\");\n\n//    QSound::play(\".../wav/KBClick.wav\");\n\n//    QPoint pos(ui->TextBlock->cursor().pos());\n//    QMouseEvent cursorrvrnt(QEvent::MouseButtonPress, pos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier) ;\n    ui->TextBlock->setFocus();\n//    QApplication::sendEvent(ui->TextBlock, &cursorrvrnt);\n}\n\nvoid InputDialog::showEvent(QShowEvent *event)\n{\n    Q_UNUSED(event);\n\n    ui->TextBlock->setFocus();\n//    ui->TextBlock->setText(QString::number( NumBtns.count()));\n}\n\nvoid InputDialog::on_Btn_Confirm_clicked()\n{\n    bool SettingMark = true;\n    QString ReturnValue = ui->TextBlock->text();\n\n    this->close();\n    emit closedialog(ReturnValue,SettingMark);\n}\n\nvoid InputDialog::on_Func_UL_clicked(bool checked)\n{\n    Func_UL_State = checked;\n    if(checked)\n    {\n        ui->Func_UL->setText(ui->Func_UL->text().toUpper());\n        foreach(QPushButton *item , CharBtns)\n        {\n            item->setText(item->objectName().replace(\"Char_\",\"\").toUpper());\n        }\n        foreach(QPushButton *item , NumBtns)\n        {\n            switch (item->objectName().replace(\"Num_\",\"\").toInt())\n            {\n                case 0:\n                    item->setText(Func_Ang_State? \"）\" : \")\");\n                    break;\n                case 1:\n                    item->setText(Func_Ang_State? \"！\" : \"!\");\n                    break;\n                case 2:\n                    item->setText(Func_Ang_State? \"@\" : \"@\");\n                    break;\n                case 3:\n                    item->setText(Func_Ang_State? \"#\" : \"#\");\n                    break;\n                case 4:\n                    item->setText(Func_Ang_State? \"¥\" : \"$\");\n                    break;\n                case 5:\n                    item->setText(Func_Ang_State? \"%\" : \"%\");\n                    break;\n                case 6:\n                    item->setText(Func_Ang_State? \"…\" : \"^\");\n                    break;\n                case 7:\n                    item->setText(Func_Ang_State? \"&&\" : \"&&\");\n                    break;\n                case 8:\n                    item->setText(Func_Ang_State? \"*\" : \"*\");\n                    break;\n                case 9:\n                    item->setText(Func_Ang_State? \"（\" : \"(\");\n                    break;\n            }\n        }\n\n        ui->Symb_Dot->setText(Func_Ang_State ? \"，\":\",\");\n        ui->Symb_Par_L->setText(Func_Ang_State ? \"「\":\"[\");\n        ui->Symb_Par_R->setText(Func_Ang_State ? \"」\":\"]\");\n        ui->Symb_Add->setText(Func_Ang_State ? \"+\":\"+\");\n        ui->Symb_Dec->setText(Func_Ang_State ? \"—\":\"-\");\n        ui->Symb_Bra_L->setText(Func_Ang_State ? \"？\":\"?\");\n        ui->Symb_Bra_R->setText(Func_Ang_State ? \"/\":\"/\");\n        ui->Symb_Ver->setText(Func_Ang_State ? \"、\":\"\\\\\");\n        ui->Symb_Wave->setText(Func_Ang_State ? \"·\":\"·\");\n        ui->Symb_Semi->setText(Func_Ang_State ? \"：\":\":\");\n        ui->Symb_Quo->setText(Func_Ang_State ? \"”\":\"“\");\n    }\n    else\n    {\n        ui->Func_UL->setText(ui->Func_UL->text().toLower());\n        foreach(QPushButton *item , CharBtns)\n        {\n            item->setText(item->objectName().replace(\"Char_\",\"\").toLower());\n        }\n        foreach(QPushButton *item , NumBtns)\n        {\n            item->setText(item->objectName().replace(\"Num_\",\"\"));\n        }\n\n        ui->Symb_Dot->setText(Func_Ang_State ? \"。\":\".\");\n        ui->Symb_Par_L->setText(Func_Ang_State ? \"【\":\"[\");\n        ui->Symb_Par_R->setText(Func_Ang_State ? \"】\":\"]\");\n        ui->Symb_Add->setText(Func_Ang_State ? \"=\":\"+\");\n        ui->Symb_Dec->setText(Func_Ang_State ? \"-\":\"-\");\n        ui->Symb_Bra_L->setText(Func_Ang_State ? \"《\":\"<\");\n        ui->Symb_Bra_R->setText(Func_Ang_State ? \"》\":\">\");\n        ui->Symb_Ver->setText(Func_Ang_State ? \"｜\":\"|\");\n        ui->Symb_Wave->setText(Func_Ang_State ? \"～\":\"~\");\n        ui->Symb_Semi->setText(Func_Ang_State ? \"；\":\";\");\n        ui->Symb_Quo->setText(Func_Ang_State ? \"'\":\"\\\"\");\n    }\n\n    ui->TextBlock->setFocus();\n//    QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_CapsLock, Qt::NoModifier, QString());\n//    QCoreApplication::sendEvent(this, &keyPress);\n}\n\nvoid InputDialog::on_Func_Ang_clicked(bool checked)\n{\n    Key_Modifier = checked ? Qt::ShiftModifier : Qt::NoModifier;\n    Func_Ang_State = checked;\n    ui->Func_Ang->setText(Func_Ang_State ? \"●\":\"☾\");\n    if(Func_UL_State)\n    {\n        foreach(QPushButton *item , NumBtns)\n        {\n            switch (item->objectName().replace(\"Num_\",\"\").toInt())\n            {\n                case 0:\n                    item->setText(Func_Ang_State? \"）\" : \")\");\n                    break;\n                case 1:\n                    item->setText(Func_Ang_State? \"！\" : \"!\");\n                    break;\n                case 2:\n                    item->setText(Func_Ang_State? \"@\" : \"@\");\n                    break;\n                case 3:\n                    item->setText(Func_Ang_State? \"#\" : \"#\");\n                    break;\n                case 4:\n                    item->setText(Func_Ang_State? \"¥\" : \"$\");\n                    break;\n                case 5:\n                    item->setText(Func_Ang_State? \"%\" : \"%\");\n                    break;\n                case 6:\n                    item->setText(Func_Ang_State? \"…\" : \"^\");\n                    break;\n                case 7:\n                    item->setText(Func_Ang_State? \"&&\" : \"&&\");\n                    break;\n                case 8:\n                    item->setText(Func_Ang_State? \"*\" : \"*\");\n                    break;\n                case 9:\n                    item->setText(Func_Ang_State? \"（\" : \"(\");\n                    break;\n            }\n        }\n        ui->Symb_Dot->setText(Func_Ang_State ? \"，\":\",\");\n        ui->Symb_Par_L->setText(Func_Ang_State ? \"「\":\"[\");\n        ui->Symb_Par_R->setText(Func_Ang_State ? \"」\":\"]\");\n        ui->Symb_Add->setText(Func_Ang_State ? \"+\":\"+\");\n        ui->Symb_Dec->setText(Func_Ang_State ? \"—\":\"-\");\n        ui->Symb_Bra_L->setText(Func_Ang_State ? \"？\":\"?\");\n        ui->Symb_Bra_R->setText(Func_Ang_State ? \"/\":\"/\");\n        ui->Symb_Ver->setText(Func_Ang_State ? \"、\":\"\\\\\");\n        ui->Symb_Wave->setText(Func_Ang_State ? \"·\":\"·\");\n        ui->Symb_Semi->setText(Func_Ang_State ? \"：\":\":\");\n        ui->Symb_Quo->setText(Func_Ang_State ? \"”\":\"“\");\n    }\n    else\n    {\n        ui->Symb_Dot->setText(Func_Ang_State ? \"。\":\".\");\n        ui->Symb_Par_L->setText(Func_Ang_State ? \"【\":\"[\");\n        ui->Symb_Par_R->setText(Func_Ang_State ? \"】\":\"]\");\n        ui->Symb_Add->setText(Func_Ang_State ? \"=\":\"+\");\n        ui->Symb_Dec->setText(Func_Ang_State ? \"-\":\"-\");\n        ui->Symb_Bra_L->setText(Func_Ang_State ? \"《\":\"<\");\n        ui->Symb_Bra_R->setText(Func_Ang_State ? \"》\":\">\");\n        ui->Symb_Ver->setText(Func_Ang_State ? \"|\":\"｜\");\n        ui->Symb_Wave->setText(Func_Ang_State ? \"～\":\"~\");\n        ui->Symb_Semi->setText(Func_Ang_State ? \"；\":\";\");\n        ui->Symb_Quo->setText(Func_Ang_State ? \"'\":\"\\\"\");\n    }\n\n    ui->TextBlock->setFocus();\n}\n\nvoid InputDialog::on_Func_BS_pressed()\n{\n//    QKeyEvent keyPress(QEvent::KeyPress, Qt::Key(), Qt::NoModifier, QString());\n//    ui->TextBlock->keyPressEvent(key);\n\n    Flag = true;\n    if(Flag)\n    {\n        QObject::connect(timer, &QTimer::timeout, this, [=](){\n            QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Backspace, Key_Modifier, QString());\n            QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n            ui->TextBlock->setFocus();\n        });\n    }\n\n    //第一次点击\n    if(Flag1 == false)\n    {\n        QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Backspace, Key_Modifier, QString());\n        QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n\n        ui->TextBlock->setFocus();\n\n        Flag1 = true;\n\n        timer->start(100);\n    }\n\n\n}\n\nvoid InputDialog::on_Key_Left_pressed()\n{\n    Flag = true;\n    if(Flag)\n    {\n        QObject::connect(timer, &QTimer::timeout, this, [=](){\n            QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Left, Key_Modifier, QString());\n            QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n            ui->TextBlock->setFocus();\n        });\n    }\n\n    //第一次点击\n    if(Flag1 == false)\n    {\n        QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Left, Key_Modifier, QString());\n        QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n\n        ui->TextBlock->setFocus();\n\n        Flag1 = true;\n\n        timer->start(100);\n    }\n\n}\n\nvoid InputDialog::on_Key_Right_pressed()\n{\n    Flag = true;\n    if(Flag)\n    {\n        QObject::connect(timer, &QTimer::timeout, this, [=](){\n            QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Right, Key_Modifier, QString());\n            QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n            ui->TextBlock->setFocus();\n        });\n    }\n\n    //第一次点击\n    if(Flag1 == false)\n    {\n        QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Right, Key_Modifier, QString());\n        QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n\n        ui->TextBlock->setFocus();\n\n        Flag1 = true;\n\n        timer->start(100);\n    }\n\n}\n\nvoid InputDialog::on_Space_clicked()\n{\n    QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Space, Key_Modifier, \" \");\n    QCoreApplication::sendEvent(ui->TextBlock, &keyPress);\n\n    ui->TextBlock->setFocus();\n}\n\nvoid InputDialog::on_Func_BS_released()\n{\n    timer->stop();\n    timer->disconnect();\n    Flag = false;\n    Flag1 = false;\n}\n\nvoid InputDialog::on_Key_Left_released()\n{\n    timer->stop();\n    timer->disconnect();\n    Flag = false;\n    Flag1 = false;\n}\n\nvoid InputDialog::on_Key_Right_released()\n{\n    timer->stop();\n    timer->disconnect();\n    Flag = false;\n    Flag1 = false;\n}\n"
  },
  {
    "path": "inputdialog.h",
    "content": "﻿#ifndef INPUTDIALOG_H\n#define INPUTDIALOG_H\n\n#include <QDialog>\n#include <QSizeF>\n#include <QTimer>\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n\nnamespace Ui {\nclass InputDialog;\n}\n\nclass InputDialog : public QDialog\n{\n    Q_OBJECT\n\nsignals:\n    void closedialog(QString &value,bool &SettingMark);\n\npublic:\n    explicit InputDialog(QWidget *parent = nullptr);\n    ~InputDialog();\n\npublic:\n//    QString ReturnValue;\n//    bool SettingMark = false;\n    enum Option\n    {\n        All = 0,\n        AD_int = 1,\n        A_int = 2,\n        AD_double = 3,\n        A_double = 4,\n        C_Lower = 5,\n        C_Upper = 6 ,\n        F_ip = 7\n    };\n    QStringList Options\n    {\n        \"-all\",\n        \"-int\",\n        \"int\",\n        \"-double\",\n        \"double\",\n        \"-lower\",\n        \"-upper\",\n        \"-ip\"\n    };\n\npublic:\n    void setvalue(QString PlaceholdText , QString InputMode , QString DefaultValue = QString::Null());\n\nprivate slots:\n    virtual void on_Btn_Undo_clicked();\n\n    virtual void on_Btn_Confirm_clicked();\n\n    virtual void on_Func_UL_clicked(bool checked);\n\n    virtual void on_Func_Ang_clicked(bool checked);\n\n    virtual void on_Func_BS_pressed();\n\n    virtual void on_Key_Left_pressed();\n\n    virtual void on_Key_Right_pressed();\n\n    virtual void on_CharKey_click();\n\n    virtual void on_NumKey_click();\n\n    virtual void on_SymbKey_click();\n\n    virtual void on_Space_clicked();\n\n    virtual void on_Beep_clicked();\n\n    virtual void released_clicked();\n\n    void on_Func_BS_released();\n\n    void on_Key_Left_released();\n\n    void on_Key_Right_released();\n\nprivate:\n    Ui::InputDialog *ui;\n//    QWidget *FUI;\n    QList<QPushButton *> NumBtns;\n    QList<QPushButton *> CharBtns;\n    QList<QPushButton *> SymbBtns;\n    QList<QPushButton *> AllBtns;\n\n    bool Func_UL_State = false;\n    bool Func_Ang_State = false;\n\n    bool Flag = false;\n    bool Flag1 = false;\n\n    QTimer *timer = new QTimer();\n\n    Qt::KeyboardModifier Key_Modifier = Qt::NoModifier;\n\nprotected:\n    void showEvent(QShowEvent *event);\n};\n\n#endif // INPUTDIALOG_H\n"
  },
  {
    "path": "inputdialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>InputDialog</class>\n <widget class=\"QDialog\" name=\"InputDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\">\n   <string>InputPanel</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/icon/BingoTouch_Logo_H.svg</normaloff>:/assets/icon/BingoTouch_Logo_H.svg</iconset>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"1,7\">\n   <property name=\"spacing\">\n    <number>3</number>\n   </property>\n   <property name=\"leftMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>5</number>\n   </property>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n     <property name=\"spacing\">\n      <number>3</number>\n     </property>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Undo\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\"/>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/off.svg</normaloff>:/assets/off.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeType\">\n        <enum>QSizePolicy::Fixed</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>10</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QLineEdit\" name=\"TextBlock\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"focusPolicy\">\n        <enum>Qt::ClickFocus</enum>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">background-color: rgb(0, 0, 0);\ncolor: rgb(245, 246, 255);</string>\n       </property>\n       <property name=\"placeholderText\">\n        <string>Please Input</string>\n       </property>\n       <property name=\"clearButtonEnabled\">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_2\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeType\">\n        <enum>QSizePolicy::Fixed</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>10</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Confirm\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"layoutDirection\">\n        <enum>Qt::RightToLeft</enum>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/queren.svg</normaloff>:/assets/queren.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <layout class=\"QGridLayout\" name=\"gridLayout\" rowstretch=\"1,1,1,1,0\">\n     <property name=\"spacing\">\n      <number>3</number>\n     </property>\n     <item row=\"1\" column=\"3\">\n      <widget class=\"QPushButton\" name=\"Char_E\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>e</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"10\">\n      <widget class=\"QPushButton\" name=\"Num_0\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>0</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"3\">\n      <widget class=\"QPushButton\" name=\"Char_S\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>s</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"9\">\n      <widget class=\"QPushButton\" name=\"Char_O\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>o</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"3\">\n      <widget class=\"QPushButton\" name=\"Char_Z\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>z</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"9\">\n      <widget class=\"QPushButton\" name=\"Char_K\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>k</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"11\">\n      <widget class=\"QPushButton\" name=\"Symb_Bra_R\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>&gt;</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"12\">\n      <widget class=\"QPushButton\" name=\"Symb_Dec\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>-</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"4\">\n      <widget class=\"QPushButton\" name=\"Num_4\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>4</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"1\">\n      <widget class=\"QPushButton\" name=\"Char_Q\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>q</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"7\">\n      <widget class=\"QPushButton\" name=\"Char_B\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>b</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"11\">\n      <widget class=\"QPushButton\" name=\"Symb_Dot\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>.</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"6\">\n      <widget class=\"QPushButton\" name=\"Char_V\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>v</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"4\" column=\"4\" colspan=\"5\">\n      <widget class=\"QPushButton\" name=\"Space\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Minimum\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>20</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/kongge.svg</normaloff>:/assets/kongge.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>300</width>\n         <height>30</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"8\">\n      <widget class=\"QPushButton\" name=\"Char_J\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>j</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"12\">\n      <widget class=\"QPushButton\" name=\"Symb_Par_R\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>]</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"12\">\n      <widget class=\"QPushButton\" name=\"Func_BS\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/deleteBtn.svg</normaloff>:/assets/deleteBtn.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>40</width>\n         <height>40</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item row=\"4\" column=\"9\">\n      <widget class=\"QPushButton\" name=\"Symb_Semi\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Minimum\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>20</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>;</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"8\">\n      <widget class=\"QPushButton\" name=\"Char_N\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>n</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"6\">\n      <widget class=\"QPushButton\" name=\"Char_Y\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>y</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"4\" column=\"3\">\n      <widget class=\"QPushButton\" name=\"Symb_Wave\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Minimum\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>20</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>~</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"4\">\n      <widget class=\"QPushButton\" name=\"Char_D\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>d</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"7\">\n      <widget class=\"QPushButton\" name=\"Num_7\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>7</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"5\">\n      <widget class=\"QPushButton\" name=\"Char_T\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>t</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"11\">\n      <widget class=\"QPushButton\" name=\"Symb_Par_L\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>[</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"9\">\n      <widget class=\"QPushButton\" name=\"Char_M\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>m</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"10\">\n      <widget class=\"QPushButton\" name=\"Symb_Bra_L\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>&lt;</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"3\">\n      <widget class=\"QPushButton\" name=\"Num_3\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>3</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"8\">\n      <widget class=\"QPushButton\" name=\"Char_I\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>i</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"10\">\n      <widget class=\"QPushButton\" name=\"Char_P\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>p</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"6\">\n      <widget class=\"QPushButton\" name=\"Char_G\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>g</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"5\">\n      <widget class=\"QPushButton\" name=\"Num_5\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>5</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"2\">\n      <widget class=\"QPushButton\" name=\"Num_2\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>2</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"12\">\n      <widget class=\"QPushButton\" name=\"Symb_Ver\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>｜</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"1\">\n      <widget class=\"QPushButton\" name=\"Num_1\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>1</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"9\">\n      <widget class=\"QPushButton\" name=\"Num_9\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>9</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"4\" column=\"1\" colspan=\"2\">\n      <widget class=\"QPushButton\" name=\"Key_Left\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Minimum\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>20</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 249, 79)</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/back.svg</normaloff>:/assets/back.svg</iconset>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"10\">\n      <widget class=\"QPushButton\" name=\"Char_L\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>l</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"4\">\n      <widget class=\"QPushButton\" name=\"Char_R\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>r</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"5\">\n      <widget class=\"QPushButton\" name=\"Char_C\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>c</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"4\" column=\"11\" colspan=\"2\">\n      <widget class=\"QPushButton\" name=\"Key_Right\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Minimum\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>20</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 249, 79)</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/next.svg</normaloff>:/assets/next.svg</iconset>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"8\">\n      <widget class=\"QPushButton\" name=\"Num_8\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>8</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"7\">\n      <widget class=\"QPushButton\" name=\"Char_H\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>h</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"2\">\n      <widget class=\"QPushButton\" name=\"Char_A\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>a</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"2\">\n      <widget class=\"QPushButton\" name=\"Char_W\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>w</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"5\">\n      <widget class=\"QPushButton\" name=\"Char_F\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>f</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"6\">\n      <widget class=\"QPushButton\" name=\"Num_6\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>6</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"7\">\n      <widget class=\"QPushButton\" name=\"Char_U\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>u</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"4\">\n      <widget class=\"QPushButton\" name=\"Char_X\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(255, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>x</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"11\">\n      <widget class=\"QPushButton\" name=\"Symb_Add\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>+</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"4\" column=\"10\">\n      <widget class=\"QPushButton\" name=\"Symb_Quo\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Minimum\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>20</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>&quot;</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"1\">\n      <widget class=\"QPushButton\" name=\"Func_Ang\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(214, 35, 29);</string>\n       </property>\n       <property name=\"text\">\n        <string>☾</string>\n       </property>\n       <property name=\"checkable\">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"1\" colspan=\"2\">\n      <widget class=\"QPushButton\" name=\"Func_UL\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"font\">\n        <font>\n         <pointsize>32</pointsize>\n         <underline>true</underline>\n        </font>\n       </property>\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet10</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">color: rgb(0, 255, 255);</string>\n       </property>\n       <property name=\"text\">\n        <string>Cap</string>\n       </property>\n       <property name=\"checkable\">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "install.sh",
    "content": "echo \"Updating system resources ...\"\nsudo apt update -y\n#sudo apt upgrade -y\necho \"Done.\"\n\n#install Dependencies and Display Driver\necho \"Installing Dependencies ...\"\nsudo apt install qt5-default qtcreator python3-pyqt5-dbg libqt5svg5 libqt5svg5-dev python3-pyqt5.qtsvg qtsvg5-doc libqt5websockets5 libqt5websockets5-dev ttf-wqy-zenhei qml-module-qtquick-controls2 libboost1.58-all-dev libudev-dev libinput-dev libts-dev libmtdev-dev libjpeg-dev libfontconfig1-dev libssl-dev libdbus-1-dev libglib2.0-dev libxkbcommon-dev libgbm-dev libgl1-mesa-dri qtdeclarative5-dev libqt5svg5 libqt5websockets5 ttf-wqy-zenhei -y\necho \"Check GLdriver ...\"\nfor package in gldriver-test libgl1-mesa-dri; do\n    if [ \"$(dpkg -l \"$package\" 2> /dev/null | tail -n 1 | cut -d ' ' -f 1)\" != \"ii\" ]; then\n      missing_packages=\"$package $missing_packages\"\n    fi\ndone\napt-get install $missing_packages -y\necho \"Done.\"\n\necho \"Set render ...\"\nsudo gpasswd -a pi render\necho \"Done.\"\n\n#Change the permissions\necho \"Setting Permissions ...\"\n#Set the boot options to CLI mode and set the auto-login to user 'pi'\nsudo systemctl set-default multi-user.target\nsudo ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service\nsudo cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF\n[Service]\nExecStart=\nExecStart=-/sbin/agetty --autologin pi --noclear %I \\$TERM\nEOF\n\nsudo cat >> /etc/profile << EOF\nexport QT_QPA_EGLFS_ALWAYS_SET_MODE=1\nexport QT_QPA_PLATFORM=eglfs\nEOF\necho \"Done.\"\n\n#Add sudo access for wireless configurations\necho \"Setting up Sudo for wifi configuration...\"\n#sudo touch /etc/sudoers.d/OctoBTT\n#sudo echo \"pi ALL=(ALL) NOPASSWD: /sbin/iwlist, /sbin/wpa_cli, /sbin/iwconfig, /sbins/ifconfig\" > /etc/sudoers.d/OctoBTT\nsudo cp OctoBTT/OctoBTT.sudoers.d /etc/sudoers.d/OctoBTT\necho \"Done.\"\n\nsu -l pi << EOF\necho \"Download OctoBTT ...\"\ncd\nrm -rf OctoBTT\ngit clone https://github.com/bigtreetech/OctoBTT.git\n#git clone https://gitee.com/Shine6Z/OctoBTT.git\necho \"Done.\"\n\necho \"Installing OctoBTT ...\"\ncd ~/OctoBTT\n#mkdir projectfile\n#make clean\n#cp OctoBTT.pro projectfile/OctoBTT.pro\nqmake OctoBTT.pro\n#cp projectfile/OctoBTT.pro OctoBTT.pro\n#rm -r -f projectfile\nif [ ! -f \"$OctoBTT\" ]; then\n rm OctoBTT\n make clean\nfi\nmake -j$(cat /proc/cpuinfo | grep processor | wc -l)\n\nEOF\n\necho \"Setting up Autostart ...\"\nsudo sed -i 's/sudo \\/bin\\/sh \\/home\\/pi\\/install.sh/su -l pi -c \\\"cd \\/home\\/pi\\/OctoBTT \\&\\& .\\/OctoBTT -platform eglfs\\\"/g' /etc/rc.local\n#sudo sed -i '/\\[pi4\\]/ i \\[pi3\\]\\ndtoverlay=vc4-fkms-v3d' /boot/config.txt\nsudo sed '/\\[all\\]/adtoverlay=vc4-fkms-v3d\\ngpu_mem=256' /boot/config.txt\necho \"Done.\"\n\nsudo reboot\n\n"
  },
  {
    "path": "liblog.cpp",
    "content": "#include \"liblog.h\"\n#include <QDebug>\n\n\nvoid LibLog::LogRec(QString message, QString exceptionName)\n{\n\n    QTime systemTime = QTime::currentTime();\n    QDate systemDate = QDate::currentDate();\n\n    //文件名 日期+.log\n    QString fileName = QString(\"%1%2.log\").arg(systemDate.toString(\"yyyy_MM_dd\")).arg((exceptionName.isNull()? \"\":\"_\" + exceptionName));\n\n    QFile file;\n\n    //文件路径\n    file.setFileName(\"Log/\" + fileName);\n\n    //判断文件夹是否存在\n    if(!QDir(\"Log\").exists())\n    {\n        QDir().mkdir(\"Log\");\n    }\n\n    //以可读可写的形式打开文件，并将信息保存于该文件\n    file.open(QFile::Append);\n    QFile::setPermissions(file.fileName(), QFileDevice::ReadOwner|QFileDevice::WriteOwner);\n\n    if(file.isOpen())\n    {\n        QString saveMessage = systemTime.toString(\"hh:mm:ss.zzz\") + \"\\t\" + message+ \"\\n\";\n        file.write(saveMessage.toUtf8());\n//        debugShow(QSysInfo::productType() != \"raspbian\",systemTime.toString(\"hh:mm:ss.zzz\"),message,exceptionName);\n    }\n\n    file.close();\n}\n\nvoid LibLog::debugShow(bool flag, QString times, QString message, QString exceptionName)\n{\n\n    if(flag)\n    {\n        //清除头尾的非必要字符并以\\t划分\n        QStringList messageModule = message.trimmed().split('\\t');\n        QStringList messageModules;\n        foreach(QString inf , messageModule)\n        {\n            //排除空格\n            if(inf.trimmed().count() == 0)\n                continue;\n            //剩下以\\n划分\n            messageModules.append(inf.trimmed().split('\\n'));\n        }\n        //组合\n        message = messageModules.join(\" > \");\n        message = (exceptionName.isNull() ? QString(\"%1 >>> %2\").arg(times).arg(message) : QString(\"%1 >>> %2 *** %3\").arg(times).arg(exceptionName).arg(message));\n        //输出信息\n        qDebug() << message;\n    }\n}\n"
  },
  {
    "path": "liblog.h",
    "content": "﻿#ifndef LIBLOG_H\n#define LIBLOG_H\n\n#include <QDir>\n#include <QFile>\n#include <QTime>\n#include <QDate>\n#include <QException>\n\n\nclass LibLog\n{\npublic:\n    static void LogRec(QString Message, QString exceptionName = NULL);\n\n\n\nprivate:\n    static void debugShow(bool flag,QString times, QString message,QString exceptionName = NULL);\n//    QTime systemTime = QTime::currentTime();\n//    QDate systemDate = QDate::currentDate();\n};\n\n#endif // LIBLOG_H\n"
  },
  {
    "path": "main.cpp",
    "content": "﻿#include \"mainwindow.h\"\n//#include \"controlpanel.h\"\n\n#include <QApplication>\n#include <QScreen>\n#include <QProcess>\n#include <QSharedMemory>\n#include <QTimer>\n#include <QTime>\n#include <QFile>\n#include <QTextCodec>\n#include <QSizeF>\n#include <QDir>\n#include <QFile>\n\nQSharedMemory mem(\"OctoBTT\");\nQByteArray Global_X_API_Key = \"\";//Test Key\nint DebugFlat = 0;//Normal Flat : 0 ;Debug Mode : 1\nQSizeF SizePercent = QSizeF(1.0,1.0);//Design Size 800:480\n//QSize SizePercent(1,1);\n\n//存放配置信息\nQString strConfiguration = \"\";\n\n\nint main(int argc, char *argv[])\n{\n    //Application Encoding\n    QTextCodec *codec = QTextCodec::codecForName(\"UTF-8\");\n    QTextCodec::setCodecForLocale(codec);\n\n    //Program Statement Code\n    QApplication a(argc, argv);\n\n    //设置全局按键默认样式表---12.24\n\n    //判断config.conf文件在不在\n    if(!QFile(\"config.conf\").exists())\n    {\n        //复制资源文件中的config.conf到用户本地文件夹里\n        QFile::copy(\":/config.conf\", \"config.conf\");\n        //设置权限\n        QFile::setPermissions(\"config.conf\", QFileDevice::ReadOwner|QFileDevice::WriteOwner);\n\n        //设置默认按键的样式表\n        QFile file(\"config.conf\");\n        file.open(QFile::ReadOnly);\n        if(file.isOpen())\n        {\n            strConfiguration = file.readAll();\n            //全局默认设置\n            //\n//            qApp->setStyleSheet(strConfiguration);\n        }\n        file.close();\n    }\n    else\n    {\n        QFile file(\":/config.conf\");\n        file.open(QFile::ReadOnly);\n\n        //获取用户本地的版本号\n        QString userNumber = file.readLine().trimmed();\n        QStringList userNumberList = userNumber.replace(QString(\"/*\"),QString(\"\")).replace(QString(\"*/\"),QString(\"\")).split(\".\");\n\n        //判断版本号是否更新，如果版本号大于旧的版本号，就更新，否则不变\n        bool upDateFlag = false;\n\n        QFile userFile(\"config.conf\");\n        userFile.open(QFile::ReadOnly);\n        QString strUpDate = userFile.readLine().trimmed();\n        QStringList strUpDateList = strUpDate.replace(QString(\"/*\"),QString(\"\")).replace(QString(\"*/\"),QString(\"\")).split(\".\");\n\n        if(QString(strUpDateList.at(0)).toInt() > QString(userNumberList.at(0)).toInt())\n            upDateFlag = true;\n\n        else if(QString(strUpDateList.at(0)).toInt() == QString(userNumberList.at(0)).toInt())\n        {\n            if(QString(strUpDateList.at(1)).toInt() > QString(userNumberList.at(1)).toInt())\n                upDateFlag = true;\n\n            else if(QString(strUpDateList.at(1)).toInt() == QString(userNumberList.at(1)).toInt())\n                if(QString(strUpDateList.at(2)).toInt() > QString(userNumberList.at(2)).toInt())\n                    upDateFlag = true;\n        }\n\n        if(upDateFlag)\n        {\n            file.close();\n            //删除旧版本并复制新版本到用户本地文件中\n            //配置文件修改函数=======================\n\n//            QFile::remove(\"/config.conf\");\n//            QFile::copy(\":/config.conf\", \"/config.conf\");\n            //设置权限\n            QFile::setPermissions(\"config.conf\", QFileDevice::ReadOwner|QFileDevice::WriteOwner);\n            file.open(QFile::ReadOnly);\n            if(file.isOpen())\n            {\n                strConfiguration = file.readAll();\n//                qApp->setStyleSheet(strConfiguration);\n            }\n        }\n        else\n        {\n            if(file.isOpen())\n            {\n                strConfiguration = file.readAll();\n//                qApp->setStyleSheet(strConfiguration);\n            }\n        }\n        file.close();\n        userFile.close();\n\n    }\n\n    //设置全局按键默认样式表---12.22\n    QString strStyleSheet = \"\";\n    //判断StyleSheet目录在不在\n    if(!QDir(\"StyleSheet\").exists())\n    {\n        QDir().mkdir(\"StyleSheet\");\n\n        //复制资源文件中的globalStyleSheet.qss到用户本地文件夹里\n        QFile::copy(\":/StyleSheet/globalStyleSheet.qss\", \"StyleSheet/globalStyleSheet.qss\");\n        //设置权限\n        QFile::setPermissions(\"StyleSheet/globalStyleSheet.qss\", QFileDevice::ReadOwner|QFileDevice::WriteOwner);\n\n        //设置默认按键的样式表\n        QFile file(\"StyleSheet/globalStyleSheet.qss\");\n        file.open(QFile::ReadOnly);\n        if(file.isOpen())\n        {\n            strStyleSheet = file.readAll();\n            //全局默认设置\n            qApp->setStyleSheet(strStyleSheet);\n        }\n        file.close();\n    }\n    else\n    {\n        QFile file(\"StyleSheet/globalStyleSheet.qss\");\n        file.open(QFile::ReadOnly);\n\n        //获取用户本地的版本号\n        QString userNumber = file.readLine().trimmed();\n        QStringList userNumberList = userNumber.replace(QString(\"/*\"),QString(\"\")).replace(QString(\"*/\"),QString(\"\")).split(\".\");\n\n        //判断用户是否自定义了样式表\n        if(0 == QString(userNumberList.at(0)).toInt() && DebugFlat == 0)\n        {\n            //使用用户定义的样式表文件qss\n            if(file.isOpen())\n            {\n                strStyleSheet = file.readAll();\n                qApp->setStyleSheet(strStyleSheet);\n            }\n        }\n        //如果不是就判断版本号是否更新\n        else\n        {\n            //如果资源版本号大于旧的版本号，就更新，否则不变\n            bool upDateFlag = false;\n\n            QFile userFile(\":/StyleSheet/globalStyleSheet.qss\");\n            userFile.open(QFile::ReadOnly);\n            QString strUpDate = userFile.readLine().trimmed();\n            QStringList strUpDateList = strUpDate.replace(QString(\"/*\"),QString(\"\")).replace(QString(\"*/\"),QString(\"\")).split(\".\");\n\n            if(QString(strUpDateList.at(0)).toInt() > QString(userNumberList.at(0)).toInt())\n                upDateFlag = true;\n\n            else if(QString(strUpDateList.at(0)).toInt() == QString(userNumberList.at(0)).toInt())\n            {\n                if(QString(strUpDateList.at(1)).toInt() > QString(userNumberList.at(1)).toInt())\n                    upDateFlag = true;\n\n                else if(QString(strUpDateList.at(1)).toInt() == QString(userNumberList.at(1)).toInt())\n                    if(QString(strUpDateList.at(2)).toInt() > QString(userNumberList.at(2)).toInt())\n                        upDateFlag = true;\n            }\n\n            if(upDateFlag || DebugFlat == 1)\n            {\n                file.close();\n                //删除旧版本并复制新版本到用户本地文件中\n                QFile::remove(\"StyleSheet/globalStyleSheet.qss\");\n                QFile::copy(\":/StyleSheet/globalStyleSheet.qss\", \"StyleSheet/globalStyleSheet.qss\");\n                //设置权限\n                QFile::setPermissions(\"StyleSheet/globalStyleSheet.qss\", QFileDevice::ReadOwner|QFileDevice::WriteOwner);\n                file.open(QFile::ReadOnly);\n                if(file.isOpen())\n                {\n                    strStyleSheet = file.readAll();\n                    qApp->setStyleSheet(strStyleSheet);\n                }\n            }\n            else\n            {\n                if(file.isOpen())\n                {\n                    strStyleSheet = file.readAll();\n                    qApp->setStyleSheet(strStyleSheet);\n                }\n            }\n            file.close();\n            userFile.close();\n        }\n    }\n\n\n\n\n    //Find Api Key\n    if(QSysInfo::productType() == \"raspbian\")\n    {\n        QFile configfile(\"/home/pi/.octoprint/config.yaml\");\n        if(configfile.open(QIODevice::ReadOnly))\n        {\n            QTextStream txtInput(&configfile);\n            QStringList ConfigArgu = txtInput.readAll().split('\\n');\n            configfile.close();\n            bool has_api = false;\n            foreach(QString Argu,ConfigArgu)\n            {\n                if(Argu.indexOf(\"api:\")>=0)\n                {\n                    has_api = true;\n                    continue;\n                }\n                else if(has_api && Argu.indexOf(\"key:\")>=0)\n                {\n                    Global_X_API_Key = ((Argu.trimmed()).remove(0,(Argu.trimmed()).indexOf(\"key:\")+4)).trimmed().toUtf8();\n                    break;\n                }\n            }\n        }\n        else\n        {\n            DebugFlat = 1;\n        }\n        //Calculate the scale\n        QScreen *screen=QGuiApplication::primaryScreen();\n        QRect mm=screen->availableGeometry();\n        SizePercent.setWidth((float)mm.width()/(float)800);\n        SizePercent.setHeight((float)mm.height()/(float)480);\n//        SizePercent = QSize(mm.width()/800,mm.height()/480);\n    }\n    MainWindow w;\n\n//Release Code\n    if(QSysInfo::productType() == \"raspbian\")\n    {\n        //Single Program//Need a life cycle as the program was accidenta\n        if (DebugFlat != 1 && !mem.create(1))\n        {\n            QApplication::exit();\n            QApplication::quit();\n            return 0;\n        }\n        w.setWindowState(Qt::WindowFullScreen);\n//        qDebug()<<mem.key();\n    }\n//DeBug Code\n//    qDebug()<<mm.width()<<\"@\"<< mm.height();\n//    qDebug()<<QSysInfo::productType();\n\n    w.show();\n\n//Boot Mode\n    int MCode = a.exec();\n    if(MCode == Base_Restart)\n    {\n        if (mem.isAttached())\n        {\n            mem.unlock();\n            mem.detach();\n        }\n        if(QSysInfo::productType() == \"raspbian\")\n        {\n//            QProcess P(0);\n//            P.start(\"startx\");\n//            P.waitForStarted();\n            QProcess::startDetached(\"bash \"+qApp->applicationDirPath()+\"/start.sh\");\n        }\n        else\n        {\n            QProcess::startDetached(qApp->applicationFilePath(), QStringList());\n        }\n        QApplication::exit();\n        QApplication::quit();\n        return 0;\n    }\n    else if(MCode == Base_Shutdown)\n    {\n        QProcess P(0);\n        P.start(\"sudo shutdown now\");\n        P.waitForStarted();\n        P.waitForFinished();\n        QApplication::exit();\n        QApplication::quit();\n        return 0;\n    }\n    else if(MCode == Base_OnlyExitApp)\n    {\n        if (mem.isAttached())\n        {\n            mem.unlock();\n            mem.detach();\n        }\n        QApplication::exit();\n        QApplication::quit();\n        return 0;\n    }\n\n    return MCode;\n}\n"
  },
  {
    "path": "mainwindow.cpp",
    "content": "#include \"mainwindow.h\"\n#include \"ui_mainwindow.h\"\n\n#include <QTimer>\n#include <QTime>\n//#include <QSizeF>\n\n#include <QJsonDocument>\n#include <QJsonObject>\n#include <QJsonArray>\n\n#include <QNetworkReply>\n//MY Dialog\n#include \"controlpanel.h\"\n#include \"filedialog.h\"\n#include \"materialctrlpanel.h\"\n\n#include <QMovie>\n#include <QPoint>\n#include <QCursor>\n#include <QDir>\n#include <QFile>\n#include <QTextBrowser>\n#include <QDesktopWidget>\n\nMainWindow::MainWindow(QWidget *parent)\n    : QMainWindow(parent)\n    , ui(new Ui::MainWindow)\n{\n\n    ui->setupUi(this);\n\n    //network wake up\n    octonetwork.ConnectFlat = true;\n    QObject::connect(octonetwork.networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(ConnectReply(QNetworkReply*)),Qt::UniqueConnection);\n    octonetwork.networkAccessManager->get(octonetwork.GetConnectRequest);\n\n    //SysTimer\n    QTimer *m_timer= new QTimer(this);\n    //启动或重启定时器, 并设置定时器时间：毫秒\n    //系统状态扫描触发计时器\n    m_timer->start(1000);\n    //定时器触发信号槽\n    connect(m_timer, SIGNAL(timeout()), this, SLOT(TimerTimeOut()));\n\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n//    ui->Btn_Camera->setVisible(false);\n    filedialog->InitializeUSBDrive();\n\n    //移动光标位置\n    QPoint pt(0,0);\n    QPoint center = this->mapToGlobal(pt);\n    QCursor::setPos(center);\n\n    //设置各个按键的样式表\n    ui->Btn_CP->setStyleSheet(\"QPushButton{border:none;font: 20pt Gill Sans MT; MT;color: rgb(245, 246, 250);}\"\n                              \"QPushButton:pressed{border:none;background-color: rgb(128, 128, 128, 30%); padding-left:4px; padding-top:4px;}\"\n                              \"QPushButton:hover  {border:none;background-color: rgb(128, 128, 128, 30%);}\");\n}\n\nMainWindow::~MainWindow()\n{\n    if(!(gcodedialog->_pdataRecvWS->state() == QAbstractSocket::UnconnectedState))\n        gcodedialog->_pdataRecvWS->abort();//Close WS\n    delete ui;\n}\n\nvoid MainWindow::TimerTimeOut()\n{\n    if(QSysInfo::productType() != \"raspbian\")\n    {\n        LibLog::LogRec(QString(\"%1 : In :___%2___%3\").arg(seq).arg(__FILE__).arg(__LINE__), \"connect\");\n    }\n    //uodate UI\n    ui->Btn_ConnectState->setText(octonetwork.ConnectState.contains(\"Printing\") ? \"Printing : \" + filedialog->DisplayName :octonetwork.ConnectState);\n    ui->Btn_CP->setText((materialctrlpanel->Hotend < 0 ? \"-\" : QString::number(materialctrlpanel->Hotend))+materialctrlpanel->Symb_Temp);\n    ui->Btn_CP_1->setText((materialctrlpanel->Hotend < 0 ? \"-\" : QString::number(materialctrlpanel->Hotend))+materialctrlpanel->Symb_Temp);\n    ui->Btn_CP_2->setText((materialctrlpanel->Heatbed < 0 ? \"-\" : QString::number(materialctrlpanel->Heatbed))+materialctrlpanel->Symb_Temp);\n    if(octonetwork.ConnectState != \"Printing\" && octonetwork.ConnectState != \"Printing from SD\")\n    {\n        ui->Btn_CP_3->setIcon(QIcon(\":/assets/fan.svg\"));\n        ui->Btn_CP_3->setText(QString::number(materialctrlpanel->FanSpeed/materialctrlpanel->FanSpeed_Max)+materialctrlpanel->Symb_Per);\n    }\n\n    //ui->Btn_ConnectState->repaint();\n    if(QSysInfo::productType() != \"raspbian\")\n    {\n        LibLog::LogRec(QString(\"%1 : %2___%3___%4\").arg(octonetwork.ConnectState).arg(ui->Btn_ConnectState->text()).arg(__FILE__).arg(__LINE__), \"connect\");\n\n    }\n    if(!octonetwork.ConnectFlat)\n    {\n        if(octonetwork.ConnectState == \"Operational\" || octonetwork.ConnectState == \"Pausing\" || octonetwork.ConnectState == \"Starting\" /*|| octonetwork.ConnectState == \"Printing\"*/ || octonetwork.ConnectState == \"Cancelling\" || octonetwork.ConnectState == \"Starting print from SD\")\n        {\n            octonetwork.ConnectFlat = true;\n            QObject::connect(octonetwork.networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(ConnectReply(QNetworkReply*)),Qt::UniqueConnection);\n            octonetwork.networkAccessManager->get(octonetwork.GetConnectRequest);\n        }\n        else if(octonetwork.ConnectState == \"Connecting\" || octonetwork.ConnectState ==\"Detecting baudrate\"|| octonetwork.ConnectState ==\"Detecting serial port\")\n        {\n            octonetwork.ConnectFlat = true;\n            QObject::connect(octonetwork.networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(ConnectReply(QNetworkReply*)),Qt::UniqueConnection);\n            octonetwork.networkAccessManager->get(octonetwork.GetConnectRequest);\n        }\n        else if(!USB_Port.isEmpty() && !octonetwork.ConnectState.contains(\"Printing\"))//Close Offline Error\n        {\n            //Post\n            materialctrlpanel->ReplyFlag = false;\n            octonetwork.ConnectState = \"Connecting\";\n\n            QJsonDocument ConnectJson;\n            QJsonObject _ConnectJson;\n            _ConnectJson.insert(\"command\",\"connect\");\n            _ConnectJson.insert(\"port\",USB_Port.takeFirst());\n            _ConnectJson.insert(\"baudrate\",115200);\n            _ConnectJson.insert(\"printerProfile\",\"_default\");\n            _ConnectJson.insert(\"save\",false);\n            _ConnectJson.insert(\"autoconnect\",false);\n            ConnectJson.setObject(_ConnectJson);\n\n            if(QSysInfo::productType() != \"raspbian\")\n            {\n                LibLog::LogRec(QString(\"Connect : %1 : In :___%2___%3\").arg(_ConnectJson.constFind(\"port\").value().toString()).arg(__FILE__).arg(__LINE__), \"connect\");\n            }\n\n            octonetwork.networkAccessManager->post(octonetwork.SetConnectRequest,ConnectJson.toJson());\n        }\n        else if(!octonetwork.ConnectState.contains(\"Printing\"))\n        {\n            octonetwork.ConnectFlat = true;\n            QObject::connect(octonetwork.networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(ConnectReply(QNetworkReply*)),Qt::UniqueConnection);\n            octonetwork.networkAccessManager->get(octonetwork.GetConnectRequest);\n        }\n\n        //Button State\n        if(octonetwork.ConnectState.contains(\"Printing\"))\n        {\n            octonetwork.ConnectFlat = true;\n            QObject::connect(octonetwork.networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(StateReply(QNetworkReply*)),Qt::UniqueConnection);\n            octonetwork.networkAccessManager->get(octonetwork.GetStateRequest);\n\n            ui->Btn_Filament->setIcon(QIcon(\":/assets/cancel.svg\"));\n            ui->Btn_Filament->setText(octonetwork.ConnectState);\n//            ui->Btn_Filament->setEnabled(true);\n        }\n        else if(octonetwork.ConnectState == \"Connecting\" || octonetwork.ConnectState ==\"Detecting baudrate\" || octonetwork.ConnectState ==\"Detecting serial port\")\n        {\n            ui->Btn_Filament->setIcon(QIcon(\":/assets/emoji.svg\"));\n            ui->Btn_Filament->setText(\"Connecting\");\n            //            ui->Btn_Filament->setEnabled(false);\n        }\n        else if(octonetwork.ConnectState == \"Cancelling\" || octonetwork.ConnectState ==\"Error\" || octonetwork.ConnectState == \"Starting print from SD\" || octonetwork.ConnectState == \"Starting\")\n        {\n            ui->Btn_Filament->setIcon(QIcon(\":/assets/emoji.svg\"));\n            ui->Btn_Filament->setText(\"Busy\");\n//            ui->Btn_Filament->setEnabled(false);\n        }\n        else if(octonetwork.ConnectState ==\"Closed\" || octonetwork.ConnectState ==\"Offline\")\n        {\n            ui->Btn_Filament->setIcon(QIcon(\":/assets/emoji.svg\"));\n            ui->Btn_Filament->setText(\"Lost connection\");\n        }\n        else\n        {\n            ui->Btn_Filament->setIcon(QIcon(\":/assets/haocaiguanli.svg\"));\n            ui->Btn_Filament->setText(\"Print \" + (filedialog->SelectURL.url() == \"\" ? \"\" : filedialog->DisplayName));\n//            ui->Btn_Filament->setEnabled(true);\n        }\n    }\n    if(QSysInfo::productType() != \"raspbian\")\n    {\n        LibLog::LogRec(QString(\"%1 : Out :___%2___%3\").arg(seq++).arg(__FILE__).arg(__LINE__), \"connect\");\n        LibLog::LogRec(\"***************************************\", \"connect\");\n    }\n}\n\nvoid MainWindow::ConnectReply(QNetworkReply *reply)\n{\n    int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();\n    if(reply->error() == QNetworkReply::NoError)\n    {\n        QByteArray replyArray = reply->readAll();\n        QJsonDocument loadDoc(QJsonDocument::fromJson(replyArray));\n        QJsonObject QObj = loadDoc.object();\n\n        QList<QJsonValue> ReplyResult = octonetwork.SearchJsonValue(octonetwork.ConnectLink , QObj);\n        octonetwork.ConnectState = ReplyResult[0].toString();\n//        ReplyResult[0].toArray().isEmpty()//判断是否为空\n        if(!USB_Port.isEmpty()) USB_Port.clear();\n        foreach(QJsonValue item , ReplyResult[1].toArray())//遍历可连接非串口设备\n        {\n            if(octonetwork.ConnectSerialLink.contains(item.toString())) continue;//属于串口\n            USB_Port.append(item.toString());\n        }\n\n        if(QSysInfo::productType() != \"raspbian\")\n        {\n            LibLog::LogRec(QString(\"%1___%2___%3\").arg(QString(replyArray)).arg(__FILE__).arg(__LINE__), \"connect\");\n        }\n    }\n    else\n    {\n        octonetwork.ConnectState = \"Error\";\n    }\n    if(QSysInfo::productType() != \"raspbian\")\n    {\n        LibLog::LogRec(QString(\"statusCode : %1___%2___%3\").arg(statusCode).arg(__FILE__).arg(__LINE__), \"connect\");\n        LibLog::LogRec(\"***************************************\", \"connect\");\n    }\n    reply->deleteLater();\n    octonetwork.ConnectFlat = !octonetwork.ConnectFlat;\n    octonetwork.networkAccessManager->disconnect(SIGNAL(finished(QNetworkReply*)));//disconnect\n}\n\nvoid MainWindow::StateReply(QNetworkReply *reply)\n{\n    int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();\n    if(reply->error() == QNetworkReply::NoError)\n    {\n        QByteArray replyArray = reply->readAll();\n        QJsonDocument loadDoc(QJsonDocument::fromJson(replyArray));\n        QJsonObject QObj = loadDoc.object();\n\n        QList<QJsonValue> ReplyResult = octonetwork.SearchJsonValue(octonetwork.StateLink , QObj);\n        octonetwork.ConnectState = ReplyResult[0].toString();\n//        ui->Btn_Filament_B->setText(ui->Btn_Filament_B->text() + \" \" + QString::number((int)ReplyResult[1].Double) + \"%\");\n        ui->Btn_CP_3->setIcon(QIcon(\":/assets/filament.svg\"));\n        ui->Btn_CP_3->setText(QString::number(ReplyResult[1].toDouble(),'f',2) + \"%\");\n\n        if(QSysInfo::productType() != \"raspbian\")\n        {\n            LibLog::LogRec(QString(\"%1___%2___%3\").arg(QString(replyArray)).arg(__FILE__).arg(__LINE__), \"connect\");\n        }\n    }\n    else\n    {\n        octonetwork.ConnectState = \"Error\";\n    }\n    if(QSysInfo::productType() != \"raspbian\")\n    {\n        LibLog::LogRec(QString(\"statusCode : %1___%2___%3\").arg(statusCode).arg(__FILE__).arg(__LINE__), \"connect\");\n        LibLog::LogRec(\"***************************************\", \"connect\");\n    }\n    reply->deleteLater();\n    octonetwork.ConnectFlat = !octonetwork.ConnectFlat;\n    octonetwork.networkAccessManager->disconnect(SIGNAL(finished(QNetworkReply*)));//disconnect\n}\n\n//Debug Btn\nvoid MainWindow::on_Btn_setting_clicked()\n{\n//    terminaldialog->resize(this->width(),this->height());\n//    terminaldialog->setFixedSize(this->width(),this->height());\n//    terminaldialog->setWindowState(this->windowState());\n//    terminaldialog->show();\n    configuration->show();\n//    if(DebugFlat == 1)\n//    {\n//        connect(terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine){\n//            disconnect(terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n//        });\n//    }\n\n}\n\nvoid MainWindow::on_Btn_Ctrl_clicked()\n{\n//    controlpanel->resize(this->width(),this->height());\n//    controlpanel->setFixedSize(this->width(),this->height());\n//    controlpanel->setWindowState(this->windowState());\n    controlpanel->show();\n}\n\nvoid MainWindow::on_UILogo_clicked()\n{\n    if(DebugFlat > 0)\n    {\n        QStringList btnName = {\"Yes\", \"No\",} ;\n        CustomDialog *newDialog = new CustomDialog();\n        QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n        {\n            if(instruct == \"Yes\")\n            {\n                qApp->exit(Base_OnlyExitApp);\n            }\n        });\n        newDialog->showCustomDialog(\"Quit desktop\",\":/assets/info.svg\",btnName,\"Do you want to quit desktop ?\",this);\n    }\n}\n\nvoid MainWindow::on_Btn_FS_clicked()\n{\n//    filedialog->resize(this->width(),this->height());\n//    filedialog->setFixedSize(this->width(),this->height());\n//    filedialog->setWindowState(this->windowState());\n//    filedialog->RefreshFileList();\n    filedialog->show();\n}\n\nvoid MainWindow::on_Btn_CP_clicked()\n{\n//    materialctrlpanel->resize(this->width(),this->height());\n//    materialctrlpanel->setFixedSize(this->width(),this->height());\n//    materialctrlpanel->setWindowState(this->windowState());\n    materialctrlpanel->show();\n}\n\nvoid MainWindow::on_Btn_Camera_clicked()\n{\n//    cameradialog->resize(this->width(),this->height());\n//    cameradialog->setWindowState(this->windowState());\n//    cameradialog->show();\n\n//    url_camera->resize(this->width(),this->height());\n//    url_camera->setFixedSize(this->width(),this->height());\n//    url_camera->setWindowState(this->windowState());\n    cameradialog->show();\n}\n//Detail For Print\nvoid MainWindow::on_Btn_Filament_clicked()\n{\n    if(filedialog->SelectURL.url().trimmed() == \"\")\n        filedialog->show();\n    else\n        octonetwork.JobSwitch(filedialog->SelectURL);\n}\n"
  },
  {
    "path": "mainwindow.h",
    "content": "﻿#ifndef MAINWINDOW_H\n#define MAINWINDOW_H\n\n#include <QMainWindow>\n#include <QSizeF>\n\n\n//#include <QJsonDocument>\n//#include <QJsonParseError>\n\n#include <QNetworkReply>\n\n//MY Dialog\n#include \"cameradialog.h\"\n#include \"controlpanel.h\"\n#include \"filedialog.h\"\n#include \"materialctrlpanel.h\"\n#include \"octonetwork.h\"\n#include \"terminaldialog.h\"\n#include \"configuration.h\"\n#include \"wlanconfig.h\"\n#include \"gcodedialog.h\"\n//#include \"webdialog.h\"\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n\nQT_BEGIN_NAMESPACE\nnamespace Ui { class MainWindow; }\nQT_END_NAMESPACE\n\nclass MainWindow : public QMainWindow\n{\n        Q_OBJECT\n\n    public:\n        MainWindow(QWidget *parent = nullptr);\n        ~MainWindow();\n\n    public:\n        OctoNetwork octonetwork = OctoNetwork(this);\n//        OctoNetwork octonetwork;\n\n    private slots:\n        virtual void on_Btn_setting_clicked();\n\n        virtual void on_Btn_Ctrl_clicked();\n\n        virtual void on_UILogo_clicked();\n\n        virtual void on_Btn_FS_clicked();\n\n        virtual void on_Btn_CP_clicked();\n\n        virtual void on_Btn_Camera_clicked();\n\n        virtual void TimerTimeOut();\n\n        virtual void ConnectReply(QNetworkReply *reply);\n\n        virtual void StateReply(QNetworkReply *reply);\n\n        virtual void on_Btn_Filament_clicked();\n\n    private:\n        Ui::MainWindow *ui;\n//        QString SearchJsonValue(QList<QString> Find_List_Name , QJsonObject _QObj);\n\n    public://Frm\n        ControlPanel *controlpanel = new ControlPanel(this);\n        FileDialog *filedialog = new FileDialog(this);\n        MaterialCtrlPanel *materialctrlpanel = new MaterialCtrlPanel(this);\n        CameraDialog *cameradialog = new CameraDialog(this);\n//        URL_Camera *url_camera = new URL_Camera(this);\n        TerminalDialog *terminaldialog = new TerminalDialog(this);\n        GcodeDialog *gcodedialog = new GcodeDialog(this);\n        Configuration *configuration = new Configuration(this);\n        Wlanconfig *wlanconfig = new Wlanconfig(this);\n//        WebDialog *webdialog = new WebDialog(this);\n\n    private:\n        QList<QString> USB_Port;\n\n//        QTimer *m_timer;\n//        void InitTimer();\n\n//        QNetworkAccessManager *networkAccessManager = new QNetworkAccessManager();\n//        QNetworkRequest request;\n\n//        bool ConnectFlat = false;\n//        QString ConnectState = \"Close\";\n//        QByteArray X_API_Key = \"C1B64D24AE99475EAA9385B5DBC77820\";\n//        QString MainUrl = \"http://192.168.3.111/api/\";\n        int seq = 1;\n};\n#endif // MAINWINDOW_H\n"
  },
  {
    "path": "mainwindow.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>MainWindow</class>\n <widget class=\"QMainWindow\" name=\"MainWindow\">\n  <property name=\"windowModality\">\n   <enum>Qt::WindowModal</enum>\n  </property>\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\">\n   <string>OctoBTT</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/icon/BTT_Duck.svg</normaloff>:/assets/icon/BTT_Duck.svg</iconset>\n  </property>\n  <widget class=\"QWidget\" name=\"centralwidget\">\n   <property name=\"sizePolicy\">\n    <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n     <horstretch>0</horstretch>\n     <verstretch>0</verstretch>\n    </sizepolicy>\n   </property>\n   <property name=\"whatsThis\">\n    <string/>\n   </property>\n   <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n    <property name=\"leftMargin\">\n     <number>5</number>\n    </property>\n    <property name=\"topMargin\">\n     <number>5</number>\n    </property>\n    <property name=\"rightMargin\">\n     <number>5</number>\n    </property>\n    <property name=\"bottomMargin\">\n     <number>5</number>\n    </property>\n    <item>\n     <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\" stretch=\"3,18,2,1\">\n      <property name=\"spacing\">\n       <number>3</number>\n      </property>\n      <property name=\"sizeConstraint\">\n       <enum>QLayout::SetDefaultConstraint</enum>\n      </property>\n      <item>\n       <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n        <property name=\"spacing\">\n         <number>2</number>\n        </property>\n        <property name=\"sizeConstraint\">\n         <enum>QLayout::SetFixedSize</enum>\n        </property>\n        <item>\n         <spacer name=\"horizontalSpacer\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <widget class=\"QPushButton\" name=\"UILogo\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"cursor\">\n           <cursorShape>ArrowCursor</cursorShape>\n          </property>\n          <property name=\"styleSheet\">\n           <string notr=\"true\">border:none;font: 40pt &quot;Gill Sans Ultra Bold&quot;;\ncolor: rgb(0, 170, 255);</string>\n          </property>\n          <property name=\"text\">\n           <string>OctoBTT</string>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/icon/icon-main-btt-blue.svg</normaloff>:/assets/icon/icon-main-btt-blue.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>72</width>\n            <height>72</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_2\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <widget class=\"QPushButton\" name=\"Btn_setting\">\n          <property name=\"enabled\">\n           <bool>true</bool>\n          </property>\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"cursor\">\n           <cursorShape>PointingHandCursor</cursorShape>\n          </property>\n          <property name=\"contextMenuPolicy\">\n           <enum>Qt::NoContextMenu</enum>\n          </property>\n          <property name=\"toolTip\">\n           <string/>\n          </property>\n          <property name=\"whatsThis\">\n           <string>BTStyleSheet4</string>\n          </property>\n          <property name=\"styleSheet\">\n           <string notr=\"true\">border:none;</string>\n          </property>\n          <property name=\"text\">\n           <string/>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/xitongpeizhi.svg</normaloff>:/assets/xitongpeizhi.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>72</width>\n            <height>72</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n       </layout>\n      </item>\n      <item>\n       <layout class=\"QHBoxLayout\" name=\"horizontalLayout_6\" stretch=\"3,2,1,2,1,2,3\">\n        <property name=\"spacing\">\n         <number>3</number>\n        </property>\n        <item>\n         <spacer name=\"horizontalSpacer_9\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <layout class=\"QVBoxLayout\" name=\"verticalLayout_3\" stretch=\"1,0,1\">\n          <property name=\"spacing\">\n           <number>0</number>\n          </property>\n          <item>\n           <spacer name=\"verticalSpacer_2\">\n            <property name=\"orientation\">\n             <enum>Qt::Vertical</enum>\n            </property>\n            <property name=\"sizeType\">\n             <enum>QSizePolicy::Preferred</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>10</width>\n              <height>60</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n          <item>\n           <widget class=\"QToolButton\" name=\"Btn_FS\">\n            <property name=\"sizePolicy\">\n             <sizepolicy hsizetype=\"Expanding\" vsizetype=\"MinimumExpanding\">\n              <horstretch>0</horstretch>\n              <verstretch>0</verstretch>\n             </sizepolicy>\n            </property>\n            <property name=\"sizeIncrement\">\n             <size>\n              <width>96</width>\n              <height>86</height>\n             </size>\n            </property>\n            <property name=\"cursor\">\n             <cursorShape>PointingHandCursor</cursorShape>\n            </property>\n            <property name=\"contextMenuPolicy\">\n             <enum>Qt::NoContextMenu</enum>\n            </property>\n            <property name=\"whatsThis\">\n             <string>BTStyleSheet9</string>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\"/>\n            </property>\n            <property name=\"text\">\n             <string>Files</string>\n            </property>\n            <property name=\"icon\">\n             <iconset resource=\"assets.qrc\">\n              <normaloff>:/assets/wenjian.svg</normaloff>:/assets/wenjian.svg</iconset>\n            </property>\n            <property name=\"iconSize\">\n             <size>\n              <width>96</width>\n              <height>96</height>\n             </size>\n            </property>\n            <property name=\"toolButtonStyle\">\n             <enum>Qt::ToolButtonTextUnderIcon</enum>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <spacer name=\"verticalSpacer_5\">\n            <property name=\"orientation\">\n             <enum>Qt::Vertical</enum>\n            </property>\n            <property name=\"sizeType\">\n             <enum>QSizePolicy::Preferred</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>10</width>\n              <height>60</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n         </layout>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_19\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <layout class=\"QVBoxLayout\" name=\"verticalLayout_4\" stretch=\"1,0,1\">\n          <property name=\"spacing\">\n           <number>0</number>\n          </property>\n          <item>\n           <spacer name=\"verticalSpacer_3\">\n            <property name=\"orientation\">\n             <enum>Qt::Vertical</enum>\n            </property>\n            <property name=\"sizeType\">\n             <enum>QSizePolicy::Preferred</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>10</width>\n              <height>60</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n          <item>\n           <widget class=\"QToolButton\" name=\"Btn_Filament\">\n            <property name=\"sizePolicy\">\n             <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n              <horstretch>0</horstretch>\n              <verstretch>0</verstretch>\n             </sizepolicy>\n            </property>\n            <property name=\"minimumSize\">\n             <size>\n              <width>0</width>\n              <height>0</height>\n             </size>\n            </property>\n            <property name=\"cursor\">\n             <cursorShape>PointingHandCursor</cursorShape>\n            </property>\n            <property name=\"contextMenuPolicy\">\n             <enum>Qt::NoContextMenu</enum>\n            </property>\n            <property name=\"whatsThis\">\n             <string>BTStyleSheet9</string>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\"/>\n            </property>\n            <property name=\"text\">\n             <string>Filament</string>\n            </property>\n            <property name=\"icon\">\n             <iconset resource=\"assets.qrc\">\n              <normaloff>:/assets/haocaiguanli.svg</normaloff>:/assets/haocaiguanli.svg</iconset>\n            </property>\n            <property name=\"iconSize\">\n             <size>\n              <width>96</width>\n              <height>96</height>\n             </size>\n            </property>\n            <property name=\"toolButtonStyle\">\n             <enum>Qt::ToolButtonTextUnderIcon</enum>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <spacer name=\"verticalSpacer_6\">\n            <property name=\"orientation\">\n             <enum>Qt::Vertical</enum>\n            </property>\n            <property name=\"sizeType\">\n             <enum>QSizePolicy::Preferred</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>10</width>\n              <height>20</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n         </layout>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_18\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <layout class=\"QVBoxLayout\" name=\"verticalLayout_5\" stretch=\"1,0,1\">\n          <property name=\"spacing\">\n           <number>0</number>\n          </property>\n          <item>\n           <spacer name=\"verticalSpacer_4\">\n            <property name=\"orientation\">\n             <enum>Qt::Vertical</enum>\n            </property>\n            <property name=\"sizeType\">\n             <enum>QSizePolicy::Preferred</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>10</width>\n              <height>60</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n          <item>\n           <widget class=\"QToolButton\" name=\"Btn_Ctrl\">\n            <property name=\"sizePolicy\">\n             <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n              <horstretch>0</horstretch>\n              <verstretch>0</verstretch>\n             </sizepolicy>\n            </property>\n            <property name=\"cursor\">\n             <cursorShape>PointingHandCursor</cursorShape>\n            </property>\n            <property name=\"contextMenuPolicy\">\n             <enum>Qt::NoContextMenu</enum>\n            </property>\n            <property name=\"toolTip\">\n             <string/>\n            </property>\n            <property name=\"whatsThis\">\n             <string>BTStyleSheet9</string>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\"/>\n            </property>\n            <property name=\"text\">\n             <string>Control</string>\n            </property>\n            <property name=\"icon\">\n             <iconset resource=\"assets.qrc\">\n              <normaloff>:/assets/Ddayin.svg</normaloff>:/assets/Ddayin.svg</iconset>\n            </property>\n            <property name=\"iconSize\">\n             <size>\n              <width>96</width>\n              <height>96</height>\n             </size>\n            </property>\n            <property name=\"toolButtonStyle\">\n             <enum>Qt::ToolButtonTextUnderIcon</enum>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <spacer name=\"verticalSpacer_7\">\n            <property name=\"orientation\">\n             <enum>Qt::Vertical</enum>\n            </property>\n            <property name=\"sizeType\">\n             <enum>QSizePolicy::Preferred</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>10</width>\n              <height>20</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n         </layout>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_8\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n       </layout>\n      </item>\n      <item>\n       <layout class=\"QHBoxLayout\" name=\"horizontalLayout_4\" stretch=\"0,0,0,0,0,0,0,0,0\">\n        <property name=\"spacing\">\n         <number>2</number>\n        </property>\n        <property name=\"sizeConstraint\">\n         <enum>QLayout::SetFixedSize</enum>\n        </property>\n        <item>\n         <spacer name=\"horizontalSpacer_10\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_14\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <widget class=\"QPushButton\" name=\"Btn_CP_1\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"cursor\">\n           <cursorShape>PointingHandCursor</cursorShape>\n          </property>\n          <property name=\"whatsThis\">\n           <string>BTStyleSheet3</string>\n          </property>\n          <property name=\"styleSheet\">\n           <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\ncolor: rgb(194, 54, 22);\n</string>\n          </property>\n          <property name=\"text\">\n           <string>23℃</string>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/penzui.svg</normaloff>:/assets/penzui.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>64</width>\n            <height>64</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_11\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <widget class=\"QPushButton\" name=\"Btn_CP_2\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"cursor\">\n           <cursorShape>PointingHandCursor</cursorShape>\n          </property>\n          <property name=\"whatsThis\">\n           <string>BTStyleSheet3</string>\n          </property>\n          <property name=\"styleSheet\">\n           <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\ncolor: rgb(215, 169, 42);</string>\n          </property>\n          <property name=\"text\">\n           <string>23℃</string>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/re.svg</normaloff>:/assets/re.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>64</width>\n            <height>64</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_12\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <widget class=\"QPushButton\" name=\"Btn_CP_3\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"cursor\">\n           <cursorShape>PointingHandCursor</cursorShape>\n          </property>\n          <property name=\"whatsThis\">\n           <string>BTStyleSheet3</string>\n          </property>\n          <property name=\"styleSheet\">\n           <string notr=\"true\">border:none;\ncolor: rgb(0, 151, 230);\nfont: 75 30pt &quot;Gill Sans MT&quot;;</string>\n          </property>\n          <property name=\"text\">\n           <string>100%</string>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/fan.svg</normaloff>:/assets/fan.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>64</width>\n            <height>64</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_15\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_13\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n       </layout>\n      </item>\n      <item>\n       <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2\">\n        <property name=\"spacing\">\n         <number>2</number>\n        </property>\n        <property name=\"sizeConstraint\">\n         <enum>QLayout::SetFixedSize</enum>\n        </property>\n        <item alignment=\"Qt::AlignLeft|Qt::AlignBottom\">\n         <widget class=\"QPushButton\" name=\"Btn_Camera\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"cursor\">\n           <cursorShape>PointingHandCursor</cursorShape>\n          </property>\n          <property name=\"whatsThis\">\n           <string>BTStyleSheet3</string>\n          </property>\n          <property name=\"styleSheet\">\n           <string notr=\"true\">border:none;;\nfont: 20pt &quot;Gill Sans MT&quot;;\ncolor: rgb(245, 246, 250);</string>\n          </property>\n          <property name=\"text\">\n           <string>Camera</string>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/video.svg</normaloff>:/assets/video.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>32</width>\n            <height>32</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_16\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item alignment=\"Qt::AlignHCenter|Qt::AlignBottom\">\n         <widget class=\"QPushButton\" name=\"Btn_CP\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"cursor\">\n           <cursorShape>PointingHandCursor</cursorShape>\n          </property>\n          <property name=\"styleSheet\">\n           <string notr=\"true\">border:none;\nfont: 20pt &quot;Gill Sans MT&quot;;\ncolor: rgb(245, 246, 250);</string>\n          </property>\n          <property name=\"text\">\n           <string>23.4℃</string>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/thermometer.svg</normaloff>:/assets/thermometer.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>32</width>\n            <height>32</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_17\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeType\">\n           <enum>QSizePolicy::MinimumExpanding</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>5</width>\n            <height>10</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n        <item alignment=\"Qt::AlignRight|Qt::AlignBottom\">\n         <widget class=\"QPushButton\" name=\"Btn_ConnectState\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"cursor\">\n           <cursorShape>ArrowCursor</cursorShape>\n          </property>\n          <property name=\"layoutDirection\">\n           <enum>Qt::RightToLeft</enum>\n          </property>\n          <property name=\"styleSheet\">\n           <string notr=\"true\">border:none;\nfont: 20pt &quot;Gill Sans MT&quot;;\ncolor: rgb(245, 246, 250);</string>\n          </property>\n          <property name=\"text\">\n           <string>Close</string>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"assets.qrc\">\n            <normaloff>:/assets/icon/BingoTouch_Logo_H.svg</normaloff>:/assets/icon/BingoTouch_Logo_H.svg</iconset>\n          </property>\n          <property name=\"iconSize\">\n           <size>\n            <width>32</width>\n            <height>32</height>\n           </size>\n          </property>\n         </widget>\n        </item>\n       </layout>\n      </item>\n     </layout>\n    </item>\n   </layout>\n  </widget>\n </widget>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections>\n  <connection>\n   <sender>Btn_CP_1</sender>\n   <signal>clicked()</signal>\n   <receiver>Btn_CP</receiver>\n   <slot>click()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>188</x>\n     <y>408</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>377</x>\n     <y>461</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>Btn_CP_2</sender>\n   <signal>clicked()</signal>\n   <receiver>Btn_CP</receiver>\n   <slot>click()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>395</x>\n     <y>408</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>377</x>\n     <y>461</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>Btn_CP_3</sender>\n   <signal>clicked()</signal>\n   <receiver>Btn_CP</receiver>\n   <slot>click()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>606</x>\n     <y>408</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>377</x>\n     <y>461</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "materialctrlpanel.cpp",
    "content": "﻿#include \"materialctrlpanel.h\"\n#include \"ui_materialctrlpanel.h\"\n\n#include <QJsonDocument>\n#include <QJsonArray>\n#include <QJsonObject>\n//#include <QSizeF>\n#include <QNetworkReply>\n#include <mainwindow.h>\n//#include <QMap>\n\nMaterialCtrlPanel::MaterialCtrlPanel(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::MaterialCtrlPanel)\n{\n    ui->setupUi(this);\n\n    FUI = (MainWindow*)parent;\n\n    ReLoopFlag = E_Temperature;\n    QObject::connect(((MainWindow*)FUI)->octonetwork.MCPnetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(Reply(QNetworkReply*)),Qt::UniqueConnection);\n\n    //SysTimer\n    QTimer *m_timer= new QTimer(this);\n    //启动或重启定时器, 并设置定时器时间：毫秒\n    m_timer->start(10);\n    //定时器触发信号槽\n    connect(m_timer, SIGNAL(timeout()), this, SLOT(TimerTimeOut()));\n\n    //屏幕自适应大小\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n\n    //设置Save按键的边框样式表\n    ui->Btn_Save->setStyleSheet(\"border-color: rgb(85, 255, 0);\");\n\n}\nvoid MaterialCtrlPanel::TimerTimeOut()\n{\n    if(!SettingFlag)\n    {\n        Hotend_Target = Hotend;\n        Heatbed_Target = Heatbed;\n        Feedrate_Target = Feedrate;\n        Flowrate_Target = Flowrate;\n        Tool_Target = Tool;\n        FanSpeed_Target = FanSpeed;\n    }\n    //update UI\n\n    ui->Txt_Hotend->setText((Hotend < 0 ? \"-\" : QString::number(Hotend_Target))+Symb_Temp);\n    ui->Btn_Hotend_A->setEnabled(Hotend >= 0);\n    ui->Btn_Hotend_D->setEnabled(Hotend >= 0);\n    ui->Txt_Heatbed->setText((Heatbed < 0 ? \"-\" : QString::number(Heatbed_Target))+Symb_Temp);\n    ui->Btn_Heatbed_A->setEnabled(Heatbed >= 0);\n    ui->Btn_Heatbed_D->setEnabled(Heatbed >= 0);\n    ui->Txt_Feedrate->setText((Feedrate < 0 ? \"-\" : QString::number(Feedrate_Target))+Symb_Per);\n    ui->Btn_Feedrate_A->setEnabled(Feedrate >= 0);\n    ui->Btn_Feedrate_D->setEnabled(Feedrate >= 0);\n    ui->Txt_Flowrate->setText((Flowrate < 0 ? \"-\" : QString::number(Flowrate_Target))+Symb_Per);\n    ui->Btn_Flowrate_A->setEnabled(Flowrate >= 0);\n    ui->Btn_Flowrate_D->setEnabled(Flowrate >= 0);\n\n    //ui->Btn_ConnectState->repaint();\n    if((((MainWindow*)FUI)->octonetwork.ConnectState == \"Operational\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Printing\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Cancelling\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Pausing\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Starting\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Printing from SD\" || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Starting print from SD\") && !ReplyFlag)\n    {\n\n//            //Post\n//            Fui->octonetwork.ConnectState = \"Connecting\";\n        switch(ReLoopFlag)\n        {\n            case E_Temperature :\n                ((MainWindow*)FUI)->octonetwork.MCPnetworkAccessManager->get(((MainWindow*)FUI)->octonetwork.GetTemperatureRequest);\n                break;\n            default:\n                break;\n        }\n        ReplyFlag = true;\n    }\n    else if((((MainWindow*)FUI)->octonetwork.ConnectState == \"Closed\" || ((MainWindow*)FUI)->octonetwork.ConnectState.contains(\"Error\")) || ((MainWindow*)FUI)->octonetwork.ConnectState == \"Connecting\" || ((MainWindow*)FUI)->octonetwork.ConnectState ==\"Detecting baudrate\" || ((MainWindow*)FUI)->octonetwork.ConnectState ==\"Detecting serial port\")\n    {\n        Hotend = -15;\n        Heatbed = -15;\n        Feedrate = 0;\n        Flowrate = 0;\n        Tool = -15;\n        FanSpeed = 0;\n    }\n}\nvoid MaterialCtrlPanel::Reply(QNetworkReply *reply)\n{\n    QList<QJsonValue> _V_Temperature;\n\n    int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();\n    if(reply->error() == QNetworkReply::NoError)\n    {\n        QByteArray replyArray = reply->readAll();\n        QJsonDocument loadDoc(QJsonDocument::fromJson(replyArray));\n        QJsonObject QObj = loadDoc.object();\n        double HotendValue = -15;\n        double ToolValue = -15;\n        switch(ReLoopFlag)\n        {\n            case E_Temperature :\n                _V_Temperature << ((MainWindow*)FUI)->octonetwork.SearchJsonValue(((MainWindow*)FUI)->octonetwork.TemperatureLink , QObj);\n                Heatbed = _V_Temperature[0].toDouble();\n                foreach(QJsonValue item,_V_Temperature[1].toArray())\n                {\n                    if(QSysInfo::productType() != \"raspbian\"){\n                        LibLog::LogRec(QString(\"%1___%2___%3\").arg(item.toDouble()).arg(__FILE__).arg(__LINE__), \"connect\");\n                    }\n                    if(item.toDouble() > HotendValue)\n                        HotendValue = item.toDouble();\n                    else if(item.toDouble() > ToolValue)\n                        ToolValue = item.toDouble();\n                }\n                Hotend = HotendValue;\n                Tool = ToolValue;\n                break;\n            default:\n                break;\n         }\n\n         if(QSysInfo::productType() != \"raspbian\")\n         {\n             LibLog::LogRec(QString(\"%1___%2___%3\").arg(QString(replyArray)).arg(__FILE__).arg(__LINE__), \"connect\");\n         }\n    }\n    else\n    {\n        ((MainWindow*)FUI)->octonetwork.ConnectState = \"Error\";\n    }\n    if(QSysInfo::productType() != \"raspbian\")\n    {\n        LibLog::LogRec(QString(\"statusCode : %1___%2___%3\").arg(statusCode).arg(__FILE__).arg(__LINE__), \"connect\");\n        LibLog::LogRec(\"***************************************\", \"connect\");\n    }\n    reply->deleteLater();\n    ReLoopFlag ++ ;\n    if(ReLoopFlag > E_Temperature)\n    {\n        ReLoopFlag = E_Temperature;\n    }\n    ReplyFlag = false;\n//    ((MainWindow*)FUI)->octonetwork.MCPnetworkAccessManager->disconnect(SIGNAL(finished(QNetworkReply*)));//disconnect\n}\n\nMaterialCtrlPanel::~MaterialCtrlPanel()\n{\n    delete ui;\n}\n\nvoid MaterialCtrlPanel::on_Btn_back_clicked()\n{\n    SettingFlag = false;\n    this->close();\n}\n\nvoid MaterialCtrlPanel::on_Btn_Save_pressed()\n{\n    QList<QString> _GCode_Setting;\n\n    if(Heatbed != Heatbed_Target)\n    {\n        _GCode_Setting.append(\"M140 S\"+QString::number((int)Heatbed_Target));\n    }\n\n    if(Hotend != Hotend_Target)\n    {\n        _GCode_Setting.append(\"M104 S\"+QString::number((int)Hotend_Target));\n    }\n\n    ((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_Setting);\n\n//    qDebug()<<TemperatureJsonObj_SonKey.count();\n    SettingFlag = false;\n}\n\nvoid MaterialCtrlPanel::on_Btn_Save_released()\n{\n//    ui->Btn_Save->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Hotend_A_pressed()\n{\n    SettingFlag = true;\n    StyleSheet_Temp = ui->Btn_Hotend_A->styleSheet();\n    ui->Btn_Hotend_A->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n    timer = new mTimer(&Hotend_Target,qobject_cast<QPushButton *>(sender()),1);\n    MaterialCtrlPanel::longPress(&Hotend_Max);\n\n\n}\n\nvoid MaterialCtrlPanel::on_Btn_Hotend_A_released()\n{\n    timer->stop();\n    timer->disconnect();\n    timerStartFlag = false;\n    firstClickedFlag = false;\n    ui->Btn_Hotend_A->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Hotend_D_pressed()\n{\n    SettingFlag = true;\n    StyleSheet_Temp = ui->Btn_Hotend_D->styleSheet();\n    ui->Btn_Hotend_D->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n    timer = new mTimer(&Hotend_Target,qobject_cast<QPushButton *>(sender()),-1);\n    MaterialCtrlPanel::longPress(&Hotend_Max);\n\n}\n\nvoid MaterialCtrlPanel::on_Btn_Hotend_D_released()\n{\n    timer->stop();\n    timer->disconnect();\n    timerStartFlag = false;\n    firstClickedFlag = false;\n    ui->Btn_Hotend_D->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Heatbed_A_pressed()\n{\n    SettingFlag = true;\n    StyleSheet_Temp = ui->Btn_Heatbed_A->styleSheet();\n    ui->Btn_Heatbed_A->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n    timer = new mTimer(&Heatbed_Target,qobject_cast<QPushButton *>(sender()),1);\n    MaterialCtrlPanel::longPress(&Heatbed_Max);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Heatbed_A_released()\n{\n    timer->stop();\n    timer->disconnect();\n    timerStartFlag = false;\n    firstClickedFlag = false;\n\n    ui->Btn_Heatbed_A->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Heatbed_D_pressed()\n{\n    SettingFlag = true;\n\n    StyleSheet_Temp = ui->Btn_Heatbed_D->styleSheet();\n    ui->Btn_Heatbed_D->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n\n    timer = new mTimer(&Heatbed_Target,qobject_cast<QPushButton *>(sender()),-1);\n\n    MaterialCtrlPanel::longPress(&Heatbed_Max);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Heatbed_D_released()\n{\n    timer->stop();\n    timer->disconnect();\n    timerStartFlag = false;\n    firstClickedFlag = false;\n    ui->Btn_Heatbed_D->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Feedrate_A_pressed()\n{\n    SettingFlag = true;\n    StyleSheet_Temp = ui->Btn_Feedrate_A->styleSheet();\n    ui->Btn_Feedrate_A->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n    timer = new mTimer(&Feedrate_Target,qobject_cast<QPushButton *>(sender()),1);\n\n    MaterialCtrlPanel::longPress(&Feedrate_Max);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Feedrate_A_released()\n{\n    timer->stop();\n    timer->disconnect();\n    timerStartFlag = false;\n    firstClickedFlag = false;\n    ui->Btn_Feedrate_A->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Feedrate_D_pressed()\n{\n    SettingFlag = true;\n    StyleSheet_Temp = ui->Btn_Feedrate_D->styleSheet();\n    ui->Btn_Feedrate_D->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n    timer = new mTimer(&Feedrate_Target,qobject_cast<QPushButton *>(sender()),-1);\n    MaterialCtrlPanel::longPress(&Feedrate_Max);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Feedrate_D_released()\n{\n    timer->stop();\n    timer->disconnect();\n    timerStartFlag = false;\n    firstClickedFlag = false;\n    ui->Btn_Feedrate_D->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Flowrate_A_pressed()\n{\n    SettingFlag = true;\n    StyleSheet_Temp = ui->Btn_Flowrate_A->styleSheet();\n    ui->Btn_Flowrate_A->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n    timer = new mTimer(&Flowrate_Target,qobject_cast<QPushButton *>(sender()),1);\n\n    MaterialCtrlPanel::longPress(&Flowrate_Max);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Flowrate_A_released()\n{\n    timer->stop();\n    timer->disconnect();\n    timerStartFlag = false;\n    firstClickedFlag = false;\n    ui->Btn_Flowrate_A->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Flowrate_D_pressed()\n{\n    SettingFlag = true;\n\n    StyleSheet_Temp = ui->Btn_Flowrate_D->styleSheet();\n    ui->Btn_Flowrate_D->setStyleSheet(StyleSheet_Temp+\"\\nbackground-color:rgb(128,128,128,128);\");\n\n\n    timer = new mTimer(&Flowrate_Target,qobject_cast<QPushButton *>(sender()),-1);\n\n    MaterialCtrlPanel::longPress(&Flowrate_Max);\n}\n\nvoid MaterialCtrlPanel::on_Btn_Flowrate_D_released()\n{\n    timer->stop();\n    timer->disconnect();\n    timerStartFlag = false;\n    firstClickedFlag = false;\n    ui->Btn_Flowrate_D->setStyleSheet(StyleSheet_Temp);\n}\n\nvoid MaterialCtrlPanel::longPress(const double *maximumCount)\n{\n    //设置长按效果--12.25\n    timerStartFlag = true;\n    if(timerStartFlag)\n    {\n        connect(timer, &mTimer::mtimeout, this, [=](){\n            if(timer->addval > 0)\n            {\n                if(*(timer->value) + timer->addval < *maximumCount)\n                    *(timer->value) += timer->addval;\n                else\n                    *(timer->value) = *maximumCount;\n            }\n            else\n            {\n                if(*(timer->value) + timer->addval > 0)\n                    *(timer->value) += timer->addval;\n                else\n                    *(timer->value) = 0;\n            }\n            *timer->value = (int)*(timer->value);\n        });\n    }\n\n    //第一次点击\n    if(firstClickedFlag == false)\n    {\n        if(timer->addval > 0)\n        {\n            if(*(timer->value) + timer->addval < *maximumCount)\n            {\n                *(timer->value) += timer->addval;\n            }\n            else\n                *(timer->value) = *maximumCount;\n        }\n        else\n        {\n            if(*(timer->value) + timer->addval > 0)\n                *(timer->value) += timer->addval;\n            else\n                *(timer->value) = 0;\n        }\n        *(timer->value) = (int)*(timer->value);\n\n        firstClickedFlag = true;\n\n        timer->start(100);\n    }\n}\n\n"
  },
  {
    "path": "materialctrlpanel.h",
    "content": "﻿#ifndef MATERIALCTRLPANEL_H\n#define MATERIALCTRLPANEL_H\n\n\n#include <QDialog>\n#include <QNetworkReply>\n#include <QSizeF>\n#include <QTimer>\n\n\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n\nnamespace Ui {\n    class MaterialCtrlPanel;\n    class mTimer;\n}\n\nclass mTimer : public QTimer\n{\n    Q_OBJECT\n    public:\n        mTimer(double *_value_,QPushButton *_button_,int _addval_)\n        {\n            value=_value_;\n            button=_button_;\n            addval=_addval_;\n            connect(this, &mTimer::timeout, this, [=](){\n                if(count == 9)\n                {\n                    addval *= 10;\n                    count++;\n                }\n                else\n                    count++;\n                emit mtimeout();\n            });\n        }\n\n        //传入变更值，按键以及阈值\n        double *value;\n        QPushButton *button;\n        double addval;\n\n    private:\n        int count = 0;\n\n    signals:\n        void mtimeout();\n\n};\nclass MaterialCtrlPanel : public QDialog\n{\n        Q_OBJECT\n\n    public:\n        explicit MaterialCtrlPanel(QWidget *parent = nullptr);\n        ~MaterialCtrlPanel();\n\n    public:\n    void longPress(const double *maximumCount);\n\n        double Hotend = 0;\n        double Heatbed = 0;\n        double Tool = 0;\n        double Feedrate = 0;\n        double Flowrate = 0;\n        double FanSpeed = 0;\n        const double Hotend_Max = 260;\n        const double Heatbed_Max = 260;\n        const double Tool_Max = 0;\n        const double Feedrate_Max = 100;\n        const double Flowrate_Max = 100;\n        const double FanSpeed_Max = 255;\n        QString Symb_Temp = \"℃\";\n        QString Symb_Per = \"%\";\n        bool ReplyFlag = false;\n\n    private slots:\n        virtual void on_Btn_back_clicked();\n\n        virtual void on_Btn_Save_pressed();\n\n        virtual void on_Btn_Save_released();\n\n        virtual void on_Btn_Hotend_A_pressed();\n\n        virtual void on_Btn_Hotend_D_released();\n\n        virtual void on_Btn_Hotend_A_released();\n\n        virtual void on_Btn_Hotend_D_pressed();\n\n        virtual void on_Btn_Heatbed_A_pressed();\n\n        virtual void on_Btn_Heatbed_A_released();\n\n        virtual void on_Btn_Heatbed_D_pressed();\n\n        virtual void on_Btn_Heatbed_D_released();\n\n        virtual void on_Btn_Feedrate_A_pressed();\n\n        virtual void on_Btn_Feedrate_A_released();\n\n        virtual void on_Btn_Feedrate_D_pressed();\n\n        virtual void on_Btn_Feedrate_D_released();\n\n        virtual void on_Btn_Flowrate_A_pressed();\n\n        virtual void on_Btn_Flowrate_A_released();\n\n        virtual void on_Btn_Flowrate_D_pressed();\n\n        virtual void on_Btn_Flowrate_D_released();\n\n        virtual void TimerTimeOut();\n\n        virtual void Reply(QNetworkReply *reply);\n\n    private:\n        double Hotend_Target = 0;\n        double Heatbed_Target = 0;\n        double Tool_Target = 0;\n        double Feedrate_Target = 0;\n        double Flowrate_Target = 0;\n        double FanSpeed_Target = 0;\n        double number = 0;\n        int SettingStep = 1;\n\n        bool timerStartFlag = false;\n\n        bool firstClickedFlag = false;\n\n        mTimer *timer;\n\n        bool SettingFlag = false;\n\n        enum ReLoop {E_Temperature};\n        int ReLoopFlag;\n\n        Ui::MaterialCtrlPanel *ui;\n        QWidget *FUI;\n        QString StyleSheet_Temp;\n\n\n};\n\n#endif // MATERIALCTRLPANEL_H\n"
  },
  {
    "path": "materialctrlpanel.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>MaterialCtrlPanel</class>\n <widget class=\"QDialog\" name=\"MaterialCtrlPanel\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Materialctrl</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/kongzhimianban2.svg</normaloff>:/assets/kongzhimianban2.svg</iconset>\n  </property>\n  <property name=\"styleSheet\">\n   <string notr=\"true\"/>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"1,7\">\n   <property name=\"spacing\">\n    <number>3</number>\n   </property>\n   <property name=\"leftMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>5</number>\n   </property>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3\">\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_back\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/huitui.svg</normaloff>:/assets/huitui.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_3\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Logo\">\n       <property name=\"styleSheet\">\n        <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\n</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/kongzhimianban_L.svg</normaloff>:/assets/kongzhimianban_L.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_4\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QLabel\" name=\"label\">\n       <property name=\"minimumSize\">\n        <size>\n         <width>84</width>\n         <height>78</height>\n        </size>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <widget class=\"QWidget\" name=\"widget\" native=\"true\">\n     <layout class=\"QGridLayout\" name=\"gridLayout_2\" rowstretch=\"1,6,4,6,1,2,1\" columnstretch=\"2,10,1,10,1,10,1,10,2\">\n      <property name=\"sizeConstraint\">\n       <enum>QLayout::SetDefaultConstraint</enum>\n      </property>\n      <property name=\"spacing\">\n       <number>3</number>\n      </property>\n      <item row=\"2\" column=\"0\">\n       <spacer name=\"horizontalSpacer_6\">\n        <property name=\"orientation\">\n         <enum>Qt::Horizontal</enum>\n        </property>\n        <property name=\"sizeType\">\n         <enum>QSizePolicy::Preferred</enum>\n        </property>\n        <property name=\"sizeHint\" stdset=\"0\">\n         <size>\n          <width>10</width>\n          <height>10</height>\n         </size>\n        </property>\n       </spacer>\n      </item>\n      <item row=\"1\" column=\"1\" rowspan=\"3\">\n       <widget class=\"QGroupBox\" name=\"groupBox\">\n        <property name=\"font\">\n         <font>\n          <family>Gill Sans MT</family>\n          <pointsize>15</pointsize>\n          <weight>50</weight>\n          <bold>false</bold>\n         </font>\n        </property>\n        <property name=\"autoFillBackground\">\n         <bool>true</bool>\n        </property>\n        <property name=\"styleSheet\">\n         <string notr=\"true\">color: rgb(255, 255, 255);</string>\n        </property>\n        <property name=\"title\">\n         <string>Hotend</string>\n        </property>\n        <property name=\"alignment\">\n         <set>Qt::AlignCenter</set>\n        </property>\n        <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\" stretch=\"1,2,1\">\n         <property name=\"spacing\">\n          <number>1</number>\n         </property>\n         <property name=\"leftMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"topMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"rightMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"bottomMargin\">\n          <number>3</number>\n         </property>\n         <item>\n          <widget class=\"QPushButton\" name=\"Btn_Hotend_A\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>25</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">padding: 10px;\nborder-style: solid;\nborder-width: 5px;\nborder-radius: 20px;</string>\n           </property>\n           <property name=\"text\">\n            <string>+</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>48</width>\n             <height>48</height>\n            </size>\n           </property>\n           <property name=\"autoExclusive\">\n            <bool>false</bool>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">buttonGroup</string>\n           </attribute>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"Txt_Hotend\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>30</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">Border:none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>200℃</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <property name=\"checkable\">\n            <bool>true</bool>\n           </property>\n           <property name=\"checked\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"Btn_Hotend_D\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>25</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">padding: 10px;\nborder-style: solid;\nborder-width: 5px;\nborder-radius: 20px;</string>\n           </property>\n           <property name=\"text\">\n            <string>-</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>48</width>\n             <height>48</height>\n            </size>\n           </property>\n           <property name=\"autoRepeatInterval\">\n            <number>500</number>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">buttonGroup</string>\n           </attribute>\n          </widget>\n         </item>\n        </layout>\n       </widget>\n      </item>\n      <item row=\"1\" column=\"3\" rowspan=\"3\">\n       <widget class=\"QGroupBox\" name=\"groupBox_3\">\n        <property name=\"font\">\n         <font>\n          <family>Gill Sans MT</family>\n          <pointsize>15</pointsize>\n          <weight>50</weight>\n          <bold>false</bold>\n         </font>\n        </property>\n        <property name=\"autoFillBackground\">\n         <bool>true</bool>\n        </property>\n        <property name=\"styleSheet\">\n         <string notr=\"true\">color: rgb(255, 255, 255);</string>\n        </property>\n        <property name=\"title\">\n         <string>Heatbed</string>\n        </property>\n        <property name=\"alignment\">\n         <set>Qt::AlignCenter</set>\n        </property>\n        <layout class=\"QVBoxLayout\" name=\"verticalLayout_4\" stretch=\"1,2,1\">\n         <property name=\"spacing\">\n          <number>1</number>\n         </property>\n         <property name=\"leftMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"topMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"rightMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"bottomMargin\">\n          <number>3</number>\n         </property>\n         <item>\n          <widget class=\"QPushButton\" name=\"Btn_Heatbed_A\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>25</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">padding: 10px;\nborder-style: solid;\nborder-width: 5px;\nborder-radius: 20px;</string>\n           </property>\n           <property name=\"text\">\n            <string>+</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>48</width>\n             <height>48</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">buttonGroup</string>\n           </attribute>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"Txt_Heatbed\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>30</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">Border:none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>60℃</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <property name=\"checkable\">\n            <bool>true</bool>\n           </property>\n           <property name=\"checked\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"Btn_Heatbed_D\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>25</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">padding: 10px;\nborder-style: solid;\nborder-width: 5px;\nborder-radius: 20px;</string>\n           </property>\n           <property name=\"text\">\n            <string>-</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>48</width>\n             <height>48</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">buttonGroup</string>\n           </attribute>\n          </widget>\n         </item>\n        </layout>\n       </widget>\n      </item>\n      <item row=\"2\" column=\"4\">\n       <spacer name=\"horizontalSpacer_5\">\n        <property name=\"orientation\">\n         <enum>Qt::Horizontal</enum>\n        </property>\n        <property name=\"sizeType\">\n         <enum>QSizePolicy::Preferred</enum>\n        </property>\n        <property name=\"sizeHint\" stdset=\"0\">\n         <size>\n          <width>10</width>\n          <height>10</height>\n         </size>\n        </property>\n       </spacer>\n      </item>\n      <item row=\"2\" column=\"6\">\n       <spacer name=\"horizontalSpacer_7\">\n        <property name=\"orientation\">\n         <enum>Qt::Horizontal</enum>\n        </property>\n        <property name=\"sizeType\">\n         <enum>QSizePolicy::Preferred</enum>\n        </property>\n        <property name=\"sizeHint\" stdset=\"0\">\n         <size>\n          <width>10</width>\n          <height>10</height>\n         </size>\n        </property>\n       </spacer>\n      </item>\n      <item row=\"0\" column=\"4\">\n       <spacer name=\"verticalSpacer_3\">\n        <property name=\"orientation\">\n         <enum>Qt::Vertical</enum>\n        </property>\n        <property name=\"sizeType\">\n         <enum>QSizePolicy::Preferred</enum>\n        </property>\n        <property name=\"sizeHint\" stdset=\"0\">\n         <size>\n          <width>10</width>\n          <height>10</height>\n         </size>\n        </property>\n       </spacer>\n      </item>\n      <item row=\"1\" column=\"7\" rowspan=\"3\">\n       <widget class=\"QGroupBox\" name=\"groupBox_2\">\n        <property name=\"font\">\n         <font>\n          <family>Gill Sans MT</family>\n          <pointsize>15</pointsize>\n          <weight>50</weight>\n          <bold>false</bold>\n         </font>\n        </property>\n        <property name=\"autoFillBackground\">\n         <bool>true</bool>\n        </property>\n        <property name=\"styleSheet\">\n         <string notr=\"true\">color: rgb(255, 255, 255);</string>\n        </property>\n        <property name=\"title\">\n         <string>Flowrate</string>\n        </property>\n        <property name=\"alignment\">\n         <set>Qt::AlignCenter</set>\n        </property>\n        <layout class=\"QVBoxLayout\" name=\"verticalLayout_3\" stretch=\"1,2,1\">\n         <property name=\"spacing\">\n          <number>1</number>\n         </property>\n         <property name=\"leftMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"topMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"rightMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"bottomMargin\">\n          <number>3</number>\n         </property>\n         <item>\n          <widget class=\"QPushButton\" name=\"Btn_Flowrate_A\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>25</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">padding: 10px;\nborder-style: solid;\nborder-width: 5px;\nborder-radius: 20px;</string>\n           </property>\n           <property name=\"text\">\n            <string>+</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>48</width>\n             <height>48</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">buttonGroup</string>\n           </attribute>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"Txt_Flowrate\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>30</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">Border:none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>100%</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <property name=\"checkable\">\n            <bool>true</bool>\n           </property>\n           <property name=\"checked\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"Btn_Flowrate_D\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>25</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">padding: 10px;\nborder-style: solid;\nborder-width: 5px;\nborder-radius: 20px;</string>\n           </property>\n           <property name=\"text\">\n            <string>-</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>48</width>\n             <height>48</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">buttonGroup</string>\n           </attribute>\n          </widget>\n         </item>\n        </layout>\n       </widget>\n      </item>\n      <item row=\"2\" column=\"2\">\n       <spacer name=\"horizontalSpacer\">\n        <property name=\"orientation\">\n         <enum>Qt::Horizontal</enum>\n        </property>\n        <property name=\"sizeType\">\n         <enum>QSizePolicy::Preferred</enum>\n        </property>\n        <property name=\"sizeHint\" stdset=\"0\">\n         <size>\n          <width>10</width>\n          <height>10</height>\n         </size>\n        </property>\n       </spacer>\n      </item>\n      <item row=\"5\" column=\"3\" colspan=\"3\" alignment=\"Qt::AlignHCenter|Qt::AlignVCenter\">\n       <widget class=\"QPushButton\" name=\"Btn_Save\">\n        <property name=\"sizePolicy\">\n         <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n          <horstretch>0</horstretch>\n          <verstretch>0</verstretch>\n         </sizepolicy>\n        </property>\n        <property name=\"font\">\n         <font>\n          <family>Gill Sans MT</family>\n          <pointsize>30</pointsize>\n          <weight>50</weight>\n          <bold>false</bold>\n         </font>\n        </property>\n        <property name=\"whatsThis\">\n         <string>BTStyleSheet1</string>\n        </property>\n        <property name=\"text\">\n         <string>SAVE</string>\n        </property>\n        <property name=\"iconSize\">\n         <size>\n          <width>64</width>\n          <height>64</height>\n         </size>\n        </property>\n        <attribute name=\"buttonGroup\">\n         <string notr=\"true\">buttonGroup</string>\n        </attribute>\n       </widget>\n      </item>\n      <item row=\"4\" column=\"4\">\n       <spacer name=\"verticalSpacer\">\n        <property name=\"orientation\">\n         <enum>Qt::Vertical</enum>\n        </property>\n        <property name=\"sizeType\">\n         <enum>QSizePolicy::Preferred</enum>\n        </property>\n        <property name=\"sizeHint\" stdset=\"0\">\n         <size>\n          <width>10</width>\n          <height>10</height>\n         </size>\n        </property>\n       </spacer>\n      </item>\n      <item row=\"2\" column=\"8\">\n       <spacer name=\"horizontalSpacer_2\">\n        <property name=\"orientation\">\n         <enum>Qt::Horizontal</enum>\n        </property>\n        <property name=\"sizeType\">\n         <enum>QSizePolicy::Preferred</enum>\n        </property>\n        <property name=\"sizeHint\" stdset=\"0\">\n         <size>\n          <width>10</width>\n          <height>10</height>\n         </size>\n        </property>\n       </spacer>\n      </item>\n      <item row=\"6\" column=\"4\">\n       <spacer name=\"verticalSpacer_2\">\n        <property name=\"orientation\">\n         <enum>Qt::Vertical</enum>\n        </property>\n        <property name=\"sizeType\">\n         <enum>QSizePolicy::Preferred</enum>\n        </property>\n        <property name=\"sizeHint\" stdset=\"0\">\n         <size>\n          <width>10</width>\n          <height>10</height>\n         </size>\n        </property>\n       </spacer>\n      </item>\n      <item row=\"1\" column=\"5\" rowspan=\"3\">\n       <widget class=\"QGroupBox\" name=\"groupBox_4\">\n        <property name=\"font\">\n         <font>\n          <family>Gill Sans MT</family>\n          <pointsize>15</pointsize>\n          <weight>50</weight>\n          <bold>false</bold>\n         </font>\n        </property>\n        <property name=\"autoFillBackground\">\n         <bool>true</bool>\n        </property>\n        <property name=\"styleSheet\">\n         <string notr=\"true\">color: rgb(255, 255, 255);</string>\n        </property>\n        <property name=\"title\">\n         <string>Feedrate</string>\n        </property>\n        <property name=\"alignment\">\n         <set>Qt::AlignCenter</set>\n        </property>\n        <layout class=\"QVBoxLayout\" name=\"verticalLayout_5\" stretch=\"1,2,1\">\n         <property name=\"spacing\">\n          <number>1</number>\n         </property>\n         <property name=\"leftMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"topMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"rightMargin\">\n          <number>3</number>\n         </property>\n         <property name=\"bottomMargin\">\n          <number>3</number>\n         </property>\n         <item>\n          <widget class=\"QPushButton\" name=\"Btn_Feedrate_A\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>25</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">padding: 10px;\nborder-style: solid;\nborder-width: 5px;\nborder-radius: 20px;</string>\n           </property>\n           <property name=\"text\">\n            <string>+</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>48</width>\n             <height>48</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">buttonGroup</string>\n           </attribute>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"Txt_Feedrate\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>30</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">Border:none;\ncolor: rgb(245, 246, 250);</string>\n           </property>\n           <property name=\"text\">\n            <string>100%</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>64</width>\n             <height>64</height>\n            </size>\n           </property>\n           <property name=\"checkable\">\n            <bool>true</bool>\n           </property>\n           <property name=\"checked\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"Btn_Feedrate_D\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"font\">\n            <font>\n             <family>Gill Sans MT</family>\n             <pointsize>25</pointsize>\n             <weight>50</weight>\n             <bold>false</bold>\n            </font>\n           </property>\n           <property name=\"styleSheet\">\n            <string notr=\"true\">padding: 10px;\nborder-style: solid;\nborder-width: 5px;\nborder-radius: 20px;</string>\n           </property>\n           <property name=\"text\">\n            <string>-</string>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>48</width>\n             <height>48</height>\n            </size>\n           </property>\n           <attribute name=\"buttonGroup\">\n            <string notr=\"true\">buttonGroup</string>\n           </attribute>\n          </widget>\n         </item>\n        </layout>\n       </widget>\n      </item>\n     </layout>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections/>\n <buttongroups>\n  <buttongroup name=\"buttonGroup\"/>\n </buttongroups>\n</ui>\n"
  },
  {
    "path": "mylineedit.cpp",
    "content": "﻿#include \"mylineedit.h\"\n\nMyLineEdit::MyLineEdit(QWidget *parent):QLineEdit(parent)\n{\n    FUI = (QWidget*)parent;//((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_Setting);\n\n//    connect(inputdialog,&InputDialog::closedialog,this,[=](QString value,bool SettingMark){\n//        FUI->show();\n//        if(SettingMark)\n//        {\n//            this->setText(value);\n//        }\n////        inputdialog->close();\n////        this->show();\n//    });\n}\n\n//MyLineEdit::~MyLineEdit()\n//{\n////    inputdialog->~InputDialog();\n////    delete this;\n//    this->close();\n//}\n\nvoid MyLineEdit::mousePressEvent(QMouseEvent *event)\n{\n    Q_UNUSED(event);\n//    inputdialog->setvalue(\"Please Input Commands\",\"\",this->text());\n    InputDialog *inputdialog = new InputDialog(FUI);\n    connect(inputdialog,&InputDialog::closedialog,this,[=](QString value,bool SettingMark){\n        if(SettingMark)\n        {\n              this->setText(value);\n        }\n        FUI->show();\n        delete sender();\n    });\n    inputdialog->setvalue(\"Please Input Commands\",\"\",this->text());\n\n}\n"
  },
  {
    "path": "mylineedit.h",
    "content": "#ifndef MYLINEEDIT_H\n#define MYLINEEDIT_H\n\n#include <QLineEdit>\n#include \"inputdialog.h\"\n\nclass MyLineEdit : public QLineEdit\n{\npublic:\n//    MyLineEdit(QWidget *parent=0);\n    explicit MyLineEdit(QWidget *parent = Q_NULLPTR);\n//    explicit MyLineEdit(const QString &, QWidget *parent = Q_NULLPTR);\n//    ~MyLineEdit();\npublic:\n\nprivate:\n//    InputDialog *inputdialog = new InputDialog(this);\n    QWidget *FUI;\nprotected:\n    void mousePressEvent(QMouseEvent *);\n};\n\n#endif // MYLINEEDIT_H\n"
  },
  {
    "path": "octonetwork.cpp",
    "content": "﻿#include \"octonetwork.h\"\n#include <QJsonDocument>\n#include <QJsonObject>\n#include <QNetworkReply>\n#include <QDebug>\n#include <QJsonArray>\n#include <filedialog.h>\n#include <mainwindow.h>\n#include <QDialog>\n#include <QLayout>\n#include <QTextBrowser>\n#include <QApplication>\n#include <QPushButton>\n#include <QDesktopWidget>\n#include \"customdialog.h\"\n\n\nOctoNetwork::OctoNetwork(QWidget *parent)\n{\n    FUI = (MainWindow*)parent;\n\n    GetConnectRequest.setUrl(QUrl(MainUrl + \"connection\"));\n    GetConnectRequest.setRawHeader(\"X_Api_Key\",X_API_Key);\n    GetConnectRequest.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n\n    GetStateRequest.setUrl(QUrl(MainUrl + \"job\"));\n    GetStateRequest.setRawHeader(\"X_Api_Key\",X_API_Key);\n    GetStateRequest.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n\n    SetConnectRequest.setUrl(QUrl(MainUrl + \"connection\"));\n    SetConnectRequest.setRawHeader(\"X_Api_Key\",X_API_Key);\n    SetConnectRequest.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n\n    GetTemperatureRequest.setUrl(QUrl(MainUrl + \"printer\"));\n    GetTemperatureRequest.setRawHeader(\"X_Api_Key\",X_API_Key);\n    GetTemperatureRequest.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n\n    SetCMDRequest.setUrl(QUrl(MainUrl + \"printer/command\"));\n    SetCMDRequest.setRawHeader(\"X_Api_Key\",X_API_Key);\n    SetCMDRequest.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n\n    SDRequest.setUrl(QUrl(MainUrl + \"printer/sd\"));\n    SDRequest.setRawHeader(\"X_Api_Key\",X_API_Key);\n    SDRequest.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n\n    FileRequest.setUrl(QUrl(MainUrl + \"files\"));\n    FileRequest.setRawHeader(\"X_Api_Key\",X_API_Key);\n    FileRequest.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n    //    TemperatureJson.object().insert(\"command\",\"target\");\n\n    //save code\n    //QMetaObject::Connection connRet = QObject::connect(networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(ConnectReplay(QNetworkReply*)));\n    //Q_ASSERT(connRet);\n}\n\nQJsonValue OctoNetwork::SearchJsonValue(QList<QString> Find_List_Name ,QNetworkReply *reply)\n{\n    int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();\n    if(QSysInfo::productType() != \"raspbian\")\n    {\n        LibLog::LogRec(QString(\"statusCode : %1___%2___%3\").arg(statusCode).arg(__FILE__).arg(__LINE__), \"connect\");\n    }\n    if(statusCode != 200)\n    {\n        ConnectState = \"Error\";\n        return QJsonValue::Null;\n    }\n    if(reply->error() == QNetworkReply::NoError)\n    {\n        QByteArray replyArray = reply->readAll();\n        QJsonDocument loadDoc(QJsonDocument::fromJson(replyArray));\n        QJsonObject QObj = loadDoc.object();\n        if(QSysInfo::productType() != \"raspbian\")\n        {\n            LibLog::LogRec(QString(\"%1___%2___%3\").arg(QString(replyArray)).arg(__FILE__).arg(__LINE__), \"connect\");\n            LibLog::LogRec(\"***************************************\", \"connect\");\n        }\n        QList<QString> SearchLink ;\n        SearchLink << Find_List_Name;\n        return SearchJsonValue(SearchLink , QObj);\n    }\n    else\n    {\n        return QJsonValue::Null;\n    }\n}\nQList<QJsonValue> OctoNetwork::SearchJsonValue(QList<QList<QString>> Find_List_Names ,QNetworkReply *reply)\n{\n    int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();\n    if(QSysInfo::productType() != \"raspbian\"){\n        LibLog::LogRec(QString(\"statusCode : %1___%2___%3\").arg(statusCode).arg(__FILE__).arg(__LINE__), \"connect\");\n    }\n    if(statusCode != 200)\n    {\n        ConnectState = \"Error\";\n        return {};\n    }\n    if(reply->error() == QNetworkReply::NoError)\n    {\n        QByteArray replyArray = reply->readAll();\n        QJsonDocument loadDoc(QJsonDocument::fromJson(replyArray));\n        QJsonObject QObj = loadDoc.object();\n\n        if(QSysInfo::productType() != \"raspbian\")\n        {\n            LibLog::LogRec(QString(\"%1___%2___%3\").arg(QString(replyArray)).arg(__FILE__).arg(__LINE__), \"connect\");\n            LibLog::LogRec(\"***************************************\", \"connect\");\n        }\n        QList<QList<QString>> SearchLink ;\n        SearchLink << Find_List_Names;\n        return SearchJsonValue(SearchLink , QObj);\n    }\n    else\n    {\n        return {};\n    }\n}\n//Find_List_Name : Retrieved List Sequence --> [Grandma,Mother,Me]\n//_QObj:Retrieved Retrieved Json Objecet\nQJsonValue OctoNetwork::SearchJsonValue(QList<QString> Find_List_Name , QJsonObject _QObj)\n{\n    QJsonValue returnValue;\n    QList<QString> SearchLink ;\n    SearchLink << Find_List_Name;\n    if(SearchLink.count() > 1)\n    {\n        QString MotherKey = SearchLink[0];\n        SearchLink.removeFirst();\n        if(MotherKey.indexOf(\"*\") >= 0)//wildcard\n        {\n            QJsonArray ArrayValue;\n            for(int i = 0 ; i <= 9 ; i++)\n            {\n                QString TempMotherKey = MotherKey;\n                if(_QObj.find(TempMotherKey.replace(\"*\",QString::number(i))).value().isUndefined())continue;\n//                if(QSysInfo::productType() != \"raspbian\"){qDebug()<<_QObj.find(TempMotherKey.replace(\"*\",QString::number(i))).value().isUndefined();};\n                QJsonValue data = SearchJsonValue(SearchLink , _QObj.constFind(TempMotherKey.replace(\"*\",QString::number(i))).value().toObject());\n                ArrayValue.append(data);\n            }\n            returnValue = ArrayValue;\n        }\n        else\n            returnValue = SearchJsonValue(SearchLink , _QObj.constFind(MotherKey).value().toObject());\n    }\n    else\n    {\n        if(SearchLink[0].indexOf(\"*\") >= 0)//wildcard\n        {\n\n        }\n        else\n            returnValue = _QObj.constFind(SearchLink[0]).value();\n    }\n    return returnValue;\n}\nQList<QJsonValue> OctoNetwork::SearchJsonValue(QList<QList<QString>> Find_List_Names , QJsonObject _QObj)\n{\n    QList<QJsonValue> _returnValue ;\n    foreach(QList<QString> item , Find_List_Names)\n    {\n        _returnValue.append(SearchJsonValue(item,_QObj));\n    }\n    return _returnValue;\n}\n\nvoid OctoNetwork::SendGCode(QList<QString> _GCode_)\n{\n    if(_GCode_.count() > 0 && (ConnectState.contains(\"Printing\") || ConnectState == \"Operational\"))\n    {\n        QJsonObject TemperatureJsonObj;\n        QJsonArray _Commands;\n        foreach(QString item,_GCode_)//遍历_GCode_，把所有指令加入指令合集\n        {\n            _Commands.append(item);\n        }\n\n        TemperatureJsonObj.insert(\"commands\",_Commands);\n\n        QJsonDocument _SenderJson;\n        _SenderJson.setObject(TemperatureJsonObj);\n\n        //网络访问管理器将Json格式的指令集发送给SetCMDRequest\n        MCPnetworkAccessManager->post(SetCMDRequest,_SenderJson.toJson());\n\n    }\n}\nvoid OctoNetwork::SendGCode(QString _GCode_)\n{\n    if(_GCode_.length() > 0 && (ConnectState == \"Operational\" || ConnectState.contains(\"Printing\")))\n    {\n        QJsonObject TemperatureJsonObj;\n        QJsonArray _Commands;\n        _Commands.append(_GCode_);\n\n        TemperatureJsonObj.insert(\"commands\",_Commands);\n\n        QJsonDocument _SenderJson;\n        _SenderJson.setObject(TemperatureJsonObj);\n\n        MCPnetworkAccessManager->post(SetCMDRequest,_SenderJson.toJson());\n    }\n}\nvoid OctoNetwork::SD_ReLoad()\n{\n    if(!ConnectState.contains(\"Printing\")  && ConnectState != \"Pausing\")\n    {\n        SD_CMD(\"release\");\n        SD_CMD(\"init\");\n    }\n    SD_CMD(\"refresh\");\n}\nvoid OctoNetwork::SD_CMD(QString CMD)\n{\n    if(ConnectState == \"Operational\")\n    {\n        QJsonObject TemperatureJsonObj;\n\n        TemperatureJsonObj.insert(\"command\",CMD);\n\n        QJsonDocument _SenderJson;\n        _SenderJson.setObject(TemperatureJsonObj);\n        if(QSysInfo::productType() != \"raspbian\")\n        {\n            LibLog::LogRec(QString(\"%1___%2___%3\").arg(QString(_SenderJson.toJson())).arg(__FILE__).arg(__LINE__), \"connect\");\n        }\n        FSnetworkAccessManager->post(SDRequest,_SenderJson.toJson());\n    }\n}\n//Start Or Stop\nvoid OctoNetwork::JobSwitch(QString FilePath)\n{\n    if(ConnectState == \"Operational\")\n    {\n        QStringList btnName = {\"Yes\", \"No\"} ;\n        CustomDialog *newDialog = new CustomDialog();\n        QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n        {\n            if(instruct == \"Yes\")\n            {\n                JobSwitch(QUrl(MainUrl + \"files/\" +FilePath));\n            }\n        });\n        newDialog->showCustomDialog(\"Warning\",\":/assets/info.svg\",btnName,\"Do you want to Start Print ?\",FUI);\n    }\n    else if(ConnectState.contains(\"Printing\") || ConnectState == \"Pausing\")\n    {\n        JobSwitch();//Stop\n    }\n}\nvoid OctoNetwork::JobSwitch(QUrl FileUrl)\n{\n    _FileUrl = FileUrl;\n    if(ConnectState == \"Operational\")\n    {\n        QString FileName = FileDialog::Hex2QString(FileUrl.url(),false);\n\n        QStringList btnName = {\"Yes\", \"No\"} ;\n        CustomDialog *newDialog = new CustomDialog();\n        QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n        {\n            if(instruct == \"Yes\")\n            {\n                _FileUrl = ((MainWindow*)FUI)->filedialog->GetRealURL(FileUrl);\n                //Auto Level\n    //            QList<QString> _GCode_;\n    //            _GCode_.append(\"G91\");\n    //            _GCode_.append(\"G28\");\n    //            _GCode_.append(\"G29\");\n    //            _GCode_.append(\"G28\");\n    //            _GCode_.append(\"G90\");\n    //            SendGCode(_GCode_);\n\n                QJsonObject TemperatureJsonObj;\n                TemperatureJsonObj.insert(\"command\",\"select\");\n                TemperatureJsonObj.insert(\"print\",true);\n\n                QNetworkRequest _Request;\n                _Request.setUrl(FileUrl);\n                _Request.setRawHeader(\"X_Api_Key\",X_API_Key);\n                _Request.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n\n                QJsonDocument _SenderJson;\n                _SenderJson.setObject(TemperatureJsonObj);\n\n                MCPnetworkAccessManager->post(_Request,_SenderJson.toJson());\n            }\n        });\n        newDialog->showCustomDialog(\"Warning\",\":/assets/info.svg\",btnName,\"Do you want to Start Print \"+FileName+\"?\",FUI);\n    }\n    else if(ConnectState.contains(\"Printing\")  || ConnectState == \"Pausing\")\n    {\n        JobSwitch();//Stop\n    }\n}\n//Only Stop\nvoid OctoNetwork::JobSwitch()\n{\n    //up z-axis 5cm\n    if(ConnectState.contains(\"Printing\")  || ConnectState == \"Pausing\")\n    {\n        QStringList btnName = {\"Yes\", \"No\"} ;\n        CustomDialog *newDialog = new CustomDialog();\n        QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n        {\n            if(instruct == \"Yes\")\n            {\n                QJsonObject TemperatureJsonObj;\n                TemperatureJsonObj.insert(\"command\",\"cancel\");\n\n                QNetworkRequest _Request;\n                _Request.setUrl(QUrl(MainUrl + \"job\"));\n                _Request.setRawHeader(\"X_Api_Key\",X_API_Key);\n                _Request.setHeader(QNetworkRequest::ContentTypeHeader,QVariant(\"application/json\"));\n\n                QJsonDocument _SenderJson;\n                _SenderJson.setObject(TemperatureJsonObj);\n\n                MCPnetworkAccessManager->post(_Request,_SenderJson.toJson());\n            }\n        });\n        newDialog->showCustomDialog(\"Information\",\":/assets/info.svg\",btnName,\"Do you want to Stop Print ?\",FUI);\n    }\n}\n"
  },
  {
    "path": "octonetwork.h",
    "content": "﻿#ifndef OCTONETWORK_H\n#define OCTONETWORK_H\n\n#include <QJsonDocument>\n#include <QJsonObject>\n\n#include <QNetworkReply>\n\nextern QByteArray Global_X_API_Key ;//Test Key\n\nextern int DebugFlat ;\n//extern QSize SizePercent;\n\nclass OctoNetwork\n{\n    public:\n        OctoNetwork(QWidget *parent = nullptr);\n//        void Initialize(QByteArray New_X_API_Key = \"\");\n        QJsonValue SearchJsonValue(QList<QString> Find_List_Name , QJsonObject _QObj);\n        QJsonValue SearchJsonValue(QList<QString> Find_List_Name ,QNetworkReply *reply);\n        QList<QJsonValue> SearchJsonValue(QList<QList<QString>> Find_List_Names , QJsonObject _QObj);\n        QList<QJsonValue> SearchJsonValue(QList<QList<QString>> Find_List_Names ,QNetworkReply *reply);\n        void SendGCode(QList<QString> _GCode_);\n        void SendGCode(QString _GCode_);\n        void JobSwitch(QString FilePath);\n        void JobSwitch(QUrl FileUrl);\n        void JobSwitch();\n        void SD_ReLoad();\n\n    private:\n        virtual void SD_CMD(QString CMD);\n        QWidget *FUI;\n\n        QUrl _FileUrl;\n\n    public:\n        QByteArray X_API_Key = Global_X_API_Key;//Test Key\n        QString MainIP = \"127.0.0.1\";\n//        QString MainIP = \"192.168.100.94\";\n        QString MainAddress = \"http://\"+MainIP+\"/\";\n        QString MainUrl = MainAddress + \"api/\";\n        QString ConnectState = \"Close\";\n        bool ConnectFlat = false;\n\n        QNetworkAccessManager *networkAccessManager = new QNetworkAccessManager();\n        QNetworkAccessManager *MCPnetworkAccessManager = new QNetworkAccessManager();\n        QNetworkAccessManager *FSnetworkAccessManager = new QNetworkAccessManager();\n\n        QNetworkRequest GetConnectRequest;\n        QNetworkRequest GetStateRequest;\n\n        QNetworkRequest SetConnectRequest;\n        const QList<QList<QString>> ConnectLink = {{\"current\",\"state\"},{\"options\",\"ports\"}};\n        const QList<QString> ConnectSerialLink = {\"/dev/ttyAMA0\",\"/dev/ttyS0\"};\n        const QList<QList<QString>> StateLink = {{\"state\"},{\"progress\",\"completion\"}};//using with printer in the Printing state\n\n        QNetworkRequest SetCMDRequest;\n        QNetworkRequest SDRequest;\n        QNetworkRequest FileRequest;\n\n        QNetworkRequest GetTemperatureRequest;\n        const QList<QList<QString>> TemperatureLink = {{\"temperature\",\"bed\",\"actual\"},{\"temperature\",\"tool*\",\"actual\"}};\n\n\n    private:\n};\n\n#endif // OCTONETWORK_H\n"
  },
  {
    "path": "start.sh",
    "content": "sleep 2\ncd /home/pi/OctoBTT && ./OctoBTT -platform eglfs\n"
  },
  {
    "path": "startup.sh",
    "content": "su -l pi << EOF\ncd\nwget --no-check-certificate https://raw.githubusercontent.com/bigtreetech/OctoBTT/master/install.sh\nsudo sed -i '/exit 0/ i sudo \\/bin\\/sh \\/home\\/pi\\/install.sh' /etc/rc.local\nsudo reboot\nEOF\n"
  },
  {
    "path": "terminaldialog.cpp",
    "content": "﻿#include \"terminaldialog.h\"\n#include \"ui_terminaldialog.h\"\n#include <QTreeWidgetItem>\n#include <QScrollBar>\n#include <QProcess>\n//#include <QSizeF>\n#include <QTimer>\n#include <QStringList>\n#include <mainwindow.h>\n#include <QTextCodec>\n#include <QTextBrowser>\n#include \"inputdialog.h\"\n#include <QDesktopWidget>\n\nTerminalDialog::TerminalDialog(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::TerminalDialog)\n{\n    ui->setupUi(this);\n\n    FUI = (MainWindow*)parent;//((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_Setting);\n\n    cmd = new QProcess(this);\n\n    /* 将QProcess的输出错误打印到界面 */\n    connect(cmd,&QProcess::readyReadStandardError,this,[=](){\n        if(!SendCMD_argu.contains(\"-e\")) ui->Receiver->append(\"->Receive->->-> Standard Error\");\n        QString outStr = QString::fromLocal8Bit(cmd->readAllStandardError());\n        if(!SendCMD_argu.contains(\"-e\")) ui->Receiver->append(\"<<StandardError:\");\n        if(!SendCMD_argu.contains(\"-e\")) ui->Receiver->append(outStr.trimmed());\n        if(!SendCMD_argu.contains(\"-e\")) ui->Receiver->horizontalScrollBar()->setValue(ui->Receiver->horizontalScrollBar()->maximum());\n\n//        QStringList _output;\n//        _output<<\"&&StandardError\"<<outStr;\n//        emit CMD_Reply(_output);//抛出槽触发\n//        if(outStr.trimmed().contains(\"sudo\") && outStr.trimmed().contains(\"askpass\") && command.contains(\"sudo \"))\n//        {\n//            int startlocal = command.indexOf(\"sudo \");\n//            command = command.replace(startlocal,5,\"echo \\\"\" + CMD_Password + \"\\\" | sudo -S \");//片段阔幅代码未处理\n//            command = command.remove(0,startlocal);\n//            SendCMD(command);\n//        }\n    });\n    /* 将QProcess的输出打印到界面 */\n    connect(cmd,&QProcess::readyReadStandardOutput,this,[=](){\n        if(!SendCMD_argu.contains(\"-q\")) ui->Receiver->append(\"->Receive->->-> Standard Output\");\n        QString outStr = QString::fromLocal8Bit(cmd->readAllStandardOutput());\n        if(!SendCMD_argu.contains(\"-q\")) ui->Receiver->append(\"<<Receiver:\");\n        //            ui->Receiver->append(outStr.trimmed());\n        //            ui->Receiver->horizontalScrollBar()->setValue(ui->Receiver->horizontalScrollBar()->maximum());\n//        cmd->disconnect(SIGNAL(readyReadStandardOutput()));\n        QStringList _output;\n        foreach(QString item,outStr.trimmed().split(\"\\n\",QString::SkipEmptyParts))\n        {\n            if(item.trimmed() != \"\")\n            {\n                QString Data = item.trimmed();\n                while (Data.indexOf(\"\\\\x\")>=0)//字符处理\n                {\n                    int index = Data.indexOf(\"\\\\x\");\n                    QString Block = Data.mid(index,12);\n                    Block = Block.replace(\"\\\\x\", QString());\n                    QString Blocks ;\n                    Blocks.append(Block.mid(0,2).toUShort(0,16));\n                    Blocks.append(Block.mid(2,2).toUShort(0,16));\n                    Blocks.append(Block.mid(4,2).toUShort(0,16));\n//                    QTextCodec *codec = QTextCodec::codecForName(\"UTF-8\");\n//                    QString desStr = codec->fromUnicode(Blocks);\n                    Data = Data.replace(index, 12, tr(Blocks.toLatin1().data()));\n//                    Data = unicodeToUtf8(Data);\n                }\n//                while (Data.indexOf(\"\\\\u\")>=0)\n//                {\n//                    int index = Data.indexOf(\"\\\\u\");\n//                    QString Block = Data.mid(index,6);\n//                    Block = Block.replace(\"\\\\u\", QString());\n//                    int nHex = Block.toInt(0, 16);\n//                    Data.replace(index, 6, QChar(nHex));\n//                }\n                _output.append(Data);//创建序列\n                if(!SendCMD_argu.contains(\"-q\")) ui->Receiver->append(Data);\n                if(!SendCMD_argu.contains(\"-q\")) ui->Receiver->horizontalScrollBar()->setValue(ui->Receiver->horizontalScrollBar()->maximum());\n            }\n        }\n        emit CMD_Reply(_output);//抛出槽触发\n        //            CMD_Reply *CMD_reply = new CMD_Reply(_output);\n        //            QCoreApplication::postEvent(this, CMD_reply);//抛出事件\n    });\n    /* 将QProcess的 \"启动/写入/结束\" 打印到界面 */\n    connect(cmd,&QProcess::started,this,[=](){\n        ui->Receiver->append(\"->Started->->->\");\n        ui->Receiver->horizontalScrollBar()->setValue(ui->Receiver->horizontalScrollBar()->maximum());\n    });\n    connect(cmd, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),[=](int exitCode, QProcess::ExitStatus exitStatus){\n        Q_UNUSED(exitCode);\n        Q_UNUSED(exitStatus);\n        if(!CloseDialog)\n        {\n            ui->Receiver->append(\"->Finished->->->\");\n            ui->Receiver->horizontalScrollBar()->setValue(ui->Receiver->horizontalScrollBar()->maximum());\n            cmd->start(\"/bin/bash\");\n        }\n    });\n\n//    cmd->setReadChannelMode(QProcess::ForwardedChannels);\n    cmd->start(\"/bin/bash\");\n    ui->Sender->setFocus();\n//    SendCMD(\"export DISPLAY=\\\":0.0\\\"\");\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n\n}\n\n//QString TerminalDialog::unicodeToUtf8(const QString resStr)\n//{\n//    QString temp;\n//    for(int i=0;i<resStr.length();)\n//    {\n//        if(resStr.at(i)=='\\\\' && resStr.at(i+1)=='x')\n//        {\n//            QString str = resStr.mid(i+2,i+4);\n//            temp.append(str.mid(0,2).toUShort(0,16));\n//            i=i+4;\n//        }\n//        else\n//        {\n//            temp.append(resStr.at(i));\n//            ++i;\n//        }\n//    }\n//    QTextCodec *codec = QTextCodec::codecForName(\"UTF-8\");\n//    QString desStr = codec->fromUnicode(temp);\n//    return tr(desStr.toLatin1().data());\n//}\n\nTerminalDialog::~TerminalDialog()\n{\n    delete ui;\n\n    CloseDialog = true;\n    if (cmd->state() == QProcess::Running)\n    {\n        cmd->terminate();\n        cmd->close();\n        cmd->waitForFinished();\n    }\n}\n\nvoid TerminalDialog::showEvent(QShowEvent *event)\n{\n    Q_UNUSED(event);\n    if(FirstLoad)\n    {\n        FirstLoad = !FirstLoad;\n    }\n}\n\nvoid TerminalDialog::on_Btn_Back_clicked()\n{\n    this->close();\n}\n\nvoid TerminalDialog::on_Btn_Send_clicked()\n{\n    if(ui->Sender->text().isEmpty())\n    {\n//        ui->Sender->setFocus();\n        return;\n    }\n    ui->Sender->setText(ui->Sender->text().trimmed());\n\n    SendCMD(ui->Sender->text());\n//    ui->Sender->setFocus();\n}\n\nvoid TerminalDialog::on_pushButton_clicked()\n{\n    ui->Receiver->clear();\n}\n\nvoid TerminalDialog::Show_debug(QString msg)\n{\n    ui->Receiver->append(\"->System MSG->->->\" + msg);\n}\nvoid TerminalDialog::SendCMD(QString CommandLine , QString argu)\n{\n    SendCMD_argu = argu;\n    command = CommandLine.trimmed();\n    if(command.isEmpty() || command == \"\")\n    {\n        return;\n    }\n    if(!cmd->isOpen())\n    {\n        cmd->open();\n    }\n    if(command.toLower() == \"exit app\" || command.toLower() == \"exitapp\")\n        qApp->exit(Base_OnlyExitApp);\n//    else if(command.toLower().startsWith(\"qdebug \"))\n//    {\n//        qDebug() << command.remove(0,6);\n//    }\n    else if(cmd->isOpen() && cmd->waitForStarted())\n    {\n        if(!SendCMD_argu.contains(\"-q\")) ui->Receiver->append(\">>Sender:\");\n        if(!SendCMD_argu.contains(\"-q\")) ui->Receiver->append(command);\n        if(command.contains(\"sudo \"))\n        {\n            int startlocal = command.indexOf(\"sudo \");\n            command = command.replace(startlocal,5,\"echo \\\"\" + CMD_Password + \"\\\" | sudo -S \");//片段阔幅代码未处理\n        }\n        cmd->write(command.toLocal8Bit()+ \"\\n\");\n        if(!SendCMD_argu.contains(\"-q\")) ui->Receiver->horizontalScrollBar()->setValue(ui->Receiver->horizontalScrollBar()->maximum());\n    }\n    else if(!cmd->isOpen())\n    {\n        ui->Receiver->append(\"->System Busy->->->\");\n    }\n}\n\n//QEvent::Type CMD_Reply::m_EventType = QEvent::None;\n\n//CMD_Reply::CMD_Reply(QStringList _value) : QEvent(eventType())\n//{\n//    m_StringList = _value;\n//}\n\n//CMD_Reply::~CMD_Reply()\n//{\n\n//}\n\n//QEvent::Type CMD_Reply::eventType()\n//{\n//    // 创建事件Type\n//    if (m_EventType == QEvent::None)\n//        m_EventType = (QEvent::Type)QEvent::registerEventType();\n\n//    return m_EventType;\n//}\n\n//QStringList CMD_Reply::getValue(void)\n//{\n//    return m_StringList;\n//}\n\nvoid TerminalDialog::on_Btn_Logo_clicked()\n{\n    QStringList btnName = {\"Yes\", \"No\"} ;\n    CustomDialog *newDialog = new CustomDialog();\n    QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n    {\n        if(instruct == \"Yes\")\n        {\n            InputDialog *inputdialog = new InputDialog(this);\n            connect(inputdialog,&InputDialog::closedialog,this,[=](QString value,bool SettingMark){\n                if(SettingMark)\n                {\n                    CMD_Password = value;\n                }\n                delete sender();\n            });\n            inputdialog->setvalue(\"Please Input Password\",\"\",CMD_Password);\n        }\n    });\n    newDialog->showCustomDialog(\"Warning\",\":/assets/terminal-box-line.svg\",btnName,\"Do you want to change the incoming password from the console ?\",this);\n}\n\nvoid TerminalDialog::on_Btn_Kill_clicked()\n{\n    cmd->terminate();\n}\n"
  },
  {
    "path": "terminaldialog.h",
    "content": "﻿#ifndef TERMINALDIALOG_H\n#define TERMINALDIALOG_H\n\n#include <QDialog>\n#include <QProcess>\n#include <QShowEvent>\n#include <QSizeF>\n//#include <QEvent>\n\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n\nnamespace Ui {\nclass TerminalDialog;\n}\n\nclass TerminalDialog : public QDialog\n{\n    Q_OBJECT\nsignals:\n    void CMD_Reply(QStringList &value);\n\npublic:\n    explicit TerminalDialog(QWidget *parent = nullptr);\n    ~TerminalDialog();\n\n    void SendCMD(QString CommandLine, QString argu = QString());\n\n    void Show_debug(QString msg);\n\nprivate slots:\n    virtual void on_Btn_Back_clicked();\n\n    virtual void on_Btn_Send_clicked();\n\n    virtual void on_pushButton_clicked();\n\n    virtual void on_Btn_Logo_clicked();\n\n    void on_Btn_Kill_clicked();\n\nprivate:\n    Ui::TerminalDialog *ui;\n    QProcess *cmd;\n//    bool CMD_NoPassword = false;\n    QString command;\n    QWidget *FUI;\n    bool FirstLoad = true;\n    QString SendCMD_argu;\n    bool CloseDialog = false;\n\n//    QString unicodeToUtf8(const QString resStr);\n\npublic:\n    QString CMD_Password = \"raspberry\";\n\nprotected:\n    void showEvent(QShowEvent *event);\n};\n\n//class CMD_Reply : public QEvent\n//{\n//public:\n//    CMD_Reply(QStringList _value);\n//    ~CMD_Reply();\n\n//    static Type eventType();\n//    QStringList getValue(void);\n\n//private:\n//    static Type m_EventType;\n//    QStringList m_StringList;\n//};\n\n#endif // TERMINALDIALOG_H\n"
  },
  {
    "path": "terminaldialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>TerminalDialog</class>\n <widget class=\"QDialog\" name=\"TerminalDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Terminal</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/terminal-box-line.svg</normaloff>:/assets/terminal-box-line.svg</iconset>\n  </property>\n  <layout class=\"QGridLayout\" name=\"gridLayout\">\n   <property name=\"leftMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>5</number>\n   </property>\n   <item row=\"3\" column=\"0\" colspan=\"6\">\n    <widget class=\"QPushButton\" name=\"pushButton\">\n     <property name=\"font\">\n      <font>\n       <pointsize>20</pointsize>\n      </font>\n     </property>\n     <property name=\"whatsThis\">\n      <string>BTStyleSheet7</string>\n     </property>\n     <property name=\"text\">\n      <string>Clean Window</string>\n     </property>\n    </widget>\n   </item>\n   <item row=\"2\" column=\"0\" colspan=\"6\">\n    <widget class=\"QTextEdit\" name=\"Receiver\">\n     <property name=\"font\">\n      <font>\n       <pointsize>15</pointsize>\n      </font>\n     </property>\n     <property name=\"autoFillBackground\">\n      <bool>true</bool>\n     </property>\n     <property name=\"styleSheet\">\n      <string notr=\"true\">background-color: rgb(0, 0, 0);\ncolor: rgb(0, 255, 0);</string>\n     </property>\n     <property name=\"undoRedoEnabled\">\n      <bool>false</bool>\n     </property>\n     <property name=\"readOnly\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item row=\"0\" column=\"0\" colspan=\"6\">\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3\">\n     <property name=\"leftMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"topMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"rightMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"bottomMargin\">\n      <number>5</number>\n     </property>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Back\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/huitui.svg</normaloff>:/assets/huitui.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_3\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Logo\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\n</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/terminal.svg</normaloff>:/assets/terminal.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_4\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QLabel\" name=\"label\">\n       <property name=\"minimumSize\">\n        <size>\n         <width>84</width>\n         <height>78</height>\n        </size>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item row=\"1\" column=\"0\">\n    <widget class=\"QPushButton\" name=\"Btn_Kill\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Minimum\" vsizetype=\"Preferred\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"minimumSize\">\n      <size>\n       <width>150</width>\n       <height>50</height>\n      </size>\n     </property>\n     <property name=\"font\">\n      <font>\n       <pointsize>15</pointsize>\n       <weight>75</weight>\n       <bold>true</bold>\n      </font>\n     </property>\n     <property name=\"whatsThis\">\n      <string>BTStyleSheet7</string>\n     </property>\n     <property name=\"autoFillBackground\">\n      <bool>false</bool>\n     </property>\n     <property name=\"text\">\n      <string>Kill CMD</string>\n     </property>\n     <property name=\"default\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item row=\"1\" column=\"5\">\n    <widget class=\"QPushButton\" name=\"Btn_Send\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Minimum\" vsizetype=\"Preferred\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"minimumSize\">\n      <size>\n       <width>150</width>\n       <height>50</height>\n      </size>\n     </property>\n     <property name=\"font\">\n      <font>\n       <pointsize>15</pointsize>\n       <weight>75</weight>\n       <bold>true</bold>\n      </font>\n     </property>\n     <property name=\"whatsThis\">\n      <string>BTStyleSheet7</string>\n     </property>\n     <property name=\"autoFillBackground\">\n      <bool>false</bool>\n     </property>\n     <property name=\"text\">\n      <string>Send CMD</string>\n     </property>\n     <property name=\"default\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item row=\"1\" column=\"1\" colspan=\"4\">\n    <widget class=\"MyLineEdit\" name=\"Sender\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Preferred\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"font\">\n      <font>\n       <pointsize>25</pointsize>\n      </font>\n     </property>\n     <property name=\"focusPolicy\">\n      <enum>Qt::ClickFocus</enum>\n     </property>\n     <property name=\"acceptDrops\">\n      <bool>false</bool>\n     </property>\n     <property name=\"autoFillBackground\">\n      <bool>false</bool>\n     </property>\n     <property name=\"styleSheet\">\n      <string notr=\"true\">background-color: rgb(0, 0, 0);\ncolor: rgb(0, 255, 0);</string>\n     </property>\n     <property name=\"text\">\n      <string>iwlist wlan0 scan | grep -E &quot;ESSID|Quality&quot;</string>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MyLineEdit</class>\n   <extends>QLineEdit</extends>\n   <header>mylineedit.h</header>\n  </customwidget>\n </customwidgets>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "update.sh",
    "content": "sleep 2\nsu -l pi << EOF\necho \"Update Dependencies ...\"\nsudo apt install qt5-default qtcreator python3-pyqt5-dbg libqt5svg5 libqt5svg5-dev python3-pyqt5.qtsvg qtsvg5-doc libqt5websockets5 libqt5websockets5-dev ttf-wqy-zenhei qml-module-qtquick-controls2 libboost1.58-all-dev libudev-dev libinput-dev libts-dev libmtdev-dev libjpeg-dev libfontconfig1-dev libssl-dev libdbus-1-dev libglib2.0-dev libxkbcommon-dev libgbm-dev libgl1-mesa-dri qtdeclarative5-dev libqt5svg5 libqt5websockets5 ttf-wqy-zenhei -y\necho \"Check GLdriver ...\"\nfor package in gldriver-test libgl1-mesa-dri; do\n    if [ \"$(dpkg -l \"$package\" 2> /dev/null | tail -n 1 | cut -d ' ' -f 1)\" != \"ii\" ]; then\n      missing_packages=\"$package $missing_packages\"\n    fi\ndone\napt-get install $missing_packages -y\necho \"Done.\"\n\necho \"Set render ...\"\nsudo gpasswd -a pi render\necho \"Done.\"\ncd ~\nrm -rf OctoBTTUpdate\necho \"Update OctoBTT Source ...\"\ngit clone https://github.com/bigtreetech/OctoBTT.git OctoBTTUpdate\n#git clone https://gitee.com/Shine6Z/OctoBTT.git OctoBTTUpdate\nmv -f OctoBTTUpdate/* OctoBTT\n#cp -rf OctoBTTUpdate OctoBTT\nrm -rf OctoBTTUpdate\necho \"Done.\"\n\n\necho \"Rebuild OctoBTT Source ...\"\ncd ~/OctoBTT\n#mkdir projectfile\n#make clean\n#cp OctoBTT.pro projectfile/OctoBTT.pro\nqmake OctoBTT.pro\n#cp projectfile/OctoBTT.pro OctoBTT.pro\n#rm -r -f projectfile\nif [ ! -f \"$OctoBTT\" ]; then\n rm -rf OctoBTT\n make clean\nfi\nmake -j$(cat /proc/cpuinfo | grep processor | wc -l)\nmake clean\necho \"Done.\"\nEOF\necho \"Run OctoBTT ...\"\nsleep 2\ncd /home/pi/OctoBTT && ./OctoBTT -platform eglfs\n"
  },
  {
    "path": "upgrade.sh",
    "content": "sleep 2\nsu -l pi << EOF\necho \"Update Dependencies ...\"\nsudo apt install qt5-default qtcreator python3-pyqt5-dbg libqt5svg5 libqt5svg5-dev python3-pyqt5.qtsvg qtsvg5-doc libqt5websockets5 libqt5websockets5-dev ttf-wqy-zenhei qml-module-qtquick-controls2 libboost1.58-all-dev libudev-dev libinput-dev libts-dev libmtdev-dev libjpeg-dev libfontconfig1-dev libssl-dev libdbus-1-dev libglib2.0-dev libxkbcommon-dev libgbm-dev libgl1-mesa-dri qtdeclarative5-dev libqt5svg5 libqt5websockets5 ttf-wqy-zenhei -y\necho \"Check GLdriver ...\"\nfor package in gldriver-test libgl1-mesa-dri; do\n    if [ \"$(dpkg -l \"$package\" 2> /dev/null | tail -n 1 | cut -d ' ' -f 1)\" != \"ii\" ]; then\n      missing_packages=\"$package $missing_packages\"\n    fi\ndone\napt-get install $missing_packages -y\necho \"Done.\"\n\necho \"Set render ...\"\nsudo gpasswd -a pi render\necho \"Done.\"\ncd ~\nrm -rf OctoBTTUpdate\necho \"Update OctoBTT Source ...\"\ngit clone https://github.com/bigtreetech/OctoBTT.git OctoBTTUpdate\n#git clone https://gitee.com/Shine6Z/OctoBTT.git OctoBTTUpdate\nmv -f OctoBTTUpdate/* OctoBTT\n#cp -rf OctoBTTUpdate OctoBTT\nrm -rf OctoBTTUpdate\necho \"Done.\"\n\n\necho \"Rebuild OctoBTT Source ...\"\ncd ~/OctoBTT\n#mkdir projectfile\n#make clean\n#cp OctoBTT.pro projectfile/OctoBTT.pro\nqmake OctoBTT.pro\n#cp projectfile/OctoBTT.pro OctoBTT.pro\n#rm -r -f projectfile\nif [ ! -f \"$OctoBTT\" ]; then\n rm -rf OctoBTT\n make clean\nfi\nmake -j$(cat /proc/cpuinfo | grep processor | wc -l)\nmake clean\necho \"Done.\"\nEOF\n\nsudo reboot\n"
  },
  {
    "path": "wlanconfig.cpp",
    "content": "#include \"wlanconfig.h\"\n#include \"ui_wlanconfig.h\"\n#include <mainwindow.h>\n//#include <QSizeF>\n#include <QScrollBar>\n#include \"inputdialog.h\"\n#include <QTextBrowser>\n#include <QDesktopWidget>\n#include <QDialog>\n\nWlanconfig::Wlanconfig(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::Wlanconfig)\n{\n    ui->setupUi(this);\n\n    FUI = (MainWindow*)parent;//((MainWindow*)FUI)->octonetwork.SendGCode(_GCode_Setting);\n\n    QFont font;\n    font.setPointSize((int)(ui->DevList->font().pointSize()*(SizePercent.width() < SizePercent.height() ? SizePercent.width():SizePercent.height())));\n    ui->DevList->setFont(font);\n    font.setPointSize((int)(ui->WPA_List->font().pointSize()*(SizePercent.width() < SizePercent.height() ? SizePercent.width():SizePercent.height())));\n    ui->WPA_List->setFont(font);\n\n    ui->WPA_List->setIconSize(QSize(SizePercent.width()*64,SizePercent.height()*64));\n\n    this->resize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setMaximumSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n    this->setFixedSize((int)(SizePercent.width()*800),(int)(SizePercent.height()*480));\n\n//    WPA_Switch = new QMap<QString,bool>;\n//    WPA_SSID = new QMap<QString,QString>;\n\n//    ui->DevList->addItem(\"baby\");\n//    ui->DevList->addItem(\"Goodgay\");\n//    ui->DevList->addItem(\"HappyGirl\");\n//    ui->DevList->addItem(\"baby1\");\n//    ui->DevList->addItem(\"Goodgay1\");\n//    ui->DevList->addItem(\"HappyGirl1\");\n//    ui->DevList->addItem(\"baby2\");\n//    ui->DevList->addItem(\"Goodgay2\");\n//    ui->DevList->addItem(\"HappyGirl2\");\n//    ui->DevList->setCurrentIndex(0);\n//    QStyle *DL = ui->DevList->style();\n//    ui->Btn_Help->setText(DL->property(\"on\").toString());\n//    DL->setProperty(\"on\",50);\n//    ui->DevList->setStyle(DL);\n\n}\n\nWlanconfig::~Wlanconfig()\n{\n    delete ui;\n}\n\nvoid Wlanconfig::on_Btn_Back_clicked()\n{\n    this->close();\n}\n\n//Load Scan Funtion\n//Load List index\nvoid Wlanconfig::showEvent(QShowEvent *event)\n{\n    Q_UNUSED(event);\n    GetDevState();\n}\n\nvoid Wlanconfig::on_Btn_DevRefresh_clicked()\n{\n    GetDevState();\n}\n\nvoid Wlanconfig::on_Btn_DevSwitch_clicked()\n{\n    if(!WPA_Switch.contains(ui->DevList->currentText()))\n        return;\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(\"ifconfig \" + ui->DevList->currentText() + (WPA_Switch[ui->DevList->currentText()] ? \" down\" : \" up\"),TeminalState);\n    WPA_Switch[ui->DevList->currentText()] = !WPA_Switch[ui->DevList->currentText()];\n\n    ui->Btn_DevSwitch->setIcon(QIcon(WPA_Switch[ui->DevList->currentText()] ? \":/assets/Network.svg\":\":/assets/shebeiweilianjie-copy.svg\"));\n    ui->Btn_Connect->setEnabled(WPA_Switch[ui->DevList->currentText()]);\n    ui->Btn_Scan->setEnabled(WPA_Switch[ui->DevList->currentText()]);\n    ui->WPA_List->setEnabled(WPA_Switch[ui->DevList->currentText()]);\n}\n\nvoid Wlanconfig::on_Btn_Connect_clicked()\n{\n    if(ui->WPA_List->model() == NULL || ui->WPA_List->model()->rowCount()==0)\n        return;\n    if(!WPA_Switch.contains(ui->DevList->currentText()))\n        return;\n    if(!WPA_Switch[ui->DevList->currentText()])\n        return;\n\n    QString Current_SSID = ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString();\n\n    if(Current_SSID.trimmed() == \"\")//未选择SSID\n        return;\n\n    if(WPA_Scan_SSID_List[Current_SSID].connectflags)//已连接\n        return;\n\n    ui->WPA_List->setEnabled(false);\n\n    if(WPA_Scan_SSID_List[Current_SSID].pwdError)//连接无效，重新输入密码 //pwdError为true本身具有前提是属于已有网络ID的\n    {\n        SetPassword();\n        return;\n    }\n\n    if(WPA_Scan_SSID_List[Current_SSID].id >= 0)//可执行连接\n    {\n        ConnectNetwork();\n        return;\n    }\n\n    CreateNetwork();\n}\n\n//双击面板输入密码连接或创建连接点\nvoid Wlanconfig::on_WPA_List_doubleClicked(const QModelIndex &index)\n{\n    if(WPA_Scan_SSID_List[index.data().toString()].id >= 0)//可执行连接\n    {\n        SetPassword();\n        return;\n    }\n    CreateNetwork();\n}\n\nvoid Wlanconfig::on_Btn_Scan_clicked()\n{\n    if(!WPA_Switch.contains(ui->DevList->currentText()))\n        return;\n    if(!WPA_Switch[ui->DevList->currentText()])\n        return;\n    ScanWPAList();\n}\n\n//点击help查看网络信息\nvoid Wlanconfig::on_Btn_Help_clicked()\n{\n    GetNetworkInfo();\n}\n\nvoid Wlanconfig::GetNetworkInfo()\n{\n    QString cmd = \"ifconfig | grep -E \\\"flags|inet|ether\\\"\";\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n                     {\n                         disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                         GetNetworkInfo(CommandLine);\n                     });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(cmd,TeminalState);\n}\n\nvoid Wlanconfig::GetNetworkInfo(QStringList &Responses)\n{\n    //=======================================================================12.23\n//    QStringList data;\n    QStringList sending;\n    foreach(QString item ,Responses)\n    {\n        QString replaceitem = item.replace(\"\\t\",\" \");\n//        sending.append(replaceitem);\n        QStringList explore = replaceitem.split(\" \",QString::SkipEmptyParts);\n        if(explore[0].contains(QRegExp(\"(eth[0-9]+[0-9]*)|(lo)|(wlan[0-9]+[0-9]*)\")))\n        {\n            sending.append(explore[0]);\n        }\n        else if(explore[0].contains(\"inet6\"))//IPv6\n        {\n            sending.append(QString(\"IPv6:%1\").arg(explore[1]));\n        }\n        else if(explore[0].contains(\"inet\"))//IP\n        {\n            sending.append(QString(\"IPv4:%1\").arg(explore[1]));\n            sending.append(QString(\"IPv4 Netmask:%1\").arg(explore[3]));\n        }\n        else if(explore[0].contains(\"ether\"))//MAC\n        {\n            sending.append(QString(\"MAC:%1\").arg(explore[1]));\n        }\n//        bool read = false;\n//        data.append(replaceitem).split(\" \",QString::SkipEmptyParts));\n    }\n\n    //创建QDialog\n    QDialog dialog(this);\n    //设置倒角?和透明度\n    dialog.setWindowOpacity(0.9);\n    dialog.setStyleSheet(\"background-color: rgba(128, 128, 128, 25%)\");\n\n    //设置窗口的标题和标识\n    dialog.setWindowTitle(tr(\"Wlan Information\"));\n    dialog.setWindowIcon(QIcon(\":/assets/WiFi2.svg\"));\n    //适应屏幕大小\n    dialog.resize(SizePercent.width()*800*0.9,SizePercent.height()*480*0.9);\n    dialog.setFixedSize(SizePercent.width()*800*0.9,SizePercent.height()*480*0.8);\n\n    //使弹窗居中显示\n    dialog.move(this->pos().x() + (this->width() - dialog.width()) / 2,this->pos().y() + (this->height() - dialog.height()) / 2);\n\n    //设置文本显示\n    QTextBrowser textBrowser(&dialog);\n    textBrowser.setStyleSheet(\"border: none; color: rgb(245, 246, 255);\");\n    textBrowser.setText(sending.join(\"\\n\"));\n    textBrowser.setFixedSize(SizePercent.width()*800*0.877,SizePercent.height()*480*0.5);\n    textBrowser.setGeometry(50,50,SizePercent.width()*800*0.8,SizePercent.height()*480*0.5);\n\n    //设置按键ok\n    QPushButton OKBT(\"OK\",&dialog);\n\n    OKBT.setWhatsThis(\"BTStyleSheet\");\n\n    //按键连接信号\n    QObject::connect(&OKBT, &QPushButton::clicked, &dialog, &QDialog::reject);\n\n    //字体适应屏幕大小\n    QFont _font = OKBT.font();\n    _font.setPointSize(this->maximumWidth() > this->maximumHeight() ? (int)this->maximumHeight()/30 : (int)this->maximumWidth()/30);\n    OKBT.setFont(_font);\n    textBrowser.setFont(_font);\n\n    //调整文本和按键的位置\n    QVBoxLayout VLayout(&dialog);\n    VLayout.addWidget(&textBrowser);\n    VLayout.addWidget(&OKBT);\n\n    int ret = dialog.exec();\n    if(ret == QDialog::Rejected)\n    {\n        dialog.close();\n    }\n}\n\nvoid Wlanconfig::CreateNetwork()\n{\n    QString cmd = QString(\"wpa_cli -i %1 add_network\").arg(ui->DevList->currentText());\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n                     {\n                         disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                         QString Current_SSID = ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString();\n                         bool chkID=false;\n                         int id = CommandLine[0].toInt(&chkID);\n                         if(chkID)\n                         {\n                             WPA_Scan_SSID_List[Current_SSID].id = id;\n                             SetSSID();\n                         }\n                         else\n                             ui->WPA_List->setEnabled(true);\n                     });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(cmd,TeminalState);\n}\n\nvoid Wlanconfig::SetSSID()\n{\n    QString Current_SSID = ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString();\n    QString cmd = QString(\"wpa_cli -i %1 set_network %2 ssid '\\\"%3\\\"'\").arg(ui->DevList->currentText()).arg(QString::number(WPA_Scan_SSID_List[Current_SSID].id)).arg(Current_SSID);\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n                     {\n                         disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                         SetSSID(CommandLine);\n                     });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(cmd,TeminalState);\n}\n\nvoid Wlanconfig::SetSSID(QStringList &Responses)\n{\n    if(Responses[0].toLower().trimmed() == \"ok\")\n    {\n        //设置密码\n        SetPassword();\n    }\n    else\n    {\n        RemoveNetwork();\n    }\n}\n\nvoid Wlanconfig::SetPassword()\n{\n    QString Current_SSID = ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString();\n    QString Dev = ui->DevList->currentText();\n\n    InputDialog *inputdialog = new InputDialog(this);\n    connect(inputdialog,&InputDialog::closedialog,this,[=](QString value,bool SettingMark){\n        if(SettingMark)\n        {\n//            SetPassword(ui->DevList->currentText() , value , WPA_Scan_SSID_List[Current_SSID].id);\n            QString Current_SSID = ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString();\n            QString Dev = ui->DevList->currentText();\n\n            QString cmd = QString(\"wpa_cli -i %1 set_network %3 psk '\\\"%2\\\"'\").arg(Dev).arg(value).arg(QString::number(WPA_Scan_SSID_List[Current_SSID].id));\n            disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n            QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n                             {\n                                 disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                                 SetPassword(CommandLine);\n                             });\n            ((MainWindow*)FUI)->terminaldialog->SendCMD(cmd,TeminalState);\n\n        }\n        else\n        {\n            if(value.trimmed() == \"\")\n            {\n                QStringList btnName = {\"Yes\", \"No\"} ;\n                CustomDialog *newDialog = new CustomDialog();\n                QObject::connect(newDialog, &CustomDialog::OutputEvent, newDialog,[=](QString instruct)\n                {\n                    if(instruct == \"Yes\")\n                    {\n                        RemoveNetwork();\n                    }\n                    else if(instruct == \"No\")\n                    {\n                        ui->WPA_List->setEnabled(true);\n\n                    }\n\n                });\n                newDialog->showCustomDialog(\"Warning\",\":/assets/info.svg\",btnName,QString(\"Do you want to forget \\\"%1\\\" ?\").arg(ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString()),this);\n             }\n            else\n                ui->WPA_List->setEnabled(true);\n        }\n        delete sender();\n    });\n    inputdialog->setvalue(\"Please Input \"+ Current_SSID +\" Password\",\"\");\n}\n\nvoid Wlanconfig::SetPassword(QStringList &Responses)\n{\n    if(Responses[0].toLower().trimmed() == \"ok\")\n    {\n        QString Current_SSID = ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString();\n        //设置图标\n//        if(WPA_Scan_SSID_List[((QStandardItemModel)ui->WPA_List->model()).item(0)->text()].connectflags)\n//            ((QStandardItemModel)ui->WPA_List->model()).item(0)->setIcon(QIcon(\":/assets/Wifi_Unlock.svg\"));\n        //执行启用并连接\n        ConnectNetwork();\n    }\n    else\n    {\n        ui->WPA_List->setEnabled(true);\n    }\n}\n\nvoid Wlanconfig::RemoveNetwork()\n{\n    QString Current_SSID = ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString();\n    QString Dev = ui->DevList->currentText();\n\n    QString cmd = QString(\"wpa_cli -i %1 remove_network %2\").arg(Dev).arg(QString::number(WPA_Scan_SSID_List[Current_SSID].id));\n\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n                     {\n                         disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                         RemoveNetwork(CommandLine);\n                     });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(cmd,TeminalState);\n}\n\nvoid Wlanconfig::RemoveNetwork(QStringList &Responses)\n{\n    QString Current_SSID = ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString();\n    if(Responses[0].toLower().trimmed() == \"ok\")\n    {\n        WPA_Scan_SSID_List[Current_SSID].id = -1;\n        WPA_Scan_SSID_List[Current_SSID].pwdError = false;\n        WPA_Scan_SSID_List[Current_SSID].connectflags = false;\n        ui->WPA_List->setEnabled(true);\n    }\n    else\n    {\n        CustomDialog *newDialog = new CustomDialog();\n        newDialog->showCustomDialog(\"Warning\",\":/assets/WiFi2.svg\",QString(\"SSID[%1] Delete failed !\"),this);\n        ui->WPA_List->setEnabled(true);\n    }\n}\n\nvoid Wlanconfig::ConnectNetwork()\n{\n    QString Current_SSID = ui->WPA_List->model()->data(ui->WPA_List->currentIndex()).toString();\n    QString Dev = ui->DevList->currentText();\n\n    QString cmd = QString(\"wpa_cli -i %1 enable_network %2 &&  wpa_cli -i %1 select_network %2 && wpa_cli -i %1 save_config\").arg(Dev).arg(QString::number(WPA_Scan_SSID_List[Current_SSID].id));\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList)\n                     {\n                         disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                         ui->WPA_List->setEnabled(true);\n                     });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(cmd,TeminalState);\n}\n\nvoid Wlanconfig::ScanWPAList()\n{\n//    this->setEnabled(false);\n\n    if(LastDev != ui->DevList->currentText())\n    {\n        LastDev = ui->DevList->currentText();\n        WPAModel->clear();\n        if(ui->WPA_List->model() != NULL && ui->WPA_List->model()->rowCount()>0)\n            ui->WPA_List->model()->removeRows(0,ui->WPA_List->model()->rowCount());\n    }\n\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n                     {\n                         disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                         ScanWPAList(CommandLine);\n                     });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(\"wpa_cli -i \"+ui->DevList->currentText()+\" list_network\",TeminalState);\n}\n\nvoid Wlanconfig::ScanWPAList(QStringList &Responses)\n{\n    bool ReadData = false;\n    WPA_Scan_SSID_List.clear();\n    foreach(QString item , Responses)\n    {\n        if(ReadData)\n        {\n            int WPA_ID = item.replace(\"\\t\",\" \").split(\" \",QString::SkipEmptyParts)[0].toInt();\n            QString LastStr = item.replace(\"\\t\",\" \").remove(0,QString::number(WPA_ID).length()).trimmed();//remove NID\n\n            LastStr = ReverseStr(LastStr);\n            bool WPA_Flags = false;\n            bool WPA_PWD_Error = false;\n            if(LastStr.startsWith(\"]\"))//has flags\n            {\n                QString FlagsStr = ((ReverseStr(LastStr.split(\" \",QString::SkipEmptyParts)[0]))).toUpper() ;\n\n                WPA_Flags = (FlagsStr == \"[CURRENT]\" && WPA_SSID[ui->DevList->currentText()].trimmed() != \"\");//连接中状态检测[TEMP-DISABLED]//逻辑不够严谨\n\n                WPA_PWD_Error = (FlagsStr == \"[TEMP-DISABLED]\" || (FlagsStr == \"[CURRENT]\" && WPA_SSID[ui->DevList->currentText()].trimmed() == \"\"));\n\n                LastStr = LastStr.remove(0,FlagsStr.count()).trimmed();//remove state\n            }\n            else\n                WPA_Flags = false;\n\n            QString SSID = ReverseStr(LastStr.remove(0,LastStr.split(\" \",QString::SkipEmptyParts)[0].count()).trimmed());\n            WPA_Scan_SSID_List.insert(SSID,WPAInfo());\n            WPA_Scan_SSID_List[SSID].id = WPA_ID;\n//            WPA_Scan_SSID_List[SSID].connectflags = SSID == WPA_SSID[ui->DevList->currentText()];\n            WPA_Scan_SSID_List[SSID].connectflags = WPA_Flags;\n            WPA_Scan_SSID_List[SSID].pwdError = WPA_PWD_Error;\n        }\n        else if(item.toLower().startsWith(\"network\"))\n        {\n            ReadData = true;\n        }\n    }\n    ScanWPA();\n}\n\nQString Wlanconfig::ReverseStr(QString args)\n{\n    QString outputdata = \"\";\n    foreach(QChar arg , args)\n    {\n        outputdata = arg + outputdata;\n    }\n    return outputdata;\n}\n\nvoid Wlanconfig::ScanWPA()\n{\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n                     {\n                         disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                         ScanWPA(CommandLine);\n                     });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(\"wpa_cli -i \"+ui->DevList->currentText()+\" scan\",TeminalState);\n}\n\nvoid Wlanconfig::ScanWPA(QStringList &Responses)\n{\n    if(Responses[0].toLower().trimmed() == \"ok\")\n        ScanWPA_Ressult();\n    else\n    {\n//        this->setEnabled(true);\n\n        if(WPA_SSID[ui->DevList->currentText()].trimmed() == \"\")\n        {\n            GetDevState();\n        }\n\n//        WPA_Switch[ui->DevList->currentText()] = false;\n\n//        ui->Btn_DevSwitch->setIcon(QIcon(WPA_Switch[ui->DevList->currentText()] ? \":/assets/Network.svg\":\":/assets/shebeiweilianjie-copy.svg\"));\n//        ui->Btn_Connect->setEnabled(WPA_Switch[ui->DevList->currentText()]);\n//        ui->Btn_Scan->setEnabled(WPA_Switch[ui->DevList->currentText()]);\n//        ui->WPA_List->setEnabled(WPA_Switch[ui->DevList->currentText()]);\n    }\n}\n\nvoid Wlanconfig::ScanWPA_Ressult()\n{\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n                     {\n                         disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                         ScanWPA_Ressult(CommandLine);\n                     });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(\"wpa_cli -i \"+ui->DevList->currentText()+\" scan_results\",TeminalState);\n}\n\nvoid Wlanconfig::ScanWPA_Ressult(QStringList &Responses)\n{\n    bool ReadData = false;\n    QStringList effectiveSSID;\n    foreach(QString item , Responses)\n    {\n        if(ReadData)\n        {\n            QStringList ModuleStr = item.replace(\"\\t\",\" \").split(\" \",QString::SkipEmptyParts);\n\n\n            int WPA_Level = ModuleStr[2].toInt();\n            QString LastStr  = item.replace(\"\\t\",\" \").remove(0,ModuleStr[0].count()).trimmed();//remove bssid\n            LastStr  = LastStr.remove(0,ModuleStr[1].count()).trimmed();//remove freq\n            LastStr  = LastStr.remove(0,ModuleStr[2].count()).trimmed();//remove level\n            QString SSID = LastStr.remove(0,ModuleStr[3].count()).trimmed();//remove SecurityFlags\n            if(SSID.trimmed() == \"\")\n                continue;\n            effectiveSSID.append(SSID);\n            if(!WPA_Scan_SSID_List.contains(SSID))\n            {\n                WPA_Scan_SSID_List.insert(SSID,WPAInfo());\n            }\n            WPA_Scan_SSID_List[SSID].level = WPA_Level;\n//            WPA_Scan_SSID_List[SSID].Quality_value ;///信号强度排序\n            if(WPA_Scan_SSID_List[SSID].level <= -100)\n                WPA_Scan_SSID_List[SSID].Quality_value = 0;\n            else if(WPA_Scan_SSID_List[SSID].level >= -50)\n                WPA_Scan_SSID_List[SSID].Quality_value = 100;\n            else\n                WPA_Scan_SSID_List[SSID].Quality_value = 2 * (WPA_Scan_SSID_List[SSID].level + 100);\n//            // dBm to Quality:\n//            if(dBm <= -100)\n//                quality = 0;\n//            else if(dBm >= -50)\n//                quality = 100;\n//            else\n//                quality = 2 * (dBm + 100);\n//            // Quality to dBm:\n//            if(quality <= 0)\n//                dBm = -100;\n//            else if(quality >= 100)\n//                dBm = -50;\n//            else\n//                dBm = (quality / 2) - 100;\n        }\n        else if(item.toLower().startsWith(\"bssid\"))\n        {\n            ReadData = true;\n        }\n    }\n\n    WPAModel->clear();\n    if(ui->WPA_List->model() != NULL && ui->WPA_List->model()->rowCount()>0)\n        ui->WPA_List->model()->removeRows(0,ui->WPA_List->model()->rowCount());\n\n    if(WPA_Scan_SSID_List.count() > 0)\n    {\n//        if(WPA_Scan_SSID_List.contains(WPA_SSID[ui->DevList->currentText()]))\n//        {\n//            QStandardItem *wpsFirst = new QStandardItem(static_cast<QString>(WPA_SSID[ui->DevList->currentText()]));\n//            wpsFirst->setIcon(QIcon(\":/assets/Network.svg\"));\n//            WPAModel->appendRow(wpsFirst);\n//        }\n        QMapIterator<QString, WPAInfo> WPAReader(WPA_Scan_SSID_List);\n        while (WPAReader.hasNext())\n        {\n            WPAReader.next();\n            if(!effectiveSSID.contains(WPAReader.key()))\n                continue;\n//            if(WPAReader.key() == WPA_SSID[ui->DevList->currentText()])\n//                continue;\n            QStandardItem *wpsitem = new QStandardItem(static_cast<QString>(WPAReader.key()));\n            wpsitem->setForeground(QColor(255,255,255));\n\n            if(WPAReader.value().Quality_value < 95)\n            {\n                wpsitem->setIcon(QIcon(\":/assets/jinggao.svg\"));\n                WPAModel->appendRow(wpsitem);\n            }\n            else if(WPAReader.value().connectflags)\n            {\n                wpsitem->setIcon(QIcon(\":/assets/Network.svg\"));\n                if(WPAModel->rowCount() > 0)\n                    WPAModel->insertRow(0,wpsitem);\n                else\n                    WPAModel->appendRow(wpsitem);\n            }\n            else if(WPAReader.value().pwdError)\n            {\n                wpsitem->setIcon(QIcon(\":/assets/wangluolianjiechaoshi.svg\"));\n                if(WPAModel->rowCount() > 1)\n                {\n                    if(WPA_Scan_SSID_List[WPAModel->item(0)->text()].connectflags)\n                        WPAModel->insertRow(1,wpsitem);\n                    else\n                        WPAModel->insertRow(0,wpsitem);\n                }\n                else\n                    WPAModel->appendRow(wpsitem);\n            }\n            else if(WPAReader.value().id >= 0)\n            {\n                wpsitem->setIcon(QIcon(\":/assets/Wifi_Unlock.svg\"));\n                if(WPAModel->rowCount() > 1)\n                {\n                    if(WPA_Scan_SSID_List[WPAModel->item(0)->text()].connectflags || WPA_Scan_SSID_List[WPAModel->item(0)->text()].pwdError)\n                        WPAModel->insertRow(1,wpsitem);\n                    else\n                        WPAModel->insertRow(0,wpsitem);\n                }\n                else\n                    WPAModel->appendRow(wpsitem);\n            }\n            else\n            {\n                wpsitem->setIcon(QIcon(\":/assets/Wifi_Lock.svg\"));\n                WPAModel->appendRow(wpsitem);\n            }\n        }\n    }\n\n//    this->setEnabled(true);\n\n//    for (int i=0;i<WPAModel->rowCount();i++)\n//    {\n//        if(i & 1)\n//            WPAModel->item(i)->setBackground(QBrush(Qt::gray));\n//        else\n//            WPAModel->item(i)->setBackground(QBrush(Qt::darkGray));\n//    }\n    ui->WPA_List->setModel(WPAModel);\n\n    if(WPA_SSID[ui->DevList->currentText()].trimmed() == \"\")\n    {\n        GetDevState();\n    }\n}\n\nvoid Wlanconfig::GetDevState()\n{\n//    this->setEnabled(false);\n    LastDev = ui->DevList->currentText();\n    disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n    QObject::connect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,this,[=](QStringList CommandLine)\n                     {\n                         disconnect(((MainWindow*)FUI)->terminaldialog,&TerminalDialog::CMD_Reply,0,0);\n                         GetDevState(CommandLine);\n                     });\n    ((MainWindow*)FUI)->terminaldialog->SendCMD(\"iwconfig | grep -E \\\"wlan[0-9]|ESSID|Tx-Power=\\\"\",TeminalState);\n}\n\nvoid Wlanconfig::GetDevState(QStringList &Responses)\n{\n    ui->Btn_DevSwitch->setIcon(QIcon(\":/assets/shebeiweilianjie-copy.svg\"));\n    WPA_Switch.clear();\n    WPA_SSID.clear();\n    ui->DevList->clear();\n\n    QString DevKey = \"\";\n    foreach(QString item , Responses)\n    {\n        QStringList Analytical = item.split(\" \",QString::SkipEmptyParts);\n        if(Analytical[0].toLower().startsWith(\"wlan\"))\n        {\n            DevKey = Analytical[0];\n            if(Analytical[3].toLower() == \"essid:off/any\")\n            {\n                WPA_SSID.insert(DevKey,\"\");\n                WPA_Switch.insert(DevKey,false);\n            }\n            else\n            {\n                WPA_SSID.insert(DevKey,(item.remove(0,item.indexOf(\"ESSID:\")+6)).replace(QRegExp(\"\\\"([^<]*)\\\"\"), \"\\\\1\"));\n                WPA_Switch.insert(DevKey,true);\n            }\n        }\n        else\n        {\n            //功率数据可在此处提取\n            Analytical = item.split(\"Tx-Power=\",QString::SkipEmptyParts);\n            WPA_Switch[DevKey] = (Analytical.count() > 1);\n        }\n    }\n\n    QStringList Dev;\n    foreach(QString item , WPA_Switch.keys())\n    {\n        Dev.append(item);\n    }\n    ui->DevList->addItems(Dev);\n    //LastDev\n    for (int i = 0;i < ui->DevList->count();i++)\n    {\n        if(ui->DevList->itemText(i) == LastDev)\n            ui->DevList->setCurrentIndex(i);\n    }\n//    this->setEnabled(true);\n}\n\nvoid Wlanconfig::on_DevList_currentIndexChanged(const QString &arg1)\n{\n    if(!WPA_Switch.contains(arg1))\n    {\n        ui->Btn_DevSwitch->setIcon(QIcon(\":/assets/shebeiweilianjie-copy.svg\"));\n        ui->Btn_Connect->setEnabled(false);\n        ui->Btn_Scan->setEnabled(false);\n        ui->WPA_List->setEnabled(false);\n        return;\n    }\n\n    ui->Btn_DevSwitch->setIcon(QIcon(WPA_Switch[arg1] ? \":/assets/Network.svg\":\":/assets/shebeiweilianjie-copy.svg\"));\n    ui->Btn_Connect->setEnabled(WPA_Switch[arg1]);\n    ui->Btn_Scan->setEnabled(WPA_Switch[arg1]);\n    ui->WPA_List->setEnabled(WPA_Switch[arg1]);\n}\n"
  },
  {
    "path": "wlanconfig.h",
    "content": "#ifndef WLANCONFIG_H\n#define WLANCONFIG_H\n\n#include <QDialog>\n#include <QMap>\n#include <QSizeF>\n#include <QMetaType>\n#include <QStandardItemModel>\n\nextern int DebugFlat ;\nextern QSizeF SizePercent;\n\nstruct WPAInfo{\n    int id;\n    double level;\n    bool connectflags;\n    bool pwdError;\n    int Quality_value;\n    int Quality_max;\n    WPAInfo()\n    {\n        id = -1;\n        level = -100;\n        Quality_value = 0;\n        Quality_max = 100;\n        connectflags = false;\n        pwdError = false;\n    }\n};\nQ_DECLARE_METATYPE(WPAInfo);\n\nnamespace Ui {\nclass Wlanconfig;\n}\n\nclass Wlanconfig : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit Wlanconfig(QWidget *parent = nullptr);\n    ~Wlanconfig();\n\n    void GetNetworkInfo();\n\nprivate slots:\n    virtual void on_Btn_Back_clicked();\n\n    void on_Btn_DevRefresh_clicked();\n\n    void on_Btn_DevSwitch_clicked();\n\n    void on_Btn_Connect_clicked();\n\n    void on_Btn_Scan_clicked();\n\n    void on_DevList_currentIndexChanged(const QString &arg1);\n\n    void on_WPA_List_doubleClicked(const QModelIndex &index);\n\n    void on_Btn_Help_clicked();\n\nprivate:\n    void GetDevState();\n    void GetDevState(QStringList &Responses);\n    void ScanWPAList();\n    void ScanWPAList(QStringList &Responses);\n    void ScanWPA();\n    void ScanWPA(QStringList &Responses);\n    void ScanWPA_Ressult();\n    void ScanWPA_Ressult(QStringList &Responses);\n    QString ReverseStr(QString args);\n    void ConnectNetwork();\n    void SetPassword(QStringList &Responses);\n    void SetPassword();\n    void SetSSID();\n    void SetSSID(QStringList &Responses);\n    void CreateNetwork();\n//    void GetNetworkInfo();\n    void GetNetworkInfo(QStringList &Responses);\n    void RemoveNetwork();\n    void RemoveNetwork(QStringList &Responses);\n\n\nprivate:\n    Ui::Wlanconfig *ui;\n    QWidget *FUI;\n\n    QString TeminalState = \"-q-e\";\n\n    QMap<QString,bool> WPA_Switch ;\n    QMap<QString,QString> WPA_SSID ;\n\n    QMap<QString,WPAInfo> WPA_Scan_SSID_List ;\n\n    QStandardItemModel *WPAModel = new QStandardItemModel(this);\n    QString LastDev;\n\nprotected:\n    void showEvent(QShowEvent *event);\n};\n\n#endif // WLANCONFIG_H\n"
  },
  {
    "path": "wlanconfig.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>Wlanconfig</class>\n <widget class=\"QDialog\" name=\"Wlanconfig\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>480</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Wlan</string>\n  </property>\n  <property name=\"windowIcon\">\n   <iconset resource=\"assets.qrc\">\n    <normaloff>:/assets/WiFi2.svg</normaloff>:/assets/WiFi2.svg</iconset>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"1,7\">\n   <property name=\"spacing\">\n    <number>3</number>\n   </property>\n   <property name=\"leftMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>5</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>5</number>\n   </property>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3\">\n     <property name=\"leftMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"topMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"rightMargin\">\n      <number>5</number>\n     </property>\n     <property name=\"bottomMargin\">\n      <number>5</number>\n     </property>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Back\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/huitui.svg</normaloff>:/assets/huitui.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_3\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Logo\">\n       <property name=\"styleSheet\">\n        <string notr=\"true\">border:none;\nfont: 75 30pt &quot;Gill Sans MT&quot;;\n</string>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/Wifi.svg</normaloff>:/assets/Wifi.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_4\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"Btn_Help\">\n       <property name=\"whatsThis\">\n        <string>BTStyleSheet2</string>\n       </property>\n       <property name=\"layoutDirection\">\n        <enum>Qt::RightToLeft</enum>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"assets.qrc\">\n         <normaloff>:/assets/help.svg</normaloff>:/assets/help.svg</iconset>\n       </property>\n       <property name=\"iconSize\">\n        <size>\n         <width>72</width>\n         <height>72</height>\n        </size>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <layout class=\"QGridLayout\" name=\"gridLayout\" rowminimumheight=\"6,1\" columnminimumwidth=\"7,1\">\n     <property name=\"spacing\">\n      <number>5</number>\n     </property>\n     <item row=\"0\" column=\"0\">\n      <widget class=\"QListView\" name=\"WPA_List\">\n       <property name=\"font\">\n        <font>\n         <pointsize>30</pointsize>\n        </font>\n       </property>\n       <property name=\"styleSheet\">\n        <string notr=\"true\">background-color: rgb(64, 64, 64);</string>\n       </property>\n       <property name=\"editTriggers\">\n        <set>QAbstractItemView::NoEditTriggers</set>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"0\">\n      <layout class=\"QHBoxLayout\" name=\"horizontalLayout\" stretch=\"0,0,0\">\n       <property name=\"spacing\">\n        <number>0</number>\n       </property>\n       <item>\n        <widget class=\"QPushButton\" name=\"Btn_DevRefresh\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"whatsThis\">\n          <string>BTStyleSheet2</string>\n         </property>\n         <property name=\"text\">\n          <string/>\n         </property>\n         <property name=\"icon\">\n          <iconset resource=\"assets.qrc\">\n           <normaloff>:/assets/shuaxin.svg</normaloff>:/assets/shuaxin.svg</iconset>\n         </property>\n         <property name=\"iconSize\">\n          <size>\n           <width>72</width>\n           <height>72</height>\n          </size>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QLabel\" name=\"label\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Preferred\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"font\">\n          <font>\n           <pointsize>21</pointsize>\n          </font>\n         </property>\n         <property name=\"styleSheet\">\n          <string notr=\"true\">color: rgb(255, 255, 255);</string>\n         </property>\n         <property name=\"text\">\n          <string>Wlan Device :</string>\n         </property>\n         <property name=\"alignment\">\n          <set>Qt::AlignCenter</set>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QComboBox\" name=\"DevList\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"font\">\n          <font>\n           <pointsize>30</pointsize>\n          </font>\n         </property>\n         <property name=\"styleSheet\">\n          <string notr=\"true\">color: rgb(255, 255, 255);</string>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n     <item row=\"0\" column=\"1\" rowspan=\"2\">\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\">\n       <property name=\"spacing\">\n        <number>0</number>\n       </property>\n       <item>\n        <widget class=\"QPushButton\" name=\"Btn_Connect\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Expanding\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"whatsThis\">\n          <string>BTStyleSheet2</string>\n         </property>\n         <property name=\"text\">\n          <string/>\n         </property>\n         <property name=\"icon\">\n          <iconset resource=\"assets.qrc\">\n           <normaloff>:/assets/wangluo.svg</normaloff>:/assets/wangluo.svg</iconset>\n         </property>\n         <property name=\"iconSize\">\n          <size>\n           <width>72</width>\n           <height>72</height>\n          </size>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QPushButton\" name=\"Btn_Scan\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Expanding\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"whatsThis\">\n          <string>BTStyleSheet2</string>\n         </property>\n         <property name=\"text\">\n          <string/>\n         </property>\n         <property name=\"icon\">\n          <iconset resource=\"assets.qrc\">\n           <normaloff>:/assets/sanweidianyunsaomiao.svg</normaloff>:/assets/sanweidianyunsaomiao.svg</iconset>\n         </property>\n         <property name=\"iconSize\">\n          <size>\n           <width>72</width>\n           <height>72</height>\n          </size>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QPushButton\" name=\"Btn_DevSwitch\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Fixed\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"whatsThis\">\n          <string>BTStyleSheet2</string>\n         </property>\n         <property name=\"text\">\n          <string/>\n         </property>\n         <property name=\"icon\">\n          <iconset resource=\"assets.qrc\">\n           <normaloff>:/assets/shebeiweilianjie-copy.svg</normaloff>:/assets/shebeiweilianjie-copy.svg</iconset>\n         </property>\n         <property name=\"iconSize\">\n          <size>\n           <width>72</width>\n           <height>72</height>\n          </size>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources>\n  <include location=\"assets.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  }
]