Exemple #1
0
void Reset_posit_length_max(Widget w, XtPointer clientData, XtPointer callData) {

    XmScaleGetValue(posit_length_value, &posit_length);
    XmScaleGetValue(posit_start_value, &posit_start);

    // Check whether start hours is greater than max findu allows
    // for duration
    //
    if (posit_start > MAX_FINDU_DURATION) {    // Set the duration slider to
                                // findu's max duration hours

        XtVaSetValues(posit_length_value,
            XmNvalue, MAX_FINDU_DURATION,
            NULL);
        posit_length = MAX_FINDU_DURATION;
    }
    else {  // Not near the max, so set the duration slider to match
            // the start hours

        XtVaSetValues(posit_length_value,
            XmNvalue, posit_start,
            NULL);
        posit_length = posit_start;
    }
}
Exemple #2
0
 void  pushbuta(Widget iw_temp, XtPointer  data, XtPointer callback)
    {
    /* Get values of magsizx, magsizy and magfac	*/
    XmScaleGetValue(iw_magx,&magsizx);
    XmScaleGetValue(iw_magy,&magsizy);
    XmScaleGetValue(iw_magf,&magfac);

    XtUnmanageChild(iw_setmag);
    }
Exemple #3
0
static void pts_activate_proc(Widget w)
{
  Widget parent_w = XtParent(w);
  Widget mems_w = XtNameToWidget(parent_w, "mems_scale");
  Widget header_w = XtNameToWidget(parent_w, "header_menu");
  Widget pts_dlog = XtNameToWidget(parent_w, "*pts_dlog");
  int pts[8];
  int mems;
  struct descriptor_xd *header_xd = XmdsNidOptionMenuGetXd(header_w);
  static char header[7];
  static struct descriptor header_dsc = {sizeof(header), DTYPE_T, CLASS_S, header};
  int status = TdiText(header_xd, &header_dsc MDS_END_ARG);
  int i;
  XmScaleGetValue(mems_w, &mems);
  L8210HeaderToPTS(header, (char *)&mems, pts);
  for (i=0; i<8; i++) {
    char pts_str[10];
    char name_str[9];
    XmString lab;
    sprintf(pts_str, "%d", pts[i]);
    sprintf(name_str,"*.pts_%d",i);
    lab = XmStringCreateSimple(pts_str);
    XtVaSetValues(XtNameToWidget(pts_dlog,name_str), XmNlabelString, lab, NULL);
    XmStringFree(lab);
  }
  XtManageChild(pts_dlog);
}
Exemple #4
0
void moviemen_buta(Widget iw_t, void * data, void * call_data)
   {
   /* get delay */
   XmScaleGetValue(iw_delay,&moviedelay);
                  
   /* get moviemagni (magnification counter) */
   XmScaleGetValue(iw_magni,&moviemagni);
   
   /* get moviecycl (runb cycles counter) */
   XmScaleGetValue(iw_cycl,&moviecycl);
   
   
   /* get twoway toggle */
   twoway =  XmToggleButtonGadgetGetState(iw_twoway);

   XtUnmanageChild(iw_moviemen);

   /* start movie going */
   wid_movie();
                                
   } /* end of moviemen_buta  */
