LabelInfo.cs 3.9 KB
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TSA_V.DeviceLibrary
{
    public  class LabelInfo
    {
        //public string lblPos="位置:";
        //public string lblNum = "库存数量:";
        //public string lblPn = "物料编码:";
        //public string lblDes = "描述:";
        //public string lblNotes = "注意事项:";

        public LabelInfo() { }

        public LabelInfo(string pos, string num, string pn, string des, string notes, string ip, string mac, bool led)
        {
            this.pos = pos;
            this.num = num;
            this.pn = pn;
            this.des = des;
            this.notes = notes;
            this.ip = ip;
            this.mac = mac.Trim();
            this.openLed = led;
        }
        public string ip="";
        public string mac="";
        public string pos="";
        public string num = "";
        public string pn = "";
        public string des = "";
        public string notes = "";

        public bool openLed;

        public Dictionary<string,object> toMap()
        {

            //[{ "mac":"99.96.19.64","mappingtype":868,"styleid":47,"lblPos":"位置:","pos":"1_8","lblNum":"库位数量:","lblPn":"物料编码:","lblDes":"描述:","lblNotes":"注意事项:","num":"234","pn":"R218","des":"描述内容","notes":"注意事项内容","边框":"","边框1":"","边框2":"","边框3":"","边框4":"","边框5":"","边框6":"","边框7":"","边框8":"","边框9":"","ledrgb":"ff00","ledstate":"0","outtime":"0"}]

            Dictionary<string, object> map = new Dictionary<string, object>();
            map.Add("lblPos", ResourceControl.GetString("Label_lblPos", "位置:"));
            map.Add("lblNum", ResourceControl.GetString("Label_lblNum", "库存数量:"));
            map.Add("lblPn", ResourceControl.GetString("Label_lblPn", "物料编码:"));
            map.Add("lblDes", ResourceControl.GetString("Label_lblDes", "描述:"));
            map.Add("lblNotes", ResourceControl.GetString("Label_lblNotes", "注意事项:"));
            map.Add("pos", pos);
            map.Add("num", num);
            map.Add("pn", pn);
            map.Add("des", des);
            map.Add("notes", notes);
            map.Add("styleid", 47);
            //string ledrgb = openLed ? "ff00" : "0";
            map.Add("边框", "");
            map.Add("边框1", "");
            map.Add("边框2", "");
            map.Add("边框3", "");
            map.Add("边框4", "");
            map.Add("边框5", "");
            map.Add("边框6", "");
            map.Add("边框7", "");
            map.Add("边框8", "");
            map.Add("边框9", "");
            map.Add("mac", mac);
            return map;
        }
    //    {
    //    "mac":"99.96.19.64",
    //    "mappingtype":868,
    //    "styleid":47,
    //    "lblPos":"位置:",
    //    "pos":"1_8",
    //    "lblNum":"库位数量:",
    //    "lblPn":"物料编码:",
    //    "lblDes":"描述:",
    //    "lblNotes":"注意事项:",
    //    "num":"234",
    //    "pn":"R218",
    //    "des":"描述内容",
    //    "notes":"注意事项内容",
    //    "边框":"",
    //    "边框1":"",
    //    "边框2":"",
    //    "边框3":"",
    //    "边框4":"",
    //    "边框5":"",
    //    "边框6":"",
    //    "边框7":"",
    //    "边框8":"",
    //    "边框9":"",
    //    "ledrgb":"ff00",
    //    "ledstate":"0",
    //    "outtime":"0"
    //}
    //[{"mac":"99.96.19.64","mappingtype":868,"styleid":47,"lblPos":"位置:","pos":"1_8","lblNum":"库位数量:","lblPn":"物料编码:","lblDes":"描述:","lblNotes":"注意事项:","num":"234","pn":"R218","des":"描述内容","notes":"注意事项内容","边框":"","边框1":"","边框2":"","边框3":"","边框4":"","边框5":"","边框6":"","边框7":"","边框8":"","边框9":"","ledrgb":"ff00","ledstate":"0","outtime":"0"}]
}
     
}