generated from arras-energy/gridlabd-old
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: David P. Chassin <[email protected]>
- Loading branch information
David P. Chassin
committed
Sep 22, 2023
1 parent
c419df4
commit 936f76d
Showing
51 changed files
with
9,566 additions
and
9,342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
[[/Converters/Import/Spida_data]] -- SPIDACalc data import | ||
|
||
# Synopis | ||
|
||
GLM: | ||
~~~ | ||
#convert SPIDACALC.xls GEODATA.csv -f xls-spida -t csv-geodata [precision=2] [extract_equipment=yes] [include_network=yes] | ||
~~~ | ||
|
||
# Description | ||
|
||
This converter extracts pole geodata from a SPIDAcalc pole asset report spreadsheet and generates a GriDLAB-D geodata CSV file. | ||
|
||
|
||
# Options | ||
|
||
- `precision=2`: specify the number of digits in a number and function ROUND will be used (default 2) | ||
|
||
- `extract_equipment=yes`: enable the conversion of pole-mounted equipment, dummy values will be used for equipment properties (default None) | ||
|
||
- `include_network=yes`: enable the generation of a bus-type feeder, dummy values will be used for properties of feeder and equipment (default None) | ||
|
||
- `include_weather=NAME`: name the weather object and do not use dummy values for weather data (default None) | ||
|
||
# Input | ||
|
||
[SPIDAcalc](https://www.spidasoftware.com/spidacalc/) is proprietarty pole loading and line design software that some utilities use to model the forces on transmission and distribution systems. The data includes detailed specifications and location data for poles, mounted equipment and lines. | ||
|
||
The input .xls must include a sheet called 'Design - Pole'. | ||
If `extract_equipment=yes`, then it must also include a sheet called 'Design - Structure' | ||
|
||
This SPIDACalc API documentation explains data in the pole asset report spreadsheet: | ||
https://github.com/spidasoftware/schema/blob/66cb5d102dde5bf23b487dbddb261d3a88fc0907/doc/wfs.md | ||
https://github.com/spidasoftware/schema/blob/master/doc/calc.md | ||
|
||
For quick reference, some of the less obvious meanings are included below: | ||
In 'Design - Pole': | ||
* `AGL` means Above Ground Length | ||
* `GLC` means GroundLine Circumference | ||
|
||
In 'Design - Structure': | ||
* `Direction` is a bearing for the mounted equipment, measured in degrees clockwise from North. | ||
* A WEP is a Wire End Point, indicating the pole or building at the other end of a wire. Here `Offset/Lead` corresponds to the length of wire between the pole and this Wire End Point. | ||
* For Insulators: "If on pole, then `offest` is attach height. If on cross arm, then `offset` is the distance from one end of the cross arm." - (SPIDAcalc docs)[https://github.com/spidasoftware/schema/blob/66cb5d102dde5bf23b487dbddb261d3a88fc0907/doc/wfs.md] | ||
* For CrossArms: "Crossarm bearing is the direction the end of the crossarm points, not the direction of the bolt attachment." - (SPIDAcalc docs)[https://github.com/spidasoftware/schema/blob/66cb5d102dde5bf23b487dbddb261d3a88fc0907/doc/wfs.md] | ||
|
||
|
||
# Output | ||
|
||
A csv where each row represents a GridLAB-D object, columns are properties for that object. | ||
**See the documentation for the respective GridLAB-D objects to interpret the properties.** | ||
|
||
The following objects can be included in the output: | ||
`pole`, `pole_configuration` | ||
If `extract_equipment=yes`, it will also include `pole_mount`. | ||
|
||
|
||
# See also | ||
|
||
* [[/Converters/Import/Csv_files]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# C++ code files | ||
|
||
The 'PT_' preffix for variable names means "Property Type". | ||
|
||
oclass means object class | ||
pclass means parent class | ||
|
||
## get_<property>_offset() | ||
These functions return offsets in memory location. Every object attribute is listed sequentially in memory (I believe in the order that they are declared?). This function returns the difference in the memory address of an attribute from the start of the object in memory. It's defined by a macro, `GL_ATOMIC(type, attribute name)` which generates a callable function specific to every attribute it's applied to. | ||
|
||
The code looks like this: | ||
`static inline size_t get_##X##_offset(void) { return (char*)&(defaults->X)-(char*)defaults; };` | ||
|
||
`defaults` is a class attribute, a pointer to an object of the same type as the class it's a part of. Say we are looking at the `pole` class. `defaults` will be a pointer to a pole object. Confusingly, `defaults` is never inititialized to anything beyond NULL. How does this work? Back when this program was written in C, `defaults` pointed to a chunk of memory holding an object with all attributes initilized to default values. In C you could create a new object by simply copying this memory chunk. In C++ you need to declare all the attributes within an object, not just the object itself. The old method of setting defaults stopped working, so it's done differently now. The `defaults` pointer was retained as an attribute in the class declaration. The get offset function uses it for pointer math, finding the differences in memory location between the start of an object and all of it's attributes. Because a class declaration includes the type of all attributes, the compiler can figure out how much space they will take up in memory. (In C++ all types have a fixed size.) 'defaults' never needs to be initialized. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.