Home AMX User Forum AMX Technical Discussion

Setting Bargraph Hi/Lo

Does anyone know if the commands for setting bargraph hi/lo (^GLL-/^GLH- or ^BMF %GLx%GHx) works on multi-state bargraph or just bargraphs.

I thought I'd be slick and create generic multi-state bargraph buttons and pre-define them in TPD4 with 21 states and a range lo of 0 and hi of 20 which would have more states then any button needed. Then in code I would set the lo/hi based on length of the array I use to populate the individual states. I often use sending levels instead of sending variable text when ever the states are known and can be pre-defined. I leave VT for "variable" text, duh.

In the past I would just defined the button parameters in TPD4 and then just send the button text from code but since it's such a pain in the butt to change in TPD4 if you want to shift states around or say add another state to the begining so I figure using the hi-lo commands would work but the various attempts I made yesterday didn't.

Anyone know for sure these work on multi-state bargraphs? Once I defined the correct counts and hi/lo the states populated correctly but what's the point of hi/lo commands if you have to pre-define in TPD4. I know the commands do work for plain old bargraphs as I've used them for displaying the play time of tracks which obviously change from trk to trk but I don't know about the multi-state bargraphs. Any one been here, done that?

Comments

  • cwpartridgecwpartridge Posts: 120
    Vining,

    Those commands should work for bargraphs and multi-state bargraphs. ms bargraphs are derived from bargraphs.
  • viningvining Posts: 4,368
    Vining,

    Those commands should work for bargraphs and multi-state bargraphs. ms bargraphs are derived from bargraphs.
    That's what I would have thought. I'll give it another try with a fresh brain. Since I can't define the number of states from code, I figured creating genric buttons with more states than requierd would be the correct approach.

    Here's the code I was using. I switched to ^BMF commands after the older commented out commands didn't seem to work. Originally I sent an array index for the TP coming online to 130 to allow 30 seconds after a master reboot but have since blocked that from running at all if the master coming online is the cause for the TP later coming online. Basically now when a TP comes online (not if iniated by the master's online) I would set a counter to 130 and start a timeline running at 1000ms to count this counter down. When the counter hit 100 I send the bargraph values and at 99 (highest state count) on down I send that state's VT that matches the counter. I have general numeric buttons 0-99, time buttons 0-59 and then a dozen or so VT buttons with a max of 16 states so I never send more than a dozen commands to any one TP in a pass (second count down).

    I think this should have worked but didn't.
    DEFINE_FUNCTION fnDVD_Do_Init_Wait(INTEGER iWait_Indx,INTEGER iSet,INTEGER iTime) 
    
         {
         if(iSet == DVD_WAIT_SET && !nDVD_Init_Waits[iWait_Indx])
    	  {
    	  nDVD_Init_Waits[iWait_Indx] = iTime ;
    	  nDVD_WaitSet = 1 ;
    	  fnDVD_Debug(FALSE,"'WAIT SET, UI(',itoa(iWait_Indx),'), INIT WAIT TIME (',itoa(iTime),') :DEBUG<',ITOA(__LINE__),'>'") ;
    	  }
         else if(iSet == DVD_WAIT_CLEAR && nDVD_Init_Waits[iWait_Indx])
    	  {
    	  STACK_VAR INTEGER i ;
    	  STACK_VAR INTEGER nLen ;
    	  
    	  nDVD_WaitSet = 0 ;
    	  nDVD_Init_Waits[iWait_Indx] = 0 ;
    	  //check for any other waits pending if so reset flag
    	  fnDVD_DeBug(FALSE,"'WAIT CLEARED, UI(',itoa(iWait_Indx),'), INIT WAIT TIME CLEARED :DEBUG<',ITOA(__LINE__),'>'") ;
    	  for(i = 1 ; i <= NUM_UIs_IN_SYSTEM ; i ++)
    	       {
    	       if(nDVD_Init_Waits[i])
    		    {
    		    nDVD_WaitSet = 1 ;
    		    BREAK ;
    		    }
    	       }
    	  }
    	  
         if(nDVD_WaitSet && !TIMELINE_ACTIVE(TL_DVD_WAITS))
    	  {
    	  TIMELINE_CREATE(TL_DVD_WAITS,TL_DVD_RT,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT) ;
    	  nDVD_TLActive = 1 ;
    	  }
         else if(!nDVD_WaitSet && TIMELINE_ACTIVE(TL_DVD_WAITS))
    	  {
    	  TIMELINE_KILL(TL_DVD_WAITS) ;
    	  nDVD_TLActive = 0 ;
    	  }
    	  
         RETURN  ;
         }
    
    DATA_EVENT[dvUI_DVDArry]
    
         {
         ONLINE://Main TP Online_Event defaults to Main Page
    	  {
    	  STACK_VAR INTEGER nUI_Indx ;
    	  STACK_VAR INTEGER nDVD_Indx ;
    	  
    	  nUI_Indx = GET_LAST(dvUI_DVDArry) ;
    	  #WARN 'REBOOT TP FOR DVD BTN STATE CHANGES TO TAKE AFFECT'
    	  if(!nMasterCameOnline)//if code is changed reboot the TP
    	       {
    	       SWITCH(nUI_TypeArry[nUI_Indx])
    		    {
    		    CASE UI_TYPE_iPHONE:
    		    CASE UI_TYPE_iTOUCH:
    		    CASE UI_TYPE_iPAD:
    		    CASE UI_TYPE_G4:
    			 {
    			 fnDVD_Do_Init_Wait(nUI_Indx,DVD_WAIT_CLEAR,DVD_WAIT_UI_VTTIME) ;
    			 fnDVD_Do_Init_Wait(nUI_Indx,DVD_WAIT_SET,DVD_WAIT_UI_VTTIME) ;
    			 }
    		    }
    	       }
    	  }
    
    DEFINE_FUNCTION fnDVD_Init_VT_BarGs(INTEGER iUI_Indx,INTEGER iCount)
    
         {
         LOCAL_VAR INTEGER nRunOnce ;
         LOCAL_VAR INTEGER nLen_SPD ;
         LOCAL_VAR INTEGER nLen_QHD ;
         LOCAL_VAR INTEGER nLen_QRP ;
         LOCAL_VAR INTEGER nLen_QZM ;
         LOCAL_VAR INTEGER nLen_UVO ;
         LOCAL_VAR INTEGER nLen_UAT ;
         LOCAL_VAR INTEGER nLen_UDT ;
         LOCAL_VAR INTEGER nLen_UPL ;
         LOCAL_VAR INTEGER nLen_SPN ;
         LOCAL_VAR INTEGER nLen_CHN ;
         STACK_VAR CHAR cNumber[3] ;
         
         if(!nRunOnce)
    	  {
    	  nRunOnce = 1 ;
    	  nLen_SPD = length_array(RX_PARAM_SPD) ;
    	  nLen_QHD = length_array(RX_PARAM_QHD) ;
    	  nLen_QRP = length_array(RX_PARAM_QRP) ;
    	  nLen_QZM = length_array(RX_PARAM_QZM) ;
    	  nLen_UVO = length_array(RX_UCMD_UVO) ;
    	  nLen_UAT = length_array(RX_UCMD_UAT) ;
    	  nLen_UDT = length_array(RX_UCMD_UDT) ;
    	  nLen_UPL = length_array(RX_UCMD_UPL) ;
    	  nLen_SPN = length_array(RX_PARAM_SPN) ;
    	  nLen_CHN = length_array(RX_UCMD_CHNLS) ;
    	  }
         
         if(iCount == 100)
    	  {
    	  fnDVD_DeBug(FALSE,"fnDEV_TO_STRING(dvUI_DVDArry[iUI_Indx]),', SENDING VT LVL STATES [ ',itoa(iCount),' ] :DEBUG<',ITOA(__LINE__),'>'") ;
    	  
    	  //fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_TIME_0_59),',0'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_TIME_0_59),',59'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_NUMERIC_0_99),',0'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_NUMERIC_0_99),',99'") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_SUR_CHNLS),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_SUR_CHNLS),',',itoa(nLen_CHN)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_SSPD_LEVELS),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_SSPD_LEVELS),',',itoa(nLen_SPD)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_FSPD_LEVELS),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_FSPD_LEVELS),',10'") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_HDMI_RES),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_HDMI_RES),',',itoa(nLen_QHD)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_REPEAT_MODE),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_REPEAT_MODE),',',itoa(nLen_QRP)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_ZOOM_MODE),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_ZOOM_MODE),',',itoa(nLen_QZM)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_INOUT_RES),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_INOUT_RES),',',itoa(nLen_UVO)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_AUDIO_TYPE),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_AUDIO_TYPE),',',itoa(nLen_UAT)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_DISC_TYPE),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_DISC_TYPE),',',itoa(nLen_UDT)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_STATUS),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_STATUS),',',itoa(nLen_UPL)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_TV_OUT),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_TV_OUT),',',itoa(nLen_SPN)") ;
    //	  
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLL-',itoa(DVD_VT_AUDIO_CHNLS),',1'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^GLH-',itoa(DVD_VT_AUDIO_CHNLS),',',itoa(nLen_CHN)") ;
    	  
    	   
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_SUR_CHNLS),   ',0,%GL1%GH',itoa(nLen_CHN)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_SSPD_LEVELS), ',0,%GL1%GH',itoa(nLen_SPD)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_FSPD_LEVELS), ',0,%GL1%GH5'") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_HDMI_RES),    ',0,%GL1%GH',itoa(nLen_QHD)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_REPEAT_MODE), ',0,%GL1%GH',itoa(nLen_QRP)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_ZOOM_MODE),   ',0,%GL1%GH',itoa(nLen_QZM)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_INOUT_RES),   ',0,%GL1%GH',itoa(nLen_UVO)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_AUDIO_TYPE),  ',0,%GL1%GH',itoa(nLen_UAT)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_DISC_TYPE),   ',0,%GL1%GH',itoa(nLen_UDT)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_STATUS),      ',0,%GL1%GH',itoa(nLen_UPL)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_TV_OUT),      ',0,%GL1%GH',itoa(nLen_SPN)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_AUDIO_CHNLS), ',0,%GL1%GH',itoa(nLen_CHN)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_TIME_0_59),   ',0,%GL1%GH59'") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_NUMERIC_0_99),',0,%GL1%GH99'") ;
    	  }
         else if(iCount && iCount < 100)
    	  {
    	  fnDVD_DeBug(FALSE,"fnDEV_TO_STRING(dvUI_DVDArry[iUI_Indx]),', SENDING VT LVL STATES [ ',itoa(iCount),' ] :DEBUG<',ITOA(__LINE__),'>'") ;
    	  cNumber = "'0',itoa(iCount)" ;
    	  //’%T<text >
    	  
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_NUMERIC_0_99),',',itoa(iCount),',%T',right_string(cNumber,2)") ;
    	  if(iCount <= 59)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_TIME_0_59),',',itoa(iCount),',%T',right_string(cNumber,2)") ;
    	       }
    	  if(iCount <= nLen_SPD)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_SSPD_LEVELS),',',itoa(iCount),',%Tx ',RX_PARAM_SPD[iCount]") ;
    	       }
    	  if(iCount <= 10)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_FSPD_LEVELS),',',itoa(iCount),',%Tx ',right_string(cNumber,1)") ;
    	       }
    	  if(iCount <= nLen_QHD)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_HDMI_RES),',',itoa(iCount),',%T',RX_PARAM_QHD[iCount]") ;
    	       }
    	  if(iCount <= nLen_QRP)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_REPEAT_MODE),',',itoa(iCount),',%T',RX_PARAM_QRP[iCount]") ;
    	       }
    	  if(iCount <= nLen_QZM)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_ZOOM_MODE),',',itoa(iCount),',%T',RX_PARAM_QZM[iCount]") ;
    	       }
    	  if(iCount <= nLen_UVO)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_INOUT_RES),',',itoa(iCount),',%T',RX_UCMD_UVO[iCount]") ;
    	       }
    	  if(iCount <= nLen_UAT)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_AUDIO_TYPE),',',itoa(iCount),',%T',RX_UCMD_UAT[iCount]") ;
    	       }
    	  if(iCount <= nLen_UDT)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_DISC_TYPE),',',itoa(iCount),',%T',RX_UCMD_UDT[iCount]") ;
    	       }
    	  if(iCount <= nLen_UPL)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_STATUS),',',itoa(iCount),',%T',RX_UCMD_UPL[iCount]") ;
    	       }
    	  if(iCount <= nLen_SPN)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_TV_OUT),',',itoa(iCount),',%T',RX_PARAM_SPN[iCount]") ;
    	       }
    	  if(iCount <= nLen_CHN)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_SUR_CHNLS),',',itoa(iCount),',%T',RX_UCMD_CHNLS[iCount]") 
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^BMF-',itoa(DVD_VT_AUDIO_CHNLS),',',itoa(iCount),',%T',RX_UCMD_CHNLS[iCount]") ;
    	       }
    	  (*
    	  fnDVD_DeBug(FALSE,"fnDEV_TO_STRING(dvUI_DVDArry[iUI_Indx]),', SENDING VT LVL STATES [ ',itoa(iCount),' ] :DEBUG<',ITOA(__LINE__),'>'") ;
    	  cNumber = "'0',itoa(iCount)" ;
    	  //’%T<text >
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_NUMERIC_0_99),',',itoa(iCount),',',right_string(cNumber,2)") ;
    	  if(iCount <= 59)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_TIME_0_59),',',itoa(iCount),',',right_string(cNumber,2)") ;
    	       }
    	  if(iCount <= nLen_SPD)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_SSPD_LEVELS),',',itoa(iCount),',x ',RX_PARAM_SPD[iCount]") ;
    	       }
    	  if(iCount <= 10)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_FSPD_LEVELS),',',itoa(iCount),',x ',right_string(cNumber,1)") ;
    	       }
    	  if(iCount <= nLen_QHD)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_HDMI_RES),',',itoa(iCount),',',RX_PARAM_QHD[iCount]") ;
    	       }
    	  if(iCount <= nLen_QRP)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_REPEAT_MODE),',',itoa(iCount),',',RX_PARAM_QRP[iCount]") ;
    	       }
    	  if(iCount <= nLen_QZM)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_ZOOM_MODE),',',itoa(iCount),',',RX_PARAM_QZM[iCount]") ;
    	       }
    	  if(iCount <= nLen_UVO)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_INOUT_RES),',',itoa(iCount),',',RX_UCMD_UVO[iCount]") ;
    	       }
    	  if(iCount <= nLen_UAT)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_AUDIO_TYPE),',',itoa(iCount),',',RX_UCMD_UAT[iCount]") ;
    	       }
    	  if(iCount <= nLen_UDT)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_DISC_TYPE),',',itoa(iCount),',',RX_UCMD_UDT[iCount]") ;
    	       }
    	  if(iCount <= nLen_UPL)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_STATUS),',',itoa(iCount),',',RX_UCMD_UPL[iCount]") ;
    	       }
    	  if(iCount <= nLen_SPN)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_TV_OUT),',',itoa(iCount),',',RX_PARAM_SPN[iCount]") ;
    	       }
    	  if(iCount <= nLen_CHN)
    	       {
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_SUR_CHNLS),',',itoa(iCount),',',RX_UCMD_CHNLS[iCount]") 
    	       fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_AUDIO_CHNLS),',',itoa(iCount),',',RX_UCMD_CHNLS[iCount]") ;
    	       }
    	  *)
    	  }
         else if(iCount == 0)
    	  {
    	  fnDVD_DeBug(FALSE,"fnDEV_TO_STRING(dvUI_DVDArry[iUI_Indx]),', SENDING VT LVL STATES [ ',itoa(iCount),' ] :DEBUG<',ITOA(__LINE__),'>'") ;
    	  cNumber = "'0',itoa(iCount)" ;
    	  
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_NUMERIC_0_99),',',itoa(iCount + 1),',',right_string(cNumber,2)") ;
    	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_TIME_0_59),',',itoa(iCount + 1),',',right_string(cNumber,2)") ;
    	  //fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_FSPD_LEVELS),',',itoa(iCount + 1),',x ',right_string(cNumber,1)") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_SSPD_LEVELS),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_FSPD_LEVELS),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_HDMI_RES),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_REPEAT_MODE),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_ZOOM_MODE),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_INOUT_RES),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_AUDIO_TYPE),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_DISC_TYPE),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_STATUS),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_TV_OUT),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_AUDIO_CHNLS),',',itoa(iCount + 1),',--'") ;
    //	  fnDVD_Send_UI_CMD(iUI_Indx,"'^TXT-',itoa(DVD_VT_SUR_CHNLS),',',itoa(iCount + 1),',..'") ;
    	  }
         
         RETURN ;
         }
    
    DEFINE_EVENT    //TIMELINE_EVENT [TL_DVD_WAITS]
         
    TIMELINE_EVENT [TL_DVD_WAITS]//1000 ms repeating
    
         {
         if(nDVD_WaitSet)
    	  {
    	  STACK_VAR INTEGER i ;
    	  
    	  nDVD_WaitSet = 0 ; //also verified in fnAVSys_Do_SW_Wait(INTEGER iSystem,INTEGER iSet,INTEGER iTime)
    	  for(i = 1 ; i <= NUM_UIs_IN_SYSTEM ; i ++)
    	       {
    	       if(nDVD_Init_Waits[i])
    		    {
    		    if(nDVD_Init_Waits[i] == 1)
    			 {
    			 fnDVD_Init_VT_BarGs(i,nDVD_Init_Waits[i]-1) ;
    			 nDVD_Init_Waits[i] = 0 ;
    			 }
    		    else if(nDVD_Init_Waits[i] <= 101)
    			 {
    			 fnDVD_Init_VT_BarGs(i,nDVD_Init_Waits[i]-1) ;
    			 nDVD_Init_Waits[i]-- ;
    			 nDVD_WaitSet = 1 ;
    			 }
    		    else if(nDVD_Init_Waits[i] > 101)//decrement wait values that aren't ready to execute
    			 {
    			 nDVD_Init_Waits[i] -- ;
    			 nDVD_WaitSet = 1 ;
    			 }
    		    }
    	       }
    	  }
         if(!nDVD_WaitSet)
    	  {
    	  TIMELINE_KILL(TL_DVD_WAITs) ;
    	  }
         }
    
  • cwpartridgecwpartridge Posts: 120
    I have verified the commands to change the upper and lower limits work, but the end result is probably not what you expect. For example, I created a multi-state bargraph and assigned it 20 states. Then I set the upper and lower limits to 1 and 20, and populated the text for each state to indicate which state was shown.

    When I ramp the level value from 1 to 20 and back to 1, the states show up as expected. (I.e. level=1->state=1, level=2-> state=2, level=3->state=3,...level=20->state=20).

    Then I change the upper limit to 10. When I ramp the level from 1 to 10, the states are scaled to display 1 to 20. (I.e. level=1->state=1, level=2-> state=3, level=3->state=5,...level=10->state=20).

    The upper and lower limits set the level range limits, and the number of states are scaled to fit into that range. The number of states are not changed according to the range of the level limits.

    This becomes more obvious when you look at it in the other direction. If there is a greater level range than there are states, the active level range for a state is scaled to level_range/num_states. The same state will be displayed for a range of level values. However, if there is a smaller level range than the number of states, there will be some states that are skipped when the number of states are scaled into the level range.

    Maybe I'm reading into what your are trying to do something that is incorrect, but this is how the commands work on the ms bargraphs.
  • viningvining Posts: 4,368
    Still can't get it to work the way I expected but I've come to realize setting the hi/lo is pretty much pointless anyway. I'll just keep the generic multi state bargraphs defined with 21 states, lo 0, hi 20 and omit sending the %GL%GH all together and just send the VT as needed while clearing states that aren't needed. Since I only send the level that cooresponds to the state I want displayed setting limits is a waste of time and probably causes the TP to scale the level being sent to it.
  • viningvining Posts: 4,368
    I have verified the commands to change the upper and lower limits work, but the end result is probably not what you expect. For example, I created a multi-state bargraph and assigned it 20 states. Then I set the upper and lower limits to 1 and 20, and populated the text for each state to indicate which state was shown.

    When I ramp the level value from 1 to 20 and back to 1, the states show up as expected. (I.e. level=1->state=1, level=2-> state=2, level=3->state=3,...level=20->state=20).

    Then I change the upper limit to 10. When I ramp the level from 1 to 10, the states are scaled to display 1 to 20. (I.e. level=1->state=1, level=2-> state=3, level=3->state=5,...level=10->state=20).

    The upper and lower limits set the level range limits, and the number of states are scaled to fit into that range. The number of states are not changed according to the range of the level limits.

    This becomes more obvious when you look at it in the other direction. If there is a greater level range than there are states, the active level range for a state is scaled to level_range/num_states. The same state will be displayed for a range of level values. However, if there is a smaller level range than the number of states, there will be some states that are skipped when the number of states are scaled into the level range.

    Maybe I'm reading into what your are trying to do something that is incorrect, but this is how the commands work on the ms bargraphs.

    I just saw your post and I pretty much came to the same conclusion, thanks.
  • DHawthorneDHawthorne Posts: 4,584
    The only advantage (and, I think it's a very useful one, I use it all the time) to the high/low setting is to automatically scale your bargraph to the same range as your device. It wouldn't be helpful they way you are using the buttons, but if, for example, you were doing a volume readout and your device went from 0-100, calculating the level to go to the default 0-255 (which we were forced to do in the Axcent days) can be a pain, and you wind up with rounding errors.
  • viningvining Posts: 4,368
    DHawthorne wrote: »
    The only advantage (and, I think it's a very useful one, I use it all the time) to the high/low setting is to automatically scale your bargraph to the same range as your device. It wouldn't be helpful they way you are using the buttons, but if, for example, you were doing a volume readout and your device went from 0-100, calculating the level to go to the default 0-255 (which we were forced to do in the Axcent days) can be a pain, and you wind up with rounding errors.
    I'm not sure what I was thinking when I started with this. In hind sight it really made no sense. The only other times that I've used these commands were to scale the "now playing" song bargraph to scale my bargraph to the current playing songs length. I was definitely over thinking or possible under thinking depending on how you want to look at it.

    It might have work the way I wanted if I also had a command to set the number of states a button had. Then using these commands might have made sense since I wanted it to start at 0-x (x = num states -1) as opposed to 1-x (x = states). Then I could set the number of state and then the lo/hi depending if I needed 0 base or a 1 base (normal).
Sign In or Register to comment.