### 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();
// 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 = etiqueta;
//string zplData = "^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ";
string zplData = etiqueta;
// Send the data to printer as a byte array.
thePrinterConn.Write(Encoding.UTF8.GetBytes(zplData));

View File

@@ -39,11 +39,13 @@
this.btnClose = new System.Windows.Forms.Button();
this.panelBody = new System.Windows.Forms.Panel();
this.labelRate = new System.Windows.Forms.Label();
this.btnConfiguración = new System.Windows.Forms.Button();
this.barcode_lbl = new System.Windows.Forms.Label();
this.btnPrinter = new System.Windows.Forms.Button();
this.labelCapacity = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.btnBD = new System.Windows.Forms.Button();
this.blackimg_picbx = new System.Windows.Forms.PictureBox();
this.btnToogleMode = new System.Windows.Forms.Button();
this.utr_count_lbl = 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.version = new System.Windows.Forms.Label();
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.panelBody.SuspendLayout();
this.panelButtons.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.blackimg_picbx)).BeginInit();
this.panelButtons.SuspendLayout();
this.SuspendLayout();
//
// timer1
@@ -122,7 +122,6 @@
//
// btnMax
//
this.btnMax.Cursor = System.Windows.Forms.Cursors.Default;
this.btnMax.Dock = System.Windows.Forms.DockStyle.Right;
this.btnMax.FlatAppearance.BorderSize = 0;
this.btnMax.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver;
@@ -206,6 +205,17 @@
this.labelRate.Text = "0 Seg.";
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
//
this.barcode_lbl.Anchor = System.Windows.Forms.AnchorStyles.Top;
@@ -272,11 +282,22 @@
this.btnBD.UseVisualStyleBackColor = false;
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
//
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.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.ForeColor = System.Drawing.Color.White;
this.btnToogleMode.Location = new System.Drawing.Point(289, 466);
@@ -420,7 +441,6 @@
//
this.TgrBtn.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.TgrBtn.BackColor = System.Drawing.SystemColors.ButtonFace;
this.TgrBtn.Cursor = System.Windows.Forms.Cursors.Default;
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.ForeColor = System.Drawing.Color.White;
@@ -511,7 +531,7 @@
this.version.Name = "version";
this.version.Size = new System.Drawing.Size(64, 21);
this.version.TabIndex = 87;
this.version.Text = "5.0.1";
this.version.Text = "5.1";
this.version.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// reader_connector
@@ -520,29 +540,6 @@
this.reader_connector.Interval = 5000;
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
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -564,9 +561,9 @@
this.panelTitleBar.PerformLayout();
this.panelBody.ResumeLayout(false);
this.panelBody.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.blackimg_picbx)).EndInit();
this.panelButtons.ResumeLayout(false);
this.panelButtons.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.blackimg_picbx)).EndInit();
this.ResumeLayout(false);
}