Skip to content

Commit

Permalink
OM-1 new ISO support
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahparker committed Aug 10, 2022
1 parent 6234b68 commit da145bd
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions camera/ptpjs/drivers/olympus.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ function exposureEvent(camera) {
driver.supportsNativeHDR = true;

driver.supportedCameras = {
'07b4:0130': { name: "Olympus OM-D", status: 'unknown', supports: { shutter: true, aperture: true, iso: true, liveview: true, destination: true, focus: true, }, usb: 'USB C' },
'07b4:0135': { name: "Olympus OM-D E-M1 II", status: 'unknown', supports: { shutter: true, aperture: true, iso: true, liveview: true, destination: true, focus: true, }, usb: 'USB C' },
'07b4:012f': { name: "Olympus OM-D E-M10 III", status: 'unknown', supports: { shutter: true, aperture: true, iso: true, liveview: true, destination: true, focus: true, }, usb: 'USB C' },
'33a2:0136': { name: "Olympus OM-1", status: 'unknown', supports: { shutter: true, aperture: true, iso: true, liveview: true, destination: true, focus: true, }, usb: 'USB C' },
'07b4:0130': { name: "Olympus OM-D", status: 'unknown', supports: { shutter: true, aperture: true, iso: true, liveview: true, destination: true, focus: true, }, usb: 'USB C', codeIndex: {iso: 0} },
'07b4:0135': { name: "Olympus OM-D E-M1 II", status: 'unknown', supports: { shutter: true, aperture: true, iso: true, liveview: true, destination: true, focus: true, }, usb: 'USB C', codeIndex: {iso: 0} },
'07b4:012f': { name: "Olympus OM-D E-M10 III", status: 'unknown', supports: { shutter: true, aperture: true, iso: true, liveview: true, destination: true, focus: true, }, usb: 'USB C', codeIndex: {iso: 0} },
'33a2:0136': { name: "Olympus OM-1", status: 'unknown', supports: { shutter: true, aperture: true, iso: true, liveview: true, destination: true, focus: true, }, usb: 'USB C', codeIndex: {iso: 1} },
}

var properties = {
Expand All @@ -61,7 +61,7 @@ var properties = {
setFunction: ptp.setPropU32,
getFunction: ptp.getPropU32,
listFunction: ptp.listProp,
code: 0xD01C,
code: [0xD01C],
ev: true,
values: [
{ name: "LIVETIME", ev: null, code: 4294967293 },
Expand Down Expand Up @@ -139,7 +139,7 @@ var properties = {
setFunction: ptp.setPropU16,
getFunction: ptp.getPropU16,
listFunction: ptp.listProp,
code: 0xD002,
code: [0xD002],
ev: true,
values: [
{ name: "1.0", ev: -8, code: 10 },
Expand Down Expand Up @@ -192,7 +192,7 @@ var properties = {
setFunction: ptp.setProp32,
getFunction: ptp.getProp32,
listFunction: ptp.listProp,
code: 0xD007,
code: [0xD007, 0xD1BF],
ev: true,
values: [
{ name: "32", ev: 1 + 2 / 3, code: 32 },
Expand Down Expand Up @@ -242,7 +242,7 @@ var properties = {
setFunction: ptp.setPropU8,
getFunction: ptp.getPropU8,
listFunction: ptp.listProp,
code: 0xd00d,
code: [0xd00d],
ev: false,
values: [
{ name: "RAW", value: 'raw', code: 32 },
Expand All @@ -262,7 +262,7 @@ var properties = {
setFunction: null,
getFunction: null,
listFunction: null,
code: null,
code: [null],
ev: false,
default: 0,
values: [
Expand All @@ -276,7 +276,7 @@ var properties = {
setFunction: null,
getFunction: null,
listFunction: null,
code: null,
code: [null],
ev: false,
default: 0,
},
Expand All @@ -286,7 +286,7 @@ var properties = {
setFunction: null,
getFunction: ptp.getPropU8,
listFunction: null,
code: 0x5001,
code: [0x5001],
ev: false,
},
'burst': {
Expand All @@ -295,7 +295,7 @@ var properties = {
setFunction: ptp.setPropU16,
getFunction: ptp.getPropU16,
listFunction: null,
code: 0x5018,
code: [0x5018],
ev: false,
},
//'bracketing': {
Expand All @@ -304,7 +304,7 @@ var properties = {
// setFunction: ptp.setPropU8,
// getFunction: ptp.getPropU8,
// listFunction: ptp.listProp,
// code: 0xD0C0,
// code: [0xD0C0],
// ev: false,
// values: [
// { name: "disabled", value: 0, code: 0 },
Expand All @@ -317,7 +317,7 @@ var properties = {
// setFunction: ptp.setPropU8,
// getFunction: ptp.getPropU8,
// listFunction: ptp.listProp,
// code: 0xD0C1,
// code: [0xD0C1],
// ev: false,
// values: [
// { name: "1/3 stop", value: 1/3, code: 0 },
Expand All @@ -333,7 +333,7 @@ var properties = {
setFunction: ptp.setPropU16,
getFunction: ptp.getPropU16,
listFunction: ptp.listProp,
code: 0xD0AD,
code: [0xD0AD],
ev: false,
values: [
{ name: "Off", value: null, code: 1 },
Expand All @@ -352,7 +352,7 @@ var properties = {
// setFunction: ptp.setPropU8,
// getFunction: ptp.getPropU8,
// listFunction: ptp.listProp,
// code: 0xD0C3,
// code: [0xD0C3],
// ev: false,
// values: [
// { name: "UNKNOWN", value: 0, code: 1 },
Expand All @@ -364,7 +364,7 @@ var properties = {
// setFunction: ptp.setPropU8,
// getFunction: ptp.getPropU8,
// listFunction: ptp.listProp,
// code: 0xD07A,
// code: [0xD07A],
// ev: false,
// values: [
// { name: "Center first", value: 'center', code: 0 },
Expand All @@ -377,7 +377,7 @@ var properties = {
// setFunction: ptp.setPropU8,
// getFunction: ptp.getPropU8,
// listFunction: ptp.listProp,
// code: 0xD079,
// code: [0xD079],
// ev: false,
// values: [
// { name: "Shutter", value: 's', code: 0 },
Expand All @@ -392,7 +392,7 @@ var properties = {
// setFunction: ptp.setPropU8,
// getFunction: ptp.getPropU8,
// listFunction: ptp.listProp,
// code: 0xD078,
// code: [0xD078],
// ev: false,
// values: [
// { name: "AE & Flash", value: 'flash', code: 0 },
Expand All @@ -407,7 +407,7 @@ var properties = {
setFunction: ptp.setPropU16,
getFunction: ptp.getPropU16,
listFunction: ptp.listProp,
code: 0xD003,
code: [0xD003],
ev: false,
values: [
{ name: "MF", value: 'mf', code: 0x0001 },
Expand All @@ -423,7 +423,7 @@ var properties = {
setFunction: ptp.setPropU32,
getFunction: ptp.getPropU32,
listFunction: ptp.listProp,
code: 0xD06D,
code: [0xD06D],
ev: false,
values: [
{ name: "enabled", value: 'on', code: 67109632 },
Expand All @@ -440,7 +440,7 @@ var properties = {
setFunction: ptp.setPropU32,
getFunction: ptp.getPropU32,
listFunction: ptp.listProp,
code: 0xD0D6,
code: [0xD0D6],
ev: false,
mapFunction: parseLiveviewSize
//values: [
Expand All @@ -453,7 +453,7 @@ var properties = {
setFunction: ptp.setPropU16,
getFunction: ptp.getPropU16,
listFunction: ptp.listProp,
code: 0xD04B,
code: [0xD04B],
ev: false,
values: [
{ name: "full", value: 'full', code: 0x0000 },
Expand All @@ -466,7 +466,7 @@ var properties = {
setFunction: ptp.setPropU16,
getFunction: ptp.getPropU16,
listFunction: ptp.listProp,
code: 0xD051,
code: [0xD051],
ev: false,
mapFunction: parseFocusPoints
},
Expand All @@ -477,7 +477,7 @@ driver.properties = properties;
function propMapped(propCode) {
for(var name in properties) {
if(properties.hasOwnProperty(name)) {
if(propCode === properties[name].code) return true;
if(properties[name].code.indexOf(propCode) !== -1) return true;
}
}
return false;
Expand Down Expand Up @@ -581,7 +581,7 @@ driver.refresh = function(camera, callback) {
if(!camera[properties[key].category]) camera[properties[key].category] = {};
if(!camera[properties[key].category][key]) camera[properties[key].category][key] = {};
if(properties[key].listFunction) {
properties[key].listFunction(camera._dev, properties[key].code, function(err, current, list, valueSize, listType) {
properties[key].listFunction(camera._dev, properties[key].code[camera.supports.codeIndex[key] || 0], function(err, current, list, valueSize, listType) {
if(err || !list) {
_logE("failed to list", key, ", err:", err);
} else {
Expand Down Expand Up @@ -726,8 +726,8 @@ driver.set = function(camera, param, value, callback, _tries) {
}
if(properties[param] && properties[param].setFunction) {
if(cameraValue !== null) {
_logD("setting", ptp.hex(properties[param].code), "to", cameraValue);
properties[param].setFunction(camera._dev, properties[param].code, cameraValue, function(err) {
_logD("setting", ptp.hex(properties[param].code[camera.supports.codeIndex[key] || 0]), "to", cameraValue);
properties[param].setFunction(camera._dev, properties[param].code[camera.supports.codeIndex[key] || 0], cameraValue, function(err) {
if(!err) {
if(!camera[properties[param].category]) camera[properties[param].category] = {};
if(!camera[properties[param].category][param]) camera[properties[param].category][param] = {};
Expand All @@ -742,7 +742,7 @@ driver.set = function(camera, param, value, callback, _tries) {
cb(err);
exposureEvent(camera);
} else {
_logE("error setting " + ptp.hex(properties[param].code) + ": " + err);
_logE("error setting " + ptp.hex(properties[param].code[camera.supports.codeIndex[key] || 0]) + ": " + err);
return cb(err);
}
});
Expand Down Expand Up @@ -787,7 +787,7 @@ driver.get = function(camera, param, callback) {
async.series([
function(cb){
if(properties[param] && properties[param].getFunction) {
properties[param].getFunction(camera._dev, properties[param].code, function(err, data, size) {
properties[param].getFunction(camera._dev, properties[param].code[camera.supports.codeIndex[key] || 0], function(err, data, size) {
if(!err) {
properties[param].size = size;
if(properties[param].values) {
Expand Down

0 comments on commit da145bd

Please sign in to comment.