This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Serial mPc(USBTX, USBRX); | |
Timer mTimer; | |
AnalogIn inSen1(dp13); | |
AnalogIn inSen2(dp11); | |
AnalogIn inSen3(dp10); | |
AnalogIn inSen4(dp9 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float fSen = inSen1; | |
iSen = int(fSen * 1000); | |
char buff[]="0000"; | |
string sPut="put_dat="; | |
sPut += conv_zeroStr(MC_ID ,4); | |
sprintf(buff, "%d", iSen); | |
mPc.printf("%s\n", sPut.c_str() ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
ser=serial.Serial(mDevice ,9600) | |
clsParam = com_getparam.getparamClass() | |
clsCom = com_func.funcClass() | |
clsParse =com_putParse.putParseClass() | |
clsLog = com_logging2.loggingClass() | |
from datetime import datetime | |
tmBef = datetime.now() | |
while True: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
headers = { | |
"X-Parse-Application-Id": clsConst.mParse_APP_ID , | |
"X-Parse-REST-API-Key": clsConst.mParse_REST_ID , | |
"Content-Type": "application/json" | |
} | |
dtParam ={'mc_id': int(dict["mc_id"]) } | |
dtParam["snum1"] = int(dict["snum_1"]) | |
dtParam["snum2"] = int(dict["snum_2"]) | |
dtParam["snum3"] = int(dict["snum_3"]) | |
dtParam["snum4"] = int(dict["snum_4"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onload = function() { | |
Parse.initialize(mAPP_ID, mJS_KEY); | |
var TodoModel = Parse.Object.extend({ | |
className: mClassName | |
}); | |
$('#id-font-mcid').text(mMC_ID); | |
var senApp = new SensorApp( ); | |
senApp.proc_start_prog(); | |
senApp.init_proc(TodoModel); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SensorApp.prototype.init_proc = function ( model ) { | |
var parent_app=this; | |
var query = new Parse.Query( model ); | |
var sDate = this.get_nowDate(); | |
var nBef =parseInt(sDate); | |
query.equalTo("mc_id", mMC_ID); | |
query.greaterThan("dtnum", nBef); | |
query.limit(300); | |
query.find({ | |
success: function(todos) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.kuc_arc_f.agripush" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> | |
<uses-permission android:name="android.permission.VIBRATE" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void init_proc(){ | |
try | |
{ | |
final ParseQuery<ParseObject> query = ParseQuery.getQuery("SenObject1"); | |
query.orderByDescending("dtnum"); | |
query.setLimit( 1 ); | |
query.findInBackground(new FindCallback<ParseObject>() { | |
public void done(List<ParseObject> senList, ParseException e) { | |
if (e == null) { | |
ArrayList lst = new ArrayList<ItemSensor>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
ser=serial.Serial(mDevice ,9600) | |
clsConst = com_appConst.appConstClass() | |
clsParam = com_getparam.getparamClass() | |
clsCom = com_func.funcClass() | |
clsParse =com_putParse.putParseClass() | |
clsLog = com_logging2.loggingClass() | |
clsPush =com_parsePush.parsePushClass() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
headers = { | |
"X-Parse-Application-Id": clsConst.mParse_APP_ID , | |
"X-Parse-REST-API-Key": clsConst.mParse_REST_ID , | |
"Content-Type": "application/json" | |
} | |
from datetime import datetime | |
sTime = datetime.now().strftime("%m-%d %H:%M") | |
nMc = int(dict["mc_id"]) | |
sMsg="Water require, MC="+ str(nMc) + " [" +sTime+ "]" |