2025年Sebia电泳绘图

Sebia电泳绘图Sebia 这仪器真是个奇葩的存在 自己仪器有图不存文件 LIS 要的话还得自己按数据绘制 还有蛋白电泳 固定电泳 画不画参考线等不同要求 奇葩的很 按理这种事不属于 lis 范围 无奈国内 lis 太卷 各种舔狗厂商才让这种仪器大行其道 蛋白电泳机器原图 蛋白电泳绘制图 按文档位置取数据绘图

大家好,我是讯享网,很高兴认识大家。

Sebia这仪器真是个奇葩的存在。自己仪器有图不存文件,LIS要的话还得自己按数据绘制。还有蛋白电泳、固定电泳、画不画参考线等不同要求(奇葩的很)。按理这种事不属于lis范围,无奈国内lis太卷,各种舔狗厂商才让这种仪器大行其道。

蛋白电泳机器原图
在这里插入图片描述
讯享网

蛋白电泳绘制图
在这里插入图片描述

按文档位置取数据绘图
在这里插入图片描述

在这里插入图片描述

绘图逻辑片段(数据以J开头)

using System; using System.Collections.Generic; using System.Linq; using System.Text; using PreDeal.Interface; using LIS.Model.Bussiness; using LIS.DAL.DataAccess; using PreDeal.Ftp; using PreDeal.Attributes; using System.Text.RegularExpressions; using System.Drawing; using System.Windows.Forms; using System.Drawing.Drawing2D; using System.IO; using System.Collections; namespace PreDeal { 
    ///<summary NoteObject="Class"> /// [功能描述:Sebia电泳仪的数据和图像处理 蛋白电泳] <para/> /// [创建者:zlz] <para/> /// [创建时间:] <para/> ///<说明> /// [说明:Sebia电泳仪的数据和图像处理处理,处理数据格式 /// J000 000 00000g/dl ADMAlbumin Alpha 1 Alpha 2 Beta 1 Beta 2 Gamma 051.2005.3008.2003.9002.6028.0000000000000000000000000000000000000000000000000000000000001 2 026.4002.00000000000000000000001.0501.00 000300A0000000000000000000000000000000000000000000000000000000B000B000B000C000D000E000000F000D000C00009000B000B000C000D000E00019001B00F00009E00BA00D900FC0D017F01BC0A02C2206CA090B0BAF0E180FA40FFF0F060CED0A3D078B053D037F026701B0012D00CD0088005D00A0024001F001C001B801A001B001C00B0004D00086009A00B200D100FD0D011F00E500AD0000005E0065006E00B0093009E00AC00BE00D400EB0C011F011D0D010100F600E700D700C500B1009E008D007F0074006B0065005F0004E804E0005F00B00A500C400E000FF800DD00BD009B007D00E804D004E00005A00A00A0086007F0074006B0064005F805E0061006A00B000A600BE00DE0E01FD0F045E058A06C207DB08A008DF05DFB01EB4D00E0026001E00E000B0000000000000000000000002|  /// ]<para/> ///</说明> ///<修改记录> /// [修改时间:]<para/> /// [修改内容:]<para/> ///</修改记录> ///<修改记录> /// [修改时间:本次修改时间]<para/> /// [修改内容:本次修改内容]<para/> ///</修改记录> ///</summary> [Remark(Remark = "Sebia血清蛋白电泳仪的数据和图像处理\n")] public class DealSebiaELPJ : BaseDeal, IPreDeal, ITimer { 
    /// <summary> /// 流水号 /// </summary> private static string epis = ""; /// <summary> /// 前处理 /// </summary> /// <param name="result">结果</param> /// <param name="machID">仪器ID</param> /// <param name="dealProcess">处理程序</param> /// <param name="index">当前文件的第几行</param> /// <param name="fileName">当前读取的文件全名</param> /// <returns></returns> public bool PreDeal(string result, string machID, string dealProcess, int index, string fileName) { 
    try { 
    string head = result.Split(' ')[0]; string sampleNo = head.Substring(5, head.Length - 5); string episAll = result.Split(' ')[0]; epis = sampleNo.Split('-')[0]; string value1Name = result.Substring(266, 10); string value1 = result.Substring(367, 5); string value2Name = result.Substring(276, 10); string value2 = result.Substring(372, 5); string value3Name = result.Substring(286, 10); string value3 = result.Substring(377, 5); string value4Name = result.Substring(296, 10); string value4 = result.Substring(382, 5); string value5Name = result.Substring(306, 10); string value5 = result.Substring(387, 5); string value6Name = result.Substring(316, 10); string value6 = result.Substring(392, 5); string value7Name = result.Substring(326, 10); string value7 = result.Substring(397, 5); string value8Name = result.Substring(336, 10); string value8 = result.Substring(402, 5); string value9Name = result.Substring(346, 10); string value9 = result.Substring(407, 5); string value10Name = result.Substring(356, 10); string value10 = result.Substring(412, 5); string value11 = result.Substring(557, 170).Trim(); //分割坐标 List<string> TroughsArr = new List<string>(); string val = result.Substring(798, 4); TroughsArr.Add(val.TrimStart('0')); val = result.Substring(802, 4); TroughsArr.Add(val.TrimStart('0')); val = result.Substring(806, 4); TroughsArr.Add(val.TrimStart('0')); val = result.Substring(810, 4); TroughsArr.Add(val.TrimStart('0')); val = result.Substring(814, 4); TroughsArr.Add(val.TrimStart('0')); val = result.Substring(818, 4); TroughsArr.Add(val.TrimStart('0')); val = result.Substring(822, 4); TroughsArr.Add(val.TrimStart('0')); val = result.Substring(826, 4); TroughsArr.Add(val.TrimStart('0')); List<int> flagList = new List<int>(); for (int zi = TroughsArr.Count - 1; zi >= 0; zi -= 2) { 
    string start = TroughsArr[zi - 1]; string end = TroughsArr[zi]; if (start != "") { 
    flagList.Add(300 - Convert.ToInt32(start)); } if (end != "") { 
    flagList.Add(300 - Convert.ToInt32(end)); } } //处理数据 DealData(value1Name + "\\" + value1 + "," + value2Name + "\\" + value2 + "," + value3Name + "\\" + value3 + "," + value4Name + "\\" + value4 + "," + value5Name + "\\" + value5 + "," + value6Name + "\\" + value6 + "," + value7Name + "\\" + value7 + "," + value8Name + "\\" + value8 + "," + value9Name + "\\" + value9 + "," + value10Name + "\\" + value10 + ",Remark" + "\\" + value11 + ",episall\\" + episAll + ",resall\\" + result, machID, sampleNo, dealProcess); //取出图形串 string imgStr = result.Substring(830, 1200); List<Dto> dataList = new List<Dto>(); int maxY = 0; int max1Index = 0; int max1Data = 0; int max2Index = 0; int max2Data = 0; int max3Index = 0; int max3Data = 0; for (int i = 0; i < imgStr.Length && i < 1200; i += 4) { 
    int startIndex = i; int endIndex = i + 4; if (endIndex > imgStr.Length) { 
    endIndex = imgStr.Length; } Dto dto = new Dto(); dto.Type = imgStr.Substring(startIndex, 1); if (dto.Type == "4" || dto.Type == "C" || dto.Type == "1" || dto.Type == "5") { 
    continue; } else { 
    dto.Y = Convert.ToInt32(imgStr.Substring(startIndex + 1, endIndex - startIndex - 1), 16); } if (dto.Y > maxY) { 
    maxY = dto.Y; } if (i / 4 > 135 && i / 4 < 165) { 
    if (max1Data < dto.Y) { 
    max1Data = dto.Y; max1Index = i / 4; } } if (i / 4 > 170 && i / 4 < 195) { 
    if (max2Data < dto.Y) { 
    max2Data = dto.Y; max2Index = i / 4; } } if (i / 4 > 230 && i / 4 < 245) { 
    if (max3Data < dto.Y) { 
    max3Data = dto.Y; max3Index = i / 4; } } dataList.Add(dto); } int imgY = 580; //创建空位图 Image img = new Bitmap(680, imgY); //获得画图句柄 Graphics g = Graphics.FromImage(img); g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; g.Clear(Color.White); int x = 40; int y = 40; //画坐标 Pen pen = new Pen(Color.Black); pen.Width = 2; g.DrawLine(pen, 40, imgY - y, 640, imgY - y); for (int i = 0; i < 300; i += 15) { 
    g.DrawLine(pen, 40 + i * 2, imgY - y, 40 + i * 2, imgY - y - 4); Point p = new Point(40 + i * 2, imgY - y + 3); Font myFont = new Font("宋体", 8, FontStyle.Regular); Brush bush = new SolidBrush(Color.Black); g.DrawString(i.ToString(), myFont, bush, p); } int preY = -1; int curindex = 0; List<string> colorStr = new List<string>(); colorStr.Add("#F80000"); colorStr.Add("#1E90FF"); colorStr.Add("#FFA500"); colorStr.Add("#"); colorStr.Add("#FFC0CB"); colorStr.Add("#008000"); colorStr.Add("#FFFF00"); colorStr.Add("#DEB887"); int indexColor = 0; int drawX = -1; Pen pen1 = new Pen(Color.Black); pen1.Color = ColorTranslator.FromHtml(colorStr[indexColor]); //遍历点画图 foreach (var d in dataList) { 
    drawX++; if (indexColor < flagList.Count() && drawX == flagList[indexColor]) { 
    indexColor++; pen1.Color = ColorTranslator.FromHtml(colorStr[indexColor]); } if (preY == -1) { 
    pen = new Pen(Color.Black); pen.Width = 1; g.DrawLine(pen, x, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y, x, imgY - Convert.ToInt32(d.Y * (imgY - y - 25.0) / maxY) - y); } else { 
    pen = new Pen(Color.Black); pen.Width = 1; g.DrawLine(pen, x, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y, x - 1, preY - y); } //画竖线填充 g.DrawLine(pen1, x, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y, x, imgY - y); if (curindex == max1Index) { 
    if (value1Name != " ") { 
    Point p = new Point(x - 8, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y - 20); Font myFont = new Font("宋体", 12, FontStyle.Regular); Brush bush = new SolidBrush(Color.Black); } } if (curindex == max2Index) { 
    if (value2Name != " ") { 
    Point p = new Point(x - 8, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y - 20); Font myFont = new Font("宋体", 12, FontStyle.Regular); Brush bush = new SolidBrush(Color.Black); } } if (curindex == max3Index) { 
    if (value3Name != " ") { 
    Point p = new Point(x - 8, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y - 20); Font myFont = new Font("宋体", 12, FontStyle.Regular); Brush bush = new SolidBrush(Color.Black); } } preY = imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY); x += 2; curindex++; } img.Save(Application.StartupPath + "\\temp\\" + epis + ".bmp"); string ftpPath = ""; //得到ftp FtpService ftp = GetFtpHelper(machID, dealProcess, out ftpPath); //上传图片 ftp.Upload(Application.StartupPath + "\\temp\\" + epis + ".bmp"); System.IO.FileInfo fInfo = new System.IO.FileInfo(Application.StartupPath + "\\temp\\" + epis + ".bmp"); System.IO.File.Delete(Application.StartupPath + "\\temp\\" + epis + ".bmp"); //保存图片 SaveImg(machID, epis, epis, ftpPath.Split('^')[3] + fInfo.Name, dealProcess, episAll); return false; } catch (Exception ex) { 
    LIS.Core.Util.LogUtils.WriteExceptionLog("绘制Sebia电泳图发生错误", ex); return false; } } /// <summary> /// 内部数据实体 /// </summary> private class Dto { 
    /// <summary> /// 类型 /// </summary> public string Type { 
    get; set; } /// <summary> /// Y坐标 /// </summary> public int Y { 
    get; set; } } } } 

讯享网

固定电泳,有参考线,出多个图
在这里插入图片描述

在这里插入图片描述

绘图逻辑片段(数据以F开头)

讯享网using System; using System.Collections.Generic; using System.Linq; using System.Text; using PreDeal.Interface; using LIS.Model.Bussiness; using LIS.DAL.DataAccess; using PreDeal.Ftp; using PreDeal.Attributes; using System.Text.RegularExpressions; using System.Drawing; using System.Windows.Forms; using System.Drawing.Drawing2D; using System.IO; using System.Collections; namespace PreDeal { 
    ///<summary NoteObject="Class"> /// [功能描述:Sebia电泳仪的数据和图像处理 固定电泳] <para/> /// [创建者:zlz] <para/> /// [创建时间:] <para/> ///<说明> /// [说明:Sebia电泳仪的数据和图像处理处理,处理数据格式 ///F000-ELP 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A0000000000000000000000000000000A000C000E00B0023002C00067007C009800CB301FF022B022901F701AED00A3F002F00F000B00000000000000000009000A000B000C000E000F0001B000022001D000000A001C001F0002A002E00002D00020001D001B00011000F000D000C000B000A00009000A000B000B000E0002A00F0028001F00E000B000000C0000015001B0008800D6014E0060A073207A1071F05C2C007A002B000E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000|  ///F000-IgG 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A00000000000000000000000007C007E000B008E00097009A009D00A100A600AB00B200B900C200CD00DA00EB00FE0E0E01BF0E02CF202A9024B01ED019E0F0010D010B010B010C010D010E010F010F010F010E010D010C010A000FB00F600F000EA00E400DD00D600CE00C700C000B900B100AA00A3009D00B00D007A0006E006C006A00000A006C006F00B007F000081007F007F007F000081007E007C0006F006B00005E005C0004B00E003B00030002E002C002A000002B002D002F0004A00003D003A000B003E00D0056005F00A0009C00AA00BB00CF00E46016E019C01CE0C022B01FBD0068002F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001|  ///F000-IgA 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A000000000000000000000000000000A000A000A000B000D0001E00E004F000CF01A901F9022B0BFB00B0007C00025001A0012000C0000000000000000000A000C000D000F0001B001F0002A0001B000000B001E0002A002D000031002E002A0001E001C000E000D000D000C000B000B000B000C000C000D000E00B0023002B00F00013000F000C000A000009000B000F0000015001C0029003D005E009200E4204AF0B077906EDF0077002B000E0000000000000000000000000000000000000018001|  ///F000-IgM 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A00000000000000000000000000000009000C000E00B00046005A00BD00FB014C01A801FE023A024B022901DB0B9007C0054003B002B001F0015000F000A00000000000000000000A000C000D000F00A001E00001D000000019001C001F0002D000030002C00020001D001A0000F000D000C000B000A000A0000A000A000B000E00E0027002F00C0024001B00D000A00000B000F000F000D000E00F002E0047006F00AE011301AB028F03D69076C068F0F000ED005F0020000A000000000000000000000000000000000000000000000000000000000000000000000000000000000000001|  ///F000-K 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A0000000000000000000000000F000E000D000D000D000D000D000D000D000D000D000D000D000D000D000D000D000E000F00019001D0022002A00F0064007D009E00CB0AD01FF001E00C00CB0001A00D000C000C000B000B000B000B000B000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000D000D000E000F000F000A001F00A002B002B0001C00000019001C001E0002A002E0003A00033002F002C0001F001C001A000F000E000D000D000D000D000D000E000F0001F0026002D0002B0023001B00E000C000B000A0000A000C000E0001A00000B0011401AA028A03C5E076F069F052A0FB00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000|  ///F000-L 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A0000000000000000000000000802C002B002B002B002B002A002A002A002A002B002B002B002B002C002C002C002D002D002E00036003A003F0044004C0008700A000C000ED012B017C01DB0D0C023301D0016B011800DD00BB00A8009D000098009A009C009E009F00A0009F009E009C009A0008B00D00D00E005A00E004A0003F003D003B003A000000003A003C0004D00F004D004A00004B004E0000000051004D0003D003A0002E002C00000028002A002C00F0048004E00B0043003C0000A003C00F00E00B009600A400B500CC00E8010B0A01A801F0024302AA203B0037B0A3C0000000000000000000000000000000000018001|  ///F000-Ref 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A0000000000000000000000000800C000B000B000B000B000B000B000B000B000B000B000B000B000C000C000D000E000E000F000F00017001B001F0003A0048005D007E00AC00E9012D016E01A601CD01DF01D901BC018A014700FD00B7007D0054003A002A0000F000D000B0000000000000000000000000000000000000000000000C000F000000E000D000C000B000B000B000C000C000D000E000E00017001A001D0002D00002F002C000D001B000000017001A001E0002B002B0001B0000F000E000E000E000E000E00018001B001B001B001B001A00C0006A00A300FD0D047D005FDC11000B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000|  /// ]<para/> ///</说明> ///<修改记录> /// [修改时间:]<para/> /// [修改内容:]<para/> ///</修改记录> ///<修改记录> /// [修改时间:本次修改时间]<para/> /// [修改内容:本次修改内容]<para/> ///</修改记录> ///</summary> [Remark(Remark = "Sebia血清蛋白电泳仪的数据和图像处理处理带有ELP参照线。F000-ELP 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A0000000000000000000000000000000A000C000E00B0023002C00067007C009800CB301FF022B022901F701AED00A3F002F00F000B00000000000000000009000A000B000C000E000F0001B000022001D000000A001C001F0002A002E00002D00020001D001B00011000F000D000C000B000A00009000A000B000B000E0002A00F0028001F00E000B000000C0000015001B0008800D6014E0060A073207A1071F05C2C007A002B000E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000| \nF000-IgG 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A00000000000000000000000007C007E000B008E00097009A009D00A100A600AB00B200B900C200CD00DA00EB00FE0E0E01BF0E02CF202A9024B01ED019E0F0010D010B010B010C010D010E010F010F010F010E010D010C010A000FB00F600F000EA00E400DD00D600CE00C700C000B900B100AA00A3009D00B00D007A0006E006C006A00000A006C006F00B007F000081007F007F007F000081007E007C0006F006B00005E005C0004B00E003B00030002E002C002A000002B002D002F0004A00003D003A000B003E00D0056005F00A0009C00AA00BB00CF00E46016E019C01CE0C022B01FBD0068002F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001| \nF000-IgA 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A000000000000000000000000000000A000A000A000B000D0001E00E004F000CF01A901F9022B0BFB00B0007C00025001A0012000C0000000000000000000A000C000D000F0001B001F0002A0001B000000B001E0002A002D000031002E002A0001E001C000E000D000D000C000B000B000B000C000C000D000E00B0023002B00F00013000F000C000A000009000B000F0000015001C0029003D005E009200E4204AF0B077906EDF0077002B000E0000000000000000000000000000000000000018001| \nF000-IgM 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A00000000000000000000000000000009000C000E00B00046005A00BD00FB014C01A801FE023A024B022901DB0B9007C0054003B002B001F0015000F000A00000000000000000000A000C000D000F00A001E00001D000000019001C001F0002D000030002C00020001D001A0000F000D000C000B000A000A0000A000A000B000E00E0027002F00C0024001B00D000A00000B000F000F000D000E00F002E0047006F00AE011301AB028F03D69076C068F0F000ED005F0020000A000000000000000000000000000000000000000000000000000000000000000000000000000000000000001| \nF000-K 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A0000000000000000000000000F000E000D000D000D000D000D000D000D000D000D000D000D000D000D000D000D000E000F00019001D0022002A00F0064007D009E00CB0AD01FF001E00C00CB0001A00D000C000C000B000B000B000B000B000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000C000D000D000E000F000F000A001F00A002B002B0001C00000019001C001E0002A002E0003A00033002F002C0001F001C001A000F000E000D000D000D000D000D000E000F0001F0026002D0002B0023001B00E000C000B000A0000A000C000E0001A00000B0011401AA028A03C5E076F069F052A0FB00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000| \nF000-L 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A0000000000000000000000000802C002B002B002B002B002A002A002A002A002B002B002B002B002C002C002C002D002D002E00036003A003F0044004C0008700A000C000ED012B017C01DB0D0C023301D0016B011800DD00BB00A8009D000098009A009C009E009F00A0009F009E009C009A0008B00D00D00E005A00E004A0003F003D003B003A000000003A003C0004D00F004D004A00004B004E0000000051004D0003D003A0002E002C00000028002A002C00F0048004E00B0043003C0000A003C00F00E00B009600A400B500CC00E8010B0A01A801F0024302AA203B0037B0A3C0000000000000000000000000000000000018001| \nF000-Ref 000 00000g/dl TS ? 100.0000.0000.0000.0000.0000.0000.0000.0000.0000.000000000000000000000000000000000000000000000000000 000.0000.0000.0000.000000000000000000000001.0001.00 000300A0000000000000000000000000800C000B000B000B000B000B000B000B000B000B000B000B000B000C000C000D000E000E000F000F00017001B001F0003A0048005D007E00AC00E9012D016E01A601CD01DF01D901BC018A014700FD00B7007D0054003A002A0000F000D000B0000000000000000000000000000000000000000000000C000F000000E000D000C000B000B000B000C000C000D000E000E00017001A001D0002D00002F002C000D001B000000017001A001E0002B002B0001B0000F000E000E000E000E000E00018001B001B001B001B001A00C0006A00A300FD0D047D005FDC11000B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000| ")] public class DealSebiaELP : BaseDeal, IPreDeal, ITimer { 
    /// <summary> /// 图片数据 /// </summary> private static Dictionary<string, string> imgdata = new Dictionary<string, string>(); /// <summary> /// 前一个文件名称 /// </summary> private static string preFileName = ""; /// <summary> /// 前一个流水 /// </summary> private static string preEpis = ""; /// <summary> /// 参照数据索引 /// </summary> private static string refIndex = ""; /// <summary> /// 流水号 /// </summary> private static string epis = ""; /// <summary> /// 前处理 /// </summary> /// <param name="result">结果</param> /// <param name="machID">仪器ID</param> /// <param name="dealProcess">处理程序</param> /// <param name="index">当前文件的第几行</param> /// <param name="fileName">当前读取的文件全名</param> /// <returns></returns> public bool PreDeal(string result, string machID, string dealProcess, int index, string fileName) { 
    string head=result.Split(' ')[0]; string sampleNo = head.Substring(5, head.Length-5); string episAll = result.Split(' ')[0]; epis =sampleNo.Split('-')[0]; //记录参照数据位置 if(sampleNo.Contains("-ELP")) { 
    refIndex = sampleNo; } if ((preFileName != fileName)||(epis != preEpis)) { 
    imgdata.Clear(); } if(!imgdata.ContainsKey(sampleNo)) { 
    imgdata.Add(sampleNo, result); } preFileName = fileName; preEpis = epis; //累计到七个数据才画图 if (imgdata.Keys.Count == 6||index==-1) { 
    if(imgdata.Keys.Count == 1) { 
    refIndex = sampleNo; string fenStart = result.Substring(824, 4); string fenEnd = result.Substring(828, 4); } foreach (var key in imgdata.Keys) { 
    result = imgdata[key]; string value1Name = result.Substring(266, 10); string value1 = result.Substring(367, 5); string value2Name = result.Substring(276, 10); string value2 = result.Substring(372, 5); string value3Name = result.Substring(286, 10); string value3 = result.Substring(377, 5); string value4Name = result.Substring(296, 10); string value4 = result.Substring(382, 5); string value5Name = result.Substring(306, 10); string value5 = result.Substring(387, 5); string value6Name = result.Substring(316, 10); string value6 = result.Substring(392, 5); string value7Name = result.Substring(326, 10); string value7 = result.Substring(397, 5); string value8Name = result.Substring(336, 10); string value8 = result.Substring(402, 5); string value9Name = result.Substring(346, 10); string value9 = result.Substring(407, 5); string value10Name = result.Substring(356, 10); string value10 = result.Substring(412, 5); string value11 = result.Substring(557, 170).Trim(); //处理数据 DealData(value1Name + "\\" + value1 + "," + value2Name + "\\" + value2 + "," + value3Name + "\\" + value3 + "," + value4Name + "\\" + value4 + "," + value5Name + "\\" + value5 + "," + value6Name + "\\" + value6 + "," + value7Name + "\\" + value7 + "," + value8Name + "\\" + value8 + "," + value9Name + "\\" + value9 + "," + value10Name + "\\" + value10 + ",Remark" + "\\" + value11 + ",episall\\" + episAll + ",resall\\" + result, machID, sampleNo, dealProcess); //取出图形串 string imgStr = result.Substring(830, 1200); string imgStrRef = imgdata[refIndex].Substring(830, 1200); List<Dto> dataListRef = new List<Dto>(); List<Dto> dataList = new List<Dto>(); int maxY = 0; int max1Index = 0; int max1Data = 0; int max2Index = 0; int max2Data = 0; int max3Index = 0; int max3Data = 0; //分割点数据 for (int i = 0; i < imgStrRef.Length && i < 1200; i += 4) { 
    int startIndex = i; int endIndex = i + 4; if (endIndex > imgStrRef.Length) { 
    endIndex = imgStrRef.Length; } Dto dto = new Dto(); dto.Type = imgStrRef.Substring(startIndex, 1); if (dto.Type == "4" || dto.Type == "C" || dto.Type == "1" || dto.Type == "5") { 
    continue; } else { 
    dto.Y = Convert.ToInt32(imgStrRef.Substring(startIndex + 1, endIndex - startIndex - 1), 16); } if (dto.Y > maxY) { 
    maxY = dto.Y; } dataListRef.Add(dto); } for (int i = 0; i < imgStr.Length && i < 1200; i += 4) { 
    int startIndex = i; int endIndex = i + 4; if (endIndex > imgStr.Length) { 
    endIndex = imgStr.Length; } Dto dto = new Dto(); dto.Type = imgStr.Substring(startIndex, 1); if (dto.Type == "4" || dto.Type == "C" || dto.Type == "1" || dto.Type == "5") { 
    continue; } else { 
    dto.Y = Convert.ToInt32(imgStr.Substring(startIndex + 1, endIndex - startIndex - 1), 16); } if (dto.Y > maxY) { 
    maxY = dto.Y; } if (i / 4 > 135 && i / 4 < 165) { 
    if (max1Data < dto.Y) { 
    max1Data = dto.Y; max1Index = i / 4; } } if (i / 4 > 170 && i / 4 < 195) { 
    if (max2Data < dto.Y) { 
    max2Data = dto.Y; max2Index = i / 4; } } if (i / 4 > 230 && i / 4 < 245) { 
    if (max3Data < dto.Y) { 
    max3Data = dto.Y; max3Index = i / 4; } } dataList.Add(dto); } int imgY = 580; //创建空位图 Image img = new Bitmap(680, imgY); //获得画图句柄 Graphics g = Graphics.FromImage(img); g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; g.Clear(Color.White); int x = 40; int y = 40; //画坐标 Pen pen = new Pen(Color.Black); Pen penRef = new Pen(Color.Black); if (imgdata.Keys.Count == 6) { 
    penRef = new Pen(Color.Blue); } penRef.Width = 2; pen.Width = 2; g.DrawLine(pen, 40, imgY - y, 640, imgY - y); for (int i = 0; i < 300; i += 15) { 
    g.DrawLine(pen, 40 + i * 2, imgY - y, 40 + i * 2, imgY - y - 4); Point p = new Point(40 + i * 2, imgY - y + 3); Font myFont = new Font("宋体", 8, FontStyle.Regular); Brush bush = new SolidBrush(Color.Black); g.DrawString(i.ToString(), myFont, bush, p); } int preYRef = -1; int preY = -1; int curindex = 0; //遍历点画图 foreach (var d in dataList) { 
    if (preY == -1) { 
    pen = new Pen(Color.Black); pen.Width = 2; g.DrawLine(pen, x, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y, x, imgY - Convert.ToInt32(d.Y * (imgY - y - 25.0) / maxY) - y); g.DrawLine(penRef, x, imgY - Convert.ToInt32(dataListRef[curindex].Y * (imgY - y - 65.0) / maxY) - y, x, imgY - Convert.ToInt32(dataListRef[curindex].Y * (imgY - y - 25.0) / maxY) - y); } else { 
    pen = new Pen(Color.Black); pen.Width = 2; g.DrawLine(pen, x, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y, x - 2, preY - y); g.DrawLine(penRef, x, imgY - Convert.ToInt32(dataListRef[curindex].Y * (imgY - y - 65.0) / maxY) - y, x - 2, preYRef - y); } if (curindex == max1Index) { 
    if (value1Name != " ") { 
    Point p = new Point(x - 8, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y - 20); Font myFont = new Font("宋体", 12, FontStyle.Regular); Brush bush = new SolidBrush(Color.Black); } } if (curindex == max2Index) { 
    if (value2Name != " ") { 
    Point p = new Point(x - 8, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y - 20); Font myFont = new Font("宋体", 12, FontStyle.Regular); Brush bush = new SolidBrush(Color.Black); } } if (curindex == max3Index) { 
    if (value3Name != " ") { 
    Point p = new Point(x - 8, imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY) - y - 20); Font myFont = new Font("宋体", 12, FontStyle.Regular); Brush bush = new SolidBrush(Color.Black); } } preY = imgY - Convert.ToInt32(d.Y * (imgY - y - 65.0) / maxY); preYRef = imgY - Convert.ToInt32(dataListRef[curindex].Y * (imgY - y - 65.0) / maxY); x += 2; curindex++; } img.Save(Application.StartupPath + "\\temp\\" + key + ".bmp"); } } return false; } /// <summary> /// 内部数据实体 /// </summary> private class Dto { 
    /// <summary> /// 类型 /// </summary> public string Type { 
    get; set; } /// <summary> /// Y坐标 /// </summary> public int Y { 
    get; set; } } } } 

国内lis还是该反思一下无底线越界改最后自己也反受其害,像酶标仪厂商的控制软件要收费不想买要每个lis开发,有人开先例做了别的人都被迫只能做了。**下舔狗行为

哎

小讯
上一篇 2025-02-24 23:54
下一篇 2025-04-05 07:37

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/90235.html