当前位置: 首页>>代码示例>>Java>>正文


Java DataSourceType类代码示例

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


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


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