예제 #1
0
        public static void PyDevFromString(this Machine @this, string script, long address, int size, bool initable = false, string name = null, long offset = 0)
        {
            var pyDev = new PythonPeripheral(size, initable, script: script);

            @this.SystemBus.Register(pyDev, new BusPointRegistration(address, offset));
            if (!string.IsNullOrEmpty(name))
            {
                @this.SetLocalName(pyDev, name);
            }
        }
예제 #2
0
 private static PythonPeripheral CreatePeripheral(Func<ScriptEngine, ScriptSource> source, int size, bool initable)
 {
     var peripheral = new PythonPeripheral(size, initable, source);
     return peripheral;
 }
예제 #3
0
 public PeripheralPythonEngine(PythonPeripheral peripheral, Func<ScriptEngine, ScriptSource> sourceGenerator)
 {
     this.peripheral = peripheral;
     InitScope(sourceGenerator(Engine));
 }
예제 #4
0
 public PeripheralPythonEngine(PythonPeripheral peripheral)
 {
     this.peripheral = peripheral;
     InitScope(Engine.CreateScriptSourceFromString(Aggregate(Imports)));
 }
예제 #5
0
 public PeripheralPythonEngine(PythonPeripheral peripheral, Func <ScriptEngine, ScriptSource> sourceGenerator)
 {
     this.peripheral = peripheral;
     InitScope(sourceGenerator(Engine));
 }
예제 #6
0
 public PeripheralPythonEngine(PythonPeripheral peripheral)
 {
     this.peripheral = peripheral;
     InitScope(Engine.CreateScriptSourceFromString(Aggregate(Imports)));
 }
예제 #7
0
        private static PythonPeripheral CreatePeripheral(Func <ScriptEngine, ScriptSource> source, int size, bool initable)
        {
            var peripheral = new PythonPeripheral(size, initable, source);

            return(peripheral);
        }