blob: 04db9d732aff3edae6c18d202b9ce4e9566ccceb [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pierre Allard,
* Regent L'Archeveque - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
*******************************************************************************/
package org.eclipse.apogy.examples.camera.impl;
import org.eclipse.apogy.addons.sensors.fov.RectangularFrustrumFieldOfView;
import org.eclipse.apogy.addons.sensors.imaging.ImageSnapshot;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CameraStubCustomImpl extends CameraStubImpl {
private static final Logger Logger = LoggerFactory.getLogger(CameraStubImpl.class);
/**
* This operation performs any required initialization operations for the
* camera. This is typically called before any other operation.
*
* @return True if the initialization was successful, false otherwise.
*/
@Override
public boolean init() {
// Generate the message and log it
// As this is a stub, just indicate that the camera would have been initialized.
Logger.info("Just a stub. The necessary initialization for the camera would have taken place.");
// Just return true
return true;
}
@Override
public boolean commandZoom(double newZoom) {
// Generate the message and log it
// As this is a stub, just indicate that the camera's current
// zoom level would have changed.
Logger.info("Set the zoom value to <" + newZoom + ">.");
// Just return true
return true;
}
@Override
public double getMinimumZoom() {
// Just return the current zoom level
return this.getCurrentZoom();
}
@Override
public double getMaximumZoom() {
// Just return the current zoom level
return this.getCurrentZoom();
}
@Override
public ImageSnapshot takeSnapshot() {
// Generate the message and log it
// As this is a stub, just indicate that the camera would be ordered
// to take a snapshot and return it.
Logger.info("Just a stub: The camera would have taken a snapshot and returned it.");
// Just return null
return null;
}
@Override
public RectangularFrustrumFieldOfView getFieldOfView() {
// Generate the message and log it
// As this is a stub, just indicate that the camera's field of view
// (FOV) would have been returned.
Logger.info("Just a stub: The camera's field of view would have been returned.");
// Return the camera's field of view
return getFov();
}
} // CameraStubImpl