Пример #1
0
 private void PopulateAttributes()
 {
     PEBKneeConnectionAttrs   = EnvironmentFiles.GetMultiDirectoryFileList(EnvironmentFiles.GetStandardPropertyFileDirectories(), PEBKneeConnectionAttr);
     PEBFlangedBraceAttrs     = EnvironmentFiles.GetMultiDirectoryFileList(EnvironmentFiles.GetStandardPropertyFileDirectories(), PEBFlangedBraceAttr);
     PEBStraightMemberAttrs   = EnvironmentFiles.GetMultiDirectoryFileList(EnvironmentFiles.GetStandardPropertyFileDirectories(), PEBStraightMemberAttr);
     PEBRadialMemberAttrs     = EnvironmentFiles.GetMultiDirectoryFileList(EnvironmentFiles.GetStandardPropertyFileDirectories(), PEBRadialMemberAttr);
     PEBSpliceConnectionAttrs = EnvironmentFiles.GetMultiDirectoryFileList(EnvironmentFiles.GetStandardPropertyFileDirectories(), PEBSpliceConnectionAttr);
     PEBBasePlateAttrs        = EnvironmentFiles.GetMultiDirectoryFileList(EnvironmentFiles.GetStandardPropertyFileDirectories(), PEBBasePlateAttr);
 }
Пример #2
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (txtPassword.Text == txtPasswordConfirm.Text)
     {
         BatchFileName = Path.Combine(Information.TempDirectoryTempData, DateTime.Now.ToString("yyyyMMddHHmmss") + ".bat");
         EnvironmentFiles.GenerateSetSetLogonAs(BatchFileName, txtUserName.Text, txtPassword.Text, NumberOfInstances);
         Process.Start("notepad", BatchFileName);
     }
     else
     {
         MessageBox.Show("Password does not match! Please try again.", "Password Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Error);
         txtPassword.Focus();
     }
 }
Пример #3
0
        private void runTestbedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            string traceFileName = EnvironmentFiles.StartTestBed();

            if (string.IsNullOrEmpty(traceFileName))
            {
                MessageBox.Show("Cannot start test bed, please contact support or reinstall IDPE!",
                                "IDPE - Test Bed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }

            this.Cursor = Cursors.Default;
        }
Пример #4
0
        public void SetNumberOfInstances(int noOfInstances)
        {
            if (this.IsLocal)
            {
                Dictionary <string, string> configs = EnvironmentFiles.ReadEnvironmentConfigs();
                if (Registry.Instance.EnvironmentVariables.ContainsKey("instances"))
                {
                    Registry.Instance.EnvironmentVariables["instances"] = noOfInstances.ToString();
                }
                else
                {
                    Registry.Instance.EnvironmentVariables.Add("instances", noOfInstances.ToString());
                }

                EnvironmentFiles.SaveEnvironmentConfigs(configs);
            }
        }
Пример #5
0
        private void PrepareEnvironment()
        {
            try
            {
                Registry.Instance.EnvironmentVariables = EnvironmentFiles.ReadEnvironmentConfigs();
                Trace.TraceInformation("Reading environment variables from {0}...{1} found.",
                                       Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Constants.EnvironmentVariablesFileName),
                                       Registry.Instance.EnvironmentVariables.Count);

                int noOfInstances = 1;
                if (Registry.Instance.EnvironmentVariables.ContainsKey("instances"))
                {
                    noOfInstances = int.Parse(Registry.Instance.EnvironmentVariables["instances"]);
                }
                //EnvironmentFiles.GenerateStartStopCommands(false, noOfInstances);

                Trace.TraceInformation("Environment is registered for {0} instances", noOfInstances);
            }
            catch (Exception ex)
            {
                Trace.TraceError("Failed to intialize environment variables." + ex.ToString());
            }
        }
Пример #6
0
 private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
 {
     SetSchema();
     EnvironmentFiles.KillTestBedService();
 }
Пример #7
0
        public void runTestToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            if (m_dm_Property.propertyGrid.SelectedObject is SreDataSourceProperty)
            {
                SreDataSourceProperty dsProp = m_dm_Property.propertyGrid.SelectedObject as SreDataSourceProperty;
                if (string.IsNullOrEmpty(dsProp.TestFileName))
                {
                    MessageBox.Show("Cannot start test bed, please set a test file on property window!",
                                    "IDPE - Test Bed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    {
                        this.Cursor = Cursors.Default;
                        return;
                    }
                }

                if (!File.Exists(dsProp.TestFileName))
                {
                    MessageBox.Show("Cannot start test bed, " + dsProp.TestFileName + "  does not exist!",
                                    "IDPE - Test Bed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    {
                        this.Cursor = Cursors.Default;
                        return;
                    }
                }
                string traceFileName = string.Empty;
                bool   useWcf        = false; //todo
                if (useWcf)
                {
                    traceFileName = EnvironmentFiles.StartTestBed(true);
                    SreEnvironment local  = EnvironmentServiceDispatcherFactory.GetEnvironmentLocal();
                    string         result = EnvironmentServiceDispatcherFactory.GetInstance(true).ProcessFile(local.EnvironmentConfigsInstancesOnly[0],
                                                                                                              dsProp.DataSource.Id, dsProp.TestFileName);
                }
                else
                {
                    string pullFolder = DataSource.GetPullFolder(dsProp.DataSource.Id, dsProp.DataSourceKeys);
                    traceFileName = EnvironmentFiles.ProcessTestFile(pullFolder, dsProp.TestFileName);
                }

                if (!string.IsNullOrEmpty(traceFileName))
                {
                    System.Threading.Thread.Sleep(1000);//service needs time to start
                    if (Application.OpenForms.OfType <Log>().Count() == 1)
                    {
                        Application.OpenForms.OfType <Log>().First().Focus();
                    }
                    else
                    {
                        Log log = new Log("IDPE - Test Bed", traceFileName);
                        log.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Cannot start test bed, please contact support or reinstall IDPE!",
                                    "IDPE - Test Bed", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
            }
            this.Cursor = Cursors.Default;
        }