Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SavvyCAN compatible Session Files #20

Open
bionicbone opened this issue Jan 22, 2022 · 6 comments
Open

SavvyCAN compatible Session Files #20

bionicbone opened this issue Jan 22, 2022 · 6 comments

Comments

@bionicbone
Copy link

bionicbone commented Jan 22, 2022

Hi Adam,
I probably should create a pull request, but I've not got everything set up.
I made a change that you may want to consider, to the save file process that converts to time stamp to ms
Its not pritty, I've not used Python before so its just a logical flow (for me at least)
However, now the file can be loading directly into SavvyCAN for analysis, the program is free download

                    **if item is not None:
                        
                        if column == 0:
                            tempItem = ''
                            for mynext in range(0,len(item.text())):
                                if item.text()[mynext] !='.':
                                    tempItem += item.text()[mynext:mynext+1]
                        else:
                            tempItem = item.text()
                        rowData.append(str(tempItem))**
                    else:
                        rowData.append('')
                writer.writerow(rowData)

Once saved load into SavvyCAN using the "GVRET LOGS" format

image

Download SavvyCAN
https://github.com/collin80/SavvyCAN/releases?page=1

image

image

image

image

@adamtheone
Copy link
Owner

I've pushed the modifications to this branch. Please try it out:
https://github.com/adamtheone/canDrive/tree/session_file_millisec

@bionicbone
Copy link
Author

Leave with me and I will check this weekend.

I suspect further code is required to remove your "human" labels after the ID number for the export.

@bionicbone
Copy link
Author

Can you update the Python like this ?

I have just created many logs for SavvyCan with this code.

def saveTableToFile(self, table, path):
    if path is None:
        path, _ = QFileDialog.getSaveFileName(self, 'Save File', './save', 'CSV(*.csv)')
    if path != '':
        with open(str(path), 'w', newline='') as stream:
            writer = csv.writer(stream)
            for row in range(table.rowCount()-1, -1, -1):
                rowData = []
                for column in range(table.columnCount()):
                    item = table.item(row, column)
                    if item is not None:
                        if column == 0:
                            tempItem = ''
                            for mynext in range(0,len(item.text())):
                                if item.text()[mynext] !='.':
                                    tempItem += item.text()[mynext:mynext+1]
                        elif column == 1:
                            tempItem = ''
                            for mynext in range(0,len(item.text())):
                                if item.text()[mynext] !=' ':
                                    tempItem += item.text()[mynext:mynext+1]
                                else:
                                    break
                        else:
                            tempItem = item.text()
                        rowData.append(str(tempItem))
                    else:
                        rowData.append('')
                writer.writerow(rowData)

@Kwieeciol
Copy link

@bionicbone I think it'd be much easier if you create a PR referencing this issue

@bionicbone
Copy link
Author

@Kwieeciol it would if I had got GitHub set up correctly

@adamtheone
Copy link
Owner

This feature is really specific for SavvyCan, and would mess up other parts of my code: when the program reads back the saved session. This should be either a separate feature from the GUI, or the read back functionality of the GUI should also be aligned with the SavvyCan format. I have very limited availability nowadays, it would be certainly be faster if you can create the modifications and create a PR from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants