home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / JSL.ZIP / JSL20 / examples / PrintProcess.java < prev   
Encoding:
Java Source  |  1998-02-20  |  957 b   |  37 lines

  1.  
  2. package examples;
  3.  
  4. import simula.*;
  5. import simula.simset.simulation.*;
  6.  
  7. public class PrintProcess extends simula.simset.simulation.Process {
  8.  
  9.     String name;
  10.  
  11.  
  12.     public PrintProcess(String name, Simulation _sim){
  13.         super(_sim);
  14.         this.name = name;
  15.     }
  16.     public void run() {
  17.         int flag = 0;
  18.  
  19.         if (flag == 0) {
  20.             Lang.outtext("..4, 3, 2, ignition sequence start, 1, there we go.. :> " + name) ;
  21.             Lang.outtext("First Stage ignited :> " + name) ;
  22.             flag = 1;
  23.         }
  24.         try {
  25.             Lang.outtext("Second Stage ignition scheduled at time : " + (4 + evTime) + " :> "+ name);
  26.             sim.hold(4);
  27.  
  28.             Lang.outtext("Second Stage ignited :> " + name);
  29.             Lang.outtext("Orbit reached, closing rockets valves :> " + name);
  30.             sim.passivate();
  31.  
  32.         } catch(SimulaException e) {
  33.             Lang.outtext("French Guyana space center, we got a problem :> " + e.getMessage());
  34.         }
  35.     }
  36.     public String toString() { return (String) (name + " (" + evTime + ")"); }
  37. }