diff options
Diffstat (limited to 'TAO/examples/Simulator/DOVEBrowser')
26 files changed, 0 insertions, 3462 deletions
diff --git a/TAO/examples/Simulator/DOVEBrowser/AnswerEvent.java b/TAO/examples/Simulator/DOVEBrowser/AnswerEvent.java deleted file mode 100644 index c10ae7d766a..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/AnswerEvent.java +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ -// -// = FILENAME -// AnswerEvent.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// Event definition for the Dialog for selecting Observables. -// -// ============================================================================ - -public class AnswerEvent extends java.util.EventObject { - - protected String selected_; - - public AnswerEvent (Object source, String selected) { - super (source); - this.selected_ = selected; - } -} - diff --git a/TAO/examples/Simulator/DOVEBrowser/AnswerListener.java b/TAO/examples/Simulator/DOVEBrowser/AnswerListener.java deleted file mode 100644 index 77d43646729..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/AnswerListener.java +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ -// -// = FILENAME -// AnswerListener.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// EventListener definition for the Dialog for selecting Observables. -// -// ============================================================================ - - -public class AnswerListener implements java.util.EventListener { - public void ok (AnswerEvent e) {} - public void cancel (AnswerEvent e) {} -} diff --git a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.html b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.html deleted file mode 100644 index 5502857d548..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.html +++ /dev/null @@ -1,30 +0,0 @@ -<HTML> -<HEAD> -<META NAME="DOVEBrowser" Content="DOVE Browser invokation"> -<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1"> -<TITLE>Document Title</TITLE> -</HEAD> -<BODY> - -Note: When used with Visibroker, the gatekeeper must run in the DOVEBrowser directory! -Note: The IORs are different for each machine! So exchange the IORs below. - - -NT Name Service IOR -<PARAM NAME="NSIOR" VALUE="IOR:010000002000000049444c3a436f734e616d696e672f4e616d696e67436f6e746578743a312e30000100000000000000520000000101000015000000636f727269646f2e63732e777573746c2e65647500003a272e0000005033353265633733313030303537613538526f6f74504f412f6368696c645f706f612f4e616d6553657276696365"> - -Unix Name ServiceIOR -<PARAM NAME="NSIOR" VALUE="IOR:000000000000002049444c3a436f734e616d696e672f4e616d696e67436f6e746578743a312e3000000000010000000000000042000100000000000674616e676f00953f0000002e5033353265623733353030306533653133526f6f74504f412f6368696c645f706f612f4e616d6553657276696365"> - -Use this to run it with the appletviewer and Visibroker -<param name=org.omg.CORBA.ORBClass value=com.visigenic.vbroker.orb.ORB> - -Use this to run it within Netscape -<param name=USE_ORB_LOCATOR value=true> - -<APPLET code="DOVEBrowserApplet.class" width=700 height=600> -<PARAM NAME="NSIOR" VALUE="IOR:010000002000000049444c3a436f734e616d696e672f4e616d696e67436f6e746578743a312e30000100000000000000520000000101000015000000636f727269646f2e63732e777573746c2e65647500003a272e0000005033353265633733313030303537613538526f6f74504f412f6368696c645f706f612f4e616d6553657276696365"> -</APPLET> - -</BODY> -</HTML> diff --git a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java deleted file mode 100644 index 6c3ef2e71e3..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowser.java +++ /dev/null @@ -1,87 +0,0 @@ -// $Id$ -// -// = FILENAME -// DOVEBrowser.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// Entry point for the demo. -// -// ============================================================================ - - -import java.awt.*; - -public class DOVEBrowser { - - DemoCore demoCore_; - - public DOVEBrowser () { - super (); - } - - public void init (String nameServiceIOR, String nameServicePort, - String[] args, boolean use_queueing) { - - demoCore_ = new DemoCore (nameServiceIOR, - nameServicePort, - args, - use_queueing, - null); - demoCore_.show (); - demoCore_.run (); - } - - public static void main (String[] args) { - String nameServiceIOR = null; - String nameServicePort = null; - boolean use_queueing = false; - int arg_index = 0; - - // Loop through command line arguments, acting on relevant options - while (args.length > arg_index) - { - System.out.println ("args.length [" + args.length + "] arg_index [" + - arg_index + "]"); - // Set the name service IOR - if (args[arg_index].equals ("-queue")) - { - ++arg_index; - use_queueing = true; - } - else if ((args[arg_index].equals ("-ORBnameserviceior")) && - (args.length > arg_index + 1)) - { - System.out.println ("switch [" + args[arg_index] + "]"); - System.out.println ("value [" + args[arg_index + 1] + "]"); - nameServiceIOR = args[arg_index + 1]; - System.out.println ("nameServiceIOR [" + nameServiceIOR + "]"); - arg_index += 2; - } - // Set the name service port - else if ((args[arg_index].equals ("-ORBnameserviceport")) && - (args.length > arg_index + 1)) - { - System.out.println ("switch [" + args[arg_index] + "]"); - System.out.println ("value [" + args[arg_index + 1] + "]"); - nameServicePort = args[arg_index + 1]; - System.out.println ("nameServicePort [" + nameServicePort + "]"); - arg_index += 2; - } - // Skip over anything else - else - { - System.out.println ("Skipping [" + args[arg_index] + "]"); - arg_index ++; - } - } - - DOVEBrowser doveBrowser = new DOVEBrowser(); - doveBrowser.init (nameServiceIOR, nameServicePort, args, use_queueing); - } -} - - - diff --git a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowserApplet.java b/TAO/examples/Simulator/DOVEBrowser/DOVEBrowserApplet.java deleted file mode 100644 index 160eb3a363b..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/DOVEBrowserApplet.java +++ /dev/null @@ -1,51 +0,0 @@ -// $Id$ -// -// = FILENAME -// DOVEBrowserApplet.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// Entry point for the demo when started inside an applet. -// -// ============================================================================ - - -import java.awt.*; - -public class DOVEBrowserApplet extends java.applet.Applet { - - DemoCore demoCore_; - static String nameServiceIOR_ = null; - - public DOVEBrowserApplet () { - super (); - } - - public void init () { - // in case of an applet use the following line, else not! - nameServiceIOR_ = this.getParameter ("NSIOR"); - - if (nameServiceIOR_ == null) { - System.out.println ("The DOVE Browser cannot run, because no Naming Service IOR was found!"); - return; - } - - demoCore_ = new DemoCore (nameServiceIOR_, // name service IOR - null, // name service port - null, // args - false, // don't use queueing - this); // pointer to the applet - demoCore_.show (); - demoCore_.run (); - } -} - - - - - - - - diff --git a/TAO/examples/Simulator/DOVEBrowser/DataHandler.java b/TAO/examples/Simulator/DOVEBrowser/DataHandler.java deleted file mode 100644 index 090cccf089d..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/DataHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -// $Id$ -// -// = FILENAME -// DataHandler.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is the interface for data handling in the simulation demo -// using the Event Channel as transport media. -// -// ============================================================================ - -import org.omg.CORBA.*; - -public interface DataHandler { - - // entry point for an consumer to put data event into the data handler - public void update (RtecEventComm.Event event); - - // get a list of the Observables names to allow selection - public java.util.Enumeration getObservablesList (); - - // get a specific Observable - public DemoObservable getObservable(String name); - - // get the property of an observable - public int getObservableProperty (String name); -} - - - - diff --git a/TAO/examples/Simulator/DOVEBrowser/DemoCore.java b/TAO/examples/Simulator/DOVEBrowser/DemoCore.java deleted file mode 100644 index 9c371342923..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/DemoCore.java +++ /dev/null @@ -1,204 +0,0 @@ -// $Id$ -// -// = FILENAME -// DemoCore.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This class servers as the core class of the simulation demo. -// It connects the push consumer of the event service with -// one or several Java Beans. -// -// ============================================================================ - - -import java.awt.*; -import java.awt.event.*; - -public class DemoCore extends Frame { - - private static final int MAX_VIS_COMPS = 10; - - private PushConsumerFactory pushConsumerFactory_; - private VisCompFactory visCompFactory_; - private DataHandler dataHandler_; - private java.util.Vector vis_comp_list_; - private int countVisComp_ = 0; - private GridBagLayout gridbag_; - private GridBagConstraints constraints_; - private boolean use_queueing_ = false; - private boolean connections_established_ = false; - - DemoCore (String nameServiceIOR, - String nameServicePort, - String[] args, - boolean use_queueing, - java.applet.Applet applet) { - super (); - - use_queueing = use_queueing; - - setSize (600,400); - setBounds (new Rectangle (50,50,800,500)); - setVisible (true); - - gridbag_ = new GridBagLayout(); - constraints_ = new GridBagConstraints(); - constraints_.fill = GridBagConstraints.BOTH; - constraints_.weightx = 1.0; - constraints_.weighty = 1.0; - this.setLayout (gridbag_); - - // Instantiate the DataHandler and the PushConsumer - dataHandler_ = new NavWeapDataHandler (); - pushConsumerFactory_ = new PushConsumerFactory (dataHandler_, - nameServiceIOR, - nameServicePort, - args, - use_queueing_, - applet); - - // List of Visualization Components - vis_comp_list_ = new java.util.Vector(); - - MenuBar menubar_ = new MenuBar (); - Menu menu_ = new Menu ("File"); - MenuItem menu_quit_item_ = new MenuItem ("Quit"); - menu_quit_item_.setEnabled (true); - MenuItem menu_add_item_ = new MenuItem ("Add"); - menu_add_item_.setEnabled (true); - menu_.add (menu_add_item_); - menu_.add (menu_quit_item_); - menubar_.add (menu_); - - setMenuBar (menubar_); - - menu_quit_item_.addActionListener (new ActionListener () - { - public void actionPerformed (ActionEvent e) { - System.exit (0); - } - }); - - menu_add_item_.addActionListener (new ActionListener () - { - public void actionPerformed (ActionEvent e) { - ObservablesDialog obsDialog_ = - new ObservablesDialog (DemoCore.this, - dataHandler_.getObservablesList()); - obsDialog_.addAnswerListener (new AnswerListener () - { - public void ok (AnswerEvent e) - { - DemoCore.this.addConnection (e.selected_); - } - }); - obsDialog_.setVisible (true); - } - }); - - // instantiate the Factory for Visualization Components - visCompFactory_ = new VisCompFactory (); - - // Traverse the args looking for switches that determine connections. - int arg_index = 0; - while (args.length > arg_index) - { - if (args[arg_index].equals ("-dualECdemo") || - args[arg_index].equals ("-dualECdemo1") || - args[arg_index].equals ("-dualECdemo2")) - { - // Use monotonic scales in the double precision data windows - DoubleVisComp.monotonic_scale (true); - - // Establish connections - if (! connections_established_) - { - connections_established_ = true; - addConnection ("Weapons"); - addConnection ("Weapons Latency (100 ns)"); - addConnection ("Weapons Latency Jitter (100 ns)"); - addConnection ("Navigation"); - addConnection ("Navigation Latency (100 ns)"); - addConnection ("Navigation Latency Jitter (100 ns)"); - break; - } - } - // Skip over anything else. - else - { - arg_index ++; - } - } - - - // If connections have not been established, set up defaults - if (! connections_established_) - { - connections_established_ = true; - addConnection ("Weapons"); - addConnection ("Weapons Latency (100 ns)"); - addConnection ("Navigation"); - addConnection ("Navigation Latency (100 ns)"); - } - } - - - public boolean addConnection (String selected) { - // to not fill too many into it - if (countVisComp_ < MAX_VIS_COMPS) { - - // get a reference to the Observable - DemoObservable observable_ = dataHandler_.getObservable (selected); - - if (observable_ != null) { - - VisComp visComp_ = visCompFactory_.getNewVisComp (observable_.getProperty (), selected); - - if (visComp_ != null) { - vis_comp_list_.addElement (visComp_); - - // connect the Observer with the Observable - observable_.addObserver (visComp_); - - countVisComp_++; - - // not more than three in a row - if (countVisComp_ == 3){ - constraints_.gridwidth = GridBagConstraints.REMAINDER; - } - if (countVisComp_ > 3) { - constraints_.gridwidth = 1; - } - - gridbag_.setConstraints ((java.awt.Component) visComp_, constraints_); - - // add the Visualization Component to the Frame - DemoCore.this.add ((java.awt.Component) visComp_); - DemoCore.this.show (); - - return true; - } - } - } - return false; - } - - public void init () - { - } - - public void paint (Graphics g) - { - } - - public void run () - { - // Wait passive until events come in - pushConsumerFactory_.run (); - } -} - - diff --git a/TAO/examples/Simulator/DOVEBrowser/DemoObservable.java b/TAO/examples/Simulator/DOVEBrowser/DemoObservable.java deleted file mode 100644 index 81c85b961f8..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/DemoObservable.java +++ /dev/null @@ -1,19 +0,0 @@ -// $Id$ -// -// = FILENAME -// DemoObservable.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This class servers as the core class of the simulation demo -// -// ============================================================================ - - - -public abstract class DemoObservable extends java.util.Observable { - - public abstract int getProperty (); -} diff --git a/TAO/examples/Simulator/DOVEBrowser/DoubleVisComp.java b/TAO/examples/Simulator/DOVEBrowser/DoubleVisComp.java deleted file mode 100644 index 228d9931fc7..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/DoubleVisComp.java +++ /dev/null @@ -1,275 +0,0 @@ -// $Id$ -// -// = FILENAME -// DoubleVisComp.java -// -// = AUTHOR -// Seth Widoff (core graph functionality) -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is a Visualization Component for displaying doubles. -// -// ============================================================================ - - - - -import java.awt.*; -import java.util.*; - -public class DoubleVisComp extends Canvas implements VisComp -{ - private static final int MIN_SPACING = 2; - private static final int POINT_HISTORY = 200; - private static final Font FONT = new Font ("Dialog", Font.PLAIN, 10); - - private Queue plot_; - private String title_; - private Graphics offgraphics_; - private Image offscreen_; - private Dimension offscreensize_; - private int max_value_; - private int old_max_value_; - private int spacing_; - private boolean max_increased_ = false; - private static boolean monotonic_scale_ = false; - - private float local_max_ = 0; - private static float local_max_values_ [] = null; - private static int local_max_value_count_ = 0; - private int local_max_value_index_ = 0; - - public DoubleVisComp() - { - super(); - - // Re-initialize the global array of local maxima. - local_max_init (); - - plot_ = new Queue(); - spacing_ = MIN_SPACING; - title_ = ""; - max_value_ = 1; - old_max_value_ = max_value_; - - java.util.Random rand = new java.util.Random (System.currentTimeMillis()); - float hue_ = rand.nextFloat(); - float brightness = rand.nextFloat(); - - hue_ += .075; - - if (hue_ > 1.0) - hue_ -= 1.0; - - if (brightness > 0.75) - brightness -= 0.25; - - Color new_color = Color.getHSBColor(hue_, 1, brightness); - - this.setBackground(new_color); - this.setForeground(Color.white); - } - - public static synchronized void monotonic_scale (boolean b) { - monotonic_scale_ = b; - } - - public static synchronized boolean monotonic_scale () { - return monotonic_scale_; - } - - public void setName (String title) { - title_ = title; - } - - public int getProperty () { - return Properties.DOUBLE; - } - - public Dimension getMinimumSize () { - return new Dimension (75, 75); - } - - public Dimension getPreferredSize () { - return new Dimension (175, 175); - } - - public String getName() { - return title_; - } - - public int getMax() { - return old_max_value_; - } - - public void update(java.util.Observable observable, java.lang.Object obj) - { - Double double_temp_; - try { - double_temp_ = (Double) obj; - } - catch (Exception excp) { - double_temp_ = new Double (0.0); - System.out.println (excp); - System.out.println ("Visualization Component received wrong data type!"); - } - - float new_point = double_temp_.floatValue(); - Float temp = (Float)plot_.dequeue_tail(); - plot_.enqueue_head(new Float(new_point)); - - if (new_point > local_max_) - { - local_max_ = new_point; - local_max_values_ [local_max_value_index_] = local_max_; - } - - if (monotonic_scale_) - { - float global_max = 0; - global_max = global_max_value (); - - while (global_max > max_value_) - max_value_ *= 2; - - while ((global_max < max_value_/2) && (max_value_ > old_max_value_)) - max_value_ /= 2; - } - else - { - while (local_max_ > max_value_) - max_value_ *= 2; - - while ((local_max_ < max_value_/2) && (max_value_ > old_max_value_)) - max_value_ /= 2; - } - - repaint(); - } - - public void update(Graphics g) - { - Dimension d = getSize (); - float tmp, value_1, value_2; - FontMetrics fm = g.getFontMetrics (); - Enumeration queue_iter = plot_.forward_iterator(); - int x1 = d.width - 8, y1, x2, y2, fheight = fm.getHeight (), i; - String value = "Value (of " + max_value_ + "): " + String.valueOf(plot_.head()); - - if ((offscreen_ == null) || - (offscreensize_.width != d.width - 8) || - (offscreensize_.height != d.height - 8)) - { - offscreen_ = createImage(d.width - 8, d.height - 8); - offscreensize_ = new Dimension(d.width - 8, d.height - 8); - offgraphics_ = offscreen_.getGraphics(); - offgraphics_.setFont(FONT); - } - - g.setColor (Color.lightGray); - g.draw3DRect (0, 0, d.width - 1, d.height - 1, true); - g.draw3DRect (1, 1, d.width - 3, d.height - 3, true); - g.draw3DRect (2, 2, d.width - 5, d.height - 5, true); - - local_max_ = 0; - - offgraphics_.setColor (getBackground()); - offgraphics_.fillRect (0, 0, offscreensize_.width, offscreensize_.height); - offgraphics_.setColor (getForeground()); - offgraphics_.drawString(title_, 5, fheight); - offgraphics_.drawString(value, 5, offscreensize_.height - 5); - - value_1 = ((Float)queue_iter.nextElement()).floatValue(); - while (queue_iter.hasMoreElements()) - { - value_2 = ((Float)queue_iter.nextElement()).floatValue(); - - if (value_1 > local_max_) - local_max_ = value_1; - - y1 = normalize(offscreensize_.height - fheight, value_1); - y2 = normalize(offscreensize_.height - fheight, value_2); - - tmp = value_2; - value_2 = value_1; - value_1 = tmp; - - x2 = x1 - spacing_; - offgraphics_.drawLine(x1, y1, x2, y2); - x1 = x2; - if (x1 <= 5) - break; - } - - local_max_values_ [local_max_value_index_] = local_max_; - - g.drawImage(offscreen_, 3, 3, null); - } - - public void paint(Graphics g) - { - Dimension d = getSize (); - int plot_length = plot_.length(); - int num_points = d.width / spacing_; - - if (plot_.length() < num_points) - { - for (int i = 0; i < num_points - plot_length; i++) - plot_.enqueue_tail(new Float(0)); - } - else if (plot_.length() > num_points) - { - for (int i = 0; i < plot_length - num_points; i++) - plot_.dequeue_tail(); - } - - update(g); - } - - private static synchronized float global_max_value () { - float result = 0; - - for (int i = 0; i < local_max_value_count_; ++i) - { - if (result < local_max_values_ [i]) - { - result = local_max_values_ [i]; - } - } - - return result; - } - - private synchronized void local_max_init () { - - // Create a new, larger, array to hold the local maxima - float new_max_values [] = - new float [local_max_value_count_ + 1]; - - // Copy the previously stored maxima (if any) into the new array. - for (int i = 0; i < local_max_value_count_; ++i) - { - new_max_values [i] = local_max_values_ [i]; - } - - // Replace the old array with the new one. - local_max_values_ = new_max_values; - - // Store the local index for this object, bump up the count. - local_max_value_index_ = local_max_value_count_; - local_max_value_count_++; - } - - - private int normalize(int height, float coord) - { - float ratio = (float)coord/max_value_; - float pixels = (float)height*ratio; - float location = (float)height - pixels; - - return Math.round(location); - } -} - - diff --git a/TAO/examples/Simulator/DOVEBrowser/MTDataHandlerAdapter.java b/TAO/examples/Simulator/DOVEBrowser/MTDataHandlerAdapter.java deleted file mode 100644 index 5025c0a8e6d..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/MTDataHandlerAdapter.java +++ /dev/null @@ -1,76 +0,0 @@ -// $Id$ - -// This is an adapter class for a data handler to be used in a separate -// thread. The adapter provides a push method that places an event -// set into its synchronized internal MTQueue. It runs a separate thread -// which blocks until there is an event in the queue, then dequeues the -// event and then unpacks it and updates the underlying data handler. - -public class MTDataHandlerAdapter extends Thread -{ - // Both the queue and the underlying data handler are private - private MTQueue queue_ = null; - private DataHandler dataHandler_ = null; - private boolean use_queueing_ = false; - - // Constructor. - MTDataHandlerAdapter (DataHandler dh, boolean use_queueing) - { - dataHandler_ = dh; - use_queueing_ = use_queueing; - if (use_queueing_) - { - queue_ = new MTQueue (); - } - } - - // Enqueue an event set for the handler thread. - public void push (RtecEventComm.Event[] events) - { - if (use_queueing_) - { - queue_.enqueue_tail (events); - } - else - { - for (int i = 0; i < events.length; ++i) - { - if(events[i].header.type == - PushConsumer.ACE_ES_EVENT_NOTIFICATION) - { - dataHandler_.update (events[i]); - } - } - } - } - - // Process enqueued event sets in a separate thread. - public void run () - { - // Loop forever, handling events. - for (;;) - { - try - { - // Pull an event set from the head of the queue - RtecEventComm.Event[] events = - (RtecEventComm.Event[]) queue_.dequeue_head (); - - for (int i = 0; i < events.length; ++i) - { - if(events[i].header.type == - PushConsumer.ACE_ES_EVENT_NOTIFICATION) - { - dataHandler_.update (events[i]); - } - } - } - catch(org.omg.CORBA.SystemException e) - { - System.err.println(e); - } - } - } -} - - diff --git a/TAO/examples/Simulator/DOVEBrowser/MTQueue.java b/TAO/examples/Simulator/DOVEBrowser/MTQueue.java deleted file mode 100644 index 357c872c4dc..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/MTQueue.java +++ /dev/null @@ -1,200 +0,0 @@ -// $Id$ - -// This is a queue class for use by multiple threads, with at least one -// thread enqueueing objects and another dequeueing them. The dequeue_* -// methods block the thread if there are no more objects in the queue, -// while the try_dequeue_* methods do not block but rather return a -// null reference if there is nothing in the queue. -public class MTQueue -{ - // Initially, the head and tail of the queue are null - MTQueue_Node head_ = null; - MTQueue_Node tail_ = null; - - // Constructor - does nothing. - public MTQueue () - { - } - - // Places a passed Object at the end of the queue. - public synchronized void enqueue_tail (Object new_data) - { - // Create a new node to hold the object. - MTQueue_Node new_node = new MTQueue_Node(new_data); - - // Insert the node into the queue. - if (tail_ == null) - { - tail_ = new_node; - head_ = new_node; - } - else - { - new_node.prev_ = tail_; - tail_.next_ = new_node; - tail_ = new_node; - } - - // Wake up any waiting threads - notifyAll (); - } - - // Places a passed Object at the front of the queue. - public synchronized void enqueue_head(Object new_data) - { - // Create a new node to hold the object. - MTQueue_Node new_node = new MTQueue_Node(new_data); - - // Insert the node into the queue. - if (head_ == null) - { - tail_ = new_node; - head_ = new_node; - } - else - { - new_node.next_ = head_; - head_.prev_ = new_node; - head_ = new_node; - } - - // Wake up any waiting threads - notifyAll (); - } - - // Try to remove an object from the head of the queue - nonblocking. - public synchronized Object try_dequeue_head() - { - // Start with a null reference. - Object return_value = null; - - // If there's anything there, dequeue it. - if (head_ != null) - { - return_value = dequeue_head (); - } - - // Return what we found, if anything. - return return_value; - } - - // Remove an object from the head of the queue - blocking. - public synchronized Object dequeue_head() - { - // Start with a null reference. - Object return_value = null; - - // Wait until there's something to dequeue. - while (head_ == null) - { - try - { - wait (); - } - catch (InterruptedException e) - { - return return_value; - } - } - - // Dequeue the object at the head of the queue. Make sure - // to null out references within dequeued nodes to prevent - // out of memory errors. - if (tail_ == head_) - { - return_value = head_.data_; - head_.next_ = null; - head_.prev_ = null; - head_.data_ = null; - tail_ = null; - head_ = null; - } - else - { - return_value = head_.data_; - head_ = head_.next_; - head_.prev_.next_ = null; - head_.prev_.prev_ = null; - head_.prev_.data_ = null; - head_.prev_ = null; - } - - // Return the object we dequeued. - return return_value; - } - - // Try to remove an object from the tail of the queue - nonblocking. - public synchronized Object try_dequeue_tail () - { - // Start with a null reference. - Object return_value = null; - - // If there's anything there, dequeue it. - if (tail_ != null) - { - return_value = dequeue_tail (); - } - - // Return what we found, if anything. - return return_value; - } - - // Remove an object from the tail of the queue - blocking. - public synchronized Object dequeue_tail () - { - // Start with a null reference. - Object return_value = null; - - // Wait until there's something to dequeue. - while (tail_ == null) - { - try - { - wait (); - } - catch (InterruptedException e) - { - return return_value; - } - } - - // Dequeue the object at the back of the queue. Make sure - // to null out references within dequeued nodes to prevent - // out of memory errors. - if (tail_ == head_) - { - return_value = tail_.data_; - tail_.data_ = null; - tail_.next_ = null; - tail_.prev_ = null; - tail_ = null; - head_ = null; - } - else - { - return_value = tail_.data_; - tail_ = tail_.prev_; - tail_.next_.data_ = null; - tail_.next_.next_ = null; - tail_.next_.prev_ = null; - tail_.next_ = null; - } - - // Return the object we dequeued. - return return_value; - } -} - -class MTQueue_Node -{ - public MTQueue_Node prev_ = null; - public MTQueue_Node next_ = null;; - public Object data_; - - public MTQueue_Node(Object data) - { - data_ = data; - } -} - - diff --git a/TAO/examples/Simulator/DOVEBrowser/Makefile b/TAO/examples/Simulator/DOVEBrowser/Makefile deleted file mode 100644 index dc2a7f4612b..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/Makefile +++ /dev/null @@ -1,109 +0,0 @@ -#---------------------------------------------------------------------------- -# -# $Id$ -# -#---------------------------------------------------------------------------- - -ifndef TAO_ROOT - TAO_ROOT = $(ACE_ROOT)/TAO -endif # ! TAO_ROOT - -#### VisiBroker 3.3 -JAVA_DIR = /project/doc/pkg/VisiJava3.3/bin/ -IDL2JAVA = $(JAVA_DIR)idl2java -JAVAC = $(JAVA_DIR)vbjc - -#### JDK 1.2 -#### JAVA_DIR = /pkg/java_1.2b4/bin/ -#### IDL2JAVA = $(JAVA_DIR)idltojava -#### JAVAC = $(JAVA_DIR)javac - -DOVE_BROWSER_JAVA = \ - CosNaming.java \ - CosTimeBase.java \ - RtecEventComm.java \ - RtecScheduler.java \ - RtecEventChannelAdmin.java \ - Navigation.java \ - Weapons.java - -DOVE_BROWSER_CLASS = Navigation.class - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU - -BUILD = $(DOVE_BROWSER_JAVA) $(DOVE_BROWSER_CLASS) - -ifeq ($(CROSS-COMPILE),) - include $(ACE_ROOT)/include/makeinclude/macros.GNU - include $(TAO_ROOT)/rules.tao.GNU - include $(ACE_ROOT)/include/makeinclude/rules.common.GNU - include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU - include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - include $(TAO_ROOT)/taoconfig.mk - - realclean: clean - -/bin/rm -rf $(DOVE_BROWSER_JAVA) \ - $(patsubst %.java,%.idl,$(DOVE_BROWSER_JAVA)) NavWeap.idl \ - Navigation.java NavigationH*.java \ - Weapons.java WeaponsH*.java *.class CosNaming \ - RtecEventChannelAdmin RtecEventComm RtecScheduler TimeBase - -else - all default_embedded: - @echo This module is not built on CROSS-COMPILE platforms. - - clean realclean: - @echo Nothing to clean on CROSS-COMPILE platforms. -endif # ! CROSS-COMPILE - -#### No need to create object directories. -OBJDIRS = - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -.SUFFIXES: -.SUFFIXES: .class .idl .java - -#### Don't remove the .idl and .java files after building the .class files. -.PRECIOUS: $(DOVE_BROWSER_JAVA) $(patsubst %.java,%.idl,$(DOVE_BROWSER_JAVA)) - -%.java: %.idl - @$(IDL2JAVA) $< - - -#### VisiBroker 3.2 idl2java creates references to a _long type, -#### but never defines it. Just change it to long if it's present. -files=$(find . -name '*.java' | xargs egrep -l ' _long') -ifneq (,$(files)) - %.class: %.java - perl -pi -e 's/\b_long\b/long/g' $(files) -else # ! vbjc - %.class: %.java -endif # vbjc - @$(JAVAC) *.java - -NavWeap.idl: ../NavWeap.idl - @cp -p $< . - -Navigation.java Weapons.java: NavWeap.idl - @$(IDL2JAVA) $< - -%.idl: $(TAO_ROOT)/orbsvcs/orbsvcs/%.idl - @cp -p $< . - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - - - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/examples/Simulator/DOVEBrowser/NS_Resolve.java b/TAO/examples/Simulator/DOVEBrowser/NS_Resolve.java deleted file mode 100644 index 51eedd40742..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/NS_Resolve.java +++ /dev/null @@ -1,125 +0,0 @@ -// $Id$ -// ============================================================================ -// -// -// = FILENAME -// NS_Resolve.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// Resolves the initial reference to the Naming service, -// the orb has to be given as a parameter to the -// resolve_name_service call. -// -// -// ============================================================================ - - - - -import org.omg.CORBA.*; -import java.net.*; -import java.io.*; - - -public class NS_Resolve -{ - - private static final String ACE_DEFAULT_MULTICAST_ADDR = "224.9.9.2"; - private static final int TAO_DEFAULT_NAME_SERVER_REQUEST_PORT = 10013; - private static final int MULTICAST_SEND_PORT = 10060; - private static final int MULTICAST_RECEIVE_PORT = 10061; - private static final int TAO_SERVICEID_NAMESERVICE = 0; - private static final int TAO_SERVICEID_TRADINGSERVICE = 1; - - org.omg.CORBA.Object name_service_; - int nameServicePort_; - - public NS_Resolve (String nameServicePort) - { - if (nameServicePort != null) - { - // If a name service port string was given, parse it - nameServicePort_ = Integer.parseInt (nameServicePort); - } - else - { - // Otherwise, just use the default TAO name service port - nameServicePort_ = TAO_DEFAULT_NAME_SERVER_REQUEST_PORT; - } - } - - public org.omg.CORBA.Object resolve_name_service (org.omg.CORBA.ORB orb) - { - try - { - // Create a message with the multicast receive port in it - ByteArrayOutputStream byte_stream_ = new ByteArrayOutputStream (); - byte_stream_.write ((int)((MULTICAST_RECEIVE_PORT&0xff00)>>>8)); - byte_stream_.write ((int)(MULTICAST_RECEIVE_PORT&0x00ff)); - byte_stream_.write ((int)((TAO_SERVICEID_NAMESERVICE&0xff00)>>>8)); - byte_stream_.write ((int)(TAO_SERVICEID_NAMESERVICE&0x00ff)); - byte[] msg = byte_stream_.toByteArray(); - - - // Define the group for the multicast - - InetAddress group = InetAddress.getByName(ACE_DEFAULT_MULTICAST_ADDR); - // Create the multicast socket at any port you want - MulticastSocket multicastsocket_ = new MulticastSocket(MULTICAST_SEND_PORT); - // Create a socket for the answer of the Naming Service - DatagramSocket socket_ = new DatagramSocket (MULTICAST_RECEIVE_PORT); - // Give three seconds time for the Naming Service to respond - socket_.setSoTimeout (3000); - // Build a packet with the port number in it - DatagramPacket hello = new DatagramPacket(msg, msg.length, - group, nameServicePort_); - - // Send the packet - multicastsocket_.send (hello); - - // @@ The restriction right now is that the length of the IOR cannot be longer than 4096 - byte[] buf = new byte[4096]; - // Set up packet which can be received - DatagramPacket recv = new DatagramPacket (buf, buf.length); - // Receive a packet or time out - socket_.receive (recv); - - // Determine the length of the IOR - int length; - for (length = 0; buf[length] != 0; length++); - - // Store the IOR in a String - String name_service_ior_ = new String (recv.getData (),0,length); - - // Convert the String into - return orb.string_to_object (name_service_ior_); - } - catch (SocketException e) - { - System.err.println (e); - } - catch (java.io.InterruptedIOException e) - { - System.err.println ("NS_Resolve: The receive lasted too long"); - } - catch(org.omg.CORBA.SystemException e) - { - System.err.println(e); - } - catch (java.io.IOException e) - { - System.err.println (e); - } - return null; - - } - -}; - - - - - diff --git a/TAO/examples/Simulator/DOVEBrowser/NavWeapDataHandler.java b/TAO/examples/Simulator/DOVEBrowser/NavWeapDataHandler.java deleted file mode 100644 index 1ce57c686e4..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/NavWeapDataHandler.java +++ /dev/null @@ -1,305 +0,0 @@ -// $Id$ -// -// = FILENAME -// NavWeapDataHandler.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is an implementation of the interface Data Handler, -// it handles Navigation and Weapons data, where statistic data is -// part of it. Several Observables are declared, they can be accessed by -// any number of Observers, which could reside in a Java Bean for example. -// -// ============================================================================ - -import org.omg.CORBA.*; - -public class NavWeapDataHandler implements DataHandler { - - java.util.Hashtable ObservablesTable; - int received_events_; - - - // Observable for Navigation data - class NavigationObservable extends DemoObservable { - - // to ask which kind of viewer is needed to display data - public int getProperty () { - return Properties.NAVIGATION; - } - - public void updateNavigation (Navigation navigation) { - setChanged (); - notifyObservers (navigation); - } - - } - - class WeaponsObservable extends DemoObservable { - - // to ask which kind of viewer is needed to display data - public int getProperty () { - return Properties.WEAPONS; - } - - public void updateWeapons (Weapons weapons) { - setChanged (); - notifyObservers (weapons); - } - } - - class Cpu_UsageObservable extends DemoObservable { - - public int getProperty () { - return Properties.DOUBLE; - } - - public void updateCpu_Usage (double utilization) { - setChanged (); - Double temp_ = new Double (utilization); - notifyObservers (temp_); - } - } - class OverheadObservable extends DemoObservable { - - public int getProperty () { - return Properties.DOUBLE; - } - - public void updateOverhead (double overhead) { - setChanged (); - Double temp_ = new Double (overhead); - notifyObservers (temp_); - } - } - class JitterObservable extends DemoObservable { - double latency = 0.0; - double avg_latency = 0.0; - double sample_count = 0.0; - - public int getProperty () { - return Properties.DOUBLE; - } - - public void updateJitter (long completion_time, - long computation_time, - long arrival_time) { - - latency = (double)(completion_time) - - (double)(computation_time) - - (double)(arrival_time); - latency = latency > 0 ? latency : 0; - - sample_count = sample_count + 1.0; - avg_latency = (avg_latency * (sample_count - 1.0) + latency) / - (sample_count); - - double jitter_ = (double)Math.abs(latency - avg_latency); - - setChanged (); - Double temp_ = new Double (jitter_); - notifyObservers (temp_); - } - } - class DeadlinesObservable extends DemoObservable { - - public int getProperty () { - return Properties.DOUBLE; - } - - public void updateDeadlines (long deadline_time, - long completion_time) { - - double missed_ = (deadline_time < completion_time) ? 1.0 : 0.0; - Double temp_ = new Double (missed_); - setChanged (); - notifyObservers (temp_); - } - } - class CriticalDeadlinesObservable extends DeadlinesObservable { - - public int getProperty () { - return Properties.DOUBLE; - } - - public void updateDeadlines (long deadline_time, - long completion_time, - long criticality) { - - double missed_ = ((criticality > 0) && - (deadline_time < completion_time)) ? 1.0 : 0.0; - Double temp_ = new Double (missed_); - setChanged (); - notifyObservers (temp_); - } - } - - class LatencyObservable extends DemoObservable { - double latency = 0.0; - double last_latency = 0.0; - - public int getProperty () { - return Properties.DOUBLE; - } - - public void updateLatency (long completion_time, - long computation_time, - long arrival_time) { - last_latency = latency; - latency = (double)(completion_time) - - (double)(computation_time) - - (double)(arrival_time); - latency = latency > 0 ? latency : 0; - - setChanged (); - Double temp_ = new Double(latency); - notifyObservers (temp_); - } - } - - - public synchronized void update (RtecEventComm.Event event) { - - Any any_value = event.data.any_value; - - if (any_value.type().equal (NavigationHelper.type())) - { - Navigation navigation_ = NavigationHelper.extract (any_value); - - // if the navigation data structure's update data flag is set, - // update its scheduling data with actual values from the EC - if (navigation_.update_data > 0) - { - navigation_.arrival_time = event.header.creation_time; - navigation_.completion_time = event.header.ec_send_time; - navigation_.deadline_time += event.header.creation_time; - } - - NavigationObservable nobs = (NavigationObservable)ObservablesTable.get ("Navigation"); - nobs.updateNavigation (navigation_); - Cpu_UsageObservable cobs = (Cpu_UsageObservable)ObservablesTable.get ("CPU Usage"); - cobs.updateCpu_Usage (navigation_.utilization); - OverheadObservable oobs = (OverheadObservable)ObservablesTable.get ("Overhead"); - oobs.updateOverhead (navigation_.overhead); - JitterObservable jobs = (JitterObservable)ObservablesTable.get ("Latency Jitter (100 ns)"); - jobs.updateJitter (navigation_.completion_time, - navigation_.computation_time, - navigation_.arrival_time); - JitterObservable njobs = (JitterObservable)ObservablesTable.get ("Navigation Latency Jitter (100 ns)"); - njobs.updateJitter (navigation_.completion_time, - navigation_.computation_time, - navigation_.arrival_time); - DeadlinesObservable dobs = (DeadlinesObservable)ObservablesTable.get ("Missed Deadlines"); - dobs.updateDeadlines (navigation_.deadline_time, - navigation_.completion_time); - CriticalDeadlinesObservable cdobs = - (CriticalDeadlinesObservable)ObservablesTable.get ("Missed Critical Deadlines"); - cdobs.updateDeadlines (navigation_.deadline_time, - navigation_.completion_time, - navigation_.criticality); - LatencyObservable lobs = (LatencyObservable)ObservablesTable.get ("Latency (100 ns)"); - lobs.updateLatency (navigation_.completion_time, - navigation_.computation_time, - navigation_.arrival_time); - LatencyObservable nlobs = (LatencyObservable)ObservablesTable.get ("Navigation Latency (100 ns)"); - nlobs.updateLatency (navigation_.completion_time, - navigation_.computation_time, - navigation_.arrival_time); - received_events_++; - } - else if (any_value.type().equal (WeaponsHelper.type())) - { - Weapons weapons_ = WeaponsHelper.extract (any_value); - - // if the weapons structure's update data flag is set, update - // itss scheduling data with actual values from the EC - if (weapons_.update_data > 0) - { - weapons_.arrival_time = event.header.creation_time; - weapons_.completion_time = event.header.ec_send_time; - weapons_.deadline_time += event.header.creation_time; - } - - WeaponsObservable wobs = (WeaponsObservable)ObservablesTable.get ("Weapons");; - wobs.updateWeapons (weapons_); - Cpu_UsageObservable cobs = (Cpu_UsageObservable)ObservablesTable.get ("CPU Usage"); - cobs.updateCpu_Usage (weapons_.utilization); - OverheadObservable oobs = (OverheadObservable)ObservablesTable.get ("Overhead"); - oobs.updateOverhead (weapons_.overhead); - JitterObservable jobs = (JitterObservable)ObservablesTable.get ("Latency Jitter (100 ns)"); - jobs.updateJitter (weapons_.completion_time, - weapons_.computation_time, - weapons_.arrival_time); - JitterObservable wjobs = (JitterObservable)ObservablesTable.get ("Weapons Latency Jitter (100 ns)"); - wjobs.updateJitter (weapons_.completion_time, - weapons_.computation_time, - weapons_.arrival_time); - DeadlinesObservable dobs = (DeadlinesObservable)ObservablesTable.get ("Missed Deadlines"); - dobs.updateDeadlines (weapons_.deadline_time, - weapons_.completion_time); - CriticalDeadlinesObservable cdobs = (CriticalDeadlinesObservable)ObservablesTable.get ("Missed Critical Deadlines"); - cdobs.updateDeadlines (weapons_.deadline_time, - weapons_.completion_time, - weapons_.criticality); - LatencyObservable lobs = (LatencyObservable)ObservablesTable.get ("Latency (100 ns)"); - lobs.updateLatency (weapons_.completion_time, - weapons_.computation_time, - weapons_.arrival_time); - LatencyObservable wlobs = (LatencyObservable)ObservablesTable.get ("Weapons Latency (100 ns)"); - wlobs.updateLatency (weapons_.completion_time, - weapons_.computation_time, - weapons_.arrival_time); - received_events_++; - } - else - { - System.out.println ("Received wrong type information"); - - System.out.println ("Received any_value.type (): [" + - any_value.type() + "]"); - - System.out.println ("Expected NavigationHelper.type (): [" + - NavigationHelper.type() + "]"); - - System.out.println ("OR WeaponsHelper.type (): [" + - WeaponsHelper.type() + "]"); - } - } - - NavWeapDataHandler () { - ObservablesTable = new java.util.Hashtable(); - - ObservablesTable.put ("Navigation", new NavigationObservable()); - ObservablesTable.put ("Weapons", new WeaponsObservable()); - ObservablesTable.put ("CPU Usage", new Cpu_UsageObservable()); - ObservablesTable.put ("Overhead", new OverheadObservable()); - ObservablesTable.put ("Latency Jitter (100 ns)", new JitterObservable()); - ObservablesTable.put ("Navigation Latency Jitter (100 ns)", new JitterObservable()); - ObservablesTable.put ("Weapons Latency Jitter (100 ns)", new JitterObservable()); - ObservablesTable.put ("Missed Deadlines", new DeadlinesObservable()); - ObservablesTable.put ("Missed Critical Deadlines", new CriticalDeadlinesObservable()); - ObservablesTable.put ("Latency (100 ns)", new LatencyObservable()); - ObservablesTable.put ("Weapons Latency (100 ns)", new LatencyObservable()); - ObservablesTable.put ("Navigation Latency (100 ns)", new LatencyObservable()); - } - - public java.util.Enumeration getObservablesList () { - return ObservablesTable.keys (); - } - - public DemoObservable getObservable(String name) { - return (DemoObservable)ObservablesTable.get (name); - } - - public int getObservableProperty (String name) { - DemoObservable obs = (DemoObservable)ObservablesTable.get (name); - return obs.getProperty (); - } -} - - - - - diff --git a/TAO/examples/Simulator/DOVEBrowser/NavigationVisComp.java b/TAO/examples/Simulator/DOVEBrowser/NavigationVisComp.java deleted file mode 100644 index 3d7a217389b..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/NavigationVisComp.java +++ /dev/null @@ -1,350 +0,0 @@ -// $Id$ -// -// = FILENAME -// NavigationVisComp.java -// -// = AUTHOR -// Seth Widoff (core functionality) -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is a Visualization Component for displaying navigation. -// -// ============================================================================ - - - -import java.awt.*; -import java.io.*; - -public class NavigationVisComp extends Panel implements VisComp -{ - private Alt_Horizon alt_hor_ = new Alt_Horizon (); - private Position pos_ = new Position (); - - public NavigationVisComp () - { - setLayout (new BorderLayout (0, 2)); - add ("Center", alt_hor_); - add ("South", pos_); - } - - public void setName (String title) { - } - - public int getProperty () { - return Properties.NAVIGATION; - } - - public void update (java.util.Observable observable, java.lang.Object obj) { - Navigation navigation_ = null; - try { - navigation_ = (Navigation) obj; - } - catch (Exception excp) { - System.out.println (excp); - System.out.println ("Visualization Component received wrong data type!"); - } - if (navigation_ != null) { - // make sure all the values are in the proper range. - navigation_.roll = (navigation_.roll > 180 || navigation_.roll < -180) ? - 0 : navigation_.roll; - navigation_.pitch = (navigation_.pitch > 90 || navigation_.pitch < -90) ? - 0 : navigation_.pitch; - - // update the artificial horizon - alt_hor_.update_display (navigation_.roll, navigation_.pitch); - - navigation_.pitch = (navigation_.position_latitude > 90 || navigation_.position_latitude < -90) ? - 0 : navigation_.position_latitude; - navigation_.pitch = (navigation_.position_longitude > 100 || navigation_.position_longitude < 00) ? - 0 : navigation_.position_longitude; - navigation_.pitch = (navigation_.altitude > 90 || navigation_.altitude < -90) ? - 0 : navigation_.altitude; - navigation_.pitch = (navigation_.heading > 180 || navigation_.heading < -180) ? - 0 : navigation_.heading; - - // update the position display - pos_.update_display (navigation_.position_latitude, - navigation_.position_longitude, - navigation_.altitude, - navigation_.heading); - } - } -} - -class Alt_Horizon -extends Canvas -{ - private final static Color GREEN = new Color (0, 100, 0), - BLUE = new Color (30, 144, 255); - - private Graphics offgraphics_; - private Image offscreen_; - private Dimension offscreensize_; - - private int roll_ = 0, pitch_ = 0; - - public void update_display (int roll, int pitch) - { - roll_ = roll; - pitch_ = pitch; - - repaint (); - } - - public Dimension getPreferredSize () - { - return new Dimension (180, 180); - } - - public Dimension getMinimumSize () - { - return new Dimension (80, 80); - } - - public void paint (Graphics g) - { - update (g); - } - - public void update (Graphics g) - { - Dimension d = getSize (); - int rad, angles[] = { 180, 0 }; - Point center; - - if ((offscreen_ == null) || (d.width != offscreensize_.width) || - (d.height != offscreensize_.height)) - { - offscreen_ = createImage (d.width, d.height); - offscreensize_ = new Dimension (d.width, d.height); - offgraphics_ = offscreen_.getGraphics (); - offgraphics_.setFont (getFont()); - - // g.setColor (Color.lightGray); - // g.draw3DRect (0, 0, d.width - 1, d.height - 1, true); - // g.draw3DRect (1, 1, d.width - 3, d.height - 3, true); - // g.draw3DRect (2, 2, d.width - 5, d.height - 5, true); - } - - offgraphics_.setColor (getBackground()); - offgraphics_.fillRect (0, 0, d.width, d.height); - offgraphics_.setColor (BLUE); - - // Calculate from the dimensions, the largest square. - center = new Point (d.width / 2, d.height / 2); - rad = ((center.x < center.y) ? center.x : center.y); - - // Draw a circle of blue - offgraphics_.fillOval (center.x - rad, center.y - rad, - 2*rad, 2*rad); - - // Roll the horizon based on the roll angle - if (roll_ != 0) - roll_horizon (rad, angles); - - // Pitch the horizon based on the pitch angle - if (pitch_ != 0) - pitch_horizon (rad, angles); - - // Draw the resulting terrain - draw_horizon (rad, center, angles); - - // Draw the plotted Image. - g.drawImage (offscreen_, 0, 0, null); - } - - private void draw_horizon (int rad, Point center, int[] angles) - { - // Draw an arc - int arc_angle = - ((angles[0] > angles[1]) ? - (360 - angles[0]) + angles[1] : - (angles[1] - angles[0])); - - Polygon remainder = new Polygon (); - - offgraphics_.setColor (GREEN); - offgraphics_.fillArc (center.x - rad, center.y - rad, - 2*rad, 2*rad, - angles[0], arc_angle); - - if (pitch_ != 0) - { - if ((pitch_ > 0 && Math.abs (roll_) < 90) || - (pitch_ < 0 && Math.abs (roll_) >= 90)) - offgraphics_.setColor (BLUE); - - int cover_angle = (angles[0] + arc_angle/2 + ((arc_angle < 180) ? 180 : 0)) % 360; - - // System.out.println (points[0] + " " + points[1]); - - // System.out.println (accepted_point); - - remainder.addPoint (center.x + polar_to_rect_x (rad, cover_angle), - center.y - polar_to_rect_y (rad, cover_angle)); - remainder.addPoint (center.x + polar_to_rect_x (rad, angles[0]), - center.y - polar_to_rect_y (rad, angles[0])); - remainder.addPoint (center.x + polar_to_rect_x (rad, angles[1]), - center.y - polar_to_rect_y (rad, angles[1])); - offgraphics_.fillPolygon (remainder); - //offgraphics_.setColor (getBackground ()); - //offgraphics_.drawPolygon (remainder); - } - } - - private void pitch_horizon (int rad, int[] angles) - { - boolean upside_down = Math.abs (roll_) >= 90; - int angle_shift = (int) Math.round ((double)(90 - (Math.abs (roll_) % 180)) / 90.0 * pitch_); - - // System.out.println ("angle_shift " + angle_shift); - - angles[0] += angle_shift; - angles[1] -= angle_shift; - - - } - - private void roll_horizon (int rad, int[] angles) - { - // Roll the left and right points of the terrain. - angles[0] += roll_; - angles[1] += roll_; - - if (angles[0] < 0) - angles[0] += 360; - - if (angles[1] < 0) - angles[1] += 360; - } - - private int polar_to_rect_x (int rad, int angle) - { - return (int) Math.round (rad * Math.cos ((double)angle * Math.PI/180.0)); - } - - private int polar_to_rect_y (int rad, int angle) - { - return (int) Math.round (rad * Math.sin ((double)angle * Math.PI/180.0)); - } - - private double caclulate_slope (int rad, int[] angles) - { - int x1 = polar_to_rect_x (rad, angles[0]), - x2 = polar_to_rect_x (rad, angles[1]), - y1 = polar_to_rect_y (rad, angles[0]), - y2 = polar_to_rect_y (rad, angles[1]); - - return ((double) (y2 - y1)) / ((double) (x2 - x1)); - } - - private Point[] line_circle_intesect (int rad, double y_intercept, double slope) - { - double r_2 = (double)(rad * rad), - s_2 = slope * slope, - a_x = s_2 + 1, - b_x = 2.0 * slope * y_intercept, - c_x = y_intercept * y_intercept - r_2; - int[] x_roots = quad_eq (a_x, b_x, c_x), - y_roots = { (int) Math.round ((double)((double) x_roots[0])*slope + y_intercept), - (int) Math.round ((double)((double) x_roots[1])*slope + y_intercept) }; - Point[] points = new Point [2]; - - points[0] = new Point (x_roots[0], y_roots[0]); - points[1] = new Point (x_roots[1], y_roots[1]); - - return points; - } - - private int calculate_angle (int rad, int x, int y) - { - /* - double angle = 0, - sin_value = Math.asin ((double)y / (double)rad), - tan_value = Math.atan ((double)y / (double)x); - - if (x >= 0) - angle = (x != 0) ? tan_value : sin_value + - ((y < 0) ? 2*Math.PI : 0); - else - angle = Math.PI + tan_value; - - return (int) Math.round (angle * 180.0 / Math.PI); - */ - - double angle = 0.0, - sin_value = Math.asin ((double)Math.abs (y) / (double)rad); - - if (x >= 0 && y >= 0) - angle = sin_value; - else if (x < 0 && y >= 0) - angle = sin_value + Math.PI/2.0; - else if (x < 0 && y < 0) - angle = sin_value + Math.PI; - else if (x >= 0 && y < 0) - angle = sin_value + 3.0*Math.PI/2.0; - - return (int) Math.round (angle * 180.0 / Math.PI); - } - - private int[] quad_eq (double a, double b, double c) - { - int[] roots = new int [2]; - double body = Math.sqrt (b*b - 4.0*a*c); - - roots[0] = (int) Math.round ((-b + body) / (2.0 * a)); - roots[1] = (int) Math.round ((-b - body) / (2.0 * a)); - - return roots; - } - - private int distance (Point point1, Point point2) - { - double xdiff = point1.x - point2.x, - ydiff = point1.y - point2.y; - - return (int) Math.round (Math.sqrt (xdiff*xdiff + ydiff*ydiff)); - } -} - -class Position extends Panel -{ - private final static Font FONT = new Font ("Dialog", Font.BOLD, 12); - private final static char DEGREE = '\u00B0'; - - private Label lat_ = new Label ("0" + DEGREE + " N", Label.RIGHT), - long_ = new Label ("0" + DEGREE + " S", Label.RIGHT), - alt_ = new Label ("0 Kft", Label.RIGHT), - heading_ = new Label ("0" + DEGREE + " ", Label.RIGHT); - - public Position () - { - Panel grid_panel = new Panel (); - - lat_.setFont (FONT); - long_.setFont (FONT); - alt_.setFont (FONT); - heading_.setFont (FONT); - - setLayout (new GridLayout (1, 4)); - add (lat_); - add (long_); - add (heading_); - add (alt_); - } - - public void update_display (int lat, int lon, int alt, int heading) - { - String lat_str = - Math.abs (lat) + "" + DEGREE + ((lat > 0) ? " N" : " S"); - String long_str = - Math.abs (lon) + "" + DEGREE + ((lon > 0) ? " E" : " W"); - - lat_.setText (lat_str); - long_.setText (long_str); - alt_.setText (alt + " Kft"); - heading_.setText (heading + "" + DEGREE + " "); - } -} diff --git a/TAO/examples/Simulator/DOVEBrowser/ObservablesDialog.java b/TAO/examples/Simulator/DOVEBrowser/ObservablesDialog.java deleted file mode 100644 index 2ea856c24e2..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/ObservablesDialog.java +++ /dev/null @@ -1,90 +0,0 @@ -// $Id$ -// -// = FILENAME -// ObservablesDialog.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// Dialog for selecting Observables. -// -// ============================================================================ - -import java.awt.*; -import java.awt.event.*; - -public class ObservablesDialog extends Dialog { - - List list_; - DemoCore parent_; - AnswerListener listener_; - - ObservablesDialog (DemoCore parent,java.util.Enumeration enumeration) { - - super ((Frame)parent, "Select Observables", true); - parent_ = parent; - this.setSize(400, 300); - setBounds (new Rectangle (50,50,400,300)); - - list_ = new List (); - list_.setFont ( new Font ("Helvetica", Font.PLAIN, 10)); - list_.setSize (200,200); - - for (; enumeration.hasMoreElements();) { - list_.add ((String)enumeration.nextElement()); - } - - - Button ok_button_ = new Button ("OK"); - ok_button_.setFont ( new Font ("DialogHelvetica", Font.PLAIN, 10)); - Button cancel_button_ = new Button ("Cancel"); - cancel_button_.setFont ( new Font ("DialogHelvetica", Font.PLAIN, 10)); - - GridBagLayout gridbag_ = new GridBagLayout (); - GridBagConstraints constraints_ = new GridBagConstraints (); - - constraints_.fill = GridBagConstraints.BOTH; - this.setLayout (gridbag_); - - constraints_.weightx = 1.0; - constraints_.weighty = 1.0; - constraints_.gridwidth = GridBagConstraints.REMAINDER; - gridbag_.setConstraints (list_, constraints_); - this.add (list_); - - constraints_.weightx = 1.0; - constraints_.weighty = 1.0; - constraints_.gridwidth = GridBagConstraints.RELATIVE; - constraints_.fill = GridBagConstraints.NONE; - gridbag_.setConstraints (ok_button_, constraints_); - gridbag_.setConstraints (cancel_button_, constraints_); - this.add (ok_button_); - this.add (cancel_button_); - - ok_button_.addActionListener (new ActionListener () { - public void actionPerformed (ActionEvent e) { - - String selected_ = ObservablesDialog.this.list_.getSelectedItem (); - if (selected_ != null) { - System.out.println (">>>>> " + selected_); - if (listener_ != null) { - AnswerEvent ev = new AnswerEvent (ObservablesDialog.this, selected_); - listener_.ok (ev); - } - ObservablesDialog.this.setVisible (false); - } - } - }); - - cancel_button_.addActionListener (new ActionListener () { - public void actionPerformed (ActionEvent e) { - ObservablesDialog.this.setVisible (false); - } - }); - } - - public void addAnswerListener (AnswerListener al) { - listener_ = al; - } -} diff --git a/TAO/examples/Simulator/DOVEBrowser/Properties.java b/TAO/examples/Simulator/DOVEBrowser/Properties.java deleted file mode 100644 index 3bab887561b..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/Properties.java +++ /dev/null @@ -1,20 +0,0 @@ -// $Id$ -// -// = FILENAME -// Properties.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This class defines the possible data type values carried by events -// -// ============================================================================ - - -public class Properties { - public static final int DOUBLE = 0; - public static final int NAVIGATION = 1; - public static final int WEAPONS = 2; -} - diff --git a/TAO/examples/Simulator/DOVEBrowser/PushConsumer.java b/TAO/examples/Simulator/DOVEBrowser/PushConsumer.java deleted file mode 100644 index 7e17de6fc0e..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/PushConsumer.java +++ /dev/null @@ -1,185 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// -// = FILENAME -// PushConsumer.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is a Push Consumer which takes the data field of the -// event and updates with it a Data Handler. -// -// -// ============================================================================ - - - -// The Consumer has to implement the Skeleton Consumer - -public class PushConsumer extends RtecEventComm._PushConsumerImplBase -{ - - public static final int ACE_ES_EVENT_ANY = 0; - public static final int ACE_ES_EVENT_SHUTDOWN = 1; - public static final int ACE_ES_EVENT_ACT = 2; - public static final int ACE_ES_EVENT_NOTIFICATION = 3; - public static final int ACE_ES_EVENT_TIMEOUT = 4; - public static final int ACE_ES_EVENT_INTERVAL_TIMEOUT = 5; - public static final int ACE_ES_EVENT_DEADLINE_TIMEOUT = 6; - public static final int ACE_ES_GLOBAL_DESIGNATOR = 7; - public static final int ACE_ES_CONJUNCTION_DESIGNATOR = 8; - public static final int ACE_ES_DISJUNCTION_DESIGNATOR = 9; - public static final int ACE_ES_EVENT_UNDEFINED = 16; - public static final int TOTAL_MESSAGES = 30; - - // Store the number of received events - private int total_received_ = 0; - private org.omg.CORBA.ORB orb_; - private MTDataHandlerAdapter dataHandlerAdapter_; - // private RtecScheduler.RT_InfoHolder rt_info_; - private RtecScheduler.handle_tHolder rt_info_; - private RtecEventChannelAdmin.EventChannel channel_admin_; - private RtecEventChannelAdmin.ConsumerAdmin consumer_admin_; - private RtecEventChannelAdmin.ProxyPushSupplier suppliers_; - - public PushConsumer (org.omg.CORBA.ORB orb, - DataHandler dataHandler, - boolean use_queueing) - { - orb_ = orb; - dataHandlerAdapter_ = - new MTDataHandlerAdapter (dataHandler, use_queueing); - if (use_queueing) - { - dataHandlerAdapter_.start (); - } - } - - - public void push (RtecEventComm.Event[] events) - { - if (total_received_ < 5) - System.out.println ("Demo Consumer: Received an event set! ->Number: " - + total_received_); - else if (total_received_ == 5) - System.out.println ("Demo Consumer: Everything is fine. " + - "Going to be mute."); - - if (events.length == 0) - { - System.err.println ("No events"); - } - else - { - total_received_++; - dataHandlerAdapter_.push (events); - } - } - - public void disconnect_push_consumer() - { - System.out.println ("Demo Consumer: Have to disconnect!"); - } - - public void open_consumer (RtecEventChannelAdmin.EventChannel event_channel_, - RtecScheduler.Scheduler scheduler_, - String name) - { - try { - - // Define Real-time information - - rt_info_ = new RtecScheduler.handle_tHolder (scheduler_.create (name)); - - scheduler_.set (rt_info_.value, - RtecScheduler.Criticality_t.VERY_LOW_CRITICALITY, - 0L, - 0L, - 0L, - 2500000, // period - RtecScheduler.Importance_t.VERY_LOW_IMPORTANCE, - 0L, - 1, - RtecScheduler.Info_Type_t.OPERATION); - - - // Register for Notification and Shutdown events - - byte payload[] = new byte[1]; - payload[0] = 0; - RtecEventComm.Event notification_event_ = new RtecEventComm.Event (); - notification_event_.header = - new RtecEventComm.EventHeader (ACE_ES_EVENT_NOTIFICATION, - 0, 1, 0, 0, 0); - - notification_event_.data = - new RtecEventComm.EventData (0, 0, 0.0, 0, - payload, orb_.create_any()); - - RtecEventChannelAdmin.Dependency dependencies_[] = new RtecEventChannelAdmin.Dependency[1]; - dependencies_[0] = new RtecEventChannelAdmin.Dependency (notification_event_, rt_info_.value); - - - // @@ Carlos please help me to set the right boolean value - RtecEventChannelAdmin.ConsumerQOS qos = new RtecEventChannelAdmin.ConsumerQOS (dependencies_, false); - - - // The channel administrator is the event channel we got from the invocation - // of this routine - - channel_admin_ = event_channel_; - - // Connect as a consumer - - consumer_admin_ = channel_admin_.for_consumers (); - - // Obtain a reference to the proxy push supplier - - suppliers_ = consumer_admin_.obtain_push_supplier (); - - suppliers_.connect_push_consumer (this, qos); - - System.out.println ("Registered the consumer successfully."); - - - } - catch (RtecEventChannelAdmin.TypeError e) - { - System.err.println ("Demo_Consumer.open_consumer: RtecEventChannelAdmin.TypeError"); - System.err.println (e); - } - catch (RtecEventChannelAdmin.AlreadyConnected e) - { - System.err.println ("Demo_Consumer.open_consumer: RtecEventChannelAdmin.AlreadyConnected"); - System.err.println (e); - } - catch (RtecScheduler.UNKNOWN_TASK e) - { - System.err.println ("Demo_Consumer.open_consumer: Unknown task"); - System.err.println (e); - } - catch (RtecScheduler.DUPLICATE_NAME e) - { - System.err.println ("Demo_Consumer.open_consumer: Duplicate names"); - System.err.println (e); - } - catch(org.omg.CORBA.SystemException e) - { - System.err.println(e); - } - } -} - - - - - - - - - - diff --git a/TAO/examples/Simulator/DOVEBrowser/PushConsumer.java.JDK1.2 b/TAO/examples/Simulator/DOVEBrowser/PushConsumer.java.JDK1.2 deleted file mode 100644 index 49a665569c3..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/PushConsumer.java.JDK1.2 +++ /dev/null @@ -1,179 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// -// = FILENAME -// PushConsumer.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is a Push Consumer which takes the data field of the -// event and updates with it a Data Handler. -// -// -// ============================================================================ - - -public class PushConsumer extends RtecEventComm._PushConsumerImplBase -{ - - public static final int ACE_ES_EVENT_ANY = 0; - public static final int ACE_ES_EVENT_SHUTDOWN = 1; - public static final int ACE_ES_EVENT_ACT = 2; - public static final int ACE_ES_EVENT_NOTIFICATION = 3; - public static final int ACE_ES_EVENT_TIMEOUT = 4; - public static final int ACE_ES_EVENT_INTERVAL_TIMEOUT = 5; - public static final int ACE_ES_EVENT_DEADLINE_TIMEOUT = 6; - public static final int ACE_ES_GLOBAL_DESIGNATOR = 7; - public static final int ACE_ES_CONJUNCTION_DESIGNATOR = 8; - public static final int ACE_ES_DISJUNCTION_DESIGNATOR = 9; - public static final int ACE_ES_EVENT_UNDEFINED = 16; - public static final int TOTAL_MESSAGES = 30; - - // Store the number of received events - private int total_received_ = 0; - private org.omg.CORBA.ORB orb_; - private DataHandler dataHandler_; - private int rt_info_; - private RtecEventChannelAdmin.EventChannel channel_admin_; - private RtecEventChannelAdmin.ConsumerAdmin consumer_admin_; - private RtecEventChannelAdmin.ProxyPushSupplier suppliers_; - - public PushConsumer (org.omg.CORBA.ORB orb, DataHandler dataHandler) - { - orb_ = orb; - dataHandler_ = dataHandler; - } - - - public void push (RtecEventComm.Event[] events) - { - if (total_received_ < 5) - System.out.println ("Demo Consumer: Received an event! ->Number: " + total_received_); - else if (total_received_ == 5) - System.out.println ("Demo Consumer: Everything is fine. Going to be mute."); - - - if (events.length == 0) - { - System.err.println ("No events"); - } - else - { - total_received_++; - - for (int i = 0; i < events.length; ++i) - { - if(events[i].type_ == ACE_ES_EVENT_NOTIFICATION) - { - try - { - dataHandler_.update (events[i].data_.any_value); - } - catch(org.omg.CORBA.SystemException e) - { - System.err.println(e); - } - } - } - } - } - - public void disconnect_push_consumer() - { - System.out.println ("Demo Consumer: Have to disconnect!"); - } - - public void open_consumer (RtecEventChannelAdmin.EventChannel event_channel, - RtecScheduler.Scheduler scheduler, - String name) - { - - try - { - - // Define Real-time information - - rt_info_ = scheduler.create (name); - - scheduler.set (rt_info_, - RtecScheduler.Criticality.VERY_LOW_CRITICALITY, - new TimeBase.ulonglong (0,0), - new TimeBase.ulonglong (0,0), - new TimeBase.ulonglong (0,0), - 2500000, // period - RtecScheduler.Importance.VERY_LOW_IMPORTANCE, - new TimeBase.ulonglong (0,0), - 1, - RtecScheduler.Info_Type.OPERATION); - - // Register for Notification and Shutdown events - RtecEventComm.Event notification_event = - new RtecEventComm.Event (ACE_ES_EVENT_NOTIFICATION, 0, - 1, // ttl - new TimeBase.ulonglong (0,0), - new TimeBase.ulonglong (0,0), - new TimeBase.ulonglong (0,0), - new RtecEventComm.EventData (orb_.create_any ())); - - RtecEventChannelAdmin.Dependency dependencies[] = new RtecEventChannelAdmin.Dependency[1]; - dependencies[0] = new RtecEventChannelAdmin.Dependency (notification_event, rt_info_); - - RtecEventChannelAdmin.ConsumerQOS qos = new RtecEventChannelAdmin.ConsumerQOS (dependencies, - false); - - // The channel administrator is the event channel we got from the invocation - // of this routine - channel_admin_ = event_channel; - - // Connect as a consumer - consumer_admin_ = channel_admin_.for_consumers (); - - // Obtain a reference to the proxy push supplier - suppliers_ = consumer_admin_.obtain_push_supplier (); - - suppliers_.connect_push_consumer (this, qos); - - System.out.println ("Registered the consumer successfully."); - - } - catch (RtecEventChannelAdmin.TypeError e) - { - System.err.println ("Demo_Consumer.open_consumer: Type error"); - System.err.println (e); - } - catch (RtecEventChannelAdmin.AlreadyConnected e) - { - System.err.println ("Demo_Consumer.open_consumer: Already connected"); - System.err.println (e); - } - - catch (RtecScheduler.UNKNOWN_TASK e) - { - System.err.println ("Demo_Consumer.open_consumer: Unknown task"); - System.err.println (e); - } - catch (RtecScheduler.DUPLICATE_NAME e) - { - System.err.println ("Demo_Consumer.open_consumer: Duplicate names"); - System.err.println (e); - } - catch(org.omg.CORBA.SystemException e) - { - System.err.println(e); - } - } -} - - - - - - - - - - diff --git a/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java b/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java deleted file mode 100644 index f3632cd43fa..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java +++ /dev/null @@ -1,351 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// = FILENAME -// PushConsumerFactory.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is the administor/factory for a PushConsumer. -// -// ============================================================================ - - - - -public class PushConsumerFactory { - - private org.omg.CORBA.ORB orb_; - private org.omg.CORBA.BOA boa_; - private org.omg.CORBA.Object naming_service_object_; - - private DataHandler dataHandler_; - private Navigation navigation_; - private Weapons weapons_; - - private String[] ec_names_ = null; - private int ec_names_count_ = 0; - - private String[] ss_names_ = null; - private int ss_names_count_ = 0; - - private boolean use_queueing_ = false; - - public PushConsumerFactory (DataHandler dataHandler, - String nameServiceIOR, - String nameServicePort, - String[] args, - boolean use_queueing, - java.applet.Applet applet) - { - try - { - use_queueing_ = use_queueing; - dataHandler_ = dataHandler; - - // if the DOVE Browser is running as an Applet - if (applet != null) { - orb_ = org.omg.CORBA.ORB.init (applet, null); - } - else { // not running as an Applet, but as an normal Application - orb_ = org.omg.CORBA.ORB.init (); - } - boa_ = orb_.BOA_init (); - - // Get the Naming Service initial reference - - // Name Service Lookup cannot be used when running as an Applet - if (nameServiceIOR == null && applet != null) { - System.out.println (" Name Service Lookup cannot be used when running as an Applet! Quit!"); - System.exit (1); - } - - if (nameServiceIOR == null) { // only used when running via "java" or "vbj" - System.out.println ("Using the lookup protocol!"); - NS_Resolve ns_resolve_ = new NS_Resolve (nameServicePort); - naming_service_object_ = ns_resolve_.resolve_name_service (orb_); - } - else { - System.out.println ("Using the following IOR: " + nameServiceIOR); - naming_service_object_ = orb_.string_to_object (nameServiceIOR); - } - - // Walk through args and count EC and Scheduling Service names. - int arg_index = 0; - while (args.length > arg_index) - { - // Count an event service name - if ((args[arg_index].equals ("-ORBeventservicename")) && - (args.length > arg_index + 1)) - { - System.out.println ("switch [" + args[arg_index] + "]"); - System.out.println ("value [" + args[arg_index + 1] + "]"); - arg_index += 2; - ++ec_names_count_; - } - // Count a scheduling service name - else if ((args[arg_index].equals ("-ORBscheduleservicename")) && - (args.length > arg_index + 1)) - { - System.out.println ("switch [" + args[arg_index] + "]"); - System.out.println ("value [" + args[arg_index + 1] + "]"); - arg_index += 2; - ++ss_names_count_; - } - else if (args[arg_index].equals ("-dualECdemo")) - { - System.out.println ("switch [" + args[arg_index] + "]"); - ++arg_index; - ec_names_count_ += 2; - ss_names_count_ += 2; - } - else if ((args[arg_index].equals ("-dualECdemo1")) || - (args[arg_index].equals ("-dualECdemo2"))) - { - System.out.println ("switch [" + args[arg_index] + "]"); - ++arg_index; - ++ec_names_count_; - ++ss_names_count_; - } - // Skip over anything else - else - { - arg_index ++; - } - } - - // Allocate arrays for the event and schedule service names (if any) - if (ec_names_count_ > 0) - { - ec_names_ = new String [ec_names_count_]; - } - if (ss_names_count_ > 0) - { - ss_names_ = new String [ss_names_count_]; - } - - // Then traverse the args again to allocate and fill in a list - // of EC and Scheduling Service names. - arg_index = 0; - ec_names_count_ = 0; - ss_names_count_ = 0; - while (args.length > arg_index) - { - // Set an event service name. - if ((args[arg_index].equals ("-ORBeventservicename")) && - (args.length > arg_index + 1)) - { - ec_names_[ec_names_count_] = args[arg_index + 1]; - ++ec_names_count_; - arg_index += 2; - } - // Set a schedule service name. - else if ((args[arg_index].equals ("-ORBscheduleservicename")) && - (args.length > arg_index + 1)) - { - ss_names_[ss_names_count_] = args[arg_index + 1]; - ++ss_names_count_; - arg_index += 2; - } - else if (args[arg_index].equals ("-dualECdemo")) - { - ss_names_[ss_names_count_] = "DUAL_SCHED_HI"; - ss_names_[ss_names_count_ + 1] = "DUAL_SCHED_LO"; - ec_names_[ec_names_count_] = "DUAL_EC_HI"; - ec_names_[ec_names_count_ + 1] = "DUAL_EC_LO"; - ++arg_index; - ec_names_count_ += 2; - ss_names_count_ += 2; - } - else if (args[arg_index].equals ("-dualECdemo1")) - { - ss_names_[ss_names_count_] = "DUAL_SCHED_HI"; - ec_names_[ec_names_count_] = "DUAL_EC_HI"; - ++arg_index; - ++ec_names_count_; - ++ss_names_count_; - } - else if (args[arg_index].equals ("-dualECdemo2")) - { - ss_names_[ss_names_count_] = "DUAL_SCHED_LO"; - ec_names_[ec_names_count_] = "DUAL_EC_LO"; - ++arg_index; - ++ec_names_count_; - ++ss_names_count_; - } - // Skip over anything else. - else - { - arg_index ++; - } - } - - // If names for event or scheduling services have not been provided - // already, provide the default names used by the service executables. - if (ec_names_count_ == 0) - { - ec_names_count_ = 1; - ec_names_ = new String [1]; - ec_names_ [0] = "EventService"; - } - if (ss_names_count_ == 0) - { - ss_names_count_ = 1; - ss_names_ = new String [1]; - ss_names_ [0] = "ScheduleService"; - } - } - catch(org.omg.CORBA.SystemException e) { - System.err.println ("PushConsumerFactory constructor: ORB and Name Service initialization"); - System.err.println(e); - } - - } - - public class Object_is_null_exception extends Exception - { - Object_is_null_exception (String s) - { - super (s); - } - } - - public void run () - { - try - { - - // Get the Naming Context to allow resolving the EventService and - // ScheduleService - CosNaming.NamingContext naming_context_ = - CosNaming.NamingContextHelper.narrow (naming_service_object_); - - if (naming_context_ == null) - { - System.err.println ("The Naming Context is null"); - System.exit (1); - } - System.out.println ("Reference to the Naming Service is ok."); - - // Create Consumers connected to the EventService - int ss_number = 0; - RtecScheduler.Scheduler scheduler_ = null; - for (int ec_number = 0; ec_number < ec_names_count_; ++ec_number) - { - // Get a reference for the next Scheduling Service if there is one. - // Invariant: we will always execute this code at least once. - if (ss_number < ss_names_count_) - { - CosNaming.NameComponent[] ss_name_components_ = new CosNaming.NameComponent[1]; - ss_name_components_[0] = new CosNaming.NameComponent (ss_names_[ss_number],""); - org.omg.CORBA.Object scheduler_object_ = naming_context_.resolve (ss_name_components_); - - if (scheduler_object_ == null) - { - throw new Object_is_null_exception(ss_names_[ss_number] + - " Object is null"); - } - - scheduler_ = RtecScheduler.SchedulerHelper.narrow (scheduler_object_); - - if (scheduler_ == null) - { - throw new Object_is_null_exception(ss_names_[ss_number] + - " narrowed ref is null"); - } - - System.out.println ("Reference to " + - ss_names_[ss_number] + " is ok."); - - ++ss_number; - } - - // Get a reference for the next Event Service - - CosNaming.NameComponent[] ec_name_components_ = new CosNaming.NameComponent[1]; - ec_name_components_[0] = new CosNaming.NameComponent (ec_names_[ec_number],""); - org.omg.CORBA.Object event_channel_object_ = naming_context_.resolve (ec_name_components_); - - if (event_channel_object_ == null) - { - throw new Object_is_null_exception(ec_names_[ec_number] + - " Object is null"); - } - - RtecEventChannelAdmin.EventChannel event_channel_ = - RtecEventChannelAdmin.EventChannelHelper.narrow (event_channel_object_); - - if (event_channel_ == null) - { - throw new Object_is_null_exception(ec_names_[ec_number] + - " narrowed ref is null"); - } - - System.out.println ("Reference to " + - ec_names_[ec_number] + " is ok."); - - // Start the consumer - System.out.println ("Instantiating the Push Consumer for " + - ec_names_[ec_number] + ": demo_consumer_" + - ec_number + "."); - - PushConsumer pushConsumer_ = new PushConsumer (orb_, - dataHandler_, - use_queueing_); - System.out.println ("Initializing the Push Consumer for " + - ec_names_[ec_number] + ": demo_consumer_" + - ec_number + "."); - - pushConsumer_.open_consumer (event_channel_, scheduler_, - "demo_consumer_" + ec_number); - - boa_.obj_is_ready (pushConsumer_); - - } - - - // Tell the CORBA environment that we are ready - - System.out.println ("boa.obj_is_ready succeeded"); - - boa_.impl_is_ready (); - } - catch (CosNaming.NamingContextPackage.CannotProceed e) - { - System.err.println ("CosNaming.NamingContextPackage.CannotProceed"); - System.err.println (e); - } - catch (CosNaming.NamingContextPackage.InvalidName e) - { - System.err.println ("CosNaming.NamingContextPackage.InvalidName"); - System.err.println (e); - } - catch (CosNaming.NamingContextPackage.NotFound e) - { - System.err.println ("CosNaming.NamingContextPackage.NotFound"); - System.err.println (e); - - } - catch (Object_is_null_exception e) - { - System.err.println (e); - } - catch(org.omg.CORBA.SystemException e) - { - System.err.println ("PushConsumerFactory.run: Failure"); - System.err.println(e); - } - } - - -} // public class PushConsumerFactory - - - - - - - diff --git a/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java.JDK1.2 b/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java.JDK1.2 deleted file mode 100644 index b6039ee72d9..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/PushConsumerFactory.java.JDK1.2 +++ /dev/null @@ -1,180 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// = FILENAME -// PushConsumerFactory.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is the administor/factory for a PushConsumer. -// -// ============================================================================ - - -public class PushConsumerFactory -{ - - private org.omg.CORBA.ORB orb_; - private org.omg.CORBA.Object naming_service_object_; - private DataHandler dataHandler_; - private Navigation navigation_; - private Weapons weapons_; - - - public PushConsumerFactory (DataHandler dataHandler, - String nameServiceIOR, - String[] args, - java.applet.Applet applet) - { - try { - dataHandler_ = dataHandler; - - // if the DOVE Browser is running as an Applet - if (applet != null) { - orb_ = org.omg.CORBA.ORB.init (applet, null); - } - else { // not running as an Applet, but as an normal Application - orb_ = org.omg.CORBA.ORB.init (args, null); - } - - // Get the Naming Service initial reference - - // Name Service Lookup cannot be used when running as an Applet - if (nameServiceIOR == null && applet != null) { - System.out.println (" Name Service Lookup cannot be used when running as an Applet! Quit!"); - System.exit (1); - } - - if (nameServiceIOR == null) { // only used when running via "java" or "vbj" - System.out.println ("Using the lookup protocol!"); - NS_Resolve ns_resolve = new NS_Resolve (); - naming_service_object_ = ns_resolve.resolve_name_service (orb_); - } - else { - System.out.println ("Using the following IOR: " + nameServiceIOR); - naming_service_object_ = orb_.string_to_object (nameServiceIOR); - } - - } - catch(org.omg.CORBA.SystemException e) { - System.err.println ("PushConsumerFactory constructor: ORB and Name Service initialization"); - System.err.println(e); - } - - } - - public class Object_is_null_exception extends Exception - { - Object_is_null_exception (String s) - { - super (s); - } - } - - public void run () - { - try - { - - // Get the Naming Context to allow resolving the EventService and - // ScheduleService - CosNaming.NamingContext naming_context = - CosNaming.NamingContextHelper.narrow (naming_service_object_); - - if (naming_context == null) - { - System.err.println ("The Naming Context is null"); - System.exit (1); - } - System.out.println ("Reference to the Naming Service is ok."); - - // Get a reference for the EventService - - CosNaming.NameComponent[] ec_name_components = new CosNaming.NameComponent[1]; - ec_name_components[0] = new CosNaming.NameComponent ("EventService",""); - org.omg.CORBA.Object event_channel_object = naming_context.resolve (ec_name_components); - - if (event_channel_object == null) - { - throw new Object_is_null_exception("EventService Object is null"); - } - - RtecEventChannelAdmin.EventChannel event_channel = - RtecEventChannelAdmin.EventChannelHelper.narrow (event_channel_object); - - System.out.println ("Reference to the Event Service is ok."); - - // Get a reference for the ScheduleService - - CosNaming.NameComponent[] s_name_components = new CosNaming.NameComponent[1]; - s_name_components[0] = new CosNaming.NameComponent ("ScheduleService",""); - org.omg.CORBA.Object scheduler_object = naming_context.resolve (s_name_components); - - if (scheduler_object == null) - { - throw new Object_is_null_exception("ScheduleService Object is null"); - } - - RtecScheduler.Scheduler scheduler = - RtecScheduler.SchedulerHelper.narrow (scheduler_object); - - System.out.println ("Reference to the Naming Service is ok."); - - - // Start the consumer - System.out.println ("Instantiating the Push Consumer."); - PushConsumer pushConsumer = new PushConsumer (orb_, dataHandler_); - System.out.println ("Initializing the Push Consumer."); - pushConsumer.open_consumer (event_channel, scheduler, "demo_consumer"); - - // Tell the CORBA environment that we are ready - - orb_.connect (pushConsumer); - - System.out.println ("Going into the event dispatching loop."); - - - java.lang.Object sync = new java.lang.Object(); - synchronized (sync) { - sync.wait(); - } - } - catch (java.lang.InterruptedException e) - { - } - catch (CosNaming.NamingContextPackage.CannotProceed e) - { - System.err.println ("CosNaming.NamingContextPackage.CannotProceed"); - System.err.println (e); - } - catch (CosNaming.NamingContextPackage.InvalidName e) - { - System.err.println ("CosNaming.NamingContextPackage.InvalidName"); - System.err.println (e); - } - catch (CosNaming.NamingContextPackage.NotFound e) - { - System.err.println ("CosNaming.NamingContextPackage.NotFound"); - System.err.println (e); - } - catch (Object_is_null_exception e) - { - System.err.println (e); - } - catch(org.omg.CORBA.SystemException e) - { - System.err.println ("PushConsumerFactory.run: Failure"); - System.err.println(e); - } - } -} // public class PushConsumerFactory - - - - - - - diff --git a/TAO/examples/Simulator/DOVEBrowser/Queue.java b/TAO/examples/Simulator/DOVEBrowser/Queue.java deleted file mode 100644 index 7ffaba15c52..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/Queue.java +++ /dev/null @@ -1,190 +0,0 @@ -// $Id$ - - -import java.util.Enumeration; - -public class Queue -{ - // Friendly? - Queue_Node head_ = null; - Queue_Node tail_ = null; - - private int length_ = 0; - - public Queue() - { - } - - public Enumeration forward_iterator() - { - return new Queue_Iterator(this, Queue_Iterator.FORWARD); - } - - public Enumeration reverse_iterator() - { - return new Queue_Iterator(this, Queue_Iterator.REVERSE); - } - - public void enqueue_tail(Object new_data) - { - Queue_Node new_node = new Queue_Node(new_data); - - if (tail_ == null) - { - tail_ = new_node; - head_ = new_node; - } - else - { - new_node.prev_ = tail_; - tail_.next_ = new_node; - tail_ = new_node; - } - - length_++; - } - - public void enqueue_head(Object new_data) - { - Queue_Node new_node = new Queue_Node(new_data); - - if (head_ == null) - { - tail_ = new_node; - head_ = new_node; - } - else - { - new_node.next_ = head_; - head_.prev_ = new_node; - head_ = new_node; - } - - length_++; - } - - public Object dequeue_head() - { - Object return_value = null; - - if (head_ == null) - return_value = null; - else if (tail_ == head_) - { - return_value = head_.data_; - tail_ = null; - head_ = null; - } - else - { - return_value = head_.data_; - head_ = head_.next_; - head_.prev_ = null; - } - - length_--; - - return return_value; - } - - public Object dequeue_tail() - { - Object return_value = null; - - if (tail_ == null) - return_value = null; - else if (tail_ == head_) - { - return_value = tail_.data_; - tail_ = null; - head_ = null; - } - else - { - return_value = tail_.data_; - tail_ = tail_.prev_; - tail_.next_ = null; - } - - length_--; - - return return_value; - } - - public int length() - { - return length_; - } - - public Object head() - { - if (head_ != null) - return head_.data_; - else - return null; - } - - public Object tail() - { - if (tail_ != null) - return tail_.data_; - else - return null; - } -} - -class Queue_Node -{ - public Queue_Node prev_ = null; - public Queue_Node next_ = null;; - public Object data_; - - public Queue_Node(Object data) - { - data_ = data; - } -} - -class Queue_Iterator implements Enumeration -{ - public static final boolean FORWARD = true; - public static final boolean REVERSE = false; - - private Queue queue_; - private Queue_Node queue_ptr_; - private boolean direction_ = FORWARD; - - public Queue_Iterator(Queue queue) - { - queue_ = queue; - queue_ptr_ = queue.head_; - } - - public Queue_Iterator(Queue queue, boolean direction) - { - queue_ = queue; - direction_ = direction; - - if (direction_) - queue_ptr_ = queue_.head_; - else - queue_ptr_ = queue_.tail_; - } - - public Object nextElement() - { - Object data = queue_ptr_.data_; - - if (direction_) - queue_ptr_ = queue_ptr_.next_; - else - queue_ptr_ = queue_ptr_.prev_; - - return data; - } - - public boolean hasMoreElements() - { - return queue_ptr_ != null; - } -} diff --git a/TAO/examples/Simulator/DOVEBrowser/VisComp.java b/TAO/examples/Simulator/DOVEBrowser/VisComp.java deleted file mode 100644 index 53294f33ea2..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/VisComp.java +++ /dev/null @@ -1,19 +0,0 @@ -// $Id$ -// -// = FILENAME -// VisComp.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is the interface for Java Beans. -// -// ============================================================================ - - -public interface VisComp extends java.util.Observer { - - public void setName (String title); - public int getProperty (); -} diff --git a/TAO/examples/Simulator/DOVEBrowser/VisCompFactory.java b/TAO/examples/Simulator/DOVEBrowser/VisCompFactory.java deleted file mode 100644 index 288fcccceec..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/VisCompFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -// $Id$ -// -// = FILENAME -// VisCompFactory.java -// -// = AUTHOR -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This class serves as factory for Visualization Components -// -// ============================================================================ - -import java.beans.*; - -class VisCompFactory { - - VisComp getNewVisComp (int property, String name) { - - ClassLoader classLoader_ = this.getClass().getClassLoader(); - - VisComp visComp_ = null; - String visCompName_ = "VisComp"; - switch (property) { - case Properties.DOUBLE: - visCompName_ = "Double"+visCompName_; - break; - case Properties.NAVIGATION: - visCompName_ = "Navigation"+visCompName_; - break; - case Properties.WEAPONS: - visCompName_ = "Weapons"+visCompName_; - break; - default: return null; - } - try { - System.out.println ("Trying to connect: " + visCompName_+ " .. "); - visComp_ = (VisComp) Beans.instantiate (classLoader_, visCompName_); - visComp_.setName (name); - System.out.println ("Connected: " + visCompName_); - return visComp_; - } - catch (Exception e) { - System.out.println ("Unable to load JavaBean: " + e); - return null; - } - } -}
\ No newline at end of file diff --git a/TAO/examples/Simulator/DOVEBrowser/WeaponsVisComp.java b/TAO/examples/Simulator/DOVEBrowser/WeaponsVisComp.java deleted file mode 100644 index 8c81bfc9c11..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/WeaponsVisComp.java +++ /dev/null @@ -1,144 +0,0 @@ -// $Id$ -// -// = FILENAME -// WeaponsVisComp.java -// -// = AUTHOR -// Seth Widoff (core functionality) -// Michael Kircher (mk1@cs.wustl.edu) -// -// = DESCRIPTION -// This is a Visualization Component for displaying weapons. -// -// ============================================================================ - - -import java.io.*; -import java.util.*; -import java.awt.*; - - -public class WeaponsVisComp extends Panel implements VisComp -{ - private final static String ONLINE = "Online"; - private final static String OFFLINE = "Offline"; - private final static Font FONT_BIG = new Font ("Dialog", Font.BOLD, 14); - private final static Font FONT_SMALL = new Font ("Dialog", Font.BOLD, 10); - private final static Color BLUE = new Color (30, 144, 255); - - private int count_ = 0; - private Hashtable weapons_table_ = new Hashtable (); - private GridBagLayout gbl_= new GridBagLayout (); - private GridBagConstraints gbc_ = new GridBagConstraints (); - - Label default_label_ = new Label ("No weapons available", Label.CENTER); - - public WeaponsVisComp () - { - default_label_.setFont (FONT_BIG); - default_label_.setForeground (BLUE); - - setLayout (gbl_); - gbc_.gridx = 0; - gbc_.gridy = 0; - gbc_.gridheight = 1; - gbc_.gridwidth = 1; - gbc_.anchor = GridBagConstraints.NORTH; - gbc_.fill = GridBagConstraints.NONE; - setBackground (Color.black); - - gbl_.setConstraints (default_label_, gbc_); - add (default_label_); - } - - public void setName (String title) { - } - - public int getProperty () { - return Properties.WEAPONS; - } - - public Dimension getPreferredSize () { - return new Dimension (250, 200); - } - - public Dimension getMinimumSize () { - return new Dimension (80, 80); - } - - public void update (java.util.Observable observable, java.lang.Object obj) { - Weapons weapons_ = null; - try { - weapons_ = (Weapons) obj; - } - catch (Exception excp) { - System.out.println (excp); - System.out.println ("Visualization Component received wrong data type!"); - } - if (weapons_ != null) - { - for (int i = 0; i < weapons_.number_of_weapons && i < 5; i++) - { - String weapon = ""; - int status = 0; - switch (i) - { - default: - break; - case 0: weapon = weapons_.weapon1_identifier; - status = weapons_.weapon1_status; - break; - case 1: weapon = weapons_.weapon2_identifier; - status = weapons_.weapon2_status; - break; - case 2: weapon = weapons_.weapon3_identifier; - status = weapons_.weapon3_status; - break; - case 3: weapon = weapons_.weapon4_identifier; - status = weapons_.weapon4_status; - break; - case 4: weapon = weapons_.weapon5_identifier; - status = weapons_.weapon5_status; - break; - } - - - Label status_label_ = (Label)weapons_table_.get (weapon); - - if (status_label_ != null) - status_label_.setText ((status == 1) ? ONLINE : OFFLINE); - else - { - if (count_ == 0) - this.removeAll (); - - count_++; - Label weapon_label_ = new Label (count_ + ". " + weapon, Label.LEFT); - status_label_ = new Label ((status == 1) ? ONLINE : OFFLINE, Label.RIGHT); - - status_label_.setFont (FONT_SMALL); - weapon_label_.setFont (FONT_SMALL); - weapon_label_.setForeground (BLUE); - - gbc_.gridx = 0; - gbc_.anchor = GridBagConstraints.WEST; - gbl_.setConstraints (weapon_label_, gbc_); - add (weapon_label_); - gbc_.gridx = 1; - gbc_.anchor = GridBagConstraints.EAST; - gbl_.setConstraints (status_label_, gbc_); - add (status_label_); - - gbc_.gridy++; - weapons_table_.put (weapon, status_label_); - } - - status_label_.setForeground ((status == 1) ? - Color.lightGray : - Color.darkGray); - } - - validate (); - } - } -} diff --git a/TAO/examples/Simulator/DOVEBrowser/make.bat b/TAO/examples/Simulator/DOVEBrowser/make.bat deleted file mode 100755 index 49677db37bb..00000000000 --- a/TAO/examples/Simulator/DOVEBrowser/make.bat +++ /dev/null @@ -1,150 +0,0 @@ -@REM This File generates the necessary classes for Visibroker and JDK1.2 -@REM call it like: -@REM -@REM make VB (makes all VB classes) -@REM make JDK (makes all JDK classes) -@REM make clean (removes classes, IDL generated files) -@REM make realclean (updates IDL files, does make clean) -@REM - -@if %1. == VB. goto VB -@if %1. == vB. goto VB -@if %1. == Vb. goto VB -@if %1. == vb. goto VB -@if %1. == JDK. goto JDK -@if %1. == jDK. goto JDK -@if %1. == JdK. goto JDK -@if %1. == JDk. goto JDK -@if %1. == jdK. goto JDK -@if %1. == jDk. goto JDK -@if %1. == Jdk. goto JDK -@if %1. == jdk. goto JDK -@if %1. == setup. goto setup -@if %1. == realclean. goto realclean -@if %1. == clean. goto clean -@if %1. == vbjava. goto VBJAVA - - -@echo Usage: -@echo make setup (sets up IDL files) -@echo make vb (makes all VB classes) -@echo make jdk (makes all JDK classes) -@echo make clean (removes old classes, IDL generated files) -@echo make realclean (updates IDL files, calls make clean) -@goto end - -REM This part build with JDK -:JDK -@echo JDK1.2 -idltojava NavWeap.idl -idltojava RtecEventComm.idl -idltojava RtecEventChannelAdmin.idl -idltojava RtecScheduler.idl -idltojava CosNaming.idl -idltojava CosTimeBase.idl -javac CosNaming\NamingContextPackage\*.java -javac CosNaming\*.java -javac CosTimeBase\*.java -javac RtecScheduler\*.java -javac RtecEventComm\*.java -javac RtecEventComm\EventChannelPackage\*.java -javac RtecEventChannelAdmin\*.java -javac *.java - -@goto end - -:setup - -@REM This part updates IDL files - -@del *.idl -@xcopy ..\NavWeap.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\CosTimeBase.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\CosNaming.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\RtecEventComm.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\RtecEventChannelAdmin.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\RtecScheduler.idl - -@goto end - -@REM This part cleans up everything, and updates IDL files - -:realclean - -@del *.idl -@xcopy ..\NavWeap.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\CosTimeBase.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\CosNaming.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\RtecEventComm.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\RtecEventChannelAdmin.idl -@xcopy ..\..\..\orbsvcs\orbsvcs\RtecScheduler.idl - -:clean - -@del *.class -@del Weapons.java -@del WeaponsHelper.java -@del WeaponsHolder.java -@del *NavWeapTerminator*.java -@del Navigation.java -@del NavigationHelper.java -@del NavigationHolder.java -@del RtecEventComm\*.java -@del RtecEventComm\*.class -@REM del RtecEventComm\EventChannelPackage\*.java -@REM del RtecEventComm\EventChannelPackage\*.class -@REM rd RtecEventComm\EventChannelPackage -@rd RtecEventComm - -@del RtecEventChannelAdmin\*.java -@del RtecEventChannelAdmin\*.class -@del RtecEventChannelAdmin\EventChannelPackage\*.java -@del RtecEventChannelAdmin\EventChannelPackage\*.class -@rd RtecEventChannelAdmin\EventChannelPackage -@rd RtecEventChannelAdmin - -@del RtecScheduler\*.java -@del RtecScheduler\*.class -@rd RtecScheduler - -@del CosNaming\*.java -@del CosNaming\*.class -@del CosNaming\NamingContextPackage\*.java -@del CosNaming\NamingContextPackage\*.class -@rd CosNaming\NamingContextPackage -@rd CosNaming - -@REM del CosTimeBase\*.java -@REM del CosTimeBase\*.class -@REM rd CosTimeBase - -@del TimeBase\*.java -@del TimeBase\*.class -@rd TimeBase - -@goto end - - -REM This part build with VB -:VB -@echo Visibroker -@echo idl2java NavWeap.idl -@idl2java NavWeap.idl -@echo idl2java RtecEventComm.idl -@idl2java RtecEventComm.idl -@echo idl2java RtecEventChannelAdmin.idl -@idl2java RtecEventChannelAdmin.idl -@echo idl2java RtecScheduler.idl -@idl2java RtecScheduler.idl -@echo idl2java CosNaming.idl -@idl2java CosNaming.idl -@echo idl2java CosTimeBase.idl -@idl2java CosTimeBase.idl - -:VBJAVA - -@echo vbjc *.java -@vbjc *.java - -:end - |