diff --git a/SuperScriptViewer/DecoratorCore.py b/SuperScriptViewer/DecoratorCore.py index b70b9f5..93afee2 100644 --- a/SuperScriptViewer/DecoratorCore.py +++ b/SuperScriptViewer/DecoratorCore.py @@ -33,7 +33,7 @@ def initDecorateDb(db): cur.execute("CREATE TABLE graph([graph] INTEGER, [graph_name] TEXT, [width] INTEGER, [height] INTEGER, [index] INTEGER, [belong_to] TEXT);") cur.execute("CREATE TABLE info([target] INTEGER, [field] TEXT, [data] TEXT);") - cur.execute("CREATE TABLE block([belong_to_graph] INETGER, [thisobj] INTEGER, [name] TEXT, [assist_text] TEXT, [pin-pin] TEXT, [pin-pout] TEXT, [pin-bin] TEXT, [pin-bout] TEXT, [x] REAL, [y] REAL, [width] REAL, [height] REAL, [expandable] INTEGER);") + cur.execute("CREATE TABLE block([belong_to_graph] INETGER, [thisobj] INTEGER, [name] TEXT, [assist_text] TEXT, [pin-ptarget] TEXT, [pin-pin] TEXT, [pin-pout] TEXT, [pin-bin] TEXT, [pin-bout] TEXT, [x] REAL, [y] REAL, [width] REAL, [height] REAL, [expandable] INTEGER);") cur.execute("CREATE TABLE cell([belong_to_graph] INETGER, [thisobj] INTEGER, [name] TEXT, [assist_text] TEXT, [x] REAL, [y] REAL, [type] INTEGER);") cur.execute("CREATE TABLE link([belong_to_graph] INETGER, [thisobj] INTEGER, [delay] INTEGER, [startobj] INTEGER, [endobj] INTEGER, [start_index] INTEGER, [end_index] INTEGER, [x1] REAL, [y1] REAL, [x2] REAL, [y2] REAL);") @@ -141,7 +141,7 @@ def buildBlock(exDb, deDb, target, currentGraphBlockCell): layer_height[curLayer] = max(layer_height.get(curLayer, 0), bbResult[i].height) layer_height[arrangedLayer] = layer_height.get(arrangedLayer, 0) # make sure misc bb height exist for i in occupiedLayerCountForSpecificBB.keys(): # add oper occipation - layer_height[i] += occupiedLayerCountForSpecificBB[i] * dcv.GRAPH_SPAN_BB_POPER + layer_height[i] += (occupiedLayerCountForSpecificBB[i] + 1) * dcv.GRAPH_SPAN_BB_POPER # calc bb Y baseY = dcv.GRAPH_CONTENTOFFSET_Y @@ -190,7 +190,7 @@ def buildBlock(exDb, deDb, target, currentGraphBlockCell): exCur.execute("SELECT [thisobj], [name], [type] FROM pTarget WHERE [belong_to] == ?;", (i,)) temp = exCur.fetchone() if temp == None: - cache.ptargetData = '' + cache.ptargetData = '{}' else: cache.ptargetData = json.dumps(dcv.PinInformation(temp[0], temp[1], temp[2]), cls = dcv.JsonCustomEncoder) @@ -244,12 +244,12 @@ def buildBlock(exDb, deDb, target, currentGraphBlockCell): for i in bbResult.keys(): cache = bbResult[i] currentGraphBlockCell[i] = dcv.BlockCellItem(cache.x, cache.y, cache.width, cache.height) - deCur.execute('INSERT INTO block VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', - (target, i, cache.name, cache.assistName, cache.pinData, cache.poutData, cache.binData, cache.boutData, cache.x, cache.y, cache.width, cache.height, cache.expandable)) + deCur.execute('INSERT INTO block VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + (target, i, cache.name, cache.assistName, cache.ptargetData, cache.pinData, cache.poutData, cache.binData, cache.boutData, cache.x, cache.y, cache.width, cache.height, cache.expandable)) for i in operResult.keys(): cache = operResult[i] currentGraphBlockCell[i] = dcv.BlockCellItem(cache.x, cache.y, cache.width, cache.height) - deCur.execute("INSERT INTO block VALUES (?, ?, ?, '', ?, ?, '[]', '[]', ?, ?, ?, ?, -1)", + deCur.execute("INSERT INTO block VALUES (?, ?, ?, '', '{}', ?, ?, '[]', '[]', ?, ?, ?, ?, -1)", (target, i, cache.name, cache.pinData, cache.poutData, cache.x, cache.y, cache.width, cache.height)) def recursiveBuildBBTree(node, exCur, processedBB, layer, depth, graphId): diff --git a/SuperScriptViewer/ServerCore.py b/SuperScriptViewer/ServerCore.py index 4742f98..ec0fe72 100644 --- a/SuperScriptViewer/ServerCore.py +++ b/SuperScriptViewer/ServerCore.py @@ -24,9 +24,14 @@ def close_connection(exception): db.close() @app.template_global(name = 'pinDecoder') -def block_pin_filter(target): +def block_pin_decoder(target): return json.loads(target) +@app.template_global(name = 'pinDecoder2') +def block_pin_decoder2(target): + vab = json.loads(target) + return [vab['name'], vab['type']] + @app.route('/', methods=['GET']) def indexHandle(): cur = get_db().cursor() diff --git a/SuperScriptViewer/static/site.css b/SuperScriptViewer/static/site.css index b209aac..b65dad3 100644 --- a/SuperScriptViewer/static/site.css +++ b/SuperScriptViewer/static/site.css @@ -3,6 +3,11 @@ p.hamburger { padding: 0; } +div.block-target { + position: absolute; + background: green; +} + div.block-b { position: absolute; background: yellow; @@ -34,7 +39,7 @@ p.block-asstext { margin: 0; padding: 0; font-size: 9px; - color: white + color: white; } div.block-body { @@ -45,7 +50,7 @@ div.block-body { div.cell-ptarget { position: absolute; - background: green + background: green; border: 1px solid #cfcfcf; } @@ -57,18 +62,18 @@ div.cell-plocal { div.cell-shortcut { position: absolute; - background: purple + background: purple; border: 1px solid #cfcfcf; } div.cell-pio { position: absolute; - background: blue + background: blue; border: 1px solid #cfcfcf; } div.cell-bio { position: absolute; - background: yellow + background: yellow; border: 1px solid #cfcfcf; } \ No newline at end of file diff --git a/SuperScriptViewer/templates/viewer.html b/SuperScriptViewer/templates/viewer.html index b9338d3..abb7cb3 100644 --- a/SuperScriptViewer/templates/viewer.html +++ b/SuperScriptViewer/templates/viewer.html @@ -37,22 +37,25 @@ {# blocks content #} {% for i in blocks %} -
{{ i[2]|e }}
{% endif %} @@ -62,9 +65,9 @@ {# cells content #} {% for i in cells %} - + {% endfor %}