private void rangerScanner_TransportChangeOptionsState( object sender, AxRANGERLib._DRangerEvents_TransportChangeOptionsStateEvent e )
{
if ( e.previousState == (int)RangerTransportStates.TransportStartingUp )
{
// enable imaging
rangerScanner.SetGenericOption( "OptionalDevices", "NeedImaging", "True" );
// limit splash screen
rangerScanner.SetGenericOption( "Ranger GUI", "DisplaySplashOncePerDay", "true" );
// turn on either color, grayscale, or bitonal(black and white) options depending on selected option
rangerScanner.SetGenericOption( "OptionalDevices", "NeedFrontImage1", "False" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedRearImage1", "False" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedFrontImage2", "False" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedRearImage2", "False" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedFrontImage3", "False" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedRearImage3", "False" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedFrontImage4", "False" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedRearImage4", "False" );
var rockConfig = RockConfig.Load();
switch ( rockConfig.ImageColorType )
{
case RangerImageColorTypes.ImageColorTypeColor:
rangerScanner.SetGenericOption( "OptionalDevices", "NeedFrontImage3", "True" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedRearImage3", rockConfig.EnableRearImage.ToTrueFalse() );
break;
case RangerImageColorTypes.ImageColorTypeGrayscale:
rangerScanner.SetGenericOption( "OptionalDevices", "NeedFrontImage2", "True" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedRearImage2", rockConfig.EnableRearImage.ToTrueFalse() );
break;
default:
rangerScanner.SetGenericOption( "OptionalDevices", "NeedFrontImage1", "True" );
rangerScanner.SetGenericOption( "OptionalDevices", "NeedRearImage1", rockConfig.EnableRearImage.ToTrueFalse() );
break;
}
rangerScanner.SetGenericOption( "OptionalDevices", "NeedDoubleDocDetection", rockConfig.EnableDoubleDocDetection.ToTrueFalse() );
// Ranger assigns a score of 1-255 on how confident it is that the character was read correctly (1 unsure, 255 very sure)
// If the score is less than 255, it will assign another score to its next best guess.
// For example, if it pretty sure it was a '3', but it thinks it might have been an '8', it might set the score for '3' as 240, but a score of 150 to '8'.
// If the difference (Plurality) between the scores isn't high enough, it will reject the char.
rangerScanner.SetDriverOption( "MICR", "Sensitivity", rockConfig.Sensitivity);
rangerScanner.SetDriverOption( "MICR", "Plurality", rockConfig.Plurality );
rangerScanner.EnableOptions();
}
}