Commit 4102d1f0 by devttys0

block value only affects heuristic blocks when -H is specified

parent 11a020c1
......@@ -17,6 +17,8 @@ class Entropy(Module):
COLORS = ['r', 'g', 'c', 'b', 'm']
DEFAULT_BLOCK_SIZE = 1024
TITLE = "Entropy"
ORDER = 8
......@@ -45,7 +47,7 @@ class Entropy(Module):
Kwarg(name='display_results', default=True),
Kwarg(name='do_plot', default=True),
Kwarg(name='show_legend', default=True),
Kwarg(name='block_size', default=1024),
Kwarg(name='block_size', default=0),
]
# Run this module last so that it can process all other module's results and overlay them on the entropy graph
......@@ -75,8 +77,11 @@ class Entropy(Module):
if self.file_markers:
self.display_results = False
if self.config.block:
self.block_size = self.config.block
if not self.block_size:
if self.config.block:
self.block_size = self.config.block
else:
self.block_size = self.DEFAULT_BLOCK_SIZE
def run(self):
from pyqtgraph.Qt import QtGui
......
......@@ -83,6 +83,7 @@ class HeuristicCompressionAnalyzer(Module):
ENTROPY_TRIGGER = .90
MIN_BLOCK_SIZE = 4096
BLOCK_OFFSET = 1024
ENTROPY_BLOCK_SIZE = 1024
TITLE = "Heuristic Compression"
......@@ -91,7 +92,7 @@ class HeuristicCompressionAnalyzer(Module):
attribute='config'),
Dependency(name='Entropy',
attribute='entropy',
kwargs={'enabled' : True, 'do_plot' : False, 'display_results' : False}),
kwargs={'enabled' : True, 'do_plot' : False, 'display_results' : False, 'block_size' : ENTROPY_BLOCK_SIZE}),
]
{'config' : 'Configuration', 'entropy' : 'Entropy'}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment