Beispiel #1
0
        public static void Show(FrameworkElement Owner, Proto.ProtoProcessDetail list, string net_id)
        {
            WinProcessDetail wid = new WinProcessDetail(Owner, list, net_id);

            wid.ShowDialog();
            return;
        }
Beispiel #2
0
        public WinProcessDetail(FrameworkElement Owner, Proto.ProtoProcessDetail list, string net_id)
        {
            InitializeComponent();
            RobotId = Convert.ToInt32(net_id);
            This    = this;

            this.Owner = Tool.MainWindow.This;
            Left       = 0;
            Top        = 0;
            Width      = Tool.MainWindow.This.Width;
            Height     = Tool.MainWindow.This.Height;
            this.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            int i = 0;

            foreach (var info in list.List)
            {
                ProcessObjInfo obj = new ProcessObjInfo();
                obj.ID        = ++i;
                obj.Name      = info.ProcessName.value_;
                obj.Path      = info.ProcessDir.value_;
                obj.Arg       = info.ProcessArg.value_;
                obj.DelayTime = info.ProcessDelayTime.value_;
                List.Add(obj);
            }
            ProcessInfoCollect.GetInstance().AddProcess(List);
            Refresh();
        }
        private void OnClickedCheck(object sender, RoutedEventArgs e)
        {
            Tool.XControl.XButton Btn = sender as Tool.XControl.XButton;
            string net_id             = Btn.Tag.ToString();

            Int32 retval = -1;

            Proto.ProtoProcessDetail list = new Proto.ProtoProcessDetail();

            this.WaitEvent(() =>
            {
                unsafe
                {
                    void *r_data = null;
                    int r_len    = 0;
                    retval       = NetInterface.NetPostSyncPackage(Convert.ToInt32(net_id), (int)NetInterface.PKTTYPE.kAgvShellProto_ProcessDetail, null, 0, &r_data, &r_len);
                    if (retval < 0 || null == r_data)
                    {
                        return;
                    }

                    byte[] ack_msg = null;

                    ack_msg = new byte[r_len];
                    using (UnmanagedMemoryStream ms = new UnmanagedMemoryStream((byte *)r_data, r_len))
                    {
                        ms.Read(ack_msg, 0, ack_msg.Length);
                    }

                    Tool.Proto.Unpackage <Proto.ProtoProcessDetail> info = new Proto.Unpackage <Proto.ProtoProcessDetail>(ack_msg);
                    if (info.build())
                    {
                        list = info.ob;
                    }
                    NetInterface.FreeDetail(r_data);
                }
            }, true, true);

            WinProcessDetail.Show(this, list, net_id);
        }
Beispiel #4
0
 public static void Show(this FrameworkElement Owner, Proto.ProtoProcessDetail list, string net_id)
 {
     WinProcessDetail.Show(Owner, list, net_id);
 }