Permalink
Browse files

Ensured that it only turns back on after 10 minutes

  • Loading branch information...
IAmCoder committed Nov 28, 2014
1 parent 28ca4f4 commit 7f01486b963bfccae7b3cf47d9ae71543b181240
@@ -58,13 +58,13 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_8A04AA9B98A94963AADF2135268ACC52"
"OwnerKey" = "8:_4210C5B26664BD7B4C21B3A1C66C3BE8"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_4210C5B26664BD7B4C21B3A1C66C3BE8"
"OwnerKey" = "8:_8A04AA9B98A94963AADF2135268ACC52"
"MsmSig" = "8:_UNDEFINED"
}
}
@@ -164,7 +164,7 @@
{
"Name" = "8:.NET Framework"
"Message" = "8:[VSDNETMSG]"
"FrameworkVersion" = "8:3.5.30729 "
"FrameworkVersion" = "8:3.5.30729 "
"AllowLaterVersions" = "11:FALSE"
"InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=76617"
}
@@ -351,15 +351,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Lucid Scribe Yocto PowerRelay"
"ProductCode" = "8:{12C073F6-6D3B-4498-86DE-D0D2FE713916}"
"PackageCode" = "8:{89546A09-3F39-4813-800E-7EA0B60C31AB}"
"ProductCode" = "8:{AFA8A7E2-F919-46E3-9ADA-3028F74E7119}"
"PackageCode" = "8:{D9B53D11-F058-4FF2-AEBE-AFEC67F19417}"
"UpgradeCode" = "8:{F7366005-EA41-478D-BED9-08441C13A31E}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:1.0.2"
"ProductVersion" = "8:1.0.3"
"Manufacturer" = "8:lucidcode"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:http://www.lucidcode.com/Contact"
BIN +512 Bytes (100%) Lucid Scribe - Yocto PowerRelay.suo
Binary file not shown.
@@ -18,9 +18,13 @@ public class PlugoutHandler : lucidcode.LucidScribe.Interface.LucidPlugoutBase

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

private Thread SwitchOffThread;
private Boolean SwitchingOff = false;

private Boolean AllowToSwitchOn = true;
private Thread AllowToSwitchBackOnThread;

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

if (On) return;

if (!AllowToSwitchOn) return;

YocoWrapper.YRelay relay;
string errorMessage = "";

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

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

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

}

@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]

0 comments on commit 7f01486

Please sign in to comment.