Re-structure LTTng sub-project as per the Linux Tools guidelines
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / controlflow / evProcessor / AbsFlowTRangeUpdate.java
index 2c541d4b9e94287fa5ef1c06a141b94536359404..3e920c97cf1c723086c1f6b6925368e21b47fc05 100644 (file)
@@ -6,16 +6,19 @@
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  * 
- * Contributors: Alvaro Sanchez-Leon - Initial implementation
+ * Contributors:
+ *   Alvaro Sanchez-Leon - Initial implementation
+ *   Michel Dagenais (michel.dagenais@polymtl.ca) - Reference C implementation, used with permission
  *******************************************************************************/
 package org.eclipse.linuxtools.lttng.ui.views.controlflow.evProcessor;
 
 import java.util.Vector;
 
-import org.eclipse.linuxtools.lttng.state.StateStrings.ProcessStatus;
-import org.eclipse.linuxtools.lttng.state.evProcessor.ILttngEventProcessor;
-import org.eclipse.linuxtools.lttng.state.model.LttngProcessState;
-import org.eclipse.linuxtools.lttng.state.model.LttngTraceState;
+import org.eclipse.linuxtools.lttng.core.state.StateStrings.ProcessStatus;
+import org.eclipse.linuxtools.lttng.core.state.evProcessor.ILttngEventProcessor;
+import org.eclipse.linuxtools.lttng.core.state.model.LttngProcessState;
+import org.eclipse.linuxtools.lttng.core.state.model.LttngTraceState;
+import org.eclipse.linuxtools.lttng.ui.TraceDebug;
 import org.eclipse.linuxtools.lttng.ui.model.trange.TimeRangeComponent;
 import org.eclipse.linuxtools.lttng.ui.model.trange.TimeRangeEvent;
 import org.eclipse.linuxtools.lttng.ui.model.trange.TimeRangeEvent.Type;
@@ -43,7 +46,7 @@ public abstract class AbsFlowTRangeUpdate extends AbsTRangeUpdate implements ILt
                // TimeRangeEventProcess localProcess = new TimeRangeEventProcess(id, name, startTime, stopTime, groupName, className)
                TimeRangeEventProcess localProcess = new TimeRangeEventProcess(
                                procContainer.getUniqueId(), stateProcess.getName(),
-                               traceStartTime, traceEndTime, "", stateProcess.getType()
+                               traceStartTime, traceEndTime, "", stateProcess.getType() //$NON-NLS-1$
                                                .getInName(), stateProcess.getCpu(), stateProcess
                                                .getInsertion_time());
                
@@ -57,6 +60,11 @@ public abstract class AbsFlowTRangeUpdate extends AbsTRangeUpdate implements ILt
                localProcess.setTraceID(traceId);
                localProcess.setProcessType(stateProcess.getType().getInName());
                procContainer.addItem(localProcess);
+
+               if (TraceDebug.isCFV()) {
+                       TraceDebug.traceCFV("addLocalProcess():" + localProcess); //$NON-NLS-1$
+               }
+
                return localProcess;
        }
        
@@ -101,10 +109,18 @@ public abstract class AbsFlowTRangeUpdate extends AbsTRangeUpdate implements ILt
         * @param stateMode
         * @return
         */
+       @SuppressWarnings("deprecation")
        protected boolean makeDraw(LttngTraceState traceSt, long startTime,
                        long endTime, TimeRangeEventProcess localProcess,
                        ParamsUpdater params, String stateMode) {
 
+               if (TraceDebug.isCFV()) {
+                       TraceDebug.traceCFV("makeDraw():[" + localProcess + //$NON-NLS-1$ 
+                                       ",candidate=[stime=" + startTime +  //$NON-NLS-1$
+                                       ",etime=" + endTime +  //$NON-NLS-1$
+                                       ",state=" + stateMode + "]]"); //$NON-NLS-1$ //$NON-NLS-2$
+               }
+
                // Determine start and end times to establish duration
                Long stime = startTime;
                Long etime = endTime;
@@ -155,7 +171,7 @@ public abstract class AbsFlowTRangeUpdate extends AbsTRangeUpdate implements ILt
                // Display a "more information" indication by allowing non visible event
                // as long as its previous event is visible.
                boolean visible = true;
-               if (pixels < 1) {
+               if (pixels < 1.0) {
                        boolean prevEventVisibility = true;
                        // Get the visibility indication on previous event for
                        // this process
@@ -173,7 +189,7 @@ public abstract class AbsFlowTRangeUpdate extends AbsTRangeUpdate implements ILt
                                // return i.e. event discarded to free up memory
                                Long eventSpan = stime - prevEvent.getStartTime();
                                if (prevEventVisibility == false
-                                               && ((double) eventSpan * k) < 2) {
+                                               && ((double) eventSpan * k) < 2.0) {
 
                                        // discard the item
                                        params.incrementEventsDiscarded(ParamsUpdater.NOT_VISIBLE);
This page took 0.02497 seconds and 5 git commands to generate.