You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@edgent.apache.org by Alex-Cook4 <gi...@git.apache.org> on 2016/04/26 00:47:40 UTC

[GitHub] incubator-quarks pull request: Quarks IoTF RangeSensor Sample

GitHub user Alex-Cook4 opened a pull request:

    https://github.com/apache/incubator-quarks/pull/98

    Quarks IoTF RangeSensor Sample 

    I have put together a sensor application that uses PI4J libraries to control a Proximity sensor HC-SR04 and LED and work through Watson IoT. 
    
    This sample is based off of the IotfSensor sample, but uses real sensors. Since it depends on Pi4J libraries, I have updated the build files so that this sample only builds if there is a PI4J_LIB environment variable present. 
    
    The full outline of this sensor application on a Pi is (I have bolded the main differences to the IotfSensor sample): 
    
    **RangeSensor** -> Quarks Analytics (only send to IoTF in case of **close proximity average**) -> Watson IoT -> IBM Streams IoTF Sample -> Send command back to IoTF -> to Quarks on Pi -> **Light up LED to say we have received the command** 
    
    This is my first commit to Quarks, so please let me know if I'm doing anything wrong or if I should be pointed to some specific docs. Thanks! 
    
    Also, thank you to @dlaboss and @ddebrunner for helping me figure out how to get the build working correctly. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Alex-Cook4/incubator-quarks master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-quarks/pull/98.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #98
    
----
commit 21a1dff8ce83594e10d6a43472c5b868c3a1a12e
Author: streamsadmin <st...@localhost>
Date:   2016-04-11T21:53:43Z

    Initial commit with build failing still.

commit 1dc1cbc9786db5bd1b9b8bbfca4ea9d5211f3003
Author: streamsadmin <st...@localhost>
Date:   2016-04-11T23:40:44Z

    Almost there...build still failing because of javadoc issue.

commit 9efe13eeeaa6dcc0280826b6301dbee9ed8b1d28
Author: streamsadmin <st...@localhost>
Date:   2016-04-13T19:07:05Z

    Better package name.

commit 004788463dac6fc51a6c897992ccdbf1a9e3d814
Author: Alex-Cook4 <co...@us.ibm.com>
Date:   2016-04-13T20:18:23Z

    Merge pull request #1 from apache/master
    
    Get master updates.

commit 50a19619f9a7e646d4d517ce3c65aba442d2a7aa
Author: streamsadmin <st...@localhost>
Date:   2016-04-18T20:51:21Z

    Fix Javadoc classpath.

commit 102afe7df459e6a7ab9b96c8c2373c79325bd4a7
Author: streamsadmin <st...@localhost>
Date:   2016-04-18T20:52:28Z

    Merge branch 'master' of https://github.com/Alex-Cook4/incubator-quarks.git

commit 0a79b434284fd05ed84c69e1ca8c013b0dda63d6
Author: streamsadmin <st...@localhost>
Date:   2016-04-18T20:58:01Z

    Fix build.xml

commit a366c8e844c330defc86c2d4c31fe1ee1f0c2cce
Author: streamsadmin <st...@localhost>
Date:   2016-04-25T22:14:36Z

    Fixed build so that no javadoc errors occur
    
    Made it so that we exclude building the range sensor classes unless
    environment variable PI4J_LIB is set.

commit 59ff2da7eeccf79d69d41890916e1f435762844d
Author: streamsadmin <st...@localhost>
Date:   2016-04-25T22:30:24Z

    Documentation on running the sample

commit 51ca8ebace4ad326955b03e824e737d93b7b316d
Author: alex-cook4 <al...@localhost>
Date:   2016-04-25T22:35:50Z

    Update README to look better.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quarks pull request: Quarks IoTF RangeSensor Sample

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-quarks/pull/98


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quarks pull request: Quarks IoTF RangeSensor Sample

