Rev 252 | Rev 264 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 252 | Rev 262 | ||
---|---|---|---|
Line 527... | Line 527... | ||
527 | public void write_params_(int to) |
527 | public void write_params_(int to) |
528 | { |
528 | { |
529 | wait4send(); |
529 | wait4send(); |
530 | params.active_paramset=to; |
530 | params.active_paramset=to; |
531 | send_command(FC_SLAVE_ADDR,'s',params.field_bak[to]); |
531 | send_command(FC_SLAVE_ADDR,'s',params.field_bak[to]); |
- | 532 | ||
532 | } |
533 | } |
Line -... | Line 534... | ||
- | 534 | ||
- | 535 | public void set_debug_interval(int interval) |
|
- | 536 | { |
|
- | 537 | send_command(FC_SLAVE_ADDR,'d',interval); |
|
533 | 538 | } |
|
534 | public void send_command(int modul,char cmd) |
539 | public void send_command(int modul,char cmd) |
535 | { |
540 | { |
536 | send_command(modul,cmd,new int[0]); |
541 | send_command(modul,cmd,new int[0]); |
Line -... | Line 542... | ||
- | 542 | } |
|
- | 543 | ||
537 | } |
544 | |
538 | 545 | ||
539 | public void send_command(int modul,char cmd,int param) |
546 | public void send_command(int modul,char cmd,int param) |
540 | { |
547 | { |
541 | int[] params=new int[1]; |
548 | int[] params=new int[1]; |
Line 630... | Line 637... | ||
630 | return -1; |
637 | return -1; |
Line 631... | Line 638... | ||
631 | 638 | ||
Line -... | Line 639... | ||
- | 639 | } |
|
- | 640 | ||
- | 641 | ||
- | 642 | public int[][] debug_buff=null; |
|
- | 643 | public int debug_buff_off=0; |
|
- | 644 | public int debug_buff_len=0; |
|
- | 645 | public int debug_buff_interval=0; |
|
- | 646 | public int debug_buff_lastset=0; |
|
- | 647 | public int debug_buff_max=1; |
|
- | 648 | ||
- | 649 | public int[] debug_buff_targets=null; |
|
- | 650 | ||
- | 651 | public void setup_debug_buff(int[] targets,int len,int interval) |
|
- | 652 | { |
|
- | 653 | debug_buff=new int[len][targets.length]; |
|
- | 654 | ||
- | 655 | debug_buff_off=0; |
|
- | 656 | debug_buff_len=len; |
|
- | 657 | debug_buff_interval=interval; |
|
- | 658 | debug_buff_targets=targets; |
|
- | 659 | debug_buff_max=1; |
|
- | 660 | debug_buff_lastset=0; |
|
- | 661 | } |
|
- | 662 | ||
- | 663 | public int chg_debug_max(int val) |
|
- | 664 | { |
|
- | 665 | if (val>debug_buff_max) |
|
- | 666 | debug_buff_max=val; |
|
- | 667 | if (-val>debug_buff_max) |
|
- | 668 | debug_buff_max=-val; |
|
- | 669 | return val; |
|
- | 670 | } |
|
- | 671 | ||
- | 672 | public void destroy_debug_buff() |
|
- | 673 | { |
|
632 | } |
674 | debug_buff_targets=null; |
633 | 675 | } |
|
Line 634... | Line 676... | ||
634 | 676 | ||
Line 657... | Line 699... | ||
657 | 699 | ||
658 | case 'D': // debug Data |
700 | case 'D': // debug Data |
659 | log("got debug data"); |
701 | log("got debug data"); |
660 | stats.debug_data_count++; |
702 | stats.debug_data_count++; |
- | 703 | debug_data.set_by_mk_data(Decode64(data,3,len-3),version); |
|
- | 704 | ||
- | 705 | if (debug_buff_targets!=null) |
|
- | 706 | { |
|
- | 707 | for (int sp=0;sp<debug_buff_targets.length;sp++) |
|
- | 708 | debug_buff[debug_buff_off][sp]=chg_debug_max(debug_data.analog[debug_buff_targets[sp]]); |
|
- | 709 | if (debug_buff_off>debug_buff_lastset) |
|
- | 710 | debug_buff_lastset=debug_buff_off; |
|
- | 711 | ||
- | 712 | debug_buff_off=(debug_buff_off+1)%debug_buff_len; |
|
- | 713 | ||
- | 714 | ||
- | 715 | ||
661 | debug_data.set_by_mk_data(Decode64(data,3,len-3),version); |
716 | } |
662 | log("processed debug data"); |
717 | log("processed debug data"); |
Line 663... | Line 718... | ||
663 | break; |
718 | break; |
664 | 719 | ||
Line 1090... | Line 1145... | ||
1090 | } |
1145 | } |
1091 | */ |
1146 | */ |
Line 1092... | Line 1147... | ||
1092 | 1147 | ||
1093 | recieving=true; |
1148 | recieving=true; |
1094 | int read_count =reader.read(data_in_buff,0,reader.available()); |
1149 | int read_count =reader.read(data_in_buff,0,reader.available()); |
1095 | log("Connected - reading data " + read_count); |
1150 | // log("Connected - reading data " + read_count); |
1096 | // pos=0; |
1151 | // pos=0; |
1097 | input=0; |
1152 | input=0; |
1098 | //data_buff[data_buff_pos]=""; |
1153 | //data_buff[data_buff_pos]=""; |
1099 | // recieve data-set |
1154 | // recieve data-set |