private void OnLog(IP2PNode node, String text)
 {
     if (Log != null)
     {
         Log(node, text);
     }
 }
 private void OnReceivedData(IP2PNode node, Byte[] data)
 {
     if (ReceivedData != null)
     {
         ReceivedData(node, data);
     }
 }
        private bool TryGetCurrentEdgeIndex(double distance, out IP2PNode currentNode, out int edgeIndex)
        {
            edgeIndex = 0;
            var distanceSum = 0.0;

            foreach (var edge in _edges)
            {
                currentNode = edge.NodeFrom;
                var length = edge.Edge.Length();
                if (distanceSum + length > distance)
                {
                    return(true);
                }
                else if (distanceSum + length == distance)
                {
                    currentNode = edge.NodeTo;
                    return(true);
                }

                distanceSum += length;
                edgeIndex++;
            }

            currentNode = null;
            return(false);
        }
Exemple #4
0
 public UI()
 {
     InitializeComponent();
     this.comboBox1.Items.Add(new ComboBoxItem("精确匹配(单关键字)", "Precise"));
     this.comboBox1.Items.Add(new ComboBoxItem("模糊匹配(单关键字)", "fuzzy"));
     //this.comboBox1.Items.Add(new ComboBoxItem("多关键字匹配", "multiple-key"));
     this.comboBox1.SelectedIndex = 0;
     IP2P = new EasyNode(show);
     CreateMyListView();
 }
Exemple #5
0
 public UI()
 {
     InitializeComponent();
     this.comboBox1.Items.Add(new ComboBoxItem("精确匹配(单关键字)", "Precise"));
     this.comboBox1.Items.Add(new ComboBoxItem("模糊匹配(单关键字)", "fuzzy"));
     //this.comboBox1.Items.Add(new ComboBoxItem("多关键字匹配", "multiple-key"));
     this.comboBox1.SelectedIndex = 0;
     IP2P = new EasyNode(show);
     CreateMyListView();
 }
 public void GetStatus(double t, out double a, out double v, out double s, out IP2PNode currentNode, out int currentEdgeIndex)
 {
     if (_jointMotionProfile != null)
     {
         _jointMotionProfile.GetStatus(t - _jointMotionProfileCreatedTime, out a, out v, out s);
         s += _jointMotionProfileCreatedDistance;
         TryGetCurrentEdgeIndex(s, out currentNode, out currentEdgeIndex);
     }
     else
     {
         a                = 0;
         v                = 0;
         s                = 0;
         currentNode      = null;
         currentEdgeIndex = 0;
     }
 }
Exemple #7
0
        public MyUI()
        {
            InitializeComponent();
            // 初始化窗体
            this.comboBox1.Items.Add(new ComboBoxItem("精确匹配(单关键字)", "Precise"));
            this.comboBox1.Items.Add(new ComboBoxItem("模糊匹配(单关键字)", "fuzzy"));
            //this.comboBox1.Items.Add(new ComboBoxItem("多关键字匹配", "multiple-key"));
            this.comboBox1.SelectedIndex = 0;
            this.listView1.GridLines     = true;         //显示行与行之间的分隔线
            this.listView1.FullRowSelect = true;         //要选择就是一行
            this.listView1.View          = View.Details; //定义列表显示的方式
            this.listView1.Scrollable    = true;         //需要时候显示滚动条
            this.listView1.MultiSelect   = false;        // 不可以多行选择
            this.listView1.HeaderStyle   = ColumnHeaderStyle.Clickable;
            this.listView1.Visible       = true;         //lstView可见
            this.listView1.Columns.Add("文件名", 80);
            this.listView1.Columns.Add("目标地址IP", 90);
            this.listView1.Columns.Add("目标地址文件路径", 230);
            this.listView1.Columns.Add("文件说明", 360);
            this.skinEngine1.SkinFile = Application.StartupPath + @"\ssk\MP10.ssk";
            IP2P = new EasyNode(show);

            // 初始化定义蓝牙相关参数
            string ativeDir = @"D:\";
            string newPath  = System.IO.Path.Combine(ativeDir, "HomeWork");

            System.IO.Directory.CreateDirectory(newPath);
            // 检查蓝牙设备是否已经打开
            if (!checkBluetooth())
            {
                MessageBox.Show("请打开电脑端蓝牙设备");
            }
            // 启动监听蓝牙设备连接的服务
            Listen();

            // 初始化图片压缩数据
            imageCompression();
        }
Exemple #8
0
        public MyUI()
        {
            InitializeComponent();
            // 初始化窗体
            this.comboBox1.Items.Add(new ComboBoxItem("精确匹配(单关键字)", "Precise"));
            this.comboBox1.Items.Add(new ComboBoxItem("模糊匹配(单关键字)", "fuzzy"));
            //this.comboBox1.Items.Add(new ComboBoxItem("多关键字匹配", "multiple-key"));
            this.comboBox1.SelectedIndex = 0;
            this.listView1.GridLines = true;  //显示行与行之间的分隔线
            this.listView1.FullRowSelect = true;  //要选择就是一行
            this.listView1.View = View.Details;  //定义列表显示的方式
            this.listView1.Scrollable = true;  //需要时候显示滚动条
            this.listView1.MultiSelect = false;  // 不可以多行选择
            this.listView1.HeaderStyle = ColumnHeaderStyle.Clickable;
            this.listView1.Visible = true;  //lstView可见
            this.listView1.Columns.Add("文件名", 80);
            this.listView1.Columns.Add("目标地址IP", 90);
            this.listView1.Columns.Add("目标地址文件路径", 230);
            this.listView1.Columns.Add("文件说明", 360);
            this.skinEngine1.SkinFile = Application.StartupPath + @"\ssk\MP10.ssk";
            IP2P = new EasyNode(show);

            // 初始化定义蓝牙相关参数
            string ativeDir = @"D:\";
            string newPath = System.IO.Path.Combine(ativeDir, "HomeWork");
            System.IO.Directory.CreateDirectory(newPath);
            // 检查蓝牙设备是否已经打开
            if (!checkBluetooth())
            {
                MessageBox.Show("请打开电脑端蓝牙设备");
            }
            // 启动监听蓝牙设备连接的服务
            Listen();

            // 初始化图片压缩数据
            imageCompression();
        }
        public IPose GetPose(TimeSpan time, out double acceleration, out double velocity, out double distance, out IP2PNode currentNode, out int currentEdgeIndex)
        {
            var t = (time - Created).TotalSeconds;

            _motionProfile.GetStatus(t, out acceleration, out velocity, out distance, out currentNode, out currentEdgeIndex);
            var pose = DirectedEdges.GetCurrentPose((float)distance);

            return(pose);
        }