Changeset 29539
- Timestamp:
- Oct 25, 2010, 12:44:51 PM (16 years ago)
- Location:
- trunk/Ohana/src/kapa2
- Files:
-
- 21 edited
- 2 copied
-
doc/notes.txt (modified) (1 diff)
-
include/buttons.h (modified) (2 diffs)
-
include/hms_buttons.h (copied) (copied from branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/hms_buttons.h )
-
include/prototypes.h (modified) (2 diffs)
-
include/structures.h (modified) (3 diffs)
-
src/ButtonFunctions.c (modified) (2 diffs)
-
src/CheckButtons.c (modified) (1 diff)
-
src/DrawFrame.c (modified) (2 diffs)
-
src/DrawObjects.c (modified) (4 diffs)
-
src/EraseCurrentPlot.c (modified) (1 diff)
-
src/EraseImage.c (modified) (1 diff)
-
src/Graphs.c (modified) (3 diffs)
-
src/Image.c (modified) (6 diffs)
-
src/LoadFrame.c (modified) (1 diff)
-
src/LoadLabels.c (modified) (1 diff)
-
src/LoadObject.c (modified) (1 diff)
-
src/LoadTextlines.c (modified) (1 diff)
-
src/PSFrame.c (modified) (1 diff)
-
src/SetGraphSize.c (modified) (4 diffs)
-
src/SetImageSize.c (modified) (15 diffs)
-
src/UpdateStatusBox.c (modified) (1 diff)
-
src/bDrawFrame.c (modified) (1 diff)
-
test/layout.pro (copied) (copied from branches/eam_branches/ipp-20100823/Ohana/src/kapa2/test/layout.pro )
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa2/doc/notes.txt
r27790 r29539 1 2 2010.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 1 10 2 11 2010.04.14 -
trunk/Ohana/src/kapa2/include/buttons.h
r17419 r29539 107 107 0x00, 0x30, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 108 108 0x00, 0x00, 0x00, 0x00}; 109 #define hms_width 25110 #define hms_height 25111 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};121 109 #define flipx_width 25 122 110 #define flipx_height 25 … … 143 131 0x00, 0x82, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 144 132 0x00, 0x10, 0x00, 0x00 }; 133 #define hex_width 25 134 #define hex_height 12 135 static 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 42 42 void AxisTickScale PROTO((Axis *axis, double *major, double *minor)); 43 43 TickMarkData *CreateAxisTicks PROTO((Axis *axis, int *nticks)); 44 int PrintTick PROTO((char *string, double value, double min, double max)); 44 45 45 46 /* EventLoop */ … … 203 204 int RecenterRescale PROTO((Graphic *graphic, KapaImageWidget *image)); 204 205 int ToggleDEG PROTO((Graphic *graphic, KapaImageWidget *image)); 206 int ToggleHEX PROTO((Graphic *graphic, KapaImageWidget *image)); 205 207 int FlipImageX PROTO((Graphic *graphic, KapaImageWidget *image)); 206 208 int FlipImageY PROTO((Graphic *graphic, KapaImageWidget *image)); -
trunk/Ohana/src/kapa2/include/structures.h
r27790 r29539 161 161 Label *textline; /* placed text labels */ 162 162 int Ntextline; 163 int haveGraph; // is there anything in the plot window? 163 164 } KapaGraphWidget; 164 165 … … 186 187 Button recenter_button; 187 188 Button hms_button; /* toggle HMS/DECIMAL mode (DECIMAL_DEG macro) */ 189 Button hex_button; /* toggle HEX / FLOAT mode */ 188 190 Button grey_button; 189 191 Button rainbow_button; … … 199 201 int MovePointer; 200 202 int DecimalDegrees; 203 int HexValue; 201 204 202 205 // double X, Y; /* image pixel at screen center */ -
trunk/Ohana/src/kapa2/src/ButtonFunctions.c
r25757 r29539 1 1 # include "Ximage.h" 2 # include "hms_buttons.h" 2 3 3 4 int PSfunction (Graphic *graphic, KapaImageWidget *image) { … … 103 104 104 105 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 113 int ToggleHEX (Graphic *graphic, KapaImageWidget *image) { 114 115 image[0].HexValue = image[0].HexValue ^ TRUE; 105 116 StatusBox (graphic, image); 106 117 FlushDisplay (); 107 118 return (TRUE); 108 109 119 } 110 120 -
trunk/Ohana/src/kapa2/src/CheckButtons.c
r16810 r29539 25 25 if (InButton (event, &image[0].hms_button)) 26 26 button = &image[0].hms_button; 27 28 if (InButton (event, &image[0].hex_button)) 29 button = &image[0].hex_button; 27 30 28 31 if (InButton (event, &image[0].flipx_button)) -
trunk/Ohana/src/kapa2/src/DrawFrame.c
r29013 r29539 43 43 } 44 44 45 int 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 45 72 void DrawTick (Graphic *graphic, Axis *axis, int P, TickMarkData *tick, int naxis) { 46 73 … … 101 128 xt = fx + (value-min)*dfx/(max - min) + dx; 102 129 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); 105 132 DrawRotText (xt, yt, string, pos, 0.0); 106 133 } -
trunk/Ohana/src/kapa2/src/DrawObjects.c
r27530 r29539 517 517 } 518 518 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 519 525 for (i = 0; i + 1 < object[0].Npts; i+=2) { 520 526 if (!(finite(x[i]) && finite(y[i]))) continue; … … 524 530 sx2 = x[i+1]*mxi + y[i+1]*mxj + bx; 525 531 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); 527 533 } 528 534 } … … 674 680 } 675 681 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 676 687 for (i = 0; i + 1 < object[0].Npts; i+=2) { 677 688 if (!(finite(x[i]) && finite(y[i]))) continue; … … 680 691 sx2 = x[i+1]*mxi + y[i+1]*mxj + bx; 681 692 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); 683 694 } 684 695 } -
trunk/Ohana/src/kapa2/src/EraseCurrentPlot.c
r21153 r29539 15 15 16 16 if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window); 17 18 SetSectionSizes (section); 17 19 Refresh (); 18 20 -
trunk/Ohana/src/kapa2/src/EraseImage.c
r14590 r29539 15 15 section->image = NULL; 16 16 17 if (USE_XWINDOW) Refresh (); 17 if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window); 18 19 SetSectionSizes (section); 20 Refresh (); 18 21 return (TRUE); 19 22 } -
trunk/Ohana/src/kapa2/src/Graphs.c
r27790 r29539 8 8 9 9 ALLOCATE (graph, KapaGraphWidget, 1); 10 11 graph[0].haveGraph = FALSE; 10 12 11 13 /* set up axis positions */ … … 82 84 void DrawGraph (KapaGraphWidget *graph) { 83 85 if (graph == NULL) return; 86 if (!graph[0].haveGraph) return; 87 84 88 DrawFrame (graph); 85 89 DrawObjects (graph); … … 94 98 95 99 if (graph == NULL) return; 100 graph[0].haveGraph = FALSE; 96 101 97 102 /* free data objects, then re-alloc those needed */ -
trunk/Ohana/src/kapa2/src/Image.c
r27435 r29539 1 1 # include "Ximage.h" 2 2 # include "buttons.h" 3 # include "hms_buttons.h" 3 4 4 5 int InitImageChannel (KapaImageChannel *channel) { … … 10 11 channel->slope = 1; 11 12 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"); 12 21 channel->coords.Npolyterms = 0; 22 13 23 channel->matrix.datasize = 0; /* a flag to show there is no data in the matrix */ 14 24 ALLOCATE (channel->matrix.buffer, char, 1); /* allocate so later free will not crash! */ … … 70 80 image[0].MovePointer = TRUE; 71 81 image[0].DecimalDegrees = TRUE; 82 image[0].HexValue = FALSE; 83 72 84 ALLOCATE (image[0].picture.data, char, 1); /* allocate so later free will not crash! */ 73 85 ALLOCATE (image[0].cmapbar.data, char, 1); /* allocate so later free will not crash! */ … … 104 116 InitButtonFunc (&image[0].overlay_button[3], Overlay3); 105 117 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 } 107 123 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); 108 127 109 128 InitButtonSize (&image[0].flipx_button, flipx_width, flipx_height, flipx_bits); … … 117 136 118 137 void 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; 121 140 button->width = width; 122 141 button->height = height; … … 185 204 DrawButton (graphic, &image[0].heat_button); 186 205 DrawButton (graphic, &image[0].hms_button); 206 DrawButton (graphic, &image[0].hex_button); 187 207 188 208 DrawButton (graphic, &image[0].flipx_button); -
trunk/Ohana/src/kapa2/src/LoadFrame.c
r27790 r29539 15 15 16 16 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; 17 20 18 21 graph[0].axis[3].min = graph[0].axis[1].min; -
trunk/Ohana/src/kapa2/src/LoadLabels.c
r17466 r29539 14 14 } 15 15 graph = section->graph; 16 16 graph[0].haveGraph = TRUE; 17 17 18 KiiScanMessage (sock, "%d", &mode); 18 19 label = KiiRecvData (sock); -
trunk/Ohana/src/kapa2/src/LoadObject.c
r27486 r29539 15 15 } 16 16 graph = section->graph; 17 graph[0].haveGraph = TRUE; 17 18 18 19 N = graph[0].Nobjects; -
trunk/Ohana/src/kapa2/src/LoadTextlines.c
r19830 r29539 11 11 section = GetActiveSection(); 12 12 graph = section->graph; 13 if (section->graph == NULL) {13 if (section->graph == NULL) { 14 14 section->graph = InitGraph (); 15 15 SetSectionSizes (section); 16 16 graph = section->graph; 17 17 } 18 graph[0].haveGraph = TRUE; 18 19 19 20 graph[0].Ntextline = MAX (graph[0].Ntextline, 0); -
trunk/Ohana/src/kapa2/src/PSFrame.c
r28347 r29539 94 94 xt = fx + (value-min)*dfx/(max - min) + dx; 95 95 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); 98 98 PSRotText (f, xt, yt, string, pos, 0.0); 99 99 } -
trunk/Ohana/src/kapa2/src/SetGraphSize.c
r27902 r29539 72 72 for (i = 0; i < Nticks; i++) { 73 73 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); 76 78 } 77 79 FREE(ticks); … … 96 98 for (i = 0; i < Nticks; i++) { 97 99 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); 100 102 } 101 103 FREE(ticks); … … 112 114 } 113 115 114 /* basic size of the graph in Xwindow coordinates */116 /* basic size of the graph in Xwindow coordinates, but measured from lower-left corner */ 115 117 X0 = graphic[0].dx * section[0].x + padYm; 116 118 Y0 = graphic[0].dy * section[0].y + padXm; … … 125 127 126 128 switch (section->image->location) { 129 case 0: 130 // no changes? 131 break; 127 132 case 1: 128 Y0 = graphic[0].dy * section[0].y + 2*PAD1 + WdY + 2; // tied to image in Y129 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; 130 135 break; 131 136 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; 133 138 break; 134 139 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; 137 143 break; 138 144 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; 140 147 break; 141 148 } -
trunk/Ohana/src/kapa2/src/SetImageSize.c
r16810 r29539 1 # include "Ximage.h"1 # include "Ximage.h" 2 2 3 3 /* Set the dimensions of the specific image based on the current window size. The image … … 9 9 int Xs, Ys, dX, dY; 10 10 int textpad, textdY, WdY; 11 int haveGraph; 11 12 KapaImageWidget *image; 12 13 KapaGraphWidget *graph; … … 17 18 if (image == NULL) return; 18 19 graph = section->graph; 20 haveGraph = graph && graph->haveGraph; 19 21 20 22 graphic = GetGraphic (); … … 33 35 34 36 case 0: // no zoom / status / wide 35 if ( section->graph) {37 if (haveGraph) { 36 38 image[0].picture.x = graph[0].axis[0].fx; 37 39 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); 39 41 image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1); 40 42 } else { 41 43 image[0].picture.x = Xs + PAD1; 42 44 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; 45 47 } 46 48 if (USE_XWINDOW) CreatePicture (image, graphic); … … 48 50 return; 49 51 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; 62 64 } 63 65 … … 72 74 image[0].zoom.dy = ZOOM_Y; 73 75 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; 75 77 76 78 /** everything below is tied in x-dir to the zoom box **/ … … 96 98 image[0].hms_button.y = image[0].overlay_button[0].y; 97 99 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 98 103 image[0].PS_button.x = image[0].text_x; 99 104 image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1; … … 127 132 break; 128 133 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) { 132 137 image[0].picture.x = graph[0].axis[0].fx; 133 138 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); 135 140 image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1); 136 141 } else { 137 image[0].picture.dx = dX - 2*PAD1;138 image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD;139 142 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; 141 146 } 142 147 … … 175 180 image[0].hms_button.y = image[0].overlay_button[0].y; 176 181 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 177 185 image[0].PS_button.x = image[0].text_x; 178 186 image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1; … … 206 214 break; 207 215 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; 212 220 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); 214 222 image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1); 215 223 } else { 216 image[0].picture.dx = dX - 3*PAD1 - ZOOM_X;217 image[0].picture.dy = dY - 3*PAD1 - COLORPAD;218 224 image[0].picture.x = Xs + 2*PAD1 + ZOOM_X; 219 225 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; 220 228 } 221 229 … … 230 238 image[0].zoom.dy = ZOOM_Y; 231 239 image[0].zoom.x = Xs + PAD1; 232 image[0].zoom.y = image[0].picture.y;240 image[0].zoom.y = Ys + 2*PAD1 + COLORPAD; 233 241 234 242 /** everything below is tied in x-dir to the zoom box **/ … … 254 262 image[0].hms_button.y = image[0].overlay_button[0].y; 255 263 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 256 267 image[0].PS_button.x = image[0].zoom.x; 257 268 image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1; … … 285 296 break; 286 297 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) { 290 301 image[0].picture.x = graph[0].axis[0].fx; 291 302 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); 293 304 image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1); 294 305 } else { 295 image[0].picture.dx = dX - 3*PAD1 - ZOOM_X;296 image[0].picture.dy = dY - 3*PAD1 - COLORPAD;297 306 image[0].picture.x = Xs + PAD1; 298 307 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; 299 310 } 300 311 … … 308 319 image[0].zoom.dx = ZOOM_X; 309 320 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; 312 323 313 324 /** everything below is tied in x-dir to the zoom box **/ … … 332 343 image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1; 333 344 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; 334 348 335 349 image[0].PS_button.x = image[0].zoom.x; -
trunk/Ohana/src/kapa2/src/UpdateStatusBox.c
r25757 r29539 43 43 } 44 44 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 } 46 51 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 47 52 image[0].text_x + PAD1, image[0].text_y + textpad + PAD1, line, strlen(line)); -
trunk/Ohana/src/kapa2/src/bDrawFrame.c
r28347 r29539 93 93 xt = fx + (value-min)*dfx/(max - min) + dx; 94 94 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); 97 97 bDrawRotText (xt, yt, string, pos, 0.0); 98 98 }
Note:
See TracChangeset
for help on using the changeset viewer.
