SemlerPDX

AVCS Load All Profile Miscellaneous Commands

May 11th, 2021
735
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'from AVCS CORE INIT_MAIN - inline function "AVCS_LoadAllProfMiscCommands"
  2.  
  3. Imports Microsoft.VisualBasic
  4. Imports System
  5. Imports System.Collections
  6. Imports System.Collections.Generic
  7.  
  8.  
  9. Public Class VAInline
  10.     dim cmdIndex as Int32
  11.     dim cmdProfMax as Int32 = 16
  12.     dim phrase as string
  13.     dim phrases as string
  14.     dim phraseArray() as string
  15.     dim phrasesList() as string
  16.     dim profileUnique as string = ""
  17.     dim phrasesFinal as new list(of string) ()
  18.     dim activeProfile as string = "CORE"
  19.  
  20.     Public Sub Main()
  21.        
  22.         if ((VA.GetText("~profile_to_init")) IsNot nothing)
  23.             activeProfile = VA.GetText("~profile_to_init")
  24.         end if
  25.        
  26.         if ((VA.GetInt("AVCS_" + activeProfile + "_PCMOS_MAX")) IsNot nothing)
  27.             cmdProfMax = Convert.ToInt32(VA.GetInt("AVCS_" + activeProfile + "_PCMOS_MAX"))
  28.         end if
  29.        
  30.         'Load all Profile Commands (Miscellaneous)
  31.         for cmdIndex = 1 to cmdProfMax
  32.             if (((VA.GetText("AVCS_" + activeProfile + "_MISC_" + cmdIndex.ToString())) IsNot nothing) and ((VA.GetText("AVCS_" + activeProfile + "_DATA_MISC_" + cmdIndex.ToString())) IsNot nothing))
  33.                 phrases = (VA.GetText("AVCS_" + activeProfile + "_MISC_" + cmdIndex.ToString()))
  34.                 phraseArray = vaProxy.Utility.ExtractPhrases(phrases, true, true)
  35.                 for each phrase in phraseArray
  36.                     if ((not(phrase = "")) and (not(phrasesFinal.Contains(phrase))))
  37.                         phrasesFinal.Add(phrase)
  38.                         profileUnique = profileUnique + phrase + ";"
  39.                         VA.SetText(phrase, cmdIndex.ToString())
  40.                     end if
  41.                 next
  42.             end if
  43.         next
  44.        
  45.         if not (profileUnique = "")
  46.             VA.SetText("AVCS_" + activeProfile + "_COMMANDS_MISC", profileUnique)
  47.         else
  48.             VA.SetText("AVCS_" + activeProfile + "_COMMANDS_MISC", nothing)
  49.         end if
  50.        
  51.     End Sub
  52.  
  53. End Class
RAW Paste Data