You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.Data.Common;
using Mesnac.Equips;
using Mesnac.Maths;
namespace Mesnac.Math.Feeding
{
public class RecipeName : IMath
{
private object NullResult = new DataTable();
public string Name
{
get { return "配方名称"; }
}
public string Caption
{
get
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("将读取的信息转化为文本");
sb.AppendLine("例:");
sb.Append(" ").Append(Name).AppendLine("()");
return sb.ToString();
}
}
public object Execute(string[] parameters, object[] buff)
{
byte[] chars = new byte[buff.Length * 2];
for (int i = 0; i < buff.Length; i++)
{
//chars[i * 2] = (byte)((int)buff[i] / 0xFF);
//chars[i * 2 + 1] = (byte)((int)buff[i] % 0xFF);
chars[i * 2 + 1] = (byte)((int)buff[i] / 0x100);
chars[i * 2] = (byte)((int)buff[i] % 0x100);
}
string Result = string.Empty;
Result = System.Text.Encoding.Default.GetString(chars);
Result = Result.Replace("\0", string.Empty);
return Result.Trim();
}
}
}