EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PIDataMgr Class Reference

#include "PlanetDataMgr.h"

Inheritance diagram for PIDataMgr:
Collaboration diagram for PIDataMgr:

Public Member Functions

 ~PIDataMgr ()
 
- Public Member Functions inherited from Singleton< PIDataMgr >
 Singleton ()
 Primary constructor. More...
 

Private Attributes

PlanetDB m_db
 
std::map< uint8, PI_Schematicm_schematicData
 

PlanetDataMgr.cpp

Specific Class for managing planet and pi data : Allan

Date
: 30 November 2016
 PIDataMgr ()
 
int Initialize ()
 
PyRepGetProgramResultInfo (Colony *pColony, uint32 pinID, uint16 typeID, PyList *heads, float headRadius)
 
void GetSchematicData (uint8 schematicID, PI_Schematic &data)
 
uint8 GetProductLevel (uint16 typeID)
 
const char * GetProductName (uint16 typeID)
 
uint16 GetHeadType (uint16 ecuTypeID, uint16 programType)
 
uint32 GetMaxOutput (InventoryItemRef iRef, uint32 qtyPerCycle=0, int64 cycleTime=0)
 
uint32 GetProgramOutput (InventoryItemRef iRef, int64 cycleTime, int64 startTime=0, int64 currentTime=0)
 
uint32 GetProgramOutputPrediction (InventoryItemRef iRef, int64 cycleTime, uint32 numCycles=0)
 
void _Populate ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< PIDataMgr >
static PIDataMgrget ()
 
- Static Protected Attributes inherited from Singleton< PIDataMgr >
static std::shared_ptr< PIDataMgrmInstance
 

Detailed Description

Definition at line 48 of file PlanetDataMgr.h.

Constructor & Destructor Documentation

PIDataMgr::PIDataMgr ( )

Definition at line 92 of file PlanetDataMgr.cpp.

93 {
94 }
PIDataMgr::~PIDataMgr ( )
inline

Definition at line 53 of file PlanetDataMgr.h.

53 { /* nothing do to yet */ }

Member Function Documentation

void PIDataMgr::_Populate ( )
protected

Definition at line 104 of file PlanetDataMgr.cpp.

References DBResultRow::GetBool(), DBResultRow::GetInt(), DBQueryResult::GetRow(), PlanetDB::GetSchematicData(), PlanetDB::GetSchematicTimes(), GetTimeMSeconds(), PI_Schematic::inputs, PlanetDataMgr::m_db, PI_Schematic::outputQty, PI_Schematic::outputType, SafeDelete(), and sLog.

105 {
106  double start = GetTimeMSeconds();
107  DBQueryResult* res = new DBQueryResult();
108 
109  m_db.GetSchematicData(*res);
110  DBResultRow row;
111  std::map<uint8, PI_Schematic>::iterator itr;
112  while (res->GetRow(row)) {
113  // SELECT `schematicID`, `typeID`, `quantity`, `isInput`
114  itr = m_schematicData.find(row.GetInt(0));
115  if (itr != m_schematicData.end()) {
116  if (row.GetBool(3)) {
117  itr->second.inputs[row.GetInt(1)] = row.GetInt(2);
118  } else {
119  itr->second.outputType = row.GetInt(1);
120  itr->second.outputQty = row.GetInt(2);
121  }
122  } else {
123  PI_Schematic data = PI_Schematic();
124  if (row.GetBool(3)) {
125  data.inputs[row.GetInt(1)] = row.GetInt(2);
126  } else {
127  data.outputType = row.GetInt(1);
128  data.outputQty = row.GetInt(2);
129  }
130  m_schematicData[row.GetInt(0)] = data;
131  }
132  }
133 
134  m_db.GetSchematicTimes(*res);
135  while (res->GetRow(row)) {
136  // SELECT `schematicID`, `cycleTime`
137  itr = m_schematicData.find(row.GetInt(0));
138  if (itr != m_schematicData.end())
139  itr->second.cycleTime = row.GetInt(1);
140  }
141 
142  //cleanup
143  SafeDelete(res);
144  sLog.Cyan(" PIDataMgr", "%u PI Schematic data groups loaded in %.3fms.", m_schematicData.size(), (GetTimeMSeconds() - start));
145 }
PlanetDB m_db
Definition: PlanetDataMgr.h:74
uint16 outputQty
Definition: EVE_Planet.h:143
int32 GetInt(uint32 index) const
Definition: dbcore.cpp:635
void GetSchematicData(DBQueryResult &res)
Definition: PlanetDB.cpp:47
uint16 outputType
Definition: EVE_Planet.h:144
std::map< uint8, PI_Schematic > m_schematicData
Definition: PlanetDataMgr.h:76
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
bool GetBool(uint32 index) const
Definition: dbcore.cpp:647
std::map< uint16, uint16 > inputs
Definition: EVE_Planet.h:148
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
double GetTimeMSeconds()
Definition: utils_time.cpp:104
void GetSchematicTimes(DBQueryResult &res)
Definition: PlanetDB.cpp:54

