Exemple #1
0
 private void OneWireDumpForm_Load(object sender, EventArgs e)
 {
     _hardwareController.DeviceInProgrammerModeDetected += HardwareController_DeviceInProgrammerModeDetected;
     _hardwareController.DeviceRemoved += HardwareController_DeviceRemoved;
     _programmersListIsRequested        = true;
     _hardwareController.GetListOfDevicesInProgrammerMode(ProgrammersManagementProc);
     tabControl.Enabled = false;
     infoPanel.Visible  = false;
 }
        private void Xerox0190Form_Load(object sender, EventArgs e)
        {
            SetNoProgrammerState();
            _hardwareController.DeviceInProgrammerModeDetected += HardwareController_DeviceInProgrammerModeDetected;
            _hardwareController.DeviceRemoved += HardwareController_DeviceRemoved;
            _programmersListIsRequested        = true;
            _hardwareController.GetListOfDevicesInProgrammerMode(ProgrammersManagementProc);

            infoPanel.Visible   = false;
            _dataBytes          = new ByteCollection((new MemoryRegion(0, 256, 0)).Data);
            hexBox.ByteProvider = new DynamicByteProvider(_dataBytes);
        }
Exemple #3
0
        private void M24CXXDumpForm_Load(object sender, EventArgs e)
        {
            SetNoProgrammerState();
            _hardwareController.DeviceInProgrammerModeDetected += HardwareController_DeviceInProgrammerModeDetected;
            _hardwareController.DeviceRemoved += HardwareController_DeviceRemoved;
            _programmersListIsRequested        = true;
            UpdateComboBox(s02512.Keys.ToArray());
            chipSelectStripComboBox.SelectedIndex = 1;
            _hardwareController.GetListOfDevicesInProgrammerMode(ProgrammersManagementProc);

            //openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            //saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

            infoPanel.Visible = false;
        }
 private void AT88DumpForm_Load(object sender, EventArgs e)
 {
     infoPanel.Visible = false;
     SetNoProgrammerState();
     userDataHexBox.ByteProvider   = new DynamicByteProvider(_userDataBytes);
     configDataHexBox.ByteProvider = new StaticByteProvider(_configDataBytes);
     configDataHexBox.StartAddress = 0x100;
     _hardwareController.DeviceInProgrammerModeDetected += HardwareController_DeviceInProgrammerModeDetected;
     _hardwareController.DeviceRemoved += HardwareController_DeviceRemoved;
     _programmersListIsRequested        = true;
     _hardwareController.GetListOfDevicesInProgrammerMode(ProgrammersManagementProc);
     foreach (TabPage tp in dumpTabControl.TabPages)
     {
         sptext[tp] = "AT88 DUMP Empty";
     }
 }
Exemple #5
0
        private void AutoForm_Load(object sender, EventArgs e)
        {
            #region Hardware Init

            _hardwareController.DeviceRemoved += HardwareController_DeviceRemoved;

            _hardwareController.DeviceInProgrammerModeDetected += HardwareController_DeviceInProgrammerModeDetected;

            _programmersListIsRequested = true;
            _hardwareController.GetListOfDevicesInProgrammerMode(ProgrammersManagementProc);

            #endregion

            #region Chips Set Init
            try
            {
                string path = Application.ExecutablePath;
                path = path.Substring(0, path.LastIndexOf("\\"));
                Directory.SetCurrentDirectory(path);


                _crumSet = XElement.Load("dumps\\chipsset.xml");
                var names =
                    from chip in _crumSet.Elements("chip")
                    orderby(string) chip.Element("name")
                    select(string) chip.Element("name");
                string[] s = names.ToArray();

                chipSelectComboBox.Items.AddRange(s);
                chipSelectComboBox.SelectedIndex = 0;
            }
            catch (Exception ee)
            {
                _crumSet = null;
                SetAlarmText(ee.Message);
            }


            #endregion

            #region Executors Init

            _crumReaders.Add("24CXX", M24CXXRead);
            _crumReaders.Add("AT88", AT88Read);
            _crumWriters.Add("24CXX", M24CXXWrite);
            _crumWriters.Add("AT88", AT88Write);

            #endregion

            #region DumpCorrectors Init

            _dumpCoprrectors.Add("No", delegate(byte[] data) { });

            _dumpCoprrectors.Add("1", delegate(byte[] data) { AnsiSerialNoIncrement(53, 63, data); });

            _dumpCoprrectors.Add("2", delegate(byte[] data) { AnsiSerialNoIncrement(37, 47, data); });

            _dumpCoprrectors.Add("searching", delegate(byte[] data)
            {
                ASCIIEncoding enc             = new ASCIIEncoding();
                string marker                 = "CRUM-";
                string dumpstring             = enc.GetString(data);
                dumpstring                    = dumpstring.ToUpper();
                List <SerialNoBounds> serials = new List <SerialNoBounds>();
                int startSearchIndex          = 0;
                while ((startSearchIndex = dumpstring.IndexOf(marker, startSearchIndex)) >= 0)
                {
                    SerialNoBounds bound;
                    bound.lowerBound = startSearchIndex + 5;
                    bound.upperBound = startSearchIndex + 15;
                    serials.Add(bound);
                    startSearchIndex++;
                }

                AnsiMultiSerialsIncrement(serials, data);
            });

            _dumpCoprrectors.Add("custom", delegate(byte[] data)
            {
                string serialDefs = _selectedChipNodes.Element("serialdefs").Value.ToString();

                Regex ubRegEx = new Regex("-([0-9a-fA-F]+)");
                Regex lbRegEx = new Regex("(^|,)([0-9a-fA-F]+)");

                MatchCollection ubMatches = ubRegEx.Matches(serialDefs);
                MatchCollection lbMatches = lbRegEx.Matches(serialDefs);

                List <SerialNoBounds> serials = new List <SerialNoBounds>();

                for (int i = 0; i < ubMatches.Count; i++)
                {
                    SerialNoBounds bound;
                    bound.upperBound = Convert.ToInt32(ubMatches[i].Groups[1].Value, 16);
                    bound.lowerBound = Convert.ToInt32(lbMatches[i].Groups[2].Value, 16);
                    serials.Add(bound);
                }


                AnsiMultiSerialsIncrement(serials, data);
            });



            #endregion
        }