### Actualización 5.1

Se cambió el uso del SDK por comunicación directa vía TCP/IP.

Creación de clases TcpReaderAccesor y TcpReaderSearcher para búsqueda del sensor y comunicación.

La actualización cambia el uso del SDK del sensor de la línea SR (SR-2000) por comunicación directa vía TCP para conectarse a un sensor de la línea SR-X (SR-X300W) que no cuenta con SDK. Teóricamente, cualquier sensor que soporte comunicación TCP debe ser compatible con esta versión, sin embargo, no se ha probado con otro sensor a excepción del SR-X300W.

Revise la documentación del sensor en específico para verificar compatibilidad en comunicación y comandos.
This commit is contained in:
2026-03-12 11:23:41 -06:00
parent d8ea775ff1
commit 22ca33b671
3 changed files with 57 additions and 60 deletions

View File

@@ -147,8 +147,8 @@ namespace ScaBox30.Controller
//readprn(); //readprn();
// This example prints "This is a ZPL test." near the top of the label. // This example prints "This is a ZPL test." near the top of the label.
string zplData = "^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ"; //string zplData = "^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ";
//string zplData = etiqueta; string zplData = etiqueta;
// Send the data to printer as a byte array. // Send the data to printer as a byte array.
thePrinterConn.Write(Encoding.UTF8.GetBytes(zplData)); thePrinterConn.Write(Encoding.UTF8.GetBytes(zplData));

View File

@@ -39,11 +39,13 @@
this.btnClose = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button();
this.panelBody = new System.Windows.Forms.Panel(); this.panelBody = new System.Windows.Forms.Panel();
this.labelRate = new System.Windows.Forms.Label(); this.labelRate = new System.Windows.Forms.Label();
this.btnConfiguración = new System.Windows.Forms.Button();
this.barcode_lbl = new System.Windows.Forms.Label(); this.barcode_lbl = new System.Windows.Forms.Label();
this.btnPrinter = new System.Windows.Forms.Button(); this.btnPrinter = new System.Windows.Forms.Button();
this.labelCapacity = new System.Windows.Forms.Label(); this.labelCapacity = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.btnBD = new System.Windows.Forms.Button(); this.btnBD = new System.Windows.Forms.Button();
this.blackimg_picbx = new System.Windows.Forms.PictureBox();
this.btnToogleMode = new System.Windows.Forms.Button(); this.btnToogleMode = new System.Windows.Forms.Button();
this.utr_count_lbl = new System.Windows.Forms.Label(); this.utr_count_lbl = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
@@ -64,12 +66,10 @@
this.sr2000w_ip_lbl = new System.Windows.Forms.Label(); this.sr2000w_ip_lbl = new System.Windows.Forms.Label();
this.version = new System.Windows.Forms.Label(); this.version = new System.Windows.Forms.Label();
this.reader_connector = new System.Windows.Forms.Timer(this.components); this.reader_connector = new System.Windows.Forms.Timer(this.components);
this.btnConfiguración = new System.Windows.Forms.Button();
this.blackimg_picbx = new System.Windows.Forms.PictureBox();
this.panelTitleBar.SuspendLayout(); this.panelTitleBar.SuspendLayout();
this.panelBody.SuspendLayout(); this.panelBody.SuspendLayout();
this.panelButtons.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.blackimg_picbx)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.blackimg_picbx)).BeginInit();
this.panelButtons.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// timer1 // timer1
@@ -122,7 +122,6 @@
// //
// btnMax // btnMax
// //
this.btnMax.Cursor = System.Windows.Forms.Cursors.Default;
this.btnMax.Dock = System.Windows.Forms.DockStyle.Right; this.btnMax.Dock = System.Windows.Forms.DockStyle.Right;
this.btnMax.FlatAppearance.BorderSize = 0; this.btnMax.FlatAppearance.BorderSize = 0;
this.btnMax.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver; this.btnMax.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver;
@@ -206,6 +205,17 @@
this.labelRate.Text = "0 Seg."; this.labelRate.Text = "0 Seg.";
this.labelRate.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.labelRate.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// btnConfiguración
//
this.btnConfiguración.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnConfiguración.Image = global::ScaBox30.Properties.Resources.gear16;
this.btnConfiguración.Location = new System.Drawing.Point(505, 1);
this.btnConfiguración.Name = "btnConfiguración";
this.btnConfiguración.Size = new System.Drawing.Size(37, 23);
this.btnConfiguración.TabIndex = 112;
this.btnConfiguración.UseVisualStyleBackColor = true;
this.btnConfiguración.Click += new System.EventHandler(this.btnConfiguracion_Click);
//
// barcode_lbl // barcode_lbl
// //
this.barcode_lbl.Anchor = System.Windows.Forms.AnchorStyles.Top; this.barcode_lbl.Anchor = System.Windows.Forms.AnchorStyles.Top;
@@ -272,11 +282,22 @@
this.btnBD.UseVisualStyleBackColor = false; this.btnBD.UseVisualStyleBackColor = false;
this.btnBD.MouseClick += new System.Windows.Forms.MouseEventHandler(this.btnBD_MouseClick); this.btnBD.MouseClick += new System.Windows.Forms.MouseEventHandler(this.btnBD_MouseClick);
// //
// blackimg_picbx
//
this.blackimg_picbx.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.blackimg_picbx.Image = ((System.Drawing.Image)(resources.GetObject("blackimg_picbx.Image")));
this.blackimg_picbx.Location = new System.Drawing.Point(69, 24);
this.blackimg_picbx.MaximumSize = new System.Drawing.Size(910, 395);
this.blackimg_picbx.Name = "blackimg_picbx";
this.blackimg_picbx.Size = new System.Drawing.Size(910, 395);
this.blackimg_picbx.TabIndex = 104;
this.blackimg_picbx.TabStop = false;
this.blackimg_picbx.Visible = false;
//
// btnToogleMode // btnToogleMode
// //
this.btnToogleMode.Anchor = System.Windows.Forms.AnchorStyles.Top; this.btnToogleMode.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnToogleMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(69)))), ((int)(((byte)(74))))); this.btnToogleMode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(69)))), ((int)(((byte)(74)))));
this.btnToogleMode.Cursor = System.Windows.Forms.Cursors.Default;
this.btnToogleMode.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnToogleMode.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnToogleMode.ForeColor = System.Drawing.Color.White; this.btnToogleMode.ForeColor = System.Drawing.Color.White;
this.btnToogleMode.Location = new System.Drawing.Point(289, 466); this.btnToogleMode.Location = new System.Drawing.Point(289, 466);
@@ -420,7 +441,6 @@
// //
this.TgrBtn.Anchor = System.Windows.Forms.AnchorStyles.Top; this.TgrBtn.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.TgrBtn.BackColor = System.Drawing.SystemColors.ButtonFace; this.TgrBtn.BackColor = System.Drawing.SystemColors.ButtonFace;
this.TgrBtn.Cursor = System.Windows.Forms.Cursors.Default;
this.TgrBtn.Enabled = false; this.TgrBtn.Enabled = false;
this.TgrBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.TgrBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.TgrBtn.ForeColor = System.Drawing.Color.White; this.TgrBtn.ForeColor = System.Drawing.Color.White;
@@ -511,7 +531,7 @@
this.version.Name = "version"; this.version.Name = "version";
this.version.Size = new System.Drawing.Size(64, 21); this.version.Size = new System.Drawing.Size(64, 21);
this.version.TabIndex = 87; this.version.TabIndex = 87;
this.version.Text = "5.0.1"; this.version.Text = "5.1";
this.version.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.version.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// reader_connector // reader_connector
@@ -520,29 +540,6 @@
this.reader_connector.Interval = 5000; this.reader_connector.Interval = 5000;
this.reader_connector.Tick += new System.EventHandler(this.reader_connector_Tick); this.reader_connector.Tick += new System.EventHandler(this.reader_connector_Tick);
// //
// btnConfiguración
//
this.btnConfiguración.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnConfiguración.Image = global::ScaBox30.Properties.Resources.gear16;
this.btnConfiguración.Location = new System.Drawing.Point(505, 1);
this.btnConfiguración.Name = "btnConfiguración";
this.btnConfiguración.Size = new System.Drawing.Size(37, 23);
this.btnConfiguración.TabIndex = 112;
this.btnConfiguración.UseVisualStyleBackColor = true;
this.btnConfiguración.Click += new System.EventHandler(this.btnConfiguracion_Click);
//
// blackimg_picbx
//
this.blackimg_picbx.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.blackimg_picbx.Image = ((System.Drawing.Image)(resources.GetObject("blackimg_picbx.Image")));
this.blackimg_picbx.Location = new System.Drawing.Point(69, 24);
this.blackimg_picbx.MaximumSize = new System.Drawing.Size(910, 395);
this.blackimg_picbx.Name = "blackimg_picbx";
this.blackimg_picbx.Size = new System.Drawing.Size(910, 395);
this.blackimg_picbx.TabIndex = 104;
this.blackimg_picbx.TabStop = false;
this.blackimg_picbx.Visible = false;
//
// Principal // Principal
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -564,9 +561,9 @@
this.panelTitleBar.PerformLayout(); this.panelTitleBar.PerformLayout();
this.panelBody.ResumeLayout(false); this.panelBody.ResumeLayout(false);
this.panelBody.PerformLayout(); this.panelBody.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.blackimg_picbx)).EndInit();
this.panelButtons.ResumeLayout(false); this.panelButtons.ResumeLayout(false);
this.panelButtons.PerformLayout(); this.panelButtons.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.blackimg_picbx)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->