Here is the call graph for this function:

uint16 PIDataMgr::GetHeadType ( uint16  ecuTypeID,
uint16  programType 
)

Definition at line 314 of file PlanetDataMgr.cpp.

References _log.

315 {
316  switch (ecuTypeID) {
317  case 2848: { //Barren ECU
318  switch (programType) {
319  case 2268: return 2409; //Barren Aqueous Liquid Extractor
320  case 2267: return 2430; //Barren Base Metals Extractor
321  case 2270: return 2435; //Barren Noble Metals Extractor
322  case 2073: return 2449; //Barren Microorganisms Extractor
323  case 2288: return 2459; //Barren Carbon Compounds Extractor
324  }
325  } break;
326  case 3060: { //Gas ECU
327  switch (programType) {
328  case 2268: return 2416; //Gas Aqueous Liquid Extractor
329  case 2309: return 2424; //Gas Ionic Solutions Extractor
330  case 2310: return 2426; //Gas Noble Gas Extractor
331  case 2311: return 2427; //Gas Reactive Gas Extractor
332  case 2267: return 2433; //Gas Base Metals Extractor
333  }
334  } break;
335  case 3061: { //Ice ECU
336  switch (programType) {
337  case 2268: return 2415; //Ice Aqueous Liquid Extractor
338  case 2310: return 2423; //Ice Noble Gas Extractor
339  case 2073: return 2432; //Ice Microorganisms Extractor
340  case 2286: return 2438; //Ice Planktic Colonies Extractor
341  case 2272: return 2441; //Ice Heavy Metals Extractor
342  }
343  } break;
344  case 3062: { //Lava ECU
345  switch (programType) {
346  case 2308: return 2418; //Lava Suspended Plasma Extractor
347  case 2267: return 2428; //Lava Base Metals Extractor
348  case 2272: return 2439; //Lava Heavy Metals Extractor
349  case 2306: return 2442; //Lava Non-CS Crystals Extractor
350  case 2307: return 2448; //Lava Felsic Magma Extractor
351  }
352  } break;
353  case 3063: { //Oceanic ECU
354  switch (programType) {
355  case 2268: return 2414; //Oceanic Aqueous Liquid Extractor
356  case 2287: return 2458; //Oceanic Complex Organisms Extractor
357  case 2286: return 2452; //Oceanic Planktic Colonies Extractor
358  case 2288: return 2461; //Oceanic Carbon Compounds Extractor
359  case 2073: return 2451; //Oceanic Microorganisms Extractor
360  }
361  } break;
362  case 3064: { //Plasma ECU
363  switch (programType) {
364  case 2308: return 2417; //Plasma Suspended Plasma Extractor
365  case 2267: return 2429; //Plasma Base Metals Extractor
366  case 2270: return 2434; //Plasma Noble Metals Extractor
367  case 2272: return 2440; //Plasma Heavy Metals Extractor
368  case 2306: return 2443; //Plasma Non-CS Crystals Extractor
369  }
370  } break;
371  case 3067: { //Storm ECU
372  switch (programType) {
373  case 2268: return 2413; //Storm Aqueous Liquid Extractor
374  case 2308: return 2419; //Storm Suspended Plasma Extractor
375  case 2309: return 2422; //Storm Ionic Solutions Extractor
376  case 2310: return 2425; //Storm Noble Gas Extractor
377  case 2267: return 2431; //Storm Base Metals Extractor
378  }
379  } break;
380  case 3068: { //Temperate ECU
381  switch (programType) {
382  case 2268: return 2412; //Temperate Aqueous Liquid Extractor
383  case 2073: return 2450; //Temperate Microorganisms Extractor
384  case 2287: return 2453; //Temperate Complex Organisms Extractor
385  case 2288: return 2460; //Temperate Carbon Compounds Extractor
386  case 2305: return 2462; //Temperate Autotrophs Extractor
387  }
388  } break;
389  }
390  _log(PLANET__ERROR, "PIDataMgr::GetHeadType() - Extractor typeID not found using ECU typeID: %u and Resource typeID: %u", ecuTypeID, programType);
391  return 2412; //Temperate Aqueous Liquid Extractor <<< as good a default as any...
392 }
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 PIDataMgr::GetMaxOutput ( InventoryItemRef  iRef,
uint32  qtyPerCycle = 0,
int64  cycleTime = 0 
)

