Beispiel #1
0
        bool SetTextForGui(ErrorDefine eDefine, string msgName)
        {
            if (eDefine != C_NO_ERROR)
            {
                // TODO - write log4net here
                _log.Error(msgName + " : " + errObject.GetNotification(errDefine));

                GenerateDBC.SetTextInfo("Info:" + msgName + " : " + errObject.GetNotification(errDefine));
                return(false);
            }
            return(true);
        }
Beispiel #2
0
        internal bool ValidateData()
        {
            //Log4net
            _log.Info("Validating data...");

            if (!isLoadingDataBefore)
            {
                MessageBox.Show("Please load data before", "Warning", MessageBoxButtons.OK);
                return(false);
            }
            // Clear text append before checking
            GenerateDBC.ClearTextInfo();

            bool flagError = true;

            foreach (Messages msg in canMatrix)
            {
                //check frame info
                errDefine  = CheckMessageInfo(msg);
                flagError &= SetTextForGui(errDefine, msg.MessageName);

                //check node of frame
                errDefine  = CheckListNodeInfo(msg.ListNode);
                flagError &= SetTextForGui(errDefine, msg.MessageName);

                if (flagError)
                {
                    //log4net
                    _log.Info(msg.MessageName + " is OK");
                }

                //Check signal
                foreach (Signal signal in msg.ListSignal)
                {
                    // signal info
                    errDefine  = CheckSignalInfo(signal);
                    flagError &= SetTextForGUI(errDefine, msg.MessageName, signal.SignalName);

                    //check node of signal
                    errDefine  = CheckListNodeInfo(signal.ListNode);
                    flagError &= SetTextForGUI(errDefine, msg.MessageName, signal.SignalName);

                    if (flagError)
                    {
                        //log4net
                        _log.Info("\t" + signal.SignalName + " is OK");
                    }
                }
            }

            return(flagError);
        }