6b6fff2e872a6ba84f4dbb36420b6ed7cde7ebb3
1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
4 * All rights reserved. This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
9 * Contributors: Alvaro Sanchez-Leon - Initial implementation
10 *******************************************************************************/
11 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.common
;
13 import org
.eclipse
.linuxtools
.internal
.lttng
.core
.state
.evProcessor
.ILttngEventProcessor
;
14 import org
.eclipse
.linuxtools
.internal
.lttng
.core
.state
.evProcessor
.state
.AbsStateProcessing
;
15 import org
.eclipse
.linuxtools
.internal
.lttng
.core
.state
.model
.LttngTraceState
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimeRange
;
18 public abstract class AbsTRangeUpdate
extends AbsStateProcessing
implements
19 ILttngEventProcessor
{
21 private static final long MINORBITS
= 20;
23 // ========================================================================
25 // =======================================================================
28 * Get the mkdev node id<br>
30 * This is an implementation of a KERNEL macro used in Lttv
33 public long getMkdevId(long major
, long minor
) {
34 return (((major
) << MINORBITS
) | (minor
));
38 * Get the pixels per Nano second, either from active widgets or initialise
39 * with the experiment time range values
46 protected double getPixelsPerNs(LttngTraceState traceSt
, ParamsUpdater params
) {
47 double pixPerNs
= params
.getPixelsPerNs();
48 if (pixPerNs
== 0.0) {
49 TmfTimeRange tsetRange
= traceSt
.getContext().getExperimentTimeWindow();
51 long startTime
= tsetRange
.getStartTime().getValue();
52 long endTime
= tsetRange
.getEndTime().getValue();
53 long delta
= endTime
- startTime
;
56 pixPerNs
= (double) params
.getWidth() / (double) delta
;
57 params
.setPixelsPerNs(pixPerNs
);
This page took 0.033821 seconds and 4 git commands to generate.