Last active
March 21, 2023 23:55
-
-
Save mentisy/aef278ad81767c3e15e70b7a0347732f to your computer and use it in GitHub Desktop.
Example of commented code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////// | |
// Change state of water for toilet | |
// | |
// Parameter `State`: | |
// - 0: Open | |
// - 1: Close | |
// - 2: Toggle? Or reverify state? | |
/////////////////////////////////////// | |
Global Function SetWaterWC (State As Long) | |
WaterProcesBusy[2].Lock() | |
Select State | |
Case 0 | |
Cell01_Relay_EnableWater_WC.Open() | |
Cell01_Relay_EnableWater_WC_FB.Open() | |
Case 1 | |
Cell01_Relay_EnableWater_WC.Close() | |
Cell01_Relay_EnableWater_WC_FB.Close() | |
Case 2 | |
If Cell01_Relay_EnableWater_WC.IsClosed() Then | |
Cell01_Relay_EnableWater_WC.Close() | |
Cell01_Relay_EnableWater_WC_FB.Close() | |
Else | |
Cell01_Relay_EnableWater_WC.Open() | |
Cell01_Relay_EnableWater_WC_FB.Open() | |
End If | |
End Select | |
WaterProcesBusy[1].Lock() | |
End Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change state of water for toilet | |
* | |
* @param int $state 0: Open, 1: Close, 2: Toggle | |
* @return void | |
*/ | |
public function SetWaterWC(int $state) | |
{ | |
switch ($state) { | |
case 0: echo "open"; | |
case 1: echo "close"; | |
case 2: echo "toggle?"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment