예제 #1
0
        // #426
        private void MainForm_Load2(object sender, System.EventArgs e)
        {
            #region ==== DockSample load layout ====
            string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");

            /* if (File.Exists(configFile))
             *      dockPanel.LoadFromXml(configFile, m_deserializeDockContent);*/
            #endregion

            Assembly     assem     = Assembly.GetEntryAssembly();
            AssemblyName assemName = assem.GetName();
            Version      ver       = assemName.Version;


            this.Text = String.Format("{0} - {1} - ({2})", assemName.Name, ver.ToString(), Application.ProductVersion);                         // Form Title
            // myScriptInfo = assemName.Name + " - " + ver.ToString();

            toolBar.Visible = false;
#if a151223
            var table = new DataTable();

            using (CsvReader csv = new CsvReader(
                       //new StreamReader(@"D:\OneDrive\0K\(K15)\5-EE\$EE\battery-CSV\L0004_8A_0_1200.csv"), true))
                       new StreamReader(@"D:\OneDrive\0K\(K15)\5-EE\$EE\battery-CSV\20151221_L0004_8A_Tool.csv"), true))
            {
                table.Load(csv);
            }

            MessageBox.Show(String.Format("Table contains {0} rows.", table.Rows.Count));
#endif
#if auto_log_decode
            var Log = new EEPROMLOG();
            Log.DecodeFile(@"D:\Dropbox\Coding\sharp\DRT\2015-11-06_17-41-40_CA0311000001_eeprom_dump.txt",
                           @"D:\Dropbox\Coding\sharp\DRT\logPlot2\logPlot\bin\Debug\EEPROM MAP\EEPROM MAP (VCU2.0) 150707 - 32bit-RTC.xls");
            dataSource.Add(Log);
#endif
#if auto_xls
            var Log = new ExcelLog();
            //Log.DecodeFile(@"D:\Dropbox\Coding\sharp\5000 pt 統達6.9AH檢查項目[email protected]");
            //Log.DecodeFile(@"D:\Dropbox\0K\(K15)\5-EE\$EE\battery-CSV\L0004_8A_0_120.xls");
            Log.DecodeFile();
            if ((Log.DataSet != null) && (!dataSource.Contains(Log)))
            {
                dataSource.Add(Log);
                MessageBox.Show(String.Format("Load {0} table(s)", Log.DataSet.Tables.Count));                 // from\n{1}", sFile1);
            }
#endif
            if (Global.isRunning)
            {
                return;
            }
            Global.isRunning = true;
            backgroundWorker1.RunWorkerAsync();
        }
예제 #2
0
		// #426
		private void MainForm_Load2(object sender, System.EventArgs e)
		{
			#region ==== DockSample load layout ==== 
			string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");

			/* if (File.Exists(configFile))
				dockPanel.LoadFromXml(configFile, m_deserializeDockContent);*/
			#endregion

			Assembly assem = Assembly.GetEntryAssembly();
			AssemblyName assemName = assem.GetName();
			Version ver = assemName.Version;
			

			this.Text = String.Format("{0} - {1} - ({2})", assemName.Name, ver.ToString(), Application.ProductVersion);		// Form Title
			// myScriptInfo = assemName.Name + " - " + ver.ToString();
			
			toolBar.Visible = false;
#if a151223
			var table = new DataTable();

			using (CsvReader csv = new CsvReader(
				//new StreamReader(@"D:\OneDrive\0K\(K15)\5-EE\$EE\battery-CSV\L0004_8A_0_1200.csv"), true))
				new StreamReader(@"D:\OneDrive\0K\(K15)\5-EE\$EE\battery-CSV\20151221_L0004_8A_Tool.csv"), true))
			{
				table.Load(csv);
			}

			MessageBox.Show( String.Format("Table contains {0} rows.", table.Rows.Count) );
#endif
#if auto_log_decode
			var Log = new EEPROMLOG();
			Log.DecodeFile(@"D:\Dropbox\Coding\sharp\DRT\2015-11-06_17-41-40_CA0311000001_eeprom_dump.txt",
				@"D:\Dropbox\Coding\sharp\DRT\logPlot2\logPlot\bin\Debug\EEPROM MAP\EEPROM MAP (VCU2.0) 150707 - 32bit-RTC.xls");
			dataSource.Add(Log);
#endif
#if auto_xls
			var Log = new ExcelLog();
			//Log.DecodeFile(@"D:\Dropbox\Coding\sharp\5000 pt 統達6.9AH檢查項目[email protected]");
			//Log.DecodeFile(@"D:\Dropbox\0K\(K15)\5-EE\$EE\battery-CSV\L0004_8A_0_120.xls");
			Log.DecodeFile();
			if ( (Log.DataSet != null) && (!dataSource.Contains(Log)) )
			{
				dataSource.Add(Log);
				MessageBox.Show(String.Format("Load {0} table(s)", Log.DataSet.Tables.Count)); // from\n{1}", sFile1);
			}
#endif
			if (Global.isRunning) return;
			Global.isRunning = true;
			backgroundWorker1.RunWorkerAsync();
		}