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

Function DrawInfo

xcharts0.cpp:124–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122// DrawSidebar() 1-6 times depending on the relationship chart mode.
123
124void DrawInfo(CI *pci, CONST char *szHeader, flag fAll)
125{
126 char sz[cchSzDef], szT[cchSzDef], *pch;
127 flag fT;
128
129 if (szHeader != NULL)
130 DrawPrint(szHeader, gi.kiOn, fFalse);
131 if (FSzSet(pci->nam))
132 DrawPrint(pci->nam, gi.kiLite, fFalse);
133
134 // Special cases which don't have date/time.
135 if (FNoTimeOrSpace(*pci)) {
136 DrawPrint("No time or space", gi.kiLite, fFalse);
137 return;
138 } else if (us.nRel == rcComposite) {
139 DrawPrint("Composite chart", gi.kiLite, fFalse);
140 return;
141 }
142
143 // Standard case: Print chart date, time, and location.
144 sprintf(sz, "%.3s %s", szDay[DayOfWeek(pci->mon, pci->day, pci->yea)],
145 SzDate(pci->mon, pci->day, pci->yea, fTrue));
146 DrawPrint(sz, gi.kiLite, fFalse);
147 DrawPrint(SzTim(pci->tim), gi.kiLite, fTrue);
148 fT = f1K || (us.fSeconds && !us.fOffsetOnly && is.ichLocSplit > 0);
149 sprintf(sz, " %s%s%s", fT ? "" : "(",
150 SzOffset(pci->zon, pci->dst, pci->lon), fT ? "" : ")");
151 DrawPrint(sz, gi.kiLite, fFalse);
152 if (FSzSet(pci->loc))
153 DrawPrint(pci->loc, gi.kiLite, fFalse);
154 if (!f1K)
155 DrawPrint(SzLocation(pci->lon, pci->lat), gi.kiLite, fFalse);
156 else {
157 pch = SzLocation(pci->lon, pci->lat);
158 pch[is.ichLocSplit] = chNull;
159 sprintf(sz, "Longitude: %s", pch); DrawPrint(sz, gi.kiLite, fFalse);
160 pch += is.ichLocSplit+1;
161 sprintf(sz, "Latitude: %s", pch); DrawPrint(sz, gi.kiLite, fFalse);
162 }
163
164 // Sometimes print extra information about chart settings.
165 if (!fAll)
166 return;
167 sprintf(sz, "%s%s houses", us.fHouse3D == (gi.nMode != gSphere) ?
168 "3D " : (us.fHouse3D && gi.nMode == gSphere ? "2D " : ""),
169 szSystem[is.nHouseSystem]);
170 DrawPrint(sz, gi.kiLite, fFalse);
171 sprintf(sz, "%s, %s", !us.fSidereal ? "Tropical" :
172 (!us.fSidereal2 ? "Sidereal" : "Sidereal Inv"),
173 us.objCenter == oSun ?
174 (!us.fBarycenter ? "Heliocentric" : "Barycentric") :
175 (us.objCenter == oEar ?
176 (!us.fTopoPos ? "Geocentric" : "Topocentric") :
177 szObjDisp[us.objCenter]));
178 DrawPrint(sz, gi.kiLite, fFalse);
179 sprintf(sz, !f1K ? "Julian Day: %13.5f" : "J. Day: %16.8f",
180 JulianDayFromTime(is.T));
181 DrawPrint(sz, gi.kiLite, fFalse);

Callers 1

DrawSidebarFunction · 0.85

Calls 8

DrawPrintFunction · 0.85
DayOfWeekFunction · 0.85
SzDateFunction · 0.85
SzTimFunction · 0.85
SzOffsetFunction · 0.85
SzLocationFunction · 0.85
FormatRFunction · 0.85
SzHMSFunction · 0.85

Tested by

no test coverage detected