• Save
Rifartek Robot Training Course - How to use ClientRobot
Upcoming SlideShare
Loading in...5
×
 

Rifartek Robot Training Course - How to use ClientRobot

on

  • 719 views

 

Statistics

Views

Total Views
719
Views on SlideShare
678
Embed Views
41

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 41

http://www.rifartek.com 35
http://ns.rifartek.com 6

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Rifartek Robot Training Course - How to use ClientRobot Rifartek Robot Training Course - How to use ClientRobot Presentation Transcript

    • Rifartek Middleware Programming Training Course How to use ClientRobot
    • Outline
      • Use ClientRobot to integrate ZigBee in 10 minutes
      • ClientRobot Integration
    • CliRobot Integration Script
    • Integrate ZigBee into DB (1/5)
      • The ZigBee module will return:
        • node-id, tag-id, LQI, RSSI
    • Integrate ZigBee into DB (2/5)
      • Insert Raw data into DB for further processing
        • Use Database Module and
        • The “script” integration method
    • Integrate ZigBee into DB (3/5)
      • Click “script” button
      • Invoke wRobot to insert data for you
    • Integrate ZigBee into DB (4/5) String a[] = id.split(","); String param[] = new String[2]; param[0] = "execute"; param[1] = "INSERT INTO zigbee(allid,insertTime,node_id,tag_id,LQI,RSSI) " + "values('"+id+"',NOW(),"+a[0]+","+a[1]+","+a[2]+","+a[3]+")"; try{ frame.call("Database",param); }catch(Exception e){ }
    • Integrate ZigBee into DB (5/5)
      • Result
    • Integrate ZigBee into File
    • More about ClientRobot Integration
    • CliRobot and ServRobot
      • Dynamic Relationship
      ServRobot module1 module2 CliRobot tab1 tab1 Negotiate Number of Modules Module attributes Security Mechanisms …
    • CliRobot and ServRobot (Cont.)
      • Message Dispatch Relationship
      ServRobot CliRobot sendMsg (String) OnMsg(String) call(module, param) OnCmd( ) sendData (String) Server send RFID Tag information Client request server module to do command
    • CliRobot and Extension
      • Script (java statement)
      • Plugin (java program)
    • CliRobot and Extension (Cont.)
      • Script vs. Plugins
      CliRobot Receive Message For each module tab Is script? Is plugin? For each plugin Invoke plugin’s OnMsg() method dynamically execute statement done for this module yes yes No No
    • Script of CliRobot
      • Click “script” button and
      • Write Java Statements
        • What you want to do when you receive a message.
        • Ex: Write file
    • Plugins of CliRobot
      • Click “plugins..” button and
      • Write Java classes
        • A set of java classes that fulfill your task
      • Load main java class into plugin management panel
    • CliRobot Integration Using Script
    • Integrate ZigBee into DB (1/5)
      • The ZigBee module will return:
        • node-id, tag-id, LQI, RSSI
    • Integrate ZigBee into DB (2/5)
      • Insert Raw data into DB for further processing
        • Use Database Module and
        • The “script” integration method
    • Integrate ZigBee into DB (3/5)
      • Click “script” button
      • Invoke wRobot to insert data for you
    • Integrate ZigBee into DB (4/5) String a[] = id.split(","); String param[] = new String[2]; param[0] = "execute"; param[1] = "INSERT INTO zigbee(allid,insertTime,node_id,tag_id,LQI,RSSI) " + "values('"+id+"',NOW(),"+a[0]+","+a[1]+","+a[2]+","+a[3]+")"; try{ frame.call("Database",param); }catch(Exception e){ }
    • Integrate ZigBee into DB (5/5)
      • Result
    • Integrate ZigBee into File
    • CliRobot Integration Using Plugin
    • The “ RifartekRobotPlugin ” base class (1/3)
      • The base class that
        • communicates with CliRobot
        • extends the capability of CliRobot
      • Class Hierarchy:
      RifartekRobotPlugin MyPlugin OOP Extends java.awt.Frame OOP Extends Abstract class
    • The “ RifartekRobotPlugin ” base class (2/3)
      • Constructor
      • Extensible methods
      Parent: The CliRobot reference ModuleName: The name of corresponding module that this plugin resident RifartekRobotPlugin( WRobotFrame parent, String moduleName); Explanation Method prototype The initialization jobs that have to do when the corresponding module is started or loaded. OnLoad( ) The cleanup jobs that have to do when the corresponding module is closed or unloaded. OnUnLoad( ) Explanation Method prototype
    • The “ RifartekRobotPlugin ” base class (3/3)
      • Extensible methods (Cont.)
      The cleanup jobs that have to do when the plugin is stop by plugin management panel OnDestroy( ) The callback method that the PDI architecture would invoke when CliRobot receives a message from corresponding module. OnMsg(String msg, String antenna, String moduleName) The callback method that the PDI architecture would invoke when CliRobot receives a message from corresponding module and it founds that the plugin is busy processing previous jobs. OnBattleNeck(int buffer) buffer means the number of accumulated un-dispatched messages Simpler version of OnMsg( ) OnMsg(String msg) Explanation Method prototype
    • Basic steps to development plugin
      • Extend RifartekRobotPlugin class
      • Overwrite Necessarily methods of RifartekRobotPlugin abstract class
        • OnMsg() is the most important and should be overwritten
      • Compile
      • Testing with CliRobot
      • Repeat 1 ~ 4 to enhance functionality
    • Basic steps to development plugin – 1. Extend RifartekRobotPlugin class
    • Basic steps to development plugin – 2. Overwrite necessary methods
    • Basic steps to development plugin – 3. Compile
      • Put your class in C:RifartekcliRobot
      • Use javac to compile with wRobotApp.jar
        • Ex:
        • # javac –classpath wRobotApp.jar;. BasicPlugin.java
    • Basic steps to development plugin – 4. Test with CliRobot
      • Add “BasicPlugin”
    • Basic steps to development plugin – 5. Enhance functionality (1/3) Prepare a StringBuffer and TextArea to display read tags Initialize and setup UI properties
    • Basic steps to development plugin – 5. Enhance functionality (2/3) append tags into StringBuffer each time the CliRobot invokes the OnMsg method. And update TextArea to show the status
    • Basic steps to development plugin – 5. Enhance functionality (3/3)
    • Use Eclipse to development plugins
      • Eclipse
        • The open-source Java IDE
    • Steps of using Eclipse
      • Create One Eclipse Workspace
      • Create One java project
      • Copy CliRobot related files
      • Setup compilation parameters
      • Extends RifartekRobotPlugin and Test
      • Enhance functionality
    • Steps of using Eclipse – 1. Create One Eclipse Workspace
      • Create one directory and
        • ex: NCUTrainWorkSpace
      • Switch Eclipse workspace
        • File  SwitchWorkspace
    • Steps of using Eclipse – 2. Create Java Project
      • File  New  Project  Java Project
    • Steps of using Eclipse – 3. Copy CliRobot related files
      • Related files
        • Robot component: wRobotApp.jar, MessageBox.exe
        • image files
    • Steps of using Eclipse – 4. Setup Compilation Parameters (1/5)
      • Parameters
        • include the robot jar file
        • Startup methods
      Before setting, everything is mess
    • Steps of using Eclipse – 4. Setup Compilation Parameters (2/5)
      • The jar file
        • right click the project name, choose “properties”
        • choose the “Libraries” tab
        • click the “Add JARs…” and select “wRobotApp.jar”
    • Steps of using Eclipse – 4. Setup Compilation Parameters (3/5)
      • after setting, errors are gone!
    • Steps of using Eclipse – 4. Setup Compilation Parameters (4/5)
      • Setup startup parameters
        • right click the project name
        • click “Run As”, click “Run”
        • right click “Java Application”, new one
          • The “Main” tab
            • Enter “wRobotApp” as Main class
          • The “Arguments” tab
            • Enter “config.data 1234” in Program arguments
    • Steps of using Eclipse – 4. Setup Compilation Parameters (5/5)
    • Steps of using Eclipse – 5. Test