12-01-2015 04:24 AM
Hi,
I have to build a coustom report generator plugin for Teststand by using c#. In the Teststand API there is a method integrated called "DisplayEditNumericFormatDialog"
Is there a way to set the sample value of the window that will appear if the method is called?
I do the following things:
private void button1_Click(object sender, EventArgs e) { mChanged = true; bool tempbool; PropertyObject tempobject = mEngine.NewPropertyObject(PropertyValueTypes.PropValType_Number, false, "", 0); //creates a temporary PropertyOgject to show the EditNumericFormatWindow tempobject.NumericFormat = mConfig.GetValString(P_PluginSpecific_Options_NumericFormat, 0); //read the numeric format of the plugin options tempobject.DisplayEditNumericFormatDialog("Numeric Format", out(tempbool), 1); //Show the EditNimericFormatWindow if (tempobject.NumericFormat == "") mConfig.SetValString(P_PluginSpecific_Options_NumericFormat, 0, "%$.13g"); else mConfig.SetValString(P_PluginSpecific_Options_NumericFormat, 0, tempobject.NumericFormat); MessageBox.Show(tempobject.NumericFormat.ToString()); }
thanks in advance
Solved! Go to Solution.
12-02-2015 04:14 AM
Hwllo f4bo
in TS i used an expression with this syntax
RunState.Engine.DisplayEditNumericFormatDialog("","%2.2d",0,20)
the last value set the sample value
Hope it helps
12-03-2015 06:46 AM - edited 12-03-2015 06:52 AM
Hello f4bo,
attached a sequence which show how this can be done.
Locals.Local = RunState.Engine.NewPropertyObject(PropValType_Number, False, "",0x1),
Locals.Local.AsPropertyObject.NumericFormat = "%b",
Locals.Local.AsPropertyObject.SetValNumber("", 0, 20),
Locals.Local.AsPropertyObject.DisplayEditNumericFormatDialog("Fake title", False, 0)
12-03-2015 09:05 AM
Hello Duffy2007
this solution does work!
thanks for your quick support!