예제 #1
0
 private ParseMessage(LineType Type, Types.ErrorCode Code, string Message, string AlternativeFile, int AlternativeLineIndex)
 {
     this.Type                 = Type;
     this.Message              = Message;
     this.Code                 = Code;
     this.AlternativeFile      = AlternativeFile;
     this.AlternativeLineIndex = AlternativeLineIndex;
 }
예제 #2
0
        public ParseMessage AddError(int Line, Types.ErrorCode Code, string Text, int CharIndex, int Length)
        {
            ParseMessage errorMessage = new ParseMessage(ParseMessage.LineType.ERROR, Code, Text, CharIndex, Length);

            Messages.Add(Line, errorMessage);
            ++m_ErrorMessages;
            return(errorMessage);
        }
예제 #3
0
 public ParseMessage(LineType Type, Types.ErrorCode Code, string Message, int CharIndex, int Length)
 {
     this.Type      = Type;
     this.Message   = Message;
     this.Code      = Code;
     this.CharIndex = CharIndex;
     this.Length    = Length;
 }
예제 #4
0
        public ParseMessage AddError(int Line, Types.ErrorCode Code, string Text)
        {
            ParseMessage errorMessage = new ParseMessage(ParseMessage.LineType.ERROR, Code, Text, -1, 0);

            Messages.Add(Line, errorMessage);
            ++m_ErrorMessages;
            return(errorMessage);
        }
예제 #5
0
        public ParseMessage AddSevereWarning(int Line, Types.ErrorCode Code, string Text)
        {
            ParseMessage warningMessage = new ParseMessage(ParseMessage.LineType.SEVERE_WARNING, Code, Text);

            Messages.Add(Line, warningMessage);
            ++m_WarningMessages;
            return(warningMessage);
        }
예제 #6
0
        public ParseMessage AddWarning(int Line, Types.ErrorCode Code, string Text, int CharIndex, int Length)
        {
            ParseMessage warningMessage = new ParseMessage(ParseMessage.LineType.WARNING, Code, Text, CharIndex, Length);

            Messages.Add(Line, warningMessage);
            ++m_WarningMessages;
            return(warningMessage);
        }
예제 #7
0
 private ParseMessage(LineType Type, Types.ErrorCode Code, string Message, string AlternativeFile, int AlternativeLineIndex, int CharIndex, int Length)
 {
     this.Type                 = Type;
     this.Message              = Message;
     this.Code                 = Code;
     this.AlternativeFile      = AlternativeFile;
     this.AlternativeLineIndex = AlternativeLineIndex;
     this.CharIndex            = CharIndex;
     this.Length               = Length;
 }
예제 #8
0
        public ParseMessage AddSevereWarning(int Line, Types.ErrorCode Code, string Text)
        {
            if (m_CompileConfig.WarningsToTreatAsError.ContainsValue(Code))
            {
                return(AddError(Line, Code, Text));
            }

            ParseMessage warningMessage = new ParseMessage(ParseMessage.LineType.SEVERE_WARNING, Code, Text);

            Messages.Add(Line, warningMessage);
            ++m_WarningMessages;
            return(warningMessage);
        }
예제 #9
0
        public ParseMessage AddWarning(int Line, Types.ErrorCode Code, string Text, int CharIndex, int Length)
        {
            if (m_CompileConfig.WarningsToTreatAsError.ContainsValue(Code))
            {
                return(AddError(Line, Code, Text, CharIndex, Length));
            }

            ParseMessage warningMessage = new ParseMessage(ParseMessage.LineType.WARNING, Code, Text, CharIndex, Length);

            Messages.Add(Line, warningMessage);
            ++m_WarningMessages;
            return(warningMessage);
        }
예제 #10
0
        private async Task <BusTransceiveResult> TransceiveAsyncInternal(int address, BusRequest request, int responseSize, int attempts, bool sync)
        {
            BusResponse response = new BusResponse(responseSize);

            Types.ErrorCode transceiveStatus = Types.ErrorCode.TransportTransmissionError;

            while (attempts > 0)
            {
                (ErrorCode, byte[])result = sync ?
                                            BusAbstraction.Transceive(address, request.GetByteArray(), responseSize) :
                                            await BusAbstraction.TransceiveAsync(address, request.GetByteArray(), responseSize);

                transceiveStatus = result.Item1;
                byte[] receiveBuffer = result.Item2;

                response = new BusResponse(responseSize);
                response.Fill(receiveBuffer);

                switch (transceiveStatus)
                {
                case Types.ErrorCode.Success:
                    ++successfulTransmissions;
                    return(new BusTransceiveResult(Types.ErrorCode.Success, response));

                case Types.ErrorCode.TransportChecksumError:
                    ++checksumErrors;
                    break;

                case Types.ErrorCode.TransportReceptionNoAnswerError:
                    ++noAnswer;
                    break;

                case Types.ErrorCode.TransportReceptionMissingDataError:
                    ++missingData;
                    break;

                case Types.ErrorCode.TransportTransmissionError:
                    ++transmitErrors;
                    break;
                }

                attempts--;
            }

            return(new BusTransceiveResult(transceiveStatus, response));
        }
예제 #11
0
 public ParseMessage(LineType Type, Types.ErrorCode Code, string Message)
 {
     this.Type    = Type;
     this.Message = Message;
     this.Code    = Code;
 }