Skip to content

Commit

Permalink
Fix Pentax shutter speed calculations for older cameras (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
karlrees committed Jun 4, 2020
1 parent a659715 commit 627fe3b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions indi-pentax/pktriggercord_ccd.cpp
Expand Up @@ -301,11 +301,22 @@ bool PkTriggerCordCCD::StartExposure(float duration)
}
PrimaryCCD.setExposureDuration(duration);
ExposureRequest = duration;
pslr_rational_t shutter_speed = {(int)(duration*100),100};
float F = duration;
pslr_rational_t shutter_speed;
if (F < 5) {
F = F * 10;
shutter_speed.denom = 10;
shutter_speed.nom = F;
} else {
shutter_speed.denom = 1;
shutter_speed.nom = F;
}
//pslr_rational_t shutter_speed = {(int)(duration*100),100};
//Doesn't look like we need to actually set the shutter speed in bulb mode
if ( status.exposure_mode != PSLR_GUI_EXPOSURE_MODE_B ) {
if (duration != (float)status.current_shutter_speed.nom/status.current_shutter_speed.denom)
if (duration != (float)status.current_shutter_speed.nom/status.current_shutter_speed.denom) {
pslr_set_shutter(device, shutter_speed);
}
}

if (autoFocusS[0].s == ISS_ON) pslr_focus(device);
Expand Down

0 comments on commit 627fe3b

Please sign in to comment.