IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27636


Ignore:
Timestamp:
Apr 7, 2010, 5:00:10 PM (16 years ago)
Author:
eugene
Message:

adding section backgrouns

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

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/CheckPipe.c

    r25757 r27636  
    221221  }
    222222 
     223  if (!strcmp (word, "BSEC")) {
     224    status = SetSectionBG (sock);
     225    KiiSendCommand (sock, 4, "DONE");
     226    FINISHED (TRUE);
     227  }
     228 
    223229  if (!strcmp (word, "FONT")) {
    224230    status = SetFont (sock);
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/DefineSection.c

    r21153 r27636  
    99  Section *section;
    1010
    11   KiiScanMessage (sock, "%s %lf %lf %lf %lf", name, &x, &y, &dx, &dy);
     11  KiiScanMessage (sock, "%s %lf %lf %lf %lf %d", name, &x, &y, &dx, &dy, &bg);
    1212
    1313  MoveSection = FALSE;
     
    1515  N = GetSectionByName (name);
    1616  if (N < 0) {
    17     section = AddSection (name, x, y, dx, dy);
     17    section = AddSection (name, x, y, dx, dy, bg);
    1818    MoveSection = TRUE;
    1919  } else {
     
    3030    section[0].dx = dx;
    3131    section[0].dy = dy;
     32    section[0].bg = bg;
    3233  }
    3334
  • branches/eam_branches/Ohana.20100407/src/kapa2/src/Sections.c

    r21153 r27636  
    1616  section[0].dx = 0;
    1717  section[0].dy = 0;
     18  section[0].bg = -1;
    1819
    1920  section[0].name = NULL;
     
    4243}
    4344
    44 Section *AddSection (char *name, float x, float y, float dx, float dy) {
     45Section *AddSection (char *name, float x, float y, float dx, float dy, int bg) {
    4546
    4647  int N;
     
    6162  sections[N][0].dx = dx;
    6263  sections[N][0].dy = dy;
     64  sections[N][0].bg = bg;
    6365  ActiveSection = N;
    6466  return (sections[N]);
     
    9193}
    9294
     95int 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
    93106int GetNumberOfSections () {
    94107  return (Nsections);
  • branches/eam_branches/Ohana.20100407/src/libkapa/include/kapa.h

    r27435 r27636  
    7272  float dx;
    7373  float dy;
     74  int bg;
    7475} KapaSection;
    7576
  • branches/eam_branches/Ohana.20100407/src/libkapa/src/KapaWindow.c

    r27588 r27636  
    312312
    313313  KiiSendCommand (fd, 4, "DSEC");
    314   KiiSendMessage (fd, "%s %6.3f %6.3f %6.3f %6.3f",
     314  KiiSendMessage (fd, "%s %6.3f %6.3f %6.3f %6.3f %3d",
    315315                  section[0].name,
    316316                  section[0].x,
    317317                  section[0].y,
    318318                  section[0].dx,
    319                   section[0].dy);
     319                  section[0].dy,
     320                  section[0].bg);
     321  KiiWaitAnswer (fd, "DONE");
     322  return (TRUE);
     323}
     324
     325int KapaSectionBG (int fd, char *name, int bg) {
     326
     327  KiiSendCommand (fd, 4, "BSEC");
     328  KiiSendMessage (fd, "%s %3d", name, bg);
    320329  KiiWaitAnswer (fd, "DONE");
    321330  return (TRUE);
  • branches/eam_branches/Ohana.20100407/src/opihi/cmd.data/section.c

    r27491 r27636  
    11# include "data.h"
    22
    3 enum {NONE, LIST, UP, DOWN, TOP, BOTTOM, TOOL};
     3enum {NONE, LIST, UP, DOWN, TOP, BOTTOM, TOOL, BG};
    44
    55int section (int argc, char **argv) {
     
    3737    location = argv[N];
    3838    remove_argument (N, &argc, argv);
     39  }
     40
     41  background = -1; // invisible
     42  if ((N = get_argument (argc, argv, "-bg"))) {
     43    remove_argument (N, &argc, argv);
     44    background = KapaColorByName(argv[N]);
     45    remove_argument (N, &argc, argv);
     46    action = BG;
    3947  }
    4048
     
    8290        break;
    8391
     92      case BG:
     93        KapaSectionBG (kapa, argv[1], bg);
     94        break;
     95
    8496      case TOOL:
    8597        if (!strcmp(location, "-x")) {
     
    121133    section.dx = atof (argv[4]);
    122134    section.dy = atof (argv[5]);
     135    section.bg = background;
    123136    KapaSetSection (kapa, &section);
    124137    return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.