Skip to content

Commit 3750d8b

Browse files
Merge pull request #776 from dynamsoft-docs/preview
update to internal commit 3594fef2
2 parents c704a7f + 937ed71 commit 3750d8b

22 files changed

+426
-765
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ dcvb_parameters: /capture-vision/docs/core/parameters/
9292
dcvb_parameters_reference: /capture-vision/docs/core/parameters/reference/
9393
dcvb_enumerations: /capture-vision/docs/core/enums/
9494
dcvb_cpp_api: /capture-vision/docs/server/programming/cplusplus/api-reference/
95+
dcvb_dotnet_api: /capture-vision/docs/server/programming/dotnet/api-reference/
96+
dcvb_python_api: /capture-vision/docs/server/programming/python/api-reference/
9597

9698
maui: /barcode-reader/docs/mobile/programming/maui/
9799
maui_api: /barcode-reader/docs/mobile/programming/maui/api-reference/

programming/features/barcode-formats-and-count.md

Lines changed: 58 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ You can configure the parameter in two different ways, depending on your require
2424
>- Android
2525
>- Objective-C
2626
>- Swift
27+
>- Python
28+
>- C#
2729
>
2830
>
2931
```javascript
@@ -84,9 +86,36 @@ do{
8486
// Add code to do when error occurs.
8587
}
8688
```
89+
>
90+
```python
91+
cvr_instance = CaptureVisionRouter()
92+
# Obtain current runtime settings of `CCaptureVisionRouter` instance.
93+
err_code, err_str, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
94+
# Specify the barcode formats by enumeration values.
95+
# Use "|" to enable multiple barcode formats at one time.
96+
settings.barcode_settings.barcode_format_ids = EnumBarcodeFormat.BF_QR_CODE.value | EnumBarcodeFormat.BF_ONED.value
97+
# Update the settings.
98+
err_code, err_str = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
99+
```
100+
>
101+
```csharp
102+
using (CaptureVisionRouter cvr = new CaptureVisionRouter())
103+
{
104+
SimplifiedCaptureVisionSettings settings;
105+
string errorMsg;
106+
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
107+
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
108+
// Specify the barcode formats by enumeration values.
109+
// Use "|" to enable multiple barcode formats at one time.
110+
settings.barcodeSettings.barcodeFormatIds = (ulong)(EnumBarcodeFormat.BF_QR_CODE | EnumBarcodeFormat.BF_ONED);
111+
// Update the settings.
112+
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
113+
}
114+
```
115+
87116

88117
* Configure barcode format via `JSON parameter template file`
89-
* update parameter `BarcodeFormatIds` in your JSON template
118+
* Update parameter `BarcodeFormatIds` in your JSON template
90119
```json
91120
{
92121
"CaptureVisionTemplates": [
@@ -110,52 +139,7 @@ do{
110139
}
111140
```
112141

113-
* apply settings by calling method `InitSettingsFromFile`
114-
115-
<div class="sample-code-prefix template2"></div>
116-
>- JavaScript
117-
>- C++
118-
>- Android
119-
>- Objective-C
120-
>- Swift
121-
>
122-
>
123-
```javascript
124-
// `router` is an instance of `CaptureVisionRouter`.
125-
// In the JS edition, the method name we use for initialization is different.
126-
router.initSettings("PATH-TO-YOUR-SETTING")
127-
```
128-
>
129-
```c++
130-
char szErrorMsg[256] = {0};
131-
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
132-
cvr->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", szErrorMsg, 256);
133-
// more process here
134-
```
135-
>
136-
```java
137-
try {
138-
// `cvr` is an instance of `CaptureVisionRouter`.
139-
cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE");
140-
} catch (CaptureVisionRouterException e) {
141-
e.printStackTrace();
142-
}
143-
```
144-
>
145-
```objc
146-
NSError *error;
147-
// `cvr` is an instance of `DSCaptureVisionRouter`.
148-
[self.cvr initSettingsFromFile:@"PATH-TO-YOUR-SETTING-FILE" error:&error];
149-
```
150-
>
151-
```swift
152-
do{
153-
//`cvr` is an instance of `CaptureVisionRouter`.
154-
try cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE")
155-
}catch{
156-
// Add code to do when error occurs.
157-
}
158-
```
142+
* Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).
159143

160144
## Set Barcode Count
161145

