Alarm settings ( in test)
This commit is contained in:
parent
1e630ab89f
commit
5cb5e62e57
6 changed files with 72 additions and 22 deletions
|
|
@ -1250,18 +1250,21 @@ int Epd3Base::Epd3U::WriteConfig(void)
|
|||
r = EndWriteQuickAccessDisplays_R3(epdComsHandle, token);
|
||||
}
|
||||
if (!r) {
|
||||
//Unmanaged%20HtmlFiles/_display_ids.html
|
||||
numItems = 9;
|
||||
enables = new DisplayAttributeMap_t[9]{
|
||||
{ 0,0xF8FF,0xFFFF },
|
||||
{ 1,0xF8FF,0xFFE7 },
|
||||
{ 2,0xF8FF,0xFFFF },
|
||||
{ 3,0xF8FF,0xFFFF },
|
||||
{ 4,0xF8FF,0xFE01 },
|
||||
{ 5,0xF8FF,0xFFFF },
|
||||
{ 6,0xF8FF,0xFFFF },
|
||||
{ 7,0xF8FF,0xFFFB },
|
||||
{ 8,0xF8FF,0xFFFF },
|
||||
{ 0,0x7FFF,0xFFFF },
|
||||
{ 1,0x7FFF,0xFFE1 },
|
||||
{ 2,0x7FFF,0xFEFF },
|
||||
{ 3,0x7FFF,0xFEFF },
|
||||
{ 4,0x7FFF,0xFE01 },
|
||||
{ 5,0x7FFF,0xFF89 },
|
||||
{ 6,0x7FFF,0xFFFF },
|
||||
{ 7,0x7FFF,0xFFFB },
|
||||
{ 8,0x7FFF,0xFFFF },
|
||||
};
|
||||
// 0x1 Operation Menu Back /0x2 On / Off 0x4 Clear Dose 0x8 Toggle Telemtry 0x10 Responder Trigger
|
||||
// 1 0 0 0 0
|
||||
|
||||
token = BeginWriteDisplayEnables_R3(epdComsHandle, enables, numItems, nullptr);
|
||||
r = Commit3(epdComsHandle);
|
||||
|
|
|
|||
13
MK3/MK3.cpp
13
MK3/MK3.cpp
|
|
@ -380,7 +380,7 @@ namespace MK3 {
|
|||
s = System::String::Format("\tnumItems={0};\n\tenables = new DisplayAttributeMap_t[9]{{", epd->numItems);
|
||||
System::Diagnostics::Debug::WriteLine(s);
|
||||
for (int i = 0; i < epd->numItems; i++) {
|
||||
s = System::String::Format("\t{{ {0},0x{1:X4},0x{2:X4} }},", epd->enables[i].MenuId, epd->enables[i].EnableMask & 0xff, epd->enables[i].Enables);
|
||||
s = System::String::Format("\t{{ {0},0x{1:X4},0x{2:X4} }},", epd->enables[i].MenuId, epd->enables[i].EnableMask | 0x7ff, epd->enables[i].Enables);
|
||||
System::Diagnostics::Debug::WriteLine(s);
|
||||
}
|
||||
System::Diagnostics::Debug::WriteLine(closingQuote);
|
||||
|
|
@ -398,6 +398,17 @@ namespace MK3 {
|
|||
System::Diagnostics::Debug::WriteLine(closingQuote);
|
||||
|
||||
|
||||
s = System::String::Format("//AlarmConfiguration \n\tuint8_t alarmConfigLen= {0};", epd->alarmConfigLen);
|
||||
System::Diagnostics::Debug::WriteLine(s);
|
||||
s = System::String::Format("\talarmConfigIds = new AlarmConfig_t[{0}] {{", epd->alarmConfigLen);
|
||||
System::Diagnostics::Debug::WriteLine(s);
|
||||
|
||||
for (int i = 0; i < epd->alarmConfigLen; i++) {
|
||||
s = System::String::Format("\t{{ (AlarmIds){0},{1},0x{2:X4},0x{3:X4},{4} }},", (int)epd->alarmConfigIds[i].AlarmId, epd->alarmConfigIds[i].MeasurandId, epd->alarmConfigIds[i].AlarmConfigMask, epd->alarmConfigIds[i].AlarmConfigBits, epd->alarmConfigIds[i].Duration);
|
||||
System::Diagnostics::Debug::WriteLine(s);
|
||||
}
|
||||
System::Diagnostics::Debug::WriteLine(closingQuote);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1133,15 +1133,15 @@ WORD MK3::Epd2U::SetSettings()
|
|||
|
||||
numItems = 9;
|
||||
enables = new DisplayAttributeMap_t[9]{
|
||||
{ 0,0x5CFF,0xFFFF },
|
||||
{ 1,0x5CFF,0xFFE7 },
|
||||
{ 2,0x5CFF,0xFFFF },
|
||||
{ 3,0x5CFF,0xFFFF },
|
||||
{ 4,0x5CFF,0xFE01 },
|
||||
{ 5,0x5CFF,0xFFFF },
|
||||
{ 6,0x5CFF,0xFFFF },
|
||||
{ 7,0x5CFF,0xFFFB },
|
||||
{ 8,0x5CFF,0xFFFF }
|
||||
{ 0,0x7FFF,0xFFFF },
|
||||
{ 1,0x7FFF,0xFFE1 },
|
||||
{ 2,0x7FFF,0xFEFF },
|
||||
{ 3,0x7FFF,0xFEFF },
|
||||
{ 4,0x7FFF,0xFE01 },
|
||||
{ 5,0x7FFF,0xFF89 },
|
||||
{ 6,0x7FFF,0xFFFF },
|
||||
{ 7,0x7FFF,0xFFFB },
|
||||
{ 8,0x7FFF,0xFFFF },
|
||||
};
|
||||
|
||||
ResetEvent(Ev1); c++;
|
||||
|
|
@ -1151,7 +1151,31 @@ WORD MK3::Epd2U::SetSettings()
|
|||
r = EndWriteDisplayEnables_R3(epdComsHandle, token);
|
||||
if (r) goto error;
|
||||
|
||||
|
||||
//AlarmConfiguration
|
||||
uint8_t alarmConfigLen = 14;
|
||||
alarmConfigIds = new AlarmConfig_t[14]{
|
||||
{ (AlarmIds)6,0,0x0000,0x1884,61 },
|
||||
{ (AlarmIds)8,0,0x0000,0x9884,61 },
|
||||
{ (AlarmIds)5,0,0x0000,0x9CA4,61 },
|
||||
{ (AlarmIds)4,0,0x0000,0x9CC7,61 },
|
||||
{ (AlarmIds)9,0,0x0000,0x9CA5,61 },
|
||||
{ (AlarmIds)7,0,0x0000,0x1884,60 },
|
||||
{ (AlarmIds)0,0,0x0000,0x9CC1,60 },
|
||||
{ (AlarmIds)1,0,0x0000,0x1884,60 },
|
||||
{ (AlarmIds)2,0,0x0000,0x9CC7,60 },
|
||||
{ (AlarmIds)3,0,0x0000,0x1885,60 },
|
||||
{ (AlarmIds)0,1,0x0000,0x9CC1,60 },
|
||||
{ (AlarmIds)1,1,0x0000,0x1884,60 },
|
||||
{ (AlarmIds)2,1,0x0000,0x9CC7,60 },
|
||||
{ (AlarmIds)3,1,0x0000,0x1885,60 },
|
||||
};
|
||||
ResetEvent(Ev1); c++;
|
||||
token = BeginWriteAlarmConfiguration_R3(epdComsHandle, alarmConfigIds,alarmConfigLen, completion);
|
||||
r = Commit(epdComsHandle);
|
||||
r = WaitForSingleObject(Ev1, 10000); // no time-out interval
|
||||
r = EndWriteAlarmConfiguration_R3(epdComsHandle, token);
|
||||
if (r) goto error;
|
||||
|
||||
|
||||
return r;
|
||||
|
||||
|
|
@ -1235,5 +1259,13 @@ WORD MK3::Epd2U::ReadDisplay()
|
|||
r = WaitForSingleObject(Ev1, 10000); // no time-out interval
|
||||
EndReadDisplayEnablePermissions_R3(epdComsHandle, token, &curAccessLevel, permissions, permissionsLen, &numMenus);
|
||||
|
||||
|
||||
alarmConfigIds = new AlarmConfig_t[20];
|
||||
token = BeginReadAlarmConfiguration(epdComsHandle, nullptr, 0,completion);
|
||||
ResetEvent(Ev1);
|
||||
r = Commit(epdComsHandle);
|
||||
r = WaitForSingleObject(Ev1, 10000); // no time-out interval
|
||||
EndReadAlarmConfiguration(epdComsHandle, token, alarmConfigIds, 20,&alarmConfigLen);
|
||||
|
||||
return CommitRV;
|
||||
}
|
||||
|
|
@ -309,6 +309,8 @@ namespace MK3
|
|||
uint8_t permissionsLen = 100;
|
||||
uint8_t numMenus;
|
||||
|
||||
AlarmConfig_t *alarmConfigIds;
|
||||
uint16_t alarmConfigLen = 20;
|
||||
|
||||
EncryptionKey EC;
|
||||
uint8_t ECLen;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ namespace TestEPD3Dll
|
|||
|
||||
x.ECIn = System.Security.Cryptography.SHA256.Create().ComputeHash(System.Text.Encoding.UTF8.GetBytes("Administrator"));
|
||||
//rv= x.SetChirp(5);
|
||||
|
||||
|
||||
x.SetSettings();
|
||||
|
||||
x.ReadDisplay(); // ToDo list
|
||||
|
|
|
|||
|
|
@ -51,5 +51,5 @@ using System.Windows;
|
|||
// 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.10.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.10.0.0")]
|
||||
[assembly: AssemblyVersion("2.11.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.11.0.0")]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue