Exemple #1
0
        public FrmEmulator(EmulatorType type)
        {
            InitializeComponent();

            this.type = type;
            InitializeEmulator();
        }
Exemple #2
0
        public void BeginNewEmulatorConfiguration()
        {
            ListItem selectedTypeItem = _emulatorTypes.FirstOrDefault(i => i.Selected);

            if (selectedTypeItem == null)
            {
                return;
            }
            EmulatorType emulatorType = (EmulatorType)selectedTypeItem.AdditionalProperties[KEY_EMULATOR_TYPE];

            _emulatorProxy = new EmulatorProxy(emulatorType);

            if (emulatorType == EmulatorType.Emulator)
            {
                NavigatePush(STATE_CHOOSE_PATH);
            }
            else if (emulatorType == EmulatorType.LibRetro)
            {
                NavigatePush(STATE_CHOOSE_CORE);
            }
            else
            {
                NavigatePush(STATE_EDIT_NAME);
            }
        }
Exemple #3
0
 private void dgEmus_SelectionChanged(object sender, EventArgs e)
 {
     if (dgEmus.CurrentRow != null)
     {
         currentEmu        = ((Emu)dgEmus.CurrentRow.DataBoundItem).Type;
         currentList       = EmuLists[currentEmu];
         dgRoms.DataSource = currentList;
     }
 }
Exemple #4
0
 public EmulatorInstance(int id, EmulatorType type, string windowName, string command, Account lastKnownAccount, App app)
 {
     this.Id               = id;
     this.Type             = type;
     this.WindowName       = windowName;
     this.Command          = command;
     this.LastKnownAccount = lastKnownAccount;
     this.App              = app;
 }
Exemple #5
0
        public static string CommandLineArgs(this Process p, EmulatorType type)
        {
            string ret      = "";
            string wmiQuery = String.Format("select CommandLine, ProcessId from Win32_Process where Name='{0}.exe' and ProcessId={1}", p.ProcessName, p.Id);

            System.Management.ManagementObjectSearcher searcher = new System.Management.ManagementObjectSearcher(wmiQuery);
            foreach (System.Management.ManagementObject retObject in searcher.Get())
            {
                ret = retObject["CommandLine"].ToString();
                if (type == EmulatorType.Nox)
                {
                    ret = ret.Replace("Nox", "C:\\Program Files (x86)\\Nox\\bin\\Nox.exe");
                }
            }

            return(ret);
        }
Exemple #6
0
        public Emulator(EmulatorType specialRole)
        {
            switch (specialRole)
            {
            case EmulatorType.pcgame:
            {
                UID           = -1;
                Title         = Translator.Instance.pcgames;
                PlatformTitle = "Windows";
                break;
            }

            case EmulatorType.manyemulators:
            {
                UID = -2;
                break;
            }
            }
        }
        private void LoadConverse()
        {
            String configFile = "";
            UsePortReader = false;
            EmulatorType = DeviceEmulator.EmulatorType.CMS;
            Converse = null;
            liveElement = null;
            rootElement = null;

            if (EmulatorName == "CMS Inverter")
            {
                EmulatorType = DeviceEmulator.EmulatorType.CMS;
                Converse = (Converse)new Phoenixtec_Converse(Services);
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                ConversationLoader conversations = new ConversationLoader(configFile, Services);
                conversations.LoadConversations(Converse);
                Converse.NoTimeout = false;
                UsePortReader = true;
            }
            else if (EmulatorName == "Modbus Growatt")
            {
                EmulatorType = DeviceEmulator.EmulatorType.ModbusGrowatt;
                ModbusConverseCalculations calc = new ModbusConverseCalculations();
                Converse = (Converse)new Converse(Services,calc);
                Converse.SetCheckSum16Endian(true);
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                ConversationLoader conversations = new ConversationLoader(configFile, Services);
                conversations.LoadConversations(Converse);
                Converse.NoTimeout = false;
                UsePortReader = true;
            }
            else if (EmulatorName == "Modbus KLNE")
            {
                EmulatorType = DeviceEmulator.EmulatorType.ModbusKLNE;
                ModbusConverseCalculations calc = new ModbusConverseCalculations();
                Converse = (Converse)new Converse(Services, calc);
                Converse.SetCheckSum16Endian(true);
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                ConversationLoader conversations = new ConversationLoader(configFile, Services);
                conversations.LoadConversations(Converse);
                Converse.NoTimeout = false;
                UsePortReader = true;
            }
            else if (EmulatorName == "KLNE Inverter")
            {
                EmulatorType = DeviceEmulator.EmulatorType.KLNE;
                Converse = (Converse)new Phoenixtec_Converse(Services);
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                ConversationLoader conversations = new ConversationLoader(configFile, Services);
                conversations.LoadConversations(Converse);
                Converse.NoTimeout = false;
                UsePortReader = true;
            }
            else if (EmulatorName == "Modbus Xantrex")
            {
                EmulatorType = DeviceEmulator.EmulatorType.ModbusXantrex;
                ModbusConverseCalculations calc = new ModbusConverseCalculations();
                Converse = (Converse)new Converse(Services, calc);
                Converse.SetCheckSum16Endian(true);
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                ConversationLoader conversations = new ConversationLoader(configFile, Services);
                conversations.LoadConversations(Converse);
                Converse.NoTimeout = false;
                UsePortReader = true;
            }
            else if (EmulatorName == "Modbus Sunnyroo")
            {
                EmulatorType = DeviceEmulator.EmulatorType.ModbusSunnyroo;
                ModbusConverseCalculations calc = new ModbusConverseCalculations();
                Converse = (Converse)new Converse(Services, calc);
                Converse.SetCheckSum16Endian(true);
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                ConversationLoader conversations = new ConversationLoader(configFile, Services);
                conversations.LoadConversations(Converse);
                Converse.NoTimeout = false;
                UsePortReader = true;
            }
            else if (EmulatorName == "Fronius")
            {
                EmulatorType = DeviceEmulator.EmulatorType.Fronius;
                FroniusConverseCalculations calc = new FroniusConverseCalculations();
                Converse = (Converse)new Converse(Services, calc);
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                ConversationLoader conversations = new ConversationLoader(configFile, Services);
                conversations.LoadConversations(Converse);
                Converse.NoTimeout = false;
                UsePortReader = true;
            }
            else if (EmulatorName == "Xantrex ASCII")
            {
                EmulatorType = DeviceEmulator.EmulatorType.XantrexASCII;
                Converse = (Converse)new Converse(Services,null);
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                ConversationLoader conversations = new ConversationLoader(configFile, Services);
                conversations.LoadConversations(Converse);
                Converse.NoTimeout = false;
                UsePortReader = true;
            }
            else if (EmulatorName == "CC EnviR")
            {
                EmulatorType = DeviceEmulator.EmulatorType.CurrentCostEnviR;
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                rootElement = XElement.Load(configFile, LoadOptions.None);
                liveElement = rootElement.Element("live").Element("msg");
                UsePortReader = false;
            }
            else if (EmulatorName == "GenericReader")
            {
                EmulatorType = DeviceEmulator.EmulatorType.GenericReader;
                ModbusConverseCalculations calc = new ModbusConverseCalculations();
                Converse = (Converse)new Converse(Services, calc);
                Converse.SetCheckSum16Endian(true);
                configFile = EmulatorMatrix[(int)EmulatorType, 1];
                configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
                ConversationLoader conversations = new ConversationLoader(configFile, Services);
                conversations.LoadConversations(Converse);
                Converse.NoTimeout = false;
                UsePortReader = true;
            }
        }
 private void comboBoxType_SourceUpdated(object sender, DataTransferEventArgs e)
 {
     if (EmulatorName == "CC EnviR")
     {
         butSendHist.Visibility = System.Windows.Visibility.Visible;
         histList = null;
         EmulatorType = DeviceEmulator.EmulatorType.CurrentCostEnviR;
         String configFile = EmulatorMatrix[(int)EmulatorType, 1];
         configFile = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, configFile);
         XElement root = XElement.Load(configFile, LoadOptions.None);
         histElements = root.Element("history");
     }
 }
Exemple #9
0
 public EmulatorTag(Dvtk.Sessions.Session theSession, EmulatorType theEmulatorType) : base(theSession)
 {
     _EmulatorType = theEmulatorType;
 }
 public EmulatorProxy(EmulatorType emulatorType)
     : this(null)
 {
     EmulatorType = emulatorType;
 }
Exemple #11
0
 public EmulatorTag(Dvtk.Sessions.Session theSession, EmulatorType theEmulatorType)
     : base(theSession)
 {
     _EmulatorType = theEmulatorType;
 }