GUI: Separate out SCM fields for MAXICODE (Ticket #212)

vector.c: Enforce minimum scale 0.1 and allow down to 0.1 in GUI
This commit is contained in:
gitlost 2021-09-09 21:50:02 +01:00
parent 492d9a41c5
commit f84f82d9a2
8 changed files with 348 additions and 158 deletions

View File

@ -1594,9 +1594,7 @@ INTERNAL int dotcode(struct zint_symbol *symbol, unsigned char source[], int len
}
symbol->height = height;
if (!(symbol->output_options & BARCODE_DOTTY_MODE)) {
symbol->output_options += BARCODE_DOTTY_MODE;
}
symbol->output_options |= BARCODE_DOTTY_MODE;
return 0;
}

View File

@ -0,0 +1,43 @@
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Zint 2.10.0.9
%%Title: Zint Generated Symbol
%%Pages: 0
%%BoundingBox: 0 0 3 2
%%EndComments
/TD { newpath 0 360 arc fill } bind def
/TB { 2 copy } bind def
/TR { newpath 4 1 roll exch moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto closepath fill } bind def
/TE { pop pop } bind def
newpath
1.00 1.00 1.00 setrgbcolor
1.60 0.00 TB 0.00 2.20 TR
TE
0.00 0.00 0.00 setrgbcolor
0.10 1.50 0.08 TD
0.90 1.50 0.08 TD
1.30 1.50 0.08 TD
1.70 1.50 0.08 TD
2.10 1.50 0.08 TD
0.70 1.30 0.08 TD
1.10 1.30 0.08 TD
1.50 1.30 0.08 TD
0.10 1.10 0.08 TD
0.50 1.10 0.08 TD
1.30 1.10 0.08 TD
1.70 1.10 0.08 TD
2.10 1.10 0.08 TD
0.30 0.90 0.08 TD
0.10 0.70 0.08 TD
2.10 0.70 0.08 TD
0.30 0.50 0.08 TD
0.70 0.50 0.08 TD
1.10 0.50 0.08 TD
1.50 0.50 0.08 TD
0.10 0.30 0.08 TD
0.50 0.30 0.08 TD
1.70 0.30 0.08 TD
2.10 0.30 0.08 TD
0.30 0.10 0.08 TD
0.70 0.10 0.08 TD
1.50 0.10 0.08 TD
1.90 0.10 0.08 TD

View File

