Opened 14 years ago

Closed 14 years ago

#2329 closed defect (fixed)

Create custom slide is pushed off toolbar

Reported by: tonyforster Owned by: walter
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Sliderule Version: Unspecified
Severity: Unspecified Keywords:
Cc: Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

Xo1 OS373pyg
Create custom slide icon is off the end of the toolbar, presumably because of the addition of the results label function
Suggest adjust edit box widths

Attachments (1)

Sliderule-18.xo (44.8 KB) - added by walter 14 years ago.
release candidate

Download all attachments as: .zip

Change History (17)

comment:1 Changed 14 years ago by walter

Oooh. I meant to test it on my XO...

comment:2 Changed 14 years ago by tonyforster

Can you explain please the purpose and differences of the results function and the results label function? I fear I have created unnecessary complexity by asking for strings. It appears that their only purpose is to label the upper figure on the cursor? Maybe it would be better to leave a blank on the cursor than have an extra field on the custom dialogs?

comment:3 Changed 14 years ago by walter

The results function are a floating point calculation based upon the position of the slides and reticule. The results label function takes that result and converts it into a formated string for display. It is equivalent to inverse function that positions the marks and labels on the slide and the function that outputs the string used as a label. So, results and offset are floats that are directly proportional to the distance along the slide. The label and results labels are functions to convert the distance to a string. Clear as mud?

FWIW, I think it was an oversight to leave the results label out. It provides a nice symmetry for the input and output. I'll manage to make everything fit.

comment:4 Changed 14 years ago by walter

Think everything should fit now...

comment:5 Changed 14 years ago by tonyforster

Clearer but still confused.
For C/D I can put x in results function and pow(10,x) in results label, I get much the same result as viceversa except for a lot of decimal places and some unexplained rounding error. I'm sure its not too hard to strip back to 2 decimal places. So if I can do floating point and formatting in the results label, what is the need for results function?

comment:6 Changed 14 years ago by walter

You can use the round function to manage decimal places. I use something similar already. However, if you want to do things like hex/binary rule, you need to do further manipulations on the result.

Also, it gives you a bit of flexibility, such as when doing compound functions (log log or ln log) where you can apply one function (usually log) to the position and the second function to the label.

comment:7 Changed 14 years ago by walter

I suppose I could reveal it as an advanced feature, and just expose two fields to begin with? But hacking custom rules is already pretty advanced.

comment:8 Changed 14 years ago by tonyforster

Still confused
"you can apply one function (usually log) to the position and the second function to the label"

Unlike the first two fields, where there is both a position and a label, results is always located at the cursor and doesnt have a position?

comment:9 Changed 14 years ago by walter

but the cursor moves :)

comment:10 Changed 14 years ago by walter

Having gotten a night's sleep, I think we may have been talking past each other. (And maybe we should be having this discussion on the lists instead of here?)

I think we can eliminate the Results label after all, since I cannot think of any circumstance where the Position label won't also serve as the Results label.

So, we need a function to (1) calculate an offset on the slide from a value; (2) calculate a value from an offset on the slide; and (3) a Label function that converts the value to some display value (often identity.)

New version appearing shortly.

comment:11 Changed 14 years ago by walter

Please let me know what you think of v18 attached to this ticket.

Changed 14 years ago by walter

release candidate

comment:12 Changed 14 years ago by walter

While I was at it, I added some in-line documentation for modifying the activity. Please test this new release candidate.

comment:13 Changed 14 years ago by tonyforster

V18 looks good, will test further
in-line documentation is a good idea

"I cannot think of any circumstance where the Position label won't also serve as the Results label" What about when you want to reduce precision on the scale to reduce clutter (n) but keep precision on the cursor (n.nn)

That said, I am still happy with the way it is now, a simple UI is more important than covering all cases.

When you create a custom scale, the alignment is lost, realign slides seems to have a different zero point

comment:14 Changed 14 years ago by walter

When you create a custom scale, the alignment is lost, realign slides seems to have a different zero point

Maybe I should reset all of the alignments when you create a custom scale...

comment:15 Changed 14 years ago by tonyforster

Next step is, I think, documentation
Which version of Python is currently in use?
Which libraries are imported?
eg
neither random() nor random.random() work
lower() does not work but str.lower() does

Experimenting with scale compression. Tried putting x in the step function, it produced an error. It was probably not going to work anyway. In other languages for(i=0; i<10; i+=i+1) can produce the sort of result I was trying for but you are probably using range(lower, upper, step) which produces an error for range(1,10,i+1). Not asking for a rewrite of code, just curious if compression is possible as is.

comment:16 Changed 14 years ago by walter

  • Resolution set to fixed
  • Status changed from new to closed

fixed in v18

Note: See TracTickets for help on using tickets.