private void logFileStart_Click(object sender, EventArgs e) { if (Utils.IOHelper.isFile(this.logFile.Text)) { //生成需要合并的文件 WelcomeForm.logFileName = this.logFile.Text; if (logFileName == null) { MessageBox.Show("ops,wrong file", "not a logat files", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { WelcomeForm.logDirPath = null; //调用DLL中的方法分析log,并返回需要的数据,放入自己建立的结构体数组中 Console.WriteLine("C#, logFileName:" + logFileName); LOGDLL.LogResult[] myLog = LOGDLL.Analysis(logFileName); //打开新的窗体 Form newForm = new LogAnalysis(myLog); newForm.Show(); //this.Hide(); } } else { MessageBox.Show("ops,should be a file!", "not file", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
//TableLayoutPanel wps_TableLayoutPanel = null; public LogAnalysis(LOGDLL.LogResult[] myLog) { InitializeComponent(); this.myLog = myLog; InitWpsLayout(); }
//添加扫描结果 public void addWpsScanResults(LOGDLL.LogResult log) { scanResultsArray = LOGDLL.getScanResults(log); scanResultButton = new Button(); scanResultButton.Text = "scan_bss:" + scanResultsArray.Length; //添加点击事件 scanResultButton.Click += new EventHandler(scanResultButton_click); }
private void startButton_Click(object sender, EventArgs e) { List <logcatInfo> logCheckes = new List <logcatInfo>(); for (int i = 0; i < this.listView1.Items.Count; i++) //for (int i = 0; i < this.logcatList.Count; i++) { if (this.listView1.Items[i].Checked) { logCheckes.Add(logcatList[i]); } } //利用list 中 sort排序, 自定义排序方法 logCheckes.Sort(Compare); CombineFile(logCheckes, WelcomeForm.logDirPath + "\\LOGANALYSIS"); for (int i = 0; i < logCheckes.Count; i++) { Console.WriteLine(logCheckes[i].name + "----" + logCheckes[i].startTime); } WelcomeForm.logFileName = WelcomeForm.logDirPath + "\\LOGANALYSIS"; //分析log,打开新窗口 LOGDLL.LogResult[] myLog = LOGDLL.Analysis(WelcomeForm.logDirPath + "\\LOGANALYSIS"); Form logAnalysisForm = new LogAnalysis(myLog); logAnalysisForm.Show(); this.Close(); //处理kernel log String kernelLogPath = Utils.IOHelper.FindFileInDir(WelcomeForm.logDirPath, "dmesglog"); //EventListView.Execute(Application.StartupPath + @"\dmesgtime.exe " + "\"" + kernelLogPath + "\"" + " 1", 1); EventListView.Execute("dmesgtime.exe", "\"" + kernelLogPath + "\" 1"); }
public ScanResultListView(LOGDLL.ScanResults[] scanResultsArray) { InitializeComponent(); this.scanResultsArray = scanResultsArray; InitListView(); }
//添加状态机 public void addWpsState(LOGDLL.LogResult log) { wpsState = log; stateChangeTime = wpsState.time; stateCurrent = wpsState.cmd.Substring(0, wpsState.cmd.IndexOf('-')-1); stateNext = wpsState.cmd.Substring(wpsState.cmd.IndexOf('>') + 2); //Console.WriteLine("wps state: " + wpsState.cmd + " current:" + stateCurrent + " next:" + stateNext + "cmd:"+ wpsState.cmd + "<<<"); }
//构造函数,用于上层状态机 public LogData(LOGDLL.LogResult State, int type) { //此时,该类只用于上层状态 switch(type) { case 0x09: this.wifiOpenCLose = State; break; case 0x11: this.wifiFrameworkState = State; break; case 0x12: this.screenState = State; break; case 0x13: this.wifiSettingState = State; break; case 0x14: this.wifiConnectedState = State; break; } }