@ -65,29 +65,31 @@ static void test_print(int index, int generate, int debug) {
/* 10*/ { BARCODE_UPCE, -1, -1, SMALL_TEXT | BOLD_TEXT, -1, -1, -1, -1, 0, 0, "", "", 0, "0123456+12345", "upce_5addon_small_bold.eps" },
/* 11*/ { BARCODE_CODE128, UNICODE_MODE, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "A\\B)ç(D", "code128_escape_latin1.eps" },
/* 12*/ { BARCODE_DBAR_LTD, -1, -1, BOLD_TEXT, -1, -1, -1, -1, 0, 0, "", "", 0, "1501234567890", "dbar_ltd_24724_fig7_bold.eps" },
/* 13*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "12", "dotcode_1.0.eps" },
/* 14*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0.1, "", "", 0, "12", "dotcode_1.0_ds0.1.eps" },
/* 15*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 1.1, "", "", 0, "12", "dotcode_1.0_ds1.1.eps" },
/* 16*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 0, "", "", 0, "12", "dotcode_1.5.eps" },
/* 17*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 0.4, "", "", 0, "12", "dotcode_1.5_ds0.4.eps" },
/* 18*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 1.1, "", "", 0, "12", "dotcode_1.5_ds1.1.eps" },
/* 19*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 2.1, "", "", 0, "12", "dotcode_1.5_ds2.1.eps" },
/* 20*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 0, "", "", 0, "12", "dotcode_2.0.eps" },
/* 21*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 0.9, "", "", 0, "12", "dotcode_2.0_ds0.9.eps" },
/* 22*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 1.1, "", "", 0, "12", "dotcode_2.0_ds1.1.eps" },
/* 23*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 0, "", "", 0, "12", "dotcode_3.0.eps" },
/* 24*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 0.4, "", "", 0, "12", "dotcode_3.0_ds0.4.eps" },
/* 25*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 1.1, "", "", 0, "12", "dotcode_3.0_ds1.1.eps" },
/* 26*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 0, "", "", 0, "12", "dotcode_3.5.eps" },
/* 27*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 0.4, "", "", 0, "12", "dotcode_3.5_ds0.4.eps" },
/* 28*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 1.1, "", "", 0, "12", "dotcode_3.5_ds1.1.eps" },
/* 29*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 0, "", "", 0, "12", "dotcode_5.0.eps" },
/* 30*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 0.2, "", "", 0, "12", "dotcode_5.0_ds0.2.eps" },
/* 31*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 1.1, "", "", 0, "12", "dotcode_5.0_ds1.1.eps" },
/* 32*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 1.7, "", "", 0, "12", "dotcode_5.0_ds1.7.eps" },
/* 33*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "FF0000", "0000FF00", 0, "12", "dotcode_no_bg.eps" },
/* 34*/ { BARCODE_MAXICODE, -1, -1, CMYK_COLOUR, -1, -1, -1, -1, 0, 0, "", "", 270, "12", "maxicode_rotate_270_cmyk.eps" },
/* 35*/ { BARCODE_MAXICODE, -1, -1, -1, 3, -1, -1, -1, 0, 0, "", "0000FF00", 180, "12", "maxicode_no_bg_hwsp3_rotate_180.eps" },
/* 13*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0.1, 0, "", "", 0, "12", "dotcode_0.1.eps" },
/* 14*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0.08, 0, "", "", 0, "12", "dotcode_0.1.eps" },
/* 15*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "", "", 0, "12", "dotcode_1.0.eps" },
/* 16*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0.1, "", "", 0, "12", "dotcode_1.0_ds0.1.eps" },
/* 17*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 1.1, "", "", 0, "12", "dotcode_1.0_ds1.1.eps" },
/* 18*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 0, "", "", 0, "12", "dotcode_1.5.eps" },
/* 19*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 0.4, "", "", 0, "12", "dotcode_1.5_ds0.4.eps" },
/* 20*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 1.1, "", "", 0, "12", "dotcode_1.5_ds1.1.eps" },
/* 21*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 1.5, 2.1, "", "", 0, "12", "dotcode_1.5_ds2.1.eps" },
/* 22*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 0, "", "", 0, "12", "dotcode_2.0.eps" },
/* 23*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 0.9, "", "", 0, "12", "dotcode_2.0_ds0.9.eps" },
/* 24*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 2, 1.1, "", "", 0, "12", "dotcode_2.0_ds1.1.eps" },
/* 25*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 0, "", "", 0, "12", "dotcode_3.0.eps" },
/* 26*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 0.4, "", "", 0, "12", "dotcode_3.0_ds0.4.eps" },
/* 27*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3, 1.1, "", "", 0, "12", "dotcode_3.0_ds1.1.eps" },
/* 28*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 0, "", "", 0, "12", "dotcode_3.5.eps" },
/* 29*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 0.4, "", "", 0, "12", "dotcode_3.5_ds0.4.eps" },
/* 30*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 3.5, 1.1, "", "", 0, "12", "dotcode_3.5_ds1.1.eps" },
/* 31*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 0, "", "", 0, "12", "dotcode_5.0.eps" },
/* 32*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 0.2, "", "", 0, "12", "dotcode_5.0_ds0.2.eps" },
/* 33*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 1.1, "", "", 0, "12", "dotcode_5.0_ds1.1.eps" },
/* 34*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 5, 1.7, "", "", 0, "12", "dotcode_5.0_ds1.7.eps" },
/* 35*/ { BARCODE_DOTCODE, -1, -1, -1, -1, -1, -1, -1, 0, 0, "FF0000", "0000FF00", 0, "12", "dotcode_no_bg.eps" },
/* 36*/ { BARCODE_MAXICODE, -1, -1, CMYK_COLOUR, -1, -1, -1, -1, 0, 0, "", "", 270, "12", "maxicode_rotate_270_cmyk.eps" },
/* 37*/ { BARCODE_MAXICODE, -1, -1, -1, 3, -1, -1, -1, 0, 0, "", "0000FF00", 180, "12", "maxicode_no_bg_hwsp3_rotate_180.eps" },
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;

View File

@ -208,6 +208,10 @@ static void vector_scale(struct zint_symbol *symbol, int file_type) {
struct zint_vector_string *string;
float scale = symbol->scale * 2.0f;
if (scale < 0.2f) { // Minimum vector scale 0.1
scale = 0.2f;
}
if ((file_type == OUT_EMF_FILE) && (symbol->symbology == BARCODE_MAXICODE)) {
// Increase size to overcome limitations in EMF file format
scale *= 20;

View File

@ -30,6 +30,14 @@
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="toolTip">
<string>Mode 2 (numeric postcode) and Mode 3 (alphanumeric postcode)
use a Structured Carrier Message (SCM) of 3 fields:
Postcode, Country Code, Service Class
Mode 4 uses enhanced ECC for the primary part of the message
Mode 5 uses enhanced ECC for all of the message
Mode 6 sets the scanner (Reader Initialisation/Programming)</string>
</property>
<property name="buddy">
<cstring>cmbMaxiMode</cstring>
</property>
@ -43,6 +51,14 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Mode 2 (numeric postcode) and Mode 3 (alphanumeric postcode)
use a Structured Carrier Message (SCM) of 3 fields:
Postcode, Country Code, Service Class
Mode 4 uses enhanced ECC for the primary part of the message
Mode 5 uses enhanced ECC for all of the message
Mode 6 sets the scanner (Reader Initialisation/Programming)</string>
</property>
<property name="currentIndex">
<number>1</number>
</property>
@ -68,105 +84,223 @@
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblMaxiPrimary">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>P&amp;rimary Message:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>txtMaxiPrimary</cstring>
</property>
<property name="toolTip">
<string>Format &quot;PPPPPPPPPCCCSSS&quot; where
P is postcode of up to 9 digits for Mode 2 or
6 alphanumerics for Mode 3 (will truncate) and
C is 3-digit country code
S is 3-digit service class
(ignored if disabled)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txtMaxiPrimary">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Primary Message Here!</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="chkMaxiSCMVV">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Enable S&amp;CM Prefix</string>
</property>
<property name="toolTip">
<string>Prefix Secondary Carrier Message with &quot;[)&gt;\R01\Gvv&quot;
where &quot;vv&quot; is version given below
(ignored if disabled)</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lblMaxiSCMVV">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>SCM Pre&amp;fix Version:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>spnMaxiSCMVV</cstring>
</property>
<property name="toolTip">
<string>Version &quot;vv&quot; to place at end of SCM prefix (default 96)
(ignored if disabled)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spnMaxiSCMVV">
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string/>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>96</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBoxMaxiSCM">
<property name="title">
<string>Structured Carrier Message</string>
</property>
<property name="toolTip">
<string>For Modes 2 and 3 only</string>
</property>
<layout class="QGridLayout" name="gridLayoutMaxiSCM">
<item row="0" column="0">
<widget class="QLabel" name="lblMaxiSCMPostcode">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Postcode of up to 9 digits for Mode 2 or
6 alphanumerics for Mode 3 (will truncate)
Postcodes less than maximum length will
be padded with spaces
(ignored if disabled)</string>
</property>
<property name="text">
<string>Pos&amp;tcode:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>txtMaxiSCMPostcode</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="txtMaxiSCMPostcode">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Postcode of up to 9 digits for Mode 2 or
6 alphanumerics for Mode 3 (will truncate)
Postcodes less than maximum length will
be padded with spaces
(ignored if disabled)</string>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maxLength">
<number>9</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblMaxiSCMCountry">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>ISO 3166 numeric country code
Value ranges from 000 to 999
(ignored if disabled)</string>
</property>
<property name="text">
<string>Cou&amp;ntry code:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>spnMaxiSCMCountry</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spnMaxiSCMCountry">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>ISO 3166 numeric country code
Value ranges from 000 to 999
(ignored if disabled)</string>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string/>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblMaxiSCMService">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Class of service, assigned by carrier
Value ranges from 000 to 999
(ignored if disabled)</string>
</property>
<property name="text">
<string>Se&amp;rvice Class:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>spnMaxiSCMService</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spnMaxiSCMService">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Class of service, assigned by carrier
Value ranges from 000 to 999
(ignored if disabled)</string>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string/>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="chkMaxiSCMVV">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Prefix Structured Carrier Message with &quot;[)&gt;\R01\Gvv&quot;
(ANS MH10.8.2 Format 01) where &quot;vv&quot; is version given below
(ignored if disabled)</string>
</property>
<property name="text">
<string>Enable S&amp;CM Prefix</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lblMaxiSCMVV">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Version &quot;vv&quot; to place at end of SCM prefix (default 96)
(ignored if disabled)</string>
</property>
<property name="text">
<string>SCM Pre&amp;fix Version:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>spnMaxiSCMVV</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="spnMaxiSCMVV">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Version &quot;vv&quot; to place at end of SCM prefix (default 96)
(ignored if disabled)</string>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string/>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>99</number>
</property>
<property name="value">
<number>96</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@ -175,7 +309,7 @@ where &quot;vv&quot; is version given below
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>20</height>
</size>
</property>
</spacer>

View File

@ -722,6 +722,9 @@ as delimiters for GS1 Application Identifiers
<property name="value">
<double>50.000000000000000</double>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
@ -870,7 +873,7 @@ in X-dimensions</string>
<number>2</number>
</property>
<property name="minimum">
<double>0.500000000000000</double>
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>99.500000000000000</double>

View File

@ -895,10 +895,12 @@ void MainWindow::change_options()
file.close();
tabMain->insertTab(1, m_optionWidget, tr("MaxiCod&e"));
connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary()));
connect(m_optionWidget->findChild<QObject*>("txtMaxiPrimary"), SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("cmbMaxiMode"), SIGNAL(currentIndexChanged( int )), SLOT(maxi_scm()));
connect(m_optionWidget->findChild<QObject*>("txtMaxiSCMPostcode"), SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("spnMaxiSCMCountry"), SIGNAL(valueChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("spnMaxiSCMService"), SIGNAL(valueChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("chkMaxiSCMVV"), SIGNAL(stateChanged( int )), SLOT(update_preview()));
connect(m_optionWidget->findChild<QObject*>("chkMaxiSCMVV"), SIGNAL(stateChanged( int )), SLOT(maxi_primary()));
connect(m_optionWidget->findChild<QObject*>("chkMaxiSCMVV"), SIGNAL(stateChanged( int )), SLOT(maxi_scm()));
connect(m_optionWidget->findChild<QObject*>("spnMaxiSCMVV"), SIGNAL(valueChanged( int )), SLOT(update_preview()));
} else if (symbology == BARCODE_CHANNEL) {
@ -1071,24 +1073,24 @@ void MainWindow::composite_ean_check()
chkComposite->setChecked(false);
}
void MainWindow::maxi_primary()
void MainWindow::maxi_scm()
{
if (bstyle_items[bstyle->currentIndex()].symbology != BARCODE_MAXICODE)
return;
QCheckBox *chkMaxiSCMVV = m_optionWidget->findChild<QCheckBox*>("chkMaxiSCMVV");
if (m_optionWidget->findChild<QComboBox*>("cmbMaxiMode")->currentIndex() == 0) {
m_optionWidget->findChild<QLabel*>("lblMaxiPrimary")->setEnabled(true);
m_optionWidget->findChild<QLineEdit*>("txtMaxiPrimary")->setEnabled(true);
chkMaxiSCMVV->setEnabled(true);
m_optionWidget->findChild<QLabel*>("lblMaxiSCMVV")->setEnabled(chkMaxiSCMVV->isChecked());
m_optionWidget->findChild<QSpinBox*>("spnMaxiSCMVV")->setEnabled(chkMaxiSCMVV->isChecked());
} else {
m_optionWidget->findChild<QLabel*>("lblMaxiPrimary")->setEnabled(false);
m_optionWidget->findChild<QLineEdit*>("txtMaxiPrimary")->setEnabled(false);
chkMaxiSCMVV->setEnabled(false);
m_optionWidget->findChild<QLabel*>("lblMaxiSCMVV")->setEnabled(false);
m_optionWidget->findChild<QSpinBox*>("spnMaxiSCMVV")->setEnabled(false);
}
bool isMode2or3 = m_optionWidget->findChild<QComboBox*>("cmbMaxiMode")->currentIndex() == 0;
m_optionWidget->findChild<QLabel*>("lblMaxiSCMPostcode")->setEnabled(isMode2or3);
m_optionWidget->findChild<QLineEdit*>("txtMaxiSCMPostcode")->setEnabled(isMode2or3);
m_optionWidget->findChild<QLabel*>("lblMaxiSCMCountry")->setEnabled(isMode2or3);
m_optionWidget->findChild<QSpinBox*>("spnMaxiSCMCountry")->setEnabled(isMode2or3);
m_optionWidget->findChild<QLabel*>("lblMaxiSCMService")->setEnabled(isMode2or3);
m_optionWidget->findChild<QSpinBox*>("spnMaxiSCMService")->setEnabled(isMode2or3);
chkMaxiSCMVV->setEnabled(isMode2or3);
m_optionWidget->findChild<QLabel*>("lblMaxiSCMVV")->setEnabled(isMode2or3 && chkMaxiSCMVV->isChecked());
m_optionWidget->findChild<QSpinBox*>("spnMaxiSCMVV")->setEnabled(isMode2or3 && chkMaxiSCMVV->isChecked());
}
void MainWindow::msi_plessey_ui_set()
@ -1290,23 +1292,22 @@ void MainWindow::update_preview()
case BARCODE_PDF417:
m_bc.bc.setOption2(m_optionWidget->findChild<QComboBox*>("cmbPDFCols")->currentIndex());
m_bc.bc.setOption1(m_optionWidget->findChild<QComboBox*>("cmbPDFECC")->currentIndex() - 1);
if(m_optionWidget->findChild<QRadioButton*>("radPDFStand")->isChecked())
m_bc.bc.setSymbol(BARCODE_PDF417);
if(m_optionWidget->findChild<QRadioButton*>("radPDFTruncated")->isChecked())
if (m_optionWidget->findChild<QRadioButton*>("radPDFTruncated")->isChecked())
m_bc.bc.setSymbol(BARCODE_PDF417COMP);
if(m_optionWidget->findChild<QRadioButton*>("radPDFHIBC")->isChecked())
else if (m_optionWidget->findChild<QRadioButton*>("radPDFHIBC")->isChecked())
m_bc.bc.setSymbol(BARCODE_HIBC_PDF);
else
m_bc.bc.setSymbol(BARCODE_PDF417);
break;
case BARCODE_MICROPDF417:
m_bc.bc.setOption2(m_optionWidget->findChild<QComboBox*>("cmbMPDFCols")->currentIndex());
if(m_optionWidget->findChild<QRadioButton*>("radMPDFStand")->isChecked())
m_bc.bc.setSymbol(BARCODE_MICROPDF417);
if(m_optionWidget->findChild<QRadioButton*>("radMPDFHIBC")->isChecked())
if (m_optionWidget->findChild<QRadioButton*>("radMPDFHIBC")->isChecked())
m_bc.bc.setSymbol(BARCODE_HIBC_MICPDF);
else
m_bc.bc.setSymbol(BARCODE_MICROPDF417);
break;
case BARCODE_DOTCODE:
@ -1549,17 +1550,18 @@ void MainWindow::update_preview()
case BARCODE_MAXICODE:
m_bc.bc.setSymbol(BARCODE_MAXICODE);
if(m_optionWidget->findChild<QComboBox*>("cmbMaxiMode")->currentIndex() == 0)
{
if (m_optionWidget->findChild<QComboBox*>("cmbMaxiMode")->currentIndex() == 0) {
m_bc.bc.setOption1(0); /* Auto-determine mode 2 or 3 from primary message (checks that it isn't empty) */
m_bc.bc.setPrimaryMessage(m_optionWidget->findChild<QLineEdit*>("txtMaxiPrimary")->text());
m_bc.bc.setPrimaryMessage(QString::asprintf("%s%03d%03d",
get_lineedit_val("txtMaxiSCMPostcode").toUtf8().constData(),
get_spinbox_val("spnMaxiSCMCountry"), get_spinbox_val("spnMaxiSCMService")));
QCheckBox *chkMaxiSCMVV = m_optionWidget->findChild<QCheckBox*>("chkMaxiSCMVV");
if (chkMaxiSCMVV->isEnabled() && chkMaxiSCMVV->isChecked()) {
m_bc.bc.setOption2(m_optionWidget->findChild<QSpinBox*>("spnMaxiSCMVV")->value() + 1);
}
}
else
} else {
m_bc.bc.setOption1(m_optionWidget->findChild<QComboBox*>("cmbMaxiMode")->currentIndex() + 3);
}
break;
case BARCODE_CHANNEL:
@ -2135,7 +2137,9 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology) {
case BARCODE_MAXICODE:
settings.setValue("studio/bc/maxicode/mode", get_combobox_index("cmbMaxiMode"));
settings.setValue("studio/bc/maxicode/primary_message", get_lineedit_val("txtMaxiPrimary"));
settings.setValue("studio/bc/maxicode/scm_postcode", get_lineedit_val("txtMaxiSCMPostcode"));
settings.setValue("studio/bc/maxicode/scm_country", get_spinbox_val("spnMaxiSCMCountry"));
settings.setValue("studio/bc/maxicode/scm_service", get_spinbox_val("spnMaxiSCMService"));
settings.setValue("studio/bc/maxicode/chk_scm_vv", get_checkbox_val("chkMaxiSCMVV"));
settings.setValue("studio/bc/maxicode/spn_scm_vv", get_spinbox_val("spnMaxiSCMVV"));
break;
@ -2389,7 +2393,9 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology) {
case BARCODE_MAXICODE:
set_combobox_from_setting(settings, "studio/bc/maxicode/mode", "cmbMaxiMode", 1);
set_lineedit_from_setting(settings, "studio/bc/maxicode/primary_message", "txtMaxiPrimary", "Primary Message Here!");
set_lineedit_from_setting(settings, "studio/bc/maxicode/scm_postcode", "txtMaxiSCMPostcode", "");
set_spinbox_from_setting(settings, "studio/bc/maxicode/scm_country", "spnMaxiSCMCountry", 0);
set_spinbox_from_setting(settings, "studio/bc/maxicode/scm_service", "spnMaxiSCMService", 0);
set_checkbox_from_setting(settings, "studio/bc/maxicode/chk_scm_vv", "chkMaxiSCMVV");
set_spinbox_from_setting(settings, "studio/bc/maxicode/spn_scm_vv", "spnMaxiSCMVV", 96); /* 96 is ASC MH10/SC 8 */
break;

View File

@ -42,7 +42,7 @@ public slots:
void on_bgcolor_clicked();
void composite_ui_set();
void composite_ean_check();
void maxi_primary();
void maxi_scm();
void msi_plessey_ui_set();
void change_print_scale();
void change_cmyk();