// File: jkingan[P]ladyheather/heathui.cpp
// Function: edit_osc_param()
void edit_osc_param()
{
DATA_SIZE val;

   // change an oscillator control parameter
   if(edit_buffer[0] == 0) return;
   val = (DATA_SIZE) atof(edit_buffer);

   if(getting_string == TC_CMD) {  // time constant
      val = (DATA_SIZE) fabs(val);
      user_time_constant = val;
      if(rcvr_type == PRS_RCVR) {
         set_prs_pt((int) val);
         return;
      }
      else if(rcvr_type == SRO_RCVR) {
         if((val < 0) || (val > 999999)) {
            sprintf(out, "Time constant must be 0 .. 999999");
            edit_error(out);
         }
         else {
            set_sro_tc((int) val);
         }
         return;
      }
      else if(rcvr_type == X72_RCVR) {
         if((val < (DATA_SIZE) MIN_X72_TC) || (val > (DATA_SIZE) MAX_X72_TC)) {
            sprintf(out, "Time constant must be %d .. %d", MIN_X72_TC, MAX_X72_TC);
            edit_error(out);
         }
         else {
            set_x72_tc((int) val);
         }
         return;
      }
   }
   else if(getting_string == DAMP_CMD) {  // damping factor
      val = (DATA_SIZE) fabs(val);
      user_damping_factor = val;
      if(rcvr_type == PRS_RCVR) {
         set_prs_pf((int) val);
         return;
      }
      else if(rcvr_type == X72_RCVR) {
         if((val < 0.25) || (val > 4.0)) {
            edit_error("Time constant must be 0.25 .. 4.0");
         }
         else {
            set_x72_damping((double) val);
         }
         return;
      }
   }
   else if(getting_string == GAIN_CMD) {  // osc gain
      user_osc_gain = val;
      lars_gain = val;
      if(ticc_type == LARS_TICC) osc_gain = val;
      if(com[RCVR_PORT].process_com == 0) osc_gain = val;
      if(luxor) set_luxor_sens((u08) val, (u08) val);
      else if(rcvr_type == PRS_RCVR) {
         set_prs_ga((int) val);
         return;
      }
   }
   else if(getting_string == INITV_CMD) {  // initial dac voltage
      user_initial_voltage = val;
      lars_initv = val;
      if(ticc_type == LARS_TICC) initial_voltage = val;
      if(saw_ntpx) initial_voltage = val;
      if(rcvr_type == PRS_RCVR) {
         set_prs_pi((int) val);
         return;
      }
   }
   else if(getting_string == JAMSYNC_CMD) {  // jam sync theshold
      val = (DATA_SIZE) fabs(val);
      user_jam_sync = val;
      if(rcvr_type == X72_RCVR) {
         if((val < 100.0) || (val > 1000.0)) {
            edit_error("Jamsync threshold time must be 100 .. 1000 ns");
         }
         else {
            set_x72_jamthresh((int) val);
         }
         return;
      }
   }
   else if(getting_string == MAXV_CMD) {  // max volts / luxor driver mode change
      user_max_volts = val;
   }
   else if(getting_string == MAX_FOSC_CMD) {  // max freq offset
      user_max_freq_offset = val;
   }
   else if(getting_string == MIN_RANGE_CMD) {  // min EFC range volts
      user_min_range = val;
   }
   else if(getting_string == MAX_RANGE_CMD) {  // max EFC range volts
      user_max_range = val;
   }
   else if(getting_string == MINV_CMD) {  // min volts / battery pwm level
      user_min_volts = val;
if(luxor) set_batt_pwm((u16) (val * (DATA_SIZE) 65535.0));
   }
   else if(getting_string == PULLIN_CMD) {
      user_pullin = (int) val;
      set_pullin_range(atoi(edit_buffer));
return;
   }
   else if(getting_string == X72_HOLDOVER_CMD) {
      val = (DATA_SIZE) fabs(val);
      if((val < 120) || (val > 1200)) {
         edit_error("Holdover analysis time must be 120 .. 1200");
      }
      else {
         user_holdover_time = (int) val;
         set_x72_holdover((int) val);
      }
return;
   }
   else return;   // unknown osc param

   set_discipline_params(1);
   request_all_dis_params();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x356091(%rip), %rax    # 0x39e4c0
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x4843c
jmp 0x4899a
leaq 0x35607d(%rip), %rdi    # 0x39e4c0
callq 0x9480
movsd %xmm0, -0x8(%rbp)
leaq 0x356394(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x31, %eax
jne 0x4857a
movsd -0x8(%rbp), %xmm0
movaps 0x126e24(%rip), %xmm1   # 0x16f290
pand %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
leaq 0x323ed7(%rip), %rax    # 0x36c358
movsd %xmm0, (%rax)
leaq 0x22f624(%rip), %rax    # 0x277ab0
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jne 0x484a4
cvttsd2si -0x8(%rbp), %edi
callq 0x9a300
jmp 0x4899a
leaq 0x22f605(%rip), %rax    # 0x277ab0
cmpq $0x8000000, (%rax)      # imm = 0x8000000
jne 0x48503
xorps %xmm0, %xmm0
ucomisd -0x8(%rbp), %xmm0
ja 0x484d1
movsd -0x8(%rbp), %xmm0
movsd 0x1291a5(%rip), %xmm1   # 0x171670
ucomisd %xmm1, %xmm0
jbe 0x484f4
leaq 0x352f28(%rip), %rdi    # 0x39b400
leaq 0x131a79(%rip), %rsi    # 0x179f58
movb $0x0, %al
callq 0x9060
leaq 0x352f13(%rip), %rdi    # 0x39b400
callq 0x30d60
jmp 0x484fe
cvttsd2si -0x8(%rbp), %edi
callq 0x9a480
jmp 0x4899a
leaq 0x22f5a6(%rip), %rax    # 0x277ab0
cmpq $0x2000000, (%rax)      # imm = 0x2000000
jne 0x48571
movsd 0x126c45(%rip), %xmm0   # 0x16f160
ucomisd -0x8(%rbp), %xmm0
ja 0x48535
movsd -0x8(%rbp), %xmm0
movsd 0x126bb9(%rip), %xmm1   # 0x16f0e8
ucomisd %xmm1, %xmm0
jbe 0x48562
leaq 0x352ec4(%rip), %rdi    # 0x39b400
leaq 0x131a37(%rip), %rsi    # 0x179f7a
movl $0x5, %edx
movl $0x186a0, %ecx          # imm = 0x186A0
movb $0x0, %al
callq 0x9060
leaq 0x352ea5(%rip), %rdi    # 0x39b400
callq 0x30d60
jmp 0x4856c
cvttsd2si -0x8(%rbp), %edi
callq 0x9a7a0
jmp 0x4899a
jmp 0x48573
jmp 0x48575
jmp 0x4898b
leaq 0x356267(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x32, %eax
jne 0x48627
movsd -0x8(%rbp), %xmm0
movaps 0x126cf7(%rip), %xmm1   # 0x16f290
pand %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
leaq 0x323db2(%rip), %rax    # 0x36c360
movsd %xmm0, (%rax)
leaq 0x22f4f7(%rip), %rax    # 0x277ab0
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jne 0x485d1
cvttsd2si -0x8(%rbp), %edi
callq 0x9a360
jmp 0x4899a
leaq 0x22f4d8(%rip), %rax    # 0x277ab0
cmpq $0x2000000, (%rax)      # imm = 0x2000000
jne 0x48620
movsd 0x1290df(%rip), %xmm0   # 0x1716c8
ucomisd -0x8(%rbp), %xmm0
ja 0x48603
movsd -0x8(%rbp), %xmm0
movsd 0x1290d3(%rip), %xmm1   # 0x1716d0
ucomisd %xmm1, %xmm0
jbe 0x48611
leaq 0x13198f(%rip), %rdi    # 0x179f99
callq 0x30d60
jmp 0x4861b
movsd -0x8(%rbp), %xmm0
callq 0x9a890
jmp 0x4899a
jmp 0x48622
jmp 0x48989
leaq 0x3561ba(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x33, %eax
jne 0x486dc
movsd -0x8(%rbp), %xmm0
leaq 0x323d22(%rip), %rax    # 0x36c368
movsd %xmm0, (%rax)
movsd -0x8(%rbp), %xmm0
leaq 0x323c9a(%rip), %rax    # 0x36c2f0
movsd %xmm0, (%rax)
leaq 0x22f487(%rip), %rax    # 0x277ae8
cmpl $0x4c, (%rax)
jne 0x48676
movsd -0x8(%rbp), %xmm0
leaq 0x323c76(%rip), %rax    # 0x36c2e8
movsd %xmm0, (%rax)
leaq 0x324e43(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x179f4(%rax)
jne 0x48696
movsd -0x8(%rbp), %xmm0
leaq 0x323c56(%rip), %rax    # 0x36c2e8
movsd %xmm0, (%rax)
leaq 0x255a81(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x486b6
cvttsd2si -0x8(%rbp), %eax
movb %al, %cl
movzbl %cl, %edi
movzbl %al, %esi
callq 0xad380
jmp 0x486d7
leaq 0x22f3f3(%rip), %rax    # 0x277ab0
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jne 0x486d5
cvttsd2si -0x8(%rbp), %edi
callq 0x9a3c0
jmp 0x4899a
jmp 0x486d7
jmp 0x48987
leaq 0x356105(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x38, %eax
jne 0x48767
movsd -0x8(%rbp), %xmm0
leaq 0x323ca9(%rip), %rax    # 0x36c3a0
movsd %xmm0, (%rax)
movsd -0x8(%rbp), %xmm0
leaq 0x323c31(%rip), %rax    # 0x36c338
movsd %xmm0, (%rax)
leaq 0x22f3d6(%rip), %rax    # 0x277ae8
cmpl $0x4c, (%rax)
jne 0x48727
movsd -0x8(%rbp), %xmm0
leaq 0x323c0d(%rip), %rax    # 0x36c330
movsd %xmm0, (%rax)
leaq 0x2559ee(%rip), %rax    # 0x29e11c
cmpb $0x0, (%rax)
je 0x48743
movsd -0x8(%rbp), %xmm0
leaq 0x323bf1(%rip), %rax    # 0x36c330
movsd %xmm0, (%rax)
leaq 0x22f366(%rip), %rax    # 0x277ab0
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jne 0x48762
cvttsd2si -0x8(%rbp), %edi
callq 0x9a420
jmp 0x4899a
jmp 0x48985
leaq 0x35607a(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x36, %eax
jne 0x487f3
movsd -0x8(%rbp), %xmm0
movaps 0x126b0e(%rip), %xmm1   # 0x16f290
pand %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
leaq 0x323bf9(%rip), %rax    # 0x36c390
movsd %xmm0, (%rax)
leaq 0x22f30e(%rip), %rax    # 0x277ab0
cmpq $0x2000000, (%rax)      # imm = 0x2000000
jne 0x487ee
movsd 0x12689d(%rip), %xmm0   # 0x16f050
ucomisd -0x8(%rbp), %xmm0
ja 0x487cd
movsd -0x8(%rbp), %xmm0
movsd 0x126869(%rip), %xmm1   # 0x16f030
ucomisd %xmm1, %xmm0
jbe 0x487db
leaq 0x1317e7(%rip), %rdi    # 0x179fbb
callq 0x30d60
jmp 0x487e9
cvttsd2si -0x8(%rbp), %eax
cvtsi2sd %eax, %xmm0
callq 0x9a6c0
jmp 0x4899a
jmp 0x48983
leaq 0x355fee(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x35, %eax
jne 0x48817
movsd -0x8(%rbp), %xmm0
leaq 0x323b6a(%rip), %rax    # 0x36c378
movsd %xmm0, (%rax)
jmp 0x48981
leaq 0x355fca(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x37, %eax
jne 0x4883b
movsd -0x8(%rbp), %xmm0
leaq 0x323b66(%rip), %rax    # 0x36c398
movsd %xmm0, (%rax)
jmp 0x4897f
leaq 0x355fa6(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x74, %eax
jne 0x4885f
movsd -0x8(%rbp), %xmm0
leaq 0x323b2a(%rip), %rax    # 0x36c380
movsd %xmm0, (%rax)
jmp 0x4897d
leaq 0x355f82(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x54, %eax
jne 0x48883
movsd -0x8(%rbp), %xmm0
leaq 0x323b0e(%rip), %rax    # 0x36c388
movsd %xmm0, (%rax)
jmp 0x4897b
leaq 0x355f5e(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x34, %eax
jne 0x488d0
movsd -0x8(%rbp), %xmm0
leaq 0x323ad2(%rip), %rax    # 0x36c370
movsd %xmm0, (%rax)
leaq 0x255875(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x488cb
movsd -0x8(%rbp), %xmm0
movsd 0x128e05(%rip), %xmm1   # 0x1716c0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movzwl %ax, %edi
callq 0xaa160
jmp 0x48979
leaq 0x355f11(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x2c0, %eax            # imm = 0x2C0
jne 0x48907
cvttsd2si -0x8(%rbp), %ecx
leaq 0x323abf(%rip), %rax    # 0x36c3ac
movl %ecx, (%rax)
leaq 0x355bca(%rip), %rdi    # 0x39e4c0
callq 0x95c0
movl %eax, %edi
callq 0x99d10
jmp 0x4899a
leaq 0x355eda(%rip), %rax    # 0x39e7e8
movzwl (%rax), %eax
cmpl $0x389, %eax            # imm = 0x389
jne 0x48977
movsd -0x8(%rbp), %xmm0
movaps 0x12696c(%rip), %xmm1   # 0x16f290
pand %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd 0x128d7b(%rip), %xmm0   # 0x1716b0
ucomisd -0x8(%rbp), %xmm0
ja 0x4894f
movsd -0x8(%rbp), %xmm0
movsd 0x128d6f(%rip), %xmm1   # 0x1716b8
ucomisd %xmm1, %xmm0
jbe 0x4895d
leaq 0x131693(%rip), %rdi    # 0x179fe9
callq 0x30d60
jmp 0x48975
cvttsd2si -0x8(%rbp), %ecx
leaq 0x323a3f(%rip), %rax    # 0x36c3a8
movl %ecx, (%rax)
cvttsd2si -0x8(%rbp), %edi
callq 0x9a950
jmp 0x4899a
jmp 0x4899a
jmp 0x4897b
jmp 0x4897d
jmp 0x4897f
jmp 0x48981
jmp 0x48983
jmp 0x48985
jmp 0x48987
jmp 0x48989
jmp 0x4898b
movl $0x1, %edi
callq 0x99d80
callq 0x99cb0
addq $0x10, %rsp
popq %rbp
retq