IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29214


Ignore:
Timestamp:
Sep 23, 2010, 6:56:30 AM (16 years ago)
Author:
eugene
Message:

add hex/float toggle button; toggle ddd/hms button label

Location:
branches/eam_branches/ipp-20100823/Ohana/src/kapa2
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/buttons.h

    r17419 r29214  
    11#define PS_width 25
    22#define PS_height 25
    3 static char PS_bits[] = {
     3char PS_bits[] = {
    44   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x81, 0x3f, 0x00,
    55   0x82, 0x67, 0x60, 0x00, 0x02, 0x26, 0x40, 0x00, 0x02, 0x24, 0x40, 0x00,
     
    1313#define grey_width 25
    1414#define grey_height 25
    15 static char grey_bits[] = {
     15char grey_bits[] = {
    1616   0x90, 0x40, 0xf7, 0x01, 0x04, 0xaa, 0xad, 0x01, 0x68, 0xd5, 0xfe, 0x01,
    1717   0x82, 0x28, 0xdb, 0x01, 0x10, 0xd2, 0x75, 0x01, 0x40, 0xad, 0xee, 0x01,
     
    2525#define rainbow_width 25
    2626#define rainbow_height 25
    27 static char rainbow_bits[] = {
     27char rainbow_bits[] = {
    2828   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    2929   0x00, 0x80, 0xff, 0x00, 0x00, 0x70, 0x00, 0x01, 0x00, 0x0c, 0x7f, 0x00,
     
    3737#define recenter_width 25
    3838#define recenter_height 25
    39 static char recenter_bits[] = {
     39char recenter_bits[] = {
    4040   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00,
    4141   0x80, 0xef, 0x03, 0x00, 0xe0, 0x00, 0x0e, 0x00, 0x30, 0x00, 0x18, 0x00,
     
    4949#define heat_width 25
    5050#define heat_height 25
    51 static char heat_bits[] = {
     51char heat_bits[] = {
    5252   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xd8, 0x01,
    5353   0x00, 0x0c, 0x37, 0x00, 0xf8, 0xc9, 0x6f, 0x00, 0x0c, 0xde, 0xf0, 0x00,
     
    6161#define red_width 25
    6262#define red_height 25
    63 static char red_bits[] = {
     63char red_bits[] = {
    6464   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xfc, 0x03, 0x00,
    6565   0x20, 0x07, 0x06, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x08, 0x00,
     
    7373#define green_width 25
    7474#define green_height 25
    75 static char green_bits[] = {
     75char green_bits[] = {
    7676   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00,
    7777   0x00, 0x06, 0x04, 0x00, 0x80, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
     
    8585#define blue_width 25
    8686#define blue_height 25
    87 static char blue_bits[] = {
     87char blue_bits[] = {
    8888   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xfe, 0x00, 0x00,
    8989   0xc0, 0x83, 0x07, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0x40, 0x00, 0x08, 0x00,
     
    9797#define yellow_width 25
    9898#define yellow_height 25
    99 static char yellow_bits[] = {
     99char yellow_bits[] = {
    100100   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x18, 0x00,
    101101   0x80, 0x01, 0x0c, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x02, 0x02, 0x00,
     
    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
    123 static char flipx_bits[] = {
     111char flipx_bits[] = {
    124112   0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
    125113   0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x80, 0x10, 0x02, 0x00,
     
    133121#define flipy_width 25
    134122#define flipy_height 25
    135 static char flipy_bits[] = {
     123char flipy_bits[] = {
    136124   0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00,
    137125   0x00, 0x82, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x80, 0x00, 0x02, 0x00,
     
    143131   0x00, 0x82, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00,
    144132   0x00, 0x10, 0x00, 0x00 };
     133#define hms_width 25
     134#define hms_height 12
     135char hms_bits[] = {
     136   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
     137   0x02, 0x00, 0x00, 0x00, 0x02, 0x01, 0xf0, 0x00, 0x1e, 0xef, 0x89, 0x00,
     138   0x22, 0x11, 0x09, 0x00, 0x22, 0x11, 0x71, 0x00, 0x22, 0x11, 0x81, 0x00,
     139   0x22, 0x11, 0x89, 0x00, 0x22, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00};
     140#define ddd_width 25
     141#define ddd_height 12
     142char ddd_bits[] = {
     143   0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00,
     144   0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x5c, 0xb8, 0xb8, 0x00,
     145   0x62, 0xc4, 0xc4, 0x00, 0x42, 0x84, 0x84, 0x00, 0x42, 0x84, 0x84, 0x00,
     146   0x62, 0xc4, 0xc4, 0x00, 0x5c, 0xb9, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00};
     147#define hex_width 25
     148#define hex_height 12
     149char hex_bits[] = {
     150   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
     151   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0x00, 0x1e, 0x00, 0x88, 0x00,
     152   0x22, 0x00, 0x08, 0x00, 0x22, 0x00, 0x70, 0x00, 0x22, 0x00, 0x80, 0x00,
     153   0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00};
  • branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/prototypes.h

    r27790 r29214  
    203203int           RecenterRescale     PROTO((Graphic *graphic, KapaImageWidget *image));
    204204int           ToggleDEG           PROTO((Graphic *graphic, KapaImageWidget *image));
     205int           ToggleHEX           PROTO((Graphic *graphic, KapaImageWidget *image));
    205206int           FlipImageX          PROTO((Graphic *graphic, KapaImageWidget *image));
    206207int           FlipImageY          PROTO((Graphic *graphic, KapaImageWidget *image));
  • branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/structures.h

    r27790 r29214  
    186186  Button   recenter_button;
    187187  Button   hms_button; /* toggle HMS/DECIMAL mode (DECIMAL_DEG macro) */
     188  Button   hex_button; /* toggle HEX / FLOAT mode */
    188189  Button   grey_button;
    189190  Button   rainbow_button;
     
    199200  int      MovePointer;
    200201  int      DecimalDegrees;
     202  int      HexValue;
    201203
    202204  // double   X, Y;           /* image pixel at screen center */
  • branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/ButtonFunctions.c

    r25757 r29214  
    11# include "Ximage.h"
     2# include "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
  • branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/CheckButtons.c

    r16810 r29214  
    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))
  • branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/Image.c

    r27435 r29214  
    7070  image[0].MovePointer = TRUE;
    7171  image[0].DecimalDegrees  = TRUE;
     72  image[0].HexValue  = FALSE;
     73
    7274  ALLOCATE (image[0].picture.data, char, 1);   /* allocate so later free will not crash! */
    7375  ALLOCATE (image[0].cmapbar.data, char, 1);   /* allocate so later free will not crash! */
     
    104106  InitButtonFunc (&image[0].overlay_button[3], Overlay3);
    105107
    106   InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits);
     108  if (image[0].DecimalDegrees) {
     109    InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits);
     110  } else {
     111    InitButtonSize (&image[0].hms_button, ddd_width, ddd_height, ddd_bits);
     112  }
    107113  InitButtonFunc (&image[0].hms_button, ToggleDEG);
     114
     115  InitButtonSize (&image[0].hex_button, hex_width, hex_height, hex_bits);
     116  InitButtonFunc (&image[0].hex_button, ToggleHEX);
    108117
    109118  InitButtonSize (&image[0].flipx_button, flipx_width, flipx_height, flipx_bits);
     
    117126
    118127void InitButtonSize (Button *button, int width, int height, char *bitmap) {
    119   button->dx = BUTTON_WIDTH;
    120   button->dy = BUTTON_HEIGHT;
     128  button->dx = width + 2;
     129  button->dy = height + 2;
    121130  button->width = width;
    122131  button->height = height;
     
    185194    DrawButton (graphic, &image[0].heat_button);
    186195    DrawButton (graphic, &image[0].hms_button);
     196    DrawButton (graphic, &image[0].hex_button);
    187197
    188198    DrawButton (graphic, &image[0].flipx_button);
  • branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/SetImageSize.c

    r16810 r29214  
    9696      image[0].hms_button.y = image[0].overlay_button[0].y;
    9797
     98      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     99      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
     100
    98101      image[0].PS_button.x = image[0].text_x;
    99102      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     
    175178      image[0].hms_button.y = image[0].overlay_button[0].y;
    176179
     180      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     181      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
     182
    177183      image[0].PS_button.x = image[0].text_x;
    178184      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     
    254260      image[0].hms_button.y = image[0].overlay_button[0].y;
    255261
     262      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     263      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
     264
    256265      image[0].PS_button.x = image[0].zoom.x;
    257266      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
     
    332341      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
    333342      image[0].hms_button.y = image[0].overlay_button[0].y;
     343
     344      image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
     345      image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1;
    334346
    335347      image[0].PS_button.x = image[0].zoom.x;
  • branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/UpdateStatusBox.c

    r25757 r29214  
    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));
Note: See TracChangeset for help on using the changeset viewer.