예제 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            RefreshComports();
            logtxt.AppendText("FumBionic Controller V1.0\r\n");
            logtxt.AppendText("Ready to connect...\r\n");
            m_PushGraphCtrl.BackColor    = Color.Black;
            m_PushGraphCtrl.LineInterval = 2;
            EMGLine           = m_PushGraphCtrl.AddLine("EMGLine", Color.Yellow);
            EMGLine.Thickness = 2;

            //TcpConfig frmConnect = new TcpConfig();
            //if (frmConnect.ShowDialog() == DialogResult.OK)
            //{
            //    if (frmConnect.txtIP.Text != string.Empty && frmConnect.txtPort.Text != string.Empty)
            //    {
            //        IP = frmConnect.txtIP.Text;
            //        Port = int.Parse(frmConnect.txtPort.Text);
            //        tcpConnection = new TCP_Communication();
            //    }
            //    else
            //    {
            //        MessageBox.Show("One or more inputs are Empty");
            //    }
            //}
            //else
            //{
            //    logtxt.AppendText("Connection Failed !! \r\n");
            //}
        }
예제 #2
0
        private void masterDataGridView_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            if (!updateGraph)
            {
                return;
            }
            DataRow drow    = dsData.Tables["Processes"].Rows[e.RowIndex];
            string  sProcID = drow.ItemArray[4].ToString();

            DataView dView = new DataView(dsData.Tables["Processes"], "ProcId=" + sProcID, "theTime", DataViewRowState.CurrentRows);

            /*
             * //using Linq
             * DataTable orders = dsData.Tables["Processes"];
             * EnumerableRowCollection<DataRow> query =
             *  from order in orders.AsEnumerable()
             *  where order.Field<bool>("OnlineOrderFlag") == true
             *  orderby order.Field<decimal>("TotalDue")
             *  select order;
             * DataView view = query.AsDataView();
             */

            C2DPushGraph.LineHandle lHandle = PushGraph1.AddLine(lineNumber, Color.Red);
            if (lHandle != null)
            {
                lHandle.Clear();
            }

            DataTable dTable = dView.ToTable("processtimes", false, new string[] { "User", "theTime" });

            System.Diagnostics.Debug.WriteLine("----------");
            foreach (DataRow dr in dTable.Rows)
            {
                object[] sA   = dr.ItemArray;
                int      iVal = Convert.ToInt16(sA[0]);
                System.Diagnostics.Debug.WriteLine(iVal.ToString());
                PushGraph1.Push(iVal, lineNumber);
            }
            PushGraph1.UpdateGraph();
        }
예제 #3
0
        public MemTracerForm()
        {
            InitializeComponent();

            m_delegateAddModuleInfo = new DelegateAddModuleInfo(this.AddModuleInfo);
            m_delegateOnDisconnect  = new DelegateOnDisconnect(this.OnDisconnect);
            m_delegateAddSnapshot   = new DelegateAddSnapshot(this.AddSnapshot);

            snapshotList1.OnCompareSnapshots = new DelegateCompareSnapshots(this.CompareSnapshots);
            snapshotList1.OnOverlapSnapshots = new DelegateOverlapSnapshots(this.OverlapSnapshots);
            snapshotList1.SetMainForm(this);
            snapshotInfo1.Init("Global");

            m_graphLineHandle = usageGraph.AddLine(0, Color.LightGreen);

            ms_MainForm = this;

            LoadConfig(kConfigFileName);
            StackTracer = new DiaStackTracer();

            EnableTabPage(tabPageFrameSnapshot, IsFrameAnalysisEnabled());
            EnableTabPage(tabPageFrameOps, IsFrameAnalysisEnabled());
        }