Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* =========================================================
- * ==== WARNING ===
- * =========================================================
- * The code in this tab has been generated from the GUI form
- * designer and care should be taken when editing this file.
- * Only add/edit code inside the event handlers i.e. only
- * use lines between the matching comment tags. e.g.
- void myBtnEvents(GButton button) { //_CODE_:button1:12356:
- // It is safe to enter your event code here
- } //_CODE_:button1:12356:
- * Do not rename this tab!
- * =========================================================
- */
- public void imgButton1_LogoPxl_click(GImageButton source, GEvent event) { //_CODE_:imgButton_LogoPxl:810868:
- println("imgButton1 - GImageButton event occured " + System.currentTimeMillis()%10000000 );
- link("http://www.pxl.be");
- textarea_console.appendText("Visiting PXL webpage ...");
- } //_CODE_:imgButton_LogoPxl:810868:
- public void imgButton_logoGithub_click(GImageButton source, GEvent event) { //_CODE_:imgButton_logoGithub:943067:
- println("imgButton1 - GImageButton event occured " + System.currentTimeMillis()%10000000 );
- link("https://github.com/Glenn-Kerselaers/PWO_HEALTHCARE_1_DEV");
- textarea_console.appendText("Visiting Github repo ...");
- } //_CODE_:imgButton_logoGithub:943067:
- public void imgButton_logoImu_click(GImageButton source, GEvent event) { //_CODE_:imgButton_logoImu:933533:
- println("imgButton2 - GImageButton event occured " + System.currentTimeMillis()%10000000 );
- link("http://xmotionplus.co.nf/");
- textarea_console.appendText("Visiting xMotionPlus webpage ...");
- } //_CODE_:imgButton_logoImu:933533:
- public void textarea_console_change(GTextArea source, GEvent event) { //_CODE_:textarea_console:563522:
- println("textarea1 - GTextArea event occured " + System.currentTimeMillis()%10000000 );
- } //_CODE_:textarea_console:563522:
- public void button_start_click(GButton source, GEvent event) { //_CODE_:button_start:906387:
- println("button_start - GButton event occured " + System.currentTimeMillis()%10000000 );
- startCommunication();
- } //_CODE_:button_start:906387:
- public void button_stop_click(GButton source, GEvent event) { //_CODE_:button_stop:509982:
- println("button_stop - GButton event occured " + System.currentTimeMillis()%10000000 );
- stopCommunication();
- } //_CODE_:button_stop:509982:
- public void button_clearConsole_click(GButton source, GEvent event) { //_CODE_:button_clearConsole:654478:
- println("button_clearConsole - GButton event occured " + System.currentTimeMillis()%10000000 );
- textarea_console.setText("");
- customGUI();
- } //_CODE_:button_clearConsole:654478:
- public void dropList_baud1_click(GDropList source, GEvent event) { //_CODE_:dropList_baud1:308840:
- println("dropList_baud1 - GDropList event occured " + System.currentTimeMillis()%10000000 );
- } //_CODE_:dropList_baud1:308840:
- public void dropList_com1_click(GDropList source, GEvent event) { //_CODE_:dropList_com1:253554:
- println("dropList_com1 - GDropList event occured " + System.currentTimeMillis()%10000000 );
- } //_CODE_:dropList_com1:253554:
- public void dropList_baud2_click(GDropList source, GEvent event) { //_CODE_:dropList_baud2:833132:
- println("dropList_baud2 - GDropList event occured " + System.currentTimeMillis()%10000000 );
- } //_CODE_:dropList_baud2:833132:
- public void dropList_com2_click1(GDropList source, GEvent event) { //_CODE_:dropList_com2:355172:
- println("dropList_com2 - GDropList event occured " + System.currentTimeMillis()%10000000 );
- } //_CODE_:dropList_com2:355172:
- public void button_connect1_click(GButton source, GEvent event) { //_CODE_:button_connect1:530530:
- println("button_connect1 - GButton event occured " + System.currentTimeMillis()%10000000 );
- connectIMU1();
- } //_CODE_:button_connect1:530530:
- public void button_connect2_click(GButton source, GEvent event) { //_CODE_:button_connect2:851447:
- println("button_connect2 - GButton event occured " + System.currentTimeMillis()%10000000 );
- connectIMU2();
- } //_CODE_:button_connect2:851447:
- public void button_findSerial_click(GButton source, GEvent event) { //_CODE_:button_findSerial:469101:
- println("button_findSerial - GButton event occured " + System.currentTimeMillis()%10000000 );
- findSerials();
- } //_CODE_:button_findSerial:469101:
- public void button_autoConnect_click(GButton source, GEvent event) { //_CODE_:button_autoConnect:652736:
- println("button_autoConnect - GButton event occured " + System.currentTimeMillis()%10000000 );
- autoConnect();
- } //_CODE_:button_autoConnect:652736:
- public void button_openGraph_click(GButton source, GEvent event) { //_CODE_:button_openGraph:455514:
- println("button_openGraph - GButton event occured " + System.currentTimeMillis()%10000000 );
- window_graph.setVisible(true);
- } //_CODE_:button_openGraph:455514:
- public void button_openAnimation_click(GButton source, GEvent event) { //_CODE_:button_openAnimation:996082:
- println("button_openAnimation - GButton event occured " + System.currentTimeMillis()%10000000 );
- window_animation.setVisible(true);
- } //_CODE_:button_openAnimation:996082:
- public void textfield_send_change(GTextField source, GEvent event) { //_CODE_:textfield_send:529509:
- println("textfield_send - GTextField event occured " + System.currentTimeMillis()%10000000 );
- } //_CODE_:textfield_send:529509:
- public void button_send_click(GButton source, GEvent event) { //_CODE_:button_send:515935:
- println("button_send - GButton event occured " + System.currentTimeMillis()%10000000 );
- String sInput = textfield_send.getText();
- String receiver = dropList_whoSend.getSelectedText();
- textarea_console.appendText("Send [" + receiver + "]: " + sInput);
- if (dropList_whoSend.getSelectedIndex() == 0) {
- myPorts[0].write(sInput);
- }
- else if (dropList_whoSend.getSelectedIndex() == 1) {
- myPorts[1].write(sInput);
- }
- else if (dropList_whoSend.getSelectedIndex() == 2) {
- myPorts[0].write(sInput);
- myPorts[1].write(sInput);
- }
- textfield_send.setText("");
- } //_CODE_:button_send:515935:
- public void dropList_whoSend_click(GDropList source, GEvent event) { //_CODE_:dropList_whoSend:741946:
- println("dropList_whoSend - GDropList event occured " + System.currentTimeMillis()%10000000 );
- } //_CODE_:dropList_whoSend:741946:
- synchronized public void win_graph_draw(GWinApplet appc, GWinData data) { //_CODE_:window_graph:648207:
- appc.background(230);
- } //_CODE_:window_graph:648207:
- synchronized public void win_animation_draw(GWinApplet appc, GWinData data) { //_CODE_:window_animation:552405:
- appc.background(0);
- } //_CODE_:window_animation:552405:
- // Create all the GUI controls.
- // autogenerated do not edit
- public void createGUI() {
- G4P.messagesEnabled(false);
- G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
- G4P.setCursor(ARROW);
- if (frame != null)
- frame.setTitle("xMotionPlus - IMU Developed by PXL {V1.0}");
- imgButton_LogoPxl = new GImageButton(this, -1, 300, new String[] {
- "logo_pxl_tech_143x60.png", "logo_pxl_tech_143x60.png", "logo_pxl_tech_143x60.png"
- }
- );
- imgButton_LogoPxl.addEventHandler(this, "imgButton1_LogoPxl_click");
- label1 = new GLabel(this, 120, 370, 360, 20);
- label1.setText("Glenn Kerselaers & Devlin Voets");
- label1.setOpaque(false);
- imgButton_logoGithub = new GImageButton(this, 150, 300, 146, 60, new String[] {
- "logo_github_146x60.png", "logo_github_146x60.png", "logo_github_146x60.png"
- }
- );
- imgButton_logoGithub.addEventHandler(this, "imgButton_logoGithub_click");
- imgButton_logoImu = new GImageButton(this, 290, 300, 306, 60, new String[] {
- "logo_xmotionplus_306x60.png", "logo_xmotionplus_306x60.png", "logo_xmotionplus_306x60.png"
- }
- );
- imgButton_logoImu.addEventHandler(this, "imgButton_logoImu_click");
- textarea_console = new GTextArea(this, 330, 60, 248, 200, G4P.SCROLLBARS_VERTICAL_ONLY | G4P.SCROLLBARS_AUTOHIDE);
- textarea_console.setOpaque(true);
- textarea_console.addEventHandler(this, "textarea_console_change");
- label2 = new GLabel(this, 330, 40, 127, 20);
- label2.setText("Console window");
- label2.setTextBold();
- label2.setOpaque(false);
- button_start = new GButton(this, 325, 10, 80, 30);
- button_start.setText("Start");
- button_start.setTextBold();
- button_start.addEventHandler(this, "button_start_click");
- button_stop = new GButton(this, 415, 10, 80, 30);
- button_stop.setText("Stop");
- button_stop.setTextBold();
- button_stop.addEventHandler(this, "button_stop_click");
- button_clearConsole = new GButton(this, 505, 10, 80, 30);
- button_clearConsole.setText("Clear");
- button_clearConsole.setTextBold();
- button_clearConsole.addEventHandler(this, "button_clearConsole_click");
- dropList_baud1 = new GDropList(this, 110, 155, 90, 66, 3);
- dropList_baud1.setItems(loadStrings("list_308840"), 0);
- dropList_baud1.addEventHandler(this, "dropList_baud1_click");
- dropList_com1 = new GDropList(this, 10, 155, 90, 66, 3);
- dropList_com1.setItems(loadStrings("list_253554"), 0);
- dropList_com1.addEventHandler(this, "dropList_com1_click");
- dropList_baud2 = new GDropList(this, 110, 205, 90, 63, 3);
- dropList_baud2.setItems(loadStrings("list_833132"), 0);
- dropList_baud2.addEventHandler(this, "dropList_baud2_click");
- dropList_com2 = new GDropList(this, 10, 205, 90, 66, 3);
- dropList_com2.setItems(loadStrings("list_355172"), 0);
- dropList_com2.addEventHandler(this, "dropList_com2_click1");
- label3 = new GLabel(this, 10, 185, 192, 20);
- label3.setTextAlign(GAlign.LEFT, GAlign.MIDDLE);
- label3.setText("IMU-Module #2");
- label3.setTextBold();
- label3.setOpaque(false);
- label4 = new GLabel(this, 10, 135, 192, 20);
- label4.setTextAlign(GAlign.LEFT, GAlign.MIDDLE);
- label4.setText("IMU-Module #1");
- label4.setTextBold();
- label4.setOpaque(false);
- button_connect1 = new GButton(this, 210, 150, 80, 30);
- button_connect1.setText("Connect");
- button_connect1.setTextBold();
- button_connect1.addEventHandler(this, "button_connect1_click");
- button_connect2 = new GButton(this, 210, 200, 80, 30);
- button_connect2.setText("Connect");
- button_connect2.setTextBold();
- button_connect2.addEventHandler(this, "button_connect2_click");
- button_findSerial = new GButton(this, 15, 10, 80, 30);
- button_findSerial.setText("Find Serials");
- button_findSerial.setTextBold();
- button_findSerial.addEventHandler(this, "button_findSerial_click");
- togGroup1 = new GToggleGroup();
- button_autoConnect = new GButton(this, 15, 50, 80, 30);
- button_autoConnect.setText("Auto-Connect");
- button_autoConnect.setTextBold();
- button_autoConnect.addEventHandler(this, "button_autoConnect_click");
- button_openGraph = new GButton(this, 110, 10, 80, 30);
- button_openGraph.setText("Open Graph");
- button_openGraph.setTextBold();
- button_openGraph.addEventHandler(this, "button_openGraph_click");
- button_openAnimation = new GButton(this, 109, 49, 80, 30);
- button_openAnimation.setText("Open Animation");
- button_openAnimation.setTextBold();
- button_openAnimation.addEventHandler(this, "button_openAnimation_click");
- textfield_send = new GTextField(this, 330, 270, 160, 21, G4P.SCROLLBARS_NONE);
- textfield_send.setOpaque(true);
- textfield_send.addEventHandler(this, "textfield_send_change");
- button_send = new GButton(this, 500, 265, 80, 30);
- button_send.setText("Send");
- button_send.setTextBold();
- button_send.addEventHandler(this, "button_send_click");
- dropList_whoSend = new GDropList(this, 230, 270, 90, 66, 3);
- dropList_whoSend.setItems(loadStrings("list_741946"), 0);
- dropList_whoSend.addEventHandler(this, "dropList_whoSend_click");
- window_graph = new GWindow(this, "Graph", 0, 0, 240, 120, false, JAVA2D);
- window_graph.setActionOnClose(G4P.CLOSE_WINDOW);
- window_graph.addDrawHandler(this, "win_graph_draw");
- window_animation = new GWindow(this, "Animation", 0, 0, 640, 360, false, JAVA2D);
- window_animation.setActionOnClose(G4P.CLOSE_WINDOW);
- window_animation.addDrawHandler(this, "win_animation_draw");
- sketchPad_animation = new GSketchPad(window_animation.papplet, 0, 0, 640, 360);
- sketchPad_animation.setOpaque(false);
- }
- // Variable declarations
- // autogenerated do not edit
- GImageButton imgButton_LogoPxl;
- GLabel label1;
- GImageButton imgButton_logoGithub;
- GImageButton imgButton_logoImu;
- GTextArea textarea_console;
- GLabel label2;
- GButton button_start;
- GButton button_stop;
- GButton button_clearConsole;
- GDropList dropList_baud1;
- GDropList dropList_com1;
- GDropList dropList_baud2;
- GDropList dropList_com2;
- GLabel label3;
- GLabel label4;
- GButton button_connect1;
- GButton button_connect2;
- GButton button_findSerial;
- GToggleGroup togGroup1;
- GButton button_autoConnect;
- GButton button_openGraph;
- GButton button_openAnimation;
- GTextField textfield_send;
- GButton button_send;
- GDropList dropList_whoSend;
- GWindow window_graph;
- GWindow window_animation;
- GSketchPad sketchPad_animation;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement