Commit 168db6d4 by Pascal Bigot

--no commit message

parent 68d00b5a
......@@ -610,16 +610,19 @@ namespace CommonLib
try
{
// si il y a une image, on la charge
PathTranslator.CheckFileExistOrThrow(strImageFullPath);
Bitmap imgBack = new Bitmap(strImageFullPath);
imgBack.MakeTransparent(Cste.TransparencyColor);
// ets i besoin on réajuste la taille du panel
if (imgBack.Width > m_DynamicPanel.Width)
m_DynamicPanel.Width = imgBack.Width;
if (imgBack.Height > m_DynamicPanel.Height)
m_DynamicPanel.Height = imgBack.Height;
m_DynamicPanel.BackgroundImage = imgBack;
if (!string.IsNullOrEmpty(strImageFullPath))
{
PathTranslator.CheckFileExistOrThrow(strImageFullPath);
Bitmap imgBack = new Bitmap(strImageFullPath);
imgBack.MakeTransparent(Cste.TransparencyColor);
// ets i besoin on réajuste la taille du panel
if (imgBack.Width > m_DynamicPanel.Width)
m_DynamicPanel.Width = imgBack.Width;
if (imgBack.Height > m_DynamicPanel.Height)
m_DynamicPanel.Height = imgBack.Height;
m_DynamicPanel.BackgroundImage = imgBack;
}
}
catch (Exception)
{
......
......@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.2.0.1")]
[assembly: AssemblyFileVersion("3.2.0.1")]
[assembly: AssemblyVersion("3.2.0.2")]
[assembly: AssemblyFileVersion("3.2.0.2")]
......@@ -53,9 +53,7 @@ namespace CommonLib
List<PreParsedLine> retPreParsedScript = new List<PreParsedLine>();
for (int i = 0; i < script.Length; i++)
{
if (!string.IsNullOrEmpty(script[i]))
retPreParsedScript.Add(PreParseLine(script[i]));
string line = script[i].Trim(' ');
string line = script[i].Replace(" ", "");
if (!string.IsNullOrEmpty(line) && !line.StartsWith("//"))
retPreParsedScript.Add(PreParseLine(line));
}
......
......@@ -191,24 +191,24 @@ namespace CommonLib
lock (this)
{
QuickId = m_PileScriptsToExecute.Peek();
if (QuickId != 0)
{
InternalExecuteScript(QuickId);
// il est éxécuté, on l'enlève de la liste.
m_PileScriptsToExecute.Dequeue();
if (EventScriptExecuted != null)
EventScriptExecuted(QuickId);
}
else
{
Traces.LogAddCritical(TraceCat.Executer, string.Format("un quickId 0 est sortie de la FIFO"));
}
}
if (QuickId != 0)
{
InternalExecuteScript(QuickId);
// il est éxécuté, on l'enlève de la liste.
m_PileScriptsToExecute.Dequeue();
if (EventScriptExecuted != null)
EventScriptExecuted(QuickId);
}
else
{
Traces.LogAddCritical(TraceCat.Executer, string.Format("un quickId 0 est sortie de la FIFO"));
}
}
catch (Exception ex)
{
LogEvent evt = new LogEvent(LOG_EVENT_TYPE.ERROR, string.Format(Lang.LangSys.C("Error in execution motor {0}", ex.Message)));
LogEvent evt = new LogEvent(LOG_EVENT_TYPE.ERROR, string.Format(Lang.LangSys.C("Error in execution motor {0}"), ex.Message));
AddLogEvent(evt);
}
......
......@@ -13,7 +13,7 @@ namespace CtrlCnxManager
/// </summary>
internal class CtrlCnxManagerCmdControl : BTDllCtrlCnxManagerControl
{
Timer m_watchdogTimer = new Timer();
System.Timers.Timer m_watchdogTimer = new System.Timers.Timer();
BTDoc m_Doc;
DateTime m_DisconnectionTime;
Timer m_RestartDelayTimer = new Timer();
......@@ -24,10 +24,10 @@ namespace CtrlCnxManager
: base(document)
{
m_watchdogTimer.Interval = 10000;
m_watchdogTimer.Tick += new EventHandler(m_watchdogTimer_Tick);
m_watchdogTimer.Elapsed += new System.Timers.ElapsedEventHandler(m_watchdogTimer_Tick);
}
void m_watchdogTimer_Tick(object sender, EventArgs e)
void m_watchdogTimer_Tick(object sender, System.Timers.ElapsedEventArgs e)
{
DllCtrlCnxManagerProp SpecProps = this.SpecificProp as DllCtrlCnxManagerProp;
if (m_Doc != null && SpecProps != null)
......@@ -46,7 +46,14 @@ namespace CtrlCnxManager
// celui est co
if (!m_Doc.IsRunning && m_Doc.Communication.IsOpen)
{
m_Doc.TraiteMessage(MESSAGE.MESS_CMD_RUN, null, TYPE_APP.SMART_COMMAND);
if (this.m_Ctrl.InvokeRequired)
{
this.m_Ctrl.BeginInvoke(new EventHandler(SendStartCommand), this, null);
}
else
{
SendStartCommand(this, null);
}
}
TimeSpan tsDelta = (DateTime.Now - m_DisconnectionTime);
if (m_DisconnectionTime != DateTime.MinValue && tsDelta.Minutes >= SpecProps.RetryCnxPeriod)
......@@ -56,6 +63,10 @@ namespace CtrlCnxManager
}
}
private void SendStartCommand(object sender, EventArgs e)
{
m_Doc.TraiteMessage(MESSAGE.MESS_CMD_RUN, null, TYPE_APP.SMART_COMMAND);
}
/// <summary>
/// Constructeur de l'objet graphique affiché dans les écrans de supervision
/// </summary>
......@@ -125,7 +136,7 @@ namespace CtrlCnxManager
{
// message de requête sur les conséquence d'une supression
case MESSAGE.MESS_CMD_STOP:
if (m_watchdogTimer.Enabled == false)
if (m_watchdogTimer.Enabled == false && m_Ctrl != null && !m_Ctrl.IsDisposed)
m_watchdogTimer.Start(); // et oui il n'est jamais arrêté
// et sa première mise en marche correspond à l'arret de la supervision suite à une coupure de connexion
......
......@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.1.0")]
[assembly: AssemblyFileVersion("1.1.1.0")]
[assembly: AssemblyVersion("1.1.1.1")]
[assembly: AssemblyFileVersion("1.1.1.1")]
......@@ -21,13 +21,13 @@ winxpsp2_title=Windows XP Service Pack 2
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{2FE97D82-A4DD-4235-A710-9C1A17CAE705}
AppName=Smart Application V3
AppVerName=Smart Application 3.2.0.1
AppVerName=Smart Application 3.2.0.2
AppPublisher=Pascal Bigot
AppCopyright=Copyright (C) 2007-2012 Pascal Bigot
AppPublisherURL=http://www.smartappsoftware.net
AppSupportURL=http://www.smartappsoftware.net
AppUpdatesURL=http://www.smartappsoftware.net
AppVersion=3.2.0.1
AppVersion=3.2.0.2
DefaultDirName={pf}\M3Tool\Smart Application V3
DefaultGroupName=Smart Application V3
AllowNoIcons=yes
......
......@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.2.0.1")]
[assembly: AssemblyFileVersion("3.2.0.1")]
[assembly: AssemblyVersion("3.2.0.2")]
[assembly: AssemblyFileVersion("3.2.0.2")]
......@@ -464,34 +464,43 @@ namespace SmartApp
}
}
void doc_VirtualDataFormStateChanged(BTDoc sender, VirtualDataForm form, bool bOpen)
{
if (m_VirtualDataFormContainter == null)
if (this.InvokeRequired)
{
m_VirtualDataFormContainter = new VirtualCnxContainer();
this.BeginInvoke(new VirtualDataFormOpenClose(doc_VirtualDataFormStateChanged), sender, form, bOpen);
}
if (form != null)
else
{
if (bOpen)
if (m_VirtualDataFormContainter == null)
{
m_VirtualDataFormContainter = new VirtualCnxContainer();
}
if (form != null)
{
if (bOpen)
{
form.MdiParent = m_VirtualDataFormContainter;
form.Show();
}
else
{
form.MdiParent = null;
form.Close();
}
}
if (m_VirtualDataFormContainter.MdiChildren.Length == 0)
{
form.MdiParent = m_VirtualDataFormContainter;
form.Show();
m_VirtualDataFormContainter.DisableCloseProtection = true;
m_VirtualDataFormContainter.Close();
m_VirtualDataFormContainter = null;
}
else
{
form.MdiParent = null;
form.Close();
m_VirtualDataFormContainter.Show();
}
}
if (m_VirtualDataFormContainter.MdiChildren.Length == 0)
{
m_VirtualDataFormContainter.Close();
m_VirtualDataFormContainter = null;
}
else
{
m_VirtualDataFormContainter.Show();
}
}
/// <summary>
......
......@@ -10,6 +10,14 @@ namespace SmartApp
{
public partial class VirtualCnxContainer : Form
{
private bool m_bDisableCloseProtection = false;
public bool DisableCloseProtection
{
get { return m_bDisableCloseProtection; }
set { m_bDisableCloseProtection = value; }
}
public VirtualCnxContainer()
{
InitializeComponent();
......@@ -37,7 +45,7 @@ namespace SmartApp
private void VirtualCnxContainer_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
if (e.CloseReason == CloseReason.UserClosing && !m_bDisableCloseProtection)
{
e.Cancel = true;
this.WindowState = FormWindowState.Minimized;
......
......@@ -64,7 +64,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="postUpdateCopy.bat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment