mirror of
https://github.com/preble/libpinproc
synced 2026-02-24 18:25:23 +01:00
Added PRDecode(), updated TZ.yaml to reflect it.
This commit is contained in:
@@ -11,17 +11,17 @@ PRBumpers:
|
||||
- slingR
|
||||
PRSwitches:
|
||||
flipperLwR:
|
||||
number: 1
|
||||
number: SF2
|
||||
flipperLwL:
|
||||
number: 3
|
||||
number: SF4
|
||||
flipperUpR:
|
||||
number: 5
|
||||
number: SF6
|
||||
flipperUpL:
|
||||
number: 7
|
||||
number: SF8
|
||||
slingL:
|
||||
number: 96
|
||||
number: S34
|
||||
slingR:
|
||||
number: 97
|
||||
number: S35
|
||||
PRCoils:
|
||||
flipperLwRMain:
|
||||
number: 32
|
||||
@@ -40,9 +40,17 @@ PRCoils:
|
||||
flipperUpLHold:
|
||||
number: 39
|
||||
slingL:
|
||||
number: 54
|
||||
number: C11
|
||||
slingR:
|
||||
number: 55
|
||||
number: C10
|
||||
slotKickout:
|
||||
number: C01
|
||||
rocketKickout:
|
||||
number: C02
|
||||
outhole:
|
||||
number: C08
|
||||
ballRelease:
|
||||
number: C09
|
||||
PRLamps:
|
||||
doorTheCamera:
|
||||
number: 80
|
||||
number: L11
|
||||
@@ -28,6 +28,7 @@
|
||||
*/
|
||||
#include "pinproctest.h"
|
||||
|
||||
PRMachineType machineType = kPRMachineInvalid;
|
||||
|
||||
/** Demonstration of the custom logging callback. */
|
||||
void TestLogger(PRLogLevel level, const char *text)
|
||||
@@ -147,7 +148,6 @@ int main(int argc, const char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
PRMachineType machineType = kPRMachineInvalid;
|
||||
std::string machineTypeString;
|
||||
yamlDoc["PRGame"]["machineType"] >> machineTypeString;
|
||||
if (machineTypeString == "wpc")
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
*/
|
||||
#include "pinproctest.h"
|
||||
|
||||
extern PRMachineType machineType;
|
||||
|
||||
typedef struct SwitchStatus {
|
||||
PREventType state;
|
||||
uint32_t lastEventTime;
|
||||
@@ -96,15 +98,16 @@ void ConfigureBumperRule (PRHandle proc, int swNum, int coilNum, int pulseTime)
|
||||
void ConfigureSwitchRules(PRHandle proc, YAML::Node& yamlDoc)
|
||||
{
|
||||
// WPC Flippers
|
||||
std::string numStr;
|
||||
const YAML::Node& flippers = yamlDoc[kFlippersSection];
|
||||
for (YAML::Iterator flippersIt = flippers.begin(); flippersIt != flippers.end(); ++flippersIt)
|
||||
{
|
||||
int swNum, coilMain, coilHold;
|
||||
std::string flipperName;
|
||||
*flippersIt >> flipperName;
|
||||
yamlDoc[kSwitchesSection][flipperName][kNumberField] >> swNum;
|
||||
yamlDoc[kCoilsSection][flipperName + "Main"][kNumberField] >> coilMain;
|
||||
yamlDoc[kCoilsSection][flipperName + "Hold"][kNumberField] >> coilHold;
|
||||
yamlDoc[kSwitchesSection][flipperName][kNumberField] >> numStr; swNum = PRDecode(machineType, numStr.c_str());
|
||||
yamlDoc[kCoilsSection][flipperName + "Main"][kNumberField] >> numStr; coilMain = PRDecode(machineType, numStr.c_str());
|
||||
yamlDoc[kCoilsSection][flipperName + "Hold"][kNumberField] >> numStr; coilHold = PRDecode(machineType, numStr.c_str());
|
||||
ConfigureWPCFlipperSwitchRule (proc, swNum, coilMain, coilHold, kFlipperPulseTime);
|
||||
}
|
||||
|
||||
@@ -115,8 +118,8 @@ void ConfigureSwitchRules(PRHandle proc, YAML::Node& yamlDoc)
|
||||
// WPC Slingshots
|
||||
std::string bumperName;
|
||||
*bumpersIt >> bumperName;
|
||||
yamlDoc[kSwitchesSection][bumperName][kNumberField] >> swNum;
|
||||
yamlDoc[kCoilsSection][bumperName][kNumberField] >> coilNum;
|
||||
yamlDoc[kSwitchesSection][bumperName][kNumberField] >> numStr; swNum = PRDecode(machineType, numStr.c_str());
|
||||
yamlDoc[kCoilsSection][bumperName][kNumberField] >> numStr; coilNum = PRDecode(machineType, numStr.c_str());
|
||||
ConfigureBumperRule (proc, swNum, coilNum, kBumperPulseTime);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user