IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27637


Ignore:
Timestamp:
Apr 8, 2010, 8:39:05 AM (16 years ago)
Author:
eugene
Message:

improvements to the kapa section options

Location:
branches/eam_branches/Ohana.20100407/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/Ohana.20100407/src/kapa2/include/prototypes.h

    r27530 r27637  
    4747int           Reconfig            PROTO((XEvent *event));
    4848void          Refresh             PROTO((void));
     49void          DrawSectionBG       PROTO((Graphic *graphic, Section *section));
    4950
    5051/* CheckPipe */
     
    6162int           SetSection          PROTO((int sock));
    6263int           ListSection         PROTO((int sock));
     64int           SetSectionBG        PROTO((int sock));
    6365int           MoveSection         PROTO((int sock));
    6466int           DefineSection       PROTO((int sock));
     
    8486void          FreeSection         PROTO((Section *section));
    8587void          FreeSections        PROTO((void));
    86 Section      *AddSection          PROTO((char *name, float x, float y, float dx, float dy));
     88Section      *AddSection          PROTO((char *name, float x, float y, float dx, float dy, int bg));
    8789int           DelSection          PROTO((char *name));
    8890int           GetSectionByName    PROTO((char *name));
  • branches/eam_branches/Ohana.20100407/src/kapa2/include/structures.h

    r25757 r27637  
    210210  float  x,  y;
    211211  float dx, dy;
     212  int bg;
    212213  char *name;
    213214} Section;
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/DefineSection.c

    r27636 r27637  
    44int DefineSection (int sock) {
    55 
    6   int N, MoveSection;
     6  int N, MoveSection, bg;
    77  char name[128];
    88  double x, y, dx, dy;
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/EraseSections.c

    r21153 r27637  
    88 
    99  FreeSections ();
    10   AddSection ("default", 0.0, 0.0, 1.0, 1.0);
     10  AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1);
    1111
    1212  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/Layout.c

    r14737 r27637  
    4343
    4444  /* create basic section, empty of image or graph */
    45   section = AddSection ("default", 0.0, 0.0, 1.0, 1.0);
     45  section = AddSection ("default", 0.0, 0.0, 1.0, 1.0, -1);
    4646}
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/Refresh.c

    r21153 r27637  
    2121  for (i = 0; i < Nsection; i++) {
    2222      section = GetSectionByNumber (i);
     23      DrawSectionBG (graphic, section);
    2324      DrawImage (section->image);
    2425      DrawGraph (section->graph);
     
    2829}
    2930
     31void DrawSectionBG (Graphic *graphic, Section *section) {
     32
     33  int X0, Y0, dX, dY;
     34  if (section->bg == -1) return;
     35
     36  XSetForeground (graphic->display, graphic->gc, graphic->color[section->bg]);
     37
     38  dY = graphic[0].dy * section[0].dy;
     39  dX = graphic[0].dx * section[0].dx;
     40  Y0 = graphic[0].dy - graphic[0].dy * section[0].y - dY;
     41  X0 = graphic[0].dx * section[0].x;
     42  fprintf (stderr, "section: (%s) %d %d - %d %d\n", section[0].name, X0, Y0, dX, dY);
     43
     44  XFillRectangle (graphic[0].display,  graphic[0].window, graphic[0].gc, X0, Y0, dX, dY);
     45  return;
     46}
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/Sections.c

    r27636 r27637  
    9393}
    9494
    95 int SetSectionBG (char *name) {
    96 
    97   int i;
    98 
    99   for (i = 0; i < Nsections; i++) {
    100     if (strcmp (name, sections[i][0].name)) continue;
    101     sections[i][0].bg =
    102   }
    103   return (-1);
    104 }
    105 
    10695int GetNumberOfSections () {
    10796  return (Nsections);
     
    168157}
    169158
     159int SetSectionBG (int sock) {
     160
     161  int N, background;
     162  char name[128];
     163
     164  KiiScanMessage (sock, "%s %d", name, &background);
     165 
     166  N = GetSectionByName (name);
     167  if (N < 0) {
     168    fprintf (stderr, "section %s not found\n", name);
     169    return (TRUE);
     170  }
     171
     172  sections[N][0].bg = background;
     173
     174  return (TRUE);
     175}
     176
    170177// return TRUE even for nonsense cases to avoid quitting kapa
    171178int MoveSection (int sock) {
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/SetGraphSize.c

    r16011 r27637  
    6262    }
    6363  }
     64  fprintf (stderr, "graph: (%s) %f %f - %f %f\n", section[0].name, X0, Y0, dX, dY);
    6465
    6566  /* define locations of coordinate axes */
  • branches/eam_branches/Ohana.20100407/src/libkapa/include/kapa.h

    r27636 r27637  
    174174int KapaSelectSection (int fd, char *name);
    175175int KapaGetSection (int fd, char *name);
     176int KapaSectionBG (int fd, char *name, int bg);
    176177int KapaMoveSection (int fd, char *name, char *direction);
    177178int KapaSetGraphData (int fd, Graphdata *graphmode);
  • branches/eam_branches/Ohana.20100407/src/opihi/cmd.data/section.c

    r27636 r27637  
    55int section (int argc, char **argv) {
    66 
    7   int N, action, kapa;
     7  int N, action, kapa, background;
    88  Graphdata graphmode;
    99  KapaSection section;
     
    9191
    9292      case BG:
    93         KapaSectionBG (kapa, argv[1], bg);
     93        KapaSectionBG (kapa, argv[1], background);
    9494        break;
    9595
Note: See TracChangeset for help on using the changeset viewer.