From: Caisking Date: Tue, 6 Jan 2026 06:29:12 +0000 (+0800) Subject: 补全完整的dialtools X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=71d4926b14bdbbcdac950880de244a478ad69d8d;p=mirrors%2FFD230.git 补全完整的dialtools --- diff --git a/tools/dial_tools/dial_converter_tool/README.txt b/tools/dial_tools/dial_converter_tool/README.txt new file mode 100644 index 000000000..fb9b83aab --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/README.txt @@ -0,0 +1,11 @@ +usage: main.py [-h] [-file FILE] [-dir DIR] [-output OUTPUT] + +options: + -h, --help 显示帮助信息。 + -file FILE, -f FILE 指定待转化的离线表盘xml文件路径。 + -dir DIR, -d DIR 指定待转化的文件夹路径。根据指定路径,转化文件夹下所有xml文件。 + -output OUTPUT 指定转化后离线表盘打包资源所在路径 + +example: +windows: python .\main.py -dir .\instance\analogue_dial +windows: python .\main.py -dir .\instance\kaleidoscope_dial \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/common_types.py b/tools/dial_tools/dial_converter_tool/common_types.py new file mode 100644 index 000000000..444fc6edc --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/common_types.py @@ -0,0 +1,26 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from enum import Enum +from ctypes import * + +class Point(Structure): + _fields_ = [ + ('x', c_short), + ('y', c_short), + ] + +class Rect(Structure): + _fields_ = [ + ('x', c_short), + ('y', c_short), + ('w', c_ushort), + ('h', c_ushort) + ] + +class ColorStop(Structure): + _fields_ = [ + ('stop', c_float), + ('color', c_uint), + ] \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/converter.py b/tools/dial_tools/dial_converter_tool/converter.py new file mode 100644 index 000000000..67b5ff0e4 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/converter.py @@ -0,0 +1,223 @@ +#!/usr/bin/python +# coding: utf-8 +import os +import re +import struct +import ctypes +import sys +from ctypes import * +import xml.sax +from enum import Enum +import img_convert +import video_convert +from dial_static_img import DialStaticImg +from dial_sequence_img import DialSequenceImg +from dial_rotate_img import DialRotateImg +from dial_option_img import DialOptionImg +from dial_digital_img import DialDigitalImg +from dial_label import DialLabel +from dial_arc_label import DialArcLabel +from dial_box_progress import DialBoxProgress +from dial_arc_progress import DialArcProgress +from dial_video import DialVideo +from dial_click import DialClick +from dial_kaleidoscope import DialKaleidoscope + +class DialHeader(Structure): + _fields_ = [ + ('dialName', c_char * 16), + ('width', c_short), + ('height', c_short), + ('version', c_char * 16), + ('previewImgId', c_ushort), + ('description', c_char * 128), + ('imgoffset', c_uint), + ('period', c_ubyte), + ('dialViewCount', c_ubyte), + ('displayCapabiliy', c_ubyte), + ('ambientPeriod', c_ubyte), + ] + _DIAL_DEFAULT_MAX_WIDTH = 960 + _DIAL_DEFAULT_MAX_HEIGHT = 960 + + def __init__(self): + self.imgoffset = 0 + self.dialViewCount = 0 + self.period = 0 + self.displayCapabiliy = 0 + self.ambientPeriod = 0 + self.viewType = [] + self.viewPt = [] + + def parse_attributes(self, attributes): + title = attributes["title"] + self.dialName = bytes(title, encoding = "utf8") + + description = attributes["description"] + self.description = bytes(description, encoding = "utf8") + + version = attributes["version"] + self.version = bytes(version, encoding = "utf8") + + self._parse_size_attr(attributes["size"]) + + previewStr = attributes["preview_img"] + self.previewImgId = img_convert.instance.convert_img(previewStr) + + for attr in attributes.getNames(): + if attr == "tile_width": + tile_width = int(attributes["tile_width"]) + img_convert.instance.set_tile_width(tile_width) + elif attr == "ambient_period": + period_suppor_value = {1, 10, 30, 60} + self.ambientPeriod = int(attributes["ambient_period"]) + if self.ambientPeriod not in period_suppor_value: + self.ambientPeriod = 0 + print("[WARNING]:label image period value not support, using defalut value 0") + + + def add_view(self, viewObj, viewType): + self.viewPt.append(viewObj) + self.viewType.append(viewType) + self.dialViewCount += 1 + + def get_bytes(self): + ret = bytes(self) + for index in range(self.dialViewCount): + ret += struct.pack('@b', self.viewType[index]) + return ret + + def get_size(self): + return sizeof(self) + sizeof(c_ubyte) * self.dialViewCount + + def _parse_size_attr(self, input_size): + input_width,input_height = input_size.split(' ') + width = int(input_width) + if width <= 0 or width > DialHeader._DIAL_DEFAULT_MAX_WIDTH : + print(f"[ERR]:dial size width out of range, (0, {DialHeader._DIAL_DEFAULT_MAX_WIDTH}], value:{width}") + sys.exit(1) + self.width = width + + height = int(input_height) + if height <= 0 or height > DialHeader._DIAL_DEFAULT_MAX_HEIGHT : + print(f"[ERR]:dial size height out of range, (0, {DialHeader._DIAL_DEFAULT_MAX_HEIGHT}], value:{height}") + sys.exit(1) + self.height = height + +class DialConvertTool(xml.sax.ContentHandler): + parser = xml.sax.make_parser() + DIAL_STATIC_IMG_TYPE = 0 + DIAL_SEQUENCE_IMG_TYPE = 1 + DIAL_ROTATE_IMG_TYPE = 2 + DIAL_OPTION_IMG_TYPE = 3 + DIAL_DIGITAL_IMG_TYPE = 4 + DIAL_LABEL_TYPE = 5 + DIAL_ARC_LABEL_TYPE = 6 + DIAL_BOX_PROGRESS_TYPE = 7 + DIAL_ARC_PROGRESS_TYPE = 8 + DIAL_VIDEO_TYPE = 9 + DIAL_CLICK_TYPE = 10 + DIAL_KALEIDOSCCOPE_TYPE = 11 + + def __init__(self): + self.inFile = "" + self.outPath = "" + self.header = DialHeader() + self.parser.setFeature(xml.sax.handler.feature_namespaces, 0) + self.parser.setContentHandler(self) + + def startElement(self, tag, attributes): + viewTypeArray = [] + if tag == "dial": + self.header.parse_attributes(attributes) + elif tag == "static_img": + view = DialStaticImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_STATIC_IMG_TYPE) + elif tag == "sequence_img": + view = DialSequenceImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_SEQUENCE_IMG_TYPE) + elif tag == "rotate_img": + view = DialRotateImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_ROTATE_IMG_TYPE) + elif tag == "option_img": + view = DialOptionImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_OPTION_IMG_TYPE) + elif tag == "digital_img": + view = DialDigitalImg() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_DIGITAL_IMG_TYPE) + elif tag == "label": + view = DialLabel() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_LABEL_TYPE) + elif tag == "arc_label": + view = DialArcLabel() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_ARC_LABEL_TYPE) + elif tag == "box_progress": + view = DialBoxProgress() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_BOX_PROGRESS_TYPE) + elif tag == "arc_progress": + view = DialArcProgress() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_ARC_PROGRESS_TYPE) + elif tag == "video": + view = DialVideo() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_VIDEO_TYPE) + elif tag == "click": + view = DialClick() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_CLICK_TYPE) + elif tag == "kaleidoscope": + view = DialKaleidoscope() + view.parse_attributes(attributes) + self.header.add_view(view, self.DIAL_KALEIDOSCCOPE_TYPE) + + def endElement(self, tag): + if tag == "dial": + # create & open dstfile + outputfile = self.outPath + "/" + os.path.basename(self.inFile)[:-3] + "bin" + fb = open(outputfile, 'wb') + os.chmod(outputfile, 0o0755) + self._write_data_to_bin(fb) + fb.close() + + def convert_xml_to_output(self, inFile, outPath): + self.inFile = inFile + self.outPath = outPath + self.parser.parse(inFile) + + def _write_data_to_bin(self, fb): + self.header.imgoffset += self.header.get_size() + aod_only, normal_only = 0, 0 + for view in self.header.viewPt: + if self.header.period < view.period: + self.header.period = view.period + if view.displayMode == 1: + aod_only = aod_only + 1 + elif view.displayMode == 2: + aod_only = aod_only + 1 + normal_only = normal_only + 1 + else: + normal_only = normal_only + 1 + self.header.imgoffset += view.get_size() + if normal_only > 0 and aod_only > 0: + self.header.displayCapabiliy = 2 + elif normal_only > 0 and aod_only == 0: + self.header.displayCapabiliy = 0 + else: + self.header.displayCapabiliy = 1 + + fb.write(self.header.get_bytes()) + for view in self.header.viewPt: + if isinstance(view, DialVideo): + view.offset += self.header.imgoffset + img_convert.instance.get_size() + fb.write(view.get_bytes()) + img_convert.instance.write_data_to_bin(fb) + video_convert.instance.write_data_to_bin(fb) diff --git a/tools/dial_tools/dial_converter_tool/dial_arc_label.py b/tools/dial_tools/dial_converter_tool/dial_arc_label.py new file mode 100644 index 000000000..1d3ac7e9c --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_arc_label.py @@ -0,0 +1,112 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point + +class DialArcLabel(Structure): + _fields_ = [ + ('align', c_ubyte), + ('fontSize', c_ubyte), + ('center', Point), + ('radius', c_ushort), + ('rotateStart', c_short), + ('rotaeteEnd', c_short), + ('color', c_uint), + ('fontName', c_char * 64), + ('text', c_char * 64), + ('bindData', c_short), + ('isPeriodic', c_bool), + ('displayMode', c_ubyte), + ('isAmbientPeriodic', c_bool) + ] + def __init__(self): + self.period = 0 + self.isPeriodic = False + self.displayMode = 0 + self.isAmbientPeriodic = False + + def parse_attributes(self, attributes): + alignStr = attributes["align"] + if alignStr == "bottom": + self.align = 4 + elif alignStr == "top": + self.align = 3 + elif alignStr == "center": + self.align = 2 + elif alignStr == "right": + self.align = 1 + elif alignStr == "left": + self.align = 0 + else: + self.align = 0 + print("[WARNING] arc label align value input error, using defalut value") + + self.fontSize = int(attributes["font_size"]) + if self.fontSize < np.iinfo(np.int16).min or self.fontSize > np.iinfo(np.int16).max: + print("[ERR]:label font size out of range") + sys.exit(1) + + x,y = attributes["center"].split(" ") + self.center.x = int(x) + if self.center.x < np.iinfo(np.int16).min or self.center.x > np.iinfo(np.int16).max: + print("[ERR]:arc label center x out of range") + sys.exit(1) + self.center.y = int(y) + if self.center.y < np.iinfo(np.int16).min or self.center.y > np.iinfo(np.int16).max: + print("[ERR]:arc label center y out of range") + sys.exit(1) + + self.radius = int(attributes["radius"]) + if self.radius < 0 or self.radius > np.iinfo(np.int16).max: + print("[ERR]:arc label radius out of range") + sys.exit(1) + + self.rotateStart = int(attributes["start_angle"]) + self.rotaeteEnd = int(attributes["end_angle"]) + + self.color = int(attributes["color"], 16) + self.fontName = bytes(attributes["font"], encoding = "utf8") + self.text = bytes(attributes["text"], encoding = "utf8") + for attr in attributes.getNames(): + if attr == "bind_data": + self.bindData = int(attributes["bind_data"]) + if self.bindData < 0 or self.bindData > np.iinfo(np.int16).max: + print("[ERR]:arc label bind data out of range") + sys.exit(1) + elif attr == "period": + period_suppor_value = {1, 10, 30, 60} + self.period = int(attributes["period"]) + if self.period == 0: + self.isPeriodic = False + elif self.period not in period_suppor_value: + self.period = 0 + print("[WARNING]:arc label period value not support, using defalut value 0") + else: + self.isPeriodic = True + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + if self.displayMode != 0 : + if "ambient_periodic" in attributes.getNames(): + if attributes["ambient_periodic"] == "true": + self.isAmbientPeriodic = True + + if self.isPeriodic != 0 and self.bindData == 0: + print("[ERR]:[bind_data] is not set, [period] cannot be set") + sys.exit(1) + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dial_arc_progress.py b/tools/dial_tools/dial_converter_tool/dial_arc_progress.py new file mode 100644 index 000000000..338c5c816 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_arc_progress.py @@ -0,0 +1,149 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect +from common_types import ColorStop +import img_convert + +class ProgressUnion(Union): + _fields_ = [ + ('stopCount', c_ubyte), + ('imgId', c_ushort), + ('color', c_uint), + ] + +class DialArcProgress(Structure): + _fields_ = [ + ('cap', c_ubyte), + ('isPeriodic', c_bool), + ('radius', c_ushort), + ('startAngle', c_ushort), + ('endAngle', c_ushort), + ('lineWidth', c_ushort), + ('bindData', c_short), + ('bgColor', c_uint), + ('type', c_ubyte), + ('rect', Rect), + ('unionValue', ProgressUnion), + ('displayMode', c_ubyte), + ('isAmbientPeriodic', c_bool) + ] + + def __init__(self): + self.stop = [] + self.period = 0 + self.isPeriodic = False + self.displayMode = 0 + self.isAmbientPeriodic = False + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + if self.rect.x < np.iinfo(np.int16).min or self.rect.x > np.iinfo(np.int16).max: + print("[ERR]:arc progress rect x out of range") + sys.exit(1) + self.rect.y = int(y) + if self.rect.y < np.iinfo(np.int16).min or self.rect.y > np.iinfo(np.int16).max: + print("[ERR]:arc progress rect y out of range") + sys.exit(1) + self.rect.w = int(w) + if self.rect.w < np.iinfo(np.int16).min or self.rect.w > np.iinfo(np.int16).max: + print("[ERR]:arc progress rect w out of range") + sys.exit(1) + self.rect.h = int(h) + if self.rect.h < np.iinfo(np.int16).min or self.rect.h > np.iinfo(np.int16).max: + print("[ERR]:arc progress rect h out of range") + sys.exit(1) + + cap = attributes["cap_type"] + if cap == "round": + self.cap = 1 + else: + self.cap = 0 + + self.radius = int(attributes["radius"]) + if self.radius < 0 or self.radius > np.iinfo(np.int16).max: + print("[ERR]:arc progress radius out of range") + sys.exit(1) + + self.startAngle = int(attributes["start_angle"]) + self.endAngle = int(attributes["end_angle"]) + + self.lineWidth = int(attributes["line_width"]) + if self.lineWidth < 0 or self.lineWidth > np.iinfo(np.int16).max: + print("[ERR]:arc progress lineWidth out of range") + sys.exit(1) + + self.bindData = int(attributes["bind_data"]) + if self.bindData < 0 or self.bindData > np.iinfo(np.int16).max: + print("[ERR]:arc progress bind data out of range") + sys.exit(1) + + attrList = attributes.getNames() + for attr in attrList: + if attr == "img_name": + self.unionValue.imgId = img_convert.instance.convert_img(attributes["img_name"]) + self.type = 0 + break + elif attr == "color": + self.unionValue.color = int(attributes["color"], 16) + self.type = 1 + break + elif attr == "gradient_colors": + self.type = 2 + stopList = attributes["gradient_stops"].split(" ") + colorList = attributes["gradient_colors"].split(" ") + if len(stopList) != len(colorList): + print("[ERROR]:[gradient_stops] attr not equal [colorList] attr") + self.unionValue.stopCount = min(len(colorList), len(stopList)) + for index in range(self.unionValue.stopCount): + colorStop = ColorStop() + colorStop.stop = float(stopList[index]) + colorStop.color = int(colorList[index], 16) + self.stop.append(colorStop) + break + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + if self.displayMode != 0 : + if "ambient_periodic" in attributes.getNames(): + if attributes["ambient_periodic"] == "true": + self.isAmbientPeriodic = True + + if "period" in attrList: + period_suppor_value = {1, 10, 30, 60} + self.period = int(attributes["period"]) + if self.period == 0: + self.isPeriodic = False + elif self.period not in period_suppor_value: + self.period = 0 + print("[WARNING]:label image period value not support, using defalut value 0") + else: + self.isPeriodic = True + + if "background_color" in attrList: + self.bgColor = int(attributes["background_color"], 16) + + def get_bytes(self): + ret = bytes(self) + if self.type == 2: + for stop in self.stop: + ret += bytes(stop) + return ret + + def get_size(self): + ret = sizeof(self) + if self.type == 2: + for stop in self.stop: + ret += sizeof(stop) + return ret \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dial_box_progress.py b/tools/dial_tools/dial_converter_tool/dial_box_progress.py new file mode 100644 index 000000000..40d842b67 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_box_progress.py @@ -0,0 +1,146 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect +from common_types import ColorStop +import img_convert + +class ProgressUnion(Union): + _fields_ = [ + ('stopCount', c_ubyte), + ('imgId', c_ushort), + ('color', c_uint), + ] + +class DialBoxProgress(Structure): + _fields_ = [ + ('cap', c_ubyte), + ('direction', c_ubyte), + ('isPeriodic', c_bool), + ('bindData', c_short), + ('bgColor', c_uint), + ('type', c_ubyte), + ('rect', Rect), + ('unionValue', ProgressUnion), + ('displayMode', c_ubyte), + ('isAmbientPeriodic', c_bool) + ] + + def __init__(self): + self.stop = [] + self.isPeriodic = False + self.period = 0 + self.displayMode = 0 + self.isAmbientPeriodic = False + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + if self.rect.x < np.iinfo(np.int16).min or self.rect.x > np.iinfo(np.int16).max: + print("[ERR]:box progress rect x out of range") + sys.exit(1) + self.rect.y = int(y) + if self.rect.y < np.iinfo(np.int16).min or self.rect.y > np.iinfo(np.int16).max: + print("[ERR]:box progress rect y out of range") + sys.exit(1) + self.rect.w = int(w) + if self.rect.w < np.iinfo(np.int16).min or self.rect.w > np.iinfo(np.int16).max: + print("[ERR]:box progress rect w out of range") + sys.exit(1) + self.rect.h = int(h) + if self.rect.h < np.iinfo(np.int16).min or self.rect.h > np.iinfo(np.int16).max: + print("[ERR]:box progress rect h out of range") + sys.exit(1) + + cap = attributes["cap_type"] + if cap == "round": + self.cap = 1 + else: + self.cap = 0 + + direction = attributes["direction"] + if direction == "left_to_right": + self.direction = 0 + elif direction == "right_to_left": + self.direction = 1 + elif direction == "top_to_bottom": + self.direction = 2 + elif direction == "bottom_to_top": + self.direction = 3 + else: + self.direction = 0 + print("[WARNING]:box progress direction set error, using defalut value") + + self.bindData = int(attributes["bind_data"]) + if self.bindData < 0 or self.bindData > np.iinfo(np.int16).max: + print("[ERR]:box progress bind data out of range") + sys.exit(1) + + attrList = attributes.getNames() + for attr in attrList: + if attr == "img_name": + self.unionValue.imgId = img_convert.instance.convert_img(attributes["img_name"]) + self.type = 0 + break + elif attr == "color": + self.unionValue.color = int(attributes["color"], 16) + self.type = 1 + break + elif attr == "gradient_colors": + stopList = attributes["gradient_stops"].split(" ") + colorList = attributes["gradient_colors"].split(" ") + if len(stopList) != len(colorList): + print("[ERROR]:[gradient_stops] attr not equal [colorList] attr") + self.unionValue.stopCount = min(len(colorList), len(stopList)) + for index in range(self.unionValue.stopCount): + colorStop = ColorStop() + colorStop.stop = float(stopList[index]) + colorStop.color = int(colorList[index], 16) + self.stop.append(colorStop) + self.type = 2 + break + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + if self.displayMode != 0 : + if "ambient_periodic" in attributes.getNames(): + if attributes["ambient_periodic"] == "true": + self.isAmbientPeriodic = True + + if "period" in attrList: + period_suppor_value = {1, 10, 30, 60} + self.period = int(attributes["period"]) + if self.period == 0: + self.isPeriodic = False + elif self.period not in period_suppor_value: + self.period = 0 + print("[WARNING]:label image period value not support, using defalut value 0") + else: + self.isPeriodic = True + + if "background_color" in attrList: + self.bgColor = int(attributes["background_color"], 16) + + def get_bytes(self): + ret = bytes(self) + if self.type == 2: + for stop in self.stop: + ret += bytes(stop) + return ret + + def get_size(self): + ret = sizeof(self) + if self.type == 2: + for stop in self.stop: + ret += sizeof(stop) + return ret \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dial_click.py b/tools/dial_tools/dial_converter_tool/dial_click.py new file mode 100644 index 000000000..4c2384090 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_click.py @@ -0,0 +1,70 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect + +class ClickTypeUnion(Union): + _fields_ = [ + ('sliceId', c_uint), + ('bundleName', c_char * 64) + ] + +class DialClick(Structure): + _fields_ = [ + ('type', c_ubyte), + ('rect', Rect), + ('unionType', ClickTypeUnion), + ('displayMode', c_ubyte) + ] + + def __init__(self): + self.period = 0 + self.displayMode = 0 + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + if self.rect.x < np.iinfo(np.int16).min or self.rect.x > np.iinfo(np.int16).max: + print("[ERR]:click rect x out of range") + sys.exit(1) + self.rect.y = int(y) + if self.rect.y < np.iinfo(np.int16).min or self.rect.y > np.iinfo(np.int16).max: + print("[ERR]:click rect y out of range") + sys.exit(1) + self.rect.w = int(w) + if self.rect.w < np.iinfo(np.int16).min or self.rect.w > np.iinfo(np.int16).max: + print("[ERR]:click rect w out of range") + sys.exit(1) + self.rect.h = int(h) + if self.rect.h < np.iinfo(np.int16).min or self.rect.h > np.iinfo(np.int16).max: + print("[ERR]:click rect h out of range") + sys.exit(1) + + for attr in attributes.getNames(): + if attr == "action_slice": + self.unionType.sliceId = int(attributes["action_slice"]) + self.type = 0 + break + elif attr == "action_bundle": + self.unionType.bundleName = bytes(attributes["action_bundle"], encoding = "utf8") + self.type = 1 + break + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dial_digital_img.py b/tools/dial_tools/dial_converter_tool/dial_digital_img.py new file mode 100644 index 000000000..8f634ef80 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_digital_img.py @@ -0,0 +1,121 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialDigitalImg(Structure): + _fields_ = [ + ('alignType', c_ubyte, 4), + ('integerLength', c_ubyte, 4), + ('decimalPrecision', c_ubyte), + ('imgIds', c_ushort * 10), + ('signImgId', c_ushort), + ('decimalPointImgId', c_ushort), + ('space', c_ushort), + ('alignPosition', Point), + ('bindData', c_short), + ('isPeriodic', c_bool), + ('displayMode', c_ubyte), + ('isAmbientPeriodic', c_bool) + ] + + def __init__(self): + self.period = 0 + self.isPeriodic = False + self.displayMode = 0 + self.isAmbientPeriodic = False + + def parse_attributes(self, attributes): + imgNames = attributes["img_names"].split(",") + length = len(imgNames) + if length < 10: + print("[ERR]:tag:[digital_img] attr[img_names] less than 10!") + sys.exit(1) + else: + for index in range(10): + self.imgIds[index] = img_convert.instance.convert_img(imgNames[index]) + + self.space = int(attributes["space"]) + if self.space < 0 or self.space > np.iinfo(np.int16).max: + print("[ERR]:digital image space out of range") + sys.exit(1) + + alignStr = attributes["align"] + if alignStr == "right": + self.alignType = 2 + elif alignStr == "center": + self.alignType = 1 + elif alignStr == "left": + self.alignType = 0 + else: + print("[ERR]:digital image align not support") + + align_pos_x,align_pos_y = attributes["align_pos"].split(" ") + align_x = int(align_pos_x) + if align_x < np.iinfo(np.int16).min or align_x > np.iinfo(np.int16).max: + print("[ERR]:digital image align x out of range") + sys.exit(1) + self.alignPosition.x = align_x + + align_y = int(align_pos_y) + if align_y < np.iinfo(np.int16).min or align_y > np.iinfo(np.int16).max: + print("[ERR]:digital image align y out of range") + sys.exit(1) + self.alignPosition.y = align_y + + self.bindData = int(attributes["bind_data"]) + if self.bindData < 0 or self.bindData > np.iinfo(np.int16).max: + print("[ERR]:digital image bind data out of range") + sys.exit(1) + + for attr in attributes.getNames(): + if attr == "sign_img_name": + signImgName = attributes["sign_img_name"] + self.signImgId = img_convert.instance.convert_img(signImgName) + elif attr == "integer_length": + self.integerLength = int(attributes["integer_length"]) + if self.integerLength < 0 or self.integerLength > np.iinfo(np.uint8).max: + print("[ERR]:digital image integer length out of range") + sys.exit(1) + elif attr == "img_decimal_point": + decimalPointImgName = attributes["img_decimal_point"] + self.decimalPointImgId = img_convert.instance.convert_img(decimalPointImgName) + elif attr == "decimal_precision": + self.decimalPrecision = int(attributes["decimal_precision"]) + if self.decimalPrecision < 0 or self.decimalPrecision > np.iinfo(np.uint8).max: + print("[ERR]:digital image decimal precision out of range") + sys.exit(1) + elif attr == "period": + period_suppor_value = {1, 10, 30, 60} + self.period = int(attributes["period"]) + if self.period == 0: + self.isPeriodic = False + elif self.period not in period_suppor_value: + self.period = 0 + print("[WARNING]:digital image period value not support, using defalut value 0") + else: + self.isPeriodic = True + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + if self.displayMode != 0 : + if "ambient_periodic" in attributes.getNames(): + if attributes["ambient_periodic"] == "true": + self.isAmbientPeriodic = True + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dial_kaleidoscope.py b/tools/dial_tools/dial_converter_tool/dial_kaleidoscope.py new file mode 100644 index 000000000..8f8952605 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_kaleidoscope.py @@ -0,0 +1,45 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +from xml.dom.minidom import parse +from ctypes import * +import img_convert + +class DialKaleidoscope(Structure): + _fields_ = [ + ('imgId', c_ushort), + ('rotateEventFactor', c_float), + ('rotateAnimatorValue', c_float), + ('displayMode', c_ubyte) + ] + + def __init__(self): + self.imgId = 0 + self.rotateEventFactor = 1.0 + self.rotateAnimatorValue = 0.0 + self.period = 0 + self.displayMode = 0 + + def parse_attributes(self, attributes): + self.imgId = img_convert.instance.convert_img(attributes["img_name"]) + for attr in attributes.getNames(): + if attr == "crown_rotate_step": + self.rotateEventFactor = float(attributes["crown_rotate_step"]) + elif attr == "animator_rotate_step": + self.rotateAnimatorValue = float(attributes["animator_rotate_step"]) + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) diff --git a/tools/dial_tools/dial_converter_tool/dial_label.py b/tools/dial_tools/dial_converter_tool/dial_label.py new file mode 100644 index 000000000..1bd19dbcf --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_label.py @@ -0,0 +1,129 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect + +class DialLabel(Structure): + _fields_ = [ + ('breakMode', c_ubyte), + ('align', c_ubyte), + ('fontSize', c_ubyte), + ('isPeriodic', c_bool), + ('rect', Rect), + ('color', c_uint), + ('fontName', c_char * 64), + ('text', c_char * 64), + ('bindData', c_short), + ('displayMode', c_ubyte), + ('isAmbientPeriodic', c_bool) + ] + + def __init__(self): + self.period = 0 + self.isPeriodic = False + self.displayMode = 0 + self.isAmbientPeriodic = False + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + if self.rect.x < np.iinfo(np.int16).min or self.rect.x > np.iinfo(np.int16).max: + print("[ERR]:label rect x out of range") + sys.exit(1) + self.rect.y = int(y) + if self.rect.y < np.iinfo(np.int16).min or self.rect.y > np.iinfo(np.int16).max: + print("[ERR]:label rect y out of range") + sys.exit(1) + self.rect.w = int(w) + if self.rect.w < np.iinfo(np.int16).min or self.rect.w > np.iinfo(np.int16).max: + print("[ERR]:label rect w out of range") + sys.exit(1) + self.rect.h = int(h) + if self.rect.h < np.iinfo(np.int16).min or self.rect.h > np.iinfo(np.int16).max: + print("[ERR]:label rect h out of range") + sys.exit(1) + + mode = attributes["break_mode"] + if mode == "adapt": + self.breakMode = 0 + elif mode == "stretch": + self.breakMode = 1 + elif mode == "wrap": + self.breakMode = 2 + elif mode == "ellipsis": + self.breakMode = 3 + elif mode == "marquee": + self.breakMode = 4 + elif mode == "clip": + self.breakMode = 5 + else: + self.breakMode = 3 + print("[WARNING][label:break_mode]Incorrect input:", mode) + + alignStr = attributes["align"] + if alignStr == "bottom": + self.align = 4 + elif alignStr == "top": + self.align = 3 + elif alignStr == "center": + self.align = 2 + elif alignStr == "right": + self.align = 1 + elif alignStr == "left": + self.align = 0 + else: + self.align = 0 + print("[WARNING][label:align]Incorrect input:", alignStr) + + self.fontSize = int(attributes["font_size"]) + if self.fontSize < 0 or self.fontSize > np.iinfo(np.uint8).max: + print("[ERR]:label font size out of range") + sys.exit(1) + + self.color = int(attributes["color"], 16) + self.fontName = bytes(attributes["font"], encoding = "utf8") + self.text = bytes(attributes["text"], encoding = "utf8") + + for attr in attributes.getNames(): + if attr == "bind_data": + self.bindData = int(attributes["bind_data"]) + if self.bindData < 0 or self.bindData > np.iinfo(np.int16).max: + print("[ERR]:label bind data out of range") + sys.exit(1) + elif attr == "period": + period_suppor_value = {1, 10, 30, 60} + self.period = int(attributes["period"]) + if self.period == 0: + self.isPeriodic = False + elif self.period not in period_suppor_value: + self.period = 0 + print("[WARNING]:label image period value not support, using defalut value 0") + else: + self.isPeriodic = True + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + if self.displayMode != 0 : + if "ambient_periodic" in attributes.getNames(): + if attributes["ambient_periodic"] == "true": + self.isAmbientPeriodic = True + + if self.isPeriodic != 0 and self.bindData == 0: + print("[ERR]:[bind_data] is not set, [period] cannot be set") + sys.exit(1) + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dial_option_img.py b/tools/dial_tools/dial_converter_tool/dial_option_img.py new file mode 100644 index 000000000..c2a448c15 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_option_img.py @@ -0,0 +1,83 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialOptionImg(Structure): + _fields_ = [ + ('pos', Point), + ('bindData', c_short), + ('isPeriodic', c_bool), + ('count', c_ubyte), + ('displayMode', c_ubyte), + ('isAmbientPeriodic', c_bool) + ] + + def __init__(self): + self.imgId = [] + self.period = 0 + self.isPeriodic = False + self.displayMode = 0 + self.isAmbientPeriodic = False + + def parse_attributes(self, attributes): + input_pos_x,input_pos_y = attributes["position"].split(" ") + self.pos.x = int(input_pos_x) + if self.pos.x < np.iinfo(np.int16).min or self.pos.x > np.iinfo(np.int16).max: + print("[ERR]:option image pos x out of range") + sys.exit(1) + + self.pos.y = int(input_pos_y) + if self.pos.y < np.iinfo(np.int16).min or self.pos.y > np.iinfo(np.int16).max: + print("[ERR]:option image pos y out of range") + sys.exit(1) + + self.bindData = int(attributes["bind_data"]) + if self.bindData < 0 or self.bindData > np.iinfo(np.int16).max: + print("[ERR]:option image bind data out of range") + sys.exit(1) + + imgNames = attributes["img_names"].split(",") + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + if self.displayMode != 0: + if "ambient_periodic" in attributes.getNames(): + if attributes["ambient_periodic"] == "true": + self.isAmbientPeriodic = True + + self.count = len(imgNames) + for img in imgNames: + imgId = img_convert.instance.convert_img(img) + self.imgId.append(imgId) + + if "period" in attributes.getNames(): + period_suppor_value = {1, 10, 30, 60} + self.period = int(attributes["period"]) + if self.period == 0: + self.isPeriodic = False + elif self.period not in period_suppor_value: + self.period = 0 + print("[WARNING]:option image period value not support, using defalut value 0") + else: + self.isPeriodic = True + + def get_bytes(self): + ret = bytes(self) + for index in range(self.count): + ret += struct.pack('@H', self.imgId[index]) + return ret + + def get_size(self): + return sizeof(self) + sizeof(c_ushort) * self.count \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dial_rotate_img.py b/tools/dial_tools/dial_converter_tool/dial_rotate_img.py new file mode 100644 index 000000000..9a12409da --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_rotate_img.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialRotateImg(Structure): + _fields_ = [ + ('pos', Point), + ('center', Point), + ('rotateStart', c_short), + ('rotaeteEnd', c_short), + ('imgId', c_ushort), + ('bindData', c_short), + ('isPeriodic', c_bool), + ('displayMode', c_ubyte), + ('isAmbientPeriodic', c_bool) + ] + + def __init__(self): + self.period = 0 + self.isPeriodic = False + self.displayMode = 0 + self.isAmbientPeriodic = False + + def parse_attributes(self, attributes): + input_pos_x,input_pos_y = attributes["position"].split(" ") + self.pos.x = int(input_pos_x) + if self.pos.x < np.iinfo(np.int16).min or self.pos.x > np.iinfo(np.int16).max: + print("[ERR]:rotate image pos x out of range") + sys.exit(1) + + self.pos.y = int(input_pos_y) + if self.pos.y < np.iinfo(np.int16).min or self.pos.y > np.iinfo(np.int16).max: + print("[ERR]:rotate image pos y out of range") + sys.exit(1) + + x,y = attributes["rotate_center"].split(" ") + self.center.x = round(float(x)) + self.center.y = round(float(y)) + + self.rotateStart = int(attributes["rotate_start"]) + if self.rotateStart < 0.0 or self.rotateStart > 360.0 : + print("[ERR]:rotate image start angle out of range, [0, 360]") + sys.exit(1) + + self.rotaeteEnd = int(attributes["rotate_end"]) + if self.rotaeteEnd < 0.0 or self.rotaeteEnd > 360.0 : + print("[ERR]:rotate image end angle out of range, [0, 360]") + sys.exit(1) + + self.bindData = int(attributes["bind_data"]) + if self.bindData < 0 or self.bindData > np.iinfo(np.int16).max: + print("[ERR]:rotate image bind data out of range") + sys.exit(1) + + self.imgId = img_convert.instance.convert_img(attributes["img_name"]) + if "period" in attributes.getNames(): + period_suppor_value = {1, 10, 30, 60} + self.period = int(attributes["period"]) + if self.period == 0: + self.isPeriodic = False + elif self.period not in period_suppor_value: + self.period = 0 + print("[WARNING]:rotate image period value not support, using defalut value 0") + else: + self.isPeriodic = True + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode = 1 + elif display_mode == "always": + self.displayMode = 2 + if self.displayMode != 0: + if "ambient_periodic" in attributes.getNames(): + if attributes["ambient_periodic"] == "true": + self.isAmbientPeriodic = True + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dial_sequence_img.py b/tools/dial_tools/dial_converter_tool/dial_sequence_img.py new file mode 100644 index 000000000..5f6a06ea3 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_sequence_img.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialSequenceImg(Structure): + _fields_ = [ + ('pos', Point), + ('interval', c_ushort), + ('repeat', c_bool), + ('imgNum', c_ubyte), + ('displayMode', c_ubyte) + ] + + def __init__(self): + self.imgId = [] + self.period = 0 + self.displayMode = 0 + + def parse_attributes(self, attributes): + x,y = attributes["position"].split(" ") + self.pos.x = int(x) + if self.pos.x < np.iinfo(np.int16).min or self.pos.x > np.iinfo(np.int16).max : + print("[ERR]:sequence image pos x out of range") + sys.exit(1) + + self.pos.y = int(y) + if self.pos.y < np.iinfo(np.int16).min or self.pos.y > np.iinfo(np.int16).max : + print("[ERR]:sequence image pos y out of range") + sys.exit(1) + + if attributes["repeat"].lower() == "true" : + self.repeat = True + elif attributes["repeat"].lower() == "false" : + self.repeat = False + else: + print("[ERR]:sequence image repeat only 'True' or 'False'") + sys.exit(1) + + interval = int(attributes["interval"]) + if interval < 0 or interval > np.iinfo(np.int16).max : + print("[ERR]: sequence image interval out of range") + sys.exit(1) + else: + self.interval = interval + + imgNames = attributes["img_names"].split(",") + self.imgNum = len(imgNames) + for img in imgNames: + imgId = img_convert.instance.convert_img(img) + self.imgId.append(imgId) + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + + def get_bytes(self): + ret = bytes(self) + for index in range(self.imgNum): + ret += struct.pack('@H', self.imgId[index]) + return ret + + def get_size(self): + return sizeof(self) + sizeof(c_ushort) * self.imgNum \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dial_static_img.py b/tools/dial_tools/dial_converter_tool/dial_static_img.py new file mode 100644 index 000000000..e05717100 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_static_img.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Point +import img_convert + +class DialStaticImg(Structure): + _fields_ = [ + ('pos', Point), + ('center', Point), + ('rotate', c_float), + ('imgId', c_ushort), + ('displayMode', c_ubyte), + ] + + def __init__(self): + self.imgId = 0 + self.center.x = 0 + self.center.y = 0 + self.rotate = 0.0 + self.period = 0 + self.displayMode = 0 + + def parse_attributes(self, attributes): + input_pos_x, input_pos_y = attributes["position"].split(" ") + self.pos.x = int(input_pos_x) + if self.pos.x < np.iinfo(np.int16).min or self.pos.x > np.iinfo(np.int16).max: + print("[ERR]:static image pos x out of range") + sys.exit(1) + + self.pos.y = int(input_pos_y) + if self.pos.y < np.iinfo(np.int16).min or self.pos.y > np.iinfo(np.int16).max: + print("[ERR]:static image pos y out of range") + sys.exit(1) + + self.imgId = img_convert.instance.convert_img(attributes["img_name"]) + + for attr in attributes.getNames(): + if attr == "center": + input_center_x,input_center_y = attributes["center"].split(" ") + self.center.x = int(input_center_x) + if self.center.x < np.iinfo(np.int16).min or self.center.x > np.iinfo(np.int16).max: + print("[ERR]:static image center x out of range") + sys.exit(1) + + self.center.y = int(input_center_y) + if self.center.y < np.iinfo(np.int16).min or self.center.y > np.iinfo(np.int16).max: + print("[ERR]:static image center y out of range") + sys.exit(1) + elif attr == "rotate": + rotate = float(attributes["rotate"]) + if rotate < 0.0 or rotate > 360.0 : + print("[ERR]:static image rotate out of range, [0, 360]") + sys.exit(1) + self.rotate = rotate + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode = 1 + elif display_mode == "always": + self.displayMode = 2 + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) diff --git a/tools/dial_tools/dial_converter_tool/dial_video.py b/tools/dial_tools/dial_converter_tool/dial_video.py new file mode 100644 index 000000000..ecc263f05 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/dial_video.py @@ -0,0 +1,61 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import numpy as np +from xml.dom.minidom import parse +from ctypes import * +from common_types import Rect +import video_convert +import img_convert + +class DialVideo(Structure): + _fields_ = [ + ('rect', Rect), + ('offset', c_uint), + ('colorKey', c_uint), + ('imgId', c_uint), + ('displayMode', c_ubyte) + ] + + def __init__(self): + self.period = 0 + self.displayMode = 0 + + def parse_attributes(self, attributes): + x,y,w,h = attributes["rect"].split(" ") + self.rect.x = int(x) + if self.rect.x < np.iinfo(np.int16).min or self.rect.x > np.iinfo(np.int16).max: + print("[ERR]:video rect x out of range") + sys.exit(1) + self.rect.y = int(y) + if self.rect.y < np.iinfo(np.int16).min or self.rect.y > np.iinfo(np.int16).max: + print("[ERR]:video rect y out of range") + sys.exit(1) + self.rect.w = int(w) + if self.rect.w < np.iinfo(np.int16).min or self.rect.w > np.iinfo(np.int16).max: + print("[ERR]:video rect w out of range") + sys.exit(1) + self.rect.h = int(h) + if self.rect.h < np.iinfo(np.int16).min or self.rect.h > np.iinfo(np.int16).max: + print("[ERR]:video rect h out of range") + sys.exit(1) + + self.colorKey = int(attributes["color_key"], 16) + self.offset = video_convert.instance.convert_video(attributes["source"]) + self.imgId = img_convert.instance.convert_img(attributes["preview_frame"]) + + if "display_mode" in attributes.getNames(): + display_mode = attributes["display_mode"] + if display_mode == "normal": + self.displayMode = 0 + elif display_mode == "ambient": + self.displayMode= 1 + elif display_mode == "always": + self.displayMode= 2 + + def get_bytes(self): + return bytes(self) + + def get_size(self): + return sizeof(self) \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/dll/linux_cs/libcodec.so b/tools/dial_tools/dial_converter_tool/dll/linux_cs/libcodec.so new file mode 100644 index 000000000..b9cf3fba2 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/dll/linux_cs/libcodec.so differ diff --git a/tools/dial_tools/dial_converter_tool/dll/linux_es/libcodec.so b/tools/dial_tools/dial_converter_tool/dll/linux_es/libcodec.so new file mode 100644 index 000000000..ddb8838c4 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/dll/linux_es/libcodec.so differ diff --git a/tools/dial_tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.dll b/tools/dial_tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.dll new file mode 100644 index 000000000..7f5174ea7 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.dll differ diff --git a/tools/dial_tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.lib b/tools/dial_tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.lib new file mode 100644 index 000000000..b33983890 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/dll/x64/release_cs/ICE_V5R1_BLOCK_HTC.lib differ diff --git a/tools/dial_tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.dll b/tools/dial_tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.dll new file mode 100644 index 000000000..4b74cd681 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.dll differ diff --git a/tools/dial_tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.lib b/tools/dial_tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.lib new file mode 100644 index 000000000..811632bbd Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/dll/x64/release_es/ICE_V5R1_BLOCK_HTC.lib differ diff --git a/tools/dial_tools/dial_converter_tool/img_convert.py b/tools/dial_tools/dial_converter_tool/img_convert.py new file mode 100644 index 000000000..3c8dfad63 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/img_convert.py @@ -0,0 +1,301 @@ +import base64 +from PIL import Image +from io import BytesIO +import cv2 +import ctypes +from ctypes import * +from PIL import Image + +import os +import sys +import struct +import time +import platform +import numpy as np +import pickle as p +import requests +import matplotlib.pyplot as pyplot + +global dll +if platform.system().lower() == 'windows': + dll = ctypes.CDLL(r".\dll\x64\release_cs\ICE_V5R1_BLOCK_HTC.dll") +elif platform.system().lower() == 'linux': + dll = ctypes.CDLL(sys.path[0] + r"/dll/linux_cs/libcodec.so") + +class Header(ctypes.Structure): + _fields_ = [ + ("width", c_uint), + ("height", c_uint), + ("stride", c_uint), + ("pixel_format", c_uint), + ("tile_width", c_uint), + ("mode_alpha", c_uint), + ("mode_rgb", c_uint) + ] + +class BsData(ctypes.Structure): + _fields_ = [ + ("bs_data", POINTER(c_ubyte)), + ("data_size", c_uint), + ("cmp_ratio", c_uint), + ("is_valid", c_uint), + ("subjective_review", c_uint), + ("para", Header) + ] + +class AutoCmpOutput(ctypes.Structure): + _fields_ = [ + ("cmp_bs0", POINTER(BsData)), + ("cmp_bs1", POINTER(BsData)), + ("cmp_bs2", POINTER(BsData)), + ("cmp_bs3", POINTER(BsData)), + ("auto_cmp_mode", c_uint), + ("valid_bs_num", c_uint) + ] + +class CmpInput(ctypes.Structure): + _fields_ = [ + ("width", c_uint), + ("height", c_uint), + ("stride", c_uint), + ("pixel_format", c_uint), + ("tile_width", c_uint), + ("mode_alpha", c_uint), + ("mode_rgb", c_uint), + ("red_channel", POINTER(c_ubyte)), + ("green_channel", POINTER(c_ubyte)), + ("blue_channel", POINTER(c_ubyte)), + ("alpha_channel", POINTER(c_ubyte)) + ] + +class AutoCmpInput(ctypes.Structure): + _fields_ =[ + ("auto_cmp_mode", c_uint), + ("high_quality_mode", c_uint), + ("high_cmp_ratio_mode", c_uint), + ("cmp_in", POINTER(CmpInput)) + ] + +class BinHeader(ctypes.Structure): + _fields_ = [ + ("dirId", c_uint), + ("count", c_uint) + ] + +class SeekInfo(ctypes.Structure): + _fields_ = [ + ("offset", c_uint), + ("size", c_uint) + ] + +class ImageHeader(ctypes.Structure): + _fields_ = [ + ("colorMode", c_uint, 8), + ("version", c_uint, 4), + ("compressMode", c_uint, 4), + ("reserved", c_uint, 16), + ("width", c_ushort), + ("height", c_ushort) + ] + +class ImageConverTool(): + binHeader = BinHeader() + binHeader.dirId = 0xfef + seekInfo = [] + imageHeader = [] + imageData = [] + imageNum = 0 + isConvertedFile = [] + tile_width_support = {4, 6, 8, 16} + + def __init__(self): + self.markCurOffset = 0 + self.width = 0 + self.height = 0 + self.file_alpha = False + self.cmp_mode = "HFBC" + self.color_fmt = ' ' + self.align = 1 + self.tile_width = 6 + self.mode_alpha = 1 + self.mode_rgb = 1 + self.auto_cmp_mode = 0 + self.high_quality_mode = 0 + self.high_cmp_ratio_mode = 0 + self.version = 1 + + def set_tile_width(self, tile_width): + if tile_width not in self.tile_width_support: + print("[ERR]:The tile_width:{tile_width} value is not supported.") + sys.exit(1) + + self.tile_width = tile_width + + def _convert(self): + width, height = self.image.size + self.width = width + self.height = height + self.stride_pixel = (self.width + self.align - 1) // self.align * self.align + if len(self.image.split()) > 3: + self.file_alpha = True + else: + self.file_alpha = False + + # initialize CmpInput + cmp_input = CmpInput() + self._get_cmp_input(cmp_input) + auto_cmp_input = AutoCmpInput() + self._get_auto_cmp_input(auto_cmp_input, cmp_input) + + # call GetBufferSize to get buffer size + # initialize CmpOutput + auto_cmp_output = AutoCmpOutput() + + cmp_bs0 = BsData() + buf_size0 = dll.ice_v5r1_block_get_buffer_size(byref(cmp_input)) # 压缩后输出数据的大小 + cmp_bs0.bs_data = (c_ubyte * buf_size0)() + auto_cmp_output.cmp_bs0 = ctypes.cast(pointer(cmp_bs0), POINTER(BsData)) + ret = dll.ice_v5r1_block_htc_auto_cmp(byref(auto_cmp_input), byref(auto_cmp_output)) # 对输入数据进行压缩返回值是函数正常运行标志位 + + # add imageinfo to list + self.binHeader.count += 1 + + imageInfo = ImageHeader() + imageInfo.width = self.width + imageInfo.height = self.height + imageInfo.colorMode = self._get_color_mode() + imageInfo.version = 1 + imageInfo.compressMode = 4 + imageInfo.reserved = 0 + seekInfo = SeekInfo() + seekInfo.offset = self.markCurOffset + seekInfo.size = sizeof(imageInfo) + cmp_bs0.data_size + self.markCurOffset += seekInfo.size + self.seekInfo.append(seekInfo) + self.imageHeader.append(imageInfo) + self.imageData.append(cmp_bs0) + self.imageNum += 1 + return self.imageNum + + def _check_path(self, path): + if not os.path.exists(path): + print("[ERROR]:", path, "is not exist") + return False + else: + if (not path[-3:].lower() == "png") and (not path[-3:].lower() == "jpg") and (not path[-3:].lower() == "bmp"): + print("[ERROR]:", path, "is not jpg or png or bmp format image") + return False + return True + + def convert_img(self, path): + if path in self.isConvertedFile: + return self.isConvertedFile.index(path) + 1 + + if not self._check_path(path): + sys.exit(1) + + self.image = Image.open(path) + if self.image.mode == 'RGBA': + self.color_fmt = 'ARGB8888' + elif self.image.mode == 'RGB': + self.color_fmt = 'RGB888' + self.isConvertedFile.append(path) + return self._convert() + + def _get_cmp_px_format(self): + if self.color_fmt == 'RGB565': + return 2 + elif self.color_fmt == 'RGB888': + return 0 + elif self.color_fmt == 'ARGB8888': + return 1 + + def _get_color_mode(self): + if self.color_fmt == 'RGB565': + return 2 + elif self.color_fmt == 'RGB888': + return 1 + elif self.color_fmt == 'ARGB8888': + return 0 + + def _get_auto_cmp_input(self, auto_cmp_input, cmp_input): + auto_cmp_input.auto_cmp_mode = self.auto_cmp_mode + auto_cmp_input.high_quality_mode = self.high_quality_mode + auto_cmp_input.high_cmp_ratio_mode = self.high_cmp_ratio_mode + auto_cmp_input.cmp_in = ctypes.cast(pointer(cmp_input), POINTER(CmpInput)) + + def _get_cmp_input(self, cmp_input): + cmp_input.width = self.width + cmp_input.height = self.height + cmp_input.stride = self.width + cmp_input.tile_width = self.tile_width + cmp_input.mode_alpha = self.mode_alpha + cmp_input.mode_rgb = self.mode_rgb + cmp_input.pixel_format = self._get_cmp_px_format() + size = self.width * self.height + red = (c_ubyte * size)() + green = (c_ubyte * size)() + blue = (c_ubyte * size)() + alpha = (c_ubyte * size)() + + for row in range(self.height): + for col in range(self.width): + position = row * self.width + col + red[position] = self.image.getdata()[position][0] + green[position] = self.image.getdata()[position][1] + blue[position] = self.image.getdata()[position][2] + if self.file_alpha == False: + alpha[position] = 0xFF + else: + alpha[position] = self.image.getdata()[position][3] + cmp_input.red_channel = red + cmp_input.green_channel = green + cmp_input.blue_channel = blue + cmp_input.alpha_channel = alpha + + def write_data_to_bin(self, fb): + fb.write(bytes(self.binHeader)) + for seek in self.seekInfo: + fb.write(bytes(seek)) + + for index in range(0, self.imageNum): + bt = bytearray() + color_fmt = self.imageHeader[index].colorMode + header = color_fmt + (self.imageHeader[index].width << 32) + \ + (self.imageHeader[index].height << 48) + (self.imageHeader[index].version << 8) + header_bin = struct.pack(" + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/instance/analogue_dial/preview_img.JPG b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/preview_img.JPG new file mode 100644 index 000000000..2b1ee8358 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/preview_img.JPG differ diff --git a/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/FIRDAY_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/FIRDAY_IMAGE_PATH.png new file mode 100644 index 000000000..9c3993262 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/FIRDAY_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/MONDAY_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/MONDAY_IMAGE_PATH.png new file mode 100644 index 000000000..58d2cdd29 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/MONDAY_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/SATURDAY_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/SATURDAY_IMAGE_PATH.png new file mode 100644 index 000000000..861ad16a8 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/SATURDAY_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/SUNDAY_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/SUNDAY_IMAGE_PATH.png new file mode 100644 index 000000000..1a0947185 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/SUNDAY_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/THURSDAY_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/THURSDAY_IMAGE_PATH.png new file mode 100644 index 000000000..a2e27c6d8 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/THURSDAY_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/TUESDAY_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/TUESDAY_IMAGE_PATH.png new file mode 100644 index 000000000..c5b292dcb Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/TUESDAY_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/WEDNESDAY_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/WEDNESDAY_IMAGE_PATH.png new file mode 100644 index 000000000..e099b5661 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/analogue_dial/week/WEDNESDAY_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/BIGCIRCLE_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/BIGCIRCLE_IMAGE_PATH.png new file mode 100644 index 000000000..e6e382277 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/BIGCIRCLE_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/HOURHAND.png b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/HOURHAND.png new file mode 100644 index 000000000..77cf955da Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/HOURHAND.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/MEDCIRCLE_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/MEDCIRCLE_IMAGE_PATH.png new file mode 100644 index 000000000..7a47b8f21 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/MEDCIRCLE_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/MINUTEHAND.png b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/MINUTEHAND.png new file mode 100644 index 000000000..f4b1dbe0f Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/MINUTEHAND.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/SECONDHAND.png b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/SECONDHAND.png new file mode 100644 index 000000000..147de5f68 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/SECONDHAND.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/SMALLCIRCLE_IMAGE_PATH.png b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/SMALLCIRCLE_IMAGE_PATH.png new file mode 100644 index 000000000..54d990129 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/SMALLCIRCLE_IMAGE_PATH.png differ diff --git a/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/kaleidoscope_dial.xml b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/kaleidoscope_dial.xml new file mode 100644 index 000000000..4c1511eb4 --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/kaleidoscope_dial.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/preview_img.PNG b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/preview_img.PNG new file mode 100644 index 000000000..9d7239d5c Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/preview_img.PNG differ diff --git a/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/rabbit454.png b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/rabbit454.png new file mode 100644 index 000000000..d937bf2d3 Binary files /dev/null and b/tools/dial_tools/dial_converter_tool/instance/kaleidoscope_dial/rabbit454.png differ diff --git a/tools/dial_tools/dial_converter_tool/main.py b/tools/dial_tools/dial_converter_tool/main.py new file mode 100644 index 000000000..26b6ed6cf --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/main.py @@ -0,0 +1,46 @@ +#!/usr/bin/python +# coding: utf-8 +# 1\ 解析命令 python main.py -d [DIR] -o [OUT_DIR] +# 2\ 循环执行svg解析写入 +import sys +import os +import argparse +from converter import DialConvertTool + +def GetParameters(): + parser = argparse.ArgumentParser() + + parser.add_argument('-file', '-f', type=str, default='', required=False, + help='Specifies the path of the offline watch face XML file to be converted.') + + parser.add_argument('-dir', '-d', type=str, default='', required=False, + help='Specifies the path of the folder to be converted. Convert all .xml files in the folder according to the specified path.') + + parser.add_argument('-output', type=str, default=os.getcwd() + "/out", required=False, + help='output dir') + + config = parser.parse_args() + return config + +if __name__ == "__main__": + userInput = GetParameters() + outputPath = userInput.output + inputFile = userInput.file + inputDir = userInput.dir + # Create an output folder. + print("output dir : " + outputPath) + if not os.path.exists(outputPath): + os.mkdir(outputPath) + + if not os.path.isdir(inputFile) and inputFile[-3:].lower() == "xml": + print("input file : " + inputFile) + converter = DialConvertTool() + converter.convert_xml_to_output(inputFile, outputPath) + + print("inputdir", inputDir) + files = os.listdir(inputDir) + print("input dir : " + inputDir) + for file in files: + if not os.path.isdir(file) and file[-3:].lower() == "xml": + converter = DialConvertTool() + converter.convert_xml_to_output(inputDir + "/" + file, outputPath) \ No newline at end of file diff --git a/tools/dial_tools/dial_converter_tool/video_convert.py b/tools/dial_tools/dial_converter_tool/video_convert.py new file mode 100644 index 000000000..d447a166b --- /dev/null +++ b/tools/dial_tools/dial_converter_tool/video_convert.py @@ -0,0 +1,32 @@ +#!/usr/bin/python +# coding: utf-8 +import sys +import struct +import ctypes +from ctypes import * + +class VideoConvertTool: + def __init__(self): + self.videoNum = 0 + self.videoName = [] + self.videoIndex = [] + self.videoData = bytearray() + + def convert_video(self, path): + if path in self.videoName: + index = self.videoName.index(path) + return self.videoIndex[index] + fp = open(path, 'rb') + data = fp.read() + fp.close() + self.videoName.append(path) + self.videoNum += 1 + ret = len(self.videoData) + self.videoIndex.append(ret) + self.videoData += data + return ret + + def write_data_to_bin(self, fb): + fb.write(self.videoData) + +instance = VideoConvertTool() diff --git a/tools/dial_tools/dial_lzma/207/owl_clock.lzma b/tools/dial_tools/dial_lzma/207/owl_clock.lzma index 37f9fc365..b191a24bf 100644 Binary files a/tools/dial_tools/dial_lzma/207/owl_clock.lzma and b/tools/dial_tools/dial_lzma/207/owl_clock.lzma differ diff --git a/tools/dial_tools/dial_lzma/207/owl_clock.png b/tools/dial_tools/dial_lzma/207/owl_clock.png new file mode 100644 index 000000000..6e8149cc2 Binary files /dev/null and b/tools/dial_tools/dial_lzma/207/owl_clock.png differ diff --git "a/tools/dial_tools/dial_lzma/207/\350\257\264\346\230\216.txt" "b/tools/dial_tools/dial_lzma/207/\350\257\264\346\230\216.txt" new file mode 100644 index 000000000..552bbac13 --- /dev/null +++ "b/tools/dial_tools/dial_lzma/207/\350\257\264\346\230\216.txt" @@ -0,0 +1,3 @@ +中文名:动态小鹰 +英文名:owl clock +标签:数码表盘; diff --git a/tools/dial_tools/instance/207/owl_clock.xml b/tools/dial_tools/instance/207/owl_clock.xml index 3fd9e6d20..afe1ca4f4 100644 --- a/tools/dial_tools/instance/207/owl_clock.xml +++ b/tools/dial_tools/instance/207/owl_clock.xml @@ -6,15 +6,20 @@ - - - - - - - - - + + + + + + + + + + + + + - + + diff --git a/tools/dial_tools/instance/208/BACKGROUND_0_6.png b/tools/dial_tools/instance/208/BACKGROUND_0_6.png new file mode 100644 index 000000000..b366278ba Binary files /dev/null and b/tools/dial_tools/instance/208/BACKGROUND_0_6.png differ diff --git a/tools/dial_tools/instance/208/BACKGROUND_12_18.png b/tools/dial_tools/instance/208/BACKGROUND_12_18.png new file mode 100644 index 000000000..aedf4b754 Binary files /dev/null and b/tools/dial_tools/instance/208/BACKGROUND_12_18.png differ diff --git a/tools/dial_tools/instance/208/BACKGROUND_18_24.png b/tools/dial_tools/instance/208/BACKGROUND_18_24.png new file mode 100644 index 000000000..eea582901 Binary files /dev/null and b/tools/dial_tools/instance/208/BACKGROUND_18_24.png differ diff --git a/tools/dial_tools/instance/208/BACKGROUND_6_12.png b/tools/dial_tools/instance/208/BACKGROUND_6_12.png new file mode 100644 index 000000000..47040438a Binary files /dev/null and b/tools/dial_tools/instance/208/BACKGROUND_6_12.png differ diff --git a/tools/dial_tools/instance/208/HAND_BOTTOM.png b/tools/dial_tools/instance/208/HAND_BOTTOM.png new file mode 100644 index 000000000..61e9cc4bc Binary files /dev/null and b/tools/dial_tools/instance/208/HAND_BOTTOM.png differ diff --git a/tools/dial_tools/instance/208/HAND_TOP.png b/tools/dial_tools/instance/208/HAND_TOP.png new file mode 100644 index 000000000..96fbd0ea9 Binary files /dev/null and b/tools/dial_tools/instance/208/HAND_TOP.png differ diff --git a/tools/dial_tools/instance/208/HOURHAND.png b/tools/dial_tools/instance/208/HOURHAND.png new file mode 100644 index 000000000..82eb6e6b0 Binary files /dev/null and b/tools/dial_tools/instance/208/HOURHAND.png differ diff --git a/tools/dial_tools/instance/208/MAIN_FACE_IMAGE.png b/tools/dial_tools/instance/208/MAIN_FACE_IMAGE.png new file mode 100644 index 000000000..20b41d7e6 Binary files /dev/null and b/tools/dial_tools/instance/208/MAIN_FACE_IMAGE.png differ diff --git a/tools/dial_tools/instance/208/MINUTEHAND.png b/tools/dial_tools/instance/208/MINUTEHAND.png new file mode 100644 index 000000000..9a1adfaee Binary files /dev/null and b/tools/dial_tools/instance/208/MINUTEHAND.png differ diff --git a/tools/dial_tools/instance/208/SECONDHAND.png b/tools/dial_tools/instance/208/SECONDHAND.png new file mode 100644 index 000000000..254851e97 Binary files /dev/null and b/tools/dial_tools/instance/208/SECONDHAND.png differ diff --git a/tools/dial_tools/instance/208/essential_sport.png b/tools/dial_tools/instance/208/essential_sport.png new file mode 100644 index 000000000..a43339bca Binary files /dev/null and b/tools/dial_tools/instance/208/essential_sport.png differ diff --git a/tools/dial_tools/instance/208/essential_sport.xml b/tools/dial_tools/instance/208/essential_sport.xml new file mode 100644 index 000000000..49a1302ff --- /dev/null +++ b/tools/dial_tools/instance/208/essential_sport.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/dial_tools/lzma_tool/lzma_tool b/tools/dial_tools/lzma_tool/lzma_tool new file mode 100644 index 000000000..711d0dca9 Binary files /dev/null and b/tools/dial_tools/lzma_tool/lzma_tool differ diff --git a/tools/dial_tools/lzma_tool/lzma_tool.exe b/tools/dial_tools/lzma_tool/lzma_tool.exe new file mode 100644 index 000000000..300ea2f15 Binary files /dev/null and b/tools/dial_tools/lzma_tool/lzma_tool.exe differ diff --git a/tools/dial_tools/lzma_tool/readme.txt b/tools/dial_tools/lzma_tool/readme.txt new file mode 100644 index 000000000..36c4b0692 --- /dev/null +++ b/tools/dial_tools/lzma_tool/readme.txt @@ -0,0 +1,9 @@ +LZMA SDK 21.07 +-------------- + +UNIX/Linux version +------------------ +To compile C++ version of file->file LZMA encoding, go to directory +CPP/7zip/Bundles/LzmaCon +and call make to recompile it: + make -f makefile.gcc clean all diff --git a/tools/dial_tools/out/owl_clock.bin b/tools/dial_tools/out/owl_clock.bin new file mode 100644 index 000000000..dd94dd456 Binary files /dev/null and b/tools/dial_tools/out/owl_clock.bin differ