Esempio n. 1
0
        /*void mv_onReadFromSRAM(object sender, IMapViewer.ReadFromSRAMEventArgs e)
        {
            // refresh the data in the mapviewer with data from the file/ecu
            byte[] _ecudata = m_trionicFile.ReadData((uint)m_trionicFileInformation.GetSymbolAddressFlash(e.Mapname), (uint)m_trionicFileInformation.GetSymbolLength(e.Mapname));

            if (_ecuConnection.Opened && _ECUmode == OperationMode.ModeOnline)
            {
                _ecuConnection.ProhibitRead = true;
                Thread.Sleep(100);
                _ecudata = _ecuConnection.ReadSymbolData(e.Mapname, (uint)m_trionicFileInformation.GetSymbolAddressSRAM(e.Mapname), (uint)m_trionicFileInformation.GetSymbolLength(e.Mapname));
                _ecuConnection.ProhibitRead = false;
            }
            // reload the view with the appropriate data
            if (sender is IMapViewer)
            {
                IMapViewer mv = (MapViewerEx)sender;
                int cols = 1;
                int rows = 1;
                mv.Map_content = _ecudata;// _ecuConnection.ReadSymbolData(e.SymbolName, (uint)m_trionicFileInformation.GetSymbolAddressSRAM(e.SymbolName), (uint)m_trionicFileInformation.GetSymbolLength(e.SymbolName));
                m_trionicFile.GetMapMatrixWitdhByName(e.Mapname, out cols, out rows);
                mv.ShowTable(cols, m_trionicFile.IsTableSixteenBits(e.Mapname));
                mv.InitEditValues();
            }
        }*/
        void mv_onSymbolSave(object sender, IMapViewer.SaveSymbolEventArgs e)
        {
            // save data from a mapviewer... save to binary if available and to ECU if available
            string note = string.Empty;
            if (m_appSettings.RequestProjectNotes && m_CurrentWorkingProject != "")
            {
                //request a small note from the user in which he/she can denote a description of the change
                frmChangeNote changenote = new frmChangeNote();
                changenote.ShowDialog();
                note = changenote.Note;
            }

            if (_ecuConnection.Opened && _ECUmode == OperationMode.ModeOnline)
            {
                _ecuConnection.WriteSymbolData(m_trionicFileInformation.GetSymbolAddressSRAM(e.SymbolName), m_trionicFileInformation.GetSymbolLength(e.SymbolName), e.SymbolDate);
            }
            m_trionicFile.WriteData(e.SymbolDate, (uint)m_trionicFileInformation.GetSymbolAddressFlash(e.SymbolName), note);
            // reload the view with the appropriate data
            if (sender is IMapViewer)
            {
                IMapViewer mv = (IMapViewer)sender;
                int cols = 1;
                int rows = 1;
                mv.Map_content = e.SymbolDate;// _ecuConnection.ReadSymbolData(e.SymbolName, (uint)m_trionicFileInformation.GetSymbolAddressSRAM(e.SymbolName), (uint)m_trionicFileInformation.GetSymbolLength(e.SymbolName));
                m_trionicFile.GetMapMatrixWitdhByName(e.SymbolName, out cols, out rows);
                mv.ShowTable(cols, m_trionicFile.IsTableSixteenBits(e.SymbolName));
            }
        }
Esempio n. 2
0
 private void btnProjectNote_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     frmChangeNote newNote = new frmChangeNote();
     newNote.ShowDialog();
     if (newNote.Note != string.Empty)
     {
         if (m_CurrentWorkingProject != string.Empty)
         {
             m_ProjectLog.WriteLogbookEntry(LogbookEntryType.Note, newNote.Note);
         }
     }
 }