Removing INFO LOG and fixing BUG when scaling

This commit is contained in:
Luis Fernando Molina committed 2019-04-28 08:16:33 +02:00
1 parent cdf44c135a
commit 7a1032c51f
2 files changed
-85

No files matched your search

-52
View File
@@ -1,7 +1,6 @@
function newAAMastersPlottersCandlesVolumesCandles() {
const MODULE_NAME = "Candles Plotter";
const INFO_LOG = false;
const ERROR_LOG = true;
const INTENSIVE_LOG = false;
const logger = newWebDebugLog();
@@ -61,8 +60,6 @@
function finalize() {
try {
if (INFO_LOG === true) { logger.write("[INFO] finalize -> Entering function."); }
/* Stop listening to the necesary events. */
viewPort.eventHandler.stopListening(zoomChangedEventSubscriptionId);
@@ -92,8 +89,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] initialize -> Entering function."); }
/* Store the information received. */
marketFiles = pStorage.marketFiles[0];
@@ -141,8 +136,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] getContainer -> Entering function."); }
let container;
/* First we check if this point is inside this space. */
@@ -168,8 +161,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onFilesUpdated -> Entering function."); }
let newMarketFile = marketFiles.getFile(timePeriod);
if (newMarketFile !== undefined) {
@@ -188,8 +179,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] setTimePeriod -> Entering function."); }
if (timePeriod !== pTimePeriod) {
timePeriod = pTimePeriod;
@@ -224,8 +213,6 @@
function setDatetime(pDatetime) {
if (INFO_LOG === true) { logger.write("[INFO] setDatetime -> Entering function."); }
datetime = pDatetime;
}
@@ -234,8 +221,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] positionAtDatetime -> Entering function."); }
value = newDatetime.valueOf();
/* Now we calculate which candle has this new time, because it will give us the y coordinate. */
@@ -337,8 +322,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onDailyFileLoaded -> Entering function."); }
if (event.currentValue === event.totalValue) {
/* This happens only when all of the files in the cursor have been loaded. */
@@ -373,8 +356,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] recalculate -> Entering function."); }
if (timePeriod >= _1_HOUR_IN_MILISECONDS) {
recalculateUsingMarketFiles();
@@ -397,8 +378,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] recalculateUsingDailyFiles -> Entering function."); }
if (fileCursor === undefined) { return; } // We need to wait
if (fileCursor.files.size === 0) { return; } // We need to wait until there are files in the cursor
@@ -495,8 +474,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] recalculateUsingMarketFiles -> Entering function."); }
if (marketFile === undefined) { return; } // Initialization not complete yet.
let daysOnSides = getSideDays(timePeriod);
@@ -561,10 +538,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] recalculateScale -> Entering function."); }
if (marketFile === undefined) { return; } // We need the market file to be loaded to make the calculation.
if (timeLineCoordinateSystem.maxValue > 0) { return; } // Already calculated.
let minValue = {
@@ -585,25 +558,6 @@
thisObject.container.frame.height
);
function getMaxRate() {
if (INFO_LOG === true) { logger.write("[INFO] recalculateScale -> getMaxRate -> Entering function."); }
let maxValue = 0;
for (let i = 0; i < marketFile.length; i++) {
let currentMax = marketFile[i][1]; // 1 = rates.
if (maxValue < currentMax) {
maxValue = currentMax;
}
}
return maxValue;
}
} catch (err) {
if (ERROR_LOG === true) { logger.write("[ERROR] recalculateScale -> err = " + err.stack); }
@@ -781,8 +735,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onZoomChanged -> Entering function."); }
recalculate();
} catch (err) {
@@ -795,8 +747,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onOffsetChanged -> Entering function."); }
if (Math.random() * 100 > 95) {
recalculate()
@@ -812,8 +762,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onDragFinished -> Entering function."); }
recalculate();
} catch (err) {
-33
View File
@@ -1,7 +1,6 @@
function newAAMastersPlottersCandlesVolumesVolumes() {
const MODULE_NAME = "Volumes Plotter";
const INFO_LOG = false;
const ERROR_LOG = true;
const INTENSIVE_LOG = false;
const logger = newWebDebugLog();
@@ -59,8 +58,6 @@
function finalize() {
try {
if (INFO_LOG === true) { logger.write("[INFO] finalize -> Entering function."); }
/* Stop listening to the necesary events. */
viewPort.eventHandler.stopListening(zoomChangedEventSubscriptionId);
@@ -90,8 +87,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] initialize -> Entering function."); }
/* Store the information received. */
marketFiles = pStorage.marketFiles[0];
@@ -148,8 +143,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] getContainer -> Entering function."); }
let container;
/* First we check if this point is inside this space. */
@@ -175,8 +168,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onFilesUpdated -> Entering function."); }
let newMarketFile = marketFiles.getFile(timePeriod);
if (newMarketFile !== undefined) {
@@ -199,8 +190,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] setTimePeriod -> Entering function."); }
if (timePeriod !== pTimePeriod) {
timePeriod = pTimePeriod;
@@ -235,8 +224,6 @@
function setDatetime(pDatetime) {
if (INFO_LOG === true) { logger.write("[INFO] setDatetime -> Entering function."); }
datetime = pDatetime;
}
@@ -245,8 +232,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onDailyFileLoaded -> Entering function."); }
if (event.currentValue === event.totalValue) {
/* This happens only when all of the files in the cursor have been loaded. */
@@ -283,8 +268,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] recalculate -> Entering function."); }
if (timePeriod >= _1_HOUR_IN_MILISECONDS) {
recalculateUsingMarketFiles();
@@ -307,8 +290,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] recalculateUsingDailyFiles -> Entering function."); }
if (fileCursor === undefined) { return; } // We need to wait
if (fileCursor.files.size === 0) { return; } // We need to wait until there are files in the cursor
@@ -392,8 +373,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] recalculateUsingMarketFiles -> Entering function."); }
if (marketFile === undefined) { return; } // Initialization not complete yet.
let leftDate = getDateFromPoint(viewPort.visibleArea.topLeft, thisObject.container, timeLineCoordinateSystem);
@@ -445,8 +424,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] recalculateScaleX -> Entering function."); }
var minValue = {
x: MIN_PLOTABLE_DATE.valueOf()
};
@@ -477,8 +454,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] recalculateScaleY -> Entering function."); }
var minValue = {
y: 0
};
@@ -505,8 +480,6 @@
function getMaxVolume() {
if (INFO_LOG === true) { logger.write("[INFO] initialize -> Entering function."); }
let maxValue = 0;
for (var i = 0; i < scaleFile.length; i++) {
@@ -813,8 +786,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onZoomChanged -> Entering function."); }
recalculateScaleX();
recalculate();
recalculateScaleY();
@@ -829,8 +800,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onOffsetChanged -> Entering function."); }
if (Math.random() * 100 > 95) {
recalculateScaleX();
@@ -849,8 +818,6 @@
try {
if (INFO_LOG === true) { logger.write("[INFO] onDragFinished -> Entering function."); }
recalculateScaleX();
recalculate();
recalculateScaleY();