@@ -178,6 +162,8 @@ You can configure the parameter in two different ways, depending on your require
178162
>- Android
179163
>- Objective-C
180164
>- Swift
165+
>- Python
166+
>- C#
181167
>
182168
>
183169
```javascript
@@ -236,6 +222,30 @@ do{
236222
// Add code to do when error occurs.
237223
}
238224
```
225+
>
226+
```python
227+
cvr_instance = CaptureVisionRouter()
228+
# Obtain current runtime settings of `CCaptureVisionRouter` instance.
229+
err_code, err_str, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
230+
# Specify the expected barcode count.
231+
settings.barcode_settings.expected_barcodes_count = 1
232+
# Update the settings.
233+
err_code, err_str = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
234+
```
235+
>
236+
```csharp
237+
using (CaptureVisionRouter cvr = new CaptureVisionRouter())
238+
{
239+
SimplifiedCaptureVisionSettings settings;
240+
string errorMsg;
241+
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
242+
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
243+
// Specify the expected barcode count.
244+
settings.barcodeSettings.expectedBarcodesCount = 1;
245+
// Update the settings.
246+
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
247+
}
248+
```
239249

240250
* Configure barcode format via `JSON parameter template file`
241251
* update parameter `ExpectedBarcodesCount` in your JSON template
@@ -261,49 +271,4 @@ do{
261271
]
262272
}
263273
```
264-
* apply settings by calling method `InitSettingsFromFile`
265-
266-
<div class="sample-code-prefix template2"></div>
267-
>- JavaScript
268-
>- C++
269-
>- Android
270-
>- Objective-C
271-
>- Swift
272-
>
273-
>
274-
```javascript
275-
// `router` is an instance of `CaptureVisionRouter`.
276-
// In the JS edition, the method name we use for initialization is different.
277-
router.initSettings("PATH-TO-YOUR-SETTING")
278-
```
279-
>
280-
```c++
281-
char szErrorMsg[256] = {0};
282-
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
283-
cvr->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", szErrorMsg, 256);
284-
// more process here
285-
```
286-
>
287-
```java
288-
try {
289-
// `cvr` is an instance of `CaptureVisionRouter`.
290-
cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE");
291-
} catch (CaptureVisionRouterException e) {
292-
e.printStackTrace();
293-
}
294-
```
295-
>
296-
```objc
297-
NSError *error;
298-
// `cvr` is an instance of `DSCaptureVisionRouter`.
299-
[self.cvr initSettingsFromFile:@"PATH-TO-YOUR-SETTING-FILE" error:&error];
300-
```
301-
>
302-
```swift
303-
do{
304-
//`cvr` is an instance of `CaptureVisionRouter`.
305-
try cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE")
306-
}catch{
307-
// Add code to do when error occurs.
308-
}
309-
```
274+
* Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).

programming/features/barcode-scan-region.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Dynamsoft Barcode Reader (DBR) will locate the code region and decode the entire
1919
<div class="sample-code-prefix template2"></div>
2020
>- JavaScript
2121
>- C++
22+
>- Python
23+
>- C#
2224
>
2325
>
2426
```javascript
@@ -48,6 +50,43 @@ settings.roiMeasuredInPercentage = 1;
4850
// Update the settings.
4951
cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &settings, szErrorMsg, 256);
5052
```
53+
>
54+
```python
55+
cvr_instance = CaptureVisionRouter()
56+
# Obtain current runtime settings of `CCaptureVisionRouter` instance.
57+
err_code, err_str, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
58+
# Specify the ROI.
59+
settings.roi_measured_in_percentage = 1
60+
points = settings.roi.points
61+
points[0].x = 10
62+
points[0].y = 10
63+
points[1].x = 90
64+
points[1].y = 10
65+
points[2].x = 90
66+
points[2].y = 90
67+
points[3].x = 10
68+
points[3].y = 90
69+
# Update the settings.
70+
err_code, err_str = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
71+
```
72+
>
73+
```csharp
74+
using (CaptureVisionRouter cvr = new CaptureVisionRouter())
75+
{
76+
SimplifiedCaptureVisionSettings settings;
77+
string errorMsg;
78+
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
79+
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
80+
// Specify the ROI.
81+
settings.roiMeasuredInPercentage = 1;
82+
settings.roi.points[0].Set(10, 10);
83+
settings.roi.points[1].Set(90, 10);
84+
settings.roi.points[2].Set(90, 90);
85+
settings.roi.points[3].Set(10, 90);
86+
// Update the settings.
87+
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
88+
}
89+
```
5190

5291
* Configure region via `JSON Template`
5392

programming/features/control-terminate-phase.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Below is an example illustrating how to configure parameter `TerminateSetting` v
4848
}
4949
```
5050

