Exemple #1
0
 private void updatemodel_bttn_Click(object sender, EventArgs e)
 {
     if (status_rtb.Text.Contains("Feature tree imported") && status_rtb.Text.Contains("Model imported"))
     {
         if (flag = true)
         {
             if (File.Exists("txtfolder\\model_subtree_guncel.txt"))
             {
                 File.Delete("txtfolder\\model_subtree_guncel.txt");
             }
             flag = FeatureProcess.updatetreeviaFeture(openfeaturemodel_tb.Text);
             //ModelUpdate.updateModel();
             ModelUpdate.updateModel_new();
             //bu kısım mcm den parse edilerek oluşturlan txt lerde value değerlerini güncelleyerek mcm'e tekrar yazdıracak.
             foreach (ModelTree item in ModelUpdate.CreateModelTree())
             {
                 McmParser Xmlpars = new McmParser(openmodelpath_tb.Text, FileProcess.RemoveSpecialCharacters(item.parent) + ".mcm");
                 Xmlpars.WriteXmlNewValues();
             }
             //status_rtb.Clear();
             status_rtb.AppendText("*** Model updated ***\n");
             button1.Enabled        = true;
             openmatelo_btn.Visible = true;
         }
     }
     else
     {
         MessageBox.Show("Please Import Feature Model and MAtelo Model!");
     }
 }
Exemple #2
0
 private void exportmodel_btn_Click(object sender, EventArgs e)
 {
     if (openmodelpath_tb.Text == "")
     {
         MessageBox.Show("Please Select Matelo Project!");
     }
     else
     {
         foreach (ModelTree item in ModelUpdate.CreateModelTree())
         {
             McmParser Xmlpars = new McmParser(openmodelpath_tb.Text, FileProcess.RemoveSpecialCharacters(item.parent) + ".mcm");
             Xmlpars.XmlParsing();
         }
         //status_rtb.Clear();
         status_rtb.AppendText("*** Model imported ***\n");
     }
 }
Exemple #3
0
        public void eskifonk_calculatenewfeature_btn_Click()
        {
            string[]         feature_arr      = FileProcess.readFeature(openfeaturemodel_tb.Text);
            List <ModelTree> updatedModelTree = new List <ModelTree>(ModelUpdate.CreateModelTree());

            foreach (ModelTree item in ModelUpdate.CreateModelTree())
            {
                for (int i = 0; i < feature_arr.Length; i++)
                {
                    if ((item.parent == feature_arr[i].Split(',').ElementAt(0)) && (feature_arr[i].Split(',').ElementAt(1) == "1"))
                    {
                        foreach (string child in item.childs)
                        {
                            for (int j = i; j < feature_arr.Length; j++)
                            {
                                if (child == feature_arr[j].Split(',').ElementAt(0) && (feature_arr[j].Split(',').ElementAt(1) == "0"))
                                {
                                    List <string> childs_list = new List <string>(item.childs);
                                    childs_list.Remove(child);
                                    item.childs     = childs_list.ToArray();
                                    item.childvalue = 1 / item.childs.Length;
                                    //numbers.RemoveAt(numbers.IndexOf(4));
                                }
                            }
                        }
                    }
                    else if ((item.parent == feature_arr[i].Split(',').ElementAt(0)) && (feature_arr[i].Split(',').ElementAt(1) == "0"))
                    {
                        updatedModelTree.Remove(item);
                    }
                }
            }
            updatedModelTree = ModelUpdate.CreateModelTree();
            foreach (ModelTree item in updatedModelTree)
            {
                modeltreeshow_rtb.AppendText(item.parent.ToString().ToUpper() + "\n");
                foreach (var child in item.childs)
                {
                    modeltreeshow_rtb.AppendText("  --" + child.ToString().ToUpper() + " =>  child_value: " + item.childvalue.ToString() + "\n");
                }
            }
        }