intel / intel-iot-services-orchestration-layer

The total solution that provides visual graphical programming for developing IoT applications.
80 stars 61 forks source link

Try to write a Widget into iot-dev,but... #48

Closed qq332769043 closed 7 years ago

qq332769043 commented 7 years ago

I want to write a Wideget into iot-dev. As http://01org.github.io/intel-iot-services-orchestration-layer/#getstarted/example/add_widget_builtin Step.1 create ui-widgets/widgets-jsx/xxx.js Step.2 add spec to ui-widgets/specs.js Step.3 add entry to ui-widgets/index.js But something goes wrong: image and all new-add-widget gets stuck and they are unresponsive.

So I use the Image Widget code(builtin) instead my code according to the 3 Step. But bug still is bug.

Did I do something wrong?

And I also want to ask How to replace the "icon" of my widget in specs.js,where the picture should be? Thank you.

jiangzidong commented 7 years ago

@qq332769043 I think the add widget operation is for dev branch. We need to modify the ui-widget folder in dev branch, then build by build.sh or link-npms.sh. I just suspect you directly operate in the master branch (or dist folder ), do you?

@jjykh Am i right about that? If so, it is our mistake that we forget to mention that in the help doc.

qq332769043 commented 7 years ago

where is the ui-widget folder in master branch

jiangzidong commented 7 years ago

both master and dev branch have a folder named ui-widgets. you should modify the dev's ui-widgets according to the doc, and then run ./build.sh.

qq332769043 commented 7 years ago

@jiangzidong How to replace the "icon" of my widget in specs.js,where the picture should be?

qq332769043 commented 7 years ago

@jiangzidong If I want to write into master branch,what should I do?

IceFireg commented 7 years ago

@jiangzidong 我们在DFRobot上购买的IO扩展板(自带有能被iot-sol识别的传感器服务)经常会出现下一次使用就不能识别这些服务的问题,但用Intel_Edison_Setup_Lin_2016.2.002刷新固件后又能重新识别,十分不稳定,请问您知道是什么原因吗?该怎么解决呢?

jiangzidong commented 7 years ago

@qq332769043 it is complicated to add widgets directly in master branch for now.

as for the icon issue, @jjykh will answer later.

jiangzidong commented 7 years ago

@IceFireg 没有遇到过这个情况, 请否描述一下“不能识别服务” 是什么现象,有么有重现的步骤。谢谢

qq332769043 commented 7 years ago

@jjykh How to replace the "icon" of my widget in specs.js,where the picture should be?

IceFireg commented 7 years ago

@jiangzidong就像这样 2016-10-23 14-59-47 下图是它自带的服务 2016-10-23 15-00-34 如果不能识别,这些服务也看不到。如果重新run the setup tool,再把原来的iot-sol复制进去就又可以看到。

jjykh commented 7 years ago

@qq332769043 In general, there are two ways to add new UI widget.

  1. For dev branch, please refer to UI Widget for details. Examples & docs:
  2. For master branch, see also Add UI Widget
jjykh commented 7 years ago

@qq332769043

To change the icon of UI Widget, please refer to Font Awesome Icon. For example, the builtin text widget using an icon image, its name is text-width.

If the widget was created by iotsol IDE, you can click the icon on preview panel to select one icon for your widget. image

jiangzidong commented 7 years ago

@IceFireg 不知道你能不能在出问题的时候, 给我发以下文件 (可以直接发我邮件 zidong.jiang@intel.com)

Thanks

qq332769043 commented 7 years ago

@jjykh I try to add wideget into master branch as doc but when I run"gulp build" it show that"No gulpfile found ",the doc seems also is right to dev but not master.

qq332769043 commented 7 years ago

@jiangzidong @jjykh I insist on working on master branch because I dont know why there is so many error during setting up dev branch,some times it makes the whole IoT don't work and I must redo all.(Windows and Ubuntu) Setting up dev branch takes me at least 2 hours and rebuild to test my widget takes me at least 40 minutes once,but I even don't know IoT could rework. I don't know what should I do.

jjykh commented 7 years ago

@qq332769043 You should execute _gendoc.sh under doc directory on master branch.

jjykh commented 7 years ago

@qq332769043 Please refer to Contribute to the Development Project for selection between master and dev branch. The iotsol dev branch, each sub-module(e.g base,center,workflow,ui-dev) depend on lots of third-party modules, setting up is really a time-consuming process. For master branch, we merged third-party npm modules from all sub-module, and provided prebuilt ui-dev and ui-user.

qq332769043 commented 7 years ago

@jjykh where is gen_doc,sh in master branch

qq332769043 commented 7 years ago

@jjykh I think you mean the doc is http://01org.github.io/intel-iot-services-orchestration-layer/#getstarted/advanced/add_widget but when I run"gulp build" to rebuild ui-widget it show that"No gulpfile found "

jjykh commented 7 years ago

Sorry, to update docs, please switch to dev branch, master branch didn't support to update docs.

jjykh commented 7 years ago

@qq332769043 If you add new widget on dev branch, you should run gulp build. but if you are working on master branch, you should put your codes under ui-widgets/addons, and needn't run building script.

qq332769043 commented 7 years ago

@jjykh when I add my widget into ui-widgets/addons and start master branch, then I open"http://localhost:8080",the window of ide is blank at all with out no respose. Is that because of using third-party react module? How can I read debugging information of my widget.

qq332769043 commented 7 years ago

@jjykh It seems that because of using third-party react module,why?

qq332769043 commented 7 years ago

@jjykh why I can't use third-party react module,the window of ide is blank at all with no respose?

IceFireg commented 7 years ago

@jiangzidong 恩,好的。如果下次出现问题,我把这几个文件发给你。

qq332769043 commented 7 years ago

@jjykh this is my demo.jsx: http://ofe3bo0re.bkt.clouddn.com/2.png Is there any problems to make the window of ide to be blank at all with no respose? qrcode.react:https://github.com/zpao/qrcode.react

qq332769043 commented 7 years ago

@jjykh 。。。。。。

jjykh commented 7 years ago

@qq332769043 If you are working on master branch, you cannot require third-party npm module for widget. because the requiring procedure is processed by browserify in build script only on dev branch. BTW, React was exported as global variable in iotsol, so you needn't require yourself.

If you want to include third-party source code, you should copy the pure javascript code to your widget directory, iotsol will insert the javascript code in HTML.

I think you can try to add your widget into ui-widgets on dev branch, then run gulp build ui-widgets module, and ui-dev, ui-user.

jjykh commented 7 years ago

@qq332769043 To add widget on dev branch, please refer to Liquid Gauge Widget

qq332769043 commented 7 years ago

@jjykh but when I run "gulp build" it show that no gulpfile found

jjykh commented 7 years ago

@qq332769043 run git checkout dev switch to dev branch.

qq332769043 commented 7 years ago

@jiangzidong @jjykh Thank you.