Ejemplo n.º 1
0
        private NXT(String uniqueID, NXTConnection nxtConn)
        {
            this.name = "Connecting...";
            this.nxtConn = nxtConn;
            this.uniqueID = uniqueID;
            connected = false;

            commandQueue = new BlockingCollection<NXTCommand>();
            commandExecuter = new BackgroundWorker();
            commandExecuter.DoWork += new DoWorkEventHandler(ExecuteNextCommand);
            commandExecuter.RunWorkerAsync();

            // Submit the request to get the device name
            NXTGetNameCommand getName = new NXTGetNameCommand(nxtConn);
            getName.ReceivedData += new NXTCommand.NXTReceivedDataHandler(getName_ReceivedData);
            commandQueue.Add(getName);
        }
Ejemplo n.º 2
0
        private NXT(String uniqueID, NXTConnection nxtConn)
        {
            this.name     = "Connecting...";
            this.nxtConn  = nxtConn;
            this.uniqueID = uniqueID;
            connected     = false;

            commandQueue            = new BlockingCollection <NXTCommand>();
            commandExecuter         = new BackgroundWorker();
            commandExecuter.DoWork += new DoWorkEventHandler(ExecuteNextCommand);
            commandExecuter.RunWorkerAsync();

            // Submit the request to get the device name
            NXTGetNameCommand getName = new NXTGetNameCommand(nxtConn);

            getName.ReceivedData += new NXTCommand.NXTReceivedDataHandler(getName_ReceivedData);
            commandQueue.Add(getName);
        }
 public NXTWriteFileCommand(NXTConnection nxtConn, String filename, byte[] file)
     : base(nxtConn)
 {
     this.filename = filename;
     this.file = file;
 }
 public PlaySoundCommand(NXTConnection nxtConn, int duration, int tone) : base(nxtConn)
 {
     this.duration = BitConverter.GetBytes(duration);
     this.tone     = BitConverter.GetBytes(tone);
 }
Ejemplo n.º 5
0
 public NXTCommand(NXTConnection nxtConn)
 {
     this.nxtConn = nxtConn;
 }
 public NXTRunProgramCommand(NXTConnection nxtConn, String filename)
     : base(nxtConn)
 {
     this.filename = filename;
 }
 public NXTSetNameCommand(NXTConnection nxtConn, String newName)
     : base(nxtConn)
 {
     this.newName = newName;
 }
 public NXTGetNameCommand(NXTConnection nxtConn)
     : base(nxtConn)
 {
 }
Ejemplo n.º 9
0
 public NXTWriteFileCommand(NXTConnection nxtConn, String filename, byte[] file)
     : base(nxtConn)
 {
     this.filename = filename;
     this.file     = file;
 }
 public NXTStopProgramCommand(NXTConnection nxtConn) : base(nxtConn)
 {
 }
 public NXTStopProgramCommand(NXTConnection nxtConn)
     : base(nxtConn)
 {
 }
Ejemplo n.º 12
0
 public NXTSetNameCommand(NXTConnection nxtConn, String newName)
     : base(nxtConn)
 {
     this.newName = newName;
 }
Ejemplo n.º 13
0
 public NXTCommand(NXTConnection nxtConn)
 {
     this.nxtConn = nxtConn;
 }
Ejemplo n.º 14
0
 public NXTGetNameCommand(NXTConnection nxtConn) : base(nxtConn)
 {
 }
 public PlaySoundCommand(NXTConnection nxtConn, int duration, int tone)
     : base(nxtConn)
 {
     this.duration = BitConverter.GetBytes(duration);
     this.tone = BitConverter.GetBytes(tone);
 }