first batch of updated scripts to use sendMIX commands instead.

This commit is contained in:
iceman1001
2019-04-28 18:46:06 +02:00
parent 195887487b
commit 819896acf6
7 changed files with 223 additions and 194 deletions

View File

@@ -4,11 +4,9 @@ local bin = require('bin')
local utils = require('utils')
local dumplib = require('html_dumplib')
example =[[
1. script run tracetest
]]
author = "Iceman"
usage = "script run tracetest"
copyright = ''
author = 'Iceman'
version = 'v1.0.1'
desc =[[
This script will load several traces files in ../traces/ folder and do
"data load"
@@ -17,45 +15,52 @@ This script will load several traces files in ../traces/ folder and do
The following tracefiles will be loaded:
em*.pm3
m*.pm3
]]
example =[[
script run tracetest
]]
usage = [[
script run tracetest -h
Arguments:
-h : this help
]]
local TIMEOUT = 2000 -- Shouldn't take longer than 2 seconds
local DEBUG = true -- the debug flag
---
-- A debug printout-function
function dbg(args)
if not DEBUG then
return
end
if type(args) == "table" then
local function dbg(args)
if not DEBUG then return end
if type(args) == 'table' then
local i = 1
while result[i] do
dbg(result[i])
i = i+1
end
else
print("###", args)
print('###', args)
end
end
---
-- This is only meant to be used when errors occur
function oops(err)
print("ERROR: ",err)
local function oops(err)
print('ERROR:', err)
core.clearCommandBuffer()
return nil, err
end
---
-- Usage help
function help()
local function help()
print(copyright)
print(author)
print(version)
print(desc)
print("Example usage")
print('Example usage')
print(example)
print(usage)
end
--
-- Exit message
function ExitMsg(msg)
local function ExitMsg(msg)
print( string.rep('--',20) )
print( string.rep('--',20) )
print(msg)
@@ -73,11 +78,11 @@ local function main(args)
local tracesMOD = "find '../traces/' -iname 'm*.pm3' -type f"
local write2File = false
local outputTemplate = os.date("testtest_%Y-%m-%d_%H%M%S")
local outputTemplate = os.date('testtest_%Y-%m-%d_%H%M%S')
-- Arguments for the script
for o, arg in getopt.getopt(args, 'h') do
if o == "h" then return help() end
if o == 'h' then return help() end
end
core.clearCommandBuffer()
@@ -98,13 +103,13 @@ local function main(args)
end
p.close();
local cmdLFSEARCH = "lf search 1 u"
local cmdLFSEARCH = 'lf search 1 u'
-- main loop
io.write('Starting to test traces > ')
for _,file in pairs(files) do
local x = "data load "..file
local x = 'data load '..file
dbg(x)
core.console(x)
@@ -114,7 +119,7 @@ local function main(args)
core.clearCommandBuffer()
if core.ukbhit() then
print("aborted by user")
print('aborted by user')
break
end
end