private void ReadDataFromDesignCSheet(DataSet data, string tableName, int linecolumn, int asetnamecolumn, int ipcolumn, int tagnamecolumn)
 {
     var dt = data.Tables[tableName];
     for (int i = 1; i < dt.Rows.Count; i++)
     {
         var item = new AssetList(dt.Rows[i][linecolumn].ToString(), dt.Rows[i][asetnamecolumn].ToString(), dt.Rows[i][ipcolumn].ToString(), dt.Rows[i][tagnamecolumn].ToString());
         if (!item.Valid) continue;
         excelAssetlList.Add(item);
     }
 }
        private void bt_startGen(object sender, EventArgs e)
        {
            if (l5xLoaded && xLSCumstomLoaded && xLSGeneralLoaded && xLSDataSheetLoaded)
            {
                //excelAssetlList.Clear();
                //all_faults.Clear();
                //all_datatypes.Clear();
                //excelFaultList.Clear();
                InitialMemArea();
                ReadDataFromFaultsExcels(ds_excel_custom, "A_Faults", 1, 4);
                ReadDataFromFaultsExcels(ds_excel_General, "A_Faults", 1, 5);
                if (cbDontUseDesignCrit.Checked == false)
                {
                    ReadDataFromDesignCSheet(ds_excel_DesignCSheet, "AssetList", 1, 3, 4, 5);
                }
                else
                {
                    excelAssetlList.Clear();
                    for (int i = 1; i < 26; i++)
                    {
                        var item = new AssetList(_createassetnr(i) + "FIS", "Asset", "0.0.0.0", _createassetnr(i) + "FIS");
                        excelAssetlList.Add(item);
                    }
                }

                CreateAllDatatypes();
                CreatingExtFaults();
                CreatingIntFaults();

                _formatingDataGridAllFaults(dataGridView_AllFaults);  // dodanie wszystkich bledow dla grida
                dataGridView_AssetsList.DataSource = excelAssetlList;  // lista z assetami pobrana z excela .
                AddAssetsListBox();

                //========================= new table ======================================
                //foreach (var fault in all_faults)
                //{
                //    _MiFilterSet(fault);
                //}

                //dataGridViewhehe.DataSource = all_faults;

                //(cMenustriphehe.Items[0] as ToolStripMenuItem).DropDownItems.Clear();
                //foreach (var assetname in excelAssetlList)
                //{
                //    (cMenustriphehe.Items[0] as ToolStripMenuItem).DropDownItems.Add(assetname.ToString(), null, AssingToAsset_allFaults);
                //}

                //_formatingDataGridNEW(dataGridViewhehe);
                Genetatestatus(true);
            }
            else
            {
                MessageBox.Show("Necessary files for generate source are not loaded");
            }
        }