SWDEV-477001: Fixing line offset and copy command for webui

Change-Id: I830bc7afd552e314f931514e938ba2214a765e63
This commit is contained in:
Giovanni LB
2024-08-01 00:32:22 -03:00
parent 0b21b2dd7d
commit 7edee28288
2 changed files with 8 additions and 7 deletions
+7 -6
View File
@@ -21,10 +21,11 @@ from http import HTTPStatus
from io import BytesIO
from drawing import Readable, GeneratePIC
from copy import deepcopy
from shutil import copy2
from glob import glob
JSON_GLOBAL_DICTIONARY = {}
def get_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.settimeout(0)
@@ -259,11 +260,11 @@ def view_trace(
os.makedirs(trace_instance_name + "_ui/", exist_ok=True)
JSON_GLOBAL_DICTIONARY["live.json"] = Readable({"live": 0})
os.system(
"cp "
+ os.path.join(os.path.abspath(os.path.dirname(__file__)), "ui")
+ "/* " + trace_instance_name + "_ui/"
)
ui_dir_files = glob(os.path.join(os.path.abspath(os.path.dirname(__file__)), "ui")+"/*")
for f in ui_dir_files:
copy2(f, trace_instance_name + "_ui/")
for k, v in JSON_GLOBAL_DICTIONARY.items():
with open(os.path.join(trace_instance_name+"_ui", k), "w" if ".json" in k else "wb") as f:
f.write(v.read())
+1 -1
View File
@@ -460,7 +460,7 @@
let L2FirstToken = {}
let L2InstTime = {}
insts.forEach((ins, i) => {
const line_num = ins[4]
const line_num = ins[4]-1
if (!(line_num in L2FirstToken)) {
L2FirstToken[line_num] = ins[0]
}