Waveform filter programs

◆ convert_to_display_units()

double DDAS3::convert_to_display_units ( const Econversion &  ConvCode,
const double &  chanval 
)

Definition at line 601 of file sigscale.cc.

References convert_GEPLHe19_volts_to_percent(), convert_GEPLHe23_volts_to_percent(), convert_pt100_ohms_to_celsius(), convert_pt100_ohms_to_Kelvin(), convert_sidiode_volts_to_kelvin(), convert_sidiode_volts_to_kelvin_with_correction(), convert_td_ohms_to_celsius(), convert_v_to_FAN16(), convert_v_to_Pres_KPa_0_17236(), convert_v_to_Pres_KPa_0_20684(), convert_v_to_Pres_KPa_0_3447(), convert_v_to_Pres_MPa_0_17236(), convert_v_to_Pres_MPa_0_20684(), convert_v_to_Pres_MPa_0_3447(), convert_v_to_Pres_PSI_0_2500(), convert_v_to_Pres_PSI_0_3000(), convert_v_to_Pres_PSI_0_500(), and convert_volts_to_psi().

Referenced by main().

603  {
604  double retval, V, Vcor;
605 
606  switch (ConvCode)
607  {
608  case datrw::tsoft::SIDIODE:
609  case datrw::tsoft::SIDIODE1:
610  retval = convert_sidiode_volts_to_kelvin(chanval);
611  break;
612  case datrw::tsoft::PT100:
613  retval = convert_pt100_ohms_to_celsius(chanval);
614  break;
615  case datrw::tsoft::PT100V:
616  // changed from 1000 to 100 4/23/08 for rev3 pcb
617  retval = convert_pt100_ohms_to_celsius(100.0 * chanval);
618  break;
619  case datrw::tsoft::PT100_K: // Added 8/02 per eb
620  retval = convert_pt100_ohms_to_Kelvin(chanval);
621  break;
622  case datrw::tsoft::PT100V_K: // Added 8/02 per eb
623  // changed from 1000 to 100 4/23/08 for rev3 pcb
624  retval = convert_pt100_ohms_to_Kelvin(100.0 * chanval);
625  break;
626  case datrw::tsoft::PSI_1_1: // Added 11/05 per eb
627  retval = convert_volts_to_psi( chanval);
628  break;
629  case datrw::tsoft::GEPLHe19: // Added 11/05 per eb
630  retval = convert_GEPLHe19_volts_to_percent( chanval);
631  break;
632  case datrw::tsoft::GEPLHe23: // Added 8/07 per eb
633  retval = convert_GEPLHe23_volts_to_percent( chanval);
634  break;
635  case datrw::tsoft::TD:
636  retval = convert_td_ohms_to_celsius(chanval);
637  break;
638  case datrw::tsoft::TDV:
639  retval = convert_td_ohms_to_celsius(1000.0 * chanval);
640  break;
641  case datrw::tsoft::MASFLO1:
642  // Mass Airflow Sensor Manufactured by Microswitch, Model #AWM3100V
643  // Equation from Bruno Meurers 3rd degree polynomial fit using data
644  // from manufacturers data sheet flow =
645  // -39.35+(48.390*voltage)-(11.737*voltage^2)+(2.3064*voltage^3)
646  V = chanval;
647  retval = ( -39.35 + (48.390 * V) - (11.737 * V * V) + (2.3064 * V * V * V) ) ;
648  break;
649  //else if( coeff == MASFLO1:
650  //{
651  // retval = chanval;
652  // break;
653  case datrw::tsoft::H2OFLO1:
654  retval = chanval;
655  break;
656  case datrw::tsoft::SIDIODE2:
657  //non-magnetic sensor raw voltage no gain from scanner
658  Vcor = chanval ;
659  if ( Vcor > 1.25 ) { Vcor = chanval - (0.2363 * ( chanval - 1.25 )); }
660  // removed /4.98 8/02 per eb
662  break;
663  case datrw::tsoft::SIDIODE3:
664  // voltage with 4.98x amp from gep aux pcb
665  Vcor = chanval/4.98 ;
666  retval = convert_sidiode_volts_to_kelvin(Vcor);
667  break;
668  case datrw::tsoft::SIDIODE4:
669  //non-magnetic sensor with 4.98x amp from gep aux pcb
670  Vcor = chanval/4.98 ;
671  if ( Vcor > 1.25) { Vcor = Vcor - (0.2363 * ( Vcor - 1.25 )); }
673  break;
674  case datrw::tsoft::POWERV:
675  if ( chanval < 0.0)
676  { retval = 0.0 ; } /* changed 6/06 per Eric */
677  else
678  { retval = chanval * chanval; } /* power = volts^2 */
679  break;
680  case datrw::tsoft::PSI_500:
681  retval = convert_v_to_Pres_PSI_0_500(chanval);
682  break;
683  case datrw::tsoft::PSI_3000:
684  retval = convert_v_to_Pres_PSI_0_3000(chanval);
685  break;
686  case datrw::tsoft::KPA_3447:
687  retval = convert_v_to_Pres_KPa_0_3447(chanval);
688  break;
689  case datrw::tsoft::KPA_20684:
690  retval = convert_v_to_Pres_KPa_0_20684(chanval);
691  break;
692  case datrw::tsoft::PSI_2500:
693  retval = convert_v_to_Pres_PSI_0_2500(chanval);
694  break;
695  case datrw::tsoft::KPA_17236:
696  retval = convert_v_to_Pres_KPa_0_17236(chanval);
697  break;
698  case datrw::tsoft::MPA_17236:
699  retval = convert_v_to_Pres_MPa_0_17236(chanval);
700  break;
701  case datrw::tsoft::MPA_3447:
702  retval = convert_v_to_Pres_MPa_0_3447(chanval);
703  break;
704  case datrw::tsoft::MPA_20684:
705  retval = convert_v_to_Pres_MPa_0_20684(chanval);
706  break;
707  case datrw::tsoft::FAN16:
708  retval = convert_v_to_FAN16(chanval);
709  break;
710  case datrw::tsoft::C20P4:
711  retval = chanval * 20.4;
712  break;
713  case datrw::tsoft::CNSP:
714  case datrw::tsoft::CNFD:
715  retval = chanval;
716  break;
717  default:
718  std::cerr << "WARNING: \n"
719  << " unknown channel conversion code: " << ConvCode << "\n";
720  retval = chanval;
721  }
722 
723  return retval;
724  } // double convert_to_display_units(const Econversion& ConvCode,
double convert_v_to_Pres_KPa_0_3447(double volts)
Definition: sigscale.cc:336
double convert_v_to_Pres_MPa_0_3447(double volts)
Definition: sigscale.cc:510
double convert_pt100_ohms_to_Kelvin(double ohms)
Definition: sigscale.cc:118
double convert_pt100_ohms_to_celsius(double ohms)
Definition: sigscale.cc:110
double convert_v_to_Pres_MPa_0_20684(double volts)
Definition: sigscale.cc:544
double convert_td_ohms_to_celsius(double ohms)
Definition: sigscale.cc:134
double convert_sidiode_volts_to_kelvin_with_correction(double volts)
Definition: sigscale.cc:192
double convert_volts_to_psi(double volts)
Definition: sigscale.cc:126
double convert_v_to_Pres_KPa_0_17236(double volts)
Definition: sigscale.cc:440
double convert_sidiode_volts_to_kelvin(double volts)
Definition: sigscale.cc:153
double convert_v_to_FAN16(double volts)
Definition: sigscale.cc:579
double convert_v_to_Pres_PSI_0_3000(double volts)
Definition: sigscale.cc:302
double convert_GEPLHe19_volts_to_percent(double volts)
Definition: sigscale.cc:237
double convert_v_to_Pres_PSI_0_500(double volts)
Definition: sigscale.cc:269
double convert_v_to_Pres_MPa_0_17236(double volts)
Definition: sigscale.cc:475
double convert_v_to_Pres_PSI_0_2500(double volts)
Definition: sigscale.cc:405
double convert_v_to_Pres_KPa_0_20684(double volts)
Definition: sigscale.cc:370
double convert_GEPLHe23_volts_to_percent(double volts)
Definition: sigscale.cc:250
Here is the call graph for this function:
Here is the caller graph for this function: