Esempio n. 1
0
        private CATable GetResultTable(string tableName)
        {
            if (tableName.IsNullOrWhiteSpace())
            {
                const string message = "The tableName must not be null or whitespace";
                Logger.Error(message);
                throw new ArgumentException(message, nameof(tableName));
            }

            // todo how to check if table name exists in model?
            CAObject caObject = _caEngine.GetObjectByName(tableName);

            if (caObject == null)
            {
                const string message = "caObject is null : ";
                Logger.Error(message + tableName);
                throw new Exception(message);
            }

            CATable caTable = caObject.ResultTable();

            if (caTable == null)
            {
                const string message = "caTable is null";
                Logger.Error(message);
                throw new Exception(message);
            }

            return(caTable);
        }
Esempio n. 2
0
        protected CATable GetDefTable(string tableName)
        {
            if (tableName.IsNullOrWhiteSpace())
            {
                string message = $"The tableName must not be null or whitespace, tableName = {tableName}";
                throw new ArgumentException(message, nameof(tableName));
            }

            CAObject caObject = _caEngine.GetObjectByName(tableName);

            if (caObject == null)
            {
                string message = $"{tableName} CAObject is null";
                Logger.Error(message);
                throw new Exception(message);
            }

            CATable caTable = caObject.DefTable();

            if (caTable == null)
            {
                const string message = "CATable is null";
                Logger.Error(message);
                throw new Exception(message);
            }

            return(caTable);
        }
Esempio n. 3
0
        protected void SetDescription(string objectName, double value)
        {
            CAObject caObject = _caEngine.GetObjectByName(objectName);

            if (!caObject.SetAttribute("Definition", value))
            //{
            //    Logger.Info($"Updated setting {objectName} {value}");
            //}
            //else
            {
                Logger.Info($"SetDescription() failed: {objectName} {value}");
            }
        }