ThingWorx : 1、建立Thing
阿新 • • 發佈:2019-02-19
1. 開啟Thingworx的Composer
2. 新建Thing
1. 新建ThingTemplate
2. 選擇Thing Template 為GenericThing
3. 儲存Thing Template
4. 建立Properties,建立一個型別為NUMBER的引數,名叫hrv
5. 建立一個型別為location,名叫myLocation的引數
6. 儲存Properties
3. 修改Services
1. 新建一個service名叫eHealthService
2. 建立三個變數
STRING 的 heartBeat
STRING 的latitude
STRING 的longitude
3. 修改伺服器的JSP程式碼
程式碼如下
me.hrv = parseFloat(heartBeat);
var douLong = parseFloat(longitude);
var douLat = parseFloat(latitude);
var intLong = parseInt((douLong/100));
var intLat = parseInt((douLat/100 ));
var fenLong = intLong+(douLong%100)/60;
var fenLat = intLat+(douLat%100)/60;
me.location = (fenLong)+","+(fenLat);
var params = {
infoTableName : "InfoTable",
dataShapeName : "eHealthDatShape"
};
var result = Resources["InfoTableFunctions" ].CreateInfoTableFromDataShape(params);
var row = new Object()
row.hrv = me.hrv;
result.AddRow(row);
4. 測試Service的設定和JSP程式碼是否正確
填寫測試引數
測試結果如下