//Object CurrentObject;

        public ObjectController(SLT.Model model)
        {
            //this.ID_Object_Counter = 0;
            //this.Initiator_Number_Counter = 0;
            this.ParentModel = model;
            this.Memory      = new Memory();
            this.IT          = new InitiatorsTable();
            this.GVT         = new GlobalVarsTable();
        }
Example #2
0
        void Rewrite_Initiators()
        {
            InitiatorsTable IT = this.Model.O_Cont.IT;

            this.Output.Initiators.Rows.Clear();
            foreach (Initiator init in IT.Initiators)
            {
                int number = init.Number;

                string name;
                string value;
                string type = "";

                SLT.Object obj = this.Model.O_Cont.GetObjectFromInitiator(init);
                name = obj.Name;
                object value_obj = obj.GetValue();
                try
                {
                    value_obj = Convert.ToDouble(value_obj);
                    value_obj = Math.Round((double)value_obj, this.Precision);
                }
                catch { }

                value = Convert.ToString(value_obj);
                switch (obj.Type)
                {
                case SLT.ObjectType.Scalar:
                    type = "Скаляр";
                    break;

                case SLT.ObjectType.Link:
                    type = "Ссылка";
                    break;

                case SLT.ObjectType.Vector:
                    type = "Вектор";
                    break;

                case SLT.ObjectType.Macro:
                    type = "Макрос";
                    break;
                }
                if (obj.Type == SLT.ObjectType.Vector)
                {
                    value = ((SLT.Vector)obj).GetTree();
                }
                this.Output.Initiators.Rows.Add(number, name, value, type);
                if (obj.Type == SLT.ObjectType.Vector)
                {
                    SLT.Vector        Vec          = (SLT.Vector)obj;
                    SLT.Vector        SubVector    = (SLT.Vector)Vec;
                    List <SLT.Object> vector_value = (List <SLT.Object>)(SubVector.GetValue());
                    Write_Vector_to_DataTable(this.Output.Initiators, vector_value);
                }
            }
        }