unlockFocus();
break;
case R.id.button3:
- //readImageFile("sampledata2.bin");
- //showMessageText("show 'sampledata2.bin'.");
+ changeFilmSimulation();
break;
case R.id.button4:
- //readImageFile("sampledata3.bin");
- //showMessageText("show 'sampledata3.bin'.");
+ changeImageAspect();
break;
default:
showMessageText("Unknown : " + id);
}
}
+ private void changeFilmSimulation()
+ {
+ try
+ {
+ Thread thread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ boolean ret = connection.execute_change_film_simulation();
+ if (!ret)
+ {
+ showMessageText("Change FilmSimulation Failure...");
+ }
+ }
+ });
+ thread.start();
+ Snackbar.make(activity.findViewById(R.id.constraintLayout), R.string.change_film_simulation, Snackbar.LENGTH_SHORT).show();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ private void changeImageAspect()
+ {
+ try
+ {
+ Thread thread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ boolean ret = connection.execute_change_image_aspect();
+ if (!ret)
+ {
+ showMessageText("Change Image aspect Failure...");
+ }
+ }
+ });
+ thread.start();
+ Snackbar.make(activity.findViewById(R.id.constraintLayout), R.string.change_image_aspect, Snackbar.LENGTH_SHORT).show();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+
@Override
public void updateImage(ReceivedDataHolder receivedData)
{
// Rotates the image.
int centerX = canvas.getWidth() / 2;
int centerY = canvas.getHeight() / 2;
+ int startX = 90;
Paint framePaint = new Paint();
framePaint.setStyle(Paint.Style.STROKE);
framePaint.setColor(Color.WHITE);
+ framePaint.setTextSize(24);
String message = shooting_mode + " REMAIN : " + sd_remain_size + " ISO : " + iso + " BATT: ";
if (battery_level < 0)
message = message + battery_level + "% ";
}
message = message + " " + shutter_speed + " " + aperture + " " + expRev + " : cnt:" + f_ss_Control;
- canvas.drawText(message, centerX, centerY - 50, framePaint);
+ canvas.drawText(message, startX, centerY - 50, framePaint);
Log.v(TAG, message);
message = message + " ERROR";
}
message = message + " [" + focusControlMode + "] ";
- canvas.drawText(message, centerX, centerY, framePaint);
+ canvas.drawText(message, startX, centerY, framePaint);
Log.v(TAG, message);
message = imageAspect + " " + imageFormat + " " + "[" + filmSimulation + "]" + " ";
- canvas.drawText(message, centerX, centerY + 50, framePaint);
+ canvas.drawText(message, startX, centerY + 50, framePaint);
Log.v(TAG, message);
}
import net.osdn.gokigen.cameratest.fuji.statuses.IFujiStatusNotify;
import net.osdn.gokigen.cameratest.fuji.statuses.IFujiStatusRequest;
+import static net.osdn.gokigen.cameratest.fuji.statuses.IFujiCameraProperties.FILM_SIMULATION;
+import static net.osdn.gokigen.cameratest.fuji.statuses.IFujiCameraProperties.IMAGE_ASPECT;
+import static net.osdn.gokigen.cameratest.fuji.statuses.IFujiCameraPropertyValues.FILM_SIMULATION_MAX;
+import static net.osdn.gokigen.cameratest.fuji.statuses.IFujiCameraPropertyValues.FILM_SIMULATION_MIN;
+import static net.osdn.gokigen.cameratest.fuji.statuses.IFujiCameraPropertyValues.IMAGE_ASPECT_MAX;
+import static net.osdn.gokigen.cameratest.fuji.statuses.IFujiCameraPropertyValues.IMAGE_ASPECT_MIN;
+
public class Connection implements IFujiStatusRequest
{
private final String TAG = toString();
return (false);
}
+ public boolean execute_change_film_simulation()
+ {
+ try
+ {
+ // 現在の値を入手
+ int currentValue = statusChecker.getValue(FILM_SIMULATION);
+ currentValue++;
+ if (currentValue > FILM_SIMULATION_MAX)
+ {
+ currentValue = FILM_SIMULATION_MIN;
+ }
+ return (updateProperty(FILM_SIMULATION, currentValue));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return (false);
+ }
+
+ public boolean execute_change_image_aspect()
+ {
+ try
+ {
+ // 現在の値を入手
+ int currentValue = statusChecker.getValue(IMAGE_ASPECT);
+ currentValue++;
+ if (currentValue > IMAGE_ASPECT_MAX)
+ {
+ currentValue = IMAGE_ASPECT_MIN;
+ }
+ return (updateProperty(IMAGE_ASPECT, currentValue));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return (false);
+ }
+
+
public boolean execute_unlock_focus()
{
try
}
}
+ public int getValue(int statusId)
+ {
+ return (statusHolder.getValue(statusId));
+ }
+
@Override
public void stop()
{
threadIsRunning = false;
}
-
-
private void statusReceivedImpl(byte[] data)
{
boolean isStatusUpdated = false;
package net.osdn.gokigen.cameratest.fuji.statuses;
-interface IFujiCameraProperties
+public interface IFujiCameraProperties
{
int BATTERY_LEVEL = 0x5001;
int WHITE_BALANCE = 0x5005;
int FOCUS_SINGLE_AUTO = 0x8001;
int FOCUS_CONTINUOUS_AUTO = 0x8002;
+ int IMAGE_ASPECT_MIN = 2;
int IMAGE_ASPECT_S_3x2 = 2;
int IMAGE_ASPECT_S_16x9 = 3;
int IMAGE_ASPECT_S_1x1 = 4;
int IMAGE_ASPECT_L_3x2 = 10;
int IMAGE_ASPECT_L_16x9 = 11;
int IMAGE_ASPECT_L_1x1 = 12;
+ int IMAGE_ASPECT_MAX = 12;
+
int IMAGE_FORMAT_FINE = 2;
int IMAGE_FORMAT_NORMAL = 3;
int IMAGE_FORMAT_FINE_RAW = 4;
int IMAGE_FORMAT_NORMAL_RAW = 5;
+ int FILM_SIMULATION_MIN = 1;
int FILM_SIMULATION_PROVIA =1;
int FILM_SIMULATION_VELVIA =2;
int FILM_SIMULATION_ASTIA =3;
int FILM_SIMULATION_ACROS_R =14;
int FILM_SIMULATION_ACROS_G =15;
int FILM_SIMULATION_ETERNA =16;
+ int FILM_SIMULATION_MAX = 17;
int BATTERY_CRITICAL =1;
int BATTERY_ONE_BAR =2;
<string name="shutter">Execute Shutter</string>
<string name="drive_af">Drive AF</string>
<string name="unlock_focus">Focus Unlock</string>
+ <string name="change_film_simulation">Change Film Simulation</string>
+ <string name="change_image_aspect">Change Image Aspect</string>
<string name="label_button1">1</string>
<string name="label_button2">2</string>
<string name="label_button3">3</string>