예제 #1
0
        /// <summary>
        /// test if generate the beacon default message files
        /// </summary>
        void test_Generate()
        {
            BFGen bfgen = new BFGen("", "", "", false, false);
            {
                string xml = ".//input//validbeacons.xml";
                Debug.Assert(false == bfgen.Generate(".\\output"));
                Debug.Assert(false == checkbeaconfiles(".\\output", false));

                bfgen = new BFGen("", xml, "", false, false);
                Debug.Assert(true == bfgen.Generate(".\\output"));
                Debug.Assert(true == checkbeaconfiles(".\\output", false));
            }

            {
                string csv = ".//input//validbeacons.csv";
                bfgen = new BFGen(csv, "", "", false, true);//lack bin generate tool so rt false
                Debug.Assert(false == bfgen.Generate(".\\output"));
                Debug.Assert(false == checkbeaconfiles(".\\output", true));
                //here error. beacon which is outof range can raise error info, but data still in the list

                bfgen = new BFGen(csv, "", ".\\compiler\\CompilerBaliseV4000\\main\\compile.exe", false, true);
                Debug.Assert(true == bfgen.Generate(".\\output"));
                Debug.Assert(true == checkbeaconfiles(".\\output", false));
            }
        }
예제 #2
0
        private void Generate()
        {
            try
            {
                beaconList.Clear();
                leuList.Clear();
                SyDB.GetInstance().clear();

                if (false == clearOutputDir())
                {
                    return;
                }
                //log is updating
                {
                    IDataGen.toolVer = this.Text;
                    GENERIC_SYSTEM_PARAMETERS sydb = FileLoader.Load <GENERIC_SYSTEM_PARAMETERS>(this.textBoxSyDB.Text);
                    SyDB.GetInstance().LoadData(sydb);

                    IDataGen.sydbFile = this.textBoxSyDB.Text;//todo will delete
                }

                {
                    IDataGen gen         = null;
                    string   compilepath = currentRunDir + "\\compiler\\CompilerBaliseV4000\\main\\compile.exe";
                    gen = new BFGen(this.textBoxLayout.Text, this.textBoxBoundaryBeacon.Text, compilepath, this.radioButtoniTC.Checked, this.checkBoxGenBin.Checked);
                    ((BFGen)gen).genPro += new BFGen.GenProess(GenProess);
                    if (false == gen.Generate(this.textBoxOutput.Text))
                    {
                        return;
                    }
                }

                {
                    IDataGen gen = null;
                    gen = new BMVFGen(this.radioButtoniTC.Checked && this.Upstream_path_considered.Checked,
                                      ref beaconList,
                                      ref leuList,
                                      this.textBox_UpstreamFile.Text);

                    if (false == gen.Generate(this.textBoxOutput.Text))
                    {
                        return;
                    }
                }

                {
                    IDataGen gen = null;
                    gen = new LEURFGen(ref beaconList, ref leuList);
                    if (false == gen.Generate(this.textBoxOutput.Text))
                    {
                        return;
                    }
                }

                {
                    IDataGen gen       = null;
                    string   LEURFFile = this.textBoxOutput.Text + "\\LEU\\LEU_Result_Filtered_Values.xml";

                    gen = new LEUXmlGen(leuList, LEURFFile, currentRunDir, this.radioButtoniTC.Checked, this.checkBoxGenBin.Checked);
                    ((LEUXmlGen)gen).genPro += new LEUXmlGen.GenProess(GenProess);
                    if (false == gen.Generate(this.textBoxOutput.Text))
                    {
                        return;
                    }
                }
            }
            finally
            {
                IsBusy = false;
            }
        }