-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.py
35 lines (30 loc) · 1.25 KB
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import EmulatorFunctions.Devices as Devices
import EmulatorFunctions.Network as Network
import json
from UtilityFunctions.Error import *
import UtilityFunctions.Logging as Logging
from UtilityFunctions.Utility import *
import math
class MainManager:
def __init__(self,Networks:list[Network.Network]=[]):
self.Networks=Networks
self.Log=Logging.Logging(LogToFile=False)
def RunScripts(self):
for X in self.Networks:
X.RunScripts()
if __name__ == "__main__":
MNet=Network.Network()
DM=Devices.DeviceMaker()
MNet.AddDevice(DM.MakeDevice("StructureCircuitHousing",69,Code=open("Test.ic10","r").read(),Pins={"d0":65}))
MNet.AddDevice(DM.MakeDevice("StructureGasMixer",65,Setting=50,DeviceName="bob"))
MNet.AddDevice(DM.MakeDevice("StructureGasMixer",64,DeviceName="bosb"))
MM=MainManager([MNet])
MM.Networks[0].DeviceList[69].State.PrintConstants()
for X in range(0,6):
MM.RunScripts()
if MM.Networks[0].DeviceList[69].Fields["Error"].Value == 1:
continue
MM.Networks[0].DeviceList[69].State.PrintRegisters()
MM.Networks[0].DeviceList[69].State.PrintStack()
MM.Networks[0].DeviceList[69].State.PrintAlias()
MM.Networks[0].DeviceList[69].PrintFields()