Page 1 of 1

About Uni Ruby script

Posted: Sun Dec 04, 2022 6:06 am
by DAMH
Hello
I'm using the 8.8 version using uni ruby script, I got stuck in a point where I want to update a value in Method UI using SetDouble, but the value doesn't seem to be updated
Ex:

Code: Select all

def Init
	Method().AddChoiceList("SyringeSizeList", "Syringe Size[uL]", $syringeSize[0],"ChangeInjectionVolume")
	for i in $syringeSize do
		Method().AddChoiceListItem("SyringeSizeList", i)
	end
	@injectionVolume=Method().GetString("SyringeSizeList").to_f*0.5
	Method().AddDouble("SampleVolume", "Sample Volume", @injectionVolume/1000, 1,EMeaningVolume,"")
end

def ChangeInjectionVolume(uiitemcollection, value)
	@injectionVolume=Method().GetString("SyringeSizeList").to_f*0.5
	Method().SetDouble("SampleVolume",@injectionVolume)
end
In this code, the "SampleVolume" is expected to change when selecting syringe size from list but the UI is not updated, is there a way to update values in Method() UI using a method like (Monitor().Synchronize())?