/* Copyright (C) 1997, Alexander Pukhov 
   Copyright (C) 2001-2003, CompHEP Collaboration
 *--------------------------------------------------
 *$Id: n_comphep_.c,v 1.5 2003/11/08 19:46:05 kryukov Exp $
 *
 *$Log: n_comphep_.c,v $
 *Revision 1.5  2003/11/08 19:46:05  kryukov
 *To bring into according the usage of messanykey and warnanykey functions.
 *
*/
#include "chep_crt/include/chep_crt.h"
#include "service2/include/tptcmac.h"
#include "service2/include/os.h"
#include "service2/include/files.h"
#include "out_ext.h"

#include "out_int.h"

#include "rw_sess.h"
#include "mc_menu.h"
#include "param.h"
#include "width_12.h"
#include "n_comphep_.h"

int interpret = 1;

void 
n_comphep (void)
{
  char ExitMessage[] = "Exit Interpreter?";

  if (interpret)
    {
      wrtprc_ ();
      inipar_ ();
    }
  else
    strcpy (ExitMessage, "Quit session?");

  clr_scr (FGmain, BGmain);

  if (nprc_ > 1)
    {
      goto_xy (4, 2);
      clr_eol ();
      scrcolor (Red, BGmain);
      print ("Process: ");
      scrcolor (Black, BGmain);
      print (processch);
      scrcolor (Red, BGmain);
      print (" (%d subprocesses)", nprc_);
    }

  if (calcFunc ())
    {
      warnanykey (15, 15, "Wrong parameters.\n Can not evaluate constraints");
      change_parameter (54, 7);
    }

  do
    {
      if (nin_ == 1 && nout_ == 2)
	decay12 ();
      else
	monte_carlo_menu ();
    }
  while (!mess_y_n (15, 15, ExitMessage));

  if (interpret)
    clearSession ();
  else
    w_sess__ (NULL);
}
