libhs_td5
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © GETpacman

//@version=5

// @description td5 Test Data Library for Logx Testing
library("libhs_td5")

export fill(matrix<string> dbus, bool fillData=true) =>
    
    string gm1=''
    string gm2=''
    string gm3=''
    string gm4=''
    string gm5=''
    string gm6=''
    string gm=''
    string gl=''
    string gs=''
    string gc=''

    string tab2='  '
    string tab4='    '

    var string o_skiplog = '^skip^'
    var string[] alphabet=array.from('     Alpha','      Beta','   Charlie','     Delta','      Echo','   Foxtrot','      Golf','     Hotel','     India','    Juliet','      Kilo','      Lima','      Mike','  November','     Oscar','      Papa','    Quebec','     Romeo','     Sugar','     Tango','   Uniform','    Victor','    Whisky','      Xray','    Yankee','      Zulu')
    var string[] alphabetc=array.from('Alpha','Beta','Charlie','Delta','Echo','Foxtrot','Golf','Hotel','India','Juliet','Kilo','Lima','Mike','November','Oscar','Papa','Quebec','Romeo','Sugar','Tango','Uniform','Victor','Whisky','Xray','Yankee','Zulu')

    int devcolmsg=2, int devcollevelC=3, int devcolstatusC=4, int prodcolmsg=5, int prodcollevelC=6, int prodcolstatusC=7
    int devcolm1=8, int devcolm2=9, int devcolm3=10, int devcolm4=11, int devcolm5=12, int devcolm6=13, int devcollevelL=14, int devcolstatusL=15
    int prodcolm1=16, int prodcolm2=17, int prodcolm3=18, int prodcolm4=19, int prodcolm5=20, int prodcolm6=21, int prodcollevelL=22, int prodcolstatusL=23

    int c=1
    var logxBus=array.new_string()
    var _filled=false

    if fillData and not _filled
        logxBus.push('')

        //zidx=1
        logxBus.push('Commencing Logx Testing')  //zidx=1
        logxBus.push('You will need to slowly go through about 450 bars 600 bars (300 each for Logx and Console) to see full suite of possibilities with this library')
        logxBus.push('Multiple tests will be conducted to show how each feature works of this library')
        logxBus.push('All tests will do one main action at each bar and some supplementary to show the best use of that test case')
        logxBus.push('Logx started with 5 rows and is filled up now')

        logxBus.push('Test 1 = Resize (add 5 rows)')      //zidx=6
        logxBus.push('@q2=● on next bar call => logx.resize(10) ▼')
        logxBus.push(o_skiplog)
        logxBus.push('@q2=More space added to queue')
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Test 1 completed ▲')  //13

        logxBus.push('Test 2 = Resize (remove 3 rows)')   //zidx=14
        logxBus.push('@q2=● on next bar call => logx.resize(7) ▼')
        logxBus.push(o_skiplog)
        logxBus.push('@q2=Space removed from the queue'+' (Frame will be removed at end of this test)')
        logxBus.push('Test 2 completed ▲')

        logxBus.push('Test 3 = set text color (to blue)')  //zidx=19
        logxBus.push('@q2=● on next bar call => logx.textColor:=color.blue ▼')
        logxBus.push('@q2=Text color is now blue')
        logxBus.push('Test 3 completed ▲')

        logxBus.push('Test 4 = set background color (to orange)')    //zidx=23
        logxBus.push('@q2=● on next bar call => logx.textColorBG:=color.orange ▼')
        logxBus.push('@q2=Background color is now orange')
        logxBus.push('Test 4 completed ▲')

        logxBus.push('Test 5 = reset background color to library default')  //zidx=27
        logxBus.push('@q2=● on next bar call => logx.resetTextColorBG() ▼')
        logxBus.push('@q2=Background color is same as chart background color')
        logxBus.push('Test 5 completed ▲')

        logxBus.push('Test 6 = reset text color to library default')    //zidx=31
        logxBus.push('@q2=● on next bar call => logx.resetTextColor() ▼')
        logxBus.push('@q2=Text color is now library default')
        logxBus.push('Test 6 completed ▲')

        logxBus.push('Test 7 = Set Status color to green')  //zidx=35
        logxBus.push('@q2=● on next bar call => logx.statusColor:=color.green ▼')
        logxBus.push('@q2=Status color is green now')
        logxBus.push('Test 7 completed ▲')

        logxBus.push('Test 8 = Set Status background color to white')   //zidx=39
        logxBus.push('@q2=● on next bar call => logx.statusColorBG:=color.white ▼')
        logxBus.push('@q2=Status background color is white now')
        logxBus.push('Test 8 completed ▲')

        logxBus.push('Test 9 = Reset Status background color to library default')   //zidx=43
        logxBus.push('@q2=● on next bar call => logx.resetStatusColorBG() ▼')
        logxBus.push('@q2=Status background color is now library default')
        logxBus.push('Test 9 completed ▲')

        logxBus.push('Test 10 = Reset Status color to library default')           //zidx=47
        logxBus.push('@q2=● on next bar call => logx.resetStatusColor() ▼')
        logxBus.push('@q2=Status color is now library default')
        logxBus.push('Test 10 completed ▲')

        logxBus.push('Test 11 = Show a frame around Logx (green colored)')         //zidx=51
        logxBus.push('@q2=● on next bar call => logx.frameColor:=color.green ▼')
        logxBus.push('@q2=A green frame around Logx is visible')
        logxBus.push('Test 11 completed ▲')

        logxBus.push('Test 12 = Remove the colored frame around Logx')            //zidx=55
        logxBus.push('@q2=● on next bar call => logx.resetFrameColor() ▼')
        logxBus.push('@q2=There is no frame around Logx anymore')
        logxBus.push('Test 12 completed ▲')

        logxBus.push('Test 13 = Color Logx as per error codes, with user supplied colors')   //zidx=59
        logxBus.push('@q2=● on next bar call => logx.setErrorColors(customFG) ▼ (fuschia/olive/maroon/navy @ 100%/65%)')
        logxBus.push('@q2=● on next bar call => logx.ColorText:=true ▼')
        c:=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Test 13 completed ▲')

        logxBus.push('Test 14 = Highlight Logx as per error codes, with user supplied colors')    //zidx=71
        logxBus.push('@q2=● on next bar call => logx.setErrorHCcolors(customHC) ▼ (fuschia/olive/maroon/navy @ 100%/65%)')
        logxBus.push('@q2=● on next bar call => logx.HighlightText:=true ▼')
        c:=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Test 14 completed ▲')

        logxBus.push('Test 15 = Color Logx as per default error codes')           //zidx=83
        logxBus.push('@q2=● on next bar call => logx.resetErrorColors() ▼')
        logxBus.push('@q2=● on next bar call => logx.ColorText:=true ▼')
        c:=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Test 15 completed ▲')

        logxBus.push('Test 16 = Highlight Logx as per default error codes')   //zidx=94
        logxBus.push('@q2=● on next bar call => logx.resetErrorHCcolors() ▼')
        logxBus.push('@q2=● on next bar call => logx.HighlightText:=true ▼')
        c:=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Test 16 completed ▲')

        logxBus.push('Test 17 = ShowColors + setColor/HC/BG + setLevelName')   //idzx=105
        logxBus.push('@q2=You can see the color of error codes on a sepatate table, to see how they look')
        logxBus.push('@q2=● on next bar call and remainder of this test call => logx.showColors(position=position.bottom_left,showColors=(idzc>=108 and idzc<=123)) ▼')
        logxBus.push('@q2=A table with colors corresponding to error codes can be see on bottom left. It shows how they look with and without highlighting, and what the log level names are.')
        logxBus.push('@q2=At the moment there are 36 error codes. Error Code 36 (in range),40,41 will be set to new colors')
        logxBus.push('@q2=Some codes are out of range, hence the color array codes will be expanded.')
        logxBus.push("@q2=Log Level names do not get expanded when color array gets expanded. ")
        logxBus.push("@q2=To auto expand Log Level names, Log Level for Code 40 will be set to 'Custom Code 40' (36 codes at moment)")
        logxBus.push("@q2=● on next bar call => logx.setLevelName(40,'Custom Code 40') ▼")
        logxBus.push('@q2=Log Level Name has been expanded, but is not visible as Color Table only goes upto max colors code, which is 36 at the moment. Wait for color expansion')
        logxBus.push('@q2=● on next bar call => logx.setColor(36,color.red) ▼')
        logxBus.push('@q2=Error Code 36 has Red Color as foreground.')
        logxBus.push('@q2=● on next bar call => logx.setColorHC(40,color.black) ▼ logx.setColor(40,color.orange) ▼')
        logxBus.push('@q2=Error Code 40 is now visible with orange foreground and black as highlight color. Background color is taken from TextColorBG')
        logxBus.push('@q2=Log Level for Code 40 is now visible as well, with custom log level name visible')
        logxBus.push('@q2=● on next bar call => logx.setColorBG(41,color.yellow) ▼')
        logxBus.push('@q2=Error Code 41 is now visible with Yellow Color as background. Foreground/Highlight has been taken from TexColor/color.white')
        logxBus.push('Color table will be deleted at end of this test')
        logxBus.push('Test 17 completed ▲')

        logxBus.push('Test 18 = Move Status to top')     //zidx=105 +19
        logxBus.push('@q2=● on next bar call => logx.StatusBarAtBottom:=false ▼')
        logxBus.push(o_skiplog)
        logxBus.push('@q2=Status has moved to the top (will be moved back to bottom at end of this test)')
        logxBus.push('Test 18 completed ▲')

        logxBus.push('Test 19 = Move Headers to bottom')        //zidx=110 +19
        logxBus.push('@q2=● on next bar call => logx.HeaderAtTop:=false ▼')
        logxBus.push( o_skiplog)
        logxBus.push('@q2=Header is now at the bottom (will be moved back to top at end of this test)')
        logxBus.push('Test 19 completed ▲')

        logxBus.push('Test 20 = Hide Headers')                        //zidx=115 +19
        logxBus.push('@q2=● on next bar call => logx.ShowHeader:=false ▼')
        logxBus.push( o_skiplog)
        logxBus.push('@q2=Header is no longer visible now')
        logxBus.push('Test 20 completed ▲')

    if fillData and not _filled
        logxBus.push('Test 21 = Change the scroll direction')     //zidx=120 +19
        logxBus.push('@q2=This can get confusing so Logx will be cleared first, status moved to top and then')
        logxBus.push('@q2=● on next bar call => logx.MoveLogUp:=false ▼')
        logxBus.push('@q2=Commencing scrolling test. messages pile on top and older messages are pushed down')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('Test 21 completed ▼') //zidx=130 +19
        logxBus.push('')
        logxBus.push('')
        logxBus.push('')
        logxBus.push('')    //zidx=134 +19

        logxBus.push('Test 22 = Show Bar Index')              //zidx=135 +19
        logxBus.push('@q2=● on next bar call => logx.ShowBarIndex:=true ▼')
        logxBus.push('@q2=Bar Index is visible now')
        logxBus.push('Test 22 completed ▲')

        logxBus.push('Test 23 = Show/Format Date/Time')       //zidx=139 +19
        logxBus.push('@q2=● on next bar call => logx.ShowDateTime:=true ▼')
        logxBus.push('@q2=Date/Time is visible now. Format will be changed next')
        logxBus.push("@q2=● on next bar call => logx.dateTimeFormat('dd.MMM.yy') ▼")
        logxBus.push('@q2=Only date is visible now')
        logxBus.push('@q2=to reset back to default format ● on next bar call => logx.dateTimeFormat() ▼')
        logxBus.push('Test 23 completed ▲')


        logxBus.push('Test 24 = Paging! Only messages from current/active bar will be kept')      //zidx=146 +19
        logxBus.push('@q2=● on next bar call => logx.PageOnEveryBar:=true ▼')                     //zidx=147 +19

        logxBus.push('Paging Test 24. Only messages from active bar will be recorded.')           //zidx=148 +19  zx=148 +19
        logxBus.push('@q2=All messages from previous bars have been cleared. When paging is on you should see this => ● in status bar')
        logxBus.push('@q2=These messages are not getting cleared as they are on the same bar (even if running on historical bars, its still on same bar).')
        c:=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Paging Test 24. This is the 2nd bar with paging setting still on ')         //zidx=149 +19   zx=154 +19
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))                    
        logxBus.push('Paging Test 24. This is the 3rd bar with paging setting still on.')         //zidx=150 +19   zx=159 +19
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('@q2=on next bar paging history will be increased by calling logx.PageHistory:=1')
        logxBus.push('Paging Test 24. This is the 4th bar with paging setting still on. we should now see 2 bars of data only (as remembering 1 page history)')      //zidx=151 +19   zx=164 +19
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Paging Test 24. This is the 5th bar with paging setting still on. we should now see 2 bars of data only (as remembering 1 page history)')      //zidx=152 +19   zx=169 +19
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Paging Test 24. This is the 6th bar with paging setting still on.')      //zidx=153 +19   zx=174 +19
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Test 24 completed ▲')                                                       //zidx=154 +19  zx=179 +19

        logxBus.push('With Paging turned off, the messages from previous bars were not erased')   //zidx=155 +19  zx=180 +19
        logxBus.push('This happaned as,from that bar Paging was turned off, it stopped clearing old messages') 

        logxBus.push('Test 25 = adhoc paging without changing the Paging config')                 //zidx=157 +19   zx=182 +19
        logxBus.push('@q2=● on next few bars call => logx.page ▼')                           
        for x=1 to 3                                                                                    //zidx=159 +19, 160 +19, 161 +19
            logxBus.push('Adhoc paging Test 25. Paging is not on as there is no ● in the status bar.')             
            logxBus.push('Adhoc paged messages will have no history from previous bars, viz it will only show messages from current bar.')             
            logxBus.push('@q2=Following messages are logged on same bar via logx.page')
            c+=1
            logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
            c+=1
            logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
            c+=1
            logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('Test 25 completed ▲')                                                     //zidx=181   zx=221



        logxBus.push('Test 26 = Show/Hide Selected Message Q')                                //zidx=182   zx=222
        logxBus.push("At the moment all 6 queues are visible. Let's hide Q2 and Q6 (with auto merge disabled)")
        logxBus.push('<This is a message for Q1>@q2=<This is a message for Q2>@q3=<This is a message for Q3>@q4=<This is a message for Q4>@q5=<This is a message for Q5>@q6=<This is a message for Q6>')
        logxBus.push('   ● on next bar call => logx.ShowQ2:=false, logx.ShowQ6:=false ▼')
        logxBus.push('Q2 and Q6 are hidden now')
        logxBus.push('Lets hide Q3 and Q5 instead and bring back Q2 and Q6')
        logxBus.push('   ● on next bar call => logx.ShowQ2:=true, logx.ShowQ6:=true ▼')
        logxBus.push('   ● on next bar call => logx.ShowQ3:=false, logx.ShowQ5:=false ▼')
        logxBus.push('Q3 and Q5 are hidden now')
        logxBus.push('Test 26 completed ▲')
        

        
        logxBus.push('Test 27 = Automerge')                   //zidx=192   zx=232
        logxBus.push('Automerge has been on since start of the testing')
        logxBus.push('Automerge has been disabled during previous test and the effect should be visible now, with the messages from different queues separating')
        logxBus.push('all it does is merge the cell queues towards the right. (if right side queues are empty all becomes one big cell)')
        logxBus.push('(if only Q3 empty Q2/Q3 become one big cell, excluding Q1)')
        logxBus.push('@q2=Clearing the queues should make the effect more prominent')
        logxBus.push('<This is a longer message for Q1, to make it spill over into Q2>')
        logxBus.push('@q2=<This is a message for Q2, does it create the indent effect due to automerge?>')
        logxBus.push('@q3=<This is a message for Q3>')
        logxBus.push('Test 27 completed ▲')
        
        logxBus.push('Test 28 = Auto Indent')             //zidx=202   zx=242
        logxBus.push('@q2=● on next bar call => logx.tabSizeQ1:=1, logx.tabSizeQ2:=2, logx.tabSizeQ3:=3 ▼')
        c:=1
        for x=1 to 7                                        //zidx=204 to 210
            logxBus.push('Level '+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+'@q2=Message for Q2@q3=Message for Q3')
            c+=1
        logxBus.push('Auto Indenting works on error codes 1 to 7 only. To disable auto indenting set respective tabsize to 0')
        logxBus.push('Test 28 completed ▲')               //zidx=212   zx=252

        logxBus.push('Test 29 = Update / Hide Status Meta Info / Hide Status')     //zidx=213   zx=253
        logxBus.push('Test 29a = Update Status')
        logxBus.push('@q2=Status Bar has Test Number at the moment, this will be replaced with a custom status message')
        logxBus.push('@q2=● on next bar call => logx.Status:="Look we have a status message now, that will persist across updates" ▼')
        logxBus.push('@q2=Not all of the status message may get updated, as table may expand as per length of logged message.')
        logxBus.push('@q2=Some part of the status is also taken by bar number and other message, hence not full status will be used')
        logxBus.push('@q2=Reset the status using logx.Status property')
        logxBus.push('Test 29b = Hide Status Meta Info')
        logxBus.push('@q2=Notice lower left corner has current bar info (as well as paging status if set)')
        logxBus.push('@q2=● on next bar call => logx.ShowMetaStatus:=false ▼')
        logxBus.push('@q2=Meta info no longer visible in status bar and full bar is available for custom status messages')
        logxBus.push('Test 29b = Hide Status')
        logxBus.push('@q2=● on next bar call => logx.ShowStatusBar:=false ▼')
        logxBus.push('@q2=Status bar is hidden now')
        logxBus.push('Test 29 completed ▲')

        logxBus.push('Test 30 = Mark New Bars')        //idzx=228     zx=268
        logxBus.push('@q2=This option adds a marker at start of each new bar')
        logxBus.push('@q2=● on next bar call => logx.MarkNewBar:=true ▼')
        for x=1 to 12                                       //idzc=231, 232, 233
            logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
            c+=1
        logxBus.push('Test 30 completed ▲')

        logxBus.push('Test 31 = Change mininum Logx width')     //idzx=235  zx=275
        logxBus.push('@q2=Current minimum Logx width is 80. We will be increasing this to 200 minimum')
        logxBus.push('@q2=● on next bar call => logx.MinWidth:=200 ▼')
        logxBus.push('@q2=Logx Width is now changed to atlest 200 characters wide')
        logxBus.push('@q2=Reset back to 80 at end of this test')
        logxBus.push('Test 31 completed ▲')

        logxBus.push('Test 32 = Show Error Code/Debug Level Q')               //zidx=241   zx=262
        logxBus.push('@q2=Some messages with 10 log levels will be shown')
        logxBus.push('@q2=● on next bar call => logx.ShowLogLevels:=true ▼')
        c:=1
        logxBus.push('@q2=Sample TRACE message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample DEBUG message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample INFO message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample WARNING message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample ERROR message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample CRITICAL message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample FATAL message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('To only see Log Levels for key 7 levels (INFO to Critical), then @q2=● call => logx.RestrictToKey7:=true ▼')             //zidx=245   zx=275 +19
        logxBus.push('If you wish to track error codes, then @q2=● on next bar call => logx.ReplaceWithErrorCodes:=true ▼')
        c:=1
        logxBus.push('@q2=Sample TRACE message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample DEBUG message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample INFO message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample WARNING message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample ERROR message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample CRITICAL message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample FATAL message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26))
        logxBus.push('To not see Log Levels or Error Codes, ● on next bar call => logx.showLogLevels:=false')    
        logxBus.push('Test 32 completed ▲')                   //zidx=249  zx=307

        logxBus.push('Test 33 = Convert Logx to Console')               //zidx=250   zx=308
        logxBus.push('@q2=Now Logx will be converted into a console. There is no need to create a new variable')
        c:=0
        for x=1 to 3                       //zidx=252 to 254
            c+=1
            tm='<Q1 message = '+alphabetc.get((c-1)%26)+'>'
            for y=2 to 6
                c+=1
                tm+='@q'+str.tostring(y)+'=<Q'+str.tostring(y)+' message = '+alphabetc.get((c-1)%26)+'>'
            logxBus.push(tm)
        logxBus.push('@q2=● on next bar call => logx.IsConsole:=true ▼')
        logxBus.push('Look this is a console now')
        logxBus.push('@q2=Converting to a console will make you lose data in Q6,')
        logxBus.push('@q2=while the data in Q2-5 will not be shown')
        logxBus.push('@q2=However when you convert console back to Logx, Q1-5 data will still be available.')
        logxBus.push('@q2=Now lets convert this Console back to Logx')
        logxBus.push('@q2=● on next bar call => logx.IsConsole:=false ▼')
        logxBus.push('Test 33 completed ▲')                   //zidx=262  zx=320

        logxBus.push('Test 34 = Turning a page')     //idzx=263 zx=321
        logxBus.push('@q2=All messages are logged on a "page", which could be turned at any point of time.')
        logxBus.push('@q2=This is different from console.page which will flush all messages from previous bars')
        logxBus.push('@q2=This is also different from PageOnEveryBar which will flush all messages from previous bars, based on Page History')
        logxBus.push('@q2=turnPage will clear all older messages at the point turnPage is called, and is independent from above')
        c:=1
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))
        c+=1
        logxBus.push('@q2=Error Code used = '+str.tostring(c)+'@q3=   Sample message = '+alphabetc.get((c-1)%26))

        logxBus.push('@q2=● on next bar call => logx.turnPage() ▼')
        logxBus.push('@q2=All older messages have been cleared and we are on a new page (not dependent on PageOnEveryBar or console.page)')
        logxBus.push('@q2=So, effectively, there are 3 ways to page messages')
        logxBus.push('Test 34 completed ▲')

        logxBus.push('Test 35 = Asynchronous Logging')     //zidx=275  zx=343
        logxBus.push('@q2=Another way to log messages is to log them to each queue individually')
        logxBus.push('@q2=This may be needed when you need to log messages at different times')
        logxBus.push('@q2=Logging four sample messages to Q1 at one go, using logx.alog(0,msg,1). These will be followed by logging to Q2 and Q3 separately, using logx.alog(0,msg,2) and logx.alog(0,msg,3) ')
        c:=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')        //zidx=279     zx=347
        c+=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    //zidx=280     zx=352
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q3=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    //zidx=287     zx=359
        c+=1
        logxBus.push('@q3=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q3=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q3=Sample message = '+alphabetc.get((c-1)%26)+' ▼') 
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')  //zidx=291     zx=363  
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        logxBus.push('@q2=As soon as normal log method is used all queues are logged in sync')
        logxBus.push('Test 35 completed ▲')     //zidx=298+3     zx=370

        logxBus.push('Test 36 = Show Specific Log Level messages/Independent Coloring')    //idzx=299+3   zc=
        logxBus.push('Logging some sample messages with the Log Level 0 to 7')
        c:=1
        logxBus.push(tab4+'Level 0'+tab4+'No Level'+tab4+' Sample message = '+alphabetc.get((c-1)%26)+' ◁'+tab2)
        c+=1
        logxBus.push(tab4+'Level 1'+tab4+'TRACE'+tab4+' Sample message = '+alphabetc.get((c-1)%26)+' ◁'+tab2)
        c+=1
        logxBus.push(tab4+'Level 2'+tab4+'DEBUG'+tab4+' Sample message = '+alphabetc.get((c-1)%26)+' ◁'+tab2)
        c+=1
        logxBus.push(tab4+'Level 3'+tab4+'INFO'+tab4+' Sample message = '+alphabetc.get((c-1)%26)+' ◁'+tab2)
        c+=1
        logxBus.push(tab4+'Level 4'+tab4+'WARNING'+tab4+' Sample message = '+alphabetc.get((c-1)%26)+' ◁'+tab2)
        c+=1
        logxBus.push(tab4+'Level 5'+tab4+'ERROR'+tab4+' Sample message = '+alphabetc.get((c-1)%26)+' ◁'+tab2)
        c+=1
        logxBus.push(tab4+'Level 6'+tab4+'CRITICAL'+tab4+' Sample message = '+alphabetc.get((c-1)%26)+' ◁'+tab2)
        c+=1
        logxBus.push(tab4+'Level 7'+tab4+'FATAL'+tab4+' Sample message = '+alphabetc.get((c-1)%26)+' ◁'+tab2)
        logxBus.push('Setting sit.ShowMinimumLvel := 3 to display INFO or higher messages')
        logxBus.push('Setting sit.ShowMinimumLvel := 4 to display WARNING or higher messages')
        logxBus.push('Test 36 completed ▲')      //idzc=307   zx=

        logxBus.push('Test 37 = Undo logged messages')    //idzx=308   zx=
        logxBus.push('@q2=Pushing some sample messages')
        logxBus.push('@q2=First message #15 will be removed, followed by removal of  #14, #13, #12 and finally all sample messages')
        c:=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=#'+str.tostring(c)+' Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        logxBus.push('@q2=All messages were removed')
        logxBus.push('@q2=Undo will remove messages logged via logx.log and stop as soon as it finds asynchronously logged messages')
        logxBus.push('Test 37 completed ▲')      //idzx=317   zx=

        logxBus.push('Test 38 = Undo asynchronously logged messages')    //idzx=318   zx=
        logxBus.push('@q2=Pushing some sample messages')
        logxBus.push('@q2=First messages from Q1 will be removed, followed by removal of Q2, while Q3 will be left alone.')
        c:=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')        //idzx=321    zx=
        c+=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    //idzx=321    zx=
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    
        c+=1
        logxBus.push('@q3=Sample message = '+alphabetc.get((c-1)%26)+' ▼')    //idzx=321    zx=
        c+=1
        logxBus.push('@q3=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q3=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q3=Sample message = '+alphabetc.get((c-1)%26)+' ▼') 
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')   
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        c+=1
        logxBus.push('@q2=Sample message = '+alphabetc.get((c-1)%26)+' ▼')
        logxBus.push('@q2=All messages from Q1 and Q2 were removed')    //idzx=325
        logxBus.push('Test 38 completed ▲')      //idzx=326   zx=

        logxBus.push('All Logx Tests completed')              //idzx=327  zx=
        // _________________________________________________________________________Logx Testing ends on zidx=299

    if fillData and not _filled
        //______ == ______________________________ Attachment Testing starts on za=1
        logxBus.push('Attachment Test 1 = Attaching a Console to Logx')                 //idza=1
        logxBus.push('While a lLogx can be converted into Console and vice versa, sometimes there may be a need to see both')
        logxBus.push('In this test a new and separate Console will be created and attached to this Logx')
        logxBus.push('Console is created. Now lets attach it')
        logxBus.push('@q2=● on next bar call => logx.attachConsole(console) ▼')      
        logxBus.push('@q2=Console attached !')                 //idza=6
        logxBus.push(o_skiplog)
        logxBus.push(o_skiplog)
        logxBus.push(o_skiplog)
        logxBus.push(o_skiplog)
        logxBus.push('Console will be moved around Logx (Left, Top, and Right)')
        logxBus.push('@q2=● on next bar call => logx.moveConsole(console,"left") ▼')                                          //idza=12
        logxBus.push('Console is now on left of Logx')
        logxBus.push("Let's move Console's Status Bar to the top, while it is attached on the left .@q2=● on next bar call => console.StatusBarAtBottom:=false")
        logxBus.push('Moving Console to top of Logx @q2=● on next bar call => logx.moveConsole(console,"top") ▼')             //idza=15
        logxBus.push('Console is now on top of Logx')
        logxBus.push('Console Status Bar will be kept at the top for now')
        logxBus.push('Moving Console to the right of Logx @q2=● on next bar call => logx.moveConsole(console,"right") ▼')   //idza=18
        logxBus.push('Console is now at right of Logx')
        logxBus.push("Let's move Status Bar of both Logx and Console to top")
        logxBus.push('@q2=● on next bar call => logx.StatusBarAtBottom:=false ▼')                                             //idza=21
        logxBus.push('Moving Console to default location, viz "anywhere" of Logx @q2=● on next bar call => logx.moveConsole(console,"anywhere") ▼')   //idza=22
        logxBus.push('Console is now at bottom of Logx (default is bottom, if location specified is not one of these -> top, right, bottom, left)')
        logxBus.push('Console will now be detached')
        logxBus.push('@q2=● on next bar call => logx.detachConsole(console) ▼')                                               //idza=25
        logxBus.push('Console detached')
        logxBus.push('Attachment Test 1 completed ▲')
        logxBus.push('Attachment testing is completed now !!')           //za=28
        //______ xx ______________________________ Attachment Testing ends on za=28


        for zx=0 to logxBus.size()-1
            gl:=logxBus.get(zx)
            dbus.set(zx,1,gl)

            q2pos=str.pos(gl,'@q2=')
            q3pos=str.pos(gl,'@q3=')
            q4pos=str.pos(gl,'@q4=')
            q5pos=str.pos(gl,'@q5=')
            q6pos=str.pos(gl,'@q6=')
            end=str.length(gl)
            gm1:= str.substring(gl,0,na(q2pos)?na(q3pos)?na(q4pos)?na(q5pos)?na(q6pos)?end:q6pos:q5pos:q4pos:q3pos:q2pos)
            gm2:= na(q2pos) ? '' : str.substring(gl,q2pos+4,na(q3pos)?na(q4pos)?na(q5pos)?na(q6pos)?end:q6pos:q5pos:q4pos:q3pos)
            gm3:= na(q3pos) ? '' : str.substring(gl,q3pos+4,na(q4pos)?na(q5pos)?na(q6pos)?end:q6pos:q5pos:q4pos)
            gm4:= na(q4pos) ? '' : str.substring(gl,q4pos+4,na(q5pos)?na(q6pos)?end:q6pos:q5pos)
            gm5:= na(q5pos) ? '' : str.substring(gl,q5pos+4,na(q6pos)?end:q6pos)
            gm6:= na(q6pos) ? '' : str.substring(gl,q6pos+4,end)

            if (zx>=323 and zx<=327)
                gm:=gm1+(gm2==''?'':(tab4+gm2))+(gm3==''?'':(tab4+gm3))+(gm4==''?'':(tab4+gm4))+(gm5==''?'':(tab4+gm5))+(gm6==''?'':(tab4+gm6))
                dbus.set(zx, devcolmsg, str.replace_all(gm,'logx.','sit.'))
                dbus.set(zx, prodcolmsg, str.replace_all(gm,'logx.','demo.'))
                dbus.set(zx, devcollevelC,'zx='+ str.tostring(zx))
                dbus.set(zx, prodcollevelC,'zx='+ str.tostring(zx))
            dbus.set(zx, devcolm1, str.replace_all(gm1,'logx.','sit.'))
            dbus.set(zx, devcolm2, str.replace_all(gm2,'logx.','sit.'))
            dbus.set(zx, devcolm3, str.replace_all(gm3,'logx.','sit.'))
            dbus.set(zx, devcolm4, str.replace_all(gm4,'logx.','sit.'))
            dbus.set(zx, devcolm5, str.replace_all(gm5,'logx.','sit.'))
            dbus.set(zx, devcolm6, str.replace_all(gm6,'logx.','sit.'))
            dbus.set(zx, prodcolm1, str.replace_all(gm1,'logx.','demo.'))
            dbus.set(zx, prodcolm2, str.replace_all(gm2,'logx.','demo.'))
            dbus.set(zx, prodcolm3, str.replace_all(gm3,'logx.','demo.'))
            dbus.set(zx, prodcolm4, str.replace_all(gm4,'logx.','demo.'))
            dbus.set(zx, prodcolm5, str.replace_all(gm5,'logx.','demo.'))
            dbus.set(zx, prodcolm6, str.replace_all(gm6,'logx.','demo.'))

            if str.contains(gl,'Test') and str.contains(gl,'=') and not str.contains(gl,'@q')
                gs:=gl
            if str.contains(gl,'Test') and str.contains(gl,'completed')
                gs:=''
            dbus.set(zx, devcolstatusL, '<SIT zx = ' + str.tostring(zx)+' ▶ '+gs+'>')
            dbus.set(zx, prodcolstatusL, gs)
            dbus.set(zx, devcollevelL,'zx='+ str.tostring(zx))
            dbus.set(zx, prodcollevelL,'zx='+ str.tostring(zx))


        for x=logxBus.size() to dbus.rows()-1
            dbus.set(x, devcolm1,'Logx testing has been completed #'+str.tostring(x))
            dbus.set(x, prodcolm1,'Logx testing has been completed #'+str.tostring(x))

        _filled:=true
        
    logxBus.clear()

//	td5	dev.111