mirror of
https://github.com/preble/libpinproc
synced 2026-02-24 18:25:23 +01:00
pinproctest: Expanded YAML format to allow for fields inside of each PRSwitches/PRLamps/PRCoils entry. Added use of 'number' field. Added TZ.yaml.
This commit is contained in:
@@ -10,20 +10,36 @@ PRBumpers:
|
|||||||
- slingL
|
- slingL
|
||||||
- slingR
|
- slingR
|
||||||
PRSwitches:
|
PRSwitches:
|
||||||
flipperLwR: 1
|
flipperLwR:
|
||||||
flipperLwL: 3
|
number: 1
|
||||||
flipperUpR: 5
|
flipperLwL:
|
||||||
flipperUpL: 7
|
number: 3
|
||||||
slingL: 96
|
flipperUpR:
|
||||||
slingR: 97
|
number: 5
|
||||||
|
flipperUpL:
|
||||||
|
number: 7
|
||||||
|
slingL:
|
||||||
|
number: 96
|
||||||
|
slingR:
|
||||||
|
number: 97
|
||||||
PRCoils:
|
PRCoils:
|
||||||
flipperLwRMain: 32
|
flipperLwRMain:
|
||||||
flipperLwRHold: 33
|
number: 32
|
||||||
flipperLwLMain: 34
|
flipperLwRHold:
|
||||||
flipperLwLHold: 35
|
number: 33
|
||||||
flipperUpRMain: 36
|
flipperLwLMain:
|
||||||
flipperUpRHold: 37
|
number: 34
|
||||||
flipperUpLMain: 38
|
flipperLwLHold:
|
||||||
flipperUpLHold: 39
|
number: 35
|
||||||
slingL: 54
|
flipperUpRMain:
|
||||||
slingR: 55
|
number: 36
|
||||||
|
flipperUpRHold:
|
||||||
|
number: 37
|
||||||
|
flipperUpLMain:
|
||||||
|
number: 38
|
||||||
|
flipperUpLHold:
|
||||||
|
number: 39
|
||||||
|
slingL:
|
||||||
|
number: 54
|
||||||
|
slingR:
|
||||||
|
number: 55
|
||||||
48
examples/pinproctest/TZ.yaml
Normal file
48
examples/pinproctest/TZ.yaml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# P-ROC Game Description file for Twilight Zone
|
||||||
|
PRGame:
|
||||||
|
machineType: wpc
|
||||||
|
PRFlippers:
|
||||||
|
- flipperLwR
|
||||||
|
- flipperLwL
|
||||||
|
- flipperUpR
|
||||||
|
- flipperUpL
|
||||||
|
PRBumpers:
|
||||||
|
- slingL
|
||||||
|
- slingR
|
||||||
|
PRSwitches:
|
||||||
|
flipperLwR:
|
||||||
|
number: 1
|
||||||
|
flipperLwL:
|
||||||
|
number: 3
|
||||||
|
flipperUpR:
|
||||||
|
number: 5
|
||||||
|
flipperUpL:
|
||||||
|
number: 7
|
||||||
|
slingL:
|
||||||
|
number: 96
|
||||||
|
slingR:
|
||||||
|
number: 97
|
||||||
|
PRCoils:
|
||||||
|
flipperLwRMain:
|
||||||
|
number: 32
|
||||||
|
flipperLwRHold:
|
||||||
|
number: 33
|
||||||
|
flipperLwLMain:
|
||||||
|
number: 34
|
||||||
|
flipperLwLHold:
|
||||||
|
number: 35
|
||||||
|
flipperUpRMain:
|
||||||
|
number: 36
|
||||||
|
flipperUpRHold:
|
||||||
|
number: 37
|
||||||
|
flipperUpLMain:
|
||||||
|
number: 38
|
||||||
|
flipperUpLHold:
|
||||||
|
number: 39
|
||||||
|
slingL:
|
||||||
|
number: 54
|
||||||
|
slingR:
|
||||||
|
number: 55
|
||||||
|
PRLamps:
|
||||||
|
doorTheCamera:
|
||||||
|
number: 80
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
#define kBumpersSection "PRBumpers"
|
#define kBumpersSection "PRBumpers"
|
||||||
#define kCoilsSection "PRCoils"
|
#define kCoilsSection "PRCoils"
|
||||||
#define kSwitchesSection "PRSwitches"
|
#define kSwitchesSection "PRSwitches"
|
||||||
|
#define kNumberField "number"
|
||||||
|
|
||||||
#define kFlipperPulseTime (34) // 34 ms
|
#define kFlipperPulseTime (34) // 34 ms
|
||||||
#define kBumperPulseTime (25) // 25 ms
|
#define kBumperPulseTime (25) // 25 ms
|
||||||
@@ -243,9 +244,9 @@ void ConfigureSwitchRules(PRHandle proc, YAML::Node& yamlDoc)
|
|||||||
int swNum, coilMain, coilHold;
|
int swNum, coilMain, coilHold;
|
||||||
std::string flipperName;
|
std::string flipperName;
|
||||||
*flippersIt >> flipperName;
|
*flippersIt >> flipperName;
|
||||||
yamlDoc[kSwitchesSection][flipperName] >> swNum;
|
yamlDoc[kSwitchesSection][flipperName][kNumberField] >> swNum;
|
||||||
yamlDoc[kCoilsSection][flipperName + "Main"] >> coilMain;
|
yamlDoc[kCoilsSection][flipperName + "Main"][kNumberField] >> coilMain;
|
||||||
yamlDoc[kCoilsSection][flipperName + "Hold"] >> coilHold;
|
yamlDoc[kCoilsSection][flipperName + "Hold"][kNumberField] >> coilHold;
|
||||||
ConfigureWPCFlipperSwitchRule (proc, swNum, coilMain, coilHold, kFlipperPulseTime);
|
ConfigureWPCFlipperSwitchRule (proc, swNum, coilMain, coilHold, kFlipperPulseTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,8 +257,8 @@ void ConfigureSwitchRules(PRHandle proc, YAML::Node& yamlDoc)
|
|||||||
// WPC Slingshots
|
// WPC Slingshots
|
||||||
std::string bumperName;
|
std::string bumperName;
|
||||||
*bumpersIt >> bumperName;
|
*bumpersIt >> bumperName;
|
||||||
yamlDoc[kSwitchesSection][bumperName] >> swNum;
|
yamlDoc[kSwitchesSection][bumperName][kNumberField] >> swNum;
|
||||||
yamlDoc[kCoilsSection][bumperName] >> coilNum;
|
yamlDoc[kCoilsSection][bumperName][kNumberField] >> coilNum;
|
||||||
ConfigureBumperRule (proc, swNum, coilNum, kBumperPulseTime);
|
ConfigureBumperRule (proc, swNum, coilNum, kBumperPulseTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user