I am new to this forum. Now I am really running into issues.
My enterprise is constantly making its Prodcts better. I now face the challenge to integrate a helptext to the Alarmmessages.
At this point I will Explain Goal and what does work, and then where the problem is:
My enterprise produces 10 different components, then puts them in different arangements and Quantity(0-99) together. The Panel mus be pretty standard, sofar that works well.
Now the Custumers desire is that er is not only a simple alarm like
but in addition to that ( as their staff can be completly untechnical) an other information like"Element xyz did not reach endposition"
Now that my enterprise exports to any given country like: USA, Germany, Czech Republic, China and so on, everything must be translatable, as most of the staff can only speak their native language.-check if element xyz can move freely
-check if all sensors are attatched to the module and not free hanging
- call maintenance for help
i have defined a class
Code: Select all
public class DefAlm
{
public AlarmItem AlmItm{ get; set; }
public int grp{ get; set; }
public int alm{ get; set; }
public string helpText{get; set;}
}
Code: Select all
foreach(AlarmGroup z in this.AlarmGroups )// For each alarmgroup
{
int i=0;
foreach(AlarmItem x in z.AlarmItems )// For Each Alarm Item
{
tempstring=helpText[0].Text; //Set Helptext to "No helptext avalible" as Standard
foreach(TextLibTexts help in helpText) //Search heltext for the acual message
{
if((help.belt== grp) && (help.aux==i) )
{
tempstring=help.Text;
}
}
almList.Add(new DefAlm(){ //Define new DefAlm and add it to DefAlm List
AlmItm=x,
grp= grp,
alm=i,
helpText=tempstring
});
i++;
}
grp++;
}
Code: Select all
foreach(DefAlm x in almList) //Add eventhandler to every item and Readout the almList to logfile
{
x.AlmItm.AlarmActive+= new EventHandler(AlmActiv) ;
}
Until here Everything is fine.
Now is the hard Part:
if an Event goes off i just log what happens
Code: Select all
private void AlmActiv(System.Object sender, System.EventArgs e)
{
Globals.Logger.WriteLog("Sender\t"+sender.ToString(), true);
}
Which returns me following:
i would expec something like the Displayname of the alarm element, which gave out tuhe event, what i find here is the Text of the alarmelement. the(69) is some parameter, which is not always there and not really related to the Position in the List or whatever! How can I now get somthing usefull out of this?Sender [TestFault2 (69)][State: Active][Id: b987d84b-7195-4678-8d9c-103829af13fd][ItemId: d8f19072-4382-4c57-864a-0a9721c93d2a]
The Testfault2 could be a text that does not mean to be the same Helptext.... Can someone help? i would really be very thankfull!
Greetings MrMaus