• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DataSourceType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.md2k.datakitapi.source.datasource.DataSourceType的典型用法代码示例。如果您正苦于以下问题:Java DataSourceType类的具体用法?Java DataSourceType怎么用?Java DataSourceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataSourceType类属于org.md2k.datakitapi.source.datasource包,在下文中一共展示了DataSourceType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createDataSourceTypeTOChannel

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
protected void createDataSourceTypeTOChannel() {
    dataSourceTypeTOChannel = new HashMap<>();
    dataSourceTypeTOChannel.put(DataSourceType.RESPIRATION, AUTOSENSE.CHEST_RIP);
    dataSourceTypeTOChannel.put(DataSourceType.ECG, AUTOSENSE.CHEST_ECG);
    dataSourceTypeTOChannel.put(DataSourceType.ACCELEROMETER_X, AUTOSENSE.CHEST_ACCEL_X);
    dataSourceTypeTOChannel.put(DataSourceType.ACCELEROMETER_Y, AUTOSENSE.CHEST_ACCEL_Y);
    dataSourceTypeTOChannel.put(DataSourceType.ACCELEROMETER_Z, AUTOSENSE.CHEST_ACCEL_Z);

    dataSourceTypeTOChannel.put(PlatformId.LEFT_WRIST + "_" + DataSourceType.ACCELEROMETER_X, PUFFMARKER.LEFTWRIST_ACCEL_X);
    dataSourceTypeTOChannel.put(PlatformId.RIGHT_WRIST + "_" + DataSourceType.ACCELEROMETER_X, PUFFMARKER.RIGHTWRIST_ACCEL_X);
    dataSourceTypeTOChannel.put(PlatformId.LEFT_WRIST + "_" + DataSourceType.ACCELEROMETER_Y, PUFFMARKER.LEFTWRIST_ACCEL_Y);
    dataSourceTypeTOChannel.put(PlatformId.RIGHT_WRIST + "_" + DataSourceType.ACCELEROMETER_Y, PUFFMARKER.RIGHTWRIST_ACCEL_Y);
    dataSourceTypeTOChannel.put(PlatformId.LEFT_WRIST + "_" + DataSourceType.ACCELEROMETER_Z, PUFFMARKER.LEFTWRIST_ACCEL_Z);
    dataSourceTypeTOChannel.put(PlatformId.RIGHT_WRIST + "_" + DataSourceType.ACCELEROMETER_Z, PUFFMARKER.RIGHTWRIST_ACCEL_Z);

    dataSourceTypeTOChannel.put(PlatformId.LEFT_WRIST + "_" + DataSourceType.GYROSCOPE_X, PUFFMARKER.LEFTWRIST_GYRO_X);
    dataSourceTypeTOChannel.put(PlatformId.RIGHT_WRIST + "_" + DataSourceType.GYROSCOPE_X, PUFFMARKER.RIGHTWRIST_GYRO_X);
    dataSourceTypeTOChannel.put(PlatformId.LEFT_WRIST + "_" + DataSourceType.GYROSCOPE_Y, PUFFMARKER.LEFTWRIST_GYRO_Y);
    dataSourceTypeTOChannel.put(PlatformId.RIGHT_WRIST + "_" + DataSourceType.GYROSCOPE_Y, PUFFMARKER.RIGHTWRIST_GYRO_Y);
    dataSourceTypeTOChannel.put(PlatformId.LEFT_WRIST + "_" + DataSourceType.GYROSCOPE_Z, PUFFMARKER.LEFTWRIST_GYRO_Z);
    dataSourceTypeTOChannel.put(PlatformId.RIGHT_WRIST + "_" + DataSourceType.GYROSCOPE_Z, PUFFMARKER.RIGHTWRIST_GYRO_Z);

}
 
开发者ID:MD2Korg,项目名称:mCerebrum-StreamProcessor,代码行数:24,代码来源:DataKitManager.java


