Ejemplo n.º 1
0
        public static bool IsSheetMetal(IPart7 Part, out bool NoSheetMetal)
        //проверка на листовой материал
        {
            bool isOpen;

            NoSheetMetal = false;
            ISheetMetalContainer _ISheetMetalContainer = (ISheetMetalContainer)Part;

            if (_ISheetMetalContainer != null)
            {
                ISheetMetalBodies _ISheetMetalBodies = _ISheetMetalContainer.SheetMetalBodies;
                if (_ISheetMetalBodies != null)
                {
                    if (_ISheetMetalBodies.Count > 0)
                    {
                        return(true);
                    }
                    else
                    {
                        VariableTable _VariableTable = Part.VariableTable;
                        if (_VariableTable != null)
                        {
                            if (isVaribale(Part, true))
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
            return(false);
        }
Ejemplo n.º 2
0
        private void OnCreateCharacterClicked(object sender, RoutedEventArgs e)
        {
            var gameConn = m_OnlineClient.GetConnection(OnlineClient.ConnectionType.Game);

            if (gameConn == null)
            {
                return;
            }

            var gamePolicy = new SF.Net.SendMessageGame(gameConn);
            var charName   = string.Format("testchar{0}{1}", txtLoginName.Text, m_Rand.Next() % 100);

            var visualConfig = new VariableTable();

            visualConfig.Add(new StringCrc32("sex"), 1);
            visualConfig.Add(new StringCrc32("hat"), 10);
            visualConfig.Add(new StringCrc32("shoes"), 10);

            var attributes = new VariableTable();

            attributes.Add(new StringCrc32("Gold"), 100);
            attributes.Add(new StringCrc32("Agile"), 10);
            attributes.Add(new StringCrc32("Strength"), 20);
            attributes.Add(new StringCrc32("Integer"), 30);
            gamePolicy.CreateCharacterCmd(0, charName, visualConfig, attributes);
        }
Ejemplo n.º 3
0
        public ArithmeticStateMachine(VariableTable variables, FileManager fileManager)
        {
            CurrentState = ArithmeticMachineState.START;
            transitions  = new Dictionary <ArithmeticStateTransition, ArithmeticMachineState>
            {
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.END), ArithmeticMachineState.START },
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.INT), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.VAR), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.ARRAY), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.PLUS), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.MINUS), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.MULT), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.DIV), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.POWER), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.START, TokenType.OPENING_BRACES), ArithmeticMachineState.EXP },

                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.INT), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.VAR), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.ARRAY), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.PLUS), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.MINUS), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.MULT), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.DIV), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.POWER), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.OPENING_BRACES), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.CLOSING_BRACES), ArithmeticMachineState.EXP },
                { new ArithmeticStateTransition(ArithmeticMachineState.EXP, TokenType.END), ArithmeticMachineState.START },
            };

            this.variables = variables;
            this.command   = new ArithmeticCommand(variables, fileManager);
        }
Ejemplo n.º 4
0
 public BaseRender(GameObject instance)
 {
     viewGameObject = instance;
     nameTable      = viewGameObject.GetComponent <NameTable>();
     eventTable     = viewGameObject.GetComponent <EventTable>();
     variableTable  = viewGameObject.GetComponent <VariableTable>();
     __init();
 }
Ejemplo n.º 5
0
 public ArithmeticCommand(VariableTable variables, FileManager fileManager)
 {
     this.variables   = variables;
     this.fileManager = fileManager;
     this.operatorS   = new Stack();
     this.rpn         = new Stack();
     this.outputQ     = new Queue();
 }
Ejemplo n.º 6
0
 private void btnSaveAsCsv_Click(object sender, EventArgs e)
 {
     saveFileDialog1.FileName = txtVariableName.Text + ".csv";
     if (saveFileDialog1.ShowDialog() == DialogResult.OK)
     {
         VariableTable v = (VariableTable)VariableToEdit;
         File.WriteAllText(saveFileDialog1.FileName, v.ToString());
     }
 }
Ejemplo n.º 7
0
    public virtual void PrefabLoadCallBack(GameObject go)
    {
        viewGameobject = go;
        eventTable     = viewGameobject.GetComponent <EventTable>();
        variableTable  = viewGameobject.GetComponent <VariableTable>();
        nameTable      = viewGameobject.GetComponent <NameTable>();;

        LoadCallBack();
        GlobalTimeRequest.AddDelayTime(0.02f, OpenCallBack);
    }
