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

Companion: save and reload telemetry values #2011

Closed
wants to merge 2 commits into from

Conversation

dwheeld
Copy link
Contributor

@dwheeld dwheeld commented Jun 6, 2022

This PR was entered in error and should be ignored.

dwheeld added 2 commits May 11, 2022 17:01
…elemetry simulator. Also, default values set for all sensor values.
@gagarinlg
Copy link
Member

Could you please find a more suitable name for the PR and a description? Thx

@dwheeld
Copy link
Contributor Author

dwheeld commented Jun 6, 2022

gagarinlg

I was attempting to modify a previous pull request and it looks like I may have entered a new one instead. How can I delete the latest one (added file flush()) and try again?

@rotorman
Copy link
Member

rotorman commented Jun 6, 2022

To combine multiple commits into one, use the squash option.
git rebase -i "HEAD~3" (lists last 3 commits)
then pick the ones you wish to squash with s and save and exit the file.
With git push -f you then push the change to GitHub.

As this PR needed a better title... for now I changed it to "Companion: save and reload telemetry values" - feel free to edit/modify. You can edit the title directly in GitHub (press Edit button on top of the page).

@rotorman rotorman added the companion Related to the companion software label Jun 6, 2022
@rotorman rotorman changed the title Master Companion: save and reload telemetry values Jun 6, 2022
@dwheeld
Copy link
Contributor Author

dwheeld commented Jun 6, 2022

Here is the results of rebase:

$ git rebase -i "HEAD~3"
radio/src/gui/colorlcd/view_statistics.h: needs merge
radio/src/gui/colorlcd/widgets/timer.cpp: needs merge
radio/src/gui/colorlcd/widgets/value.cpp: needs merge
radio/src/targets/horus/extmodule_driver.cpp: needs merge
error: cannot rebase: You have unstaged changes.
error: additionally, your index contains uncommitted changes.
error: Please commit or stash them.

I don't understand because I have not made any commits to radio. Only to companion. It may be because I have tried to keep my branch up to date by fetching upstream. It states that I am now 10 commits ahead of main. Is there any way of falling back to just my branch without all of the upstream commits?

@rotorman
Copy link
Member

rotorman commented Jun 6, 2022

First, you have some local changes that you have not committed yet apparently. If these are required, commit them, if not, revert/discard them locally.

Second, no worries about your fork's branch "master" https://github.com/dwheeld/edgetx/tree/master being some commit's behind. This means that in the meantime, some changes (new commits) were added to the main EdgeTX that your branch in your fork does not have yet. Unless these changes are not to one of the 3 files and lines you were changing, this won't affect the PR's mergeability. You could rebase on top of present EdgeTX main, but this might just more complicate this at this stage for you, so let's skip it now, if there are no conflicts.

Third, you should really edit the first post of this PR to tell more about the contents of the changes you are proposing.

@dwheeld
Copy link
Contributor Author

dwheeld commented Jun 6, 2022

[let's skip it now, if there are no conflicts.]

Yes. Probably better if I leave it as is for now.

[Third, you should really edit the first post of this PR to tell more about the contents of the changes you are proposing.]

I did not see a way to edit the pr so will try to tell more here.

When using Companion Telemetry Simulator, the user can enter values for each sensor. These values can be used to test things like low voltage alarms, etc. At this time, the values must be entered manually each time the telemetry simulator is started. If he leaves the simulator to edit these alarms, and then re-starts the simulator, he must enter the sensor values again after the telemetry simulator re-starts. My addition allows the user to save these values to a file. After re-starting the simulator he simply reloads the previously saved values. Also, most of the telemetry simulator sensors do not have a default value. I have entered these default values for all of the sensors.

My final concern is that my branch does not reflect the last change I made (added file.flush before file.close). When I attempt to push the change from my local branch I get errors saying that my local is not up to date. I have updated several times and still get the error.

@pfeerick
Copy link
Member

pfeerick commented Jun 7, 2022

You would be better closing this PR and continuing with #1954 as you intended ;)

It seems you have created a new branch - master - and applied the new commit to that, rather than the main branch which you've been using for your other PR ;) That probably explains why you've having trouble finding it locally, you're probably looking in the wrong branch.

I have cherry-picked that commit across to the correct branch, so it now shows up in the #1954 PR as it should... so if you are able to get your local working tree in order we can close this PR and carry on there. Ideally you can git checkout main and then git pull and you should be back in business. If there is still something wrong with your local state after than, then git fetch origin and git reset --hard origin/main should get your local branch back into the same state as the github remote, and then you can carry on. Once you're back on track, let us know, and we can close this PR, and carry on over in #1954.

As far the rebase, the fact that this branch - master - is some 29 days behind the edgetx main would probably explain why rebase wants to merge changes in - since the whole premise if how it functions is that it needs to bring your repo branch up to date before attempting to re-applying your unique commits. But it failed since "You have unstaged changes." - i.e. there were changes in your working directory that you hadn't committed. So you would have needed to identify what isn't committed - git status, stash them to recover and continue working on later,

To edit a message:
image

@dwheeld dwheeld closed this Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
companion Related to the companion software
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants