MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / ChartTransitGraph

Function ChartTransitGraph

charts3.cpp:1090–1388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1088// (blank=aspect out of orb, "0"=0-9% of max strength, "9"=90-100% exact).
1089
1090void ChartTransitGraph(flag fTrans, flag fProg)
1091{
1092 TransGraInfo *rgEph;
1093 word **ppw, *pw, *pw2;
1094 char sz[cchSzDef];
1095 int cAsp, cSlice, cYea, dYea, occurcount = 0, ymin, x0, y0, x, y, asp,
1096 iw, iwFocus, nMax, n, ch, obj, et;
1097 flag fMonth = us.fInDayMonth, fYear = us.fInDayYear, fMark, fEclipse =
1098 us.fEclipse && !fTrans && !us.fParallel;
1099 CI ciT;
1100 real rT;
1101
1102 // Initialize variables.
1103 rgEph = (TransGraInfo *)PAllocate(sizeof(TransGraInfo),
1104 "transit graph grid");
1105 if (rgEph == NULL)
1106 goto LDone;
1107 ClearB((pbyte)(*rgEph), sizeof(TransGraInfo));
1108
1109 if (!fTrans && !fProg)
1110 ciT = ciMain;
1111 else
1112 ciT = ciTran;
1113 cAsp = fTrans && is.fReturn ? aCon : us.nAsp;
1114 ymin = 1-fTrans;
1115
1116 // Determine character width of chart based on time period being graphed.
1117 if (!fMonth) {
1118 cSlice = 49;
1119 iwFocus = (int)(ciT.tim / 0.5);
1120 } else if (!fYear) {
1121 cSlice = (DayInMonth(ciT.mon, ciT.yea) << 1) + 1;
1122 iwFocus = ((ciT.day-1) << 1) + (ciT.tim >= 12.0);
1123 } else if (us.nEphemYears <= 1) {
1124 cSlice = 12*5;
1125 iwFocus = (ciT.mon-1)*5 + (Min(ciT.day, 30)-1)/6;
1126 } else {
1127 cYea = Max(us.nEphemYears, 2); cYea = Min(cYea, 21);
1128 dYea = (cYea - 1) >> 1;
1129 cSlice = cYea*12;
1130 iwFocus = dYea*12 + (ciT.mon-1);
1131 }
1132 if (iwFocus == 0 && ciT.tim <= 0.0)
1133 iwFocus = -1;
1134
1135 // Calculate and fill out aspect strength arrays for each aspect present.
1136 if (fTrans || fProg) {
1137 ciCore = ciMain;
1138 us.fProgress = fFalse;
1139 CastChart(0);
1140 cp1 = cp0;
1141 }
1142 for (iw = 0; iw < cSlice; iw++) {
1143
1144 // Cast chart for current time slice.
1145 ciCore = ciT;
1146 if (!fMonth) {
1147 TT = (real)iw * 0.5;

Callers 1

PrintChartFunction · 0.85

Calls 15

PAllocateFunction · 0.85
ClearBFunction · 0.85
DayInMonthFunction · 0.85
CastChartFunction · 0.85
MdytszToJulianFunction · 0.85
FCreateGridFunction · 0.85
FCreateGridRelationFunction · 0.85
GetOrbFunction · 0.85
NCheckEclipseAnyFunction · 0.85
AnsiColorFunction · 0.85
SzDateFunction · 0.85
PrintSzFunction · 0.85

Tested by

no test coverage detected