示例2: readWakeupTimeFromDataKit

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private void readWakeupTimeFromDataKit() {
    DataKitAPI dataKitAPI = DataKitAPI.getInstance(modelManager.getContext());
    wakeupOffset = -1;
    try {
        ArrayList<DataSourceClient> dataSourceClients = dataKitAPI.find(new DataSourceBuilder().setType(DataSourceType.WAKEUP));
        if (dataSourceClients.size() > 0) {
            ArrayList<DataType> dataTypes = dataKitAPI.query(dataSourceClients.get(0), 1);
            if (dataTypes.size() != 0) {
                DataTypeLong dataTypeLong = (DataTypeLong) dataTypes.get(0);
                wakeupOffset = dataTypeLong.getSample();
            }
        }
    } catch (Exception ignored) {

    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:17,代码来源:DayStartEndInfoManager.java


示例3: readSleepTimeFromDataKit

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private void readSleepTimeFromDataKit() {
    DataKitAPI dataKitAPI = DataKitAPI.getInstance(modelManager.getContext());
    sleepOffset = -1;
    try {
        ArrayList<DataSourceClient> dataSourceClients = dataKitAPI.find(new DataSourceBuilder().setType(DataSourceType.SLEEP));
        if (dataSourceClients.size() > 0) {
            ArrayList<DataType> dataTypes = dataKitAPI.query(dataSourceClients.get(0), 1);
            if (dataTypes.size() != 0) {
                DataTypeLong dataTypeLong = (DataTypeLong) dataTypes.get(0);
                sleepOffset = dataTypeLong.getSample();
            }
        }
    } catch (DataKitException e) {
        LocalBroadcastManager.getInstance(modelManager.getContext()).sendBroadcast(new Intent(Constants.INTENT_RESTART));
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:17,代码来源:DayStartEndInfoManager.java


示例4: createDataSourceBuilderDayStart

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private DataSourceBuilder createDataSourceBuilderDayStart() {
    Platform platform = new PlatformBuilder().setType(PlatformType.PHONE).build();
    DataSourceBuilder dataSourceBuilder = new DataSourceBuilder().setType(DataSourceType.DAY_START).setPlatform(platform);
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.NAME, "Day Start");
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.DESCRIPTION, "Represents when day started");
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.DATA_TYPE, DataTypeLong.class.getName());
    ArrayList<HashMap<String, String>> dataDescriptors = new ArrayList<>();
    HashMap<String, String> dataDescriptor = new HashMap<>();
    dataDescriptor.put(METADATA.NAME, "Day Start");
    dataDescriptor.put(METADATA.MIN_VALUE, String.valueOf(0));
    dataDescriptor.put(METADATA.MAX_VALUE, String.valueOf(Long.MAX_VALUE));
    dataDescriptor.put(METADATA.UNIT, "millisecond");
    dataDescriptor.put(METADATA.DESCRIPTION, "Contains day start time in millisecond");
    dataDescriptor.put(METADATA.DATA_TYPE, long.class.getName());
    dataDescriptors.add(dataDescriptor);
    dataSourceBuilder = dataSourceBuilder.setDataDescriptors(dataDescriptors);
    return dataSourceBuilder;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:19,代码来源:DayStartEndInfoManager.java


示例5: createDataSourceBuilderDayEnd

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private DataSourceBuilder createDataSourceBuilderDayEnd() {
    Platform platform = new PlatformBuilder().setType(PlatformType.PHONE).build();
    DataSourceBuilder dataSourceBuilder = new DataSourceBuilder().setType(DataSourceType.DAY_END).setPlatform(platform);
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.NAME, "Day End");
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.DESCRIPTION, "Represents when day ended");
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.DATA_TYPE, DataTypeLong.class.getName());
    ArrayList<HashMap<String, String>> dataDescriptors = new ArrayList<>();
    HashMap<String, String> dataDescriptor = new HashMap<>();
    dataDescriptor.put(METADATA.NAME, "Day End");
    dataDescriptor.put(METADATA.MIN_VALUE, String.valueOf(0));
    dataDescriptor.put(METADATA.MAX_VALUE, String.valueOf(Long.MAX_VALUE));
    dataDescriptor.put(METADATA.UNIT, "millisecond");
    dataDescriptor.put(METADATA.DESCRIPTION, "Contains day end time in millisecond");
    dataDescriptor.put(METADATA.DATA_TYPE, long.class.getName());
    dataDescriptors.add(dataDescriptor);
    dataSourceBuilder = dataSourceBuilder.setDataDescriptors(dataDescriptors);
    return dataSourceBuilder;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:19,代码来源:DayStartEndInfoManager.java