51-
To apply the above settings, please follow the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).
51+
Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).
5252

5353
## Timeout
5454

@@ -67,6 +67,8 @@ You can configure the parameter in two different ways, depending on your require
6767
<div class="sample-code-prefix template2"></div>
6868
>- JavaScript
6969
>- C++
70+
>- Python
71+
>- C#
7072
>
7173
>
7274
```javascript
@@ -84,11 +86,35 @@ char szErrorMsg[256] = {0};
8486
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
8587
SimplifiedCaptureVisionSettings settings;
8688
cvr->GetSimplifiedSettings(CPresetTemplate::PT_READ_BARCODES, &settings);
87-
// Specify the expected barcode count.
89+
// Specify the timeout.
8890
settings.timeout = 1000;
8991
// Update the settings.
9092
cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &settings, szErrorMsg, 256);
9193
```
94+
>
95+
```python
96+
cvr_instance = CaptureVisionRouter()
97+
# Obtain current runtime settings of `CCaptureVisionRouter` instance.
98+
err_code, err_str, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
99+
# Specify the timeout.
100+
settings.timeout = 1000
101+
# Update the settings.
102+
err_code, err_str = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
103+
```
104+
>
105+
```csharp
106+
using (CaptureVisionRouter cvr = new CaptureVisionRouter())
107+
{
108+
SimplifiedCaptureVisionSettings settings;
109+
string errorMsg;
110+
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
111+
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
112+
// Specify the timeout.
113+
settings.timeout = 1000;
114+
// Update the settings.
115+
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
116+
}
117+
```
92118

93119

94120
* Configure parameter `Timeout` via `JSON Template`
@@ -116,4 +142,5 @@ cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &settings, szErrorMsg, 25
116142
}
117143
```
118144

119-
To apply the above settings, please follow the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).
145+
Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).
146+

programming/features/filter-and-sort.md

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Dynamsoft Barcode Reader SDK is able to read multiple barcodes at once and retur
2323
* [TextResultOrderModes]({{ site.dcvb_parameters_reference }}barcode-reader-task-settings/text-result-order-modes.html)
2424

2525

26-
## Sample Code
26+
## Example
2727

2828
Below is an example illustrating how to filter out QR Code results with confidence higher than 50 and then order the results by position.
2929

30-
* update parameters in your JSON template
30+
* Update parameters in your JSON template
3131

3232
```json
3333
{
@@ -64,49 +64,4 @@ Below is an example illustrating how to filter out QR Code results with confiden
6464
}
6565
```
6666

67-
* apply settings by calling method `InitSettingsFromFile`
68-
69-
<div class="sample-code-prefix template2"></div>
70-
>- JavaScript
71-
>- C++
72-
>- Android
73-
>- Objective-C
74-
>- Swift
75-
>
76-
>
77-
```javascript
78-
// `router` is an instance of `CaptureVisionRouter`.
79-
// In the JS edition, the method name we use for initialization is different.
80-
router.initSettings("PATH-TO-YOUR-SETTING")
81-
```
82-
>
83-
```c++
84-
char szErrorMsg[256] = {0};
85-
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
86-
cvr->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", szErrorMsg, 256);
87-
// more process here
88-
```
89-
>
90-
```java
91-
try {
92-
// `cvr` is an instance of `CaptureVisionRouter`.
93-
cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE");
94-
} catch (CaptureVisionRouterException e) {
95-
e.printStackTrace();
96-
}
97-
```
98-
>
99-
```objc
100-
NSError *error;
101-
// `cvr` is an instance of `DSCaptureVisionRouter`.
102-
[self.cvr initSettingsFromFile:@"PATH-TO-YOUR-SETTING-FILE" error:&error];
103-
```
104-
>
105-
```swift
106-
do{
107-
//`cvr` is an instance of `CaptureVisionRouter`.
108-
try cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE")
109-
}catch{
110-
// Add code to do when error occurs.
111-
}
112-
```
67+
* Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).

0 commit comments

Comments
 (0)