コード例 #1
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.btn_save_auto:
        String frequencyStr = mFrequencyEditText.getText().toString();
        String symbolRateStr = mSymbolRateEditText.getText().toString();
        mDefaultTransponder.setFrequency(Integer.parseInt(frequencyStr) * 1000);
        mDefaultTransponder.setSymbolRate(Integer.parseInt(symbolRateStr));

        // 点击保存后设置频点信息到bundle 返回搜索时带着频点数据
        Intent resultIntent = new Intent();
        Bundle mBundle = new Bundle();
        mBundle.putInt(MODULATION, mDefaultTransponder.getModulation());
        mBundle.putInt(FREQUENCY, Integer.parseInt(frequencyStr) * 1000);
        mBundle.putInt(SYMBOLRATE, Integer.parseInt(symbolRateStr));
        resultIntent.putExtras(mBundle);
        setResult(AUTOSEARCH_RESPONSECODE, resultIntent);

        // 保存tp信息到sp
        if (SearchMainActivity.FULLSEARCH.equals(stringExtra)) {
          log.D("save mainTP");
          TransponderUtil.saveDefaultTransponer(
              this,
              DefaultParameter.DefaultTransponderType.DEFAULT_TRANSPONDER_TYPE_MAINTP,
              mDefaultTransponder);
        } else {
          log.D("save autoTp");
          TransponderUtil.saveDefaultTransponer(
              this,
              DefaultParameter.DefaultTransponderType.DEFAULT_TRANSPONDER_TYPE_AUTO,
              mDefaultTransponder);
        }
        finish();
        break;
      case R.id.btn_cancle_auto:
        finish();
        break;
    }
  }
コード例 #2
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
        /*case R.id.sixteen_qam_manual_tv:
            mSixteenImage.setVisibility(View.VISIBLE);
            mThirthtytwoImage.setVisibility(View.INVISIBLE);
            mSixtyfourImage.setVisibility(View.INVISIBLE);
            mOneTwoEightImage.setVisibility(View.INVISIBLE);
            mTwoFiveSixImage.setVisibility(View.INVISIBLE);
            mDefaultTransponder.setModulation(0);
            break;

        case R.id.thirthtytwo_qam_manual_tv:
            mSixteenImage.setVisibility(View.INVISIBLE);
            mThirthtytwoImage.setVisibility(View.VISIBLE);
            mSixtyfourImage.setVisibility(View.INVISIBLE);
            mOneTwoEightImage.setVisibility(View.INVISIBLE);
            mTwoFiveSixImage.setVisibility(View.INVISIBLE);
            mDefaultTransponder.setModulation(1);
            break;*/

      case R.id.sixtyfour_qam_manual_tv:
        //                mSixteenImage.setVisibility(View.INVISIBLE);
        //                mThirthtytwoImage.setVisibility(View.INVISIBLE);
        mSixtyfourImage.setVisibility(View.VISIBLE);
        mOneTwoEightImage.setVisibility(View.INVISIBLE);
        mTwoFiveSixImage.setVisibility(View.INVISIBLE);
        mDefaultTransponder.setModulation(DefaultParameter.ModulationType.MODULATION_64QAM);
        break;

      case R.id.onetwoeight_qam_manual_tv:
        //                mSixteenImage.setVisibility(View.INVISIBLE);
        //                mThirthtytwoImage.setVisibility(View.INVISIBLE);
        mSixtyfourImage.setVisibility(View.INVISIBLE);
        mOneTwoEightImage.setVisibility(View.VISIBLE);
        mTwoFiveSixImage.setVisibility(View.INVISIBLE);
        mDefaultTransponder.setModulation(DefaultParameter.ModulationType.MODULATION_128QAM);
        break;

      case R.id.twofivesix_qam_manual_tv:
        //                mSixteenImage.setVisibility(View.INVISIBLE);
        //                mThirthtytwoImage.setVisibility(View.INVISIBLE);
        mSixtyfourImage.setVisibility(View.INVISIBLE);
        mOneTwoEightImage.setVisibility(View.INVISIBLE);
        mTwoFiveSixImage.setVisibility(View.VISIBLE);
        mDefaultTransponder.setModulation(DefaultParameter.ModulationType.MODULATION_256QAM);
        break;

      case R.id.btn_search_manual:
        String frequency = mFrequencyEditText.getText().toString();
        String symbolRate = mSymbolRateEditText.getText().toString();

        Bundle bundle = new Bundle();
        bundle.putInt(FREQUENCY, Integer.parseInt(frequency) * 1000);
        bundle.putInt(SYMBOLRATE, Integer.parseInt(symbolRate));
        bundle.putInt(MODULATION, mDefaultTransponder.getModulation());
        bundle.putBoolean("isManual", isManualSearch);
        mDefaultTransponder.setFrequency(Integer.parseInt(frequency) * 1000);
        mDefaultTransponder.setSymbolRate(Integer.parseInt(symbolRate));
        TransponderUtil.saveDefaultTransponer(
            this,
            DefaultParameter.DefaultTransponderType.DEFAULT_TRANSPONDER_TYPE_MANUAL,
            mDefaultTransponder);

        Intent autoSearchIntent = new Intent(this, SearchHandActivity.class);
        autoSearchIntent.putExtra(MANUALSEARCH, bundle);
        startActivity(autoSearchIntent);
        break;

      case R.id.btn_cancle_manual:
        finish();
        break;
    }
  }