Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers



Laser Pointer Store

My warning label generator... yeah, I was bored.

Status
Not open for further replies.

Trevor

Well-known member
Joined
Jul 17, 2009
Messages
4,513
Likes
548
Points
113
So I haven't written any PHP in a while, and since swatmugga posted one, I figured I'd take a stab at it too.

This is what the better part of my day yielded:

Laser Warning Label Generator

For whatever wavelength in the visible spectrum you choose, it colors the beam on the label that color. Anything outside it shows up black. It just now occurred to me that could be annoying if you just want a standard red beam, so I'll code an override option and build a better GUI tomorrow.

Instead of using a pre-built image and printing text, I re-rendered the whole thing using PHP's GD library to completely avoid quality issues.

Hope some of you find it useful.

Please leave a note here if you want me to add laser classes (all I used was the old system) or system types (I added just a few to test it).

-Trevor
 
Last edited:

bobhaha

New member
Joined
May 31, 2009
Messages
3,256
Likes
206
Points
0
Awesome work! The only other thing I can think of, is can you make it selectable for <, = or > then output power?

For example

<50mw
50mw
>50mw
 

lasersbee

Well-known member
Joined
Sep 20, 2008
Messages
17,455
Likes
1,558
Points
113
Very nice.... I like it...:gj:

Maybe have the Laser Class automatically be chosen by the
Power you choose for the label.. like you do for the color
of the Label's Laser Beam & Spot...:cool:


Jerry
 
Last edited:

Trevor

Well-known member
Joined
Jul 17, 2009
Messages
4,513
Likes
548
Points
113
Hey I like it! one thing though the text changes depending on the class, see the yellow labels:
Laser safety - Wikipedia, the free encyclopedia

example: class 4 you must avoid direct or indirect exposure.
I'll do that.

Today I cleaned up the GUI and added the automatic class selection option. Also, previous settings no longer clear from the fields on form submission. I'll keep coding tomorrow after my brain cools and coagulates overnight - I melted it by having classes then spending several hours writing C++, then switching to PHP.

-Trevor
 

Trevor

Well-known member
Joined
Jul 17, 2009
Messages
4,513
Likes
548
Points
113
Hey I like it! one thing though the text changes depending on the class, see the yellow labels:
Laser safety - Wikipedia, the free encyclopedia

example: class 4 you must avoid direct or indirect exposure.
I've gone in and made the promised changes (beam color override, sign selection, and a counter for fun), but I haven't done this yet. I'm using the old system, but the warning phrases on the article are for the new system.

Do you (or anyone else) have suggestions for warning phrases for classes I, II, IIIa, IIIb, and IV?

-Trevor
 
Last edited:
Joined
Oct 9, 2009
Messages
432
Likes
21
Points
0
Im not sure waht the standard is really. But it just looked a bit out of place compared to the rest of the text.

Thanks
 

Trevor

Well-known member
Joined
Jul 17, 2009
Messages
4,513
Likes
548
Points
113
Im not sure waht the standard is really. But it just looked a bit out of place compared to the rest of the text.

Thanks
I centered it... looks odd to me, but that could stem from the fact that I've been working on this thing for a while now and the text has been in the corner the whole time.

EDIT: Added anti-aliasing to the beam and scatter.

-Trevor
 
Status
Not open for further replies.




Top