diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..29f81d812f3e768fa89638d1f72920dbfd1413a8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index fcc2f15a35b510db2bc426d9cfebf4751868d840..a96a59d605ec9ebbbd4ee6d694b1a55b866eb3a7 100755 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ BearPi-HM Micro开发板是一块高度集成并可运行Openharmony系统的开 - [8. 开发空气质量示例应用](docs/开发空气质量示例.md) - [9. 开发时钟示例应用](docs/开发时钟案例.md) - [10. 开发计算器示例应用](docs/开发计算器案例.md) -- [10. 开发图表示例例应用](docs/开发图表示例.md) +- [11. 开发图表示例例应用](docs/开发图表示例.md) ## 三、开发板图片预览[(淘宝链接)](https://item.taobao.com/item.htm?id=662078665554) diff --git a/code/Micro_E53/.gitignore b/code/Micro_E53/.gitignore new file mode 100755 index 0000000000000000000000000000000000000000..52c0fa2ebccc570f0beb3e329e1fea389f7676e0 --- /dev/null +++ b/code/Micro_E53/.gitignore @@ -0,0 +1,16 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx +/node_modules diff --git a/code/Micro_E53/build.gradle b/code/Micro_E53/build.gradle new file mode 100755 index 0000000000000000000000000000000000000000..1d87b5152030f0b438eb7046e1723d2c482c31d9 --- /dev/null +++ b/code/Micro_E53/build.gradle @@ -0,0 +1,33 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 7 +} + +buildscript { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } + dependencies { + classpath 'com.huawei.ohos:hap:3.0.5.2' + classpath 'com.huawei.ohos:decctest:1.2.7.2' + } +} + +allprojects { + repositories { + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + } +} diff --git a/code/Micro_E53/entry/.gitignore b/code/Micro_E53/entry/.gitignore new file mode 100755 index 0000000000000000000000000000000000000000..f77260b1509284d42a7f8a2449ad1e8f4b489a3a --- /dev/null +++ b/code/Micro_E53/entry/.gitignore @@ -0,0 +1,2 @@ +/build +/node_modules diff --git a/code/Micro_E53/entry/build.gradle b/code/Micro_E53/entry/build.gradle new file mode 100755 index 0000000000000000000000000000000000000000..aa560ceca979fa574a1337543c146c8596404c00 --- /dev/null +++ b/code/Micro_E53/entry/build.gradle @@ -0,0 +1,24 @@ +apply plugin: 'com.huawei.ohos.hap' +apply plugin: 'com.huawei.ohos.decctest' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 7 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + testImplementation 'junit:junit:4.13.1' +} +decc { + supportType = ['html','xml'] +} diff --git a/code/Micro_E53/entry/proguard-rules.pro b/code/Micro_E53/entry/proguard-rules.pro new file mode 100755 index 0000000000000000000000000000000000000000..f7666e47561d514b2a76d5a7dfbb43ede86da92a --- /dev/null +++ b/code/Micro_E53/entry/proguard-rules.pro @@ -0,0 +1 @@ +# config module specific ProGuard rules here. \ No newline at end of file diff --git a/code/Micro_E53/entry/src/main/config.json b/code/Micro_E53/entry/src/main/config.json new file mode 100755 index 0000000000000000000000000000000000000000..b6f0864e4c7ba4ef84ebb7b356641c0fba7c7d9a --- /dev/null +++ b/code/Micro_E53/entry/src/main/config.json @@ -0,0 +1,42 @@ +{ + "app": { + "bundleName": "com.example.E53", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "deviceType": [ + "smartVision" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "name": "default", + "icon": "$media:icon_small", + "label": "$string:entry_MainAbility", + "type": "page" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/nongye/nongye", + "pages/ludeng/ludeng", + "pages/yangan/yangan", + "pages/jinggai/jinggai", + "pages/hongwai/hongwai" + ], + "name": "default" + } + ] + } +} \ No newline at end of file diff --git a/code/Micro_E53/entry/src/main/js/default/app.js b/code/Micro_E53/entry/src/main/js/default/app.js new file mode 100755 index 0000000000000000000000000000000000000000..6d060ffe5682c19fc83e2274a9e62cbc40a655f8 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/app.js @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info("Application onCreate"); + }, + onDestroy() { + console.info("Application onDestroy"); + } +}; diff --git a/code/Micro_E53/entry/src/main/js/default/common/airHumidity.png b/code/Micro_E53/entry/src/main/js/default/common/airHumidity.png new file mode 100755 index 0000000000000000000000000000000000000000..6301e9d57addf42bdb8a2162430b782e23f9c74c Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/airHumidity.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/airLux.png b/code/Micro_E53/entry/src/main/js/default/common/airLux.png new file mode 100755 index 0000000000000000000000000000000000000000..f7d83c943aed0950abfc9942cdfacecd2f701933 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/airLux.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/airTemp.png b/code/Micro_E53/entry/src/main/js/default/common/airTemp.png new file mode 100755 index 0000000000000000000000000000000000000000..4254ef11d46c75ff7561b22413092caf3b1a0178 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/airTemp.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/case_deng.png b/code/Micro_E53/entry/src/main/js/default/common/case_deng.png new file mode 100755 index 0000000000000000000000000000000000000000..ceae82fd3e8b150b4b1c4d2750cd8aef0b3becfe Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/case_deng.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/case_hong.png b/code/Micro_E53/entry/src/main/js/default/common/case_hong.png new file mode 100755 index 0000000000000000000000000000000000000000..30618c107c5180c56fcc87ed8379d2aa209a1d59 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/case_hong.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/case_jing.png b/code/Micro_E53/entry/src/main/js/default/common/case_jing.png new file mode 100755 index 0000000000000000000000000000000000000000..abb1f92989336076c19cfc6e1bb687d6b1e1bfe2 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/case_jing.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/case_nong.png b/code/Micro_E53/entry/src/main/js/default/common/case_nong.png new file mode 100755 index 0000000000000000000000000000000000000000..bb6ac4251dbda391040cabd5cf5a8c158b3e0d0e Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/case_nong.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/case_yan.png b/code/Micro_E53/entry/src/main/js/default/common/case_yan.png new file mode 100755 index 0000000000000000000000000000000000000000..7075f9e29ac8e6d0194d165cfa573a1b1b867df8 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/case_yan.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/deng.png b/code/Micro_E53/entry/src/main/js/default/common/deng.png new file mode 100755 index 0000000000000000000000000000000000000000..93ebfea28103b33775c600c79b879f364e5d435d Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/deng.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/deng_2.png b/code/Micro_E53/entry/src/main/js/default/common/deng_2.png new file mode 100755 index 0000000000000000000000000000000000000000..3a2cd2d2674ecd5617a88562777206d828ec5293 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/deng_2.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/dian.png b/code/Micro_E53/entry/src/main/js/default/common/dian.png new file mode 100755 index 0000000000000000000000000000000000000000..b44f4315b1dfcb497de8133eede0ed66117abeb2 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/dian.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/dian_2.png b/code/Micro_E53/entry/src/main/js/default/common/dian_2.png new file mode 100755 index 0000000000000000000000000000000000000000..0fbda4e33e17c6006fb7b1d3216bab1ebc9c025e Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/dian_2.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/dian_off.png b/code/Micro_E53/entry/src/main/js/default/common/dian_off.png new file mode 100755 index 0000000000000000000000000000000000000000..50fe565605a42fd39dbc9af330f41b1fed8a3d58 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/dian_off.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/dian_on.png b/code/Micro_E53/entry/src/main/js/default/common/dian_on.png new file mode 100755 index 0000000000000000000000000000000000000000..88dedce3b3d515a1fc41da9133c2e3a65f8cdea6 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/dian_on.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/ic_back.png b/code/Micro_E53/entry/src/main/js/default/common/ic_back.png new file mode 100755 index 0000000000000000000000000000000000000000..4a269a11a6eca005d2eabb957992297446c858db Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/ic_back.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/jing.png b/code/Micro_E53/entry/src/main/js/default/common/jing.png new file mode 100755 index 0000000000000000000000000000000000000000..d727bf174be3e7f119439aae75b41d4146a486db Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/jing.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/jing_2.png b/code/Micro_E53/entry/src/main/js/default/common/jing_2.png new file mode 100755 index 0000000000000000000000000000000000000000..d78d43bbb0d7d3ba14d559ed8f4677ee62d7d923 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/jing_2.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/kaiguan.png b/code/Micro_E53/entry/src/main/js/default/common/kaiguan.png new file mode 100755 index 0000000000000000000000000000000000000000..c706c8e50b5011f340f8b817b694969757cdf101 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/kaiguan.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/kaiguan_2.png b/code/Micro_E53/entry/src/main/js/default/common/kaiguan_2.png new file mode 100755 index 0000000000000000000000000000000000000000..79cb25b4ab99413025fda2dd9dea4530ab2ec0d0 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/kaiguan_2.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/led_off.png b/code/Micro_E53/entry/src/main/js/default/common/led_off.png new file mode 100755 index 0000000000000000000000000000000000000000..b75f0034f9d749ae0e70567373afa9b16b410f3c Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/led_off.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/led_on.png b/code/Micro_E53/entry/src/main/js/default/common/led_on.png new file mode 100755 index 0000000000000000000000000000000000000000..c5962890d4675a25d0b5c5071c81123448963e08 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/led_on.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/off.png b/code/Micro_E53/entry/src/main/js/default/common/off.png new file mode 100755 index 0000000000000000000000000000000000000000..ed378fbf890d55105810a4a3227583855e6bcf5c Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/off.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/on.png b/code/Micro_E53/entry/src/main/js/default/common/on.png new file mode 100755 index 0000000000000000000000000000000000000000..6e4e34adf4c3410c42c3b0415fdca8826e9758ee Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/on.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/ren.png b/code/Micro_E53/entry/src/main/js/default/common/ren.png new file mode 100755 index 0000000000000000000000000000000000000000..458677467a3037aa2e60ce4198a9c7ed92244760 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/ren.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/ren_2.png b/code/Micro_E53/entry/src/main/js/default/common/ren_2.png new file mode 100755 index 0000000000000000000000000000000000000000..f462a9bfe5de22a935ecfcd5aa9b8c6bb8f69ae7 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/ren_2.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/yan.png b/code/Micro_E53/entry/src/main/js/default/common/yan.png new file mode 100755 index 0000000000000000000000000000000000000000..c88d1a476612667855633c788584271d09cf4489 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/yan.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/common/yan_2.png b/code/Micro_E53/entry/src/main/js/default/common/yan_2.png new file mode 100755 index 0000000000000000000000000000000000000000..5a4da7ad17e7cf301a1d0e5e109ba10d98827f45 Binary files /dev/null and b/code/Micro_E53/entry/src/main/js/default/common/yan_2.png differ diff --git a/code/Micro_E53/entry/src/main/js/default/i18n/en-US.json b/code/Micro_E53/entry/src/main/js/default/i18n/en-US.json new file mode 100755 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/code/Micro_E53/entry/src/main/js/default/i18n/zh-CN.json b/code/Micro_E53/entry/src/main/js/default/i18n/zh-CN.json new file mode 100755 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/code/Micro_E53/entry/src/main/js/default/pages/hongwai/hongwai.css b/code/Micro_E53/entry/src/main/js/default/pages/hongwai/hongwai.css new file mode 100755 index 0000000000000000000000000000000000000000..f6b06dfb4bdbbbbb350cc0d5b1d76c0497583274 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/hongwai/hongwai.css @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.text{ + color: #3c3c3c; +} +.container { + width: 100%; + height: 100%; + flex-direction: column; + background-color: white; +} +.back{ + width: 100%; + height: 60px; +} +.back-img-view{ + width: 80px; + height: 60px; +} +.back-img{ + width: 38px; + height: 38px; + margin-left: 20px; + margin-top: 10px; +} +.e53-title{ + width: 100%; + height: 60px; + align-items: center; + justify-content: center; +} +.e53-title-text{ + font-size: 36px; +} +.control-board{ + display: flex; + width: 100%; + height: 340px; + justify-content: center; + align-items: center; +} +.alert-view{ + flex-direction: column; + width: 220px; + height: 280px; + justify-content: center; + align-items: center; +} +.deng-img{ + width: 200px; + height: 200px; +} +.data-text{ + font-size: 40px; +} \ No newline at end of file diff --git a/code/Micro_E53/entry/src/main/js/default/pages/hongwai/hongwai.hml b/code/Micro_E53/entry/src/main/js/default/pages/hongwai/hongwai.hml new file mode 100755 index 0000000000000000000000000000000000000000..7ee6ed4a38fc6d36204245f9b7ee860179cb61bc --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/hongwai/hongwai.hml @@ -0,0 +1,31 @@ + +
+
+
+ +
+
+
+ 智慧人体红外 +
+
+
+ + + {{ state[mydata.humanAround] }} +
+
+
diff --git a/code/Micro_E53/entry/src/main/js/default/pages/hongwai/hongwai.js b/code/Micro_E53/entry/src/main/js/default/pages/hongwai/hongwai.js new file mode 100755 index 0000000000000000000000000000000000000000..6c926adc63f2c065b12baec8dff3a112e40270a3 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/hongwai/hongwai.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; +import app from '@system.app'; + +var cmdno = {init:0,close:1,read:2} +export default { + data: { + mydata: { + humanAround: 0 + }, + state:{ + 0:'无人经过', + 1:'有人经过' + }, + interval: 0 + }, + onInit(){ + app.e53is1service({ + cmd:cmdno.init, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + this.interval = setInterval(()=>this.queryData(),500) + }, + toback(){ + app.e53is1service({ + cmd:cmdno.close, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + clearInterval(this.interval) + router.replace({ + uri: 'pages/index/index' + }); + }, + queryData(){ + let that = this + app.e53is1service({ + cmd:cmdno.read, + data:'', + success(res){ + that.mydata = JSON.parse(res.e53_is1) + }, + fail(res){ + + }, + complete(res){ + + }, + }) + } +} diff --git a/code/Micro_E53/entry/src/main/js/default/pages/index/index.css b/code/Micro_E53/entry/src/main/js/default/pages/index/index.css new file mode 100755 index 0000000000000000000000000000000000000000..b998afb4fded0ee918afd2334da884b76ac7f695 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.text{ + color: #3c3c3c; +} +.container { + width: 100%; + height: 100%; + flex-direction: column; + background-color: white; +} +.back{ + width: 100%; + height: 60px; +} +.back-img-view{ + width: 80px; + height: 60px; +} +.back-img{ + width: 38px; + height: 38px; + margin-left: 20px; + margin-top: 10px; +} +.e53{ + width: 100%; + height: 420px; + flex-direction: column; +} +.e53-title{ + width: 100%; + height: 60px; +} +.e53-title-text{ + margin-left: 30px; + font-size: 28px; +} +.e53-group1{ + width: 800px; + height: 160px; + align-items: center; +} +.e53-group2{ + width: 800px; + height: 160px; + align-items: center; +} +.e53-case{ + width: 140px; + height: 140px; + border-radius: 20px; + margin-left: 30px; + border-color: black; + border-width: 2px; + flex-direction: column; + +} +.e53-case-img{ + width: 80px; + height: 80px; + margin-top: 10px; + margin-left: 27px; +} +.e53-case-state{ + margin-top: 5px; + margin-left: 44px; + font-size: 24px; +} \ No newline at end of file diff --git a/code/Micro_E53/entry/src/main/js/default/pages/index/index.hml b/code/Micro_E53/entry/src/main/js/default/pages/index/index.hml new file mode 100755 index 0000000000000000000000000000000000000000..e29f35ac3587c133968b021f383936cc7dca3529 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,60 @@ + +
+
+
+ +
+
+
+
+ 我的模块 +
+
+
+ + + {{e53.e53_nong.state}} + +
+
+ + + {{e53.e53_deng.state}} + +
+
+ + + {{e53.e53_yan.state}} + +
+
+
+
+ + + {{e53.e53_jing.state}} + +
+
+ + + {{e53.e53_hong.state}} + +
+
+
+
diff --git a/code/Micro_E53/entry/src/main/js/default/pages/index/index.js b/code/Micro_E53/entry/src/main/js/default/pages/index/index.js new file mode 100755 index 0000000000000000000000000000000000000000..ab1157d16184692775e809ec142e31946148c078 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import app from '@system.app'; +import router from '@system.router'; + +export default { + data: { + title: 'World', + e53: { + e53_nong: { + state: '农业', uri: 'pages/nongye/nongye', ico:'../../common/case_nong.png' + }, + e53_deng: { + state: '路灯', uri: 'pages/ludeng/ludeng', ico:'../../common/case_deng.png' + }, + e53_yan: { + state: '烟感', uri: 'pages/yangan/yangan', ico:'../../common/case_yan.png' + }, + e53_jing: { + state: '井盖', uri: 'pages/jinggai/jinggai', ico:'../../common/case_jing.png' + }, + e53_hong: { + state: '红外', uri: 'pages/hongwai/hongwai', ico:'../../common/case_hong.png' + }, + } + }, + exit(){ + app.terminate() + }, + route(e){ + router.replace({ + uri: e.uri + }); + } +} diff --git a/code/Micro_E53/entry/src/main/js/default/pages/jinggai/jinggai.css b/code/Micro_E53/entry/src/main/js/default/pages/jinggai/jinggai.css new file mode 100755 index 0000000000000000000000000000000000000000..d87d2e68316d0d1c3b54201d2e41fef8becad48d --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/jinggai/jinggai.css @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.text{ + color: #3c3c3c; +} +.container { + width: 100%; + height: 100%; + flex-direction: column; + background-color: white; +} +.back{ + width: 100%; + height: 60px; +} +.back-img-view{ + width: 80px; + height: 60px; +} +.back-img{ + width: 38px; + height: 38px; + margin-left: 20px; + margin-top: 10px; +} +.e53-title{ + width: 100%; + height: 60px; + align-items: center; + justify-content: center; +} +.e53-title-text{ + font-size: 36px; +} +.control-board{ + display: flex; + width: 100%; + height: 340px; +} +.data-view1{ + width: 50%; + height: 340; + flex-direction: column; + align-items: center; +} +.data-view{ + width: 50%; + height: 340; + flex-direction: column; + justify-content: center; + align-items: center; +} +.text-view{ + width: 100%; + height: 60px; + margin-top: 120px; + align-items: center; +} +.deng-img{ + width: 200px; + height: 200px; +} +.data-text{ + font-size: 36px; + margin-top: 5px; + margin-left: 5px; +} +.data-ico{ + width: 32px; + height: 32px; + margin-left: 50px; +} diff --git a/code/Micro_E53/entry/src/main/js/default/pages/jinggai/jinggai.hml b/code/Micro_E53/entry/src/main/js/default/pages/jinggai/jinggai.hml new file mode 100755 index 0000000000000000000000000000000000000000..218968e6fbe6fd5086a89ea0de150b064daa86ba --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/jinggai/jinggai.hml @@ -0,0 +1,36 @@ + +
+
+
+ +
+
+
+ 智慧井盖 +
+
+
+
+ + 温度:{{mydata.Temp}}℃ +
+
+
+ + +
+
+
diff --git a/code/Micro_E53/entry/src/main/js/default/pages/jinggai/jinggai.js b/code/Micro_E53/entry/src/main/js/default/pages/jinggai/jinggai.js new file mode 100755 index 0000000000000000000000000000000000000000..38eeffd14ab4be76d215933347bd7f01eab18918 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/jinggai/jinggai.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; +import app from '@system.app'; + +var cmdno = {init:0,close:1,read:2} +export default { + data: { + mydata: { + Temp: 0, + Status: 0 + }, + interval:0 + }, + onInit(){ + app.e53sc2service({ + cmd:cmdno.init, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + this.interval = setInterval(()=>this.queryData(),2000) + }, + toback(){ + app.e53sc2service({ + cmd:cmdno.close, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + clearInterval(this.interval) + router.replace({ + uri: 'pages/index/index' + }); + }, + queryData(){ + let that = this + app.e53sc2service({ + cmd:cmdno.read, + data:'', + success(res){ + that.mydata = JSON.parse(res.e53_sc2) + }, + fail(res){ + + }, + complete(res){ + + }, + }) + } +} diff --git a/code/Micro_E53/entry/src/main/js/default/pages/ludeng/ludeng.css b/code/Micro_E53/entry/src/main/js/default/pages/ludeng/ludeng.css new file mode 100755 index 0000000000000000000000000000000000000000..109501845ff1ce5027c404b7aa64b00caa0e7b06 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/ludeng/ludeng.css @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.text{ + color: #3c3c3c; +} +.container { + width: 100%; + height: 100%; + flex-direction: column; + background-color: white; +} +.back{ + width: 100%; + height: 60px; +} +.back-img-view{ + width: 80px; + height: 60px; +} +.back-img{ + width: 38px; + height: 38px; + margin-left: 20px; + margin-top: 10px; +} +.e53-title{ + width: 100%; + height: 60px; + align-items: center; + justify-content: center; +} +.e53-title-text{ + font-size: 36px; +} +.control-board{ + display: flex; + width: 100%; + height: 340px; +} +.data-view1{ + width: 50%; + height: 340; + flex-direction: column; + align-items: center; +} +.data-view{ + width: 50%; + height: 340; + flex-direction: column; + justify-content: center; + align-items: center; +} +.text-view{ + width: 100%; + height: 60px; + margin-top: 120px; + align-items: center; +} +.deng-img{ + width: 200px; + height: 200px; +} +.data-text{ + font-size: 36px; + margin-left: 5px; + margin-top: 5px; +} +.data-ico{ + width: 32px; + height: 32px; + margin-left: 50px; +} \ No newline at end of file diff --git a/code/Micro_E53/entry/src/main/js/default/pages/ludeng/ludeng.hml b/code/Micro_E53/entry/src/main/js/default/pages/ludeng/ludeng.hml new file mode 100755 index 0000000000000000000000000000000000000000..158796b36f41c763219416fbf9643059ae278b3d --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/ludeng/ludeng.hml @@ -0,0 +1,36 @@ + +
+
+
+ +
+
+
+ 智慧路灯 +
+
+
+
+ + 光照强度:{{mydata.Lux}}lx +
+
+
+ + +
+
+
diff --git a/code/Micro_E53/entry/src/main/js/default/pages/ludeng/ludeng.js b/code/Micro_E53/entry/src/main/js/default/pages/ludeng/ludeng.js new file mode 100755 index 0000000000000000000000000000000000000000..d09482d995f95065202c4b68be3aef64acf6d445 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/ludeng/ludeng.js @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; +import app from '@system.app'; + +var cmdno = {init:0,close:1,read:2,deng:3} +export default { + data: { + mydata: { + Lux: 0, + LED: 'OFF' + }, + interval:0 + }, + onInit(){ + app.e53sc1service({ + cmd:cmdno.init, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + this.interval = setInterval(()=>this.queryData(),2000) + }, + toback(){ + app.e53ia1service({ + cmd:cmdno.close, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + clearInterval(this.interval) + router.replace({ + uri: 'pages/index/index' + }); + }, + open(){ + let that = this + app.e53sc1service({ + cmd:cmdno.deng, + data:'ON', + success(res){ + that.mydata = JSON.parse(res.e53_sc1) + }, + fail(res){ + + }, + complete(res){ + + }, + }) + }, + close(){ + let that = this + app.e53sc1service({ + cmd:cmdno.deng, + data:'OFF', + success(res){ + that.mydata = JSON.parse(res.e53_sc1) + }, + fail(res){ + + }, + complete(res){ + + }, + }) + }, + queryData(){ + let that = this + app.e53sc1service({ + cmd:cmdno.read, + data:'', + success(res){ + that.mydata = JSON.parse(res.e53_sc1) + }, + fail(res){ + + }, + complete(res){ + + }, + }) + } +} diff --git a/code/Micro_E53/entry/src/main/js/default/pages/nongye/nongye.css b/code/Micro_E53/entry/src/main/js/default/pages/nongye/nongye.css new file mode 100755 index 0000000000000000000000000000000000000000..96f1f04500fec817d35b3c8aabe699eff09b8485 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/nongye/nongye.css @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.text{ + color: #3c3c3c; +} +.container { + width: 100%; + height: 100%; + flex-direction: column; + background-color: white; +} +.back{ + width: 100%; + height: 60px; +} +.back-img-view{ + width: 80px; + height: 60px; +} +.back-img{ + width: 38px; + height: 38px; + margin-left: 20px; + margin-top: 10px; +} +.e53-title{ + width: 100%; + height: 60px; + align-items: center; + justify-content: center; +} +.e53-title-text{ + font-size: 36px; +} +.control-board{ + display: flex; + width: 100%; + height: 340px; +} +.data-view{ + width: 50%; + height: 340; + justify-content: center; + align-items: center; +} +.data-group{ + width: 340px; + height: 260px; + border-radius: 20px; + border-width: 2px; + border-color: black; + flex-direction: column; +} +.data-cap{ + height: 80px; + width: 340px; + margin-top: 5px; + align-items: center; +} +.data-describe{ + margin-left: 10px; +} +.data-ico{ + width: 32px; + height: 32px; + margin-left: 10px; +} +.control-view{ + width: 50%; + height: 340; + justify-content: center; + align-items: center; +} +.control-group{ + width: 320px; + height: 260px; + border-radius: 20px; + border-width: 2px; + border-color: black; + flex-direction: column; +} +.group{ + width: 320px; + height: 130px; + flex-direction: column; + align-items: center; +} +.control-ico-group{ + width: 320px; + height: 80px; + justify-content: space-between; + align-items: center; +} +.control-describe{ + font-size: 26px; + margin-top: 10px; +} +.control-switch{ + width: 80px; +} +.control-ico-right{ + height: 60px; + width: 60px; + margin-right: 20px; +} +.control-ico-left{ + height: 60px; + width: 60px; + margin-left: 20px; +} \ No newline at end of file diff --git a/code/Micro_E53/entry/src/main/js/default/pages/nongye/nongye.hml b/code/Micro_E53/entry/src/main/js/default/pages/nongye/nongye.hml new file mode 100755 index 0000000000000000000000000000000000000000..ad116c00b38285c8d4c79d5398ed29a270b1617e --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/nongye/nongye.hml @@ -0,0 +1,64 @@ + +
+
+
+ +
+
+
+ {{ title }} +
+
+
+
+
+ + 温度:{{mydata.Temp}}℃ +
+
+ + 湿度:{{mydata.Hum}}% +
+
+ + 光照强度:{{mydata.Lux}}lx +
+
+
+
+
+
+ led灯 +
+ + + + +
+
+
+ 风扇 +
+ + + + +
+
+
+
+
+
diff --git a/code/Micro_E53/entry/src/main/js/default/pages/nongye/nongye.js b/code/Micro_E53/entry/src/main/js/default/pages/nongye/nongye.js new file mode 100755 index 0000000000000000000000000000000000000000..537f8e8dca9b512a7e542acd3b97ec3d6c83269c --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/nongye/nongye.js @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; +import app from '@system.app'; + +var cmdno = {init:0,close:1,read:2,dian:3,deng:4} +export default { + data: { + title: '智慧农业', + mydata: { + Temp: 0, + Hum: 0, + Lux: 0, + Motor: 'OFF', + LED: 'OFF' + }, + interval:0 + }, + onInit(){ + app.e53ia1service({ + cmd:cmdno.init, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + this.interval = setInterval(()=>this.queryData(),2000) + }, + toback(){ + app.e53ia1service({ + cmd:cmdno.close, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + clearInterval(this.interval) + router.replace({ + uri: 'pages/index/index' + }); + }, + dengChange(){ + let that = this + let flag = '' + if(this.mydata.LED == 'OFF'){ + flag = 'ON' + } + else{ + flag = 'OFF' + } + app.e53ia1service({ + cmd:cmdno.deng, + data:flag, + success(res){ + that.mydata = JSON.parse(res.e53_ia1) + }, + fail(res){ + + }, + complete(res){ + + }, + }) + }, + dianChange(){ + let that = this + let flag = '' + if(this.mydata.Motor == 'OFF'){ + flag = 'ON' + } + else{ + flag = 'OFF' + } + app.e53ia1service({ + cmd:cmdno.dian, + data:flag, + success(res){ + that.mydata = JSON.parse(res.e53_ia1) + }, + fail(res){ + + }, + complete(res){ + + }, + }) + }, + queryData(){ + let that = this + app.e53ia1service({ + cmd:cmdno.read, + data:'', + success(res){ + that.mydata = JSON.parse(res.e53_ia1) + }, + fail(res){ + + }, + complete(res){ + + }, + }) + } +} diff --git a/code/Micro_E53/entry/src/main/js/default/pages/yangan/yangan.css b/code/Micro_E53/entry/src/main/js/default/pages/yangan/yangan.css new file mode 100755 index 0000000000000000000000000000000000000000..4a13a55c687067e3498397c48d3ccbb6576ef0aa --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/yangan/yangan.css @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +.text{ + color: #3c3c3c; +} +.container { + width: 100%; + height: 100%; + flex-direction: column; + background-color: white; +} +.back{ + width: 100%; + height: 60px; +} +.back-img-view{ + width: 80px; + height: 60px; +} +.back-img{ + width: 38px; + height: 38px; + margin-left: 20px; + margin-top: 10px; +} +.e53-title{ + width: 100%; + height: 60px; + align-items: center; + justify-content: center; +} +.e53-title-text{ + font-size: 36px; +} +.control-board{ + display: flex; + width: 100%; + height: 340px; +} +.text-view{ + width: 100%; + height: 60px; +} +.text-view2{ + width: 100%; + height: 60px; + margin-top: 35px; +} +.data-view{ + width: 50%; + height: 340; + flex-direction: column; + justify-content: center; + align-items: center; +} +.data-view2{ + width: 50%; + height: 340; + flex-direction: column; + align-items: center; +} +.deng-img{ + margin-top: 10px; + width: 200px; + height: 200px; +} +.data-text{ + font-size: 36px; + margin-top: 5px; + margin-left: 100px; +} +.data-text2{ + font-size: 36px; + margin-top: 5px; + margin-left: 120px; +} +.ppmset-view{ + width: 300px; + height: 60px; + margin-top: 40px; + justify-content: center; + align-items: center; + background-color: #2bffff; +} +.ppm-set{ + width: 300px; + height: 30px; + background-color: #2bffff; + color: deepskyblue; +} \ No newline at end of file diff --git a/code/Micro_E53/entry/src/main/js/default/pages/yangan/yangan.hml b/code/Micro_E53/entry/src/main/js/default/pages/yangan/yangan.hml new file mode 100755 index 0000000000000000000000000000000000000000..d19566651ba5bc9f36ced297a81371559d4feaa2 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/yangan/yangan.hml @@ -0,0 +1,41 @@ + +
+
+
+ +
+
+
+ 智慧烟感 +
+
+
+
+ 烟雾浓度:{{ mydata.ppm }} +
+ + +
+
+
+ 阈值:{{ threshold }} +
+
+ +
+
+
+
diff --git a/code/Micro_E53/entry/src/main/js/default/pages/yangan/yangan.js b/code/Micro_E53/entry/src/main/js/default/pages/yangan/yangan.js new file mode 100755 index 0000000000000000000000000000000000000000..286ad3192a111ce99e122786bfc94bfce0ea4f81 --- /dev/null +++ b/code/Micro_E53/entry/src/main/js/default/pages/yangan/yangan.js @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2022 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; +import app from '@system.app'; + +var cmdno = {init:0,close:1,read:2,beep:3} +export default { + data: { + mydata: { + ppm: 0, + Beep: 'OFF' + }, + threshold: 300, + interval: 0 + }, + onInit(){ + app.e53sf1service({ + cmd:cmdno.init, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + this.interval = setInterval(()=>this.queryData(),2000) + }, + toback(){ + app.e53sf1service({ + cmd:cmdno.close, + success(res){ + }, + fail(res){ + + }, + complete(res){ + + }, + }) + clearInterval(this.interval) + router.replace({ + uri: 'pages/index/index' + }); + }, + thresholdChange(e){ + this.threshold = e.value + }, + openAlert(){ + app.e53sf1service({ + cmd:cmdno.beep, + data:'ON', + success(res){ + + }, + fail(res){ + + }, + complete(res){ + + }, + }) + }, + closeAlert(){ + app.e53sf1service({ + cmd:cmdno.beep, + data:'OFF', + success(res){ + + }, + fail(res){ + + }, + complete(res){ + + }, + }) + }, + queryData(){ + let that = this + app.e53sf1service({ + cmd:cmdno.read, + data:'', + success(res){ + that.mydata = JSON.parse(res.e53_sf1) + if(that.mydata.ppm > that.threshold && that.mydata.Beep == 'OFF'){ + that.openAlert() + } + else if(that.mydata.ppm < that.threshold && that.mydata.Beep == 'ON'){ + that.closeAlert() + } + else{ + + } + }, + fail(res){ + + }, + complete(res){ + + }, + }) + } +} diff --git a/code/Micro_E53/entry/src/main/resources/base/element/string.json b/code/Micro_E53/entry/src/main/resources/base/element/string.json new file mode 100755 index 0000000000000000000000000000000000000000..2be18c1abe7ea61ee7a352fe857461af5e85805b --- /dev/null +++ b/code/Micro_E53/entry/src/main/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + } + ] +} diff --git a/code/Micro_E53/entry/src/main/resources/base/media/icon.png b/code/Micro_E53/entry/src/main/resources/base/media/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/code/Micro_E53/entry/src/main/resources/base/media/icon.png differ diff --git a/code/Micro_E53/entry/src/main/resources/base/media/icon_small.png b/code/Micro_E53/entry/src/main/resources/base/media/icon_small.png new file mode 100755 index 0000000000000000000000000000000000000000..a4ddee89e182ce7544f4ffdd8956c5e328fd792e Binary files /dev/null and b/code/Micro_E53/entry/src/main/resources/base/media/icon_small.png differ diff --git a/code/Micro_E53/gradle.properties b/code/Micro_E53/gradle.properties new file mode 100755 index 0000000000000000000000000000000000000000..be492496f9a20ac2d980ef4fc30061f4184c1c40 --- /dev/null +++ b/code/Micro_E53/gradle.properties @@ -0,0 +1,13 @@ +# Project-wide Gradle settings. +# IDE (e.g. DevEco Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# If the Chinese output is garbled, please configure the following parameter. +# This function is enabled by default when the DevEco Studio builds the hap/app,if you need disable gradle parallel,you should set org.gradle.parallel false. +# more information see https://docs.gradle.org/current/userguide/performance.html +# org.gradle.parallel=false +# org.gradle.jvmargs=-Dfile.encoding=GBK \ No newline at end of file diff --git a/code/Micro_E53/gradle/wrapper/gradle-wrapper.jar b/code/Micro_E53/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 0000000000000000000000000000000000000000..490fda8577df6c95960ba7077c43220e5bb2c0d9 Binary files /dev/null and b/code/Micro_E53/gradle/wrapper/gradle-wrapper.jar differ diff --git a/code/Micro_E53/gradle/wrapper/gradle-wrapper.properties b/code/Micro_E53/gradle/wrapper/gradle-wrapper.properties new file mode 100755 index 0000000000000000000000000000000000000000..63c817f17998697c0097fa6399106b99591c77b9 --- /dev/null +++ b/code/Micro_E53/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-7.3-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/code/Micro_E53/gradlew b/code/Micro_E53/gradlew new file mode 100755 index 0000000000000000000000000000000000000000..536f0272dd995f3afdb5e34e0f42bdf3d1986c22 --- /dev/null +++ b/code/Micro_E53/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ]; do + ls=$(ls -ld "$PRG") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' >/dev/null; then + PRG="$link" + else + PRG=$(dirname "$PRG")"/$link" + fi +done +SAVED="$(pwd)" +cd "$(dirname \"$PRG\")/" >/dev/null +APP_HOME="$(pwd -P)" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=$(basename "$0") + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn() { + echo "$*" +} + +die() { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$(uname)" in +CYGWIN*) + cygwin=true + ;; +Darwin*) + darwin=true + ;; +MINGW*) + msys=true + ;; +NONSTOP*) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ]; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then + MAX_FD_LIMIT=$(ulimit -H -n) + if [ $? -eq 0 ]; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ]; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ]; then + APP_HOME=$(cygpath --path --mixed "$APP_HOME") + CLASSPATH=$(cygpath --path --mixed "$CLASSPATH") + JAVACMD=$(cygpath --unix "$JAVACMD") + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null) + SEP="" + for dir in $ROOTDIRSRAW; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ]; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@"; do + CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -) + CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition + eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg") + else + eval $(echo args$i)="\"$arg\"" + fi + i=$(expr $i + 1) + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save() { + for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/code/Micro_E53/gradlew.bat b/code/Micro_E53/gradlew.bat new file mode 100755 index 0000000000000000000000000000000000000000..62bd9b9ccefea2b65ae41e5d9a545e2021b90a1d --- /dev/null +++ b/code/Micro_E53/gradlew.bat @@ -0,0 +1,103 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/code/Micro_E53/package.json b/code/Micro_E53/package.json new file mode 100755 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/code/Micro_E53/package.json @@ -0,0 +1 @@ +{} diff --git a/code/Micro_E53/settings.gradle b/code/Micro_E53/settings.gradle new file mode 100755 index 0000000000000000000000000000000000000000..28d595f2fba0d06b2025da200383d15f87c4e9f0 --- /dev/null +++ b/code/Micro_E53/settings.gradle @@ -0,0 +1 @@ +include ':entry'