示例6: run

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
@Override
public void run() {
    try {
        Log.d(TAG, "runnableSubscribeResponse...run()");
        Application application = new ApplicationBuilder().setId("org.md2k.notificationmanager").build();
        DataSourceBuilder dataSourceBuilder = new DataSourceBuilder().setType(DataSourceType.NOTIFICATION_RESPONSE).setApplication(application);
        dataSourceClientResponses = DataKitAPI.getInstance(context).find(dataSourceBuilder);
        Log.d(TAG, "DataSourceClients...size=" + dataSourceClientResponses.size());
        if (dataSourceClientResponses.size() == 0) {
            handlerSubscribeResponse.postDelayed(this, 1000);
        } else {
            subscribeNotificationResponse();
            handlerSubscribeAck.post(runnableSubscribeAcknowledge);
        }
    } catch (DataKitException e) {
        LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(Constants.INTENT_RESTART));
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:19,代码来源:NotifierManager.java


示例7: createDataSourceBuilderStudyStart

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private DataSourceBuilder createDataSourceBuilderStudyStart() {
    Platform platform = new PlatformBuilder().setType(PlatformType.PHONE).build();
    DataSourceBuilder dataSourceBuilder = new DataSourceBuilder().setType(DataSourceType.STUDY_START).setPlatform(platform);
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.NAME, "Study Start");
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.DESCRIPTION, "Represents when study started");
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.DATA_TYPE, DataTypeLong.class.getName());
    ArrayList<HashMap<String, String>> dataDescriptors = new ArrayList<>();
    HashMap<String, String> dataDescriptor = new HashMap<>();
    dataDescriptor.put(METADATA.NAME, "Study Start");
    dataDescriptor.put(METADATA.MIN_VALUE, String.valueOf(0));
    dataDescriptor.put(METADATA.MAX_VALUE, String.valueOf(Long.MAX_VALUE));
    dataDescriptor.put(METADATA.UNIT, "millisecond");
    dataDescriptor.put(METADATA.DESCRIPTION, "Contains study start time in millisecond");
    dataDescriptor.put(METADATA.DATA_TYPE, long.class.getName());
    dataDescriptors.add(dataDescriptor);
    dataSourceBuilder = dataSourceBuilder.setDataDescriptors(dataDescriptors);
    return dataSourceBuilder;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:19,代码来源:StudyStartEndInfoManager.java


示例8: createDataSourceBuilderStudyEnd

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private DataSourceBuilder createDataSourceBuilderStudyEnd() {
    Platform platform = new PlatformBuilder().setType(PlatformType.PHONE).build();
    DataSourceBuilder dataSourceBuilder = new DataSourceBuilder().setType(DataSourceType.STUDY_END).setPlatform(platform);
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.NAME, "Study End");
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.DESCRIPTION, "Represents when study ended");
    dataSourceBuilder = dataSourceBuilder.setMetadata(METADATA.DATA_TYPE, DataTypeLong.class.getName());
    ArrayList<HashMap<String, String>> dataDescriptors = new ArrayList<>();
    HashMap<String, String> dataDescriptor = new HashMap<>();
    dataDescriptor.put(METADATA.NAME, "Study End");
    dataDescriptor.put(METADATA.MIN_VALUE, String.valueOf(0));
    dataDescriptor.put(METADATA.MAX_VALUE, String.valueOf(Long.MAX_VALUE));
    dataDescriptor.put(METADATA.UNIT, "millisecond");
    dataDescriptor.put(METADATA.DESCRIPTION, "Contains study end time in millisecond");
    dataDescriptor.put(METADATA.DATA_TYPE, long.class.getName());
    dataDescriptors.add(dataDescriptor);
    dataSourceBuilder = dataSourceBuilder.setDataDescriptors(dataDescriptors);
    return dataSourceBuilder;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:19,代码来源:StudyStartEndInfoManager.java


