Ejemplo n.º 1
0
 public CommandValuesMessage(MipsCommand command, string value1, string value2, int value3, int value4, int value5) : base(command)
 {
     this.command = command;
     this.value1  = Encoding.ASCII.GetBytes(value1.ToString());
     this.value2  = Encoding.ASCII.GetBytes(value2.ToString());
     this.value3  = Encoding.ASCII.GetBytes(value3.ToString());
     this.value4  = Encoding.ASCII.GetBytes(value4.ToString());
     this.value5  = Encoding.ASCII.GetBytes(value5.ToString());
 }
Ejemplo n.º 2
0
        public CommandValueValueMessage(MipsCommand command, string value1, BitArray value2) : base(command)
        {
            StringBuilder sb = new StringBuilder();

            foreach (var b in value2)
            {
                sb.Append((bool)b ? "1" : "0");
            }
            this.value1 = Encoding.ASCII.GetBytes(value1.ToString());
            this.value2 = Encoding.ASCII.GetBytes(sb.ToString());
        }
Ejemplo n.º 3
0
        public CommandEnumerableValueValueMessage(MipsCommand command, string value1, IEnumerable <int> values) : base(command)
        {
            bytevalue = new byte[values.Count()][];
            int i = 0;

            this.value1 = Encoding.ASCII.GetBytes(value1.ToString());
            foreach (var value in values)
            {
                bytevalue[i] = Encoding.ASCII.GetBytes(value.ToString());
                i++;
            }
        }
Ejemplo n.º 4
0
        public CommandEnumerableMessage(MipsCommand command, IEnumerable <double> values) : base(command)
        {
            bytevalue = new byte[values.Count()][];
            int i = 0;

            foreach (var value in values)
            {
                byte[] result = Encoding.ASCII.GetBytes(value.ToString());
                bytevalue[i] = result;
                i++;
            }
        }
Ejemplo n.º 5
0
        public CommandValueEnumerableMessage(MipsCommand command, string value, IEnumerable <int> values) : base(command)
        {
            bytevalue = new byte[values.Count()][];
            int i = 0;

            this.value = Encoding.ASCII.GetBytes(value);
            foreach (var val in values)
            {
                byte[] result = Encoding.ASCII.GetBytes(val.ToString());
                bytevalue[i] = result;
                i++;
            }
        }
Ejemplo n.º 6
0
        public void WriteHeader(MipsCommand command)
        {
            var commandBytes = MipsCommandMap.Default.GetBytes(command);

            if (commandBytes == null)
            {
                throw new NotImplementedException();
            }

            foreach (var commandByte in commandBytes)
            {
                port.WriteByte(commandByte);
            }
        }
Ejemplo n.º 7
0
        public void WriteHeader(MipsCommand command)
        {
            var commandBytes = MipsCommandMap.Default.GetBytes(command);

            if (commandBytes == null)
            {
                throw new NotImplementedException();
            }
            lock (sync)
            {
                foreach (var commandByte in commandBytes)
                {
                    serialPort.BaseStream.WriteByte(commandByte);
                }
            }
            System.Diagnostics.Debug.Write(Encoding.UTF8.GetString(commandBytes));
        }
Ejemplo n.º 8
0
 public CommandValueValueValueMessage(MipsCommand command, string value1, string value2, int value3) : base(command)
 {
     this.value1 = Encoding.ASCII.GetBytes(value1.ToString());
     this.value2 = Encoding.ASCII.GetBytes(value2.ToString());
     this.value3 = Encoding.ASCII.GetBytes(value3.ToString());
 }
Ejemplo n.º 9
0
 public static MipsMessage Create(MipsCommand command, CompressionTable compressionTable)
 {
     return(new CommandCompressionTableMessage(command, compressionTable));
 }
Ejemplo n.º 10
0
 public static MipsMessage Create(MipsCommand command, string value1, IEnumerable <int> values)
 {
     return(new CommandEnumerableValueValueMessage(command, value1, values));
 }
Ejemplo n.º 11
0
 public static MipsMessage Create(MipsCommand command, int value, IEnumerable <int> values)
 {
     return(new CommandValueEnumerableMessage(command, value, values));
 }
Ejemplo n.º 12
0
 public CommandValueValueMessage(MipsCommand command, double value1, double value2) : base(command)
 {
     this.value1 = Encoding.ASCII.GetBytes(value1.ToString());
     this.value2 = Encoding.ASCII.GetBytes(value2.ToString());
 }
Ejemplo n.º 13
0
 public static MipsMessage Create(MipsCommand command, double value1, double value2)
 {
     return(new CommandValueValueMessage(command, value1, value2));
 }
Ejemplo n.º 14
0
 public void IsAvailable(MipsCommand command)
 {
     //return map[(int)command] != null;
 }
Ejemplo n.º 15
0
 internal byte[] GetBytes(MipsCommand command)
 {
     return(map[(int)command]);
 }
Ejemplo n.º 16
0
 public CommandCompressionTableMessage(MipsCommand command, CompressionTable compressionTable) : base(command)
 {
     this.value = Encoding.ASCII.GetBytes(compressionTable.RetrieveTableAsEncodedString());
 }
Ejemplo n.º 17
0
 public CommandBase(MipsCommand command) : base(command)
 {
 }
Ejemplo n.º 18
0
 public CommandMessage(MipsCommand command) : base(command)
 {
 }
Ejemplo n.º 19
0
 public static MipsMessage Create(MipsCommand command, int value1, int value2, string value3)
 {
     return(new CommandValueValueValueMessage(command, value1, value2, value3));
 }
Ejemplo n.º 20
0
 public static MipsMessage Create(MipsCommand command, string value1, string value2, int value3, int value4, int value5)
 {
     return(new CommandValuesMessage(command, value1, value2, value3, value4, value5));
 }
Ejemplo n.º 21
0
 public MipsMessage(MipsCommand command)
 {
     this.command     = command;
     createdDateTime  = DateTime.UtcNow;
     createdTimestamp = System.Diagnostics.Stopwatch.GetTimestamp();
 }
Ejemplo n.º 22
0
 public CommandSignalTableMessage(MipsCommand command, MipsSignalTable signalTable) : base(command)
 {
     this.value = Encoding.ASCII.GetBytes(value.ToString());
 }
Ejemplo n.º 23
0
 public CommandSignalTableMessage(MipsCommand command, MipsSignalTable signalTable) : base(command)
 {
     this.value = Encoding.ASCII.GetBytes(signalTable.RetrieveTableAsEncodedString());
 }
Ejemplo n.º 24
0
 public static MipsMessage Create(MipsCommand command, bool value)
 {
     return(new CommandValueMessage(command, value));
 }
Ejemplo n.º 25
0
 public CommandValueMessage(MipsCommand command, string value) : base(command)
 {
     this.value = Encoding.ASCII.GetBytes(value.ToString());
 }
Ejemplo n.º 26
0
 public static MipsMessage Create(MipsCommand command, string value1, BitArray value2)
 {
     return(new CommandValueValueMessage(command, value1, value2));
 }
Ejemplo n.º 27
0
 public static MipsMessage Create(MipsCommand command, MipsSignalTable signalTable)
 {
     return(new CommandSignalTableMessage(command, signalTable));
 }
Ejemplo n.º 28
0
        // public virtual string CommandAndKey => Command.ToString();

        public static MipsMessage Create(MipsCommand command)
        {
            return(new CommandMessage(command));
        }
Ejemplo n.º 29
0
 public static MipsMessage Create(MipsCommand command, IEnumerable <double> values)
 {
     return(new CommandEnumerableMessage(command, values));
 }