Definition at line 304 of file PlanetDataMgr.cpp.

References AttrECUNoiseFactor, AttrPinCycleTime, AttrPinExtractionQuantity, EvilNumber::get_float(), EvilNumber::get_int(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), and EvE::Time::Second.

305 {
306  if (qtyPerCycle == 0)
307  qtyPerCycle = iRef->GetAttribute(AttrPinExtractionQuantity).get_uint32();
308  if (cycleTime == 0)
309  cycleTime = iRef->GetAttribute(AttrPinCycleTime).get_int() * EvE::Time::Second; // base time is 300s
310  float scalar = iRef->GetAttribute(AttrECUNoiseFactor).get_float() +1;
311  return (scalar * qtyPerCycle) * cycleTime / EvE::Time::Second / 900.0;
312 }
int64 get_int()
Definition: EvilNumber.cpp:166
uint32 get_uint32()
Definition: EvilNumber.cpp:173
EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

uint8 PIDataMgr::GetProductLevel ( uint16  typeID)

Definition at line 394 of file PlanetDataMgr.cpp.

References _log, and EvE::traceStack().

395 {
396  switch (typeID) {
397  // P0 - Raw Materials
398  case 2267: //Base Metals
399  case 2270: //Noble Metals
400  case 2272: //Heavy Metals
401  case 2306: //Non-CS Crystals
402  case 2307: //Felsic Magma
403  case 2268: //Aqueous Liquids
404  case 2308: //Suspended Plasma
405  case 2309: //Ionic Solutions
406  case 2310: //Noble Gas
407  case 2311: //Reactive Gas
408  case 2073: //Microorganisms
409  case 2286: //Planktic Colonies
410  case 2287: //Complex Organisms
411  case 2288: //Carbon Compounds
412  case 2305: //Autotrophs
413  return 0;
414 
415  // P1 - Basic Commodities
416  case 2389: //Plasmoids
417  case 2390: //Electrolytes
418  case 2392: //Oxidizing Compound
419  case 2393: //Bacteria
420  case 2395: //Proteins
421  case 2396: //Biofuels
422  case 2397: //Industrial Fibers
423  case 2398: //Reactive Metals
424  case 2399: //Precious Metals
425  case 2400: //Toxic Metals
426  case 2401: //Chiral Structures
427  case 3779: //Biomass
428  case 9828: //Silicon
429  case 3683: //Oxygen
430  case 3645: //Water
431  return 1;
432 
433  // P2 - Refined Commodities
434  case 44: //Enriched Uranium
435  case 2312: //Supertensile Plastics
436  case 2317: //Oxides
437  case 2319: //Test Cultures
438  case 2321: //Polyaramids
439  case 2327: //Microfiber Shielding
440  case 2328: //Water-Cooled CPU
441  case 2329: //Biocells
442  case 2463: //Nanites
443  case 3689: //Mechanical Parts
444  case 3691: //Synthetic Oil
445  case 3693: //Fertilizer
446  case 3695: //Polytextiles
447  case 3697: //Silicate Glass
448  case 3725: //Livestock
449  case 3775: //Viral Agent
450  case 3828: //Construction Blocks
451  case 9830: //Rocket Fuel
452  case 9832: //Coolant
453  case 9836: //Consumer Electronics
454  case 9838: //Superconductors
455  case 9840: //Transmitter
456  case 9842: //Miniature Electronics
457  case 15317: //Genetically Enhanced Livestock
458  return 2;
459 
460  // P3 - Specialized Commodities
461  case 2344: //Condensates
462  case 2345: //Camera Drones
463  case 2346: //Synthetic Synapses
464  case 2348: //Gel-Matrix Biopaste
465  case 2349: //Supercomputers
466  case 2351: //Smartfab Units
467  case 2352: //Nuclear Reactors
468  case 2354: //Neocoms
469  case 2358: //Biotech Research Reports
470  case 2360: //Industrial Explosives
471  case 2361: //Hermetic Membranes
472  case 2366: //Hazmat Detection Systems
473  case 2367: //Cryoprotectant Solution
474  case 9834: //Guidance Systems
475  case 9846: //Planetary Vehicles
476  case 9848: //Robotics
477  case 12836: //Transcranial Microcontrollers
478  case 17136: //Ukomi Superconductors
479  case 17392: //Data Chips
480  case 17898: //High-Tech Transmitters
481  case 28974: //Vaccines
482  return 3;
483 
484  // P4 - Advanced Commodities
485  case 2867: //Broadcast Node
486  case 2868: //Integrity Response Drones
487  case 2869: //Nano-Factory
488  case 2870: //Organic Mortar Applicators
489  case 2871: //Recursive Computing Module
490  case 2872: //Self-Harmonizing Power Core
491  case 2875: //Sterile Conduits
492  case 2876: //Wetware Mainframe
493  return 4;
494  }
495  _log(PLANET__ERROR, "PIDataMgr::GetProductLevel() - Commodity product level not found for typeID: %u", typeID);
496  EvE::traceStack();
497  return 0;
498 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void traceStack(void)
Definition: misc.cpp:169

Here is the call graph for this function:

const char * PIDataMgr::GetProductName ( uint16  typeID)

Definition at line 500 of file PlanetDataMgr.cpp.

References _log.

501 {
502  switch (typeID) {
503  // P0 - Raw Materials
504  case 2267: return "Base Metals";
505  case 2270: return "Noble Metals";
506  case 2272: return "Heavy Metals";
507  case 2306: return "Non-CS Crystals";
508  case 2307: return "Felsic Magma";
509  case 2268: return "Aqueous Liquids";
510  case 2308: return "Suspended Plasma";
511  case 2309: return "Ionic Solutions";
512  case 2310: return "Noble Gas";
513  case 2311: return "Reactive Gas";
514  case 2073: return "Microorganisms";
515  case 2286: return "Planktic Colonies";
516  case 2287: return "Complex Organisms";
517  case 2288: return "Carbon Compounds";
518  case 2305: return "Autotrophs";
519  // P1 - Basic Commodities
520  case 2389: return "Plasmoids";
521  case 2390: return "Electrolytes";
522  case 2392: return "Oxidizing Compound";
523  case 2393: return "Bacteria";
524  case 2395: return "Proteins";
525  case 2396: return "Biofuels";
526  case 2397: return "Industrial Fibers";
527  case 2398: return "Reactive Metals";
528  case 2399: return "Precious Metals";
529  case 2400: return "Toxic Metals";
530  case 2401: return "Chiral Structures";
531  case 3779: return "Biomass";
532  case 9828: return "Silicon";
533  case 3683: return "Oxygen";
534  case 3645: return "Water";
535  // P2 - Refined Commodities
536  case 44: return "Enriched Uranium";
537  case 2312: return "Supertensile Plastics";
538  case 2317: return "Oxides";
539  case 2319: return "Test Cultures";
540  case 2321: return "Polyaramids";
541  case 2327: return "Microfiber Shielding";
542  case 2328: return "Water-Cooled CPU";
543  case 2329: return "Biocells";
544  case 2463: return "Nanites";
545  case 3689: return "Mechanical Parts";
546  case 3691: return "Synthetic Oil";
547  case 3693: return "Fertilizer";
548  case 3695: return "Polytextiles";
549  case 3697: return "Silicate Glass";
550  case 3725: return "Livestock";
551  case 3775: return "Viral Agent";
552  case 3828: return "Construction Blocks";
553  case 9830: return "Rocket Fuel";
554  case 9832: return "Coolant";
555  case 9836: return "Consumer Electronics";
556  case 9838: return "Superconductors";
557  case 9840: return "Transmitter";
558  case 9842: return "Miniature Electronics";
559  case 15317: return "Genetically Enhanced Livestock";
560  // P3 - Specialized Commodities
561  case 2344: return "Condensates";
562  case 2345: return "Camera Drones";
563  case 2346: return "Synthetic Synapses";
564  case 2348: return "Gel-Matrix Biopaste";
565  case 2349: return "Supercomputers";
566  case 2351: return "Smartfab Units";
567  case 2352: return "Nuclear Reactors";
568  case 2354: return "Neocoms";
569  case 2358: return "Biotech Research Reports";
570  case 2360: return "Industrial Explosives";
571  case 2361: return "Hermetic Membranes";
572  case 2366: return "Hazmat Detection Systems";
573  case 2367: return "Cryoprotectant Solution";
574  case 9834: return "Guidance Systems";
575  case 9846: return "Planetary Vehicles";
576  case 9848: return "Robotics";
577  case 12836: return "Transcranial Microcontrollers";
578  case 17136: return "Ukomi Superconductors";
579  case 17392: return "Data Chips";
580  case 17898: return "High-Tech Transmitters";
581  case 28974: return "Vaccines";
582  // P4 - Advanced Commodities
583  case 2867: return "Broadcast Node";
584  case 2868: return "Integrity Response Drones";
585  case 2869: return "Nano-Factory";
586  case 2870: return "Organic Mortar Applicators";
587  case 2871: return "Recursive Computing Module";
588  case 2872: return "Self-Harmonizing Power Core";
589  case 2875: return "Sterile Conduits";
590  case 2876: return "Wetware Mainframe";
591  }
592  _log(PLANET__ERROR, "PIDataMgr::GetProductName() - Commodity product not found for typeID: %u", typeID);
593  return "NULL";
594 }
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 PIDataMgr::GetProgramOutput ( InventoryItemRef  iRef,
int64  cycleTime,
int64  startTime = 0,
int64  currentTime = 0 
)

Definition at line 264 of file PlanetDataMgr.cpp.

References GetFileTimeNow(), EvE::max(), and EvE::Time::Second.

265 {
266  // this is in client to display the Extractor window program results.
267 
268  if (startTime == 0)
269  startTime = GetFileTimeNow() - 2 * EvE::Time::Second;
270  if (currentTime == 0)
272 
273  int cycleNum = EvE::max((currentTime - startTime + EvE::Time::Second) / cycleTime - 1, 1);
274  float barWidth = cycleTime / EvE::Time::Second / 900.0; //0.13888
275  float t = (cycleNum + 0.5f) * barWidth; // 0.20833
276  // qtyPerCycle default is 1000. it is reset to calculated after this returns
277  /*
278  uint32 qtyPerCycle = iRef->GetDefaultAttribute(AttrPinExtractionQuantity).get_uint32();
279  float decayValue = qtyPerCycle / (1 + t * iRef->GetAttribute(AttrECUDecayFactor).get_float()); // 1000
280  float f1 = 1.0f / 12; // 0.08333
281  float f2 = 1.0f / 5; // 0.2
282  float f3 = 1.0f / 2; // 0.5
283  float phaseShift = pow(qtyPerCycle, 0.7); // 125.89254
284  float sinA = cos(phaseShift + t * f1); // 0.96985
285  float sinB = cos(phaseShift / 2 + t * f2); // 0.98784
286  float sinC = cos(t * f3); // 0.99457
287  float sinStuff = (sinA + sinB + sinC) / 3; // 0.98408
288  sinStuff = EvE::max(sinStuff);
289  float barHeight = decayValue * (1 + iRef->GetAttribute(AttrECUNoiseFactor).get_float() * sinStuff); //0.8
290  */
291  return uint32(barWidth * 1000); // 0.13888 * 1000 16
292 }
unsigned __int32 uint32
Definition: eve-compat.h:50
double GetFileTimeNow()
Definition: utils_time.cpp:84
int64 max(int64 x, int64 y=0)
Definition: misc.h:103
static uint32 currentTime
Definition: timer.cpp:33

Here is the call graph for this function:

uint32 PIDataMgr::GetProgramOutputPrediction ( InventoryItemRef  iRef,
int64  cycleTime,
uint32  numCycles = 0 
)

Definition at line 294 of file PlanetDataMgr.cpp.

295 {
296  uint32 val = 0;
297  if (numCycles > 120) // hardcoded in client
298  numCycles = 120;
299  for (int i=1; i <= numCycles; ++i)
300  val += GetProgramOutput(iRef, cycleTime, i * cycleTime);
301  return val;
302 }
unsigned __int32 uint32
Definition: eve-compat.h:50
uint32 GetProgramOutput(InventoryItemRef iRef, int64 cycleTime, int64 startTime=0, int64 currentTime=0)
PyRep * PIDataMgr::GetProgramResultInfo ( Colony pColony,
uint32  pinID,
uint16  typeID,
PyList heads,
float  headRadius 
)
Todo:
get head interference and calculate decayFactor, noiseFactor and overlapFactor for heads.

Definition at line 189 of file PlanetDataMgr.cpp.

References _log, AttrPinCycleTime, EvilNumber::get_int(), InventoryItem::GetAttribute(), EvE::Time::Hour, is_log_enabled, EvE::max(), PySafeDecRef, Colony::SetProgramResults(), sItemFactory, and PyList::size().

190 {
191  // ECU pinID, resource typeID, list of {headID, lat, long}, radius of head (small number...rad maybe?)
192  // qtyToDistribute, cycleTime, numCycles = self.remoteHandler.GetProgramResultInfo(pinID, typeID, pin.heads, headRadius)
193 
196  /*
197  * SEC = 10000000L
198  * MIN = SEC * 60L
199  * HOUR = MIN * 60L
200  * RADIUS_DRILLAREAMAX = 0.05
201  * RADIUS_DRILLAREAMIN = 0.01
202  * RADIUS_DRILLAREADIFF = RADIUS_DRILLAREAMAX - RADIUS_DRILLAREAMIN
203  *
204  * def GetProgramLengthFromHeadRadius(headRadius):
205  * return ((headRadius - RADIUS_DRILLAREAMIN) / RADIUS_DRILLAREADIFF) * 335 + 1 << length in hours between 1 and 336 (336h = 14d)
206  * def GetCycleTimeFromProgramLength(programLength):
207  * return 0.25 * 2 ^ max(0, math.floor(math.log(programLength / 25.0, 2)) + 1)
208  *
209  * programLength = planetCommon.GetProgramLengthFromHeadRadius(headRadius)
210  * cycleTime = planetCommon.GetCycleTimeFromProgramLength(programLength)
211  * numCycles = int(programLength / cycleTime)
212  * cycleTime = int(cycleTime * HOUR)
213  */
214  InventoryItemRef iRef = sItemFactory.GetItem(pinID);
215  float cycleTime = iRef->GetAttribute(AttrPinCycleTime).get_int()/*300*/, length = 0;
216  uint16 numCycles = 0;
217  double one = ((headRadius - 0.01f) /0.04);
218  length = one * 335 + 1; //293
219  double two = log2(length /25); //3.584962501
220  cycleTime = EvE::max(floor(two) + 1); //4
221  cycleTime = 0.25 * (pow(2, cycleTime)); // this is (float) in hours (0.25, 0.5, etc)
222  numCycles = (uint16)(length / cycleTime); //73
223  int64 iCycleTime = cycleTime * EvE::Time::Hour;
224 
225  uint32 qtyPerCycle = GetProgramOutput(iRef, iCycleTime);
226  //qtyPerCycle *= heads->size();
227 
228  _log(PLANET__TRACE, "PlanetMgr::GetProgramResultInfo() - cycleTime:%.2f, iCycleTime:%li, length:%.2f, numCycles:%u, qtyPerCycle:%u, heads: %u, headRadius:%.4f", \
229  cycleTime, iCycleTime, length, numCycles, qtyPerCycle, heads->size(), headRadius);
230 
231  PyTuple* res = new PyTuple(3);
232  res->SetItem(0, new PyInt(qtyPerCycle)); //qtyToDistribute (2843)
233  res->SetItem(1, new PyLong(iCycleTime)); //cycleTime - in usec (9000000000)
234  res->SetItem(2, new PyInt(numCycles)); //numCycles (12)
235 
236  if (is_log_enabled(PLANET__RES_DUMP))
237  res->Dump(PLANET__RES_DUMP, " ");
238 
239  pColony->SetProgramResults(pinID, typeID, numCycles, headRadius, cycleTime, qtyPerCycle);
240 
241  /* based on values noted in GetProgramOutput()
242  13:17:37 [PlanetTrace] PlanetMgr::GetProgramResultInfo() - cycleTime:0.25, iCycleTime:1251639296, length:8.28, numCycles:33, qtyPerCycle:1380 (one:0.02172, two:-1.59504) headRadius:0.0109
243  13:17:37 [PlanetResDump] Tuple: 3 elements
244  13:17:37 [PlanetResDump] [ 0] Integer: 1380
245  13:17:37 [PlanetResDump] [ 1] Long: 1251639296
246  13:17:37 [PlanetResDump] [ 2] Integer: 33
247  */
248  PySafeDecRef(heads);
249  return res;
250 }
#define _log(type, fmt,...)
Definition: logsys.h:124
Python tuple.
Definition: PyRep.h:567
#define is_log_enabled(type)
Definition: logsys.h:78
int64 get_int()
Definition: EvilNumber.cpp:166
Python integer.
Definition: PyRep.h:231
unsigned __int32 uint32
Definition: eve-compat.h:50
uint32 GetProgramOutput(InventoryItemRef iRef, int64 cycleTime, int64 startTime=0, int64 currentTime=0)
signed __int64 int64
Definition: eve-compat.h:51
int64 max(int64 x, int64 y=0)
Definition: misc.h:103
EvilNumber GetAttribute(const uint16 attrID) const
size_t size() const
Definition: PyRep.h:663
#define PySafeDecRef(op)
Definition: PyRep.h:61
#define sItemFactory
Definition: ItemFactory.h:165
unsigned __int16 uint16
Definition: eve-compat.h:48
void SetProgramResults(uint32 ecuID, uint16 typeID, uint16 numCycles, float headRadius, float cycleTime, uint32 qtyPerCycle)
Definition: Colony.cpp:832
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

void PIDataMgr::GetSchematicData ( uint8  schematicID,
PI_Schematic data 
)

Definition at line 147 of file PlanetDataMgr.cpp.

References _log.

148 {
149  std::map<uint8, PI_Schematic>::iterator itr = m_schematicData.find(schematicID);
150  if (itr != m_schematicData.end()) {
151  data = itr->second;
152  return;
153  }
154  _log(PLANET__ERROR, "PIDataMgr::GetSchematicData() - Data not found for schematic %u", schematicID);
155 }
#define _log(type, fmt,...)
Definition: logsys.h:124
std::map< uint8, PI_Schematic > m_schematicData
Definition: PlanetDataMgr.h:76
int PIDataMgr::Initialize ( )

Definition at line 96 of file PlanetDataMgr.cpp.

References PlanetDataMgr::_Populate(), and sLog.

97 {
98  _Populate();
99  sLog.Blue(" PIDataMgr", "Planet Interaction Data Manager Initialized.");
100  return 1;
101 }
void _Populate()
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250

Here is the call graph for this function:

Member Data Documentation

PlanetDB PIDataMgr::m_db
private

Definition at line 74 of file PlanetDataMgr.h.

std::map<uint8, PI_Schematic> PIDataMgr::m_schematicData
private

Definition at line 76 of file PlanetDataMgr.h.


The documentation for this class was generated from the following files: