Skip to content

Commit

Permalink
Changed behaviour of scanner_input_enabled and scanner_selection_by_i…
Browse files Browse the repository at this point in the history
…dentifier to allow add or remove of these parameters in the switch config method.
  • Loading branch information
ltrudu committed Sep 20, 2022
1 parent 62819ce commit 3f0007b
Showing 1 changed file with 17 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class PluginScanner
Useful to control when scan should be available in an application
Default is true
*/
public Boolean scanner_input_enabled = true;
public Boolean scanner_input_enabled = null;

/*
Use it to force the scanner selection
Expand All @@ -59,7 +59,7 @@ public class PluginScanner
Set the scanner you want to use for this profile
Default is internal imager
*/
public SC_E_SCANNER_IDENTIFIER scanner_selection_by_identifier = SC_E_SCANNER_IDENTIFIER.AUTO;
public SC_E_SCANNER_IDENTIFIER scanner_selection_by_identifier = null;


public class Decoders {
Expand Down Expand Up @@ -313,15 +313,24 @@ public Bundle getBarcodePluginBundleForSetConfig(boolean resetConfig) throws Exc
}

private void setupScannerPlugin(Bundle barcodeProps) throws Exception {
barcodeProps.putString("scanner_input_enabled", scanner_input_enabled ? "true" : "false");
if(scanner_input_enabled != null)
barcodeProps.putString("scanner_input_enabled", scanner_input_enabled ? "true" : "false");
else
{
barcodeProps.putString("scanner_input_enabled", "true");
}

// Use this for Datawedge < 6.7
//barcodeProps.putString("scanner_selection", scanner_selection);

// Use this for Datawedge < 6.7
//barcodeProps.putString("scanner_selection", "AUTO");
// Use this for Datawedge >= 6.7
barcodeProps.putString("scanner_selection_by_identifier",scanner_selection_by_identifier.toString());
if(scanner_selection_by_identifier != null)
barcodeProps.putString("scanner_selection_by_identifier",scanner_selection_by_identifier.toString());
else
barcodeProps.putString("scanner_selection_by_identifier",SC_E_SCANNER_IDENTIFIER.AUTO.toString());


// Setup decoders
setupDecoders(barcodeProps);
Expand Down Expand Up @@ -612,22 +621,6 @@ private void setupOtherParameters(Bundle barcodeProps)
barcodeProps.putString("i20f5_enable_marginless_decode", MarginLess.i20f5_enable_marginless_decode ? "true":"false");
}

/**
* Use this method if you want to switch between two knowns parameters
* @param configToBeCompared
* @return
*/
public Bundle getBarcodePluginBundleForSwitchParams(PluginScanner configToBeCompared)
{
// Pass everything to the bundle
Bundle barcodeProps = new Bundle();

// Setup Reader Params
setupReaderParams(barcodeProps, true);

return barcodeProps;
}

/**
* Use this method if you want to force all parameters to be switched
* @return
Expand All @@ -636,15 +629,17 @@ public Bundle getBarcodePluginBundleForSwitchParams() throws Exception {
// Pass everything to the bundle
Bundle barcodeProps = new Bundle();

barcodeProps.putString("scanner_input_enabled", scanner_input_enabled ? "true" : "false");
if(scanner_input_enabled != null)
barcodeProps.putString("scanner_input_enabled", scanner_input_enabled ? "true" : "false");

// Use this for Datawedge < 6.7
//barcodeProps.putString("scanner_selection", scanner_selection);

// Use this for Datawedge < 6.7
//barcodeProps.putString("scanner_selection", "AUTO");
// Use this for Datawedge >= 6.7
barcodeProps.putString("scanner_selection_by_identifier",scanner_selection_by_identifier.toString());
if(scanner_selection_by_identifier != null)
barcodeProps.putString("scanner_selection_by_identifier",scanner_selection_by_identifier.toString());


// Setup decoders
Expand Down

0 comments on commit 3f0007b

Please sign in to comment.