private void InitializeData()
        {
            _ecuSetup = EcuSetup.Load(FileType);
            _comSetup = ComSetup.Load(FileType);
            var lastPortName = string.Empty;
            var portFound    = false;

            foreach (var portName in SerialComPort.Helper.SetupValues.GetPortNameValues())
            {
                if (_comSetup.PortName.Equals(portName))
                {
                    portFound = true;
                    break;
                }
                lastPortName = portName;
            }
            if (!portFound)
            {
                _comSetup.PortName = lastPortName;
            }
            Emulator.Setup    = _ecuSetup;
            Emulator.Register = RegisterList.Load(FileType);
            if (Emulator.Register.Items.Count <= 0)
            {
                Emulator.Register = Emulator.InitRegister();
            }
        }
示例#2
0
        public void InitSetup()
        {
            //Create XML:
            var setup = EcuSetup.Load();

            setup.Save();

            //Create Json
            var setupJ = EcuSetup.Load(Serializer.ConversionTypes.Json);

            setupJ.Save(Serializer.ConversionTypes.Json);

            //Create Bin:
            var setupB = EcuSetup.Load(Serializer.ConversionTypes.Binary);

            setupB.Save(Serializer.ConversionTypes.Binary);
        }