Ejemplo n.º 1
0
        private void buttonExport_Click(object sender, EventArgs e)
        {
            string fileName = @"E:\ToanTV\STM\2.source c#\STM_TestDevice\STM_TestDevice\bin\Debug\ConfigBatery.xlsx";
            // generateReport();
            //TestCopyPasteTextExcell();
            DevicesParser devicesParser = new DevicesParser(fileName);

            devicesParser.Open();

            List <Device> devices = devicesParser.ParseConfigDefine();
            List <Device> detail  = devicesParser.ParseSetupData(devices[0]);

            devicesParser.Close();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// set worker do make this task
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonLoadConfig_Click(object sender, EventArgs e)
        {
            //Battery.CreateReportFile(Application.StartupPath + "\\toan_creat_full.xlsx");
            //return;

            if (mDevicesParser == null)
            {
                mDevicesParser = new DevicesParser(getPathConfigFile());
            }
            else
            {
                //mDevicesParser.Close();
                //mDevicesParser = new DevicesParser(getPathConfigFile());
            }

            mDevicesParser.Open();
            mDevices = mDevicesParser.ParseConfigDefine();

            //devicesParser.Close();

            for (int i = 0; i < mDevices.Count; i++)
            {
                Control currButton = GetControlByName("buttonConfig" + (i + 1));
                Button  b          = (Button)currButton;
                if (currButton != null)
                {
                    //b.Click += button_Click;
                    b.Text    = mDevices[i].gCmdName;
                    b.Visible = true;
                }
                else
                {
                    b.Visible = false;
                }
            }

            mOpenFileSaveThreadEvent.Set();
            mOpenPasteExcellThredEvent.Set();
            mOpenUpdateBatStatUIThredEvent.Set();

            // disable change report file if thread is running
            buttonOpenReportFile.Enabled = false;
        }