Exemple #5
0
static Boolean apply_proc(Widget w)
{
  int status;
  Widget mem_scale = XtNameToWidget(XtParent(w), "mems_scale");
  static int mems;
  static DESCRIPTOR_LONG(mems_dsc,&mems);
  int nid;
  XtVaGetValues(mem_scale, XmNuserData, &nid, NULL);
  XmScaleGetValue(mem_scale, &mems);
  status = TreePutRecord(nid, &mems_dsc,0) & 1;
  if (!status)
    XmdsComplain(XtParent(w), "Error writing num memories");
  if (status)
    XmdsApplyAllXds(XtParent(w));
  return status & 1;
}
Exemple #6
0
static void slider_func(Widget sliderID, XtPointer app_data,
	XtPointer widget_data)
{
	Screen_Obj *sop;
	char str[LLEN];
	int value;
	QSP_DECL

	INIT_MOTIF_QSP

	sop = find_object(DEFAULT_QSP_ARG  sliderID);
	if( sop != NO_SCREEN_OBJ ){

		/* get the value from the slider */
		XmScaleGetValue(sliderID, &value);
		sprintf(str,"%d",value);
		ASSIGN_RESERVED_VAR("slider_val",str);
		chew_text(DEFAULT_QSP_ARG sop->so_action_text,"(slider event)");
	} else ERROR1("can't locate slider");
} // slider_func
Exemple #7
0
void Download_trail_now(Widget w, XtPointer clientData, XtPointer callData) {
    char temp[MAX_CALLSIGN+1];
    static char fileimg[400];
    static char log_filename[200];
    char *temp_ptr;
    pthread_t download_trail_thread;
    static XtPointer download_client_data = NULL;

    char tmp_base_dir[MAX_VALUE];

    get_user_base_dir("tmp",tmp_base_dir, sizeof(tmp_base_dir));

    // If we're already fetching a trail, we shouldn't be calling
    // this callback function.  Get out.
    if (fetching_findu_trail_now)
        return;

    // Pass two parameters to findu_transfer_thread via a struct
    track_ptrs.download_client_ptrs[0] = log_filename;
    track_ptrs.download_client_ptrs[1] = fileimg;
    download_client_data = &track_ptrs;

    // Check whether it's ok to do a download currently.
    if (read_file) {
        // No, we're already in the middle of reading in some file.
        // Skip trying to download yet another file.

        fprintf(stderr,"Processing another file.  Wait a bit, then try again\n");

        popup_message_always(langcode("POPEM00035"),
            langcode("POPEM00041"));

        return;
    }
 
//    busy_cursor(appshell);

    xastir_snprintf(log_filename,
        sizeof(log_filename),
        "%s/map.log",
        tmp_base_dir);

    // Erase any previously existing local file by the same name.
    // This avoids the problem of having an old tracklog here and
    // the code trying to display it when the download fails.
    unlink( log_filename );


    XmScaleGetValue(posit_start_value , &posit_start);
    XmScaleGetValue(posit_length_value , &posit_length);

    temp_ptr = XmTextFieldGetString(download_trail_station_data);
    xastir_snprintf(temp,
        sizeof(temp),
        "%s",
        temp_ptr);
    XtFree(temp_ptr);

    (void)remove_trailing_spaces(temp);
    (void)remove_trailing_dash_zero(temp);
   
    xastir_snprintf(download_trail_station_call,
        sizeof(download_trail_station_call),
        "%s",
        temp);        
    //Download_trail_destroy_shell(w, clientData, callData);


// New URL's for findu.  The second one looks very promising.
//http://www.findu.com/cgi-bin/raw.cgi?call=k4hg-8&time=1
//http://www.findu.com/cgi-bin/rawposit.cgi?call=k4hg-8&time=1
//
// The last adds this to the beginning of the line:
//
//      "20030619235323,"
//
// which is a date/timestamp.  We'll need to do some extra stuff
// here in order to actually use that date/timestamp though.
// Setting the read_file_ptr to the downloaded file won't do it.



//        "http://www.findu.com/cgi-bin/rawposit.cgi?call=%s&start=%d&length=%d&time=1", // New, with timestamp
    xastir_snprintf(fileimg, sizeof(fileimg),
        //
        // Posits only:
        // "http://www.findu.com/cgi-bin/rawposit.cgi?call=%s&start=%d&length=%d",
        //
        // Posits plus timestamps (we can't handle timestamps yet):
        // "http://www.findu.com/cgi-bin/rawposit.cgi?call=%s&start=%d&length=%d&time=1", // New, with timestamp
        // 
        // Download all packets, not just posits:
        "http://www.findu.com/cgi-bin/raw.cgi?call=%s&start=%d&length=%d",
        //
        download_trail_station_call,posit_start,posit_length);

    if (debug_level & 1024) {
        fprintf(stderr, "%s\n", fileimg);
    }


//----- Start New Thread -----

    if (pthread_create(&download_trail_thread,
            NULL,
            findu_transfer_thread,
            download_client_data)) {

        fprintf(stderr,"Error creating findu transfer thread\n");
    }
    else {
        // We're off and running with the new thread!
    }

    display_zoom_status();

    Download_trail_destroy_shell(w, clientData, callData);
}
Exemple #8
0
 void backmen_butm(Widget iw_temp, XtPointer data, 
                                   XtPointer call_data)

 {
 int             nindex, ival, iflags, indx;  
 float           fval,ft;
 int             ngo_com, nend_com;  

 /* Get new ngo & nend */
 XmScaleGetValue(iw_ngob,  &ngo_com);
 XmScaleGetValue(iw_nendb, &nend_com);

 if (nend_com < ngo_com)
    { spout("*** Upper value must be > lower value"); return;}
 else if (ngo_com < imagego)                                            
    { spout("*** Lower value outside of image ramp"); return;}
 else if (nend_com > imageend)                                         
    { spout("*** Upper value outside of image ramp"); return;}

 // Use ngo to signal ramp info
 ngo  = ngo_com;
 nend = nend_com;
 
#ifdef WEB_TRUE
// WEB_TRUE ------------------------------------------- WEB_TRUE

 // Uses virtual cmap
 newvmap(ngo,nend,vmap);
 neednewmap = TRUE;

 // Applies virtual cmap
 expos_cb(NULL,NULL,NULL);

#else
// WEB_24 --------------------------------------------- WEB_24


 /* Set the colors in the image portion of the colormap, only */ 

 iflags = DoRed | DoGreen | DoBlue; 
 indx   = 0;
 ft     = 65535.0 / ((float) (nend - ngo));

 for (nindex = mapgo; nindex <= imageend; nindex++)
    {
    colort[indx].pixel = ispicol[nindex];
    colort[indx].flags = iflags;

    if (nindex <= ngo) 
       { ival = 0; }     /* Set this color to black */
    else if (nindex < nend)
       {                 
       /* Interpolate shade */
       fval = (float)(nindex - ngo) * ft;
       ival = fval;
       }
    else 
       { ival = 65535; } /* Set this color to white */

    colort[indx].red     = ival;
    colort[indx].green   = ival;
    colort[indx++].blue  = ival;
    }
 
 /* Put the colors in the desired colormap */
 XStoreColors(idispl, map, colort, indx);

// BOTH --------------------------------------------- BOTH
#endif

 XFlush(idispl);
 return;
 }