Changeset 75


Ignore:
Timestamp:
11/10/2008 01:48:21 PM (15 years ago)
Author:
marcus
Message:

r58 | svn | 2008-11-08 22:10:47 +0100 (Sa, 08 Nov 2008) | 1 line

extension of user cmds (startup button sequence)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/source/motif/shm.c

    r67 r75  
    33 *      ===== 
    44 * 
    5  * $Revision: 52 $, $Date: 2008-10-17 12:57:15 +0200 (Fr, 17 Okt 2008) $ 
     5 * $Revision: 58 $, $Date: 2008-11-08 22:10:47 +0100 (Sa, 08 Nov 2008) $ 
    66 * 
    77 * main module of shm 
     
    831831        } 
    832832 
     833        /* execute button sequence on -buttonseq qualifiers */ 
     834        if  (pa_qspecified("-buttonseq"))  { 
     835                status = cBcNoError; 
     836                mg_tracedisplay( xmv_w[k_widget_draw], &xmv_dspctrl, &status ); 
     837                xm_exec_userdef( pa_qvalue("-buttonseq") ); 
     838        } /*endif*/ 
     839 
    833840        xmv_xt_initialized = TRUE; 
    834841        XtAppMainLoop( xmv_appctxt ); 
     
    16721679        case k_button_read_grsn_station+29: 
    16731680                bit = 1 << (*tag - k_button_read_grsn_station); 
    1674                 if  (data->set)  { 
     1681                if  (data == NULL)  { 
     1682                        xmv_cmd_readg.stations |= bit; 
     1683                } else if  (data->set)  { 
    16751684                        xmv_cmd_readg.stations |= bit; 
    16761685                } else { 
     
    28322841                break; 
    28332842        default: 
    2834                 printf( "*SHM: xm_call_activate: this cannot happen\n " ); 
     2843                printf( "*SHM: xm_call_activate: this cannot happen (%d)\n", *tag ); 
    28352844        } /*endswitch*/ 
    28362845 
     
    48734882{ 
    48744883        /* local variables */ 
    4875         FILE     *fp;                 /* pointer to input file */ 
    4876         char     line[BC_LINELTH+1];  /* current line of file */ 
    4877         char     event[BC_LINELTH+1]; /* name of event */ 
    4878         int      item;                /* event item */ 
    4879         BOOLEAN  m;                   /* menu or button */ 
     4884        FILE     *fp;                     /* pointer to input file */ 
     4885        char     line[BC_LINELTH+1];      /* current line of file */ 
     4886        char     event[BC_LINELTH+1];     /* name of event */ 
     4887        int      item;                    /* event item */ 
     4888        int      m;                       /* menu, button or nothing */ 
     4889        int      i;                       /* counter */ 
     4890        char     itemname[cBcLineLth+1];  /* name of station button */ 
    48804891 
    48814892        /* executable code */ 
     
    48904901                if  (*line == '\n' || *line == '!')  continue; 
    48914902                sscanf( line, "%s", event ); 
    4892                 if       EV("command")   {item=k_entry_command; m=TRUE;} 
    4893                 else if  EV("quit")      {item=k_entry_quit; m=TRUE;} 
    4894                 else if  EV("read_grsn") {item=k_entry_read_grsn; m=TRUE;} 
     4903                if       EV("command")   {item=k_entry_command; m=1;} 
     4904                else if  EV("quit")      {item=k_entry_quit; m=1;} 
     4905                else if  EV("read_grsn") {item=k_entry_read_grsn; m=1;} 
    48954906                /*  :  */ 
    48964907                /*  :  */ 
    4897                 else if  EV("read_grsn_nexttime")  {item=k_button_read_grsn_nexttime; m=FALSE;} 
    4898                 else if  EV("read_grsn_prevtime")  {item=k_button_read_grsn_prevtime; m=FALSE;} 
    4899                 else if  EV("read_grsn_mindn")     {item=k_button_read_grsn_mindn; m=FALSE;} 
    4900                 else if  EV("read_grsn_read")      {item=k_button_read_grsn_read; m=FALSE;} 
    4901                 else if  EV("read_grsn_readnew")   {item=k_button_read_grsn_readnew; m=FALSE;} 
    4902                 else  {fprintf( stderr, "*SHM: userdef: unkown keyword %s\n", event ); continue;} 
    4903                 if  (m)  { 
     4908                else if  EV("read_grsn_nexttime")  {item=k_button_read_grsn_nexttime; m=0;} 
     4909                else if  EV("read_grsn_prevtime")  {item=k_button_read_grsn_prevtime; m=0;} 
     4910                else if  EV("read_grsn_mindn")     {item=k_button_read_grsn_mindn; m=0;} 
     4911                else if  EV("read_grsn_read")      {item=k_button_read_grsn_read; m=0;} 
     4912                else if  EV("read_grsn_readnew")   {item=k_button_read_grsn_readnew; m=0;} 
     4913                else if  EV("read_grsn_frq1")      { 
     4914                        item = -1; 
     4915                        XmToggleButtonSetState(xmv_w[k_widget_read_grsn_1hz],TRUE,TRUE); 
     4916                        m=2; 
     4917                } 
     4918                else if  EV("read_grsn_frq2")      { 
     4919                        item = k_button_read_grsn_20hz; 
     4920                        XmToggleButtonSetState(xmv_w[k_widget_read_grsn_20hz],TRUE,TRUE); 
     4921                        m=0; 
     4922                } 
     4923                else if  EV("read_grsn_frq3")      { 
     4924                        item = k_button_read_grsn_80hz; 
     4925                        XmToggleButtonSetState(xmv_w[k_widget_read_grsn_80hz],TRUE,TRUE); 
     4926                        m=0; 
     4927                } 
     4928                else if  EV("read_grsn_comp1")     { 
     4929                        item = -1; 
     4930                        XmToggleButtonSetState(xmv_w[k_widget_read_grsn_comp_z],TRUE,TRUE); 
     4931                        m=2; 
     4932                } 
     4933                else if  EV("read_grsn_comp2")     { 
     4934                        item = -1; 
     4935                        XmToggleButtonSetState(xmv_w[k_widget_read_grsn_comp_n],TRUE,TRUE); 
     4936                        m=2; 
     4937                } 
     4938                else if  EV("read_grsn_comp3")     { 
     4939                        item = -1; 
     4940                        XmToggleButtonSetState(xmv_w[k_widget_read_grsn_comp_e],TRUE,TRUE); 
     4941                        m=2; 
     4942                } 
     4943                else  { 
     4944                        item = -1; 
     4945                        for  (i=0; i<30; i++)  { 
     4946                                sprintf( itemname, "read_grsn_station_%d", i+1 ); 
     4947                                if EV(itemname)  { 
     4948                                        XmToggleButtonSetState(xmv_w[k_widget_read_grsn_station+i],TRUE,TRUE); 
     4949                                        item = k_button_read_grsn_station+i; 
     4950                                        m = 2; 
     4951                                        break; 
     4952                                } /*endif*/ 
     4953                        } /*endfor*/ 
     4954                        if  (item < 0)  { 
     4955                                fprintf( stderr, "*SHM: userdef: unkown keyword %s\n", event ); 
     4956                                continue; 
     4957                        } /*endif*/ 
     4958                } /*endif*/ 
     4959                if  (m == 1)  { 
    49044960                        xm_call_menu_select( (Widget)0, &item, NULL ); 
    4905                 } else { 
     4961                } else if  (m == 0) { 
    49064962                        xm_call_activate( (Widget)0, &item, NULL ); 
    49074963                } /*endif*/ 
Note: See TracChangeset for help on using the changeset viewer.