Ejemplo n.º 8
0
        /**
         *
         */
        public LogFormatDataEntry(VariableTable vtable, String[] variables)
        {
            // Create a command object for this entry object.
            SQLiteConnection conn = vtable.Connection;

            this.command_ = conn.CreateCommand();

            // Prepare an insert command.
            this.prepare_insert_command(variables);
        }
Ejemplo n.º 9
0
        public override bool ResolveObject(VariableTable varTable)
        {
            base.ResolveObject(varTable);

            if (_valid && !(State.Type.ValueSpace is NumberSpace))
            {
                setInvalid();
            }

            return(_valid);
        }
Ejemplo n.º 10
0
 private object RValue(VariableTable table)
 {
     if (_control.ValueType == Conds.Condition.ValueType.Var)
     {
         return(table[_control.Value.ToString()].Value);
     }
     else
     {
         return(_control.Value);
     }
 }
Ejemplo n.º 11
0
 public string GetValue(VariableTable table)
 {
     if (comboBox1.SelectedIndex == 0)
     {
         return(textBox1.Text);
     }
     else
     {
         return(table.Contains(textBox1.Text) ? table[textBox1.Text].Value.ToString() : null);
     }
 }
Ejemplo n.º 12
0
    public virtual void PrefabLoadCallBack(GameObject go)
    {
        viewGameobject = go;
        eventTable     = viewGameobject.GetComponent <EventTable>();
        variableTable  = viewGameobject.GetComponent <VariableTable>();
        nameTable      = viewGameobject.GetComponent <NameTable>();;

        __init();
        LoadCallBack();
        OpenCallBack();
    }
Ejemplo n.º 13
0
 public void SetTableVariable(string name, VariableTable val)
 {
     if (val == null)
     {
         return;
     }
     lock (tablevariables)
     {
         tablevariables[name] = val;
     }
 }
Ejemplo n.º 14
0
        public bool ResolveObject(VariableTable varTable)
        {
            _list     = varTable.GetListGroup(_listName);
            _resolved = (_list != null);

            if (_resolved)
            {
                _window = new IndexedDataWindow(_list.DataWindow);
                changeIndexWindow(_formula);
            }

            return(_resolved);
        }
Ejemplo n.º 15
0
        static void Main(string[] args)
        {
            var main_code_text = File.ReadAllText(args[2]);

            //Console.WriteLine(main_code_text.GetHashCode());
            Console.WriteLine("-------------------------------------------------");
            Console.WriteLine("Сode received in the Gonozov's language: ");
            Console.WriteLine("- - - - - - - - - - - - - - - - - - - - - - - - -");
            Console.WriteLine(main_code_text);
            Console.WriteLine("-------------------------------------------------");

            VariableTable <Function> globalFuncTable = new VariableTable <Function>();

            PrecedenceBasedRegexTokenizer tokenizer = new PrecedenceBasedRegexTokenizer();
            PrecedenceBasedRPNParser      parser    = new PrecedenceBasedRPNParser(ref globalFuncTable);
            TriadsOptimizer triadsOptimizer         = new TriadsOptimizer();
            StackMachine    stackMachine            = new StackMachine(globalFuncTable);


            var tokenSeqence = tokenizer.Tokenize(main_code_text).ToList();

            foreach (var token in tokenSeqence)
            {
                Console.Write(token.ToString() + " , ");
            }
            Console.WriteLine("\n-------------------------------------------------");

            var parseSequence = parser.Parse(tokenSeqence);

            foreach (var result in parseSequence)
            {
                Console.Write(result.ToString() + " , ");
            }
            Console.WriteLine("\n-------------------------------------------------");

            globalFuncTable.Print();

            //parseSequence = triadsOptimizer.Optimize(parseSequence);

            //Console.WriteLine("\n-------------------------------------------------");

            //foreach (var result in parseSequence)
            //{
            //    Console.Write(result.ToString() + " , ");
            //}

            //Console.WriteLine("\n-------------------------------------------------");

            stackMachine.Execute(parseSequence);
        }
Ejemplo n.º 16
0
 public override void Execute(VariableTable table)
 {
     base.Execute(table);
     if (string.IsNullOrEmpty(Name))
     {
         throw new VariableException("변수가 비어있습니다.");
     }
     if (!table.Contains(Name))
     {
         throw new VariableException("변수가 정의되어 있지 않습니다.");
     }
     table[Name].Value = Delegate(table[Name].Value, RValue(table));
     Next = _linked[0];
 }
