Skip to content

Commit

Permalink
数据采集 v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoCai committed May 4, 2017
1 parent 2127903 commit e68eed9
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 56 deletions.
2 changes: 1 addition & 1 deletion detection_unused/detection_unused.iml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="module" module-name="publiclibs" exported="" />
</component>
Expand Down
8 changes: 4 additions & 4 deletions multi_sensor_collector/multi_sensor_collector.iml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="sdk-v1.0.0" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
<orderEntry type="library" exported="" name="design-23.1.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
<orderEntry type="library" exported="" name="sdk-v1.0.0" level="project" />
<orderEntry type="library" exported="" name="accessory-v2.3.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
<orderEntry type="library" exported="" name="design-23.1.1" level="project" />
<orderEntry type="module" module-name="publiclibs" exported="" />
</component>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.leocai.publiclibs.multidecicealign.BleClient;
import com.leocai.publiclibs.multidecicealign.FileInitCallBack;
import com.leocai.publiclibs.multidecicealign.MySensorManager;
import com.leocai.publiclibs.multidecicealign.SensorGlobalWriter;
import com.leocai.publiclibs.multidecicealign.SensorSokectWriter;
import com.leocai.publiclibs.multidecicealign.StartCallBack;
import com.leocai.publiclibs.multidecicealign.StopCallBack;
Expand Down Expand Up @@ -132,7 +133,8 @@ public void onClick(View v) {
break;
case STARTING:
bleServer.sendStopCommands();
((Button) v).setText("INIT FILE");
((Button) v).setText("Need Reset");
((Button) v).setEnabled(false);
currentState = STOPPED;
etFileName.setEnabled(true);
break;
Expand Down Expand Up @@ -160,7 +162,7 @@ public void onClick(View v) {
btnStart.setEnabled(false);
btnClient.setEnabled(false);
mySensorManager = new MySensorManager(BleSyncActivity.this);
mySensorManager.setGlobalWriter(new SensorSokectWriter());
mySensorManager.setGlobalWriter(new SensorGlobalWriter());
frequency = Integer.parseInt(edt_frequency.getText().toString());
saveFrequncy(frequency);
mySensorManager.setFrequency(frequency);
Expand Down
2 changes: 1 addition & 1 deletion publiclibs/publiclibs.iml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="spacesync" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
</component>
</module>
46 changes: 23 additions & 23 deletions publiclibs/src/main/java/com/leocai/publiclibs/ShakingData.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ public double[] getLinearAccData() {

public void setLinearAccData(double[] linearAccData) {
this.linearAccData = linearAccData;
if (linearAccData == null) return;
this.resultantAccData = Math.sqrt(Math.pow(linearAccData[0], 2)
+ Math.pow(linearAccData[1], 2)
+ Math.pow(linearAccData[2], 2));
// if (linearAccData == null) return;
// this.resultantAccData = Math.sqrt(Math.pow(linearAccData[0], 2)
// + Math.pow(linearAccData[1], 2)
// + Math.pow(linearAccData[2], 2));
}

public double[] getGyrData() {
Expand Down Expand Up @@ -338,15 +338,15 @@ public String getCSVHead() {
info.append(i);
info.append(",");
}
for (int i = 0; i < 3; i++) {
info.append("ConvertedData");
info.append(i);
info.append(",");
}
info.append("ResultantAcc");
info.append(",");
info.append("Timestamp");
info.append(",");
// for (int i = 0; i < 3; i++) {
// info.append("ConvertedData");
// info.append(i);
// info.append(",");
// }
// info.append("ResultantAcc");
// info.append(",");
// info.append("Timestamp");
// info.append(",");
info.append("dt");
info.append("\n");
return info.toString();
Expand Down Expand Up @@ -379,16 +379,16 @@ public String getCSV() {
info.append(this.magnetData[i]);
info.append(",");
}
for (int i = 0; i < 3; i++) {
if(convertedData!=null)
info.append(this.convertedData[i]);
info.append(",");
}
info.append(resultantAccData);
info.append(",");
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
info.append(sdf.format(new Date(timeStamp)));
info.append(",");
// for (int i = 0; i < 3; i++) {
// if(convertedData!=null)
// info.append(this.convertedData[i]);
// info.append(",");
// }
// info.append(resultantAccData);
// info.append(",");
// SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
// info.append(sdf.format(new Date(timeStamp)));
// info.append(",");
info.append(dt);
info.append("\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void run() {
while (!stop) {
if (cuShakingData.getLinearAccData() == null) continue;
// Log.d(TAG,"dection");
cuShakingData.transform();
// cuShakingData.transform();
notifyObservers(cuShakingData);
setChanged();
try {
Expand Down Expand Up @@ -115,7 +115,7 @@ public void onSensorChanged(SensorEvent event) {
Sensor sensor = event.sensor;
if (sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
cuShakingData.setAccData(new double[]{event.values[0],event.values[1],event.values[2]});
cuShakingData.setTimeStamp(new Date().getTime());
// cuShakingData.setTimeStamp(new Date().getTime());
if (preTimestamp != 0)
cuShakingData.setDt(1.0 * (event.timestamp - preTimestamp) / 1000000000);
preTimestamp = event.timestamp;
Expand Down
36 changes: 18 additions & 18 deletions unsued1/unsued1.iml
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,31 @@
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="play-services-vision-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-identity-7.8.0" level="project" />
<orderEntry type="library" exported="" name="mediarouter-v7-22.2.0" level="project" />
<orderEntry type="library" exported="" name="play-services-cast-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-games-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-wallet-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-drive-7.8.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-location-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-nearby-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-ads-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-panorama-7.8.0" level="project" />
<orderEntry type="library" exported="" name="mediarouter-v7-22.2.0" level="project" />
<orderEntry type="library" exported="" name="play-services-safetynet-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-analytics-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-base-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-appindexing-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-appinvite-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-plus-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-safetynet-7.8.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-appindexing-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-base-7.8.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-fitness-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-gcm-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-games-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-cast-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-wearable-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-wallet-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-vision-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-nearby-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-location-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-appstate-7.8.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-wearable-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-identity-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-panorama-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-plus-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-maps-7.8.0" level="project" />
</component>
</module>
4 changes: 2 additions & 2 deletions wear_depracated/wear_depracated.iml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="play-services-wearable-7.8.0" level="project" />
<orderEntry type="library" exported="" name="play-services-base-7.8.0" level="project" />
<orderEntry type="library" exported="" name="wearable-1.3.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-22.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-7.8.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="module" module-name="publiclibs" exported="" />
</component>
Expand Down
6 changes: 3 additions & 3 deletions weardata_depracated/weardata_depracated.iml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="play-services-base-8.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-8.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-wearable-8.4.0" level="project" />
<orderEntry type="library" exported="" name="wearable-1.3.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-22.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-8.4.0" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-8.4.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="module" module-name="publiclibs" exported="" />
</component>
Expand Down

0 comments on commit e68eed9

Please sign in to comment.