Skip to content

Commit

Permalink
Ensured that it only turns back on after 10 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmCoder committed Nov 28, 2014
1 parent 28ca4f4 commit 7f01486
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Installer/Lucid Scribe Yocto PowerRelay.vdproj
Expand Up @@ -58,13 +58,13 @@
"Entry" "Entry"
{ {
"MsmKey" = "8:_UNDEFINED" "MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_8A04AA9B98A94963AADF2135268ACC52" "OwnerKey" = "8:_4210C5B26664BD7B4C21B3A1C66C3BE8"
"MsmSig" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED"
} }
"Entry" "Entry"
{ {
"MsmKey" = "8:_UNDEFINED" "MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_4210C5B26664BD7B4C21B3A1C66C3BE8" "OwnerKey" = "8:_8A04AA9B98A94963AADF2135268ACC52"
"MsmSig" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED"
} }
} }
Expand Down Expand Up @@ -164,7 +164,7 @@
{ {
"Name" = "8:.NET Framework" "Name" = "8:.NET Framework"
"Message" = "8:[VSDNETMSG]" "Message" = "8:[VSDNETMSG]"
"FrameworkVersion" = "8:3.5.30729 " "FrameworkVersion" = "8:3.5.30729 "
"AllowLaterVersions" = "11:FALSE" "AllowLaterVersions" = "11:FALSE"
"InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=76617" "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=76617"
} }
Expand Down Expand Up @@ -351,15 +351,15 @@
{ {
"Name" = "8:Microsoft Visual Studio" "Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Lucid Scribe Yocto PowerRelay" "ProductName" = "8:Lucid Scribe Yocto PowerRelay"
"ProductCode" = "8:{12C073F6-6D3B-4498-86DE-D0D2FE713916}" "ProductCode" = "8:{AFA8A7E2-F919-46E3-9ADA-3028F74E7119}"
"PackageCode" = "8:{89546A09-3F39-4813-800E-7EA0B60C31AB}" "PackageCode" = "8:{D9B53D11-F058-4FF2-AEBE-AFEC67F19417}"
"UpgradeCode" = "8:{F7366005-EA41-478D-BED9-08441C13A31E}" "UpgradeCode" = "8:{F7366005-EA41-478D-BED9-08441C13A31E}"
"AspNetVersion" = "8:4.0.30319.0" "AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE" "RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE" "RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:TRUE" "InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:1.0.2" "ProductVersion" = "8:1.0.3"
"Manufacturer" = "8:lucidcode" "Manufacturer" = "8:lucidcode"
"ARPHELPTELEPHONE" = "8:" "ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:http://www.lucidcode.com/Contact" "ARPHELPLINK" = "8:http://www.lucidcode.com/Contact"
Expand Down
Binary file modified Lucid Scribe - Yocto PowerRelay.suo
Binary file not shown.
16 changes: 16 additions & 0 deletions Yocto PowerRelay/PlugoutHandler.cs
Expand Up @@ -18,9 +18,13 @@ public class PlugoutHandler : lucidcode.LucidScribe.Interface.LucidPlugoutBase


private Boolean Failed = false; private Boolean Failed = false;
private Boolean On = false; private Boolean On = false;

private Thread SwitchOffThread; private Thread SwitchOffThread;
private Boolean SwitchingOff = false; private Boolean SwitchingOff = false;


private Boolean AllowToSwitchOn = true;
private Thread AllowToSwitchBackOnThread;

public override string Name public override string Name
{ {
get { return "Yocto PowerRelay"; } get { return "Yocto PowerRelay"; }
Expand All @@ -44,6 +48,8 @@ public override void Trigger()


if (On) return; if (On) return;


if (!AllowToSwitchOn) return;

YocoWrapper.YRelay relay; YocoWrapper.YRelay relay;
string errorMessage = ""; string errorMessage = "";


Expand Down Expand Up @@ -78,6 +84,11 @@ public override void Trigger()
// Turn it off in a minute // Turn it off in a minute
SwitchOffThread = new Thread(SwitchOff); SwitchOffThread = new Thread(SwitchOff);
SwitchOffThread.Start(); SwitchOffThread.Start();

// And allow it to turn back on in 10
AllowToSwitchOn = false;
AllowToSwitchBackOnThread = new Thread(AllowToSwitchBackOn);
AllowToSwitchBackOnThread.Start();
} }
} }
else else
Expand All @@ -102,6 +113,11 @@ public void SwitchOff()
On = false; On = false;
} }


public void AllowToSwitchBackOn()
{
Thread.Sleep(1000 * 60 * 10);
AllowToSwitchOn = true;
}


} }


Expand Down
4 changes: 2 additions & 2 deletions Yocto PowerRelay/Properties/AssemblyInfo.cs
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")] [assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.2.0")] [assembly: AssemblyFileVersion("1.0.3.0")]

0 comments on commit 7f01486

Please sign in to comment.