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

New plugin how to write value for reseting counter #1380

Closed
Jodaille opened this issue Mar 2, 2025 · 13 comments · Fixed by #1391
Closed

New plugin how to write value for reseting counter #1380

Jodaille opened this issue Mar 2, 2025 · 13 comments · Fixed by #1391

Comments

@Jodaille
Copy link
Contributor

Jodaille commented Mar 2, 2025

Hello,

I try to write a new plugin for reseting water pump counters (low, middle, high speed).

I have look at the other plugins, I can read values but reseting (write) return None.

For example:
https://github.com/Jodaille/ddtplugins/blob/master/zoe_waterpump_counter_reset.py#L216-L224

reset_request = self.evc_ecu.requests[u"DataWrite.($3349) Time Counter for the driving WEP in Low Speed"] request_response = reset_request.send_request()

Nb: I start diag session before https://github.com/Jodaille/ddtplugins/blob/master/zoe_waterpump_counter_reset.py#L174-L181

Can you see what am I missing ?

@Jodaille
Copy link
Contributor Author

Jodaille commented Mar 2, 2025

In xml:
EVC_3180_RH5_510_V1.1_20210422T184714.xml

I see StartDiagnosticSession.Default (I use this one to start session)
but there is two others:

StartDiagnosticSession.Programming
and
StartDiagnosticSession.ExtendedDiagnosticSession

Do you think I have to use this one to be able to write (reset) counter ?

@Jodaille
Copy link
Contributor Author

Jodaille commented Mar 3, 2025

Hello,

I may have found something, thanks to a video: https://youtu.be/cNc5uVA0Jf8?t=511
I need to pass 0 as value, and it seems the key correspond to
<DataItem Name="($3349) Time Counter for the driving WEP in Low Speed" in XML file

reset_request = self.evc_ecu.requests[u"DataWrite.($3349) Time Counter for the driving WEP in Low Speed"] request_response = reset_request.send_request({"($3349) Time Counter for the driving WEP in Low Speed": 0})

@Jodaille
Copy link
Contributor Author

Jodaille commented Mar 4, 2025

Hello,

I can reset low speed counter using start_diag_extend_session()
\o/
I have changed medium, high and V_Timer_DrivWEP_ON to use it (but no tested now)

@Jodaille Jodaille closed this as completed Mar 4, 2025
@Jodaille
Copy link
Contributor Author

Jodaille commented Mar 5, 2025

Hello @Furtif,

do you think you can merge my pull request ?

@Furtif
Copy link
Collaborator

Furtif commented Mar 5, 2025

I not have access in repo plugins this need @cedricp

@Furtif
Copy link
Collaborator

Furtif commented Mar 11, 2025

Image

need verif

@Furtif Furtif reopened this Mar 11, 2025
@Furtif
Copy link
Collaborator

Furtif commented Mar 11, 2025

make TIPS as translatable , fix screen please.

@Jodaille
Copy link
Contributor Author

Jodaille commented Mar 11, 2025

make TIPS as translatable , fix screen please.

About screen I am using:
self.setGeometry(100, 100, 480, 445)
https://github.com/Jodaille/ddtplugins/blob/master/zoe_waterpump_counter_reset.py#L26C9-L26C45
That seems to work for me.

Image

Do you know a best way to do it ?
Or do you know why it does not work for you ?

I have translation for tips,
and
self.setFixedSize(480, 445) but I don't know if it solves your display.

PS: I have test on Linux and Mac, are you on Windows ?

cedricp/ddtplugins@09a7d6f

@Furtif
Copy link
Collaborator

Furtif commented Mar 12, 2025

I have test in windows, I have changed plugin mode (not more as submodule)

@Furtif
Copy link
Collaborator

Furtif commented Mar 12, 2025

https://github.com/cedricp/ddt4all/blob/master/ddtplugins%2Fzoe_waterpump_counter_reset.py

@Jodaille
Copy link
Contributor Author

Hello,

I have pushed "Tips translate"

I have added self.setFixedSize(480, 480)
but I cannot not test it on Windows
If you can have a try

Thank you
#1388

@Furtif Furtif closed this as completed Mar 12, 2025
@Furtif
Copy link
Collaborator

Furtif commented Mar 12, 2025

Hello,

I have pushed "Tips translate"

I have added self.setFixedSize(480, 480) but I cannot not test it on Windows If you can have a try

Thank you #1388

Image

On windows i thinks better this:

# x, y, width, high
       self.setGeometry(100, 100, 510, 530)
       self.setFixedSize(510, 530)

need maybe add the other string values as _(translate)

style :

self.table.setHorizontalHeaderLabels([_("Name"), _("Values"), _("Action")])  # columns headers
`


data = [
            [_("Low Speed"), "", ""],
            [_("Middle Speed"), "", ""],
            [_("High Speed"), "", ""],
            [_("V_Timer_DrivWEP_ON"), "", ""], #V_Timer_DrivWEP_ON
        ]

gui.QPushButton(_("Reset"))
.... (all other Reset)
`

infos = gui.QLabel(_("Zoe water pump counters<br>"
                             "<font color='red'>THIS PLUGIN WILL ERASE WATER PUMP COUNTERS<br>GO AWAY IF YOU HAVE NO IDEA OF WHAT IT MEANS</font>"))
 check_button = gui.QPushButton(_("Check values"))
        self.status_check = gui.QLabel_("Waiting action"))
        self.virginize_button = gui.QPushButton(_("Reset counters"))

here only as one maybe:


instructions_html = f"""
        <h1>{_('TIPS')}</h1>
        <ul>
            <li>{_('Insert key CARD')}</li>
            <li>{_('Put D position')}</li>
            <li>{_('Press/Stay START until')} <b>"{_('Remove card')}"</b> {_('message')}</li>
            <li>{_('Put P position')}</li>
            <li>{_('Keep key card inserted')}</li>
        </ul>
        """


to:
        instructions_html = _("<h1>TIPS</h1><ul><li>Insert key CARD</li><li>Put D position</li><li>Press/Stay START until <b>Remove card</b> message</li><li>Put P position</li><li>Keep key card inserted</li></ul>")


 options.main_window.logview.append("reading V_Timer_DrivWEP_ON") as translate also here

 print(f"Réponse reçue: {pumptimer_check_values}") here also

etc all translatable stuffs

@Furtif Furtif reopened this Mar 12, 2025
@Jodaille
Copy link
Contributor Author

Hello !

please see PR
#1391

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

Successfully merging a pull request may close this issue.

2 participants