 1Content-type: application/x-Unknown; charset=UTF8package nmc.common;

import java.io.DataOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;

public class InitializeInstrumentCmd extends Command {

    public int channelNumber;
    
    public InitializeInstrumentCmd(DataInputStream dis) throws IOException {
    	this.decerealize(dis);
    }
    
    public InitializeInstrumentCmd(int channelNumber) {
    	this.seqNo = getNextCmdSeqNo();
    	this.len = 8;
    	this.channelNumber = channelNumber;
    }
    
    public int getMessageType() {
    	return INITIALIZE_INSTRUMENT_CMD;
    }
    
    public void cerealize(DataOutputStream s) throws IOException {
    	super.cerealize(s);
	s.writeInt(channelNumber);
    }

    public void decerealize(DataInputStream s) throws IOException {
    	super.decerealize(s);
    	channelNumber = s.readInt();
    }

    public String toString(){
	return "%<%msgType=InitializeInstrumentCmd%seqNo="
	       + this.seqNo
	       + "%len="
	       + this.len
	       + "%channelNumber="
	       + this.channelNumber
	       + "%>%";
    }

}
