Beispiel #1
0
        private void btn_ret_run_Click(object sender, RoutedEventArgs e)
        {
            App    p     = Application.Current as App;
            Intf   i     = new Intf(0);
            UInt16 delay = UInt16.Parse(intf_ckb_delay.Content.ToString());

            ApplySetting();

            curr_packer.SaveCurrentConfig(2);
            p.SwitchTo("runmode");
        }
Beispiel #2
0
        private void btn_ret_run_Click(object sender, RoutedEventArgs e)
        {
            App p = Application.Current as App;
            Intf i = new Intf(0);
            UInt16 delay = UInt16.Parse(intf_ckb_delay.Content.ToString());

            ApplySetting();
            
            curr_packer.SaveCurrentConfig(2);
            p.SwitchTo("runmode");

        }
Beispiel #3
0
        public Intf getInterface()
        {
            string val = agent.GetNodeReg(bot_addr, "target_weight");

            if (val == "")
            {
                return(new Intf(0));
            }
            Intf intf_byte = new Intf(UInt16.Parse(val));

            return(intf_byte);
        }
Beispiel #4
0
        public void UpdateDisplay()
        {
            Intf i = curr_packer.getInterface();

            curr_packer.agent.SetVibIntf(curr_packer.vib_addr, i);
            intf_ckb_mem.IsChecked            = i.b_Hasmem;
            intf_handshake.IsChecked          = i.b_Handshake;
            intf_ckb_delay.Content            = i.delay_length.ToString();
            intf_lb_feed_times.Content        = (i.feed_times + 1).ToString();
            intf_input_trigger.SelectedIndex  = i.fmt_input;
            intf_output_trigger.SelectedIndex = i.fmt_output;
            intf_pulse_width.Content          = curr_packer.agent.GetNodeReg(curr_packer.bot_addr, "cs_filter").ToString();
        }
Beispiel #5
0
        private void ApplySetting()
        {
            App p = Application.Current as App;
            Intf i = new Intf(0);
            UInt16 delay = UInt16.Parse(intf_ckb_delay.Content.ToString());

            i.b_Hasdelay = (delay > 0);
            i.b_Hasmem = intf_ckb_mem.IsChecked.Value;
            i.b_Handshake = intf_handshake.IsChecked.Value;
            i.delay_length = delay;
            i.feed_times =Convert.ToUInt16(UInt16.Parse(intf_lb_feed_times.Content.ToString()) - 1);
            i.fmt_input = Convert.ToUInt16(intf_input_trigger.SelectedIndex);
            i.fmt_output = Convert.ToUInt16(intf_output_trigger.SelectedIndex);
            curr_packer.setInterface(i);
            curr_packer.agent.SetVibIntf(curr_packer.vib_addr, i);
            curr_packer.agent.SetNodeReg(curr_packer.bot_addr, "cs_filter", Convert.ToUInt16(intf_pulse_width.Content));
            UpdateDisplay();
        }
Beispiel #6
0
        private void ApplySetting()
        {
            App    p     = Application.Current as App;
            Intf   i     = new Intf(0);
            UInt16 delay = UInt16.Parse(intf_ckb_delay.Content.ToString());

            i.b_Hasdelay   = (delay > 0);
            i.b_Hasmem     = intf_ckb_mem.IsChecked.Value;
            i.b_Handshake  = intf_handshake.IsChecked.Value;
            i.delay_length = delay;
            i.feed_times   = Convert.ToUInt16(UInt16.Parse(intf_lb_feed_times.Content.ToString()) - 1);
            i.fmt_input    = Convert.ToUInt16(intf_input_trigger.SelectedIndex);
            i.fmt_output   = Convert.ToUInt16(intf_output_trigger.SelectedIndex);
            curr_packer.setInterface(i);
            curr_packer.agent.SetVibIntf(curr_packer.vib_addr, i);
            curr_packer.agent.SetNodeReg(curr_packer.bot_addr, "cs_filter", Convert.ToUInt16(intf_pulse_width.Content));
            UpdateDisplay();
        }
Beispiel #7
0
 public void setInterface(Intf intf_byte)
 {
     agent.Action(bot_addr,"interface"+intf_byte.buf.ToString()); //set interface of bottom packer ex, interface123
 }
Beispiel #8
0
 public Intf getInterface()
 {
     string val = agent.GetNodeReg(bot_addr, "target_weight");
     if (val == "")
         return new Intf(0);
     Intf intf_byte = new Intf(UInt16.Parse(val));
     return intf_byte;
 }
Beispiel #9
0
 internal VibrateNode(SPort _port, byte node_addr) : base(_port, node_addr)
 {
     intf_byte = new Intf(0);
 }
Beispiel #10
0
 public void setInterface(Intf intf_byte)
 {
     agent.Action(bot_addr, "interface" + intf_byte.buf.ToString()); //set interface of bottom packer ex, interface123
 }
Beispiel #11
0
 public void SetVibIntf(byte vibaddr, Intf i)
 {
     VibrateNode vn = this[vibaddr] as VibrateNode;
     vn.intf_byte = i;
 }
Beispiel #12
0
 internal VibrateNode(SPort _port,byte node_addr): base(_port,node_addr)
 {
     intf_byte = new Intf(0);
 }