Posted by dlaboss <gi...@git.apache.org>.
Github user dlaboss commented on a diff in the pull request:

    https://github.com/apache/incubator-quarks/pull/98#discussion_r61129034
  
    --- Diff: samples/scenarios/src/main/java/quarks/samples/scenarios/iotf/range/sensor/IotfRangeSensor.java ---
    @@ -0,0 +1,192 @@
    +package quarks.samples.scenarios.iotf.range.sensor;
    +
    +import static quarks.analytics.math3.stat.Statistic.MAX;
    +import static quarks.analytics.math3.stat.Statistic.MEAN;
    +import static quarks.analytics.math3.stat.Statistic.MIN;
    +import static quarks.analytics.math3.stat.Statistic.STDDEV;
    +
    +import java.io.File;
    +import java.util.Date;
    +import java.util.Random;
    +import java.util.concurrent.TimeUnit;
    +
    +import com.google.gson.JsonElement;
    +import com.google.gson.JsonObject;
    +import com.pi4j.io.gpio.Pin;
    +import com.pi4j.io.gpio.RaspiPin;
    +
    +import quarks.analytics.math3.json.JsonAnalytics;
    +import quarks.connectors.iot.IotDevice;
    +import quarks.connectors.iot.QoS;
    +import quarks.connectors.iotf.IotfDevice;
    +import quarks.function.Supplier;
    +import quarks.providers.direct.DirectProvider;
    +import quarks.providers.direct.DirectTopology;
    +import quarks.topology.TStream;
    +import quarks.topology.TWindow;
    +
    +public class IotfRangeSensor {
    --- End diff --
    
    This is a new file so can the indenting be made consistent within it wrt use of spaces vs tabs?  Things aren't lining up.  Note, as recently noted in DEVELOPMENT.md, the desire is no hard tabs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quarks pull request: Quarks IoTF RangeSensor Sample

Posted by Alex-Cook4 <gi...@git.apache.org>.
Github user Alex-Cook4 commented on a diff in the pull request:

    https://github.com/apache/incubator-quarks/pull/98#discussion_r61142958
  
    --- Diff: samples/scenarios/src/main/java/quarks/samples/scenarios/iotf/range/sensor/IotfRangeSensor.java ---
    @@ -0,0 +1,192 @@
    +package quarks.samples.scenarios.iotf.range.sensor;
    +
    +import static quarks.analytics.math3.stat.Statistic.MAX;
    +import static quarks.analytics.math3.stat.Statistic.MEAN;
    +import static quarks.analytics.math3.stat.Statistic.MIN;
    +import static quarks.analytics.math3.stat.Statistic.STDDEV;
    +
    +import java.io.File;
    +import java.util.Date;
    +import java.util.Random;
    +import java.util.concurrent.TimeUnit;
    +
    +import com.google.gson.JsonElement;
    +import com.google.gson.JsonObject;
    +import com.pi4j.io.gpio.Pin;
    +import com.pi4j.io.gpio.RaspiPin;
    +
    +import quarks.analytics.math3.json.JsonAnalytics;
    +import quarks.connectors.iot.IotDevice;
    +import quarks.connectors.iot.QoS;
    +import quarks.connectors.iotf.IotfDevice;
    +import quarks.function.Supplier;
    +import quarks.providers.direct.DirectProvider;
    +import quarks.providers.direct.DirectTopology;
    +import quarks.topology.TStream;
    +import quarks.topology.TWindow;
    +
    +public class IotfRangeSensor {
    --- End diff --
    
    I have fixed all the tabs to be spaces. Thanks for pointing that out. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quarks pull request: Quarks IoTF RangeSensor Sample

Posted by dlaboss <gi...@git.apache.org>.
Github user dlaboss commented on a diff in the pull request:

    https://github.com/apache/incubator-quarks/pull/98#discussion_r61127189
  
    --- Diff: build.xml ---
    @@ -293,14 +293,16 @@
           additionalparam="-Xdoclint:none"
           Overview="quarks_overview.html"
           failonwarning="true"
    -      excludepackagenames="quarks.connectors.runtime,quarks.connectors.*.runtime,quarks.console.*,quarks.topology.spi.*,quarks.graph.spi.*"
    +      excludepackagenames="quarks.connectors.runtime,quarks.connectors.*.runtime,quarks.console.*,quarks.topology.spi.*,quarks.graph.spi.*,quarks.samples.scenarios.iotf.range.sensor"
           >
    -      <sourcepath>
    -         <dirset dir="${basedir}">
    -           <include name="*/*/src/main/java"/>
    -           <exclude name="android/**"/>
    -         </dirset>
    -      </sourcepath>
    +  	
    +    <sourcepath>
    --- End diff --
    
    looks like indentation was inadvertently changed?  if so, please revert it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quarks pull request: Quarks IoTF RangeSensor Sample

Posted by Alex-Cook4 <gi...@git.apache.org>.
Github user Alex-Cook4 commented on a diff in the pull request:

    https://github.com/apache/incubator-quarks/pull/98#discussion_r61142848
  
    --- Diff: samples/scenarios/src/main/java/quarks/samples/scenarios/iotf/range/sensor/IotfRangeSensor.java ---
    @@ -0,0 +1,192 @@
    +package quarks.samples.scenarios.iotf.range.sensor;
    --- End diff --
    
    Thanks. Added the Apache license headers. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quarks pull request: Quarks IoTF RangeSensor Sample

Posted by dlaboss <gi...@git.apache.org>.
Github user dlaboss commented on a diff in the pull request:

    https://github.com/apache/incubator-quarks/pull/98#discussion_r61127604
  
    --- Diff: samples/scenarios/src/main/java/quarks/samples/scenarios/iotf/range/sensor/IotfRangeSensor.java ---
    @@ -0,0 +1,192 @@
    +package quarks.samples.scenarios.iotf.range.sensor;
    --- End diff --
    
    missing Apache license header.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---