Package com.grt192.networking

Examples of com.grt192.networking.GRTServer$GRTSingleConnect


    }

    protected void notifyRightYAxisChange() {
        for (int i = 0; i < joystickListeners.size(); i++) {
            ((XboxJoystickListener) joystickListeners.elementAt(i)).rightYAxisMoved(
                    new XboxJoystickEvent(this,
                    XboxJoystickEvent.DEFAULT,
                    getState("rightYValue")));
        }
    }
View Full Code Here


    }

    protected void notifyTriggerChange() {
        for (int i = 0; i < joystickListeners.size(); i++) {
            ((XboxJoystickListener) joystickListeners.elementAt(i)).triggerMoved(
                    new XboxJoystickEvent(this,
                    XboxJoystickEvent.DEFAULT,
                    getState("triggerValue")));
        }
    }
View Full Code Here


  private void notifyPadChange() {
        for (int i = 0; i < joystickListeners.size(); i++) {
            ((XboxJoystickListener) joystickListeners.elementAt(i)).padMoved(
                    new XboxJoystickEvent(this,
                    XboxJoystickEvent.DEFAULT,
                    getState("padValue")));
        }
  }
View Full Code Here

    public static final int PORT = 192;

    public static void main(String[] args) {

        //new client
        final LoggerModel lms = new LoggerModel();

        //new connection to client
        GRTClientSocket gcs = new GRTClientSocket(IP, PORT);
        gcs.start();
        gcs.addSocketListener(lms);

        //new panel
        LoggerUI lu = new LoggerUI(lms);

        JFrame vars = new JFrame("vars");
        vars.setLayout(new BorderLayout());
        VariableUI v = new VariableUI(lms);
        vars.add(v,BorderLayout.CENTER);
        vars.setSize(500, 500);
        vars.setVisible(true);


        //new frame
        final JFrame j = new JFrame("Logger UI");
        //menu bar and co.
        JMenuBar bar = new JMenuBar();
        JMenu file = new JMenu("File");
        JMenu log = new JMenu("Log");



        //add item to log
        JMenuItem write = new JMenuItem("Write to file");
        log.add(write);
        JMenuItem getVers = new JMenuItem("Print version");
        log.add(getVers);

        //ad menu bar to frame
        j.setJMenuBar(bar);
        bar.add(file);
        bar.add(log);
       
        write.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                lms.writeLogs();
            }
        });

        getVers.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                int i = lms.getLastVersion();
                JOptionPane.showMessageDialog(j, i);
            }
        });

        j.setSize(500, 500);
        j.add(lu, BorderLayout.CENTER);
        j.setVisible(true);
        j.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        j.addWindowListener(new WindowAdapter() {

            public void windowClosing(WindowEvent e) {
                lms.writeLogs();
                System.exit(0);
            }
        });

    }
View Full Code Here

//        GRTGyro gyro = new GRTGyro(7, 15, "BaseGyro");
        System.out.println("Switches Initialized");

        // Mechanisms
        robotbase = new RobotBase(leftDT1, leftDT2, rightDT1, rightDT2);
        driverStation = new DriverStation(primary, secondary);
        System.out.println("Mechanisms Initialized");

        // camera = new CameraAssembly();
        // System.out.println("Camera Initialized");
View Full Code Here

        // analog inputs
        InternetRPC rpc = new InternetRPC(180);
        rpc.start();
        BatterySensor s = new BatterySensor(10);
        s.start();
        VoltageMessenger messenger = new VoltageMessenger(rpc, 23, s);
//        GRTPotentiometer batterySensor = new GRTPotentiometer(1, 50,
//                "batteryVoltage");
//        batterySensor.start();
//        GRTGyro gyro = new GRTGyro(7, 15, "BaseGyro");
        System.out.println("Switches Initialized");
View Full Code Here

//        batterySensor.start();
//        GRTGyro gyro = new GRTGyro(7, 15, "BaseGyro");
        System.out.println("Switches Initialized");

        // Mechanisms
        robotbase = new RobotBase(leftDT1, leftDT2, rightDT1, rightDT2);
        driverStation = new DriverStation(primary, secondary);
        System.out.println("Mechanisms Initialized");

        // camera = new CameraAssembly();
        // System.out.println("Camera Initialized");
View Full Code Here

        master = MASTER_DEFAULT_STATE;
        auto = AUTO_DEFAULT_STATE;
    }

    public void initMechanism(){
        om = new HHLEDMechanism();
        addMechanism(MECHANISM_ID, om);
    }
View Full Code Here

        //new client
        final LoggerModel lms = new LoggerModel();

        //new connection to client
        GRTClientSocket gcs = new GRTClientSocket(IP, PORT);
        gcs.start();
        gcs.addSocketListener(lms);

        //new panel
        LoggerUI lu = new LoggerUI(lms);

        JFrame vars = new JFrame("vars");
View Full Code Here

        initServer();
        initPrinters();
    }

    public void initServer(){
        gs = new GRTServer(PORT);
        gs.addSocketListener(this);
        gs.start();
    }
View Full Code Here

TOP

Related Classes of com.grt192.networking.GRTServer$GRTSingleConnect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.