示例9: setConfigDataQualityView

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
void setConfigDataQualityView(ArrayList<ConfigDataQualityView> configDataQualityViews, DataSource dataSource) {
    for(int i=0;i<configDataQualityViews.size();i++){
        DataSource confDataSource=configDataQualityViews.get(i).getPlotter().getDatasource();
        if(confDataSource.getType().equals(DataSourceType.RESPIRATION) && confDataSource.getType().equals(dataSource.getId())) {
            configDataQualityView = configDataQualityViews.get(i);
            return;
        }
        if(confDataSource.getType().equals(DataSourceType.ECG) && confDataSource.getType().equals(dataSource.getId())) {
            configDataQualityView = configDataQualityViews.get(i);
            return;
        }
        if(confDataSource.getPlatform()==null || confDataSource.getPlatform().getId()==null || confDataSource.getPlatform().getType()==null) {
        }
        else if(confDataSource.getPlatform().getType().equals(dataSource.getPlatform().getType()) && confDataSource.getPlatform().getId().equals(dataSource.getPlatform().getId())) {
            configDataQualityView = configDataQualityViews.get(i);
            return;
        }
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-Study,代码行数:20,代码来源:DataQualityInfo.java


示例10: getSharedPreference

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private void getSharedPreference() {
    MySharedPreference mySharedPreference = MySharedPreference.getInstance(getActivity());
    String deviceId = mySharedPreference.getSharedPreferenceString("deviceId");
    MicrosoftBand microsoftBand = microsoftBands.find(deviceId);
    microsoftBand.platformId = mySharedPreference.getSharedPreferenceString("platformId");
    microsoftBand.enabled = true;

    for (int i = 0; i < microsoftBand.getSensors().size(); i++) {
        String dataSourceType = microsoftBand.getSensors().get(i).getDataSourceType();
        microsoftBand.getSensors().get(i).setEnabled(mySharedPreference.getSharedPreferenceBoolean(dataSourceType));
        if (dataSourceType.equals(DataSourceType.ACCELEROMETER) || dataSourceType.equals(DataSourceType.GYROSCOPE)) {
            String frequency = mySharedPreference.getSharedPreferenceString(dataSourceType + "_frequency");
            microsoftBand.getSensors().get(i).setFrequency(frequency);
        }
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-MicrosoftBand,代码行数:17,代码来源:PrefsFragmentMicrosoftBandSettings.java


示例11: onSharedPreferenceChanged

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
    switch (key) {
        case "platformId":
            findPreference("platformId").setSummary(getLocationSummary(mySharedPreference.getSharedPreferenceString("platformId")));
            ListPreference lpLocation = (ListPreference) findPreference("platformId");
            lpLocation.setValue(mySharedPreference.getSharedPreferenceString("platformId"));
            updateDefaultConfiguration();
            break;
        case DataSourceType.ACCELEROMETER + "_frequency":
            findPreference(DataSourceType.ACCELEROMETER).setSummary(mySharedPreference.getSharedPreferenceString(key) + " Hz");
            break;
        case DataSourceType.GYROSCOPE + "_frequency":
            findPreference(DataSourceType.GYROSCOPE).setSummary(mySharedPreference.getSharedPreferenceString(key) + " Hz");
            break;
        default:
            break;
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-MicrosoftBand,代码行数:20,代码来源:PrefsFragmentMicrosoftBandPlatformSettings.java


示例12: updatePreferenceScreen

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private void updatePreferenceScreen() {
    int versionFirmwareInt = getBandVersion();
    findPreference("platformName").setSummary(mySharedPreference.getSharedPreferenceString("platformName"));
    findPreference("deviceId").setSummary(mySharedPreference.getSharedPreferenceString("deviceId"));
    findPreference("platformId").setSummary(getLocationSummary(mySharedPreference.getSharedPreferenceString("platformId")));
    ListPreference lpLocation = (ListPreference) findPreference("platformId");
    lpLocation.setValue(mySharedPreference.getSharedPreferenceString("platformId"));
    MicrosoftBand microsoftBand = new MicrosoftBand(getActivity(), null, null);

    for (int i = 0; i < microsoftBand.getSensors().size(); i++) {
        String dataSourceType = microsoftBand.getSensors().get(i).getDataSourceType();
        ((SwitchPreference) findPreference(dataSourceType)).setChecked(mySharedPreference.getSharedPreferenceBoolean(dataSourceType));
        if (microsoftBand.getSensors().get(i).getVersion() > versionFirmwareInt)
            findPreference(dataSourceType).setEnabled(false);
        else
            findPreference(dataSourceType).setEnabled(true);
        if (dataSourceType.equals(DataSourceType.ACCELEROMETER) || dataSourceType.equals(DataSourceType.GYROSCOPE)) {
            findPreference(dataSourceType).setSummary(mySharedPreference.getSharedPreferenceString(dataSourceType + "_frequency") + " Hz");
            findPreference(dataSourceType).setDefaultValue(mySharedPreference.getSharedPreferenceString(dataSourceType + "_frequency"));
        }
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-MicrosoftBand,代码行数:23,代码来源:PrefsFragmentMicrosoftBandPlatformSettings.java


示例13: run

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
@Override
public void run() {
    Application application = new ApplicationBuilder().setId("org.md2k.notificationmanager").build();
    DataSourceBuilder dataSourceBuilder = new DataSourceBuilder().setType(DataSourceType.NOTIFICATION_REQUEST).setApplication(application);
    try {
        dataSourceClietNotificationRequests = DataKitAPI.getInstance(context).find(dataSourceBuilder);
        Log.d(TAG, "datasourceclient=" + dataSourceClietNotificationRequests.size());
        if (dataSourceClietNotificationRequests.size() == 0) {
            if (RERUN > 0) {
                RERUN--;
                handler.postDelayed(this, 1000);
            } else handler.postDelayed(this, 60000);
        } else {
            subscribe();
        }
    } catch (DataKitException e) {
        Intent intent = new Intent(Constants.INTENT_STOP);
        intent.putExtra("type", "NotificationManager.java...runnableSubscribe()");
        LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-MicrosoftBand,代码行数:22,代码来源:NotificationManager.java


示例14: getDataSourceType

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
public String getDataSourceType(byte[] ANTRxMessage) {
    byte mSequenceNumber = (byte) (ANTRxMessage[8] & 0x0F);
    switch (mSequenceNumber) {
        case NINE_AXIS_ACCL_X_CHANNEL:
            return DataSourceType.ACCELEROMETER_X;
        case NINE_AXIS_ACCL_Y_CHANNEL:
            return DataSourceType.ACCELEROMETER_Y;
        case NINE_AXIS_ACCL_Z_CHANNEL:
            return DataSourceType.ACCELEROMETER_Z;
        case NINE_AXIS_GYRO_X_CHANNEL:
            return DataSourceType.GYROSCOPE_X;
        case NINE_AXIS_GYRO_Y_CHANNEL:
            return DataSourceType.GYROSCOPE_Y;
        case NINE_AXIS_GYRO_Z_CHANNEL:
            return DataSourceType.GYROSCOPE_Z;
        default:
            return null;
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-AutoSense,代码行数:20,代码来源:DataExtractorWrist.java


示例15: AutoSensePlatformChest

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
public AutoSensePlatformChest(Context context, String platformType, String platformId, String deviceId) {
    super(context,platformType,platformId,deviceId, "AutoSense (Chest)");
    this.platformId= PlatformId.CHEST;
    dataQualities = new ArrayList<>();
    dataQualities.add(new DataQualityRIPVariance(context)); //WHY DOES THIS ORDER MATTER?
    dataQualities.add(new DataQualityRIP(context));
    dataQualities.add(new DataQualityECG(context));

    autoSenseDataSources=new ArrayList<>();
    for (int i=0;i<DATASOURCES.size();i++) {
        DATASOURCE datasource=DATASOURCES.get(i);
        if (datasource.dataSourceType.equals(DataSourceType.RESPIRATION))
            autoSenseDataSources.add(new AutoSenseDataSource(context, datasource.dataSourceType, datasource.name, datasource.frequency, -4096, 4096));
        else
            autoSenseDataSources.add(new AutoSenseDataSource(context, datasource.dataSourceType, datasource.name, datasource.frequency, 0, 4096));
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-AutoSense,代码行数:18,代码来源:AutoSensePlatformChest.java


示例16: AutoSensePlatformWrist

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
public AutoSensePlatformWrist(Context context, String platformType, String platformId, String deviceId) {
    super(context,platformType,platformId,deviceId, "AutoSense ()");
    this.name=platformId.toLowerCase();
    if("LEFT_WRIST".equals(platformId))
        this.name = "AutoSense (Left Wrist)";
    else if("RIGHT_WRIST".equals(platformId))
        this.name = "AutoSense (Right Wrist)";
    dataQualities = new ArrayList<>();
    dataQualities.add(new DataQualityACL(context));

    autoSenseDataSources=new ArrayList<>();
    for (DATASOURCE datasource : DATASOURCES) {
        if (datasource.dataSourceType.equals(DataSourceType.ACCELEROMETER_X) || datasource.dataSourceType.equals(DataSourceType.ACCELEROMETER_Y) || datasource.dataSourceType.equals(DataSourceType.ACCELEROMETER_Z) )
            autoSenseDataSources.add(new AutoSenseDataSource(context, datasource.dataSourceType, datasource.name, datasource.frequency, -2, 2));
        else if (datasource.dataSourceType.equals(DataSourceType.GYROSCOPE_X) || datasource.dataSourceType.equals(DataSourceType.GYROSCOPE_Y) || datasource.dataSourceType.equals(DataSourceType.GYROSCOPE_Z))
            autoSenseDataSources.add(new AutoSenseDataSource(context, datasource.dataSourceType, datasource.name, datasource.frequency, -250, 250));
    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-AutoSense,代码行数:19,代码来源:AutoSensePlatformWrist.java


示例17: unsubscribe

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private void unsubscribe(final String platformId) throws DataKitException {
    DataSourceClient dataSourceClientMBAccel = findDataSourceClient(PlatformType.MICROSOFT_BAND, platformId, DataSourceType.ACCELEROMETER);
    DataSourceClient dataSourceClientMBGyro = findDataSourceClient(PlatformType.MICROSOFT_BAND, platformId, DataSourceType.GYROSCOPE);

    DataSourceClient dataSourceClientMSAccel = findDataSourceClient(PlatformType.MOTION_SENSE, platformId, DataSourceType.ACCELEROMETER);
    DataSourceClient dataSourceClientMSGyro = findDataSourceClient(PlatformType.MOTION_SENSE, platformId, DataSourceType.GYROSCOPE);

    DataSourceClient dataSourceClientAW = findDataSourceClient(PlatformType.AUTOSENSE_WRIST, platformId, null);

    if (dataSourceClientMBAccel != null && dataSourceClientMBGyro != null) {
        dataKitAPI.unsubscribe(dataSourceClientMBAccel);
        dataKitAPI.unsubscribe(dataSourceClientMBGyro);

    } else if (dataSourceClientAW != null) {
        unsubscribe(PlatformType.AUTOSENSE_WRIST, platformId, DataSourceType.ACCELEROMETER_X);
        unsubscribe(PlatformType.AUTOSENSE_WRIST, platformId, DataSourceType.ACCELEROMETER_Y);
        unsubscribe(PlatformType.AUTOSENSE_WRIST, platformId, DataSourceType.ACCELEROMETER_Z);
        unsubscribe(PlatformType.AUTOSENSE_WRIST, platformId, DataSourceType.GYROSCOPE_X);
        unsubscribe(PlatformType.AUTOSENSE_WRIST, platformId, DataSourceType.GYROSCOPE_Y);
        unsubscribe(PlatformType.AUTOSENSE_WRIST, platformId, DataSourceType.GYROSCOPE_Z);

    } else if (dataSourceClientMSAccel != null && dataSourceClientMSGyro != null) {
        dataKitAPI.unsubscribe(dataSourceClientMSAccel);
        dataKitAPI.unsubscribe(dataSourceClientMSGyro);

    }
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-StreamProcessor,代码行数:28,代码来源:DataKitManager.java


示例18: subscribeForThreeTuple

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
private void subscribeForThreeTuple(DataSourceClient dataSourceClient, final String platformId, final String dataSourceId, final int[] convertedAxis, final int[] convertedSign) throws DataKitException {
    dataKitAPI.subscribe(dataSourceClient, new OnReceiveListener() {
        @Override
        public void onReceived(DataType dataType) {
            try {
                DataTypeDoubleArray dataTypeDoubleArray = (DataTypeDoubleArray) dataType;
                CSVDataPoint csvDataPointx = null;
                CSVDataPoint csvDataPointy = null;
                CSVDataPoint csvDataPointz = null;

                if (DataSourceType.ACCELEROMETER.equals(dataSourceId)) {
                    csvDataPointx = new CSVDataPoint(dataSourceTypeTOChannel.get(platformId + "_" + DataSourceType.ACCELEROMETER_X), dataTypeDoubleArray.getDateTime(), convertedSign[0] * dataTypeDoubleArray.getSample()[convertedAxis[0]]);
                    csvDataPointy = new CSVDataPoint(dataSourceTypeTOChannel.get(platformId + "_" + DataSourceType.ACCELEROMETER_Y), dataTypeDoubleArray.getDateTime(), convertedSign[1] * dataTypeDoubleArray.getSample()[convertedAxis[1]]);
                    csvDataPointz = new CSVDataPoint(dataSourceTypeTOChannel.get(platformId + "_" + DataSourceType.ACCELEROMETER_Z), dataTypeDoubleArray.getDateTime(), convertedSign[2] * dataTypeDoubleArray.getSample()[convertedAxis[2]]);
                } else if (DataSourceType.GYROSCOPE.equals(dataSourceId)) {
                    csvDataPointx = new CSVDataPoint(dataSourceTypeTOChannel.get(platformId + "_" + DataSourceType.GYROSCOPE_X), dataTypeDoubleArray.getDateTime(), convertedSign[0] * dataTypeDoubleArray.getSample()[convertedAxis[0]]);
                    csvDataPointy = new CSVDataPoint(dataSourceTypeTOChannel.get(platformId + "_" + DataSourceType.GYROSCOPE_Y), dataTypeDoubleArray.getDateTime(), convertedSign[1] * dataTypeDoubleArray.getSample()[convertedAxis[1]]);
                    csvDataPointz = new CSVDataPoint(dataSourceTypeTOChannel.get(platformId + "_" + DataSourceType.GYROSCOPE_Z), dataTypeDoubleArray.getDateTime(), convertedSign[2] * dataTypeDoubleArray.getSample()[convertedAxis[2]]);
                }
                streamProcessorWrapper.addDataPoint(csvDataPointx);
                streamProcessorWrapper.addDataPoint(csvDataPointy);
                streamProcessorWrapper.addDataPoint(csvDataPointz);
            } catch (Exception ignored) {

            }
        }
    });
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-StreamProcessor,代码行数:29,代码来源:DataKitManager.java


示例19: onPreferenceChange

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
    boolean value = (Boolean) newValue;
    if(preference.getKey().equals(DataSourceType.LOCATION) && value){
        enableGPS();
    }
    phoneSensorDataSources.find(preference.getKey()).setEnabled(value);
    saveConfigurationFile();
    updatePreferenceScreen();
    return false;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-PhoneSensor,代码行数:12,代码来源:PrefsFragmentSettings.java


示例20: isSensorSupported

import org.md2k.datakitapi.source.datasource.DataSourceType; //导入依赖的package包/类
boolean isSensorSupported(String dataSourceType) {
    SensorManager mSensorManager;
    Sensor mSensor;
    mSensorManager = (SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE);
    switch (dataSourceType) {
        case DataSourceType.ACCELEROMETER:
            mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
            break;
        case (DataSourceType.GYROSCOPE):
            mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
            break;
        case (DataSourceType.AMBIENT_TEMPERATURE):
            mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_AMBIENT_TEMPERATURE);
            break;
        case (DataSourceType.COMPASS):
            mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
            break;
        case (DataSourceType.AMBIENT_LIGHT):
            mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
            break;
        case (DataSourceType.PRESSURE):
            mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE);
            break;
        case (DataSourceType.PROXIMITY):
            mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
            break;
        case DataSourceType.LOCATION:
            return getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS);
        default:
            return true;

    }
    return mSensor != null;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-PhoneSensor,代码行数:35,代码来源:PrefsFragmentSettings.java



注:本文中的org.md2k.datakitapi.source.datasource.DataSourceType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CustomizationAdapterMapping类代码示例发布时间:2022-05-22
下一篇:
Java MatcherHolder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap