Supports camera upgrade to SD 1.3, ver. 2.17.762

This commit is contained in:
Milan Hanajik 2017-12-06 23:21:50 +03:00
parent f6e44914fa
commit ace0bdb2a6
7 changed files with 70 additions and 27 deletions

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 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("2.17.760.0")]
[assembly: AssemblyFileVersion("2.17.760.0")]
[assembly: AssemblyVersion("2.17.762.0")]
[assembly: AssemblyFileVersion("2.17.762.0")]

View File

@ -112,6 +112,8 @@ namespace TBF.BenchControl.Elde
#else
int flowMeterIdxAndDiv = flowMeterNr;
#endif
log.InfoFormat("Start() : SendCommand(Cmd.Start, {0}, route, {1}, {1}, {2}, {3}, {4}, 0, Stop.None)",
flowMeterIdxAndDiv, refPulses, testMethod, filterConstant, (int)pidCoef);
controlBoard.SendCommand(Command.Start, flowMeterIdxAndDiv, controlBoard.Route,
refPulses, refPulses, testMethod,

View File

@ -154,12 +154,9 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
roisAndResults = new RoisAndResults(); /// object for measurement results, writes/reads to/from this object are locked
running = false;
log.Debug(this.ToString());
}
public void Initialize()
{
cameraIdx = GetCameraIdx();
@ -211,7 +208,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
Telnet.Enqueue(new Telnet.Command(Network.Telnet.CmdAction.CLEAR_RESPONSE));
Telnet.Enqueue(new Telnet.Command(Network.Telnet.CmdAction.SEND_COMMAND, "sha1sum clp/*"));
log.FatalFormat("'{0}' with address {1} detected, IP address = {2}", Name, CameraCfg.HardwareAddress, ipAddress);
log.FatalFormat("'{0}' with address {1} detected, IP = {2}, SD = {3}", Name, CameraCfg.HardwareAddress, ipAddress, sdCardVer);
}
else
{
@ -461,7 +458,15 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
if (!sha1sumResponse.Contains(fi.Name))
{
/// Change file properties if it was a new file
sshClient.CreateCommand(string.Format("chmod 755 clp/{0}", fi.Name)).Execute();
string command = string.Format("chmod 755 clp/{0}", fi.Name);
log.InfoFormat("{0}, IP={1}, Executing command '{2}'", Name, IPAddress, command);
sshClient.CreateCommand(command).Execute();
//if (fi.Name.Equals("runmeonce"))
//{
// log.InfoFormat("{0}, IP={1}, Executing command 'sudo clp/runmeonce'", Name, IPAddress);
// sshClient.CreateCommand("sudo clp/runmeonce").Execute();
//}
}
}
}
@ -472,32 +477,32 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
///
/// Run SCP command loop
///
if (scpConnected)
while (scpConnected && !stopScpThreadFlag)
{
while (!stopScpThreadFlag)
switch (scpCommand)
{
switch (scpCommand)
{
case ScpCommand.Get:
scpCommand = ScpCommand.None;
scpClient.Download(scpRemoteFileName, new System.IO.FileInfo(scpLocalFileName));
break;
case ScpCommand.Get:
scpCommand = ScpCommand.None;
scpClient.Download(scpRemoteFileName, new System.IO.FileInfo(scpLocalFileName));
break;
case ScpCommand.Put:
scpCommand = ScpCommand.None;
scpClient.Upload(new System.IO.FileInfo(scpLocalFileName), scpRemoteFileName);
break;
case ScpCommand.Put:
scpCommand = ScpCommand.None;
scpClient.Upload(new System.IO.FileInfo(scpLocalFileName), scpRemoteFileName);
break;
default:
Thread.Sleep(250);
break;
}
default:
Thread.Sleep(250);
break;
}
scpConnected = scpClient.IsConnected;
}
scpClient.Disconnect();
running = false;
scpClient.Disconnect();
scpConnected = false;
}
}
}
catch (Exception exc)
{

View File

@ -0,0 +1,23 @@
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
# Start camera discovery daemon
/usr/bin/DiscoveryDaemon 1.3 &
exit 0

View File

@ -0,0 +1,4 @@
pkill DiscoveryDaemon
cp clp/DiscoveryDaemon /usr/bin
cp clp/rc.local /etc
shutdown -r now

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.17.761.0")]
[assembly: AssemblyFileVersion("2.17.761.0")]
[assembly: AssemblyVersion("2.17.762.0")]
[assembly: AssemblyFileVersion("2.17.762.0")]

View File

@ -2640,6 +2640,15 @@
<Content Include="CameraBinaryFiles\VisionLib.so">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles\DiscoveryDaemon">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles\rc.local">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles\runmeonce">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="packages.config" />
<None Include="Properties\app.manifest">
<SubType>Designer</SubType>