public ConfigureLoggingFile(SequenceContext _seqContext, ChannelType _channelType) { InitializeComponent(); //Set up Teststand objects seqContext = _seqContext; seqContextPO = seqContext.AsPropertyObject(); selectedTSSequence = seqContext.SelectedSequences[0]; selectedTSStep = seqContext.SelectedSteps[0]; stepID = selectedTSStep.UniqueStepId; seqFile = selectedTSSequence.SequenceFile; permSeqContext = selectedTSSequence.Locals; //Must get sequence context this way for variables to save if teststand is restarted propObjectFile = seqFile.AsPropertyObjectFile(); EvaluationTypes eval = seqContext.Engine.NewEvaluationTypes(); eval.PropertyValueTypeFlags = 0x4; //set string as the valid evaluation type LogFilePath_exp.SetValidEvaluationTypes(eval); LogFilePath_exp.Context = seqContextPO; EvaluationTypes evalNumeric = seqContext.Engine.NewEvaluationTypes(); stepPropertyObject = selectedTSSequence.GetStepByUniqueId(stepID).AsPropertyObject(); //Set up dialog objects sysDefPath = seqContext.SequenceFile.FileGlobalsDefaultValues.GetValString("Veristand.SystemDefinitionPath", 1); //Get the System Definition path for the Client Sequence File. Create it if it does not exist. seqContext.SequenceFile.FileGlobalsDefaultValues.SetFlags("Veristand.SystemDefinitionPath", 0, 0x4400000); channelList = stepPropertyObject.GetValVariant("Veristand.ChannelPaths", 0); //Get ChannelPaths array of strings. LogFilePath_exp.Text = stepPropertyObject.GetValString("Veristand.LogFilePath", 0); //Try to get the Log File Path associated with this step SegmentFileSize_boolean.Checked = stepPropertyObject.GetValBoolean("Veristand.FileSegmenting", 0); //Get the boolean for Segmenting File Size option FileSegmentSize_num.Value = (int)stepPropertyObject.GetValNumber("Veristand.FileSegmentingSize", 0); //Get the File Segment Size value fileDescription = stepPropertyObject.GetValString("Veristand.FileDescription", 0); //Get the File Description advanced property filePropertyNames.AddRange(stepPropertyObject.GetValVariant("Veristand.FilePropertyNames", 0)); filePropertyValues.AddRange(stepPropertyObject.GetValVariant("Veristand.FilePropertyValues", 0)); channelType = _channelType; loggingChannelSelection.ShowCheckBox = true; //If the file at path FileGlobals.Veristand.SystemDefinitionPath exists and the extension is ".nivssdf" use that System Definition file to initialize the TreeAliasBrowserWF. if (System.IO.File.Exists(StringUtilities.unparseFilePathString(sysDefPath)) && System.IO.Path.GetExtension(StringUtilities.unparseFilePathString(sysDefPath)) == ".nivssdf") { //File exists with correct extension so try and populate the tree InitializeListBox(sysDefPath); } //If FileGlobals.Veristand.SystemDefinitionPath is empty or the file does not exist at path FileGlobals.Veristand.SystemDefinitionPath. else //(sysDefPath == "" || !System.IO.File.Exists(StringUtilities.unparseFilePathString(sysDefPath))) { //Do nothing } VSDialogs vsdiag = new VSDialogs(); }
private void openFileDialog1_FileOk(object sender, CancelEventArgs e) { OpenFileDialog openFile = (OpenFileDialog)sender; this.parameterfile_exp.Text = StringUtilities.stringArrayToExpressionArray(new string[] { StringUtilities.parseFilePathString(openFile.FileName) }); }