nicesprinkler API Documentation
controller
Created on 13.08.2024
@author: wf
model
Created on 13.08.2024
@author: wf
sprinkler_cmd
Created on 13.08.2024
@author: wf
NiceSprinklerCmd
Bases: WebserverCmd
command line handling for nicesprinkler
Source code in sprinkler/sprinkler_cmd.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
__init__()
constructor
Source code in sprinkler/sprinkler_cmd.py
25 26 27 28 29 30 | |
getArgParser(description, version_msg)
override the default argparser call
Source code in sprinkler/sprinkler_cmd.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
main(argv=None)
main call
Source code in sprinkler/sprinkler_cmd.py
56 57 58 59 60 61 62 | |
sprinkler_core
Created on 2024-08-13
@author: wf
Angles
Initial angles for the sprinkler
Source code in sprinkler/sprinkler_core.py
30 31 32 33 34 35 36 | |
HosePerformance
Hose performance specifications
Source code in sprinkler/sprinkler_core.py
38 39 40 41 42 43 44 | |
Lawn
Lawn dimensions in meters
Source code in sprinkler/sprinkler_core.py
13 14 15 16 17 18 19 | |
MotorConfig
Configuration for a single motor
Source code in sprinkler/sprinkler_core.py
46 47 48 49 50 51 52 53 54 55 56 | |
SprinklerConfig
Complete configuration for the sprinkler system
Source code in sprinkler/sprinkler_core.py
58 59 60 61 62 63 64 65 66 67 | |
SprinklerPosition
Sprinkler position in the lawn
Source code in sprinkler/sprinkler_core.py
21 22 23 24 25 26 27 28 | |
SprinklerSystem
Main sprinkler system class
Source code in sprinkler/sprinkler_core.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
analyze_stl()
Analyze the STL file to determine key points for spray calculation
Source code in sprinkler/sprinkler_core.py
81 82 83 84 85 86 87 88 89 90 91 92 | |
get_spray_origin()
Get the spray origin from the config
Source code in sprinkler/sprinkler_core.py
94 95 96 97 98 99 100 | |
sprinkler_sim
Created on 2024-08-13
@author: wf
SprinklerSimulation
A sprinkler simulation
Source code in sprinkler/sprinkler_sim.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
stepper
Created on 13.08.2024
@author: wf
version
Created on 2024-08-13
@author: wf
Version
dataclass
Bases: object
Version handling for nicesprinkler
Source code in sprinkler/version.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
webserver
Created on 13.08.2024
@author: wf
NiceSprinklerSolution
Bases: InputWebSolution
the NiceSprinkler solution
Source code in sprinkler/webserver.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
__init__(webserver, client)
Initialize the solution
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
webserver |
NiceSprinklerWebServer
|
The webserver instance associated with this context. |
required |
client |
Client
|
The client instance this context is associated with. |
required |
Source code in sprinkler/webserver.py
71 72 73 74 75 76 77 78 79 80 | |
configure_settings()
Generates the settings page with options to modify sprinkler configuration.
Source code in sprinkler/webserver.py
100 101 102 103 | |
home()
async
Generates the home page with a 3D viewer and controls for the sprinkler.
Source code in sprinkler/webserver.py
82 83 84 85 86 87 88 89 90 91 92 | |
reset_simulation()
async
Resets the simulation to its initial state.
Source code in sprinkler/webserver.py
94 95 96 97 98 | |
update_config(e)
Updates the simulation configuration based on user input.
Source code in sprinkler/webserver.py
105 106 107 108 109 110 111 112 113 114 | |
NiceSprinklerWebServer
Bases: InputWebserver
WebServer class that manages the server and handles Sprinkler operations.
Source code in sprinkler/webserver.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
__init__()
Constructs all the necessary attributes for the WebServer object.
Source code in sprinkler/webserver.py
32 33 34 35 | |
configure_run()
Configure the run based on command line arguments
Source code in sprinkler/webserver.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |