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
.lttng
.state
.evProcessor
.IEventProcessing
;
14 import org
.eclipse
.linuxtools
.lttng
.state
.evProcessor
.state
.AbsStateProcessing
;
15 import org
.eclipse
.linuxtools
.lttng
.state
.model
.LttngTraceState
;
16 import org
.eclipse
.linuxtools
.tmf
.event
.TmfTimeRange
;
18 public abstract class AbsTRangeUpdate
extends AbsStateProcessing
implements
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();
49 TmfTimeRange tsetRange
= traceSt
.getInputDataRef().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.031598 seconds and 5 git commands to generate.