IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29539


Ignore:
Timestamp:
Oct 25, 2010, 12:44:51 PM (16 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20100823

Location:
trunk/Ohana/src/kapa2
Files:
21 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa2/doc/notes.txt

    r27790 r29539  
     1
     22010.10.14
     3
     4  * dX,dY = window size, Xs, Ys = corner of image
     5
     6  * PAD1 = 3 (gap between elements)
     7  * PAD2 = 5 (alternate gap)
     8  * COLORPAD = 10 (thickness of colorbar)
     9  * WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1) : height of zoom box or text box + buttons
    110
    2112010.04.14
  • trunk/Ohana/src/kapa2/include/buttons.h

    r17419 r29539  
    107107   0x00, 0x30, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    108108   0x00, 0x00, 0x00, 0x00};
    109 #define hms_width 25
    110 #define hms_height 25
    111 static char hms_bits[] = {
    112    0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
    113    0x02, 0x00, 0x00, 0x00, 0x02, 0x01, 0xf0, 0x00, 0x1e, 0xef, 0x89, 0x00,
    114    0x22, 0x11, 0x09, 0x00, 0x22, 0x11, 0x71, 0x00, 0x22, 0x11, 0x81, 0x00,
    115    0x22, 0x11, 0x89, 0x00, 0x22, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00,
    116    0x1e, 0xc7, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x80, 0x00,
    117    0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00,
    118    0x40, 0x80, 0x80, 0x00, 0x5c, 0xb8, 0xb8, 0x00, 0x62, 0xc4, 0xc4, 0x00,
    119    0x42, 0x84, 0x84, 0x00, 0x42, 0x84, 0x84, 0x00, 0x62, 0xc4, 0xc4, 0x00,
    120    0x5c, 0xb9, 0xb8, 0x00};
    121109#define flipx_width 25
    122110#define flipx_height 25
     
    143131   0x00, 0x82, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00,
    144132   0x00, 0x10, 0x00, 0x00 };
     133#define hex_width 25
     134#define hex_height 12
     135static char hex_bits[] = {
     136   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
     137   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0x00, 0x1e, 0x00, 0x88, 0x00,
     138   0x22, 0x00, 0x08, 0x00, 0x22, 0x00, 0x70, 0x00, 0x22, 0x00, 0x80, 0x00,
     139   0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00};
  • trunk/Ohana/src/kapa2/include/prototypes.h

    r27790 r29539  
    4242void          AxisTickScale       PROTO((Axis *axis, double *major, double *minor));
    4343TickMarkData *CreateAxisTicks     PROTO((Axis *axis, int *nticks));
     44int           PrintTick           PROTO((char *string, double value, double min, double max));
    4445
    4546/* EventLoop */
     
    203204int           RecenterRescale     PROTO((Graphic *graphic, KapaImageWidget *image));
    204205int           ToggleDEG           PROTO((Graphic *graphic, KapaImageWidget *image));
     206int           ToggleHEX           PROTO((Graphic *graphic, KapaImageWidget *image));
    205207int           FlipImageX          PROTO((Graphic *graphic, KapaImageWidget *image));
    206208int           FlipImageY          PROTO((Graphic *graphic, KapaImageWidget *image));
  • trunk/Ohana/src/kapa2/include/structures.h

    r27790 r29539  
    161161  Label    *textline;      /* placed text labels */
    162162  int      Ntextline;     
     163  int      haveGraph;   // is there anything in the plot window?
    163164} KapaGraphWidget;
    164165
     
    186187  Button   recenter_button;
    187188  Button   hms_button; /* toggle HMS/DECIMAL mode (DECIMAL_DEG macro) */
     189  Button   hex_button; /* toggle HEX / FLOAT mode */
    188190  Button   grey_button;
    189191  Button   rainbow_button;
     
    199201  int      MovePointer;
    200202  int      DecimalDegrees;
     203  int      HexValue;
    201204
    202205  // double   X, Y;           /* image pixel at screen center */
  • trunk/Ohana/src/kapa2/src/ButtonFunctions.c

    r25757 r29539  
    11# include "Ximage.h"
     2# include "hms_buttons.h"
    23
    34int PSfunction (Graphic *graphic, KapaImageWidget *image) {
     
    103104
    104105  image[0].DecimalDegrees = image[0].DecimalDegrees ^ TRUE;
     106  image[0].hms_button.bitmap = (image[0].DecimalDegrees) ? hms_bits : ddd_bits;
     107  StatusBox (graphic, image);
     108  DrawButton (graphic, &image[0].hms_button);
     109  FlushDisplay ();
     110  return (TRUE);
     111}
     112
     113int ToggleHEX (Graphic *graphic, KapaImageWidget *image) {
     114
     115  image[0].HexValue = image[0].HexValue ^ TRUE;
    105116  StatusBox (graphic, image);
    106117  FlushDisplay ();
    107118  return (TRUE);
    108 
    109119}
    110120
  • trunk/Ohana/src/kapa2/src/CheckButtons.c

    r16810 r29539  
    2525  if (InButton (event, &image[0].hms_button))
    2626    button = &image[0].hms_button;
     27
     28  if (InButton (event, &image[0].hex_button))
     29    button = &image[0].hex_button;
    2730
    2831  if (InButton (event, &image[0].flipx_button))
  • trunk/Ohana/src/kapa2/src/DrawFrame.c

    r29013 r29539  
    4343}
    4444
     45int PrintTick (char *string, double value, double min, double max) {
     46
     47  int Nexp = 0;
     48  int Nchar = 0;
     49 
     50  if (fabs(value/(max-min)) < 0.001) {
     51    value = 0.0;
     52    Nchar = sprintf (string, "%.1f", value);
     53    return Nchar;
     54  }
     55
     56  double lvalue = log10(fabs(value));
     57
     58  if (isfinite(lvalue)) {
     59    Nexp = fabs(lvalue);
     60  } else {
     61    Nexp = 0;
     62  }
     63 
     64  if (Nexp > 3) {
     65    Nchar = sprintf (string, "%.1e", value);
     66  } else {
     67    Nchar = sprintf (string, "%.1f", value);
     68  }
     69  return Nchar;
     70}
     71
    4572void DrawTick (Graphic *graphic, Axis *axis, int P, TickMarkData *tick, int naxis) {
    4673 
     
    101128    xt = fx + (value-min)*dfx/(max - min) + dx;
    102129    yt = fy + (value-min)*dfy/(max - min) + dy;
    103     if (fabs(value/(max-min)) < 0.001) { value = 0.0; }
    104     sprintf (string, "%4g", value);
     130
     131    PrintTick (string, value, min, max);
    105132    DrawRotText (xt, yt, string, pos, 0.0);
    106133  }
  • trunk/Ohana/src/kapa2/src/DrawObjects.c

    r27530 r29539  
    517517    }
    518518    if (object[0].ptype == 100) {       /* connect a pair of points */
     519
     520      double X0 = graph[0].axis[0].fx;
     521      double X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx;
     522      double Y0 = graph[0].axis[1].fy;
     523      double Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy;
     524
    519525      for (i = 0; i + 1 < object[0].Npts; i+=2) {
    520526        if (!(finite(x[i]) && finite(y[i]))) continue;
     
    524530        sx2 = x[i+1]*mxi + y[i+1]*mxj + bx;
    525531        sy2 = x[i+1]*myi + y[i+1]*myj + by;
    526         DrawLine (sx1, sy1, sx2, sy2);
     532        ClipLine (sx1, sy1, sx2, sy2, X0, Y0, X1, Y1);
    527533      }
    528534    }
     
    674680    }
    675681    if (object[0].ptype == 100) {       
     682      double X0 = graph[0].axis[0].fx;
     683      double X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx;
     684      double Y0 = graph[0].axis[1].fy;
     685      double Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy;
     686
    676687      for (i = 0; i + 1 < object[0].Npts; i+=2) {
    677688        if (!(finite(x[i]) && finite(y[i]))) continue;
     
    680691        sx2 = x[i+1]*mxi + y[i+1]*mxj + bx;
    681692        sy2 = x[i+1]*myi + y[i+1]*myj + by;
    682         DrawLine (sx1, sy1, sx2, sy2);
     693        ClipLine (sx1, sy1, sx2, sy2, X0, Y0, X1, Y1);
    683694      }
    684695    }
  • trunk/Ohana/src/kapa2/src/EraseCurrentPlot.c

    r21153 r29539  
    1515 
    1616  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
     17
     18  SetSectionSizes (section);
    1719  Refresh ();
    1820
  • trunk/Ohana/src/kapa2/src/EraseImage.c

    r14590 r29539  
    1515  section->image = NULL;
    1616
    17   if (USE_XWINDOW) Refresh ();
     17  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
     18 
     19  SetSectionSizes (section);
     20  Refresh ();
    1821  return (TRUE);
    1922}
  • trunk/Ohana/src/kapa2/src/Graphs.c

    r27790 r29539  
    88
    99  ALLOCATE (graph, KapaGraphWidget, 1);
     10
     11  graph[0].haveGraph = FALSE;
    1012
    1113  /* set up axis positions */
     
    8284void DrawGraph (KapaGraphWidget *graph) {
    8385  if (graph == NULL) return;
     86  if (!graph[0].haveGraph) return;
     87
    8488  DrawFrame    (graph);
    8589  DrawObjects  (graph);
     
    9498
    9599  if (graph == NULL) return;
     100  graph[0].haveGraph = FALSE;
    96101
    97102  /* free data objects, then re-alloc those needed */
  • trunk/Ohana/src/kapa2/src/Image.c

    r27435 r29539  
    11# include "Ximage.h"
    22# include "buttons.h"
     3# include "hms_buttons.h"
    34
    45int InitImageChannel (KapaImageChannel *channel) {
     
    1011  channel->slope = 1;
    1112
     13  channel->coords.pc1_1 = channel->coords.pc2_2 = 1.0;
     14  channel->coords.pc1_2 = channel->coords.pc2_1 = 0.0;
     15  channel->coords.crval1 = 0.0;
     16  channel->coords.crval2 = 0.0;
     17  channel->coords.crpix1 = 0.0;
     18  channel->coords.crpix2 = 0.0;
     19  channel->coords.cdelt1 = channel->coords.cdelt2 = 1.0;
     20  strcpy (channel->coords.ctype, "RA---LIN");
    1221  channel->coords.Npolyterms = 0;
     22
    1323  channel->matrix.datasize = 0; /* a flag to show there is no data in the matrix */
    1424  ALLOCATE (channel->matrix.buffer, char, 1);  /* allocate so later free will not crash! */
     
    7080  image[0].MovePointer = TRUE;
    7181  image[0].DecimalDegrees  = TRUE;
     82  image[0].HexValue  = FALSE;
     83
    7284  ALLOCATE (image[0].picture.data, char, 1);   /* allocate so later free will not crash! */
    7385  ALLOCATE (image[0].cmapbar.data, char, 1);   /* allocate so later free will not crash! */
     
    104116  InitButtonFunc (&image[0].overlay_button[3], Overlay3);
    105117
    106   InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits);
     118  if (image[0].DecimalDegrees) {
     119    InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits);
     120  } else {
     121    InitButtonSize (&image[0].hms_button, ddd_width, ddd_height, ddd_bits);
     122  }
    107123  InitButtonFunc (&image[0].hms_button, ToggleDEG);
     124
     125  InitButtonSize (&image[0].hex_button, hex_width, hex_height, hex_bits);
     126  InitButtonFunc (&image[0].hex_button, ToggleHEX);
    108127
    109128  InitButtonSize (&image[0].flipx_button, flipx_width, flipx_height, flipx_bits);
     
    117136
    118137void InitButtonSize (Button *button, int width, int height, char *bitmap) {
    119   button->dx = BUTTON_WIDTH;
    120   button->dy = BUTTON_HEIGHT;
     138  button->dx = width + 2;
     139  button->dy = height + 2;
    121140  button->width = width;
    122141  button->height = height;
     
    185204    DrawButton (graphic, &image[0].heat_button);
    186205    DrawButton (graphic, &image[0].hms_button);
     206    DrawButton (graphic, &image[0].hex_button);
    187207
    188208    DrawButton (graphic, &image[0].flipx_button);
  • trunk/Ohana/src/kapa2/src/LoadFrame.c

    r27790 r29539  
    1515
    1616  KapaScanGraphData (sock, &graph[0].data);
     17
     18  // even if we have no actual elements, once we define a frame, we have a graph
     19  graph[0].haveGraph = TRUE;
    1720
    1821  graph[0].axis[3].min = graph[0].axis[1].min;
  • trunk/Ohana/src/kapa2/src/LoadLabels.c

    r17466 r29539  
    1414  }
    1515  graph = section->graph;
    16  
     16  graph[0].haveGraph = TRUE;
     17
    1718  KiiScanMessage (sock, "%d", &mode);
    1819  label = KiiRecvData (sock);
  • trunk/Ohana/src/kapa2/src/LoadObject.c

    r27486 r29539  
    1515  }
    1616  graph = section->graph;
     17  graph[0].haveGraph = TRUE;
    1718 
    1819  N = graph[0].Nobjects;
  • trunk/Ohana/src/kapa2/src/LoadTextlines.c

    r19830 r29539  
    1111  section = GetActiveSection();
    1212  graph = section->graph;
    13     if (section->graph == NULL) {
     13  if (section->graph == NULL) {
    1414    section->graph = InitGraph ();
    1515    SetSectionSizes (section);
    1616    graph = section->graph;
    1717  }
     18  graph[0].haveGraph = TRUE;
    1819
    1920  graph[0].Ntextline = MAX (graph[0].Ntextline, 0);
  • trunk/Ohana/src/kapa2/src/PSFrame.c

    r28347 r29539  
    9494    xt = fx + (value-min)*dfx/(max - min) + dx;
    9595    yt = fy + (value-min)*dfy/(max - min) + dy;
    96     if (fabs(value) < 0.001) { value = 0.0; }
    97     sprintf (string, "%4g", value);
     96
     97    PrintTick (string, value, min, max);
    9898    PSRotText (f, xt, yt, string, pos, 0.0);
    9999  }
  • trunk/Ohana/src/kapa2/src/SetGraphSize.c

    r27902 r29539  
    7272    for (i = 0; i < Nticks; i++) {
    7373      if (!ticks[i].IsMajor) continue;
    74       sprintf (string, "%g", ticks[i].value);
    75       Nc = MAX (Nc, strlen (string));
     74
     75      int Nchar = PrintTick (string, ticks[i].value, graph[0].axis[1].min, graph[0].axis[1].max);
     76
     77      Nc = MAX (Nc, Nchar);
    7678    }
    7779    FREE(ticks);
     
    9698    for (i = 0; i < Nticks; i++) {
    9799      if (!ticks[i].IsMajor) continue;
    98       sprintf (string, "%g", ticks[i].value);
    99       Nc = MAX (Nc, strlen (string));
     100      int Nchar = PrintTick (string, ticks[i].value, graph[0].axis[3].min, graph[0].axis[3].max);
     101      Nc = MAX (Nc, Nchar);
    100102    }
    101103    FREE(ticks);
     
    112114  }
    113115
    114   /* basic size of the graph in Xwindow coordinates */
     116  /* basic size of the graph in Xwindow coordinates, but measured from lower-left corner */
    115117  X0 = graphic[0].dx * section[0].x + padYm;
    116118  Y0 = graphic[0].dy * section[0].y + padXm;
     
    125127
    126128    switch (section->image->location) {
     129      case 0:
     130        // no changes?
     131        break;
    127132      case 1:
    128         Y0 = graphic[0].dy * section[0].y  + 2*PAD1 + WdY + 2; // tied to image in Y
    129         dY = graphic[0].dy * section[0].dy - 5*PAD1 - WdY - COLORPAD + 1;
     133        Y0 = graphic[0].dy * section[0].y  + padXm         + 2*PAD1 + WdY + 2;
     134        dY = graphic[0].dy * section[0].dy - padXm - padXp - 4*PAD1 - 1 - WdY - COLORPAD;
    130135        break;
    131136      case 3:
    132         dY = graphic[0].dy * section[0].dy - 5*PAD1 - WdY - COLORPAD - padYm - padYp;
     137        dY = graphic[0].dy * section[0].dy - padXm - padXp - 4*PAD1 - 1 - WdY - COLORPAD;
    133138        break;
    134139      case 2:
    135         X0 = graphic[0].dx * section[0].x  + 2*PAD1 + ZOOM_X;
    136         dX = graphic[0].dx * section[0].dx - 3*PAD1 - ZOOM_X;
     140        X0 = graphic[0].dx * section[0].x  + padYm         + 2*PAD1 + ZOOM_X;
     141        dX = graphic[0].dx * section[0].dx - padYm - padYp - 3*PAD1 - ZOOM_X;
     142        dY = graphic[0].dy * section[0].dy - padXm - padXp - 2*PAD1 - COLORPAD;
    137143        break;
    138144      case 4:
    139         dX = graphic[0].dx * section[0].dx - 3*PAD1 - ZOOM_X - padXm - padXp;
     145        dX = graphic[0].dx * section[0].dx - padYm - padYp - 3*PAD1 - ZOOM_X;
     146        dY = graphic[0].dy * section[0].dy - padXm - padXp - 2*PAD1 - COLORPAD;
    140147        break;
    141148    }
  • trunk/Ohana/src/kapa2/src/SetImageSize.c

    r16810 r29539  
    1 # include "Ximage.h"
     1 # include "Ximage.h"
    22
    33/* Set the dimensions of the specific image based on the current window size.  The image
     
    99  int Xs, Ys, dX, dY;
    1010  int textpad, textdY, WdY;
     11  int haveGraph;
    1112  KapaImageWidget *image;
    1213  KapaGraphWidget *graph;
     
    1718  if (image == NULL) return;
    1819  graph = section->graph;
     20  haveGraph = graph && graph->haveGraph;
    1921
    2022  graphic = GetGraphic ();
     
    3335
    3436    case 0: // no zoom / status / wide
    35       if (section->graph) {
     37      if (haveGraph) {
    3638          image[0].picture.x  = graph[0].axis[0].fx;
    3739          image[0].picture.y  = graph[0].axis[1].fy + graph[0].axis[1].dfy;
    38           image[0].picture.dx = MAX(graph[0].axis[0].dfx + 1, 1);
     40          image[0].picture.dx = MAX(fabs(graph[0].axis[0].dfx) - 1, 1);
    3941          image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1);
    4042      } else {
    4143          image[0].picture.x  = Xs + PAD1;
    4244          image[0].picture.y  = Ys + PAD1;
    43           image[0].picture.dx = dX - 2*PAD1;
    44           image[0].picture.dy = dY - 2*PAD1;
     45          image[0].picture.dx = dX - 2*PAD1 - 1;
     46          image[0].picture.dy = dY - 2*PAD1 - 1;
    4547      }
    4648      if (USE_XWINDOW) CreatePicture (image, graphic);
     
    4850      return;
    4951
    50     case 1: // zoom / status / wide on bottom
    51 
    52       if (section->graph) {
    53           image[0].picture.x = graph[0].axis[0].fx;
    54           image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
    55           image[0].picture.dx = graph[0].axis[0].dfx;
    56           image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD;
    57       } else {
    58           image[0].picture.x  = Xs + PAD1;
    59           image[0].picture.y  = Ys + 2*PAD1 + COLORPAD;
    60           image[0].picture.dx = dX - 2*PAD1;
    61           image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD;
     52    case 1: // zoom / status / wide on bottom (-x)
     53
     54      if (haveGraph) {
     55        image[0].picture.x = graph[0].axis[0].fx;
     56        image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy;
     57        image[0].picture.dx = MAX(fabs(graph[0].axis[0].dfx) - 1, 1);
     58        image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1);
     59      } else {
     60        image[0].picture.x  = Xs + PAD1;
     61        image[0].picture.y  = Ys + 2*PAD1 + COLORPAD;
     62        image[0].picture.dx = dX - 2*PAD1 - 1;
     63        image[0].picture.dy = dY - 4*PAD1 - 1 - WdY - COLORPAD;
    6264      }
    6365
     
    7274      image[0].zoom.dy = ZOOM_Y;
    7375      image[0].zoom.x = Xs + PAD1;
    74       image[0].zoom.y = image[0].picture.y + image[0].picture.dy + PAD1;
     76      image[0].zoom.y = Ys + dY - PAD1 - WdY;
    7577
    7678      /** everything below is tied in x-dir to the zoom box **/
     
    9698      image[0].hms_button.y = image[0].overlay_button[0].y;
    9799
     100      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     101      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
     102
    98103      image[0].PS_button.x = image[0].text_x;
    99104      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     
    127132      break;
    128133
    129     case 3: // zoom / status / wide on top
    130 
    131       if (section->graph) {
     134    case 3: // zoom / status / wide on top (+x)
     135
     136      if (haveGraph) {
    132137        image[0].picture.x = graph[0].axis[0].fx;
    133138        image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy;
    134         image[0].picture.dx = MAX(graph[0].axis[0].dfx, 1);
     139        image[0].picture.dx = MAX(fabs(graph[0].axis[0].dfx) - 1, 1);
    135140        image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1);
    136141      } else {
    137         image[0].picture.dx = dX - 2*PAD1;
    138         image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD;
    139142        image[0].picture.x = Xs + PAD1;
    140         image[0].picture.y = Ys + 4*PAD1 + COLORPAD + WdY;
     143        image[0].picture.y = Ys + 3*PAD1 + COLORPAD + WdY;
     144        image[0].picture.dx = dX - 2*PAD1 - 1;
     145        image[0].picture.dy = dY - 4*PAD1 - 1 - WdY - COLORPAD;
    141146      }
    142147
     
    175180      image[0].hms_button.y = image[0].overlay_button[0].y;
    176181
     182      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     183      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
     184
    177185      image[0].PS_button.x = image[0].text_x;
    178186      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     
    206214      break;
    207215
    208     case 2: // zoom / status / wide on left
    209 
    210       if (section->graph) {
    211         image[0].picture.x = Xs + 2*PAD1 + ZOOM_X;
     216    case 2: // zoom / status / wide on left (-y)
     217
     218      if (haveGraph) {
     219        image[0].picture.x = graph[0].axis[0].fx;
    212220        image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy;
    213         image[0].picture.dx = dX - 3*PAD1 - ZOOM_X;
     221        image[0].picture.dx = MAX(fabs(graph[0].axis[0].dfx) - 1, 1);
    214222        image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1);
    215223      } else {
    216         image[0].picture.dx = dX - 3*PAD1 - ZOOM_X;
    217         image[0].picture.dy = dY - 3*PAD1 - COLORPAD;
    218224        image[0].picture.x = Xs + 2*PAD1 + ZOOM_X;
    219225        image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
     226        image[0].picture.dx = dX - 3*PAD1 - 1 - ZOOM_X;
     227        image[0].picture.dy = dY - 3*PAD1 - 1 - COLORPAD;
    220228      }
    221229
     
    230238      image[0].zoom.dy = ZOOM_Y;
    231239      image[0].zoom.x = Xs + PAD1;
    232       image[0].zoom.y = image[0].picture.y;
     240      image[0].zoom.y = Ys + 2*PAD1 + COLORPAD;
    233241
    234242      /** everything below is tied in x-dir to the zoom box **/
     
    254262      image[0].hms_button.y = image[0].overlay_button[0].y;
    255263
     264      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     265      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
     266
    256267      image[0].PS_button.x = image[0].zoom.x;
    257268      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     
    285296      break;
    286297
    287     case 4:  // zoom / status / wide on right
    288 
    289       if (section->graph) {
     298    case 4:  // zoom / status / wide on right (+y)
     299
     300      if (haveGraph) {
    290301        image[0].picture.x = graph[0].axis[0].fx;
    291302        image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy;
    292         image[0].picture.dx = dX - 3*PAD1 - ZOOM_X - graph[0].axis[0].fx;
     303        image[0].picture.dx = MAX(fabs(graph[0].axis[0].dfx) - 1, 1);
    293304        image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1);
    294305      } else {
    295         image[0].picture.dx = dX - 3*PAD1 - ZOOM_X;
    296         image[0].picture.dy = dY - 3*PAD1 - COLORPAD;
    297306        image[0].picture.x = Xs + PAD1;
    298307        image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
     308        image[0].picture.dx = dX - 3*PAD1 - 1 - ZOOM_X;
     309        image[0].picture.dy = dY - 3*PAD1 - 1 - COLORPAD;
    299310      }
    300311
     
    308319      image[0].zoom.dx = ZOOM_X;
    309320      image[0].zoom.dy = ZOOM_Y;
    310       image[0].zoom.x = image[0].picture.x + image[0].picture.dx + PAD1;
    311       image[0].zoom.y = image[0].picture.y;
     321      image[0].zoom.x = Xs + dX - ZOOM_X - PAD1;
     322      image[0].zoom.y = Ys + 2*PAD1 + COLORPAD;
    312323
    313324      /** everything below is tied in x-dir to the zoom box **/
     
    332343      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
    333344      image[0].hms_button.y = image[0].overlay_button[0].y;
     345
     346      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     347      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
    334348
    335349      image[0].PS_button.x = image[0].zoom.x;
  • trunk/Ohana/src/kapa2/src/UpdateStatusBox.c

    r25757 r29539  
    4343  }
    4444  bzero (line, 100);
    45   sprintf (line, "%22.3f", z);
     45
     46  if (image[0].HexValue) {
     47    sprintf (line, "%04x", (int) z);
     48  } else {
     49    sprintf (line, "%22.3f", z);
     50  }
    4651  XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc,
    4752               image[0].text_x + PAD1, image[0].text_y + textpad + PAD1, line, strlen(line));
  • trunk/Ohana/src/kapa2/src/bDrawFrame.c

    r28347 r29539  
    9393    xt = fx + (value-min)*dfx/(max - min) + dx;
    9494    yt = fy + (value-min)*dfy/(max - min) + dy;
    95     if (fabs(value) < 0.001) { value = 0.0; }
    96     sprintf (string, "%4g", value);
     95
     96    PrintTick (string, value, min, max);
    9797    bDrawRotText (xt, yt, string, pos, 0.0);
    9898  }
Note: See TracChangeset for help on using the changeset viewer.