IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7960


Ignore:
Timestamp:
Jul 24, 2006, 3:15:49 PM (20 years ago)
Author:
eugene
Message:

updates to pantasks client/server; new API for command

Location:
trunk/Ohana/src/opihi
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/dvo.c

    r7917 r7960  
    1717  InitAstro ();
    1818  InitDVO ();
     19
     20  gprintInit ();
    1921
    2022  if (!SetCATDIR (NULL, FALSE)) {
     
    4850  return;
    4951}
     52
     53/* call to opihi shell */
     54int main (int argc, char **argv) {
     55  int status;
     56  status = opihi (argc, argv);
     57  exit (status);
     58}
  • trunk/Ohana/src/opihi/dvo/fitcolors.c

    r7917 r7960  
    268268      /* perform robust fit on dmag vs color */
    269269      cmd = strcreate ("fit tmp_x tmp_y 1 -clip 3 3 -quiet");
    270       status = command (cmd, &outcmd);
     270      status = command (cmd, &outcmd, TRUE);
    271271      if (outcmd != NULL) free (outcmd);
    272272     
  • trunk/Ohana/src/opihi/dvo/fitsed.c

    r7917 r7960  
    8585    remove_argument (N, &argc, argv);
    8686    PLOT = TRUE;
    87   }
    88 
    89   SAVEDIR = NULL;
    90   if ((N = get_argument (argc, argv, "-save"))) {
    91     remove_argument (N, &argc, argv);
    92     SAVEDIR = strcreate (argv[N]);
    93     remove_argument (N, &argc, argv);
    9487  }
    9588
  • trunk/Ohana/src/opihi/dvo/gstar.c

    r7917 r7960  
    11# include "dvoshell.h"
    22
    3 void print_value (double value, short int ival);
    43void initPhotcodeSequence (int Nsec);
    54void freePhotcodeSequence ();
  • trunk/Ohana/src/opihi/include/dvoshell.h

    r7680 r7960  
    8888int           match_image           PROTO((Image *image, int Nimage, unsigned int T, short int S));
    8989int           match_image_subset    PROTO((Image *image, int *subset, int Nsubset, unsigned int T, short int S));
    90 void          print_value           PROTO((FILE *f, double value, short int ival));
     90void          print_value           PROTO((double value, short int ival));
    9191void          sort_image_subset     PROTO((Image *image, int *subset, int N));
    9292void          sort_images           PROTO((Image *image, int N));
  • trunk/Ohana/src/opihi/include/pantasks.h

    r7952 r7960  
    217217void CheckTasksSetState (int state);
    218218int CheckTasksGetState ();
    219 void CheckTasksThread ();
     219void CheckTasksThread (void *data);
     220
    220221void CheckJobsSetState (int state);
    221222int CheckJobsGetState ();
    222 void CheckJobsThread ();
     223void CheckJobsThread (void *data);
     224
    223225void CheckControllerSetState (int state);
    224226int CheckControllerGetState ();
    225 void CheckControllerThread ();
     227void CheckControllerThread (void *data);
     228
    226229void CheckInputsSetState (int state);
    227230int CheckInputsGetState ();
    228 void CheckInputsThread ();
     231void CheckInputsThread (void *data);
    229232
    230233// functions related to the queue of input files
  • trunk/Ohana/src/opihi/pantasks/Makefile

    r7952 r7960  
    4848$(SDIR)/kill.$(ARCH).o \
    4949$(SDIR)/delete.$(ARCH).o \
    50 $(SDIR)/server.$(ARCH).o \
    5150$(SDIR)/verbose.$(ARCH).o \
    5251$(SDIR)/controller.$(ARCH).o \
     
    7978$(SDIR)/InputQueue.$(ARCH).o \
    8079$(SDIR)/ListenClients.$(ARCH).o \
     80$(SDIR)/server.$(ARCH).o \
     81$(SDIR)/status_server.$(ARCH).o \
     82$(SDIR)/init_server.$(ARCH).o \
    8183$(SDIR)/CheckPassword.$(ARCH).o
    8284
  • trunk/Ohana/src/opihi/pantasks/init.c

    r7929 r7960  
    3838};
    3939
    40 /* these are functions which duplicate actions on the
    41    controller.  these could simply pass the command along
    42    to the controller (and should then be in 'controller'),
    43    or they could add / modify the jobs in the scheduler
    44    job stack
    45 
    46   {"job",        job,          "add job"},
    47   {"kill",       kill_sh,      "kill job"},
    48   {"delete",     delete,       "delete job"},
    49   {"stdout",     stdout_sh,    "get stdout buffer for job"},
    50   {"stderr",     stderr_sh,    "get stderr buffer for job"},
    51 */
    52 
    5340void InitPantasks () {
    5441 
     
    6249    AddCommand (&cmds[i]);
    6350  }
    64 
    6551}
    66 
    67 int server         PROTO((int, char **));
    68 
    69 static Command server_cmds[] = { 
    70   {"server",  server,   "server-specific commands"},
    71 };
    72 
    73 void InitPantasksServer () {
    74  
    75   int i;
    76 
    77   InitTasks ();
    78   InitJobs ();
    79   InitJobIDs ();
    80 
    81   for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
    82     AddCommand (&cmds[i]);
    83   }
    84   for (i = 0; i < sizeof (server_cmds) / sizeof (Command); i++) {
    85     AddCommand (&server_cmds[i]);
    86   }
    87 
    88 }
  • trunk/Ohana/src/opihi/pantasks/pantasks.c

    r7917 r7960  
    1616  InitData ();
    1717  InitPantasks ();
     18
     19  gprintInit ();
    1820
    1921  rl_readline_name = opihi_name;
     
    5456  return;
    5557}
     58
     59/* call to opihi shell */
     60int main (int argc, char **argv) {
     61  int status;
     62  status = opihi (argc, argv);
     63  exit (status);
     64}
  • trunk/Ohana/src/opihi/pantasks/server_threads.c

    r7952 r7960  
    2424}
    2525
    26 void CheckTasksThread () {
     26void CheckTasksThread (void *data) {
    2727
    2828  gprintInit ();  // each thread needs to init the printing system
     
    5555}
    5656
    57 void CheckJobsThread () {
     57void CheckJobsThread (void *data) {
    5858
    5959  gprintInit ();  // each thread needs to init the printing system
     
    8686}
    8787
    88 void CheckControllerThread () {
     88void CheckControllerThread (void *data) {
    8989
    9090  gprintInit ();  // each thread needs to init the printing system
     
    118118}
    119119
    120 void CheckInputsThread () {
     120void CheckInputsThread (void *data) {
    121121
    122122  gprintInit ();  // each thread needs to init the printing system
  • trunk/Ohana/src/opihi/pantasks/status.c

    r7952 r7960  
    1414    gprint (GP_LOG, " Controller is stopped\n");
    1515  }
    16   if (CheckTasksGetState()) {
    17     gprint (GP_LOG, " Scheduler is running\n");
    18   } else {
    19     gprint (GP_LOG, " Scheduler is stopped\n");
    20   }
    21   if (CheckControllerGetState()) {
    22     gprint (GP_LOG, " Controller is running\n");
    23   } else {
    24     gprint (GP_LOG, " Controller is stopped\n");
    25   }
    2616  ListTasks (FALSE);
    2717  ListJobs ();
    2818  return (TRUE);
    2919}
    30 
  • trunk/Ohana/src/opihi/pantasks/task.c

    r7917 r7960  
    9696      case TASK_COMMAND:
    9797      case TASK_PERIODS:
    98         status = command (input, &outline);
     98        status = command (input, &outline, TRUE);
    9999        if (outline != NULL) free (outline);
    100100        /* what to do if command is invalid?
  • trunk/Ohana/src/opihi/pclient/pclient.c

    r7917 r7960  
    5353}
    5454
     55/* call to opihi shell */
     56int main (int argc, char **argv) {
     57  int status;
     58  status = opihi (argc, argv);
     59  exit (status);
     60}
  • trunk/Ohana/src/opihi/pcontrol/pcontrol.c

    r7917 r7960  
    5252  return;
    5353}
     54
     55/* call to opihi shell */
     56int main (int argc, char **argv) {
     57  int status;
     58  status = opihi (argc, argv);
     59  exit (status);
     60}
Note: See TracChangeset for help on using the changeset viewer.