static constexpr const char *OTHER_IMAGE = ICON36 "/Other.bin";
static constexpr const char *PINGPONG_IMAGE = ICON36 "/Pingpong.bin";
static constexpr const char *REST_IMAGE = ICON36 "/Rest.bin";
- static constexpr const char *RIDING_IMAGE = ICON36 "/Riding.bin";
- static constexpr const char *RUNNING_IMAGE = ICON36 "/Running.bin";
static constexpr const char *SWIMMING_IMAGE = ICON36 "/Swimming.bin";
- static constexpr const char *WALKING_IMAGE = ICON36 "/Walking.bin";
+ static constexpr const char *RIDING_IMAGE = ICON36 "/riding.bin";
+ static constexpr const char *RUNNING_IMAGE = ICON36 "/running.bin";
+ static constexpr const char *WALKING_IMAGE = ICON36 "/walking.bin";
// Icons in the icon_60x60 folder
+ static constexpr const char *RIDING_60_IMAGE_END = ICON60 "/riding.bin";
+ static constexpr const char *RUNNING_60_IMAGE_END = ICON60 "/running.bin";
+ static constexpr const char *WALKING_60_IMAGE_END = ICON60 "/walking.bin";
static constexpr const char *RIDING_60_IMAGE = ICON60 "/Riding_60.bin";
static constexpr const char *RUNNING_60_IMAGE = ICON60 "/Running_60.bin";
static constexpr const char *WALKING_60_IMAGE = ICON60 "/walking_60.bin";
+
+
static constexpr const char *FREE_60_IMAGE = ICON60 "/FreeTraining_60.bin";
+
// Icons in the icon_80x80 folder
static constexpr const char *JUMPROPE_80_IMAGE = ICON80 "/Jumprope_80.bin";
static constexpr const char *MOUNTAINEERING_80_IMAGE = ICON80 "/Mountaineering_80.bin";
int GetBleSportId(Exercisetype sporttype, UIResourceTextId id); /*获取协议Id*/
UIResourceTextId GetSportTypeId(Exercisetype type); /*获取训练类Id*/
void SetSportType(Exercisetype type); /*设置运动类型*/
- std::string GetSportType(Exercisetype sporttype); /*获取训练类型type图片*/
- std::string GetSportIcon(Exercisetype sporttype); /*获取训练类型icon图片*/
+ // std::string GetSportType(Exercisetype sporttype); /*获取训练类型type图片*/
+ // std::string GetSportIcon(Exercisetype sporttype); /*获取训练类型icon图片*/
+ std::string GetSportIcon(Exercisetype sporttype, UIResourceTextId id,
+ uint8_t type);
// 训练目标相关配置
void SetSportTag(ExerciseTag tagtpye,
/*title and sport*/
InitRollLabel(labeltype, 83, 50, 300, 35, "label1", STR_EXERCISE_LIST,
DEFAULT_VECTOR_FONT_FILENAME, 30);
- InitRollLabel(labelsport, 147, 140, 240, 35, "label6", STR_EXERCISE_OUTDOORRUNNING,
- DEFAULT_VECTOR_FONT_FILENAME, 30);
+ InitRollLabel(labelsport, 147, 140, 240, 35, "label6",
+ STR_EXERCISE_OUTDOORRUNNING, DEFAULT_VECTOR_FONT_FILENAME, 30);
InitLabel(labelduration, 146, 179, 240, 40, "label7", "13:00:22-15:00:12",
DEFAULT_VECTOR_FONT_FILENAME, 28);
// 初始化Label
}
// 训练图标Icon
- std::string imageStr =
- TraingModel::GetInstance()->GetSportType(enddata->sportType);
+ std::string imageStr = TraingModel::GetInstance()->GetSportIcon(
+ enddata->sportType, enddata->sportId, 0);
if (!imageStr.empty()) {
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "imageIcon %s\r\n",
imageStr.c_str());
}
/*设置运动类型*/
void TraingModel::SetSportType(Exercisetype type) { sportType_ = type; }
-/*结束数据icon*/
-std::string sportImages[8] = {
- FITNESS_54_IMAGE, DANCE_54_IMAGE, REST_54_IMAGE, BALL_54_IMAGE,
- SWIMMING_54_IMAGE, ICE_54_IMAGE, LIMIT_54_IMAGE, OTHER_54_IMAGE,
-};
-/*训练记录Icon*/
-std::string sportIcons[8] = {
- FITNESS_IMAGE, DANCE_IMAGE, REST_IMAGE, BALL_IMAGE,
- SWIMMING_IMAGE, ICE_IMAGE, LIMIT_IMAGE, OTHER_IMAGE,
-};
/*获取训练Id->协议*/
int TraingModel::GetBleSportId(Exercisetype sporttype, UIResourceTextId id) {
int offset = 0;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " offset %d id %d", offset, id);
return id - offset;
}
-/*获取运动类型图片*/
-std::string TraingModel::GetSportType(Exercisetype sporttype) {
- int index = static_cast<int>(sporttype);
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, " GetSportType index %d", index);
- return sportImages[index];
-}
-/*获取运动类型icon*/
-std::string TraingModel::GetSportIcon(Exercisetype sporttype) {
+
+/*结束数据icon*/
+std::string sportImages[8] = {
+ FITNESS_54_IMAGE, DANCE_54_IMAGE, REST_54_IMAGE, BALL_54_IMAGE,
+ SWIMMING_54_IMAGE, ICE_54_IMAGE, LIMIT_54_IMAGE, OTHER_54_IMAGE,
+};
+/*训练记录Icon*/
+std::string sportIcons[8] = {
+ FITNESS_IMAGE, DANCE_IMAGE, REST_IMAGE, BALL_IMAGE,
+ SWIMMING_IMAGE, ICE_IMAGE, LIMIT_IMAGE, OTHER_IMAGE,
+};
+/*特殊运动icon*/
+std::string sportIcons_special[6] = {RUNNING_60_IMAGE_END, WALKING_60_IMAGE_END,
+ RIDING_60_IMAGE_END, RUNNING_IMAGE,
+ WALKING_IMAGE, RIDING_IMAGE};
+
+/*
+ type
+ 0 是运动结束图标
+ 1 是运动类型图标
+*/
+std::string TraingModel::GetSportIcon(Exercisetype sporttype,
+ UIResourceTextId id, uint8_t type) {
+
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+ " GetSportIcon sporttype %d id %d type %d", sporttype, id,
+ type);
+ bool specialsport = false;
+ uint8_t specialindex = 0;
+ switch (id) {
+ case UIResourceTextId::STR_EXERCISE_OUTDOORRUNNING:
+ case UIResourceTextId::STR_EXERCISE_INDOORRUNNING:
+ specialsport = true;
+ specialindex = 0;
+ break;
+ case UIResourceTextId::STR_EXERCISE_OUTDOORWALKING:
+ case UIResourceTextId::STR_EXERCISE_INDOORWALKING:
+ specialsport = true;
+ specialindex = 1;
+ break;
+ case UIResourceTextId::STR_EXERCISE_OUTDOORBIKING:
+ specialsport = true;
+ specialindex = 2;
+ break;
+ }
int index = static_cast<int>(sporttype);
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, " GetSportIcon index %d", index);
- return sportIcons[static_cast<int>(sporttype)];
+ if (specialsport) {
+ // 特殊运动
+ if (type == 0) {
+ return sportIcons_special[specialindex]; //返回特殊运动大图标
+ } else {
+ return sportIcons_special[specialindex + 3]; //返回特殊运动小图标
+ }
+ }
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, " GetResource index %d", index);
+ if (type == 0) {
+ return sportImages[index]; //返回运动类大图标
+ } else {
+ return sportIcons[index]; //返回运动类小图标
+ }
+ return "";
}
/*设置运动Id*/
void TraingModel::SetSportEvent(UIResourceTextId id) {
{
SportData sportData = sportDataVector[i];
// 获取训练类图标
- std::string imageicon = TraingModel::GetInstance()->GetSportIcon(sportData.sportType);
+ std::string imageicon = TraingModel::GetInstance()->GetSportIcon(sportData.sportType,sportData.sportId,1);
// 获取日期
// 获取时间
std::string Time = sportData.start_time + std::string("-") + sportData.end_time;
version https://git-lfs.github.com/spec/v1
-oid sha256:ef6a0e63e11b6cb0082ee1334165ab5173870e9db7e6d69199ff77f330e86019
+oid sha256:08f0508f712626feef2355942c48483b3d324a1d7a32cccc55e2d626944aba64
size 888
version https://git-lfs.github.com/spec/v1
-oid sha256:3a132279a20471e2727c4496ffe24836dedaa4483341915ff2dafc1efb5c89a5
+oid sha256:5e8bfcf8a2095f09d5b8edc52208cb341b7fb89daf9eae8a84869fc00b9b08fc
size 888
version https://git-lfs.github.com/spec/v1
-oid sha256:79c752381cb0cf317f97498354a7109c044a94fb13a2d71d1c8c95ff6a94b3ba
+oid sha256:18f50f28b337507dd2acc012f46bba2ad78c8ecca0521aff275a76475a2e6532
size 888
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:137ac43eb82e53b4c8bbab2907e60182ab10da596aa29b06abaf1afd2cc5ea6c
+size 2424
version https://git-lfs.github.com/spec/v1
-oid sha256:b3fb5df04b4825af8bf4be02d8185d17c047ccca30d2a73f2283f0ab3f6c69ff
+oid sha256:389b835e5edccd0bde754d8b00a3c2ec5fdbb59ae1603a59d8128f9ba0860c10
size 888
version https://git-lfs.github.com/spec/v1
-oid sha256:ef24e56c4596301c51ed0a9ec90d074baedbffad81de5bd008ec9b94b666948b
+oid sha256:3bbf984d2d1c6789554b7f9146c95e1a43876bc3aab2560d7aeb91254b13f6d5
size 888
version https://git-lfs.github.com/spec/v1
-oid sha256:1e8655b1cbbab73ee30af6c6ba90081b17efa716f7f58a5deabd38f203950aae
+oid sha256:8bc913378f9ec9b0d75f4dc9af3e30ffa21dc389b843d00fea900e49c5d8a315
size 888
version https://git-lfs.github.com/spec/v1
-oid sha256:b120bebd56881b8d12f6e21a2ae8ffc3ed33deeb36ed81f4fe2baa7b0522b903
+oid sha256:a3aa632c0001dd1e97527976fb9d381e02d2c8e07db61525d5950ef58c150c86
size 888
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:070ed8c37b9f8c0824dd81cb217701bef297671547a91a847d4cbeab37066891
+size 2424
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:7709bc5f7289f43ebd019659dda1ce8b06a204d174d02672d570f94e23f190cb
+size 2424
version https://git-lfs.github.com/spec/v1
-oid sha256:613975bbea17962e1b127fca4b08087eac641b5e708e20e2a4024e0fc6ec5382
+oid sha256:7c85c0ea4f8c3b704976da8c4cf47dee9262a1793fd8e53977fb74d688813463
size 888
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:00707185aad1fd0c5ef3b1b60fcca6773b499978a013c582c85ddb1cc1de0192
+size 888
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:21a62ab6ea01fff10868ea61e10c61636e9fd929f204cc76a0bd67ff3f327ac6
+size 888
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:65db18009374b73f6550d1c55ee3ea494bd21a5e225b7d1ecaa0fe484adb3f0e
+size 888
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:7a022b8b53725137cec218c820f23c5584a97f0e0fe151cdbd389fd9b3192e31
+size 2424
version https://git-lfs.github.com/spec/v1
-oid sha256:fd9a19ecb78cc936ff97e9f2f80c4654f7e33593bd8018a917d98f85113716b9
+oid sha256:070ed8c37b9f8c0824dd81cb217701bef297671547a91a847d4cbeab37066891
size 2424
version https://git-lfs.github.com/spec/v1
-oid sha256:e6f42a59c66d3c46c7eceffb5e4bd0bb7277af2c6813052ab7e37a76972f0401
+oid sha256:7709bc5f7289f43ebd019659dda1ce8b06a204d174d02672d570f94e23f190cb
size 2424
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:d19fc5a820aa44dd4eab539a8fd492800c6c398785b1f617568f8a1dcf89ca33
+size 2424
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:53b75792f1b2533dced0c72da35ecae8660aad03677c53ff3425b3a3b2e07bdb
+size 2424
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:dd71de7f6658d06fa8de2fdc511a0db4d2c957bd4bfb1308034cb41c91af332f
+size 2424
version https://git-lfs.github.com/spec/v1
-oid sha256:2500ee37273f320bba465dca193cd80a8e875072f46b241281ba00721bab668c
+oid sha256:7a022b8b53725137cec218c820f23c5584a97f0e0fe151cdbd389fd9b3192e31
size 2424