// 假设 IEntity 接口定义如下
interface IEntity {
    ChangeToTable(): string[];
    ChangeFromTable(parms: any[]): void;
}

export class THotKeyMessage implements IEntity {
    public Tellernum: string;
    public KeyName: string;
    public KeyDes: string;
    public KeyState: number;
    public KeyValue: string;
    public KeyType: number;
    public KeyIndex: number;

    constructor() {
        this.Tellernum = '';
        this.KeyName = '';
        this.KeyDes = '';
        this.KeyState = 0;
        this.KeyValue = '';
        this.KeyType = 0;
        this.KeyIndex = 0;
    }

    public ChangeToTable(): string[] {
        return [
            this.Tellernum,
            this.KeyName,
            this.KeyDes,
            this.KeyState.toString(),
            this.KeyValue,
            this.KeyType.toString(),
            this.KeyIndex.toString()
        ];
    }

    public ChangeFromTable(parms: any[]): void {
        this.Tellernum = parms[0].toString();
        this.KeyName = parms[1].toString();
        this.KeyDes = parms[2].toString();
        this.KeyState = parseInt(parms[3].toString(), 10);
        this.KeyValue = parms[4].toString();
        this.KeyType = parseInt(parms[5].toString(), 10);
        this.KeyIndex = parseInt(parms[6].toString(), 10);
    }
}