Exemple #1
0
        //Using ToString instead of ToStringSimplified might be better when doing math operations
        public override string ToString()
        {
            string coef = "", var = "", pow = "";

            coef = Coef.ToString();
            pow  = "^" + Power.ToString();
            if (!VariableSymbol.Equals(DefaultVariableSymbol))
            {
                var = VariableSymbol.ToString();
            }
            return(string.Format("{0}{1}{2}", coef, var, pow));
        }
Exemple #2
0
 public bool SetAvrSetCoefDt()
 {
     if (audysseyMultEQAvrTcpClientWithTimeout != null)
     {
         // data for each speaker... this is a very dumb binary data pump... payload must be SECRET!
         foreach (Int32[] Coef in _audysseyMultEQAvr.CoefData)
         {
             // transmit packets in chunks of 512 bytes
             int total_byte_packets = (Coef.Length * 4) / 512;
             // the last packet may have less than 512 bytes
             int last_packet_length = Coef.Length - (total_byte_packets * 128);
             // count for all packets
             if (last_packet_length > 0)
             {
                 total_byte_packets++;
             }
             // transmit all the packets
             for (int current_packet = 0; current_packet < total_byte_packets; current_packet++)
             {
                 Int32[] CopyData = current_packet < total_byte_packets - 1 ? new int[128] : new int[last_packet_length];
                 Array.Copy(Coef, current_packet * 128, CopyData, 0, current_packet < total_byte_packets - 1 ? 128 : last_packet_length);
                 bool   CheckSumChecked = false;
                 string CmdString       = "SET_COEFDT";
                 Console.Write(CmdString);
                 Console.WriteLine(Coef.ToString());
                 // transmit request
                 audysseyMultEQAvrTcpClientWithTimeout.TransmitTcpAvrStream(CmdString, audysseyMultEQAvrTcpClientWithTimeout.Int32ToByte(CopyData), current_packet, total_byte_packets - 1);;
                 string AvrString;
                 // receive rseponse
                 audysseyMultEQAvrTcpClientWithTimeout.ReceiveTcpAvrStream(ref CmdString, out AvrString, out CheckSumChecked);
                 Console.Write(CmdString);
                 Console.WriteLine(AvrString);
                 // success if all succeed
                 if (false == (CmdString.Equals("SET_COEFDT") && AvrString.Equals(ACK) && CheckSumChecked))
                 {
                     return(false);
                 }
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #3
0
 public override string ToString()
 {
     return(NameWorker + " - коэффициент к оплате " + Coef.ToString());
 }