How to wait for a slice to be ready?

  • 1
  • Question
  • Updated 5 years ago
What is the proper way to wait for a slice to be ready to accept property modifications after I've created it?  

Waiting for the slice created event doesn't seem to be enough. I tried putting a set slice.freq command in the event, but it doesn't work.   But if I wait some time and then change the slice's frequency it will do it. 

Obviously there is some other event, besides slice created, a or property I have to monitor before I start making demands of the slice.  What is it?
Photo of Drax

Drax

  • 99 Posts
  • 13 Reply Likes

Posted 5 years ago

  • 1
Photo of BobT

BobT, Elmer

  • 59 Posts
  • 31 Reply Likes


Drax,


Here is a snippet of how I do that in CAT:


public void SliceAdded(Slice slc)
{
	switch (slc.Index)
	{
		case 0:
			if (slice0 == null)
			{
				slice0 = slc;
				slice0.PropertyChanged += new PropertyChangedEventHandler(slice0_PropertyChanged);
				slice0.SMeterDataReady += new Slice.SMeterDataReadyEventHandler(slice0_SMeterDataReady);
				//initialize the current_receive_slice
				if (current_receive_slice == null)
					{
					current_receive_slice = slice0;
						Set("Freq0", slice0.Freq.ToString());
					}
 
                      string split_status = "00";
                      if (slice0 != null && slice1 == null && slice0.Transmit)
                       {
                          split_status = "00";
                          this.CurrentTransmitSlice = 0;
                       }

The SliceAdded(Slice slc) method is called from the radio slice_added event handler. 

Hope this helps,

Bob