Commit 150a84e0 by Pascal Bigot

--no commit message

parent f95bc944
......@@ -89,10 +89,9 @@ namespace CommonLib
get { return m_bModeRun; }
set
{
bool prevValue = m_bModeRun;
m_bModeRun = value;
if (value != prevValue)
if (value != m_bModeRun)
{
m_bModeRun = value;
UpdateRunState();
NotifyRunStateChange();
}
......@@ -756,6 +755,7 @@ namespace CommonLib
if (m_Comm.IsOpen && m_Comm.CommType == TYPE_COMM.VIRTUAL)
{
m_virtualDataForm = new VirtualDataForm(this);
m_virtualDataForm.Text += " - " + Path.GetFileNameWithoutExtension(this.FileName);
m_virtualDataForm.Show();
m_virtualDataForm.BringToFront();
}
......
......@@ -38,9 +38,17 @@ namespace CommonLib
public bool IsRunning
{
get { return m_bModeRun; }
protected set
{
if (m_bModeRun != value)
{
m_bModeRun = value;
NotifyRunStateChange();
}
}
}
public void NotifyRunStateChange()
protected void NotifyRunStateChange()
{
if (OnRunStateChange != null)
OnRunStateChange(this);
......
......@@ -176,7 +176,11 @@ namespace CommonLib
case MESSAGE.MESS_ITEM_DELETED:
case MESSAGE.MESS_ITEM_RENAMED:
case MESSAGE.MESS_CMD_RUN:
this.IsRunning = true;
break;
case MESSAGE.MESS_CMD_STOP:
this.IsRunning = false;
break;
case MESSAGE.MESS_PRE_PARSE:
break;
}
......
......@@ -638,7 +638,7 @@ namespace CommonLib
switch (Mess)
{
case MESSAGE.MESS_PRE_PARSE:
if (this.m_ScriptContainer["EvtScript"].Length != 0)
if (this.m_ScriptContainer["EvtScript"] != null && this.m_ScriptContainer["EvtScript"].Length != 0)
this.m_iQuickScriptID = m_Executer.PreParseScript(this.m_ScriptContainer["EvtScript"]);
break;
default :
......
......@@ -254,7 +254,8 @@ namespace CommonLib
m_Timer.Stop();
CommonLib.PerfChrono theChrono = new PerfChrono();
m_Executer.ExecuteScript(this.m_iQuickScriptID);
if (this.ItemScripts["TimerScript"].Length != 0)
m_Executer.ExecuteScript(this.m_iQuickScriptID);
theChrono.EndMeasure("InstanceName = " + this.Symbol);
m_Timer.Start();
}
......
......@@ -258,40 +258,30 @@ namespace CommonLib
}
else if (curNode.Name == NODE_PROJECT_LIST)
{
// d'abord les supervision
foreach (XmlNode NodeProj in curNode.ChildNodes)
{
XmlAttribute attr = NodeProj.Attributes[ATTR_VALUE];
string cheminProj = attr.Value;
string cheminProjExt = Path.GetExtension(cheminProj);
if (cheminProjExt.EndsWith(".sab"))
continue;
cheminProj = m_PathTranslator.RelativePathToAbsolute(cheminProj);
cheminProj = PathTranslator.LinuxVsWindowsPathUse(cheminProj);
//bool KeepGhostProject = true;
if (!File.Exists(cheminProj))
{
DialogResult dlgRes = MessageBox.Show(string.Format(Lang.LangSys.C("Unable to open file {0}, this project will be removed from solution"),cheminProj),
Lang.LangSys.C("Error"),
MessageBoxButtons.OK,
MessageBoxIcon.Error);
/*if (dlgRes == DialogResult.Yes)
{
KeepGhostProject = true;
}*/
}
else if (this.OpenDocument(cheminProj) == null)
{
DialogResult dlgRes = MessageBox.Show(string.Format(Lang.LangSys.C("File {0}, is corrupted. this project will be removed from solution"), cheminProj),
Lang.LangSys.C("Error"),
MessageBoxButtons.OK,
MessageBoxIcon.Error);
/*if (dlgRes == DialogResult.Yes)
{
KeepGhostProject = true;
}*/
}
/*
if (KeepGhostProject)
{
// TODO ENVOYER LE GHOST
}*/
CheckAndOpenDoc(cheminProj);
}
// puis les bridges
foreach (XmlNode NodeProj in curNode.ChildNodes)
{
XmlAttribute attr = NodeProj.Attributes[ATTR_VALUE];
string cheminProj = attr.Value;
string cheminProjExt = Path.GetExtension(cheminProj);
if (cheminProjExt.EndsWith(".saf"))
continue;
cheminProj = m_PathTranslator.RelativePathToAbsolute(cheminProj);
cheminProj = PathTranslator.LinuxVsWindowsPathUse(cheminProj);
CheckAndOpenDoc(cheminProj);
}
}
}
......@@ -299,6 +289,38 @@ namespace CommonLib
return true;
}
private void CheckAndOpenDoc(string path)
{
//bool KeepGhostProject = true;
if (!File.Exists(path))
{
DialogResult dlgRes = MessageBox.Show(string.Format(Lang.LangSys.C("Unable to open file {0}, this project will be removed from solution"), path),
Lang.LangSys.C("Error"),
MessageBoxButtons.OK,
MessageBoxIcon.Error);
/*if (dlgRes == DialogResult.Yes)
{
KeepGhostProject = true;
}*/
}
else if (this.OpenDocument(path) == null)
{
DialogResult dlgRes = MessageBox.Show(string.Format(Lang.LangSys.C("File {0}, is corrupted. this project will be removed from solution"), path),
Lang.LangSys.C("Error"),
MessageBoxButtons.OK,
MessageBoxIcon.Error);
/*if (dlgRes == DialogResult.Yes)
{
KeepGhostProject = true;
}*/
}
/*
if (KeepGhostProject)
{
// TODO ENVOYER LE GHOST
}*/
}
/// <summary>
///
/// </summary>
......
......@@ -153,6 +153,7 @@ namespace CommonLib
Id = ++m_iQuickIdCounter;
m_DictioQuickScripts.Add(Id, preParsedScript);
}
System.Diagnostics.Debug.Assert(Id != -1);
return Id;
}
......
......@@ -58,7 +58,7 @@ namespace CommonLib
else
m_AssociateData.Value = 1;
}
if (this.m_ScriptContainer["EvtScript"].Length != 0)
if (this.m_ScriptContainer["EvtScript"] != null && this.m_ScriptContainer["EvtScript"].Length != 0)
{
m_Executer.ExecuteScript(this.m_iQuickScriptID);
}
......
......@@ -66,7 +66,7 @@ namespace CtrlDataTrigger
DllCtrlDataTriggerProp prop = (DllCtrlDataTriggerProp)m_SpecificProp;
if (prop.BehaveLikeTrigger == false)
{
if (this.m_ScriptContainer["EvtScript"].Length != 0)
if (this.m_ScriptContainer["EvtScript"] != null && this.m_ScriptContainer["EvtScript"].Length != 0)
{
m_Executer.ExecuteScript(this.m_iQuickScriptID);
}
......
......@@ -173,7 +173,7 @@ namespace ImageButton
m_AssociateData.Value = m_AssociateData.Value == 0 ? 1 : 0;
}
}
if (this.m_ScriptContainer["EvtScript"].Length != 0)
if (this.m_ScriptContainer["EvtScript"] != null && this.m_ScriptContainer["EvtScript"].Length != 0)
{
m_Executer.ExecuteScript(this.m_iQuickScriptID);
}
......
......@@ -73,6 +73,10 @@
<Data strSymbol="ETH_OUT7_I1" strNom="" Min="-32768" Max="32767" DefVal="0" size="16" Constant="False" />
<Data strSymbol="ETH_OUT8_I1" strNom="" Min="-32768" Max="32767" DefVal="0" size="16" Constant="False" />
<Data strSymbol="NEW_DATA_0" strNom="" Min="-32768" Max="32767" DefVal="0" size="16" Constant="False" />
<Data strSymbol="NEW_DATA_1" strNom="" Min="-32768" Max="32767" DefVal="0" size="16" Constant="False" />
<Data strSymbol="NEW_DATA_2" strNom="" Min="-32768" Max="32767" DefVal="0" size="16" Constant="False" />
<Data strSymbol="NEW_DATA_3" strNom="" Min="-32768" Max="32767" DefVal="0" size="16" Constant="False" />
<Data strSymbol="NEW_DATA_4" strNom="" Min="-32768" Max="32767" DefVal="0" size="16" Constant="False" />
<GroupSection>
<Group strNom="Default group" strSymbol="GROUP_0" bkColor="255, 255, 255">
<Object strSymbol="TRANSACTION_ID" />
......@@ -90,6 +94,10 @@
<Object strSymbol="BYTE_COUNT_16_REG" />
<Object strSymbol="TCPMB_REG_ADDR_20" />
<Object strSymbol="NEW_DATA_0" />
<Object strSymbol="NEW_DATA_1" />
<Object strSymbol="NEW_DATA_2" />
<Object strSymbol="NEW_DATA_3" />
<Object strSymbol="NEW_DATA_4" />
</Group>
<Group strNom="New Group 0" strSymbol="GROUP_1" bkColor="255, 255, 255">
<Object strSymbol="ETH_IN1_O1_B16" />
......@@ -337,6 +345,28 @@
<Font FontName="Microsoft Sans Serif" FontAttrib="Bold" FontSize="18" Color="0, 0, 0" />
<EventScript />
</Control>
<DllControl strSymbol="NEW_CTRL_1" strNom="" DllID="220" AssociateData="" ScreenEvent="False" Pos="30,105" size="130,30" Text="" ReadOnly="False">
<Font FontName="Microsoft Sans Serif" FontAttrib="Regular" FontSize="8,25" Color="0, 0, 0" />
<TIMEWATCHPARAM HoursData="NEW_DATA_1" MinutesData="NEW_DATA_2" SecondsData="NEW_DATA_3" />
<EventScript />
</DllControl>
<DllControl strSymbol="NEW_CTRL_2" strNom="" DllID="160" AssociateData="NEW_DATA_1" ScreenEvent="False" Pos="187,50" size="130,30" Text="" ReadOnly="False" DigitColor="173, 255, 47" DigitBackColor="0, 0, 0" Format=":F0">
<Font FontName="Microsoft Sans Serif" FontAttrib="Regular" FontSize="8,25" Color="0, 0, 0" />
<EventScript />
</DllControl>
<DllControl strSymbol="NEW_CTRL_3" strNom="" DllID="160" AssociateData="NEW_DATA_2" ScreenEvent="False" Pos="187,97" size="130,30" Text="" ReadOnly="False" DigitColor="173, 255, 47" DigitBackColor="0, 0, 0" Format=":F0">
<Font FontName="Microsoft Sans Serif" FontAttrib="Regular" FontSize="8,25" Color="0, 0, 0" />
<EventScript />
</DllControl>
<DllControl strSymbol="NEW_CTRL_4" strNom="" DllID="160" AssociateData="NEW_DATA_3" ScreenEvent="False" Pos="191,144" size="130,30" Text="" ReadOnly="False" DigitColor="173, 255, 47" DigitBackColor="0, 0, 0" Format=":F0">
<Font FontName="Microsoft Sans Serif" FontAttrib="Regular" FontSize="8,25" Color="0, 0, 0" />
<EventScript />
</DllControl>
<DllControl strSymbol="NEW_CTRL_5" strNom="" DllID="290" AssociateData="NEW_DATA_4" ScreenEvent="False" Pos="37,222" size="70,30" Text="" ReadOnly="False">
<Font FontName="Microsoft Sans Serif" FontAttrib="Regular" FontSize="8,25" Color="0, 0, 0" />
<CompParam CompMode="5" DataA="14" DataB="NEW_DATA_2" DataC="16" />
<EventScript />
</DllControl>
</ControlList>
<InitScript />
<EventScript />
......
......@@ -220,6 +220,10 @@ namespace SmartApp
if (currentDoc.Communication.IsOpen)
img = Resources.CxnOn;
}
else if (doc is BridgeDoc)
{
img = doc.IsRunning ? Resources.CxnOn : Resources.CxnOff;
}
DataGridViewImageCell projectCnxStatuxCell = row.Cells[this.colProjCnxStatus.Name] as DataGridViewImageCell;
projectCnxStatuxCell.Value = img;
......@@ -275,6 +279,7 @@ namespace SmartApp
{
// pas de sender pour le message start ou stop
doc.TraiteMessage(null, MESSAGE.MESS_CMD_STOP, null, Program.TypeApp);
AsyncComStateUpdater(doc);
}
}
}
......@@ -501,10 +506,12 @@ namespace SmartApp
if (doc.IsRunning)
{
doc.TraiteMessage(null, MESSAGE.MESS_CMD_STOP, null, Program.TypeApp);
AsyncComStateUpdater(doc);
}
else
{
doc.TraiteMessage(null, MESSAGE.MESS_CMD_RUN, null, Program.TypeApp);
AsyncComStateUpdater(doc);
}
}
}
......@@ -544,12 +551,14 @@ namespace SmartApp
if (doc.IsRunning)
{
doc.TraiteMessage(null, MESSAGE.MESS_CMD_STOP, null, Program.TypeApp);
AsyncComStateUpdater(doc);
}
else
{
if (!doc.IsRunning)
{
doc.TraiteMessage(null, MESSAGE.MESS_CMD_RUN, null, Program.TypeApp);
AsyncComStateUpdater(doc);
}
}
}
......
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