Ejemplo n.º 17
0
 public override void Execute(VariableTable table)
 {
     base.Execute(table);
     if (Variable == null)
     {
         throw new VariableException("변수가 비어있습니다.");
     }
     if (table.Contains(Variable))
     {
         throw new VariableException("이미 같은 이름의 변수가 정의되어 있습니다.");
     }
     table.Add(Variable);
     Next = _linked[0];
 }
Ejemplo n.º 18
0
        public virtual bool ResolveObject(VariableTable varTable)
        {
            ApplianceState state = (ApplianceState)varTable[_stateName];

            _valid = (state != null);

            if (_valid)
            {
                state.ValueChangedEvent += new PUC.ApplianceState.ValueChangedHandler(this.StateValueChanged);
                _state = new ValueDataWindow(state);
            }

            return(_valid);
        }
Ejemplo n.º 19
0
        void HandleGetCharacterListRes(SFMessage message)
        {
            UpdateButtonState();

            var result = message.GetValue <Result>("Result");

            if (result.IsFailed)
            {
                return;
            }

            var characters   = message.GetValue <VariableTable[]>("Characters");
            var numCharacter = characters.Length;

            listCharacter.BeginInit();
            listCharacter.Items.Clear();

            for (int iChar = 0; iChar < numCharacter; iChar++)
            {
                object obj;
                UInt64 characterId     = 0;
                string characterName   = null;
                byte[] characterVisual = null;

                if (characters[iChar].TryGetValue(new StringCrc32("CharacterId"), out obj))
                {
                    characterId = (UInt64)Convert.ChangeType(obj, typeof(UInt64));
                }
                if (characters[iChar].TryGetValue(new StringCrc32("Name"), out obj))
                {
                    characterName = (string)Convert.ChangeType(obj, typeof(string));
                }
                if (characters[iChar].TryGetValue(new StringCrc32("VisualData"), out obj))
                {
                    characterVisual = (byte[])obj;
                }
                VariableTable parsedValue = new VariableTable();
                parsedValue.FromSerializedMemory(characterVisual);

                listCharacter.Items.Add(new CharacterItem()
                {
                    CharacterId   = (uint)characterId,
                    CharacterName = characterName,
                    VisualData    = parsedValue
                });
            }

            listCharacter.EndInit();
        }
Ejemplo n.º 20
0
        private void AddTableVariable(VariableStore vs, DataGridView dgv)
        {
            VariableTable v       = new VariableTable();
            string        varname = "";

            v = (VariableTable)OpenVariableEditor(v, ref varname, true);
            if (v != null)
            {
                lock (vs.Table)
                {
                    vs.Table[varname] = v;
                }
                RefreshTableVariables(vs, dgv);
            }
        }
Ejemplo n.º 21
0
        private void btnTableAdd_Click(object sender, EventArgs e)
        {
            VariableTable v       = new VariableTable();
            string        varname = "";

            v = (VariableTable)OpenVariableEditor(v, ref varname, true);
            if (v != null)
            {
                lock (plug.tablevariables)
                {
                    plug.tablevariables[varname] = v;
                }
                RefreshTableVariables();
            }
        }
        public DimStateMachine(VariableTable variables, FileManager fileManager)
        {
            CurrentState = DimMachineState.START;
            transitions  = new Dictionary <DimStateTransition, DimMachineState>
            {
                { new DimStateTransition(DimMachineState.START, TokenType.END), DimMachineState.START },
                { new DimStateTransition(DimMachineState.START, TokenType.DIM), DimMachineState.DIM },

                { new DimStateTransition(DimMachineState.DIM, TokenType.ARRAY), DimMachineState.ARRAY },

                { new DimStateTransition(DimMachineState.ARRAY, TokenType.END), DimMachineState.START }
            };
            this.variables = variables;
            this.command   = new DimCommand(variables, fileManager);
        }
Ejemplo n.º 23
0
        protected void refreshListData(VariableTable varTable, int start, int length)
        {
            Hashtable data = (Hashtable)varTable.GetListStructure(_listGroup.FullPath);

            IEnumerator e = _states.GetEnumerator();

            e.MoveNext();
            refreshStateData((ApplianceState)e.Current, data, start, length, true);

            // process the rest of the states
            while (e.MoveNext())
            {
                refreshStateData((ApplianceState)e.Current, data, start, length, false);
            }
        }
        public void Visit(CteInnerExpressionNode node)
        {
            var set = Nodes.Pop();

            var collector = new GetSelectFieldsVisitor();
            var traverser = new GetSelectFieldsTraverseVisitor(collector);

            set.Accept(traverser);

            var table = new VariableTable(collector.CollectedFieldNames);

            _currentScope.Parent.ScopeSymbolTable.AddSymbol(node.Name,
                                                            new TableSymbol(node.Name, new TransitionSchema(node.Name, table), table, false));

            Nodes.Push(new CteInnerExpressionNode(set, node.Name));
        }
        public GoSubStateMachine(VariableTable variables, FileManager fileManager)
        {
            CurrentState = GoSubMachineState.START;
            transitions  = new Dictionary <GoSubStateTransition, GoSubMachineState>
            {
                { new GoSubStateTransition(GoSubMachineState.START, TokenType.END), GoSubMachineState.START },
                { new GoSubStateTransition(GoSubMachineState.START, TokenType.GOSUB), GoSubMachineState.GOSUB },

                { new GoSubStateTransition(GoSubMachineState.GOSUB, TokenType.INT), GoSubMachineState.LABEL },

                { new GoSubStateTransition(GoSubMachineState.LABEL, TokenType.END), GoSubMachineState.START }
            };

            this.variables = variables;
            this.command   = new GoSubCommand(variables, fileManager);
        }
Ejemplo n.º 26
0
        public Boolean IsTrue(VariableTable history)
        {
            if (Nothing == this)
            {
                return(true);
            }

            if (history.Keys.Contains(Variable))
            {
                return(Evaluate(history[Variable]));
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 27
0
        public NextStateMachine(VariableTable variables, FileManager fileManager)
        {
            CurrentState = NextMachineState.START;
            transitions  = new Dictionary <NextStateTransition, NextMachineState>
            {
                { new NextStateTransition(NextMachineState.START, TokenType.END), NextMachineState.START },
                { new NextStateTransition(NextMachineState.START, TokenType.NEXT), NextMachineState.NEXT },

                { new NextStateTransition(NextMachineState.NEXT, TokenType.VAR), NextMachineState.VAR },
                { new NextStateTransition(NextMachineState.NEXT, TokenType.ARRAY), NextMachineState.VAR },

                { new NextStateTransition(NextMachineState.VAR, TokenType.END), NextMachineState.START },
            };
            this.variables = variables;
            this.command   = new NextCommand(variables, fileManager);
        }
Ejemplo n.º 28
0
        public void Setup()
        {
            varTable     = new VariableTable();
            varTable[tn] = t;
            varTable[fn] = f;

            varTable[minusOneIntn] = minusOneInt;
            varTable[zeroIntn]     = zeroInt;
            varTable[oneIntn]      = oneInt;
            varTable[twoIntn]      = twoInt;

            varTable[minusOneFloatn] = minusOneFloat;
            varTable[zeroFloatn]     = zeroFloat;
            varTable[halfFloatn]     = halfFloat;
            varTable[oneFloatn]      = oneFloat;
            varTable[oneHalfFloatn]  = oneHalfFloat;
        }
Ejemplo n.º 29
0
 public VariableTable GetTableVariable(string name, bool createNew = false)
 {
     lock (tablevariables)
     {
         if (tablevariables.ContainsKey(name) == true)
         {
             return(tablevariables[name]);
         }
         if (createNew == false)
         {
             return(null);
         }
         VariableTable v = new VariableTable();
         tablevariables[name] = v;
         return(v);
     }
 }
Ejemplo n.º 30
0
        public override void Execute(VariableTable table)
        {
            base.Execute(table);
            if (Condition == null)
            {
                throw new ArgumentNullException("Condition");
            }

            if (this.Condition.GetValue(table))
            {
                Next = _linked[0];
            }
            else
            {
                Next = _linked[1];
            }
        }
Ejemplo n.º 31
0
        public override void Intro( params object [] args )
        {
            variableTable = new VariableTable ();

            fileSystem = FileSystemManager.GetFileSystem ( "LocalFileSystem" );
            if ( fileSystem.IsFileExist ( "vartab.dat" ) )
                variableTable.Load ( fileSystem.OpenFile ( "vartab.dat" ) );
            else
            {
                variableTable.AddPackageVariableTable ( myGuid, 3 );
                variableTable.SetVariable ( myGuid, 0, 0 );
                variableTable.SetVariable ( myGuid, 1, 0.0 );
                variableTable.SetVariable ( myGuid, 2, false );
            }

            base.Intro ( args );
        }
Ejemplo n.º 32
0
       /* public AssignmentNode(object value)
        {
            this.value = value;
        }
        */

        public AssignmentNode(VariableTable variables, Node arg1, Node arg2)
        {
            this.variables = variables;
            this.arg1 = arg1;
            this.arg2 = arg2;
        }