mirror of https://github.com/jetkvm/kvm.git
Merge f455d6cc18 into 83caa8f82d
This commit is contained in:
commit
38759a0c6e
|
|
@ -1,27 +1,38 @@
|
|||
{
|
||||
"name": "JetKVM",
|
||||
"image": "mcr.microsoft.com/devcontainers/go:1-1.23-bookworm",
|
||||
"image": "mcr.microsoft.com/devcontainers/go:1.25-trixie",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
// Should match what is defined in ui/package.json
|
||||
"version": "22.15.0"
|
||||
"version": "22.19.0"
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
|
||||
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
|
||||
],
|
||||
"onCreateCommand": ".devcontainer/install-deps.sh",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"bradlc.vscode-tailwindcss",
|
||||
// coding styles
|
||||
"chrislajoie.vscode-modelines",
|
||||
"editorconfig.editorconfig",
|
||||
// GitHub
|
||||
"GitHub.vscode-pull-request-github",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"github.vscode-github-actions",
|
||||
// Golang
|
||||
"golang.go",
|
||||
// C / C++
|
||||
"ms-vscode.cpptools",
|
||||
"ms-vscode.cpptools-extension-pack",
|
||||
// CMake / Makefile
|
||||
"ms-vscode.makefile-tools",
|
||||
"ms-vscode.cmake-tools",
|
||||
// Frontend
|
||||
"esbenp.prettier-vscode",
|
||||
"github.vscode-github-actions"
|
||||
"dbaeumer.vscode-eslint",
|
||||
"bradlc.vscode-tailwindcss"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
device-tree-compiler \
|
||||
gperf g++-multilib gcc-multilib \
|
||||
libnl-3-dev libdbus-1-dev libelf-dev libmpc-dev dwarves \
|
||||
bc openssl flex bison libssl-dev python3 python-is-python3 texinfo kmod cmake \
|
||||
wget zstd \
|
||||
python3-venv python3-kconfiglib \
|
||||
&& sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install buildkit
|
||||
BUILDKIT_VERSION="v0.2.5"
|
||||
BUILDKIT_TMPDIR="$(mktemp -d)"
|
||||
pushd "${BUILDKIT_TMPDIR}" > /dev/null
|
||||
|
||||
wget https://github.com/jetkvm/rv1106-system/releases/download/${BUILDKIT_VERSION}/buildkit.tar.zst && \
|
||||
sudo mkdir -p /opt/jetkvm-native-buildkit && \
|
||||
sudo tar --use-compress-program="unzstd --long=31" -xvf buildkit.tar.zst -C /opt/jetkvm-native-buildkit && \
|
||||
rm buildkit.tar.zst
|
||||
popd
|
||||
|
|
@ -16,6 +16,13 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Set up Cmake cache
|
||||
uses: buildjet/cache@v4
|
||||
with:
|
||||
path: internal/native/cgo/build
|
||||
key: jetkvm-cgo-${{ hashFiles('internal/native/cgo/**/*.c', 'internal/native/cgo/**/*.h', 'internal/native/cgo/**/*.patch', 'internal/native/cgo/**/*.txt', 'internal/native/cgo/**/*.sh', '!internal/native/cgo/build/**') }}
|
||||
restore-keys: |
|
||||
jetkvm-cgo-${{ hashFiles('internal/native/cgo/**/*.c', 'internal/native/cgo/**/*.h', 'internal/native/cgo/**/*.patch', 'internal/native/cgo/**/*.txt', 'internal/native/cgo/**/*.sh', '!internal/native/cgo/build/**') }}
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@ static/*
|
|||
.DS_Store
|
||||
|
||||
device-tests.tar.gz
|
||||
node_modules
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"hash": "10b5fb8d",
|
||||
"configHash": "fd609f12",
|
||||
"lockfileHash": "e3b0c442",
|
||||
"browserHash": "4bebaebb",
|
||||
"optimized": {},
|
||||
"chunks": {}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
{
|
||||
"tailwindCSS.classFunctions": ["cva", "cx"]
|
||||
"tailwindCSS.classFunctions": [
|
||||
"cva",
|
||||
"cx"
|
||||
],
|
||||
"cmake.sourceDirectory": "/Users/aveline/Projects/JetKVM/ymjk/internal/native/cgo"
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
FROM golang:1.24.4-bookworm
|
||||
|
||||
ENV GOTOOLCHAIN=local
|
||||
ENV GOPATH /go
|
||||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
|
||||
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
device-tree-compiler \
|
||||
gperf g++-multilib gcc-multilib \
|
||||
libnl-3-dev libdbus-1-dev libelf-dev libmpc-dev dwarves \
|
||||
bc openssl flex bison libssl-dev python3 python-is-python3 texinfo kmod cmake \
|
||||
wget zstd \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install buildkit
|
||||
ENV BUILDKIT_VERSION="v0.2.2"
|
||||
RUN wget https://github.com/jetkvm/rv1106-system/releases/download/${BUILDKIT_VERSION}/buildkit.tar.zst && \
|
||||
mkdir -p /opt/jetkvm-native-buildkit && \
|
||||
tar --use-compress-program="unzstd --long=31" -xvf buildkit.tar.zst -C /opt/jetkvm-native-buildkit && \
|
||||
rm buildkit.tar.zst
|
||||
|
||||
# Create build directory
|
||||
RUN mkdir -p /build/
|
||||
|
||||
# Copy go.mod and go.sum
|
||||
COPY go.mod go.sum /build/
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN go mod download && go mod verify
|
||||
31
Makefile
31
Makefile
|
|
@ -8,6 +8,10 @@ VERSION := 0.4.7
|
|||
PROMETHEUS_TAG := github.com/prometheus/common/version
|
||||
KVM_PKG_NAME := github.com/jetkvm/kvm
|
||||
|
||||
BUILDKIT_FLAVOR := arm-rockchip830-linux-uclibcgnueabihf
|
||||
BUILDKIT_PATH ?= /opt/jetkvm-native-buildkit
|
||||
|
||||
|
||||
GO_BUILD_ARGS := -tags netgo -tags timetzdata
|
||||
GO_RELEASE_BUILD_ARGS := -trimpath $(GO_BUILD_ARGS)
|
||||
GO_LDFLAGS := \
|
||||
|
|
@ -17,20 +21,37 @@ GO_LDFLAGS := \
|
|||
-X $(PROMETHEUS_TAG).Revision=$(REVISION) \
|
||||
-X $(KVM_PKG_NAME).builtTimestamp=$(BUILDTS)
|
||||
|
||||
GO_CMD := GOOS=linux GOARCH=arm GOARM=7 go
|
||||
GO_ARGS := GOOS=linux GOARCH=arm GOARM=7 ARCHFLAGS="-arch arm"
|
||||
# if BUILDKIT_PATH exists, use buildkit to build
|
||||
ifneq ($(wildcard $(BUILDKIT_PATH)),)
|
||||
GO_ARGS := $(GO_ARGS) \
|
||||
CGO_CFLAGS="-I$(BUILDKIT_PATH)/$(BUILDKIT_FLAVOR)/include -I$(BUILDKIT_PATH)/$(BUILDKIT_FLAVOR)/sysroot/usr/include" \
|
||||
CGO_LDFLAGS="-L$(BUILDKIT_PATH)/$(BUILDKIT_FLAVOR)/lib -L$(BUILDKIT_PATH)/$(BUILDKIT_FLAVOR)/sysroot/usr/lib -lrockit -lrockchip_mpp -lrga -lpthread -lm" \
|
||||
CC="$(BUILDKIT_PATH)/bin/$(BUILDKIT_FLAVOR)-gcc" \
|
||||
LD="$(BUILDKIT_PATH)/bin/$(BUILDKIT_FLAVOR)-ld" \
|
||||
CGO_ENABLED=1
|
||||
# GO_RELEASE_BUILD_ARGS := $(GO_RELEASE_BUILD_ARGS) -x -work
|
||||
endif
|
||||
|
||||
GO_CMD := $(GO_ARGS) go
|
||||
|
||||
BIN_DIR := $(shell pwd)/bin
|
||||
|
||||
TEST_DIRS := $(shell find . -name "*_test.go" -type f -exec dirname {} \; | sort -u)
|
||||
|
||||
hash_resource:
|
||||
@shasum -a 256 resource/jetkvm_native | cut -d ' ' -f 1 > resource/jetkvm_native.sha256
|
||||
build_native:
|
||||
@echo "Building native..."
|
||||
cd internal/native/cgo && ./ui_index.gen.sh && \
|
||||
CC="$(BUILDKIT_PATH)/bin/$(BUILDKIT_FLAVOR)-gcc" \
|
||||
LD="$(BUILDKIT_PATH)/bin/$(BUILDKIT_FLAVOR)-ld" \
|
||||
./build.sh
|
||||
|
||||
build_dev: hash_resource
|
||||
build_dev: build_native
|
||||
@echo "Building..."
|
||||
$(GO_CMD) build \
|
||||
-ldflags="$(GO_LDFLAGS) -X $(KVM_PKG_NAME).builtAppVersion=$(VERSION_DEV)" \
|
||||
$(GO_RELEASE_BUILD_ARGS) \
|
||||
-o $(BIN_DIR)/jetkvm_app cmd/main.go
|
||||
-o $(BIN_DIR)/jetkvm_app -v cmd/main.go
|
||||
|
||||
build_test2json:
|
||||
$(GO_CMD) build -o $(BIN_DIR)/test2json cmd/test2json
|
||||
|
|
|
|||
1
cloud.go
1
cloud.go
|
|
@ -170,6 +170,7 @@ func setCloudConnectionState(state CloudConnectionState) {
|
|||
|
||||
go waitCtrlAndRequestDisplayUpdate(
|
||||
previousState != state,
|
||||
"set_cloud_connection_state",
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
20
config.go
20
config.go
|
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
"github.com/jetkvm/kvm/internal/logging"
|
||||
|
|
@ -105,6 +106,25 @@ type Config struct {
|
|||
DefaultLogLevel string `json:"default_log_level"`
|
||||
}
|
||||
|
||||
func (c *Config) GetDisplayRotation() uint16 {
|
||||
rotationInt, err := strconv.ParseUint(c.DisplayRotation, 10, 16)
|
||||
if err != nil {
|
||||
logger.Warn().Err(err).Msg("invalid display rotation, using default")
|
||||
return 270
|
||||
}
|
||||
return uint16(rotationInt)
|
||||
}
|
||||
|
||||
func (c *Config) SetDisplayRotation(rotation string) error {
|
||||
_, err := strconv.ParseUint(rotation, 10, 16)
|
||||
if err != nil {
|
||||
logger.Warn().Err(err).Msg("invalid display rotation, using default")
|
||||
return err
|
||||
}
|
||||
c.DisplayRotation = rotation
|
||||
return nil
|
||||
}
|
||||
|
||||
const configPath = "/userdata/kvm_config.json"
|
||||
|
||||
var defaultConfig = &Config{
|
||||
|
|
|
|||
233
display.go
233
display.go
|
|
@ -6,16 +6,16 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/common/version"
|
||||
)
|
||||
|
||||
var backlightState = 0 // 0 - NORMAL, 1 - DIMMED, 2 - OFF
|
||||
|
||||
var (
|
||||
currentScreen = "ui_Boot_Screen"
|
||||
displayedTexts = make(map[string]string)
|
||||
screenStateLock = sync.Mutex{}
|
||||
currentScreen = "boot_screen"
|
||||
backlightState = 0 // 0 - NORMAL, 1 - DIMMED, 2 - OFF
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -28,128 +28,52 @@ const (
|
|||
backlightControlClass string = "/sys/class/backlight/backlight/brightness"
|
||||
)
|
||||
|
||||
// do not call this function directly, use switchToScreenIfDifferent instead
|
||||
// this function is not thread safe
|
||||
func switchToScreen(screen string) {
|
||||
_, err := CallCtrlAction("lv_scr_load", map[string]any{"obj": screen})
|
||||
if err != nil {
|
||||
displayLogger.Warn().Err(err).Str("screen", screen).Msg("failed to switch to screen")
|
||||
return
|
||||
}
|
||||
currentScreen = screen
|
||||
}
|
||||
|
||||
func lvObjSetState(objName string, state string) (*CtrlResponse, error) {
|
||||
return CallCtrlAction("lv_obj_set_state", map[string]any{"obj": objName, "state": state})
|
||||
}
|
||||
|
||||
func lvObjAddFlag(objName string, flag string) (*CtrlResponse, error) {
|
||||
return CallCtrlAction("lv_obj_add_flag", map[string]any{"obj": objName, "flag": flag})
|
||||
}
|
||||
|
||||
func lvObjClearFlag(objName string, flag string) (*CtrlResponse, error) {
|
||||
return CallCtrlAction("lv_obj_clear_flag", map[string]any{"obj": objName, "flag": flag})
|
||||
}
|
||||
|
||||
func lvObjHide(objName string) (*CtrlResponse, error) {
|
||||
return lvObjAddFlag(objName, "LV_OBJ_FLAG_HIDDEN")
|
||||
}
|
||||
|
||||
func lvObjShow(objName string) (*CtrlResponse, error) {
|
||||
return lvObjClearFlag(objName, "LV_OBJ_FLAG_HIDDEN")
|
||||
}
|
||||
|
||||
func lvObjSetOpacity(objName string, opacity int) (*CtrlResponse, error) { // nolint:unused
|
||||
return CallCtrlAction("lv_obj_set_style_opa_layered", map[string]any{"obj": objName, "opa": opacity})
|
||||
}
|
||||
|
||||
func lvObjFadeIn(objName string, duration uint32) (*CtrlResponse, error) {
|
||||
return CallCtrlAction("lv_obj_fade_in", map[string]any{"obj": objName, "duration": duration})
|
||||
}
|
||||
|
||||
func lvObjFadeOut(objName string, duration uint32) (*CtrlResponse, error) {
|
||||
return CallCtrlAction("lv_obj_fade_out", map[string]any{"obj": objName, "duration": duration})
|
||||
}
|
||||
|
||||
func lvLabelSetText(objName string, text string) (*CtrlResponse, error) {
|
||||
return CallCtrlAction("lv_label_set_text", map[string]any{"obj": objName, "text": text})
|
||||
}
|
||||
|
||||
func lvImgSetSrc(objName string, src string) (*CtrlResponse, error) {
|
||||
return CallCtrlAction("lv_img_set_src", map[string]any{"obj": objName, "src": src})
|
||||
}
|
||||
|
||||
func lvDispSetRotation(rotation string) (*CtrlResponse, error) {
|
||||
return CallCtrlAction("lv_disp_set_rotation", map[string]any{"rotation": rotation})
|
||||
}
|
||||
|
||||
func updateLabelIfChanged(objName string, newText string) {
|
||||
screenStateLock.Lock()
|
||||
defer screenStateLock.Unlock()
|
||||
|
||||
if newText != "" && newText != displayedTexts[objName] {
|
||||
_, _ = lvLabelSetText(objName, newText)
|
||||
displayedTexts[objName] = newText
|
||||
}
|
||||
}
|
||||
|
||||
func switchToScreenIfDifferent(screenName string) {
|
||||
screenStateLock.Lock()
|
||||
defer screenStateLock.Unlock()
|
||||
|
||||
if currentScreen != screenName {
|
||||
displayLogger.Info().Str("from", currentScreen).Str("to", screenName).Msg("switching screen")
|
||||
switchToScreen(screenName)
|
||||
}
|
||||
}
|
||||
|
||||
func clearDisplayState() {
|
||||
screenStateLock.Lock()
|
||||
defer screenStateLock.Unlock()
|
||||
|
||||
displayedTexts = make(map[string]string)
|
||||
currentScreen = "ui_Boot_Screen"
|
||||
}
|
||||
|
||||
func updateDisplay() {
|
||||
updateLabelIfChanged("ui_Home_Content_Ip", networkState.IPv4String())
|
||||
nativeInstance.UpdateLabelIfChanged("home_info_ipv4_addr", networkState.IPv4String())
|
||||
nativeInstance.UpdateLabelAndChangeVisibility("home_info_ipv6_addr", networkState.IPv6String())
|
||||
|
||||
nativeInstance.UIObjHide("menu_btn_network")
|
||||
nativeInstance.UIObjHide("menu_btn_access")
|
||||
|
||||
nativeInstance.UpdateLabelIfChanged("home_info_mac_addr", networkState.MACString())
|
||||
|
||||
if usbState == "configured" {
|
||||
updateLabelIfChanged("ui_Home_Footer_Usb_Status_Label", "Connected")
|
||||
_, _ = lvObjSetState("ui_Home_Footer_Usb_Status_Label", "LV_STATE_DEFAULT")
|
||||
nativeInstance.UpdateLabelIfChanged("usb_status_label", "Connected")
|
||||
_, _ = nativeInstance.UIObjSetState("usb_status", "LV_STATE_DEFAULT")
|
||||
} else {
|
||||
updateLabelIfChanged("ui_Home_Footer_Usb_Status_Label", "Disconnected")
|
||||
_, _ = lvObjSetState("ui_Home_Footer_Usb_Status_Label", "LV_STATE_USER_2")
|
||||
nativeInstance.UpdateLabelIfChanged("usb_status_label", "Disconnected")
|
||||
_, _ = nativeInstance.UIObjSetState("usb_status", "LV_STATE_DISABLED")
|
||||
}
|
||||
if lastVideoState.Ready {
|
||||
updateLabelIfChanged("ui_Home_Footer_Hdmi_Status_Label", "Connected")
|
||||
_, _ = lvObjSetState("ui_Home_Footer_Hdmi_Status_Label", "LV_STATE_DEFAULT")
|
||||
nativeInstance.UpdateLabelIfChanged("hdmi_status_label", "Connected")
|
||||
_, _ = nativeInstance.UIObjSetState("hdmi_status", "LV_STATE_DEFAULT")
|
||||
} else {
|
||||
updateLabelIfChanged("ui_Home_Footer_Hdmi_Status_Label", "Disconnected")
|
||||
_, _ = lvObjSetState("ui_Home_Footer_Hdmi_Status_Label", "LV_STATE_USER_2")
|
||||
nativeInstance.UpdateLabelIfChanged("hdmi_status_label", "Disconnected")
|
||||
_, _ = nativeInstance.UIObjSetState("hdmi_status", "LV_STATE_DISABLED")
|
||||
}
|
||||
updateLabelIfChanged("ui_Home_Header_Cloud_Status_Label", fmt.Sprintf("%d active", actionSessions))
|
||||
nativeInstance.UpdateLabelIfChanged("cloud_status_label", fmt.Sprintf("%d active", actionSessions))
|
||||
|
||||
if networkState.IsUp() {
|
||||
switchToScreenIfDifferent("ui_Home_Screen")
|
||||
nativeInstance.SwitchToScreenIf("home_screen", []string{"no_network_screen", "boot_screen"})
|
||||
} else {
|
||||
switchToScreenIfDifferent("ui_No_Network_Screen")
|
||||
nativeInstance.SwitchToScreenIf("no_network_screen", []string{"home_screen", "boot_screen"})
|
||||
}
|
||||
|
||||
if cloudConnectionState == CloudConnectionStateNotConfigured {
|
||||
_, _ = lvObjHide("ui_Home_Header_Cloud_Status_Icon")
|
||||
_, _ = nativeInstance.UIObjHide("cloud_status_icon")
|
||||
} else {
|
||||
_, _ = lvObjShow("ui_Home_Header_Cloud_Status_Icon")
|
||||
_, _ = nativeInstance.UIObjShow("cloud_status_icon")
|
||||
}
|
||||
|
||||
switch cloudConnectionState {
|
||||
case CloudConnectionStateDisconnected:
|
||||
_, _ = lvImgSetSrc("ui_Home_Header_Cloud_Status_Icon", "cloud_disconnected.png")
|
||||
_, _ = nativeInstance.UIObjSetImageSrc("cloud_status_icon", "cloud_disconnected")
|
||||
stopCloudBlink()
|
||||
case CloudConnectionStateConnecting:
|
||||
_, _ = lvImgSetSrc("ui_Home_Header_Cloud_Status_Icon", "cloud.png")
|
||||
restartCloudBlink()
|
||||
_, _ = nativeInstance.UIObjSetImageSrc("cloud_status_icon", "cloud")
|
||||
startCloudBlink()
|
||||
case CloudConnectionStateConnected:
|
||||
_, _ = lvImgSetSrc("ui_Home_Header_Cloud_Status_Icon", "cloud.png")
|
||||
_, _ = nativeInstance.UIObjSetImageSrc("cloud_status_icon", "cloud")
|
||||
stopCloudBlink()
|
||||
}
|
||||
}
|
||||
|
|
@ -171,7 +95,7 @@ func doCloudBlink(ctx context.Context) {
|
|||
continue
|
||||
}
|
||||
|
||||
_, _ = lvObjFadeOut("ui_Home_Header_Cloud_Status_Icon", uint32(cloudBlinkDuration.Milliseconds()))
|
||||
_, _ = nativeInstance.UIObjFadeOut("ui_Home_Header_Cloud_Status_Icon", uint32(cloudBlinkDuration.Milliseconds()))
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
|
|
@ -179,7 +103,7 @@ func doCloudBlink(ctx context.Context) {
|
|||
case <-time.After(cloudBlinkDuration):
|
||||
}
|
||||
|
||||
_, _ = lvObjFadeIn("ui_Home_Header_Cloud_Status_Icon", uint32(cloudBlinkDuration.Milliseconds()))
|
||||
_, _ = nativeInstance.UIObjFadeIn("ui_Home_Header_Cloud_Status_Icon", uint32(cloudBlinkDuration.Milliseconds()))
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
|
|
@ -230,7 +154,7 @@ var (
|
|||
waitDisplayUpdate = sync.Mutex{}
|
||||
)
|
||||
|
||||
func requestDisplayUpdate(shouldWakeDisplay bool) {
|
||||
func requestDisplayUpdate(shouldWakeDisplay bool, reason string) {
|
||||
displayUpdateLock.Lock()
|
||||
defer displayUpdateLock.Unlock()
|
||||
|
||||
|
|
@ -240,7 +164,7 @@ func requestDisplayUpdate(shouldWakeDisplay bool) {
|
|||
}
|
||||
go func() {
|
||||
if shouldWakeDisplay {
|
||||
wakeDisplay(false)
|
||||
wakeDisplay(false, reason)
|
||||
}
|
||||
displayLogger.Debug().Msg("display updating")
|
||||
//TODO: only run once regardless how many pending updates
|
||||
|
|
@ -248,29 +172,47 @@ func requestDisplayUpdate(shouldWakeDisplay bool) {
|
|||
}()
|
||||
}
|
||||
|
||||
func waitCtrlAndRequestDisplayUpdate(shouldWakeDisplay bool) {
|
||||
func waitCtrlAndRequestDisplayUpdate(shouldWakeDisplay bool, reason string) {
|
||||
waitDisplayUpdate.Lock()
|
||||
defer waitDisplayUpdate.Unlock()
|
||||
|
||||
waitCtrlClientConnected()
|
||||
requestDisplayUpdate(shouldWakeDisplay)
|
||||
// nativeInstance.WaitCtrlClientConnected()
|
||||
requestDisplayUpdate(shouldWakeDisplay, reason)
|
||||
}
|
||||
|
||||
func updateStaticContents() {
|
||||
//contents that never change
|
||||
updateLabelIfChanged("ui_Home_Content_Mac", networkState.MACString())
|
||||
systemVersion, appVersion, err := GetLocalVersion()
|
||||
if err == nil {
|
||||
updateLabelIfChanged("ui_About_Content_Operating_System_Version_ContentLabel", systemVersion.String())
|
||||
updateLabelIfChanged("ui_About_Content_App_Version_Content_Label", appVersion.String())
|
||||
nativeInstance.UpdateLabelIfChanged("home_info_mac_addr", networkState.MACString())
|
||||
|
||||
// get cpu info
|
||||
cpuInfo, err := os.ReadFile("/proc/cpuinfo")
|
||||
// get the line starting with "Serial"
|
||||
for _, line := range strings.Split(string(cpuInfo), "\n") {
|
||||
if strings.HasPrefix(line, "Serial") {
|
||||
serial := strings.SplitN(line, ":", 2)[1]
|
||||
nativeInstance.UpdateLabelAndChangeVisibility("cpu_serial", strings.TrimSpace(serial))
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
updateLabelIfChanged("ui_Status_Content_Device_Id_Content_Label", GetDeviceID())
|
||||
// get kernel version
|
||||
kernelVersion, err := os.ReadFile("/proc/version")
|
||||
if err == nil {
|
||||
kernelVersion := strings.TrimPrefix(string(kernelVersion), "Linux version ")
|
||||
kernelVersion = strings.SplitN(kernelVersion, " ", 2)[0]
|
||||
nativeInstance.UpdateLabelAndChangeVisibility("kernel_version", kernelVersion)
|
||||
}
|
||||
|
||||
nativeInstance.UpdateLabelAndChangeVisibility("build_branch", version.Branch)
|
||||
nativeInstance.UpdateLabelAndChangeVisibility("build_date", version.BuildDate)
|
||||
nativeInstance.UpdateLabelAndChangeVisibility("golang_version", version.GoVersion)
|
||||
|
||||
// nativeInstance.UpdateLabelAndChangeVisibility("boot_screen_device_id", GetDeviceID())
|
||||
}
|
||||
|
||||
// setDisplayBrightness sets /sys/class/backlight/backlight/brightness to alter
|
||||
// the backlight brightness of the JetKVM hardware's display.
|
||||
func setDisplayBrightness(brightness int) error {
|
||||
func setDisplayBrightness(brightness int, reason string) error {
|
||||
// NOTE: The actual maximum value for this is 255, but out-of-the-box, the value is set to 64.
|
||||
// The maximum set here is set to 100 to reduce the risk of drawing too much power (and besides, 255 is very bright!).
|
||||
if brightness > 100 || brightness < 0 {
|
||||
|
|
@ -289,14 +231,14 @@ func setDisplayBrightness(brightness int) error {
|
|||
return err
|
||||
}
|
||||
|
||||
displayLogger.Info().Int("brightness", brightness).Msg("set brightness")
|
||||
displayLogger.Info().Int("brightness", brightness).Str("reason", reason).Msg("set brightness")
|
||||
return nil
|
||||
}
|
||||
|
||||
// tick_displayDim() is called when when dim ticker expires, it simply reduces the brightness
|
||||
// of the display by half of the max brightness.
|
||||
func tick_displayDim() {
|
||||
err := setDisplayBrightness(config.DisplayMaxBrightness / 2)
|
||||
err := setDisplayBrightness(config.DisplayMaxBrightness/2, "tick_display_dim")
|
||||
if err != nil {
|
||||
displayLogger.Warn().Err(err).Msg("failed to dim display")
|
||||
}
|
||||
|
|
@ -309,7 +251,7 @@ func tick_displayDim() {
|
|||
// tick_displayOff() is called when the off ticker expires, it turns off the display
|
||||
// by setting the brightness to zero.
|
||||
func tick_displayOff() {
|
||||
err := setDisplayBrightness(0)
|
||||
err := setDisplayBrightness(0, "tick_display_off")
|
||||
if err != nil {
|
||||
displayLogger.Warn().Err(err).Msg("failed to turn off display")
|
||||
}
|
||||
|
|
@ -322,7 +264,7 @@ func tick_displayOff() {
|
|||
// wakeDisplay sets the display brightness back to config.DisplayMaxBrightness and stores the time the display
|
||||
// last woke, ready for displayTimeoutTick to put the display back in the dim/off states.
|
||||
// Set force to true to skip the backlight state check, this should be done if altering the tickers.
|
||||
func wakeDisplay(force bool) {
|
||||
func wakeDisplay(force bool, reason string) {
|
||||
if backlightState == 0 && !force {
|
||||
return
|
||||
}
|
||||
|
|
@ -332,7 +274,11 @@ func wakeDisplay(force bool) {
|
|||
return
|
||||
}
|
||||
|
||||
err := setDisplayBrightness(config.DisplayMaxBrightness)
|
||||
if reason == "" {
|
||||
reason = "wake_display"
|
||||
}
|
||||
|
||||
err := setDisplayBrightness(config.DisplayMaxBrightness, reason)
|
||||
if err != nil {
|
||||
displayLogger.Warn().Err(err).Msg("failed to wake display")
|
||||
}
|
||||
|
|
@ -347,34 +293,6 @@ func wakeDisplay(force bool) {
|
|||
backlightState = 0
|
||||
}
|
||||
|
||||
// watchTsEvents monitors the touchscreen for events and simply calls wakeDisplay() to ensure the
|
||||
// touchscreen interface still works even with LCD dimming/off.
|
||||
// TODO: This is quite a hack, really we should be getting an event from jetkvm_native, or the whole display backlight
|
||||
// control should be hoisted up to jetkvm_native.
|
||||
func watchTsEvents() {
|
||||
ts, err := os.OpenFile(touchscreenDevice, os.O_RDONLY, 0666)
|
||||
if err != nil {
|
||||
displayLogger.Warn().Err(err).Msg("failed to open touchscreen device")
|
||||
return
|
||||
}
|
||||
|
||||
defer ts.Close()
|
||||
|
||||
// This buffer is set to 24 bytes as that's the normal size of events on /dev/input
|
||||
// Reference: https://www.kernel.org/doc/Documentation/input/input.txt
|
||||
// This could potentially be set higher, to require multiple events to wake the display.
|
||||
buf := make([]byte, 24)
|
||||
for {
|
||||
_, err := ts.Read(buf)
|
||||
if err != nil {
|
||||
displayLogger.Warn().Err(err).Msg("failed to read from touchscreen device")
|
||||
return
|
||||
}
|
||||
|
||||
wakeDisplay(false)
|
||||
}
|
||||
}
|
||||
|
||||
// startBacklightTickers starts the two tickers for dimming and switching off the display
|
||||
// if they're not already set. This is done separately to the init routine as the "never dim"
|
||||
// option has the value set to zero, but time.NewTicker only accept positive values.
|
||||
|
|
@ -382,7 +300,7 @@ func startBacklightTickers() {
|
|||
// Don't start the tickers if the display is switched off.
|
||||
// Set the display to off if that's the case.
|
||||
if config.DisplayMaxBrightness == 0 {
|
||||
_ = setDisplayBrightness(0)
|
||||
_ = setDisplayBrightness(0, "display_disabled")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -426,17 +344,12 @@ func startBacklightTickers() {
|
|||
|
||||
func initDisplay() {
|
||||
go func() {
|
||||
waitCtrlClientConnected()
|
||||
displayLogger.Info().Msg("setting initial display contents")
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
_, _ = lvDispSetRotation(config.DisplayRotation)
|
||||
updateStaticContents()
|
||||
displayInited = true
|
||||
displayLogger.Info().Msg("display inited")
|
||||
startBacklightTickers()
|
||||
wakeDisplay(true)
|
||||
requestDisplayUpdate(true)
|
||||
requestDisplayUpdate(true, "init_display")
|
||||
}()
|
||||
|
||||
go watchTsEvents()
|
||||
}
|
||||
|
|
|
|||
8
go.mod
8
go.mod
|
|
@ -12,10 +12,11 @@ require (
|
|||
github.com/gin-contrib/logger v1.2.6
|
||||
github.com/gin-gonic/gin v1.10.1
|
||||
github.com/go-co-op/gocron/v2 v2.16.5
|
||||
github.com/google/flatbuffers v25.2.10+incompatible
|
||||
github.com/google/gopacket v1.1.19
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/guregu/null/v6 v6.0.0
|
||||
github.com/gwatts/rootcerts v0.0.0-20250901182336-dc5ae18bd79f
|
||||
github.com/jellydator/ttlcache/v3 v3.4.0
|
||||
github.com/pion/logging v0.2.4
|
||||
github.com/pion/mdns/v2 v2.0.7
|
||||
github.com/pion/webrtc/v4 v4.1.4
|
||||
|
|
@ -28,6 +29,7 @@ require (
|
|||
github.com/rs/zerolog v1.34.0
|
||||
github.com/sourcegraph/tf-dag v0.2.2-0.20250131204052-3e8ff1477b4f
|
||||
github.com/stretchr/testify v1.11.1
|
||||
github.com/vearutop/statigz v1.5.0
|
||||
github.com/vishvananda/netlink v1.3.1
|
||||
go.bug.st/serial v1.6.4
|
||||
golang.org/x/crypto v0.41.0
|
||||
|
|
@ -43,7 +45,7 @@ require (
|
|||
github.com/bytedance/sonic/loader v0.2.4 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/cloudwego/base64x v0.1.5 // indirect
|
||||
github.com/creack/goselect v0.1.3 // indirect
|
||||
github.com/creack/goselect v0.1.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
|
||||
github.com/gin-contrib/sse v1.1.0 // indirect
|
||||
|
|
@ -83,11 +85,11 @@ require (
|
|||
github.com/rogpeppe/go-internal v1.14.1 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.3.0 // indirect
|
||||
github.com/vearutop/statigz v1.5.0 // indirect
|
||||
github.com/vishvananda/netns v0.0.5 // indirect
|
||||
github.com/wlynxg/anet v0.0.5 // indirect
|
||||
golang.org/x/arch v0.18.0 // indirect
|
||||
golang.org/x/oauth2 v0.30.0 // indirect
|
||||
golang.org/x/sync v0.16.0 // indirect
|
||||
golang.org/x/text v0.28.0 // indirect
|
||||
google.golang.org/protobuf v1.36.8 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
|
|
|
|||
30
go.sum
30
go.sum
|
|
@ -1,9 +1,13 @@
|
|||
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
|
||||
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA=
|
||||
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
|
||||
github.com/beevik/ntp v1.4.3 h1:PlbTvE5NNy4QHmA4Mg57n7mcFTmr1W1j3gcK7L1lqho=
|
||||
github.com/beevik/ntp v1.4.3/go.mod h1:Unr8Zg+2dRn7d8bHFuehIMSvvUYssHMxW3Q5Nx4RW5Q=
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bool64/dev v0.2.39 h1:kP8DnMGlWXhGYJEZE/J0l/gVBdbuhoPGL+MJG4QbofE=
|
||||
github.com/bool64/dev v0.2.39/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
|
||||
github.com/bytedance/sonic v1.13.3 h1:MS8gmaH16Gtirygw7jV91pDCN33NyMrPbN7qiYhEsF0=
|
||||
github.com/bytedance/sonic v1.13.3/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
|
||||
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
||||
|
|
@ -21,8 +25,8 @@ github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3C
|
|||
github.com/coreos/go-oidc/v3 v3.15.0 h1:R6Oz8Z4bqWR7VFQ+sPSvZPQv4x8M+sJkDO5ojgwlyAg=
|
||||
github.com/coreos/go-oidc/v3 v3.15.0/go.mod h1:HaZ3szPaZ0e4r6ebqvsLWlk2Tn+aejfmrfah6hnSYEU=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/creack/goselect v0.1.3 h1:MaGNMclRo7P2Jl21hBpR1Cn33ITSbKP6E49RtfblLKc=
|
||||
github.com/creack/goselect v0.1.3/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY=
|
||||
github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0=
|
||||
github.com/creack/goselect v0.1.2/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY=
|
||||
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
|
||||
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
|
@ -53,11 +57,11 @@ github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAu
|
|||
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
||||
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q=
|
||||
github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
|
||||
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc h1:GN2Lv3MGO7AS6PrRoT6yV5+wkrOpcszoIsO4+4ds248=
|
||||
|
|
@ -66,6 +70,8 @@ github.com/guregu/null/v6 v6.0.0 h1:N14VRS+4di81i1PXRiprbQJ9EM9gqBa0+KVMeS/QSjQ=
|
|||
github.com/guregu/null/v6 v6.0.0/go.mod h1:hrMIhIfrOZeLPZhROSn149tpw2gHkidAqxoXNyeX3iQ=
|
||||
github.com/gwatts/rootcerts v0.0.0-20250901182336-dc5ae18bd79f h1:08t2PbrkDgW2+mwCQ3jhKUBrCM9Bc9SeH5j2Dst3B+0=
|
||||
github.com/gwatts/rootcerts v0.0.0-20250901182336-dc5ae18bd79f/go.mod h1:5Kt9XkWvkGi2OHOq0QsGxebHmhCcqJ8KCbNg/a6+n+g=
|
||||
github.com/jellydator/ttlcache/v3 v3.4.0 h1:YS4P125qQS0tNhtL6aeYkheEaB/m8HCqdMMP4mnWdTY=
|
||||
github.com/jellydator/ttlcache/v3 v3.4.0/go.mod h1:Hw9EgjymziQD3yGsQdf1FqFdpp7YjFMd4Srg5EJlgD4=
|
||||
github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I=
|
||||
github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
|
|
@ -188,12 +194,23 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
|||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/arch v0.18.0 h1:WN9poc33zL4AzGxqf8VtpKUnGvMi8O9lhNyBMF/85qc=
|
||||
golang.org/x/arch v0.18.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
|
||||
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
|
||||
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
|
||||
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
|
||||
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
||||
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
|
|
@ -201,8 +218,13 @@ golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
|
||||
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
|
||||
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
|
||||
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
|
||||
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ type testNetworkConfig struct {
|
|||
IPv6Mode null.String `json:"ipv6_mode" one_of:"slaac,dhcpv6,slaac_and_dhcpv6,static,link_local,disabled" default:"slaac"`
|
||||
IPv6Static *testIPv6StaticConfig `json:"ipv6_static,omitempty" required_if:"IPv6Mode=static"`
|
||||
|
||||
LLDPMode null.String `json:"lldp_mode,omitempty" one_of:"disabled,basic,all" default:"basic"`
|
||||
LLDPMode null.String `json:"lldp_mode,omitempty" one_of:"disabled,rx_only,tx_only,enabled" default:"enabled"`
|
||||
LLDPTxTLVs []string `json:"lldp_tx_tlvs,omitempty" one_of:"chassis,port,system,vlan" default:"chassis,port,system,vlan"`
|
||||
MDNSMode null.String `json:"mdns_mode,omitempty" one_of:"disabled,auto,ipv4_only,ipv6_only" default:"auto"`
|
||||
TimeSyncMode null.String `json:"time_sync_mode,omitempty" one_of:"ntp_only,ntp_and_http,http_only,custom" default:"ntp_and_http"`
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
package lldp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/google/gopacket/afpacket"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const (
|
||||
afPacketBufferSize = 2 // in MiB
|
||||
afPacketSnaplen = 9216
|
||||
)
|
||||
|
||||
func afPacketComputeSize(targetSizeMb int, snaplen int, pageSize int) (
|
||||
frameSize int, blockSize int, numBlocks int, err error) {
|
||||
if snaplen < pageSize {
|
||||
frameSize = pageSize / (pageSize / snaplen)
|
||||
} else {
|
||||
frameSize = (snaplen/pageSize + 1) * pageSize
|
||||
}
|
||||
|
||||
// 128 is the default from the gopacket library so just use that
|
||||
blockSize = frameSize * 128
|
||||
numBlocks = (targetSizeMb * 1024 * 1024) / blockSize
|
||||
|
||||
if numBlocks == 0 {
|
||||
return 0, 0, 0, fmt.Errorf("interface buffersize is too small")
|
||||
}
|
||||
|
||||
return frameSize, blockSize, numBlocks, nil
|
||||
}
|
||||
|
||||
func afPacketNewTPacket(ifName string) (*afpacket.TPacket, error) {
|
||||
szFrame, szBlock, numBlocks, err := afPacketComputeSize(
|
||||
afPacketBufferSize,
|
||||
afPacketSnaplen,
|
||||
os.Getpagesize())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return afpacket.NewTPacket(
|
||||
afpacket.OptInterface(ifName),
|
||||
afpacket.OptFrameSize(szFrame),
|
||||
afpacket.OptBlockSize(szBlock),
|
||||
afpacket.OptNumBlocks(numBlocks),
|
||||
afpacket.OptAddVLANHeader(false),
|
||||
afpacket.SocketRaw,
|
||||
afpacket.TPacketVersion3)
|
||||
}
|
||||
|
||||
type ifreq struct {
|
||||
ifrName [IFNAMSIZ]byte
|
||||
ifrHwaddr syscall.RawSockaddr
|
||||
}
|
||||
|
||||
func addMulticastAddr(ifName string, addr net.HardwareAddr) error {
|
||||
fd, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_DGRAM, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer syscall.Close(fd)
|
||||
|
||||
var name [IFNAMSIZ]byte
|
||||
copy(name[:], []byte(ifName))
|
||||
|
||||
ifr := &ifreq{
|
||||
ifrName: name,
|
||||
ifrHwaddr: toRawSockaddr(addr),
|
||||
}
|
||||
|
||||
_, _, ep := unix.Syscall(unix.SYS_IOCTL, uintptr(fd),
|
||||
unix.SIOCADDMULTI, uintptr(unsafe.Pointer(ifr)))
|
||||
|
||||
if ep != 0 {
|
||||
return syscall.Errno(ep)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
//go:build arm && linux
|
||||
|
||||
package lldp
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func toRawSockaddr(mac net.HardwareAddr) (sockaddr syscall.RawSockaddr) {
|
||||
for i, n := range mac {
|
||||
sockaddr.Data[i] = uint8(n)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
//go:build !arm && linux
|
||||
|
||||
package lldp
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func toRawSockaddr(mac net.HardwareAddr) (sockaddr syscall.RawSockaddr) {
|
||||
for i, n := range mac {
|
||||
sockaddr.Data[i] = int8(n)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
package lldp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/google/gopacket"
|
||||
"github.com/google/gopacket/afpacket"
|
||||
"github.com/jellydator/ttlcache/v3"
|
||||
"github.com/jetkvm/kvm/internal/logging"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
var defaultLogger = logging.GetSubsystemLogger("lldp")
|
||||
|
||||
type LLDP struct {
|
||||
l *zerolog.Logger
|
||||
tPacket *afpacket.TPacket
|
||||
pktSource *gopacket.PacketSource
|
||||
rxCtx context.Context
|
||||
rxCancel context.CancelFunc
|
||||
rxLock sync.Mutex
|
||||
|
||||
enableRx bool
|
||||
enableTx bool
|
||||
|
||||
packets chan gopacket.Packet
|
||||
interfaceName string
|
||||
stop chan struct{}
|
||||
|
||||
neighbors *ttlcache.Cache[string, Neighbor]
|
||||
}
|
||||
|
||||
type LLDPOptions struct {
|
||||
InterfaceName string
|
||||
EnableRx bool
|
||||
EnableTx bool
|
||||
Logger *zerolog.Logger
|
||||
}
|
||||
|
||||
func NewLLDP(opts *LLDPOptions) *LLDP {
|
||||
if opts.Logger == nil {
|
||||
opts.Logger = defaultLogger
|
||||
}
|
||||
|
||||
if opts.InterfaceName == "" {
|
||||
opts.Logger.Fatal().Msg("InterfaceName is required")
|
||||
}
|
||||
|
||||
return &LLDP{
|
||||
interfaceName: opts.InterfaceName,
|
||||
enableRx: opts.EnableRx,
|
||||
enableTx: opts.EnableTx,
|
||||
l: opts.Logger,
|
||||
neighbors: ttlcache.New(ttlcache.WithTTL[string, Neighbor](1 * time.Hour)),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LLDP) Start() error {
|
||||
l.rxLock.Lock()
|
||||
defer l.rxLock.Unlock()
|
||||
|
||||
if l.rxCtx != nil {
|
||||
l.l.Info().Msg("LLDP already started")
|
||||
return nil
|
||||
}
|
||||
|
||||
l.rxCtx, l.rxCancel = context.WithCancel(context.Background())
|
||||
|
||||
if l.enableRx {
|
||||
l.l.Info().Msg("setting up AF_PACKET")
|
||||
if err := l.setUpCapture(); err != nil {
|
||||
l.l.Error().Err(err).Msg("unable to set up AF_PACKET")
|
||||
return err
|
||||
}
|
||||
if err := l.startCapture(); err != nil {
|
||||
l.l.Error().Err(err).Msg("unable to start capture")
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
go l.neighbors.Start()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LLDP) Stop() error {
|
||||
l.rxLock.Lock()
|
||||
defer l.rxLock.Unlock()
|
||||
|
||||
if l.rxCancel != nil {
|
||||
l.rxCancel()
|
||||
l.rxCancel = nil
|
||||
l.rxCtx = nil
|
||||
}
|
||||
|
||||
if l.enableRx {
|
||||
_ = l.shutdownCapture()
|
||||
}
|
||||
|
||||
l.neighbors.Stop()
|
||||
l.neighbors.DeleteAll()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package lldp
|
||||
|
||||
import "time"
|
||||
|
||||
type Neighbor struct {
|
||||
Mac string `json:"mac"`
|
||||
Source string `json:"source"`
|
||||
ChassisID string `json:"chassis_id"`
|
||||
PortID string `json:"port_id"`
|
||||
PortDescription string `json:"port_description"`
|
||||
SystemName string `json:"system_name"`
|
||||
SystemDescription string `json:"system_description"`
|
||||
TTL uint16 `json:"ttl"`
|
||||
ManagementAddress string `json:"management_address"`
|
||||
Values map[string]string `json:"values"`
|
||||
}
|
||||
|
||||
func (l *LLDP) addNeighbor(mac string, neighbor Neighbor, ttl time.Duration) {
|
||||
logger := l.l.With().
|
||||
Str("mac", mac).
|
||||
Interface("neighbor", neighbor).
|
||||
Logger()
|
||||
|
||||
current_neigh := l.neighbors.Get(mac)
|
||||
if current_neigh != nil {
|
||||
current_source := current_neigh.Value().Source
|
||||
if current_source == "lldp" && neighbor.Source != "lldp" {
|
||||
logger.Info().Msg("skip updating neighbor, as LLDP has higher priority")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
logger.Info().Msg("adding neighbor")
|
||||
l.neighbors.Set(mac, neighbor, ttl)
|
||||
}
|
||||
|
||||
func (l *LLDP) deleteNeighbor(mac string) {
|
||||
logger := l.l.With().
|
||||
Str("mac", mac).
|
||||
Logger()
|
||||
|
||||
logger.Info().Msg("deleting neighbor")
|
||||
l.neighbors.Delete(mac)
|
||||
}
|
||||
|
||||
func (l *LLDP) GetNeighbors() []Neighbor {
|
||||
items := l.neighbors.Items()
|
||||
neighbors := make([]Neighbor, 0, len(items))
|
||||
|
||||
for _, item := range items {
|
||||
neighbors = append(neighbors, item.Value())
|
||||
}
|
||||
|
||||
l.l.Info().Interface("neighbors", neighbors).Msg("neighbors")
|
||||
|
||||
return neighbors
|
||||
}
|
||||
|
|
@ -0,0 +1,264 @@
|
|||
package lldp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/google/gopacket"
|
||||
"github.com/google/gopacket/layers"
|
||||
"github.com/rs/zerolog"
|
||||
"golang.org/x/net/bpf"
|
||||
)
|
||||
|
||||
const IFNAMSIZ = 16
|
||||
|
||||
var (
|
||||
lldpDefaultTTL = 120 * time.Second
|
||||
cdpDefaultTTL = 180 * time.Second
|
||||
)
|
||||
|
||||
// from lldpd
|
||||
// https://github.com/lldpd/lldpd/blob/9034c9332cca0c8b1a20e1287f0e5fed81f7eb2a/src/daemon/lldpd.h#L246
|
||||
//
|
||||
//nolint:govet
|
||||
var bpfFilter = []bpf.RawInstruction{
|
||||
{0x30, 0, 0, 0x00000000}, {0x54, 0, 0, 0x00000001}, {0x15, 0, 16, 0x00000001},
|
||||
{0x28, 0, 0, 0x0000000c}, {0x15, 0, 6, 0x000088cc},
|
||||
{0x20, 0, 0, 0x00000002}, {0x15, 2, 0, 0xc200000e},
|
||||
{0x15, 1, 0, 0xc2000003}, {0x15, 0, 2, 0xc2000000},
|
||||
{0x28, 0, 0, 0x00000000}, {0x15, 12, 13, 0x00000180},
|
||||
{0x20, 0, 0, 0x00000002}, {0x15, 0, 2, 0x52cccccc},
|
||||
{0x28, 0, 0, 0x00000000}, {0x15, 8, 9, 0x000001e0},
|
||||
{0x15, 1, 0, 0x0ccccccc}, {0x15, 0, 2, 0x81000100},
|
||||
{0x28, 0, 0, 0x00000000}, {0x15, 4, 5, 0x00000100},
|
||||
{0x20, 0, 0, 0x00000002}, {0x15, 0, 3, 0x2b000000},
|
||||
{0x28, 0, 0, 0x00000000}, {0x15, 0, 1, 0x000000e0},
|
||||
{0x6, 0, 0, 0x00040000},
|
||||
{0x6, 0, 0, 0x00000000},
|
||||
}
|
||||
|
||||
var multicastAddrs = []string{
|
||||
// LLDP
|
||||
"01:80:C2:00:00:00",
|
||||
"01:80:C2:00:00:03",
|
||||
"01:80:C2:00:00:0E",
|
||||
// CDP
|
||||
"01:00:0C:CC:CC:CC",
|
||||
}
|
||||
|
||||
func (l *LLDP) setUpCapture() error {
|
||||
logger := l.l.With().Str("interface", l.interfaceName).Logger()
|
||||
tPacket, err := afPacketNewTPacket(l.interfaceName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logger.Info().Msg("created TPacket")
|
||||
|
||||
// set up multicast addresses
|
||||
// otherwise the kernel might discard the packets
|
||||
// another workaround would be to enable promiscuous mode but that's too tricky
|
||||
for _, mac := range multicastAddrs {
|
||||
hwAddr, err := net.ParseMAC(mac)
|
||||
if err != nil {
|
||||
logger.Error().Msgf("unable to parse MAC address %s: %s", mac, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if err := addMulticastAddr(l.interfaceName, hwAddr); err != nil {
|
||||
logger.Error().Msgf("unable to add multicast address %s: %s", mac, err)
|
||||
continue
|
||||
}
|
||||
|
||||
logger.Info().
|
||||
Interface("hwaddr", hwAddr).
|
||||
Msgf("added multicast address")
|
||||
}
|
||||
|
||||
if err = tPacket.SetBPF(bpfFilter); err != nil {
|
||||
logger.Error().Msgf("unable to set BPF filter: %s", err)
|
||||
tPacket.Close()
|
||||
return err
|
||||
}
|
||||
logger.Info().Msg("BPF filter set")
|
||||
|
||||
l.pktSource = gopacket.NewPacketSource(tPacket, layers.LayerTypeEthernet)
|
||||
l.tPacket = tPacket
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LLDP) startCapture() error {
|
||||
logger := l.l.With().Str("interface", l.interfaceName).Logger()
|
||||
if l.tPacket == nil {
|
||||
return fmt.Errorf("AFPacket not initialized")
|
||||
}
|
||||
|
||||
if l.pktSource == nil {
|
||||
return fmt.Errorf("packet source not initialized")
|
||||
}
|
||||
|
||||
go func() {
|
||||
logger.Info().Msg("starting capture LLDP ethernet frames")
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-l.rxCtx.Done():
|
||||
logger.Info().Msg("shutting down LLDP capture")
|
||||
return
|
||||
case packet := <-l.pktSource.Packets():
|
||||
if err := l.handlePacket(packet, &logger); err != nil {
|
||||
logger.Error().Msgf("error handling packet: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LLDP) handlePacket(packet gopacket.Packet, logger *zerolog.Logger) error {
|
||||
linkLayer := packet.LinkLayer()
|
||||
if linkLayer == nil {
|
||||
return fmt.Errorf("no link layer")
|
||||
}
|
||||
|
||||
srcMac := linkLayer.LinkFlow().Src().String()
|
||||
dstMac := linkLayer.LinkFlow().Dst().String()
|
||||
|
||||
logger.Trace().
|
||||
Str("src_mac", srcMac).
|
||||
Str("dst_mac", dstMac).
|
||||
Int("length", len(packet.Data())).
|
||||
Hex("data", packet.Data()).
|
||||
Msg("received packet")
|
||||
|
||||
lldpRaw := packet.Layer(layers.LayerTypeLinkLayerDiscovery)
|
||||
if lldpRaw != nil {
|
||||
logger.Trace().Msgf("Found LLDP Frame")
|
||||
|
||||
lldpInfo := packet.Layer(layers.LayerTypeLinkLayerDiscoveryInfo)
|
||||
if lldpInfo == nil {
|
||||
return fmt.Errorf("no LLDP info layer")
|
||||
}
|
||||
|
||||
return l.handlePacketLLDP(
|
||||
srcMac,
|
||||
lldpRaw.(*layers.LinkLayerDiscovery),
|
||||
lldpInfo.(*layers.LinkLayerDiscoveryInfo),
|
||||
)
|
||||
}
|
||||
|
||||
cdpRaw := packet.Layer(layers.LayerTypeCiscoDiscovery)
|
||||
if cdpRaw != nil {
|
||||
logger.Trace().Msgf("Found CDP Frame")
|
||||
|
||||
cdpInfo := packet.Layer(layers.LayerTypeCiscoDiscoveryInfo)
|
||||
if cdpInfo == nil {
|
||||
return fmt.Errorf("no CDP info layer")
|
||||
}
|
||||
|
||||
return l.handlePacketCDP(
|
||||
srcMac,
|
||||
cdpRaw.(*layers.CiscoDiscovery),
|
||||
cdpInfo.(*layers.CiscoDiscoveryInfo),
|
||||
)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LLDP) handlePacketLLDP(mac string, raw *layers.LinkLayerDiscovery, info *layers.LinkLayerDiscoveryInfo) error {
|
||||
n := &Neighbor{
|
||||
Values: make(map[string]string),
|
||||
Source: "lldp",
|
||||
Mac: mac,
|
||||
}
|
||||
gotEnd := false
|
||||
|
||||
ttl := lldpDefaultTTL
|
||||
|
||||
for _, v := range raw.Values {
|
||||
switch v.Type {
|
||||
case layers.LLDPTLVEnd:
|
||||
gotEnd = true
|
||||
case layers.LLDPTLVChassisID:
|
||||
n.ChassisID = string(raw.ChassisID.ID)
|
||||
n.Values["chassis_id"] = n.ChassisID
|
||||
case layers.LLDPTLVPortID:
|
||||
n.PortID = string(raw.PortID.ID)
|
||||
n.Values["port_id"] = n.PortID
|
||||
case layers.LLDPTLVPortDescription:
|
||||
n.PortDescription = info.PortDescription
|
||||
n.Values["port_description"] = n.PortDescription
|
||||
case layers.LLDPTLVSysName:
|
||||
n.SystemName = info.SysName
|
||||
n.Values["system_name"] = n.SystemName
|
||||
case layers.LLDPTLVSysDescription:
|
||||
n.SystemDescription = info.SysDescription
|
||||
n.Values["system_description"] = n.SystemDescription
|
||||
case layers.LLDPTLVMgmtAddress:
|
||||
// n.ManagementAddress = info.MgmtAddress.Address
|
||||
case layers.LLDPTLVTTL:
|
||||
n.TTL = uint16(raw.TTL)
|
||||
ttl = time.Duration(n.TTL) * time.Second
|
||||
n.Values["ttl"] = fmt.Sprintf("%d", n.TTL)
|
||||
case layers.LLDPTLVOrgSpecific:
|
||||
for _, org := range info.OrgTLVs {
|
||||
n.Values[fmt.Sprintf("org_specific_%d", org.OUI)] = string(org.Info)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if gotEnd || ttl < 1*time.Second {
|
||||
l.deleteNeighbor(mac)
|
||||
} else {
|
||||
l.addNeighbor(mac, *n, ttl)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LLDP) handlePacketCDP(mac string, raw *layers.CiscoDiscovery, info *layers.CiscoDiscoveryInfo) error {
|
||||
// TODO: implement full CDP parsing
|
||||
n := &Neighbor{
|
||||
Values: make(map[string]string),
|
||||
Source: "cdp",
|
||||
Mac: mac,
|
||||
}
|
||||
|
||||
ttl := cdpDefaultTTL
|
||||
|
||||
n.ChassisID = info.DeviceID
|
||||
n.PortID = info.PortID
|
||||
n.SystemName = info.SysName
|
||||
n.SystemDescription = info.Platform
|
||||
n.TTL = uint16(raw.TTL)
|
||||
|
||||
if n.TTL > 1 {
|
||||
ttl = time.Duration(n.TTL) * time.Second
|
||||
}
|
||||
|
||||
if len(info.MgmtAddresses) > 0 {
|
||||
n.ManagementAddress = string(info.MgmtAddresses[0])
|
||||
}
|
||||
|
||||
l.addNeighbor(mac, *n, ttl)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *LLDP) shutdownCapture() error {
|
||||
if l.tPacket != nil {
|
||||
l.l.Info().Msg("closing TPacket")
|
||||
l.tPacket.Close()
|
||||
l.tPacket = nil
|
||||
}
|
||||
|
||||
if l.pktSource != nil {
|
||||
l.l.Info().Msg("closing packet source")
|
||||
l.pktSource = nil
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@
|
|||
this.statsElement = statsElement;
|
||||
this.stream = null;
|
||||
this.reconnectAttempts = 0;
|
||||
this.maxReconnectAttempts = 10;
|
||||
this.maxReconnectAttempts = 500;
|
||||
this.reconnectDelay = 1000; // Start with 1 second
|
||||
this.maxReconnectDelay = 30000; // Max 30 seconds
|
||||
this.isConnecting = false;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
build
|
||||
deps
|
||||
ui_index.c
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
cmake_minimum_required(VERSION 3.14)
|
||||
include(FetchContent)
|
||||
include(ExternalProject)
|
||||
|
||||
project(jknative LANGUAGES C CXX)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# Rockchip SDK paths
|
||||
set(RK_SDK_BASE "/opt/jetkvm-native-buildkit")
|
||||
set(RK_MEDIA_OUTPUT "${RK_SDK_BASE}/media/out")
|
||||
set(RK_MEDIA_INCLUDE_PATH "${RK_MEDIA_OUTPUT}/include")
|
||||
set(RK_APP_MEDIA_LIBS_PATH "${RK_MEDIA_OUTPUT}/lib")
|
||||
|
||||
set(LV_USE_KCONFIG ON CACHE BOOL "" FORCE)
|
||||
set(LV_BUILD_DEFCONFIG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lvgl_defconfig CACHE PATH "" FORCE)
|
||||
|
||||
# # libgpiod
|
||||
|
||||
# ExternalProject_Add(libgpiod-project
|
||||
# URL https://mirrors.edge.kernel.org/pub/software/libs/libgpiod/libgpiod-2.2.tar.gz
|
||||
# URL_HASH SHA256=f89c2176250f1a9563265479eb8ad5f22a63f42db6a1f438effc570f0254d2f5
|
||||
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps/libgpiod
|
||||
# BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/libgpiod
|
||||
# CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CPPFLAGS=-fPIC ${CMAKE_CURRENT_SOURCE_DIR}/deps/libgpiod/configure --enable-tools=no CC=${CMAKE_C_COMPILER} --host=${CMAKE_HOST_SYSTEM_PROCESSOR}
|
||||
# BUILD_COMMAND make && make install
|
||||
# BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/deps/libgpiod/lib/libgpiod.a
|
||||
# )
|
||||
|
||||
|
||||
# Fetch LVGL from GitHub
|
||||
FetchContent_Declare(
|
||||
lvgl
|
||||
GIT_REPOSITORY https://github.com/lvgl/lvgl.git
|
||||
GIT_TAG v9.3.0
|
||||
GIT_SHALLOW 1
|
||||
UPDATE_DISCONNECTED 1
|
||||
)
|
||||
FetchContent_MakeAvailable(lvgl)
|
||||
|
||||
# Get source files, excluding CMake generated files
|
||||
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "*.c" "ui/*.c")
|
||||
list(FILTER sources EXCLUDE REGEX "CMakeFiles.*CompilerId.*\\.c$")
|
||||
|
||||
add_library(jknative STATIC ${sources} ${CMAKE_CURRENT_SOURCE_DIR}/ctrl.h)
|
||||
|
||||
# Include directories
|
||||
target_include_directories(jknative PRIVATE
|
||||
${RK_MEDIA_INCLUDE_PATH}
|
||||
${RK_MEDIA_INCLUDE_PATH}/libdrm
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ui
|
||||
${CMAKE_CURRENT_BINARY_DIR}/deps/libgpiod/include
|
||||
)
|
||||
|
||||
# Set library search path
|
||||
target_link_directories(jknative PRIVATE ${RK_APP_MEDIA_LIBS_PATH})
|
||||
# target_link_directories(jknative PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/deps/libgpiod/lib)
|
||||
|
||||
target_link_libraries(jknative PRIVATE
|
||||
lvgl::lvgl
|
||||
pthread
|
||||
rockit
|
||||
rockchip_mpp
|
||||
rga
|
||||
m
|
||||
# libgpiod
|
||||
)
|
||||
|
||||
install(TARGETS jknative DESTINATION lib)
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
C_RST="$(tput sgr0)"
|
||||
C_ERR="$(tput setaf 1)"
|
||||
C_OK="$(tput setaf 2)"
|
||||
C_WARN="$(tput setaf 3)"
|
||||
C_INFO="$(tput setaf 5)"
|
||||
|
||||
msg() { printf '%s%s%s\n' $2 "$1" $C_RST; }
|
||||
|
||||
msg_info() { msg "$1" $C_INFO; }
|
||||
msg_ok() { msg "$1" $C_OK; }
|
||||
msg_err() { msg "$1" $C_ERR; }
|
||||
msg_warn() { msg "$1" $C_WARN; }
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
BUILD_DIR=${SCRIPT_DIR}/build
|
||||
|
||||
CMAKE_TOOLCHAIN_FILE=/opt/jetkvm-native-buildkit/rv1106-jetkvm-v2.cmake
|
||||
CLEAN_ALL=${CLEAN_ALL:-0}
|
||||
|
||||
if [ "$CLEAN_ALL" -eq 1 ]; then
|
||||
rm -rf "${BUILD_DIR}"
|
||||
fi
|
||||
|
||||
TMP_DIR=$(mktemp -d)
|
||||
pushd "${SCRIPT_DIR}" > /dev/null
|
||||
|
||||
msg_info "▶ Generating UI index"
|
||||
./ui_index.gen.sh
|
||||
|
||||
msg_info "▶ Building native library"
|
||||
VERBOSE=1 cmake -B "${BUILD_DIR}" \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=armv7l \
|
||||
-DCMAKE_SYSTEM_NAME=Linux \
|
||||
-DCMAKE_CROSSCOMPILING=1 \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE \
|
||||
-DLV_BUILD_USE_KCONFIG=ON \
|
||||
-DLV_BUILD_DEFCONFIG_PATH=${SCRIPT_DIR}/lvgl_defconfig \
|
||||
-DCONFIG_LV_BUILD_EXAMPLES=OFF \
|
||||
-DCONFIG_LV_BUILD_DEMOS=OFF \
|
||||
-DSKIP_GLIBC_NAMES=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="${TMP_DIR}"
|
||||
|
||||
msg_info "▶ Copying built library and header files"
|
||||
cmake --build "${BUILD_DIR}" --target install
|
||||
cp -r "${TMP_DIR}/include" ../
|
||||
cp -r "${TMP_DIR}/lib" ../
|
||||
rm -rf "${TMP_DIR}"
|
||||
|
||||
popd > /dev/null
|
||||
|
|
@ -0,0 +1,378 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/socket.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <stdint.h>
|
||||
#include <fcntl.h>
|
||||
#include "video.h"
|
||||
#include "screen.h"
|
||||
#include "edid.h"
|
||||
#include "ctrl.h"
|
||||
#include <lvgl.h>
|
||||
#include "ui_index.h"
|
||||
#include "log.h"
|
||||
#include "log_handler.h"
|
||||
|
||||
jetkvm_video_state_t state;
|
||||
jetkvm_video_state_handler_t *video_state_handler = NULL;
|
||||
|
||||
jetkvm_video_handler_t *video_handler = NULL;
|
||||
|
||||
|
||||
void jetkvm_set_log_handler(jetkvm_log_handler_t *handler) {
|
||||
log_set_handler(handler);
|
||||
}
|
||||
|
||||
void jetkvm_set_video_handler(jetkvm_video_handler_t *handler) {
|
||||
video_handler = handler;
|
||||
}
|
||||
|
||||
void jetkvm_set_indev_handler(jetkvm_indev_handler_t *handler) {
|
||||
lvgl_set_indev_handler(handler);
|
||||
}
|
||||
|
||||
const char *jetkvm_ui_event_code_to_name(int code) {
|
||||
lv_event_code_t cCode = (lv_event_code_t)code;
|
||||
return lv_event_code_get_name(code);
|
||||
}
|
||||
|
||||
void video_report_format(bool ready, const char *error, u_int16_t width, u_int16_t height, double frame_per_second)
|
||||
{
|
||||
state.ready = ready;
|
||||
state.error = error;
|
||||
state.width = width;
|
||||
state.height = height;
|
||||
state.frame_per_second = frame_per_second;
|
||||
if (video_state_handler != NULL) {
|
||||
(*video_state_handler)(&state);
|
||||
}
|
||||
}
|
||||
|
||||
int video_send_frame(const uint8_t *frame, ssize_t len)
|
||||
{
|
||||
if (video_handler != NULL) {
|
||||
(*video_handler)(frame, len);
|
||||
} else {
|
||||
log_error("video handler is not set");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert a hexadecimal string to an array of uint8_t bytes
|
||||
*
|
||||
* @param hex_str The input hexadecimal string
|
||||
* @param bytes The output byte array (must be pre-allocated)
|
||||
* @param max_len The maximum number of bytes that can be stored in the output array
|
||||
* @return int The number of bytes converted, or -1 on error
|
||||
*/
|
||||
int hex_to_bytes(const char *hex_str, uint8_t *bytes, size_t max_len)
|
||||
{
|
||||
size_t hex_len = strnlen(hex_str, 4096);
|
||||
if (hex_len % 2 != 0 || hex_len / 2 > max_len)
|
||||
{
|
||||
return -1; // Invalid input length or insufficient output buffer
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < hex_len; i += 2)
|
||||
{
|
||||
char byte_str[3] = {hex_str[i], hex_str[i + 1], '\0'};
|
||||
char *end_ptr;
|
||||
long value = strtol(byte_str, &end_ptr, 16);
|
||||
|
||||
if (*end_ptr != '\0' || value < 0 || value > 255)
|
||||
{
|
||||
return -1; // Invalid hexadecimal value
|
||||
}
|
||||
|
||||
bytes[i / 2] = (uint8_t)value;
|
||||
}
|
||||
|
||||
return hex_len / 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert an array of uint8_t bytes to a hexadecimal string, user must free the returned string
|
||||
*
|
||||
* @param bytes The input byte array
|
||||
* @param len The number of bytes in the input array
|
||||
* @return char* The output hexadecimal string (dynamically allocated, must be freed by the caller), or NULL on error
|
||||
*/
|
||||
const char *bytes_to_hex(const uint8_t *bytes, size_t len)
|
||||
{
|
||||
if (bytes == NULL || len == 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *hex_str = malloc(2 * len + 1); // Each byte becomes 2 hex chars, plus null terminator
|
||||
if (hex_str == NULL)
|
||||
{
|
||||
return NULL; // Memory allocation failed
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < len; i++)
|
||||
{
|
||||
snprintf(hex_str + (2 * i), 3, "%02x", bytes[i]);
|
||||
}
|
||||
|
||||
hex_str[2 * len] = '\0'; // Ensure null termination
|
||||
return hex_str;
|
||||
}
|
||||
|
||||
lv_obj_flag_t str_to_lv_obj_flag(const char *flag)
|
||||
{
|
||||
if (strcmp(flag, "LV_OBJ_FLAG_HIDDEN") == 0)
|
||||
{
|
||||
return LV_OBJ_FLAG_HIDDEN;
|
||||
}
|
||||
else if (strcmp(flag, "LV_OBJ_FLAG_CLICKABLE") == 0)
|
||||
{
|
||||
return LV_OBJ_FLAG_CLICKABLE;
|
||||
}
|
||||
else if (strcmp(flag, "LV_OBJ_FLAG_SCROLLABLE") == 0)
|
||||
{
|
||||
return LV_OBJ_FLAG_SCROLLABLE;
|
||||
}
|
||||
else if (strcmp(flag, "LV_OBJ_FLAG_CLICK_FOCUSABLE") == 0)
|
||||
{
|
||||
return LV_OBJ_FLAG_CLICK_FOCUSABLE;
|
||||
}
|
||||
else if (strcmp(flag, "LV_OBJ_FLAG_SCROLL_ON_FOCUS") == 0)
|
||||
{
|
||||
return LV_OBJ_FLAG_SCROLL_ON_FOCUS;
|
||||
}
|
||||
else if (strcmp(flag, "LV_OBJ_FLAG_SCROLL_CHAIN") == 0)
|
||||
{
|
||||
return LV_OBJ_FLAG_SCROLL_CHAIN;
|
||||
}
|
||||
else if (strcmp(flag, "LV_OBJ_FLAG_PRESS_LOCK") == 0)
|
||||
{
|
||||
return LV_OBJ_FLAG_PRESS_LOCK;
|
||||
}
|
||||
else if (strcmp(flag, "LV_OBJ_FLAG_OVERFLOW_VISIBLE") == 0)
|
||||
{
|
||||
return LV_OBJ_FLAG_OVERFLOW_VISIBLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0; // Unknown flag
|
||||
}
|
||||
}
|
||||
|
||||
void jetkvm_ui_set_var(const char *name, const char *value) {
|
||||
for (int i = 0; i < ui_vars_size; i++) {
|
||||
if (strcmp(ui_vars[i].name, name) == 0) {
|
||||
ui_vars[i].setter(value);
|
||||
return;
|
||||
}
|
||||
}
|
||||
log_error("variable %s not found", name);
|
||||
}
|
||||
|
||||
const char *jetkvm_ui_get_var(const char *name) {
|
||||
for (int i = 0; i < ui_vars_size; i++) {
|
||||
if (strcmp(ui_vars[i].name, name) == 0) {
|
||||
return ui_vars[i].getter();
|
||||
}
|
||||
}
|
||||
log_error("variable %s not found", name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void jetkvm_ui_init(u_int16_t rotation) {
|
||||
lvgl_init(rotation);
|
||||
}
|
||||
|
||||
void jetkvm_ui_tick() {
|
||||
lvgl_tick();
|
||||
}
|
||||
|
||||
void jetkvm_set_video_state_handler(jetkvm_video_state_handler_t *handler) {
|
||||
video_state_handler = handler;
|
||||
}
|
||||
|
||||
void jetkvm_ui_set_rotation(u_int16_t rotation)
|
||||
{
|
||||
lvgl_set_rotation(NULL, rotation);
|
||||
}
|
||||
|
||||
const char *jetkvm_ui_get_current_screen() {
|
||||
return ui_get_current_screen();
|
||||
}
|
||||
|
||||
void jetkvm_ui_load_screen(const char *obj_name) {
|
||||
lv_obj_t *obj = ui_get_obj(obj_name);
|
||||
if (obj == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (lv_scr_act() != obj) {
|
||||
lv_scr_load(obj);
|
||||
}
|
||||
}
|
||||
|
||||
int jetkvm_ui_set_text(const char *obj_name, const char *text) {
|
||||
lv_obj_t *obj = ui_get_obj(obj_name);
|
||||
if (obj == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strcmp(lv_label_get_text(obj), text) == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
lv_label_set_text(obj, text);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void jetkvm_ui_set_image(const char *obj_name, const char *image_name) {
|
||||
lv_obj_t *obj = ui_get_obj(obj_name);
|
||||
if (obj == NULL) {
|
||||
return;
|
||||
}
|
||||
lv_img_set_src(obj, image_name);
|
||||
}
|
||||
|
||||
void jetkvm_ui_set_state(const char *obj_name, const char *state_name) {
|
||||
lv_obj_t *obj = ui_get_obj(obj_name);
|
||||
if (obj == NULL) {
|
||||
return;
|
||||
}
|
||||
lv_obj_add_state(obj, LV_STATE_USER_1);
|
||||
lv_state_t state_val = LV_STATE_DEFAULT;
|
||||
if (strcmp(state_name, "LV_STATE_USER_1") == 0)
|
||||
{
|
||||
state_val = LV_STATE_USER_1;
|
||||
}
|
||||
else if (strcmp(state_name, "LV_STATE_USER_2") == 0)
|
||||
{
|
||||
state_val = LV_STATE_USER_2;
|
||||
}
|
||||
else if (strcmp(state_name, "LV_STATE_USER_3") == 0)
|
||||
{
|
||||
state_val = LV_STATE_USER_3;
|
||||
}
|
||||
else if (strcmp(state_name, "LV_STATE_USER_4") == 0)
|
||||
{
|
||||
state_val = LV_STATE_USER_4;
|
||||
}
|
||||
else if (strcmp(state_name, "LV_STATE_DISABLED") == 0)
|
||||
{
|
||||
state_val = LV_STATE_DISABLED;
|
||||
}
|
||||
// TODO: use LV_STATE_USER_* once eez supports it
|
||||
lv_obj_clear_state(obj, LV_STATE_USER_1 | LV_STATE_USER_2 | LV_STATE_USER_3 | LV_STATE_USER_4 | LV_STATE_DISABLED);
|
||||
lv_obj_add_state(obj, state_val);
|
||||
}
|
||||
|
||||
int jetkvm_ui_add_flag(const char *obj_name, const char *flag_name) {
|
||||
lv_obj_t *obj = ui_get_obj(obj_name);
|
||||
if (obj == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
lv_obj_flag_t flag_val = str_to_lv_obj_flag(flag_name);
|
||||
if (flag_val == 0)
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
lv_obj_add_flag(obj, flag_val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int jetkvm_ui_clear_flag(const char *obj_name, const char *flag_name) {
|
||||
lv_obj_t *obj = ui_get_obj(obj_name);
|
||||
if (obj == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
lv_obj_flag_t flag_val = str_to_lv_obj_flag(flag_name);
|
||||
if (flag_val == 0)
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
lv_obj_clear_flag(obj, flag_val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void jetkvm_ui_fade_in(const char *obj_name, u_int32_t duration) {
|
||||
lv_obj_t *obj = ui_get_obj(obj_name);
|
||||
if (obj == NULL) {
|
||||
return;
|
||||
}
|
||||
lv_obj_fade_in(obj, duration, 0);
|
||||
}
|
||||
|
||||
void jetkvm_ui_fade_out(const char *obj_name, u_int32_t duration) {
|
||||
lv_obj_t *obj = ui_get_obj(obj_name);
|
||||
if (obj == NULL) {
|
||||
return;
|
||||
}
|
||||
lv_obj_fade_out(obj, duration, 0);
|
||||
}
|
||||
|
||||
void jetkvm_ui_set_opacity(const char *obj_name, u_int8_t opacity) {
|
||||
lv_obj_t *obj = ui_get_obj(obj_name);
|
||||
if (obj == NULL) {
|
||||
return;
|
||||
}
|
||||
lv_obj_set_style_opa(obj, opacity, LV_PART_MAIN);
|
||||
}
|
||||
|
||||
const char *jetkvm_ui_get_lvgl_version() {
|
||||
return lv_version_info();
|
||||
}
|
||||
|
||||
void jetkvm_video_start() {
|
||||
video_start_streaming();
|
||||
}
|
||||
|
||||
void jetkvm_video_stop() {
|
||||
video_stop_streaming();
|
||||
}
|
||||
|
||||
int jetkvm_video_set_quality_factor(float quality_factor) {
|
||||
if (quality_factor < 0 || quality_factor > 1) {
|
||||
return -1;
|
||||
}
|
||||
video_set_quality_factor(quality_factor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
float jetkvm_video_get_quality_factor() {
|
||||
return video_get_quality_factor();
|
||||
}
|
||||
|
||||
int jetkvm_video_set_edid(const char *edid_hex) {
|
||||
uint8_t edid[256];
|
||||
int edid_len = hex_to_bytes(edid_hex, edid, 256);
|
||||
if (edid_len < 0) {
|
||||
return -1;
|
||||
}
|
||||
return set_edid(edid, edid_len);
|
||||
}
|
||||
|
||||
char *jetkvm_video_get_edid_hex() {
|
||||
uint8_t edid[256];
|
||||
int edid_len = get_edid(edid, 256);
|
||||
if (edid_len < 0) {
|
||||
return NULL;
|
||||
}
|
||||
return bytes_to_hex(edid, edid_len);
|
||||
}
|
||||
|
||||
jetkvm_video_state_t *jetkvm_video_get_status() {
|
||||
return &state;
|
||||
}
|
||||
|
||||
int jetkvm_video_init() {
|
||||
return video_init();
|
||||
}
|
||||
|
||||
void jetkvm_video_shutdown() {
|
||||
video_shutdown();
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
#ifndef VIDEO_DAEMON_CTRL_H
|
||||
#define VIDEO_DAEMON_CTRL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool ready;
|
||||
const char *error;
|
||||
u_int16_t width;
|
||||
u_int16_t height;
|
||||
double frame_per_second;
|
||||
} jetkvm_video_state_t;
|
||||
|
||||
typedef void (jetkvm_video_state_handler_t)(jetkvm_video_state_t *state);
|
||||
typedef void (jetkvm_log_handler_t)(int level, const char *filename, const char *funcname, int line, const char *message);
|
||||
typedef void (jetkvm_video_handler_t)(const uint8_t *frame, ssize_t len);
|
||||
typedef void (jetkvm_indev_handler_t)(int code);
|
||||
|
||||
void jetkvm_set_log_handler(jetkvm_log_handler_t *handler);
|
||||
void jetkvm_set_video_handler(jetkvm_video_handler_t *handler);
|
||||
void jetkvm_set_indev_handler(jetkvm_indev_handler_t *handler);
|
||||
void jetkvm_set_video_state_handler(jetkvm_video_state_handler_t *handler);
|
||||
|
||||
void jetkvm_ui_set_var(const char *name, const char *value);
|
||||
const char *jetkvm_ui_get_var(const char *name);
|
||||
|
||||
void jetkvm_ui_init(u_int16_t rotation);
|
||||
void jetkvm_ui_tick();
|
||||
|
||||
|
||||
void jetkvm_ui_set_rotation(u_int16_t rotation);
|
||||
const char *jetkvm_ui_get_current_screen();
|
||||
void jetkvm_ui_load_screen(const char *obj_name);
|
||||
int jetkvm_ui_set_text(const char *obj_name, const char *text);
|
||||
void jetkvm_ui_set_image(const char *obj_name, const char *image_name);
|
||||
void jetkvm_ui_set_state(const char *obj_name, const char *state_name);
|
||||
void jetkvm_ui_fade_in(const char *obj_name, u_int32_t duration);
|
||||
void jetkvm_ui_fade_out(const char *obj_name, u_int32_t duration);
|
||||
void jetkvm_ui_set_opacity(const char *obj_name, u_int8_t opacity);
|
||||
int jetkvm_ui_add_flag(const char *obj_name, const char *flag_name);
|
||||
int jetkvm_ui_clear_flag(const char *obj_name, const char *flag_name);
|
||||
|
||||
const char *jetkvm_ui_get_lvgl_version();
|
||||
|
||||
const char *jetkvm_ui_event_code_to_name(int code);
|
||||
|
||||
int jetkvm_video_init();
|
||||
void jetkvm_video_shutdown();
|
||||
void jetkvm_video_start();
|
||||
void jetkvm_video_stop();
|
||||
int jetkvm_video_set_quality_factor(float quality_factor);
|
||||
float jetkvm_video_get_quality_factor();
|
||||
int jetkvm_video_set_edid(const char *edid_hex);
|
||||
char *jetkvm_video_get_edid_hex();
|
||||
jetkvm_video_state_t *jetkvm_video_get_status();
|
||||
|
||||
void video_report_format(bool ready, const char *error, u_int16_t width, u_int16_t height, double frame_per_second);
|
||||
int video_send_frame(const uint8_t *frame, ssize_t len);
|
||||
|
||||
|
||||
|
||||
#endif //VIDEO_DAEMON_CTRL_H
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
#include "edid.h"
|
||||
#include "log.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include <errno.h>
|
||||
#include <sys/klog.h>
|
||||
|
||||
#define MAX_EDID_SIZE 256
|
||||
#define V4L_SUBDEV "/dev/v4l-subdev2"
|
||||
|
||||
int get_edid(uint8_t *edid, size_t max_size)
|
||||
{
|
||||
if (edid == NULL)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (max_size != 128 && max_size != 256)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fd;
|
||||
struct v4l2_edid v4l2_edid;
|
||||
|
||||
fd = open(V4L_SUBDEV, O_RDWR);
|
||||
if (fd < 0)
|
||||
{
|
||||
perror("Failed to open device");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&v4l2_edid, 0, sizeof(v4l2_edid));
|
||||
v4l2_edid.pad = 0;
|
||||
v4l2_edid.start_block = 0;
|
||||
v4l2_edid.blocks = 2;
|
||||
v4l2_edid.edid = edid;
|
||||
|
||||
if (ioctl(fd, VIDIOC_G_EDID, &v4l2_edid) < 0)
|
||||
{
|
||||
perror("Failed to get EDID");
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return v4l2_edid.blocks * 128;
|
||||
}
|
||||
|
||||
static void fix_edid_checksum(uint8_t *edid, size_t size)
|
||||
{
|
||||
for (size_t block = 0; block < size / 128; block++)
|
||||
{
|
||||
uint8_t sum = 0;
|
||||
for (int i = 0; i < 127; i++)
|
||||
{
|
||||
sum += edid[block * 128 + i];
|
||||
}
|
||||
edid[block * 128 + 127] = (uint8_t)(256 - sum);
|
||||
}
|
||||
}
|
||||
|
||||
int set_edid(uint8_t *edid, size_t size)
|
||||
{
|
||||
if (edid == NULL)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (size != 128 && size != 256)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fd;
|
||||
struct v4l2_edid v4l2_edid;
|
||||
|
||||
fd = open(V4L_SUBDEV, O_RDWR);
|
||||
if (fd < 0)
|
||||
{
|
||||
perror("Failed to open device");
|
||||
return -1;
|
||||
}
|
||||
|
||||
fix_edid_checksum(edid, size);
|
||||
|
||||
memset(&v4l2_edid, 0, sizeof(v4l2_edid));
|
||||
v4l2_edid.pad = 0;
|
||||
v4l2_edid.start_block = 0;
|
||||
v4l2_edid.blocks = size / 128;
|
||||
v4l2_edid.edid = edid;
|
||||
|
||||
if (ioctl(fd, VIDIOC_S_EDID, &v4l2_edid) < 0)
|
||||
{
|
||||
perror("Failed to set EDID");
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *videoc_log_status()
|
||||
{
|
||||
int fd;
|
||||
char *buffer = NULL;
|
||||
size_t buffer_size = 0;
|
||||
ssize_t bytes_read;
|
||||
|
||||
fd = open(V4L_SUBDEV, O_RDWR);
|
||||
if (fd < 0)
|
||||
{
|
||||
perror("Failed to open device");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ioctl(fd, VIDIOC_LOG_STATUS) == -1)
|
||||
{
|
||||
perror("VIDIOC_LOG_STATUS failed");
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
char buf[40960];
|
||||
int len = -1;
|
||||
|
||||
len = klogctl(3, buf, sizeof(buf) - 1);
|
||||
|
||||
if (len >= 0)
|
||||
{
|
||||
bool found_status = false;
|
||||
char *p = buf;
|
||||
char *q;
|
||||
|
||||
buf[len] = 0;
|
||||
while ((q = strstr(p, "START STATUS")))
|
||||
{
|
||||
found_status = true;
|
||||
p = q + 1;
|
||||
}
|
||||
if (found_status)
|
||||
{
|
||||
while (p > buf && *p != '<')
|
||||
p--;
|
||||
q = p;
|
||||
while ((q = strstr(q, "<6>")))
|
||||
{
|
||||
memcpy(q, " ", 3);
|
||||
}
|
||||
}
|
||||
buffer = strdup(p);
|
||||
if (buffer == NULL)
|
||||
{
|
||||
perror("Failed to allocate memory for status");
|
||||
return NULL;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
log_error("Failed to read kernel log\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef EDID_H
|
||||
#define EDID_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/**
|
||||
* @brief Read the EDID from the display
|
||||
*
|
||||
* @param edid Buffer to store the EDID data
|
||||
* @param max_size Maximum size of the buffer (should be 128 or 256)
|
||||
* @return int Number of bytes read on success, -1 on failure
|
||||
*/
|
||||
int get_edid(uint8_t *edid, size_t max_size);
|
||||
|
||||
/**
|
||||
* @brief Set the EDID of the display
|
||||
*
|
||||
* @param edid The EDID to set, it can be modified
|
||||
* @param size The size of the EDID (should be 128 or 256)
|
||||
* @return int 0 on success, -1 on failure
|
||||
*/
|
||||
int set_edid(uint8_t *edid, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Get the status of the videocontroller, aka v4l2-ctl --log-status.
|
||||
* User should free the returned string
|
||||
*
|
||||
* @return const char* The status of the videocontroller
|
||||
*/
|
||||
const char* videoc_log_status();
|
||||
|
||||
#endif // EDID_H
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
#ifndef VIDEO_DAEMON_LOG_H
|
||||
#define VIDEO_DAEMON_LOG_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "log_handler.h"
|
||||
|
||||
/* Default level */
|
||||
#ifndef LOG_LEVEL
|
||||
#define LOG_LEVEL LEVEL_INFO
|
||||
#endif
|
||||
|
||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||
|
||||
void jetkvm_log(const char *message);
|
||||
|
||||
/* Log to screen */
|
||||
#define emit_log(level, file, func, line, ...) do { \
|
||||
/* call the log handler */ \
|
||||
char msg_buffer[1024]; \
|
||||
sprintf(msg_buffer, __VA_ARGS__); \
|
||||
log_message(level, file, func, line, msg_buffer); \
|
||||
} while (0)
|
||||
|
||||
/* Level enum */
|
||||
#define LEVEL_PANIC 5
|
||||
#define LEVEL_FATAL 4
|
||||
#define LEVEL_ERROR 3
|
||||
#define LEVEL_WARN 2
|
||||
#define LEVEL_INFO 1
|
||||
#define LEVEL_DEBUG 0
|
||||
#define LEVEL_TRACE -1
|
||||
|
||||
/* TRACE LOG */
|
||||
#define log_trace(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_TRACE) { \
|
||||
emit_log( \
|
||||
LEVEL_TRACE, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* DEBUG LOG */
|
||||
#define log_debug(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_DEBUG) { \
|
||||
emit_log( \
|
||||
LEVEL_DEBUG, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* INFO LOG */
|
||||
#define log_info(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_INFO) { \
|
||||
emit_log( \
|
||||
LEVEL_INFO, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* NOTICE LOG */
|
||||
#define log_notice(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_INFO) { \
|
||||
emit_log( \
|
||||
LEVEL_INFO, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* WARN LOG */
|
||||
#define log_warn(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_WARN) { \
|
||||
emit_log( \
|
||||
LEVEL_WARN, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* ERROR LOG */
|
||||
#define log_error(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_ERROR) { \
|
||||
emit_log( \
|
||||
LEVEL_ERROR, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* PANIC LOG */
|
||||
#define log_panic(...) do { \
|
||||
if (LOG_LEVEL <= LEVEL_PANIC) { \
|
||||
emit_log( \
|
||||
LEVEL_PANIC, __FILENAME__, __func__, __LINE__, __VA_ARGS__ \
|
||||
); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif //VIDEO_DAEMON_LOG_H
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#include <stddef.h>
|
||||
#include "log_handler.h"
|
||||
|
||||
/* Log handler */
|
||||
jetkvm_log_handler_t *log_handler = NULL;
|
||||
|
||||
void log_message(int level, const char *filename, const char *funcname, const int line, const char *message) {
|
||||
if (log_handler != NULL) {
|
||||
log_handler(level, filename, funcname, line, message);
|
||||
}
|
||||
}
|
||||
|
||||
void log_set_handler(jetkvm_log_handler_t *handler) {
|
||||
log_handler = handler;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef LOG_HANDLER_H
|
||||
#define LOG_HANDLER_H
|
||||
|
||||
typedef void (jetkvm_log_handler_t)(int level, const char *filename, const char *funcname, const int line, const char *message);
|
||||
void log_message(int level, const char *filename, const char *funcname, const int line, const char *message);
|
||||
|
||||
void log_set_handler(jetkvm_log_handler_t *handler);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
diff --git a/env_support/cmake/custom.cmake b/env_support/cmake/custom.cmake
|
||||
index 7da68124b..1fbe2d3de 100644
|
||||
--- a/env_support/cmake/custom.cmake
|
||||
+++ b/env_support/cmake/custom.cmake
|
||||
@@ -15,8 +15,6 @@ get_filename_component(LV_CONF_DIR ${LV_CONF_PATH} DIRECTORY)
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
|
||||
file(GLOB_RECURSE SOURCES ${LVGL_ROOT_DIR}/src/*.c)
|
||||
-file(GLOB_RECURSE EXAMPLE_SOURCES ${LVGL_ROOT_DIR}/examples/*.c)
|
||||
-file(GLOB_RECURSE DEMO_SOURCES ${LVGL_ROOT_DIR}/demos/*.c)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_library(lvgl SHARED ${SOURCES})
|
||||
@@ -25,10 +23,6 @@ else()
|
||||
endif()
|
||||
|
||||
add_library(lvgl::lvgl ALIAS lvgl)
|
||||
-add_library(lvgl_examples STATIC ${EXAMPLE_SOURCES})
|
||||
-add_library(lvgl::examples ALIAS lvgl_examples)
|
||||
-add_library(lvgl_demos STATIC ${DEMO_SOURCES})
|
||||
-add_library(lvgl::demos ALIAS lvgl_demos)
|
||||
|
||||
target_compile_definitions(
|
||||
lvgl PUBLIC $<$<BOOL:${LV_LVGL_H_INCLUDE_SIMPLE}>:LV_LVGL_H_INCLUDE_SIMPLE>
|
||||
@@ -37,15 +31,6 @@ target_compile_definitions(
|
||||
# Include root and optional parent path of LV_CONF_PATH
|
||||
target_include_directories(lvgl SYSTEM PUBLIC ${LVGL_ROOT_DIR} ${LV_CONF_DIR})
|
||||
|
||||
-# Include /examples folder
|
||||
-target_include_directories(lvgl_examples SYSTEM
|
||||
- PUBLIC ${LVGL_ROOT_DIR}/examples)
|
||||
-target_include_directories(lvgl_demos SYSTEM
|
||||
- PUBLIC ${LVGL_ROOT_DIR}/demos)
|
||||
-
|
||||
-target_link_libraries(lvgl_examples PUBLIC lvgl)
|
||||
-target_link_libraries(lvgl_demos PUBLIC lvgl)
|
||||
-
|
||||
# Lbrary and headers can be installed to system using make install
|
||||
file(GLOB LVGL_PUBLIC_HEADERS "${CMAKE_SOURCE_DIR}/lv_conf.h"
|
||||
"${CMAKE_SOURCE_DIR}/lvgl.h")
|
||||
diff --git a/lvgl.mk b/lvgl.mk
|
||||
index 0ea126daa..300fb6cbe 100644
|
||||
--- a/lvgl.mk
|
||||
+++ b/lvgl.mk
|
||||
@@ -1,5 +1,3 @@
|
||||
-include $(LVGL_DIR)/$(LVGL_DIR_NAME)/demos/lv_demos.mk
|
||||
-include $(LVGL_DIR)/$(LVGL_DIR_NAME)/examples/lv_examples.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/core/lv_core.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/lv_draw.mk
|
||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/extra/lv_extra.mk
|
||||
diff --git a/src/font/lv_font.h b/src/font/lv_font.h
|
||||
index e3b670c87..4cceffc45 100644
|
||||
--- a/src/font/lv_font.h
|
||||
+++ b/src/font/lv_font.h
|
||||
@@ -132,114 +132,10 @@ static inline lv_coord_t lv_font_get_line_height(const lv_font_t * font_p)
|
||||
|
||||
#define LV_FONT_DECLARE(font_name) extern const lv_font_t font_name;
|
||||
|
||||
-#if LV_FONT_MONTSERRAT_8
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_8)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_10
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_10)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_12
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_12)
|
||||
-#endif
|
||||
-
|
||||
#if LV_FONT_MONTSERRAT_14
|
||||
LV_FONT_DECLARE(lv_font_montserrat_14)
|
||||
#endif
|
||||
|
||||
-#if LV_FONT_MONTSERRAT_16
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_16)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_18
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_18)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_20
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_20)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_22
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_22)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_24
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_24)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_26
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_26)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_28
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_28)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_30
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_30)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_32
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_32)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_34
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_34)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_36
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_36)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_38
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_38)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_40
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_40)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_42
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_42)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_44
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_44)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_46
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_46)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_48
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_48)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_12_SUBPX
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_12_subpx)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_MONTSERRAT_28_COMPRESSED
|
||||
-LV_FONT_DECLARE(lv_font_montserrat_28_compressed)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_DEJAVU_16_PERSIAN_HEBREW
|
||||
-LV_FONT_DECLARE(lv_font_dejavu_16_persian_hebrew)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_SIMSUN_16_CJK
|
||||
-LV_FONT_DECLARE(lv_font_simsun_16_cjk)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_UNSCII_8
|
||||
-LV_FONT_DECLARE(lv_font_unscii_8)
|
||||
-#endif
|
||||
-
|
||||
-#if LV_FONT_UNSCII_16
|
||||
-LV_FONT_DECLARE(lv_font_unscii_16)
|
||||
-#endif
|
||||
-
|
||||
/*Declare the custom (user defined) fonts*/
|
||||
#ifdef LV_FONT_CUSTOM_DECLARE
|
||||
LV_FONT_CUSTOM_DECLARE
|
||||
diff --git a/src/font/lv_font.mk b/src/font/lv_font.mk
|
||||
index 2201b73f2..7b2707da4 100644
|
||||
--- a/src/font/lv_font.mk
|
||||
+++ b/src/font/lv_font.mk
|
||||
@@ -2,33 +2,7 @@ CSRCS += lv_font.c
|
||||
CSRCS += lv_font_fmt_txt.c
|
||||
CSRCS += lv_font_loader.c
|
||||
|
||||
-CSRCS += lv_font_dejavu_16_persian_hebrew.c
|
||||
-CSRCS += lv_font_montserrat_8.c
|
||||
-CSRCS += lv_font_montserrat_10.c
|
||||
-CSRCS += lv_font_montserrat_12.c
|
||||
-CSRCS += lv_font_montserrat_12_subpx.c
|
||||
CSRCS += lv_font_montserrat_14.c
|
||||
-CSRCS += lv_font_montserrat_16.c
|
||||
-CSRCS += lv_font_montserrat_18.c
|
||||
-CSRCS += lv_font_montserrat_20.c
|
||||
-CSRCS += lv_font_montserrat_22.c
|
||||
-CSRCS += lv_font_montserrat_24.c
|
||||
-CSRCS += lv_font_montserrat_26.c
|
||||
-CSRCS += lv_font_montserrat_28.c
|
||||
-CSRCS += lv_font_montserrat_28_compressed.c
|
||||
-CSRCS += lv_font_montserrat_30.c
|
||||
-CSRCS += lv_font_montserrat_32.c
|
||||
-CSRCS += lv_font_montserrat_34.c
|
||||
-CSRCS += lv_font_montserrat_36.c
|
||||
-CSRCS += lv_font_montserrat_38.c
|
||||
-CSRCS += lv_font_montserrat_40.c
|
||||
-CSRCS += lv_font_montserrat_42.c
|
||||
-CSRCS += lv_font_montserrat_44.c
|
||||
-CSRCS += lv_font_montserrat_46.c
|
||||
-CSRCS += lv_font_montserrat_48.c
|
||||
-CSRCS += lv_font_simsun_16_cjk.c
|
||||
-CSRCS += lv_font_unscii_8.c
|
||||
-CSRCS += lv_font_unscii_16.c
|
||||
|
||||
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/font
|
||||
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/font
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
CONFIG_LV_OS_PTHREAD=y
|
||||
CONFIG_LV_USE_OBJ_ID=y
|
||||
CONFIG_LV_USE_OBJ_NAME=y
|
||||
CONFIG_LV_USE_OBJ_ID_BUILTIN=y
|
||||
CONFIG_LV_USE_OBJ_PROPERTY=y
|
||||
CONFIG_LV_USE_OBJ_PROPERTY_NAME=y
|
||||
CONFIG_LV_USE_PRIVATE_API=y
|
||||
# CONFIG_LV_USE_CALENDAR is not set
|
||||
# CONFIG_LV_USE_CHART is not set
|
||||
# CONFIG_LV_USE_CHECKBOX is not set
|
||||
# CONFIG_LV_USE_MSGBOX is not set
|
||||
# CONFIG_LV_USE_ROLLER is not set
|
||||
# CONFIG_LV_USE_SCALE is not set
|
||||
# CONFIG_LV_USE_SLIDER is not set
|
||||
# CONFIG_LV_USE_TABLE is not set
|
||||
# CONFIG_LV_USE_TABVIEW is not set
|
||||
# CONFIG_LV_USE_TILEVIEW is not set
|
||||
CONFIG_LV_USE_QRCODE=y
|
||||
CONFIG_LV_USE_LINUX_FBDEV=y
|
||||
CONFIG_LV_USE_EVDEV=y
|
||||
CONFIG_LV_USE_ST7789=y
|
||||
CONFIG_LV_BUILD_EXAMPLES=n
|
||||
CONFIG_LV_BUILD_DEMOS=n
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "screen.h"
|
||||
#include <lvgl.h>
|
||||
// #include "st7789/lcd.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui_index.h"
|
||||
|
||||
#define DISP_BUF_SIZE (300 * 240 * 2)
|
||||
static lv_color_t buf[DISP_BUF_SIZE];
|
||||
|
||||
indev_handler_t *indev_handler = NULL;
|
||||
|
||||
void lvgl_set_indev_handler(indev_handler_t *handler) {
|
||||
indev_handler = handler;
|
||||
}
|
||||
|
||||
void handle_indev_event(lv_event_t *e) {
|
||||
if (indev_handler == NULL) {
|
||||
return;
|
||||
}
|
||||
indev_handler(lv_event_get_code(e));
|
||||
}
|
||||
|
||||
void lvgl_init(u_int16_t rotation) {
|
||||
log_trace("initalizing lvgl");
|
||||
|
||||
/*LittlevGL init*/
|
||||
lv_init();
|
||||
|
||||
/*Linux frame buffer device init*/
|
||||
|
||||
/*Linux frame buffer device init*/
|
||||
lv_display_t *disp = lv_linux_fbdev_create();
|
||||
// lv_display_set_physical_resolution(disp, 240, 300);
|
||||
lv_display_set_resolution(disp, 240, 300);
|
||||
lv_linux_fbdev_set_file(disp, "/dev/fb0");
|
||||
|
||||
lvgl_set_rotation(disp, rotation);
|
||||
|
||||
// lv_display_t *disp = lv_st7789_create(LCD_H_RES, LCD_V_RES, LV_LCD_FLAG_NONE, lcd_send_cmd, lcd_send_color);
|
||||
// lv_display_set_resolution(disp, 240, 300);
|
||||
// lv_display_set_rotation(disp, LV_DISP_ROTATION_270);
|
||||
|
||||
// lv_color_t * buf1 = NULL;
|
||||
// lv_color_t * buf2 = NULL;
|
||||
|
||||
// uint32_t buf_size = LCD_H_RES * LCD_V_RES / 10 * lv_color_format_get_size(lv_display_get_color_format(disp));
|
||||
|
||||
// buf1 = lv_malloc(buf_size);
|
||||
// if(buf1 == NULL) {
|
||||
// log_error("display draw buffer malloc failed");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// buf2 = lv_malloc(buf_size);
|
||||
// if(buf2 == NULL) {
|
||||
// log_error("display buffer malloc failed");
|
||||
// lv_free(buf1);
|
||||
// return;
|
||||
// }
|
||||
// lv_display_set_buffers(disp, buf1, buf2, buf_size, LV_DISPLAY_RENDER_MODE_PARTIAL);
|
||||
|
||||
/* Linux input device init */
|
||||
lv_indev_t *mouse = lv_evdev_create(LV_INDEV_TYPE_POINTER, "/dev/input/event1");
|
||||
lv_indev_set_group(mouse, lv_group_get_default());
|
||||
lv_indev_set_display(mouse, disp);
|
||||
|
||||
lv_indev_add_event_cb(mouse, handle_indev_event, LV_EVENT_ALL, NULL);
|
||||
|
||||
log_trace("initalizing ui");
|
||||
|
||||
ui_init();
|
||||
|
||||
log_info("ui initalized");
|
||||
// lv_label_set_text(ui_Boot_Screen_Version, "");
|
||||
// lv_label_set_text(ui_Home_Content_Ip, "...");
|
||||
// lv_label_set_text(ui_Home_Header_Cloud_Status_Label, "0 active");
|
||||
}
|
||||
|
||||
void lvgl_tick(void) {
|
||||
lv_timer_handler();
|
||||
ui_tick();
|
||||
}
|
||||
|
||||
void lvgl_set_rotation(lv_display_t *disp, u_int16_t rotation) {
|
||||
log_info("setting rotation to %d", rotation);
|
||||
if (rotation == 0) {
|
||||
lv_display_set_rotation(disp, LV_DISP_ROTATION_0);
|
||||
} else if (rotation == 90) {
|
||||
lv_display_set_rotation(disp, LV_DISP_ROTATION_90);
|
||||
} else if (rotation == 180) {
|
||||
lv_display_set_rotation(disp, LV_DISP_ROTATION_180);
|
||||
} else if (rotation == 270) {
|
||||
lv_display_set_rotation(disp, LV_DISP_ROTATION_270);
|
||||
} else {
|
||||
log_error("invalid rotation %d", rotation);
|
||||
}
|
||||
|
||||
lv_style_t *flex_screen_style = ui_get_style("flex_screen");
|
||||
if (flex_screen_style == NULL) {
|
||||
log_error("flex_screen style not found");
|
||||
return;
|
||||
}
|
||||
|
||||
lv_style_t *flex_screen_menu_style = ui_get_style("flex_screen_menu");
|
||||
if (flex_screen_menu_style == NULL) {
|
||||
log_error("flex_screen_menu style not found");
|
||||
return;
|
||||
}
|
||||
|
||||
if (rotation == 90) {
|
||||
lv_style_set_pad_left(flex_screen_style, 24);
|
||||
lv_style_set_pad_right(flex_screen_style, 44);
|
||||
} else if (rotation == 270) {
|
||||
lv_style_set_pad_left(flex_screen_style, 44);
|
||||
lv_style_set_pad_right(flex_screen_style, 24);
|
||||
}
|
||||
|
||||
log_info("refreshing objects");
|
||||
lv_obj_report_style_change(&flex_screen_style);
|
||||
lv_obj_report_style_change(&flex_screen_menu_style);
|
||||
}
|
||||
|
||||
uint32_t custom_tick_get(void)
|
||||
{
|
||||
static uint64_t start_ms = 0;
|
||||
if(start_ms == 0) {
|
||||
struct timeval tv_start;
|
||||
gettimeofday(&tv_start, NULL);
|
||||
start_ms = (tv_start.tv_sec * 1000000 + tv_start.tv_usec) / 1000;
|
||||
}
|
||||
|
||||
struct timeval tv_now;
|
||||
gettimeofday(&tv_now, NULL);
|
||||
uint64_t now_ms;
|
||||
now_ms = (tv_now.tv_sec * 1000000 + tv_now.tv_usec) / 1000;
|
||||
|
||||
uint32_t time_ms = now_ms - start_ms;
|
||||
return time_ms;
|
||||
}
|
||||
|
||||
lv_obj_t *ui_get_obj(const char *name) {
|
||||
for (size_t i = 0; i < ui_objects_size; i++) {
|
||||
if (strcmp(ui_objects[i].name, name) == 0) {
|
||||
return *ui_objects[i].obj;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lv_style_t *ui_get_style(const char *name) {
|
||||
for (size_t i = 0; i < ui_styles_size; i++) {
|
||||
if (strcmp(ui_styles[i].name, name) == 0) {
|
||||
return ui_styles[i].getter();
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
const char *ui_get_current_screen() {
|
||||
lv_obj_t *scr = lv_scr_act();
|
||||
if (scr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
for (size_t i = 0; i < ui_objects_size; i++) {
|
||||
if (*(ui_objects[i].obj) == scr) {
|
||||
return ui_objects[i].name;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lv_img_dsc_t *ui_get_image(const char *name) {
|
||||
for (size_t i = 0; i < ui_images_size; i++) {
|
||||
if (strcmp(ui_images[i].name, name) == 0) {
|
||||
return ui_images[i].img;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ui_set_text(const char *name, const char *text) {
|
||||
lv_obj_t *obj = ui_get_obj(name);
|
||||
if(obj == NULL) {
|
||||
log_error("ui_set_text %s %s, obj not found\n", name, text);
|
||||
return;
|
||||
}
|
||||
lv_label_set_text(obj, text);
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef SCREEN_H
|
||||
#define SCREEN_H
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
typedef void (indev_handler_t)(lv_event_code_t code);
|
||||
|
||||
void lvgl_set_indev_handler(indev_handler_t *handler);
|
||||
|
||||
void lvgl_init(u_int16_t rotation);
|
||||
void lvgl_tick(void);
|
||||
|
||||
void lvgl_set_rotation(lv_display_t *disp, u_int16_t rotation);
|
||||
|
||||
void ui_set_text(const char *name, const char *text);
|
||||
|
||||
lv_obj_t *ui_get_obj(const char *name);
|
||||
lv_style_t *ui_get_style(const char *name);
|
||||
lv_img_dsc_t *ui_get_image(const char *name);
|
||||
|
||||
#endif // SCREEN_H
|
||||
|
|
@ -0,0 +1 @@
|
|||
../eez/src/ui
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
cat << EOF > ui_index.c
|
||||
// This file was generated by ui_index.gen.sh, do not edit it manually
|
||||
#include "ui_index.h"
|
||||
|
||||
ui_obj_map ui_objects[] = {
|
||||
$(grep -h "lv_obj_t \*" ui/screens.h | sed 's/lv_obj_t \*//g' | sed 's/;//g' | while read -r line; do
|
||||
echo " {\"$line\", &(objects.$line)},"
|
||||
done)
|
||||
};
|
||||
|
||||
const int ui_objects_size = sizeof(ui_objects) / sizeof(ui_objects[0]);
|
||||
|
||||
ui_style_map ui_styles[] = {
|
||||
$(grep 'lv_style_t \*get_style_' ui/styles.h | sed 's/lv_style_t \*get_style_//g' | sed 's/_MAIN_DEFAULT();//g' | sed 's/\r//' | while read -r line; do
|
||||
echo " {\"$line\", &get_style_${line}_MAIN_DEFAULT},"
|
||||
done)
|
||||
};
|
||||
|
||||
const int ui_styles_size = sizeof(ui_styles) / sizeof(ui_styles[0]);
|
||||
|
||||
ui_img_map ui_images[] = {
|
||||
$(grep "extern const lv_img_dsc_t " ui/images.h | sed 's/extern const lv_img_dsc_t //g' | sed 's/;//g' | while read -r line; do
|
||||
echo " {\"$line\", &$line},"
|
||||
done)
|
||||
};
|
||||
|
||||
const int ui_images_size = sizeof(ui_images) / sizeof(ui_images[0]);
|
||||
|
||||
ui_var_map ui_vars[] = {
|
||||
$(grep 'extern const char \*get_var_' ui/vars.h | sed 's/extern const char \*get_var_//g' | sed 's/();//g' | sed 's/\r//' | while read -r line; do
|
||||
echo " {\"$line\", &get_var_$line, &set_var_$line},"
|
||||
done)
|
||||
};
|
||||
|
||||
const int ui_vars_size = sizeof(ui_vars) / sizeof(ui_vars[0]);
|
||||
EOF
|
||||
|
||||
echo "ui_index.c has been generated successfully."
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#ifndef UI_INDEX_H
|
||||
#define UI_INDEX_H
|
||||
|
||||
#include "ui/ui.h"
|
||||
#include "ui/screens.h"
|
||||
#include "ui/styles.h"
|
||||
#include "ui/images.h"
|
||||
#include "ui/vars.h"
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
lv_obj_t **obj; // Pointer to the object pointer, as the object pointer is only populated after the ui is initialized
|
||||
} ui_obj_map;
|
||||
|
||||
extern ui_obj_map ui_objects[];
|
||||
extern const int ui_objects_size;
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
lv_style_t *(*getter)();
|
||||
} ui_style_map;
|
||||
|
||||
extern ui_style_map ui_styles[];
|
||||
extern const int ui_styles_size;
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
const lv_img_dsc_t *img; // Pointer to the image descriptor const
|
||||
} ui_img_map;
|
||||
|
||||
extern ui_img_map ui_images[];
|
||||
extern const int ui_images_size;
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
const char *(*getter)();
|
||||
void (*setter)(const char *value);
|
||||
} ui_var_map;
|
||||
|
||||
extern ui_var_map ui_vars[];
|
||||
extern const int ui_vars_size;
|
||||
|
||||
#endif // UI_INDEX_H
|
||||
|
|
@ -0,0 +1,728 @@
|
|||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <rk_type.h>
|
||||
#include <rk_mpi_venc.h>
|
||||
#include <rk_mpi_sys.h>
|
||||
#include <string.h>
|
||||
#include <rk_debug.h>
|
||||
#include <malloc.h>
|
||||
#include <stdbool.h>
|
||||
#include <rk_mpi_mb.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdatomic.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <rk_mpi_mmz.h>
|
||||
#include <pthread.h>
|
||||
#include <assert.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/socket.h>
|
||||
#include "video.h"
|
||||
#include "ctrl.h"
|
||||
#include "log.h"
|
||||
|
||||
#define VIDEO_DEV "/dev/video0"
|
||||
#define SUB_DEV "/dev/v4l-subdev2"
|
||||
|
||||
#define RK_ALIGN(x, a) (((x) + (a)-1) & ~((a)-1))
|
||||
#define RK_ALIGN_2(x) RK_ALIGN(x, 2)
|
||||
#define RK_ALIGN_16(x) RK_ALIGN(x, 16)
|
||||
#define RK_ALIGN_32(x) RK_ALIGN(x, 32)
|
||||
|
||||
int sub_dev_fd = -1;
|
||||
#define VENC_CHANNEL 0
|
||||
MB_POOL memPool = MB_INVALID_POOLID;
|
||||
|
||||
bool should_exit = false;
|
||||
float quality_factor = 1.0f;
|
||||
|
||||
static void *venc_read_stream(void *arg);
|
||||
|
||||
RK_U64 get_us()
|
||||
{
|
||||
struct timespec time = {0, 0};
|
||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||
return (RK_U64)time.tv_sec * 1000000 + (RK_U64)time.tv_nsec / 1000; /* microseconds */
|
||||
}
|
||||
|
||||
double calculate_bitrate(float bitrate_factor, int width, int height)
|
||||
{
|
||||
const int32_t base_bitrate_high = 2000;
|
||||
const int32_t base_bitrate_low = 512;
|
||||
|
||||
double pixels = (double)width * height;
|
||||
double ref_pixels = 1920.0 * 1080.0;
|
||||
|
||||
double scale_factor = pixels / ref_pixels;
|
||||
|
||||
int32_t base_bitrate = base_bitrate_low + (int32_t)((base_bitrate_high - base_bitrate_low) * bitrate_factor);
|
||||
|
||||
int32_t bitrate = (int32_t)(base_bitrate * scale_factor);
|
||||
|
||||
const int32_t min_bitrate = 100;
|
||||
if (bitrate < min_bitrate)
|
||||
{
|
||||
bitrate = min_bitrate;
|
||||
}
|
||||
|
||||
return bitrate;
|
||||
}
|
||||
|
||||
static void populate_venc_attr(VENC_CHN_ATTR_S *stAttr, RK_U32 bitrate, RK_U32 max_bitrate, RK_U32 width, RK_U32 height)
|
||||
{
|
||||
memset(stAttr, 0, sizeof(VENC_CHN_ATTR_S));
|
||||
|
||||
stAttr->stRcAttr.enRcMode = VENC_RC_MODE_H264VBR;
|
||||
stAttr->stRcAttr.stH264Vbr.u32BitRate = bitrate;
|
||||
stAttr->stRcAttr.stH264Vbr.u32MaxBitRate = max_bitrate;
|
||||
stAttr->stRcAttr.stH264Vbr.u32Gop = 60;
|
||||
|
||||
stAttr->stVencAttr.enType = RK_VIDEO_ID_AVC;
|
||||
stAttr->stVencAttr.enPixelFormat = RK_FMT_YUV422_YUYV;
|
||||
stAttr->stVencAttr.u32Profile = H264E_PROFILE_HIGH;
|
||||
stAttr->stVencAttr.u32PicWidth = width;
|
||||
stAttr->stVencAttr.u32PicHeight = height;
|
||||
// stAttr->stVencAttr.u32VirWidth = (width + 15) & (~15);
|
||||
// stAttr->stVencAttr.u32VirHeight = (height + 15) & (~15);
|
||||
stAttr->stVencAttr.u32VirWidth = RK_ALIGN_2(width);
|
||||
stAttr->stVencAttr.u32VirHeight = RK_ALIGN_2(height);
|
||||
stAttr->stVencAttr.u32StreamBufCnt = 3;
|
||||
stAttr->stVencAttr.u32BufSize = width * height * 3 / 2;
|
||||
stAttr->stVencAttr.enMirror = MIRROR_NONE;
|
||||
}
|
||||
|
||||
pthread_t *venc_read_thread = NULL;
|
||||
volatile bool venc_running = false;
|
||||
static int32_t venc_start(int32_t bitrate, int32_t max_bitrate, int32_t width, int32_t height)
|
||||
{
|
||||
int32_t ret;
|
||||
VENC_CHN_ATTR_S stAttr;
|
||||
populate_venc_attr(&stAttr, bitrate, max_bitrate, width, height);
|
||||
|
||||
ret = RK_MPI_VENC_CreateChn(VENC_CHANNEL, &stAttr);
|
||||
if (ret < 0)
|
||||
{
|
||||
RK_LOGE("error RK_MPI_VENC_CreateChn, %d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
VENC_RECV_PIC_PARAM_S stRecvParam;
|
||||
memset(&stRecvParam, 0, sizeof(VENC_RECV_PIC_PARAM_S));
|
||||
stRecvParam.s32RecvPicNum = -1;
|
||||
ret = RK_MPI_VENC_StartRecvFrame(VENC_CHANNEL, &stRecvParam);
|
||||
if (ret < 0)
|
||||
{
|
||||
RK_LOGE("error RK_MPI_VENC_StartRecvFrame, %d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
venc_running = true;
|
||||
venc_read_thread = malloc(sizeof(pthread_t));
|
||||
if (pthread_create(venc_read_thread, NULL, venc_read_stream, NULL) != 0)
|
||||
{
|
||||
RK_LOGE("Failed to create venc_read_thread");
|
||||
return RK_FAILURE;
|
||||
}
|
||||
|
||||
return RK_SUCCESS;
|
||||
}
|
||||
|
||||
static int32_t venc_stop()
|
||||
{
|
||||
venc_running = false;
|
||||
|
||||
int32_t ret;
|
||||
ret = RK_MPI_VENC_StopRecvFrame(VENC_CHANNEL);
|
||||
if (ret != RK_SUCCESS)
|
||||
{
|
||||
RK_LOGE("Failed to stop receiving frames for VENC_CHANNEL, error code: %d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (venc_read_thread != NULL)
|
||||
{
|
||||
pthread_join(*venc_read_thread, NULL);
|
||||
free(venc_read_thread);
|
||||
venc_read_thread = NULL;
|
||||
}
|
||||
|
||||
ret = RK_MPI_VENC_DestroyChn(VENC_CHANNEL);
|
||||
if (ret != RK_SUCCESS)
|
||||
{
|
||||
RK_LOGE("Failed to destroy VENC_CHANNEL, error code: %d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return RK_SUCCESS;
|
||||
}
|
||||
|
||||
struct buffer
|
||||
{
|
||||
struct v4l2_plane plane_buffer;
|
||||
MB_BLK mb_blk;
|
||||
};
|
||||
|
||||
const int input_buffer_count = 3;
|
||||
|
||||
static int32_t buf_init()
|
||||
{
|
||||
MB_POOL_CONFIG_S stMbPoolCfg;
|
||||
memset(&stMbPoolCfg, 0, sizeof(MB_POOL_CONFIG_S));
|
||||
stMbPoolCfg.u64MBSize = 1920 * 1080 * 3; // max resolution
|
||||
stMbPoolCfg.u32MBCnt = input_buffer_count;
|
||||
stMbPoolCfg.enAllocType = MB_ALLOC_TYPE_DMA;
|
||||
stMbPoolCfg.bPreAlloc = RK_TRUE;
|
||||
memPool = RK_MPI_MB_CreatePool(&stMbPoolCfg);
|
||||
if (memPool == MB_INVALID_POOLID)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
log_info("created memory pool");
|
||||
|
||||
return RK_SUCCESS;
|
||||
}
|
||||
|
||||
pthread_t *format_thread = NULL;
|
||||
|
||||
int video_init()
|
||||
{
|
||||
if (RK_MPI_SYS_Init() != RK_SUCCESS)
|
||||
{
|
||||
log_error("RK_MPI_SYS_Init failed");
|
||||
return RK_FAILURE;
|
||||
}
|
||||
|
||||
if (sub_dev_fd < 0)
|
||||
{
|
||||
sub_dev_fd = open(SUB_DEV, O_RDWR);
|
||||
if (sub_dev_fd < 0)
|
||||
{
|
||||
log_error("failed to open control sub device %s: %s", SUB_DEV, strerror(errno));
|
||||
return errno;
|
||||
}
|
||||
log_info("opened control sub device %s", SUB_DEV);
|
||||
}
|
||||
|
||||
int32_t ret = buf_init();
|
||||
if (ret != RK_SUCCESS)
|
||||
{
|
||||
log_error("buf_init failed with error: %d", ret);
|
||||
return ret;
|
||||
}
|
||||
log_info("buf_init completed successfully");
|
||||
|
||||
format_thread = malloc(sizeof(pthread_t));
|
||||
pthread_create(format_thread, NULL, run_detect_format, NULL);
|
||||
return RK_SUCCESS;
|
||||
}
|
||||
|
||||
// static int32_t venc_set_param(int32_t bitrate, int32_t max_bitrate, int32_t width, int32_t height)
|
||||
// {
|
||||
|
||||
// VENC_CHN_ATTR_S stAttr;
|
||||
// populate_venc_attr(&stAttr, bitrate, max_bitrate, width, height);
|
||||
// VENC_CHN_PARAM_S stParam;
|
||||
// memset(&stParam, 0, sizeof(VENC_CHN_PARAM_S));
|
||||
|
||||
// RK_MPI_VENC_StopRecvFrame(VENC_CHANNEL);
|
||||
|
||||
// int32_t ret = RK_MPI_VENC_SetChnParam(VENC_CHANNEL, &stAttr);
|
||||
// if (ret < 0)
|
||||
// {
|
||||
// RK_LOGE("error RK_MPI_VENC_SetChnParam, %d", ret);
|
||||
// return ret;
|
||||
// }
|
||||
// VENC_RECV_PIC_PARAM_S stRecvParam;
|
||||
// memset(&stRecvParam, 0, sizeof(VENC_RECV_PIC_PARAM_S));
|
||||
// stRecvParam.s32RecvPicNum = -1;
|
||||
// ret = RK_MPI_VENC_StartRecvFrame(VENC_CHANNEL, &stRecvParam);
|
||||
// if (ret < 0)
|
||||
// {
|
||||
// RK_LOGE("error RK_MPI_VENC_StartRecvFrame, %d", ret);
|
||||
// return ret;
|
||||
// }
|
||||
|
||||
// return RK_SUCCESS;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @brief Continuously reads encoded video streams and sends them over unix socket.
|
||||
*
|
||||
* @param arg Unused parameter (void pointer for thread compatibility)
|
||||
* @return NULL Always returns NULL
|
||||
*/
|
||||
static void *venc_read_stream(void *arg)
|
||||
{
|
||||
(void)arg;
|
||||
void *pData = RK_NULL;
|
||||
int loopCount = 0;
|
||||
int s32Ret;
|
||||
|
||||
VENC_STREAM_S stFrame;
|
||||
stFrame.pstPack = malloc(sizeof(VENC_PACK_S));
|
||||
while (venc_running)
|
||||
{
|
||||
// printf("RK_MPI_VENC_GetStream\n");
|
||||
s32Ret = RK_MPI_VENC_GetStream(VENC_CHANNEL, &stFrame, 200); // blocks max 200ms
|
||||
if (s32Ret == RK_SUCCESS)
|
||||
{
|
||||
RK_U64 nowUs = get_us();
|
||||
// printf("chn:0, loopCount:%d enc->seq:%d wd:%d pts=%llu delay=%lldus\n",
|
||||
// loopCount, stFrame.u32Seq, stFrame.pstPack->u32Len,
|
||||
// stFrame.pstPack->u64PTS, nowUs - stFrame.pstPack->u64PTS);
|
||||
pData = RK_MPI_MB_Handle2VirAddr(stFrame.pstPack->pMbBlk);
|
||||
video_send_frame(pData, (ssize_t)stFrame.pstPack->u32Len);
|
||||
s32Ret = RK_MPI_VENC_ReleaseStream(VENC_CHANNEL, &stFrame);
|
||||
if (s32Ret != RK_SUCCESS)
|
||||
{
|
||||
log_error("RK_MPI_VENC_ReleaseStream fail %x", s32Ret);
|
||||
}
|
||||
loopCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s32Ret == RK_ERR_VENC_BUF_EMPTY)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
log_error("RK_MPI_VENC_GetStream fail %x", s32Ret);
|
||||
break;
|
||||
}
|
||||
}
|
||||
log_info("exiting venc_read_stream");
|
||||
free(stFrame.pstPack);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32_t detected_width, detected_height;
|
||||
bool detected_signal = false, streaming_flag = false;
|
||||
|
||||
pthread_t *streaming_thread = NULL;
|
||||
|
||||
void write_buffer_to_file(const uint8_t *buffer, size_t length, const char *filename)
|
||||
{
|
||||
FILE *file = fopen(filename, "wb");
|
||||
fwrite(buffer, 1, length, file);
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
void *run_video_stream(void *arg)
|
||||
{
|
||||
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
|
||||
log_info("running video stream");
|
||||
|
||||
while (streaming_flag)
|
||||
{
|
||||
if (detected_signal == false)
|
||||
{
|
||||
usleep(100000);
|
||||
continue;
|
||||
}
|
||||
|
||||
int video_dev_fd = open(VIDEO_DEV, O_RDWR);
|
||||
if (video_dev_fd < 0)
|
||||
{
|
||||
log_error("failed to open video capture device %s: %s", VIDEO_DEV, strerror(errno));
|
||||
usleep(1000000);
|
||||
continue;
|
||||
}
|
||||
log_info("opened video capture device %s", VIDEO_DEV);
|
||||
|
||||
uint32_t width = detected_width;
|
||||
uint32_t height = detected_height;
|
||||
struct v4l2_format fmt;
|
||||
memset(&fmt, 0, sizeof(struct v4l2_format));
|
||||
fmt.type = type;
|
||||
fmt.fmt.pix_mp.width = width;
|
||||
fmt.fmt.pix_mp.height = height;
|
||||
fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_YUYV;
|
||||
fmt.fmt.pix_mp.field = V4L2_FIELD_ANY;
|
||||
|
||||
if (ioctl(video_dev_fd, VIDIOC_S_FMT, &fmt) < 0)
|
||||
{
|
||||
perror("Set format fail");
|
||||
usleep(100000); // Sleep for 100 milliseconds
|
||||
close(video_dev_fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
struct v4l2_buffer buf;
|
||||
|
||||
struct v4l2_requestbuffers req;
|
||||
req.count = input_buffer_count;
|
||||
req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
req.memory = V4L2_MEMORY_DMABUF;
|
||||
|
||||
if (ioctl(video_dev_fd, VIDIOC_REQBUFS, &req) < 0)
|
||||
{
|
||||
perror("VIDIOC_REQBUFS failed");
|
||||
return errno;
|
||||
}
|
||||
log_info("VIDIOC_REQBUFS successful");
|
||||
|
||||
struct buffer buffers[3] = {};
|
||||
log_info("allocated buffers");
|
||||
|
||||
for (int i = 0; i < input_buffer_count; i++)
|
||||
{
|
||||
struct v4l2_plane *planes_buffer = &buffers[i].plane_buffer;
|
||||
memset(planes_buffer, 0, sizeof(struct v4l2_plane));
|
||||
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
buf.memory = V4L2_MEMORY_DMABUF;
|
||||
buf.m.planes = planes_buffer;
|
||||
buf.length = 1;
|
||||
buf.index = i;
|
||||
|
||||
if (-1 == ioctl(video_dev_fd, VIDIOC_QUERYBUF, &buf))
|
||||
{
|
||||
perror("VIDIOC_QUERYBUF failed");
|
||||
req.count = i;
|
||||
return errno;
|
||||
}
|
||||
printf("VIDIOC_QUERYBUF successful for buffer %d\n", i);
|
||||
|
||||
printf("plane: length = %d\n", planes_buffer->length);
|
||||
printf("plane: offset = %d\n", planes_buffer->m.mem_offset);
|
||||
|
||||
MB_BLK blk = RK_MPI_MB_GetMB(memPool, (planes_buffer)->length, RK_TRUE);
|
||||
if (blk == NULL)
|
||||
{
|
||||
RK_LOGE("get mb blk failed!");
|
||||
return -1;
|
||||
}
|
||||
printf("Got memory block for buffer %d\n", i);
|
||||
|
||||
buffers[i].mb_blk = blk;
|
||||
|
||||
RK_S32 buf_fd = (RK_MPI_MB_Handle2Fd(blk));
|
||||
if (buf_fd < 0)
|
||||
{
|
||||
RK_LOGE("RK_MPI_MB_Handle2Fd failed!");
|
||||
return -1;
|
||||
}
|
||||
printf("Converted memory block to file descriptor for buffer %d\n", i);
|
||||
planes_buffer->m.fd = buf_fd;
|
||||
}
|
||||
|
||||
for (int i = 0; i < input_buffer_count; ++i)
|
||||
{
|
||||
struct v4l2_buffer buf;
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
buf.memory = V4L2_MEMORY_DMABUF;
|
||||
buf.length = 1;
|
||||
buf.index = i;
|
||||
buf.m.planes = &buffers[i].plane_buffer;
|
||||
if (ioctl(video_dev_fd, VIDIOC_QBUF, &buf) < 0)
|
||||
{
|
||||
perror("VIDIOC_QBUF failed");
|
||||
return errno;
|
||||
}
|
||||
printf("VIDIOC_QBUF successful for buffer %d\n", i);
|
||||
}
|
||||
|
||||
if (ioctl(video_dev_fd, VIDIOC_STREAMON, &type) < 0)
|
||||
{
|
||||
perror("VIDIOC_STREAMON failed");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
struct v4l2_plane tmp_plane;
|
||||
|
||||
// Set VENC parameters
|
||||
int32_t bitrate = calculate_bitrate(quality_factor, width, height);
|
||||
RK_S32 ret = venc_start(bitrate, bitrate * 2, width, height);
|
||||
if (ret != RK_SUCCESS)
|
||||
{
|
||||
log_error("Set VENC parameters failed with %#x", ret);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
fd_set fds;
|
||||
struct timeval tv;
|
||||
int r;
|
||||
uint32_t num = 0;
|
||||
VIDEO_FRAME_INFO_S stFrame;
|
||||
|
||||
while (streaming_flag)
|
||||
{
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(video_dev_fd, &fds);
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
r = select(video_dev_fd + 1, &fds, NULL, NULL, &tv);
|
||||
if (r == 0)
|
||||
{
|
||||
log_info("select timeout \n");
|
||||
break;
|
||||
}
|
||||
if (r == -1)
|
||||
{
|
||||
if (errno == EINTR)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
perror("select in video streaming");
|
||||
break;
|
||||
}
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
buf.memory = V4L2_MEMORY_DMABUF;
|
||||
buf.m.planes = &tmp_plane;
|
||||
buf.length = 1;
|
||||
if (ioctl(video_dev_fd, VIDIOC_DQBUF, &buf) < 0)
|
||||
{
|
||||
perror("VIDIOC_DQBUF failed");
|
||||
break;
|
||||
}
|
||||
// printf("got frame, bytesused = %d\n", tmp_plane.bytesused);
|
||||
memset(&stFrame, 0, sizeof(VIDEO_FRAME_INFO_S));
|
||||
MB_BLK blk = RK_NULL;
|
||||
blk = RK_MPI_MMZ_Fd2Handle(tmp_plane.m.fd);
|
||||
assert(blk != RK_NULL);
|
||||
stFrame.stVFrame.pMbBlk = blk;
|
||||
stFrame.stVFrame.u32Width = width;
|
||||
stFrame.stVFrame.u32Height = height;
|
||||
// stFrame.stVFrame.u32VirWidth = (width + 15) & (~15);
|
||||
// stFrame.stVFrame.u32VirHeight = (height + 15) & (~15);
|
||||
stFrame.stVFrame.u32VirWidth = RK_ALIGN_2(width);
|
||||
stFrame.stVFrame.u32VirHeight = RK_ALIGN_2(height);
|
||||
stFrame.stVFrame.u32TimeRef = num; // frame number
|
||||
stFrame.stVFrame.u64PTS = get_us();
|
||||
stFrame.stVFrame.enPixelFormat = RK_FMT_YUV422_YUYV;
|
||||
stFrame.stVFrame.u32FrameFlag |= 0;
|
||||
stFrame.stVFrame.enCompressMode = COMPRESS_MODE_NONE;
|
||||
bool retried = false;
|
||||
// if (num == 100) {
|
||||
// RK_VOID *pData = RK_MPI_MB_Handle2VirAddr(stFrame.stVFrame.pMbBlk);
|
||||
// if (pData) {
|
||||
// size_t frameSize = tmp_plane.bytesused; // Use the actual size reported by the driver
|
||||
// write_buffer_to_file(pData, frameSize, "/userdata/banana.raw");
|
||||
// printf("Frame 100 written to /userdata/banana.raw\n");
|
||||
// } else {
|
||||
// printf("Failed to get virtual address for frame 100\n");
|
||||
// }
|
||||
// }
|
||||
retry_send_frame:
|
||||
if (RK_MPI_VENC_SendFrame(VENC_CHANNEL, &stFrame, 2000) != RK_SUCCESS)
|
||||
{
|
||||
if (retried == true)
|
||||
{
|
||||
RK_LOGE("RK_MPI_VENC_SendFrame retry failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
RK_LOGE("RK_MPI_VENC_SendFrame failed,retrying");
|
||||
retried = true;
|
||||
usleep(1000llu);
|
||||
goto retry_send_frame;
|
||||
}
|
||||
}
|
||||
|
||||
num++;
|
||||
|
||||
if (ioctl(video_dev_fd, VIDIOC_QBUF, &buf) < 0)
|
||||
printf("failture VIDIOC_QBUF\n");
|
||||
}
|
||||
cleanup:
|
||||
if (ioctl(video_dev_fd, VIDIOC_STREAMOFF, &type) < 0)
|
||||
{
|
||||
perror("VIDIOC_STREAMOFF failed");
|
||||
}
|
||||
|
||||
venc_stop();
|
||||
|
||||
for (int i = 0; i < input_buffer_count; i++)
|
||||
{
|
||||
if (buffers[i].mb_blk != NULL)
|
||||
{
|
||||
RK_MPI_MB_ReleaseMB((buffers + i)->mb_blk);
|
||||
}
|
||||
}
|
||||
|
||||
close(video_dev_fd);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void video_shutdown()
|
||||
{
|
||||
if (should_exit == true)
|
||||
{
|
||||
printf("shutting down in progress already\n");
|
||||
return;
|
||||
}
|
||||
video_stop_streaming();
|
||||
// if (buffers != NULL) {
|
||||
// for (int i = 0; i < input_buffer_count; i++) {
|
||||
// if ((buffers + i)->mb_blk != NULL) {
|
||||
// RK_MPI_MB_ReleaseMB((buffers + i)->mb_blk);
|
||||
// }
|
||||
// free((buffers + i)->planes_buffer);
|
||||
// }
|
||||
// free(buffers);
|
||||
// }
|
||||
should_exit = true;
|
||||
if (sub_dev_fd > 0)
|
||||
{
|
||||
shutdown(sub_dev_fd, SHUT_RDWR);
|
||||
// close(sub_dev_fd);
|
||||
printf("Closed sub_dev_fd\n");
|
||||
}
|
||||
|
||||
if (memPool != MB_INVALID_POOLID)
|
||||
{
|
||||
RK_MPI_MB_DestroyPool(memPool);
|
||||
}
|
||||
printf("Destroyed memory pool\n");
|
||||
// if (format_thread != NULL) {
|
||||
// pthread_join(*format_thread, NULL);
|
||||
// free(format_thread);
|
||||
// format_thread = NULL;
|
||||
// }
|
||||
// printf("Joined format detection thread\n");
|
||||
}
|
||||
|
||||
// TODO: mutex?
|
||||
|
||||
void video_start_streaming()
|
||||
{
|
||||
if (streaming_thread != NULL)
|
||||
{
|
||||
log_info("video streaming already started");
|
||||
return;
|
||||
}
|
||||
streaming_thread = malloc(sizeof(pthread_t));
|
||||
assert(streaming_thread != NULL);
|
||||
streaming_flag = true;
|
||||
pthread_create(streaming_thread, NULL, run_video_stream, NULL);
|
||||
}
|
||||
|
||||
void video_stop_streaming()
|
||||
{
|
||||
if (streaming_thread != NULL)
|
||||
{
|
||||
streaming_flag = false;
|
||||
pthread_join(*streaming_thread, NULL);
|
||||
free(streaming_thread);
|
||||
streaming_thread = NULL;
|
||||
log_info("video streaming stopped");
|
||||
}
|
||||
}
|
||||
|
||||
void *run_detect_format(void *arg)
|
||||
{
|
||||
struct v4l2_event_subscription sub;
|
||||
struct v4l2_event ev;
|
||||
struct v4l2_dv_timings dv_timings;
|
||||
|
||||
memset(&sub, 0, sizeof(sub));
|
||||
sub.type = V4L2_EVENT_SOURCE_CHANGE;
|
||||
if (ioctl(sub_dev_fd, VIDIOC_SUBSCRIBE_EVENT, &sub) == -1)
|
||||
{
|
||||
log_error("cannot subscribe to event");
|
||||
perror("Cannot subscribe to event");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
while (!should_exit)
|
||||
{
|
||||
memset(&dv_timings, 0, sizeof(dv_timings));
|
||||
if (ioctl(sub_dev_fd, VIDIOC_QUERY_DV_TIMINGS, &dv_timings) != 0)
|
||||
{
|
||||
detected_signal = false;
|
||||
if (errno == ENOLINK)
|
||||
{
|
||||
// No timings could be detected because no signal was found.
|
||||
log_info("HDMI status: no signal");
|
||||
video_report_format(false, "no_signal", 0, 0, 0);
|
||||
}
|
||||
else if (errno == ENOLCK)
|
||||
{
|
||||
// The signal was unstable and the hardware could not lock on to it.
|
||||
log_info("HDMI status: no lock");
|
||||
video_report_format(false, "no_lock", 0, 0, 0);
|
||||
}
|
||||
else if (errno == ERANGE)
|
||||
{
|
||||
// Timings were found, but they are out of range of the hardware capabilities.
|
||||
printf("HDMI status: out of range\n");
|
||||
video_report_format(false, "out_of_range", 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
perror("error VIDIOC_QUERY_DV_TIMINGS");
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
log_info("Active width: %d", dv_timings.bt.width);
|
||||
log_info("Active height: %d", dv_timings.bt.height);
|
||||
double frames_per_second = (double)dv_timings.bt.pixelclock /
|
||||
((dv_timings.bt.height + dv_timings.bt.vfrontporch + dv_timings.bt.vsync +
|
||||
dv_timings.bt.vbackporch) *
|
||||
(dv_timings.bt.width + dv_timings.bt.hfrontporch + dv_timings.bt.hsync +
|
||||
dv_timings.bt.hbackporch));
|
||||
log_info("Frames per second: %.2f fps", frames_per_second);
|
||||
detected_width = dv_timings.bt.width;
|
||||
detected_height = dv_timings.bt.height;
|
||||
detected_signal = true;
|
||||
video_report_format(true, NULL, detected_width, detected_height, frames_per_second);
|
||||
if (streaming_flag == true)
|
||||
{
|
||||
log_info("restarting on going video streaming");
|
||||
video_stop_streaming();
|
||||
video_start_streaming();
|
||||
}
|
||||
}
|
||||
|
||||
memset(&ev, 0, sizeof(ev));
|
||||
if (ioctl(sub_dev_fd, VIDIOC_DQEVENT, &ev) != 0)
|
||||
{
|
||||
log_error("failed to VIDIOC_DQEVENT");
|
||||
perror("failed to VIDIOC_DQEVENT");
|
||||
break;
|
||||
}
|
||||
log_info("New event of type %u", ev.type);
|
||||
if (ev.type != V4L2_EVENT_SOURCE_CHANGE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
log_info("source change detected!");
|
||||
}
|
||||
exit:
|
||||
close(sub_dev_fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void video_set_quality_factor(float factor)
|
||||
{
|
||||
quality_factor = factor;
|
||||
|
||||
// TODO: update venc bitrate without stopping streaming
|
||||
|
||||
if (streaming_flag == true)
|
||||
{
|
||||
log_info("restarting on going video streaming due to quality factor change");
|
||||
video_stop_streaming();
|
||||
video_start_streaming();
|
||||
}
|
||||
}
|
||||
|
||||
float video_get_quality_factor() {
|
||||
return quality_factor;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef VIDEO_DAEMON_VIDEO_H
|
||||
#define VIDEO_DAEMON_VIDEO_H
|
||||
|
||||
int video_init();
|
||||
void video_shutdown();
|
||||
void *run_detect_format(void *arg);
|
||||
void video_start_streaming();
|
||||
void video_stop_streaming();
|
||||
|
||||
void video_set_quality_factor(float factor);
|
||||
float video_get_quality_factor();
|
||||
|
||||
#endif //VIDEO_DAEMON_VIDEO_H
|
||||
|
|
@ -0,0 +1,280 @@
|
|||
//go:build linux
|
||||
|
||||
package native
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -Llib -ljknative -llvgl
|
||||
#cgo CFLAGS: -Iinclude
|
||||
#include "ctrl.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef const char cchar_t;
|
||||
typedef const uint8_t cuint8_t;
|
||||
|
||||
extern void jetkvm_go_log_handler(int level, cchar_t *filename, cchar_t *funcname, int line, cchar_t *message);
|
||||
static inline void jetkvm_cgo_setup_log_handler() {
|
||||
jetkvm_set_log_handler(&jetkvm_go_log_handler);
|
||||
}
|
||||
|
||||
extern void jetkvm_go_video_state_handler(jetkvm_video_state_t *state);
|
||||
static inline void jetkvm_cgo_setup_video_state_handler() {
|
||||
jetkvm_set_video_state_handler(&jetkvm_go_video_state_handler);
|
||||
}
|
||||
|
||||
extern void jetkvm_go_video_handler(cuint8_t *frame, ssize_t len);
|
||||
static inline void jetkvm_cgo_setup_video_handler() {
|
||||
jetkvm_set_video_handler(&jetkvm_go_video_handler);
|
||||
}
|
||||
|
||||
extern void jetkvm_go_indev_handler(int code);
|
||||
static inline void jetkvm_cgo_setup_indev_handler() {
|
||||
jetkvm_set_indev_handler(&jetkvm_go_indev_handler);
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
//export jetkvm_go_video_state_handler
|
||||
func jetkvm_go_video_state_handler(state *C.jetkvm_video_state_t) {
|
||||
videoState := VideoState{
|
||||
Ready: bool(state.ready),
|
||||
Error: C.GoString(state.error),
|
||||
Width: int(state.width),
|
||||
Height: int(state.height),
|
||||
FramePerSecond: float64(state.frame_per_second),
|
||||
}
|
||||
videoStateChan <- videoState
|
||||
}
|
||||
|
||||
//export jetkvm_go_log_handler
|
||||
func jetkvm_go_log_handler(level C.int, filename *C.cchar_t, funcname *C.cchar_t, line C.int, message *C.cchar_t) {
|
||||
logMessage := nativeLogMessage{
|
||||
Level: zerolog.Level(level),
|
||||
Message: C.GoString(message),
|
||||
File: C.GoString(filename),
|
||||
FuncName: C.GoString(funcname),
|
||||
Line: int(line),
|
||||
}
|
||||
|
||||
logChan <- logMessage
|
||||
}
|
||||
|
||||
//export jetkvm_go_video_handler
|
||||
func jetkvm_go_video_handler(frame *C.cuint8_t, len C.ssize_t) {
|
||||
videoFrameChan <- C.GoBytes(unsafe.Pointer(frame), C.int(len))
|
||||
}
|
||||
|
||||
//export jetkvm_go_indev_handler
|
||||
func jetkvm_go_indev_handler(code C.int) {
|
||||
indevEventChan <- int(code)
|
||||
}
|
||||
|
||||
var eventCodeToNameMap = map[int]string{}
|
||||
|
||||
func uiEventCodeToName(code int) string {
|
||||
name, ok := eventCodeToNameMap[code]
|
||||
if !ok {
|
||||
cCode := C.int(code)
|
||||
cName := C.jetkvm_ui_event_code_to_name(cCode)
|
||||
name = C.GoString(cName)
|
||||
eventCodeToNameMap[code] = name
|
||||
}
|
||||
|
||||
return name
|
||||
}
|
||||
|
||||
func setUpNativeHandlers() {
|
||||
C.jetkvm_cgo_setup_log_handler()
|
||||
C.jetkvm_cgo_setup_video_state_handler()
|
||||
C.jetkvm_cgo_setup_video_handler()
|
||||
C.jetkvm_cgo_setup_indev_handler()
|
||||
}
|
||||
|
||||
func uiInit(rotation uint16) {
|
||||
cRotation := C.u_int16_t(rotation)
|
||||
defer C.free(unsafe.Pointer(&cRotation))
|
||||
|
||||
C.jetkvm_ui_init(cRotation)
|
||||
}
|
||||
|
||||
func uiTick() {
|
||||
C.jetkvm_ui_tick()
|
||||
}
|
||||
|
||||
func videoInit() error {
|
||||
ret := C.jetkvm_video_init()
|
||||
if ret != 0 {
|
||||
return fmt.Errorf("failed to initialize video: %d", ret)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func videoShutdown() {
|
||||
C.jetkvm_video_shutdown()
|
||||
}
|
||||
|
||||
func videoStart() {
|
||||
C.jetkvm_video_start()
|
||||
}
|
||||
|
||||
func videoStop() {
|
||||
C.jetkvm_video_stop()
|
||||
}
|
||||
|
||||
func uiSetVar(name string, value string) {
|
||||
nameCStr := C.CString(name)
|
||||
defer C.free(unsafe.Pointer(nameCStr))
|
||||
|
||||
valueCStr := C.CString(value)
|
||||
defer C.free(unsafe.Pointer(valueCStr))
|
||||
|
||||
C.jetkvm_ui_set_var(nameCStr, valueCStr)
|
||||
}
|
||||
|
||||
func uiGetVar(name string) string {
|
||||
nameCStr := C.CString(name)
|
||||
defer C.free(unsafe.Pointer(nameCStr))
|
||||
|
||||
return C.GoString(C.jetkvm_ui_get_var(nameCStr))
|
||||
}
|
||||
|
||||
func uiSwitchToScreen(screen string) {
|
||||
screenCStr := C.CString(screen)
|
||||
defer C.free(unsafe.Pointer(screenCStr))
|
||||
C.jetkvm_ui_load_screen(screenCStr)
|
||||
}
|
||||
|
||||
func uiGetCurrentScreen() string {
|
||||
screenCStr := C.jetkvm_ui_get_current_screen()
|
||||
return C.GoString(screenCStr)
|
||||
}
|
||||
|
||||
func uiObjSetState(objName string, state string) (bool, error) {
|
||||
objNameCStr := C.CString(objName)
|
||||
defer C.free(unsafe.Pointer(objNameCStr))
|
||||
stateCStr := C.CString(state)
|
||||
defer C.free(unsafe.Pointer(stateCStr))
|
||||
C.jetkvm_ui_set_state(objNameCStr, stateCStr)
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func uiGetLVGLVersion() string {
|
||||
return C.GoString(C.jetkvm_ui_get_lvgl_version())
|
||||
}
|
||||
|
||||
// TODO: use Enum instead of string but it's not a hot path and performance is not a concern now
|
||||
func uiObjAddFlag(objName string, flag string) (bool, error) {
|
||||
objNameCStr := C.CString(objName)
|
||||
defer C.free(unsafe.Pointer(objNameCStr))
|
||||
flagCStr := C.CString(flag)
|
||||
defer C.free(unsafe.Pointer(flagCStr))
|
||||
C.jetkvm_ui_add_flag(objNameCStr, flagCStr)
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func uiObjClearFlag(objName string, flag string) (bool, error) {
|
||||
objNameCStr := C.CString(objName)
|
||||
defer C.free(unsafe.Pointer(objNameCStr))
|
||||
flagCStr := C.CString(flag)
|
||||
defer C.free(unsafe.Pointer(flagCStr))
|
||||
C.jetkvm_ui_clear_flag(objNameCStr, flagCStr)
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func uiObjHide(objName string) (bool, error) {
|
||||
return uiObjAddFlag(objName, "LV_OBJ_FLAG_HIDDEN")
|
||||
}
|
||||
|
||||
func uiObjShow(objName string) (bool, error) {
|
||||
return uiObjClearFlag(objName, "LV_OBJ_FLAG_HIDDEN")
|
||||
}
|
||||
|
||||
func uiObjSetOpacity(objName string, opacity int) (bool, error) {
|
||||
objNameCStr := C.CString(objName)
|
||||
defer C.free(unsafe.Pointer(objNameCStr))
|
||||
|
||||
C.jetkvm_ui_set_opacity(objNameCStr, C.u_int8_t(opacity))
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func uiObjFadeIn(objName string, duration uint32) (bool, error) {
|
||||
objNameCStr := C.CString(objName)
|
||||
defer C.free(unsafe.Pointer(objNameCStr))
|
||||
|
||||
C.jetkvm_ui_fade_in(objNameCStr, C.u_int32_t(duration))
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func uiObjFadeOut(objName string, duration uint32) (bool, error) {
|
||||
objNameCStr := C.CString(objName)
|
||||
defer C.free(unsafe.Pointer(objNameCStr))
|
||||
|
||||
C.jetkvm_ui_fade_out(objNameCStr, C.u_int32_t(duration))
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func uiLabelSetText(objName string, text string) (bool, error) {
|
||||
objNameCStr := C.CString(objName)
|
||||
defer C.free(unsafe.Pointer(objNameCStr))
|
||||
|
||||
textCStr := C.CString(text)
|
||||
defer C.free(unsafe.Pointer(textCStr))
|
||||
|
||||
ret := C.jetkvm_ui_set_text(objNameCStr, textCStr)
|
||||
if ret < 0 {
|
||||
return false, fmt.Errorf("failed to set text: %d", ret)
|
||||
}
|
||||
return ret == 0, nil
|
||||
}
|
||||
|
||||
func uiImgSetSrc(objName string, src string) (bool, error) {
|
||||
objNameCStr := C.CString(objName)
|
||||
defer C.free(unsafe.Pointer(objNameCStr))
|
||||
|
||||
srcCStr := C.CString(src)
|
||||
defer C.free(unsafe.Pointer(srcCStr))
|
||||
|
||||
C.jetkvm_ui_set_image(objNameCStr, srcCStr)
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func uiDispSetRotation(rotation uint16) (bool, error) {
|
||||
nativeLogger.Info().Uint16("rotation", rotation).Msg("setting rotation")
|
||||
|
||||
cRotation := C.u_int16_t(rotation)
|
||||
defer C.free(unsafe.Pointer(&cRotation))
|
||||
|
||||
C.jetkvm_ui_set_rotation(cRotation)
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func videoGetStreamQualityFactor() (float64, error) {
|
||||
factor := C.jetkvm_video_get_quality_factor()
|
||||
return float64(factor), nil
|
||||
}
|
||||
|
||||
func videoSetStreamQualityFactor(factor float64) error {
|
||||
C.jetkvm_video_set_quality_factor(C.float(factor))
|
||||
return nil
|
||||
}
|
||||
|
||||
func videoGetEDID() (string, error) {
|
||||
edidCStr := C.jetkvm_video_get_edid_hex()
|
||||
return C.GoString(edidCStr), nil
|
||||
}
|
||||
|
||||
func videoSetEDID(edid string) error {
|
||||
edidCStr := C.CString(edid)
|
||||
defer C.free(unsafe.Pointer(edidCStr))
|
||||
C.jetkvm_video_set_edid(edidCStr)
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
//go:build !linux
|
||||
|
||||
package native
|
||||
|
||||
func panicPlatformNotSupported() {
|
||||
panic("platform not supported")
|
||||
}
|
||||
|
||||
func setUpNativeHandlers() {
|
||||
panicPlatformNotSupported()
|
||||
}
|
||||
|
||||
func uiSetVar(name string, value string) {
|
||||
panicPlatformNotSupported()
|
||||
}
|
||||
|
||||
func uiGetVar(name string) string {
|
||||
panicPlatformNotSupported()
|
||||
return ""
|
||||
}
|
||||
|
||||
func uiSwitchToScreen(screen string) {
|
||||
panicPlatformNotSupported()
|
||||
}
|
||||
|
||||
func uiGetCurrentScreen() string {
|
||||
panicPlatformNotSupported()
|
||||
return ""
|
||||
}
|
||||
|
||||
func uiObjSetState(objName string, state string) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiObjAddFlag(objName string, flag string) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiObjClearFlag(objName string, flag string) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiObjHide(objName string) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiObjShow(objName string) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiObjSetOpacity(objName string, opacity int) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiObjFadeIn(objName string, duration uint32) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiObjFadeOut(objName string, duration uint32) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiLabelSetText(objName string, text string) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiImgSetSrc(objName string, src string) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiDispSetRotation(rotation uint16) (bool, error) {
|
||||
panicPlatformNotSupported()
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func uiEventCodeToName(code int) string {
|
||||
panicPlatformNotSupported()
|
||||
return ""
|
||||
}
|
||||
|
||||
func uiGetLVGLVersion() string {
|
||||
panicPlatformNotSupported()
|
||||
return ""
|
||||
}
|
||||
|
||||
func videoGetStreamQualityFactor() (float64, error) {
|
||||
panicPlatformNotSupported()
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
func videoSetStreamQualityFactor(factor float64) error {
|
||||
panicPlatformNotSupported()
|
||||
return nil
|
||||
}
|
||||
|
||||
func videoGetEDID() (string, error) {
|
||||
panicPlatformNotSupported()
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func videoSetEDID(edid string) error {
|
||||
panicPlatformNotSupported()
|
||||
return nil
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package native
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
var (
|
||||
videoFrameChan chan []byte = make(chan []byte)
|
||||
videoStateChan chan VideoState = make(chan VideoState)
|
||||
logChan chan nativeLogMessage = make(chan nativeLogMessage)
|
||||
indevEventChan chan int = make(chan int)
|
||||
)
|
||||
|
||||
func (n *Native) handleVideoFrameChan() {
|
||||
lastFrame := time.Now()
|
||||
for {
|
||||
frame := <-videoFrameChan
|
||||
now := time.Now()
|
||||
sinceLastFrame := now.Sub(lastFrame)
|
||||
lastFrame = now
|
||||
n.onVideoFrameReceived(frame, sinceLastFrame)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *Native) handleVideoStateChan() {
|
||||
for {
|
||||
state := <-videoStateChan
|
||||
n.onVideoStateChange(state)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *Native) handleLogChan() {
|
||||
for {
|
||||
entry := <-logChan
|
||||
l := n.l.With().
|
||||
Str("file", entry.File).
|
||||
Str("func", entry.FuncName).
|
||||
Int("line", entry.Line).
|
||||
Logger()
|
||||
|
||||
switch entry.Level {
|
||||
case zerolog.DebugLevel:
|
||||
l.Debug().Msg(entry.Message)
|
||||
case zerolog.InfoLevel:
|
||||
l.Info().Msg(entry.Message)
|
||||
case zerolog.WarnLevel:
|
||||
l.Warn().Msg(entry.Message)
|
||||
case zerolog.ErrorLevel:
|
||||
l.Error().Msg(entry.Message)
|
||||
case zerolog.PanicLevel:
|
||||
l.Panic().Msg(entry.Message)
|
||||
case zerolog.FatalLevel:
|
||||
l.Fatal().Msg(entry.Message)
|
||||
case zerolog.TraceLevel:
|
||||
l.Trace().Msg(entry.Message)
|
||||
case zerolog.NoLevel:
|
||||
l.Info().Msg(entry.Message)
|
||||
default:
|
||||
l.Info().Msg(entry.Message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (n *Native) handleIndevEventChan() {
|
||||
for {
|
||||
event := <-indevEventChan
|
||||
name := uiEventCodeToName(event)
|
||||
n.onIndevEvent(name)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
cgo/ctrl.h
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
package native
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (n *Native) setUIVars() {
|
||||
uiSetVar("app_version", n.appVersion.String())
|
||||
uiSetVar("system_version", n.systemVersion.String())
|
||||
}
|
||||
|
||||
func (n *Native) initUI() {
|
||||
uiInit(n.displayRotation)
|
||||
n.setUIVars()
|
||||
}
|
||||
|
||||
func (n *Native) tickUI() {
|
||||
for {
|
||||
uiTick()
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
// GetLVGLVersion returns the LVGL version
|
||||
func (n *Native) GetLVGLVersion() (string, error) {
|
||||
return uiGetLVGLVersion(), nil
|
||||
}
|
||||
|
||||
// UIObjHide hides the object
|
||||
func (n *Native) UIObjHide(objName string) (bool, error) {
|
||||
return uiObjHide(objName)
|
||||
}
|
||||
|
||||
// UIObjShow shows the object
|
||||
func (n *Native) UIObjShow(objName string) (bool, error) {
|
||||
return uiObjShow(objName)
|
||||
}
|
||||
|
||||
// UIObjSetState clears the state then adds the new state
|
||||
func (n *Native) UIObjSetState(objName string, state string) (bool, error) {
|
||||
return uiObjSetState(objName, state)
|
||||
}
|
||||
|
||||
// UIObjAddFlag adds the flag to the object
|
||||
func (n *Native) UIObjAddFlag(objName string, flag string) (bool, error) {
|
||||
return uiObjAddFlag(objName, flag)
|
||||
}
|
||||
|
||||
// UIObjClearFlag clears the flag from the object
|
||||
func (n *Native) UIObjClearFlag(objName string, flag string) (bool, error) {
|
||||
return uiObjClearFlag(objName, flag)
|
||||
}
|
||||
|
||||
// UIObjSetOpacity sets the opacity of the object
|
||||
func (n *Native) UIObjSetOpacity(objName string, opacity int) (bool, error) {
|
||||
return uiObjSetOpacity(objName, opacity)
|
||||
}
|
||||
|
||||
// UIObjFadeIn fades in the object
|
||||
func (n *Native) UIObjFadeIn(objName string, duration uint32) (bool, error) {
|
||||
return uiObjFadeIn(objName, duration)
|
||||
}
|
||||
|
||||
// UIObjFadeOut fades out the object
|
||||
func (n *Native) UIObjFadeOut(objName string, duration uint32) (bool, error) {
|
||||
return uiObjFadeOut(objName, duration)
|
||||
}
|
||||
|
||||
// UIObjSetLabelText sets the text of the object
|
||||
func (n *Native) UIObjSetLabelText(objName string, text string) (bool, error) {
|
||||
return uiLabelSetText(objName, text)
|
||||
}
|
||||
|
||||
// UIObjSetImageSrc sets the image of the object
|
||||
func (n *Native) UIObjSetImageSrc(objName string, image string) (bool, error) {
|
||||
return uiImgSetSrc(objName, image)
|
||||
}
|
||||
|
||||
// DisplaySetRotation sets the rotation of the display
|
||||
func (n *Native) DisplaySetRotation(rotation uint16) (bool, error) {
|
||||
return uiDispSetRotation(rotation)
|
||||
}
|
||||
|
||||
// UpdateLabelIfChanged updates the label if the text has changed
|
||||
func (n *Native) UpdateLabelIfChanged(objName string, newText string) {
|
||||
l := n.lD.Trace().Str("obj", objName).Str("text", newText)
|
||||
|
||||
changed, err := n.UIObjSetLabelText(objName, newText)
|
||||
if err != nil {
|
||||
n.lD.Warn().Str("obj", objName).Str("text", newText).Err(err).Msg("failed to update label")
|
||||
return
|
||||
}
|
||||
|
||||
if changed {
|
||||
l.Msg("label changed")
|
||||
} else {
|
||||
l.Msg("label not changed")
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateLabelAndChangeVisibility updates the label and changes the visibility of the object
|
||||
func (n *Native) UpdateLabelAndChangeVisibility(objName string, newText string) {
|
||||
containerName := objName + "_container"
|
||||
if newText == "" {
|
||||
_, _ = n.UIObjHide(objName)
|
||||
_, _ = n.UIObjHide(containerName)
|
||||
} else {
|
||||
_, _ = n.UIObjShow(objName)
|
||||
_, _ = n.UIObjShow(containerName)
|
||||
}
|
||||
|
||||
n.UpdateLabelIfChanged(objName, newText)
|
||||
}
|
||||
|
||||
// SwitchToScreenIf switches to the screen if the screen name is different from the current screen and the screen name is in the shouldSwitch list
|
||||
func (n *Native) SwitchToScreenIf(screenName string, shouldSwitch []string) {
|
||||
currentScreen := uiGetCurrentScreen()
|
||||
if currentScreen == screenName {
|
||||
return
|
||||
}
|
||||
if !slices.Contains(shouldSwitch, currentScreen) {
|
||||
n.lD.Trace().Str("from", currentScreen).Str("to", screenName).Msg("skipping screen switch")
|
||||
return
|
||||
}
|
||||
n.lD.Info().Str("from", currentScreen).Str("to", screenName).Msg("switching screen")
|
||||
uiSwitchToScreen(screenName)
|
||||
}
|
||||
|
||||
// SwitchToScreenIfDifferent switches to the screen if the screen name is different from the current screen
|
||||
func (n *Native) SwitchToScreenIfDifferent(screenName string) {
|
||||
n.SwitchToScreenIf(screenName, []string{})
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
src/ui
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,17 @@
|
|||
package native
|
||||
|
||||
import (
|
||||
"github.com/jetkvm/kvm/internal/logging"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
var nativeLogger = logging.GetSubsystemLogger("native")
|
||||
var displayLogger = logging.GetSubsystemLogger("display")
|
||||
|
||||
type nativeLogMessage struct {
|
||||
Level zerolog.Level
|
||||
Message string
|
||||
File string
|
||||
FuncName string
|
||||
Line int
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package native
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
type Native struct {
|
||||
ready chan struct{}
|
||||
l *zerolog.Logger
|
||||
lD *zerolog.Logger
|
||||
systemVersion *semver.Version
|
||||
appVersion *semver.Version
|
||||
displayRotation uint16
|
||||
onVideoStateChange func(state VideoState)
|
||||
onVideoFrameReceived func(frame []byte, duration time.Duration)
|
||||
onIndevEvent func(event string)
|
||||
}
|
||||
|
||||
type NativeOptions struct {
|
||||
SystemVersion *semver.Version
|
||||
AppVersion *semver.Version
|
||||
DisplayRotation uint16
|
||||
OnVideoStateChange func(state VideoState)
|
||||
OnVideoFrameReceived func(frame []byte, duration time.Duration)
|
||||
OnIndevEvent func(event string)
|
||||
}
|
||||
|
||||
func NewNative(opts NativeOptions) *Native {
|
||||
onVideoStateChange := opts.OnVideoStateChange
|
||||
if onVideoStateChange == nil {
|
||||
onVideoStateChange = func(state VideoState) {
|
||||
nativeLogger.Info().Msg("video state changed")
|
||||
}
|
||||
}
|
||||
|
||||
onVideoFrameReceived := opts.OnVideoFrameReceived
|
||||
if onVideoFrameReceived == nil {
|
||||
onVideoFrameReceived = func(frame []byte, duration time.Duration) {
|
||||
nativeLogger.Info().Msg("video frame received")
|
||||
}
|
||||
}
|
||||
|
||||
onIndevEvent := opts.OnIndevEvent
|
||||
if onIndevEvent == nil {
|
||||
onIndevEvent = func(event string) {
|
||||
nativeLogger.Info().Str("event", event).Msg("indev event")
|
||||
}
|
||||
}
|
||||
|
||||
return &Native{
|
||||
ready: make(chan struct{}),
|
||||
l: nativeLogger,
|
||||
lD: displayLogger,
|
||||
systemVersion: opts.SystemVersion,
|
||||
appVersion: opts.AppVersion,
|
||||
displayRotation: opts.DisplayRotation,
|
||||
onVideoStateChange: opts.OnVideoStateChange,
|
||||
onVideoFrameReceived: opts.OnVideoFrameReceived,
|
||||
onIndevEvent: opts.OnIndevEvent,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *Native) Start() {
|
||||
// set up singleton
|
||||
setInstance(n)
|
||||
setUpNativeHandlers()
|
||||
|
||||
// start the native video
|
||||
go n.handleLogChan()
|
||||
go n.handleVideoStateChan()
|
||||
go n.handleVideoFrameChan()
|
||||
go n.handleIndevEventChan()
|
||||
|
||||
n.initUI()
|
||||
go n.tickUI()
|
||||
|
||||
close(n.ready)
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package native
|
||||
|
||||
import "sync"
|
||||
|
||||
var (
|
||||
instance *Native
|
||||
instanceLock sync.RWMutex
|
||||
)
|
||||
|
||||
func setInstance(n *Native) {
|
||||
instanceLock.Lock()
|
||||
defer instanceLock.Unlock()
|
||||
|
||||
if instance == nil {
|
||||
instance = n
|
||||
}
|
||||
|
||||
if instance != n {
|
||||
panic("instance is already set")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package native
|
||||
|
||||
type VideoState struct {
|
||||
Ready bool `json:"ready"`
|
||||
Error string `json:"error,omitempty"` //no_signal, no_lock, out_of_range
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
FramePerSecond float64 `json:"fps"`
|
||||
}
|
||||
|
||||
func (n *Native) VideoSetQualityFactor(factor float64) error {
|
||||
return videoSetStreamQualityFactor(factor)
|
||||
}
|
||||
|
||||
func (n *Native) VideoGetQualityFactor() (float64, error) {
|
||||
return videoGetStreamQualityFactor()
|
||||
}
|
||||
|
||||
func (n *Native) VideoSetEDID(edid string) error {
|
||||
return videoSetEDID(edid)
|
||||
}
|
||||
|
||||
func (n *Native) VideoGetEDID() (string, error) {
|
||||
return videoGetEDID()
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ type NetworkConfig struct {
|
|||
IPv6Mode null.String `json:"ipv6_mode,omitempty" one_of:"slaac,dhcpv6,slaac_and_dhcpv6,static,link_local,disabled" default:"slaac"`
|
||||
IPv6Static *IPv6StaticConfig `json:"ipv6_static,omitempty" required_if:"IPv6Mode=static"`
|
||||
|
||||
LLDPMode null.String `json:"lldp_mode,omitempty" one_of:"disabled,basic,all" default:"basic"`
|
||||
LLDPMode null.String `json:"lldp_mode,omitempty" one_of:"disabled,rx_only,tx_only,basic,all,enabled" default:"enabled"`
|
||||
LLDPTxTLVs []string `json:"lldp_tx_tlvs,omitempty" one_of:"chassis,port,system,vlan" default:"chassis,port,system,vlan"`
|
||||
MDNSMode null.String `json:"mdns_mode,omitempty" one_of:"disabled,auto,ipv4_only,ipv6_only" default:"auto"`
|
||||
TimeSyncMode null.String `json:"time_sync_mode,omitempty" one_of:"ntp_only,ntp_and_http,http_only,custom" default:"ntp_and_http"`
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package network
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/jetkvm/kvm/internal/lldp"
|
||||
)
|
||||
|
||||
func (s *NetworkInterfaceState) shouldStartLLDP() bool {
|
||||
if s.lldp == nil {
|
||||
s.l.Trace().Msg("LLDP not initialized")
|
||||
return false
|
||||
}
|
||||
|
||||
s.l.Trace().Msgf("LLDP mode: %s", s.config.LLDPMode.String)
|
||||
|
||||
return s.config.LLDPMode.String != "disabled"
|
||||
}
|
||||
|
||||
func (s *NetworkInterfaceState) startLLDP() {
|
||||
if !s.shouldStartLLDP() || s.lldp == nil {
|
||||
return
|
||||
}
|
||||
|
||||
s.l.Trace().Msg("starting LLDP")
|
||||
if err := s.lldp.Start(); err != nil {
|
||||
s.l.Error().Err(err).Msg("unable to start LLDP")
|
||||
}
|
||||
}
|
||||
|
||||
func (s *NetworkInterfaceState) stopLLDP() {
|
||||
if s.lldp == nil {
|
||||
return
|
||||
}
|
||||
s.l.Trace().Msg("stopping LLDP")
|
||||
if err := s.lldp.Stop(); err != nil {
|
||||
s.l.Error().Err(err).Msg("unable to stop LLDP")
|
||||
}
|
||||
}
|
||||
|
||||
func (s *NetworkInterfaceState) GetLLDPNeighbors() ([]lldp.Neighbor, error) {
|
||||
if s.lldp == nil {
|
||||
return nil, errors.New("lldp not initialized")
|
||||
}
|
||||
return s.lldp.GetNeighbors(), nil
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"sync"
|
||||
|
||||
"github.com/jetkvm/kvm/internal/confparser"
|
||||
"github.com/jetkvm/kvm/internal/lldp"
|
||||
"github.com/jetkvm/kvm/internal/logging"
|
||||
"github.com/jetkvm/kvm/internal/udhcpc"
|
||||
"github.com/rs/zerolog"
|
||||
|
|
@ -30,6 +31,8 @@ type NetworkInterfaceState struct {
|
|||
config *NetworkConfig
|
||||
dhcpClient *udhcpc.DHCPClient
|
||||
|
||||
lldp *lldp.LLDP
|
||||
|
||||
defaultHostname string
|
||||
currentHostname string
|
||||
currentFqdn string
|
||||
|
|
@ -98,8 +101,24 @@ func NewNetworkInterfaceState(opts *NetworkInterfaceOptions) (*NetworkInterfaceS
|
|||
},
|
||||
})
|
||||
|
||||
s.dhcpClient = dhcpClient
|
||||
// create the lldp service
|
||||
lldpClient := lldp.NewLLDP(&lldp.LLDPOptions{
|
||||
InterfaceName: opts.InterfaceName,
|
||||
EnableRx: true,
|
||||
EnableTx: true,
|
||||
Logger: l,
|
||||
})
|
||||
|
||||
// create the lldp service
|
||||
lldpClient = lldp.NewLLDP(&lldp.LLDPOptions{
|
||||
InterfaceName: opts.InterfaceName,
|
||||
EnableRx: true,
|
||||
EnableTx: true,
|
||||
Logger: l,
|
||||
})
|
||||
|
||||
s.dhcpClient = dhcpClient
|
||||
s.lldp = lldpClient
|
||||
return s, nil
|
||||
}
|
||||
|
||||
|
|
@ -339,9 +358,9 @@ func (s *NetworkInterfaceState) update() (DhcpTargetState, error) {
|
|||
}
|
||||
|
||||
if initialCheck {
|
||||
s.onInitialCheck(s)
|
||||
s.handleInitialCheck()
|
||||
} else if changed {
|
||||
s.onStateChange(s)
|
||||
s.handleStateChange()
|
||||
}
|
||||
|
||||
return dhcpTargetState, nil
|
||||
|
|
@ -366,6 +385,22 @@ func (s *NetworkInterfaceState) updateNtpServersFromLease(lease *udhcpc.Lease) e
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *NetworkInterfaceState) handleInitialCheck() {
|
||||
if s.IsUp() {
|
||||
s.startLLDP()
|
||||
}
|
||||
s.onInitialCheck(s)
|
||||
}
|
||||
|
||||
func (s *NetworkInterfaceState) handleStateChange() {
|
||||
if s.IsUp() {
|
||||
s.startLLDP()
|
||||
} else {
|
||||
s.stopLLDP()
|
||||
}
|
||||
s.onStateChange(s)
|
||||
}
|
||||
|
||||
func (s *NetworkInterfaceState) CheckAndUpdateDhcp() error {
|
||||
dhcpTargetState, err := s.update()
|
||||
if err != nil {
|
||||
|
|
|
|||
40
jsonrpc.go
40
jsonrpc.go
|
|
@ -204,7 +204,7 @@ func rpcGetStreamQualityFactor() (float64, error) {
|
|||
|
||||
func rpcSetStreamQualityFactor(factor float64) error {
|
||||
logger.Info().Float64("factor", factor).Msg("Setting stream quality factor")
|
||||
var _, err = CallCtrlAction("set_video_quality_factor", map[string]any{"quality_factor": factor})
|
||||
err := nativeInstance.VideoSetQualityFactor(factor)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -226,15 +226,11 @@ func rpcSetAutoUpdateState(enabled bool) (bool, error) {
|
|||
}
|
||||
|
||||
func rpcGetEDID() (string, error) {
|
||||
resp, err := CallCtrlAction("get_edid", nil)
|
||||
resp, err := nativeInstance.VideoGetEDID()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
edid, ok := resp.Result["edid"]
|
||||
if ok {
|
||||
return edid.(string), nil
|
||||
}
|
||||
return "", errors.New("EDID not found in response")
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func rpcSetEDID(edid string) error {
|
||||
|
|
@ -244,7 +240,7 @@ func rpcSetEDID(edid string) error {
|
|||
} else {
|
||||
logger.Info().Str("edid", edid).Msg("Setting EDID")
|
||||
}
|
||||
_, err := CallCtrlAction("set_edid", map[string]any{"edid": edid})
|
||||
err := nativeInstance.VideoSetEDID(edid)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -305,14 +301,25 @@ func rpcTryUpdate() error {
|
|||
}
|
||||
|
||||
func rpcSetDisplayRotation(params DisplayRotationSettings) error {
|
||||
var err error
|
||||
_, err = lvDispSetRotation(params.Rotation)
|
||||
if err == nil {
|
||||
config.DisplayRotation = params.Rotation
|
||||
if err := SaveConfig(); err != nil {
|
||||
return fmt.Errorf("failed to save config: %w", err)
|
||||
}
|
||||
currentRotation := config.DisplayRotation
|
||||
if currentRotation == params.Rotation {
|
||||
return nil
|
||||
}
|
||||
|
||||
err := config.SetDisplayRotation(params.Rotation)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = nativeInstance.DisplaySetRotation(config.GetDisplayRotation())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := SaveConfig(); err != nil {
|
||||
return fmt.Errorf("failed to save config: %w", err)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -356,7 +363,7 @@ func rpcSetBacklightSettings(params BacklightSettings) error {
|
|||
// are reset to the new settings, and will bring the display up to maxBrightness.
|
||||
// Calling with force set to true, to ignore the current state of the display, and force
|
||||
// it to reset the tickers.
|
||||
wakeDisplay(true)
|
||||
wakeDisplay(true, "backlight_settings_changed")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1252,4 +1259,5 @@ var rpcHandlers = map[string]RPCHandler{
|
|||
"setKeyboardMacros": {Func: setKeyboardMacros, Params: []string{"params"}},
|
||||
"getLocalLoopbackOnly": {Func: rpcGetLocalLoopbackOnly},
|
||||
"setLocalLoopbackOnly": {Func: rpcSetLocalLoopbackOnly, Params: []string{"enabled"}},
|
||||
"getLLDPNeighbors": {Func: rpcGetLLDPNeighbors},
|
||||
}
|
||||
|
|
|
|||
16
main.go
16
main.go
|
|
@ -33,6 +33,8 @@ func Main() {
|
|||
go runWatchdog()
|
||||
go confirmCurrentSystem()
|
||||
|
||||
initNative(systemVersionLocal, appVersionLocal)
|
||||
|
||||
http.DefaultClient.Timeout = 1 * time.Minute
|
||||
|
||||
err = rootcerts.UpdateDefaultTransport()
|
||||
|
|
@ -59,22 +61,8 @@ func Main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Initialize native ctrl socket server
|
||||
StartNativeCtrlSocketServer()
|
||||
|
||||
// Initialize native video socket server
|
||||
StartNativeVideoSocketServer()
|
||||
|
||||
initPrometheus()
|
||||
|
||||
go func() {
|
||||
err = ExtractAndRunNativeBin()
|
||||
if err != nil {
|
||||
logger.Warn().Err(err).Msg("failed to extract and run native bin")
|
||||
//TODO: prepare an error message screen buffer to show on kvm screen
|
||||
}
|
||||
}()
|
||||
|
||||
// initialize usb gadget
|
||||
initUsbGadget()
|
||||
if err := setInitialVirtualMediaState(); err != nil {
|
||||
|
|
|
|||
447
native.go
447
native.go
|
|
@ -1,437 +1,38 @@
|
|||
package kvm
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/jetkvm/kvm/resource"
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/jetkvm/kvm/internal/native"
|
||||
"github.com/pion/webrtc/v4/pkg/media"
|
||||
)
|
||||
|
||||
var ctrlSocketConn net.Conn
|
||||
var nativeInstance *native.Native
|
||||
|
||||
type CtrlAction struct {
|
||||
Action string `json:"action"`
|
||||
Seq int32 `json:"seq,omitempty"`
|
||||
Params map[string]any `json:"params,omitempty"`
|
||||
}
|
||||
func initNative(systemVersion *semver.Version, appVersion *semver.Version) {
|
||||
|
||||
type CtrlResponse struct {
|
||||
Seq int32 `json:"seq,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Errno int32 `json:"errno,omitempty"`
|
||||
Result map[string]any `json:"result,omitempty"`
|
||||
Event string `json:"event,omitempty"`
|
||||
Data json.RawMessage `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
type EventHandler func(event CtrlResponse)
|
||||
|
||||
var seq int32 = 1
|
||||
|
||||
var ongoingRequests = make(map[int32]chan *CtrlResponse)
|
||||
|
||||
var lock = &sync.Mutex{}
|
||||
|
||||
var (
|
||||
nativeCmd *exec.Cmd
|
||||
nativeCmdLock = &sync.Mutex{}
|
||||
)
|
||||
|
||||
func CallCtrlAction(action string, params map[string]any) (*CtrlResponse, error) {
|
||||
lock.Lock()
|
||||
defer lock.Unlock()
|
||||
ctrlAction := CtrlAction{
|
||||
Action: action,
|
||||
Seq: seq,
|
||||
Params: params,
|
||||
}
|
||||
|
||||
responseChan := make(chan *CtrlResponse)
|
||||
ongoingRequests[seq] = responseChan
|
||||
seq++
|
||||
|
||||
jsonData, err := json.Marshal(ctrlAction)
|
||||
if err != nil {
|
||||
delete(ongoingRequests, ctrlAction.Seq)
|
||||
return nil, fmt.Errorf("error marshaling ctrl action: %w", err)
|
||||
}
|
||||
|
||||
scopedLogger := nativeLogger.With().
|
||||
Str("action", ctrlAction.Action).
|
||||
Interface("params", ctrlAction.Params).Logger()
|
||||
|
||||
scopedLogger.Debug().Msg("sending ctrl action")
|
||||
|
||||
err = WriteCtrlMessage(jsonData)
|
||||
if err != nil {
|
||||
delete(ongoingRequests, ctrlAction.Seq)
|
||||
return nil, ErrorfL(&scopedLogger, "error writing ctrl message", err)
|
||||
}
|
||||
|
||||
select {
|
||||
case response := <-responseChan:
|
||||
delete(ongoingRequests, seq)
|
||||
if response.Error != "" {
|
||||
return nil, ErrorfL(
|
||||
&scopedLogger,
|
||||
"error native response: %s",
|
||||
errors.New(response.Error),
|
||||
)
|
||||
}
|
||||
return response, nil
|
||||
case <-time.After(5 * time.Second):
|
||||
close(responseChan)
|
||||
delete(ongoingRequests, seq)
|
||||
return nil, ErrorfL(&scopedLogger, "timeout waiting for response", nil)
|
||||
}
|
||||
}
|
||||
|
||||
func WriteCtrlMessage(message []byte) error {
|
||||
if ctrlSocketConn == nil {
|
||||
return fmt.Errorf("ctrl socket not conn ected")
|
||||
}
|
||||
_, err := ctrlSocketConn.Write(message)
|
||||
return err
|
||||
}
|
||||
|
||||
var nativeCtrlSocketListener net.Listener //nolint:unused
|
||||
var nativeVideoSocketListener net.Listener //nolint:unused
|
||||
|
||||
var ctrlClientConnected = make(chan struct{})
|
||||
|
||||
func waitCtrlClientConnected() {
|
||||
<-ctrlClientConnected
|
||||
}
|
||||
|
||||
func StartNativeSocketServer(socketPath string, handleClient func(net.Conn), isCtrl bool) net.Listener {
|
||||
scopedLogger := nativeLogger.With().
|
||||
Str("socket_path", socketPath).
|
||||
Logger()
|
||||
|
||||
// Remove the socket file if it already exists
|
||||
if _, err := os.Stat(socketPath); err == nil {
|
||||
if err := os.Remove(socketPath); err != nil {
|
||||
scopedLogger.Warn().Err(err).Msg("failed to remove existing socket file")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
listener, err := net.Listen("unixpacket", socketPath)
|
||||
if err != nil {
|
||||
scopedLogger.Warn().Err(err).Msg("failed to start server")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
scopedLogger.Info().Msg("server listening")
|
||||
|
||||
go func() {
|
||||
for {
|
||||
conn, err := listener.Accept()
|
||||
|
||||
if err != nil {
|
||||
scopedLogger.Warn().Err(err).Msg("failed to accept socket")
|
||||
continue
|
||||
}
|
||||
if isCtrl {
|
||||
// check if the channel is closed
|
||||
select {
|
||||
case <-ctrlClientConnected:
|
||||
scopedLogger.Debug().Msg("ctrl client reconnected")
|
||||
default:
|
||||
close(ctrlClientConnected)
|
||||
scopedLogger.Debug().Msg("first native ctrl socket client connected")
|
||||
}
|
||||
}
|
||||
|
||||
go handleClient(conn)
|
||||
}
|
||||
}()
|
||||
|
||||
return listener
|
||||
}
|
||||
|
||||
func StartNativeCtrlSocketServer() {
|
||||
nativeCtrlSocketListener = StartNativeSocketServer("/var/run/jetkvm_ctrl.sock", handleCtrlClient, true)
|
||||
nativeLogger.Debug().Msg("native app ctrl sock started")
|
||||
}
|
||||
|
||||
func StartNativeVideoSocketServer() {
|
||||
nativeVideoSocketListener = StartNativeSocketServer("/var/run/jetkvm_video.sock", handleVideoClient, false)
|
||||
nativeLogger.Debug().Msg("native app video sock started")
|
||||
}
|
||||
|
||||
func handleCtrlClient(conn net.Conn) {
|
||||
defer conn.Close()
|
||||
|
||||
scopedLogger := nativeLogger.With().
|
||||
Str("addr", conn.RemoteAddr().String()).
|
||||
Str("type", "ctrl").
|
||||
Logger()
|
||||
|
||||
scopedLogger.Info().Msg("native ctrl socket client connected")
|
||||
if ctrlSocketConn != nil {
|
||||
scopedLogger.Debug().Msg("closing existing native socket connection")
|
||||
ctrlSocketConn.Close()
|
||||
}
|
||||
|
||||
ctrlSocketConn = conn
|
||||
|
||||
// Restore HDMI EDID if applicable
|
||||
go restoreHdmiEdid()
|
||||
|
||||
readBuf := make([]byte, 4096)
|
||||
for {
|
||||
n, err := conn.Read(readBuf)
|
||||
if err != nil {
|
||||
scopedLogger.Warn().Err(err).Msg("error reading from ctrl sock")
|
||||
break
|
||||
}
|
||||
readMsg := string(readBuf[:n])
|
||||
|
||||
ctrlResp := CtrlResponse{}
|
||||
err = json.Unmarshal([]byte(readMsg), &ctrlResp)
|
||||
if err != nil {
|
||||
scopedLogger.Warn().Err(err).Str("data", readMsg).Msg("error parsing ctrl sock msg")
|
||||
continue
|
||||
}
|
||||
scopedLogger.Trace().Interface("data", ctrlResp).Msg("ctrl sock msg")
|
||||
|
||||
if ctrlResp.Seq != 0 {
|
||||
responseChan, ok := ongoingRequests[ctrlResp.Seq]
|
||||
if ok {
|
||||
responseChan <- &ctrlResp
|
||||
}
|
||||
}
|
||||
switch ctrlResp.Event {
|
||||
case "video_input_state":
|
||||
HandleVideoStateMessage(ctrlResp)
|
||||
}
|
||||
}
|
||||
|
||||
scopedLogger.Debug().Msg("ctrl sock disconnected")
|
||||
}
|
||||
|
||||
func handleVideoClient(conn net.Conn) {
|
||||
defer conn.Close()
|
||||
|
||||
scopedLogger := nativeLogger.With().
|
||||
Str("addr", conn.RemoteAddr().String()).
|
||||
Str("type", "video").
|
||||
Logger()
|
||||
|
||||
scopedLogger.Info().Msg("native video socket client connected")
|
||||
|
||||
inboundPacket := make([]byte, maxFrameSize)
|
||||
lastFrame := time.Now()
|
||||
for {
|
||||
n, err := conn.Read(inboundPacket)
|
||||
if err != nil {
|
||||
scopedLogger.Warn().Err(err).Msg("error during read")
|
||||
return
|
||||
}
|
||||
now := time.Now()
|
||||
sinceLastFrame := now.Sub(lastFrame)
|
||||
lastFrame = now
|
||||
if currentSession != nil {
|
||||
err := currentSession.VideoTrack.WriteSample(media.Sample{Data: inboundPacket[:n], Duration: sinceLastFrame})
|
||||
if err != nil {
|
||||
scopedLogger.Warn().Err(err).Msg("error writing sample")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func startNativeBinaryWithLock(binaryPath string) (*exec.Cmd, error) {
|
||||
nativeCmdLock.Lock()
|
||||
defer nativeCmdLock.Unlock()
|
||||
|
||||
cmd, err := startNativeBinary(binaryPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nativeCmd = cmd
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
func restartNativeBinary(binaryPath string) error {
|
||||
time.Sleep(10 * time.Second)
|
||||
// restart the binary
|
||||
nativeLogger.Info().Msg("restarting jetkvm_native binary")
|
||||
cmd, err := startNativeBinary(binaryPath)
|
||||
if err != nil {
|
||||
nativeLogger.Warn().Err(err).Msg("failed to restart binary")
|
||||
}
|
||||
nativeCmd = cmd
|
||||
|
||||
// reset the display state
|
||||
time.Sleep(1 * time.Second)
|
||||
clearDisplayState()
|
||||
updateStaticContents()
|
||||
requestDisplayUpdate(true)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func superviseNativeBinary(binaryPath string) error {
|
||||
nativeCmdLock.Lock()
|
||||
defer nativeCmdLock.Unlock()
|
||||
|
||||
if nativeCmd == nil || nativeCmd.Process == nil {
|
||||
return restartNativeBinary(binaryPath)
|
||||
}
|
||||
|
||||
err := nativeCmd.Wait()
|
||||
|
||||
if err == nil {
|
||||
nativeLogger.Info().Err(err).Msg("jetkvm_native binary exited with no error")
|
||||
} else if exiterr, ok := err.(*exec.ExitError); ok {
|
||||
nativeLogger.Warn().Int("exit_code", exiterr.ExitCode()).Msg("jetkvm_native binary exited with error")
|
||||
} else {
|
||||
nativeLogger.Warn().Err(err).Msg("jetkvm_native binary exited with unknown error")
|
||||
}
|
||||
|
||||
return restartNativeBinary(binaryPath)
|
||||
}
|
||||
|
||||
func ExtractAndRunNativeBin() error {
|
||||
binaryPath := "/userdata/jetkvm/bin/jetkvm_native"
|
||||
if err := ensureBinaryUpdated(binaryPath); err != nil {
|
||||
return fmt.Errorf("failed to extract binary: %w", err)
|
||||
}
|
||||
|
||||
// Make the binary executable
|
||||
if err := os.Chmod(binaryPath, 0755); err != nil {
|
||||
return fmt.Errorf("failed to make binary executable: %w", err)
|
||||
}
|
||||
// Run the binary in the background
|
||||
cmd, err := startNativeBinaryWithLock(binaryPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to start binary: %w", err)
|
||||
}
|
||||
|
||||
// check if the binary is still running every 10 seconds
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-appCtx.Done():
|
||||
nativeLogger.Info().Msg("stopping native binary supervisor")
|
||||
return
|
||||
default:
|
||||
err := superviseNativeBinary(binaryPath)
|
||||
nativeInstance = native.NewNative(native.NativeOptions{
|
||||
SystemVersion: systemVersion,
|
||||
AppVersion: appVersion,
|
||||
DisplayRotation: config.GetDisplayRotation(),
|
||||
OnVideoStateChange: func(state native.VideoState) {
|
||||
lastVideoState = state
|
||||
triggerVideoStateUpdate()
|
||||
requestDisplayUpdate(true, "video_state_changed")
|
||||
},
|
||||
OnIndevEvent: func(event string) {
|
||||
nativeLogger.Trace().Str("event", event).Msg("indev event received")
|
||||
wakeDisplay(false, "indev_event")
|
||||
},
|
||||
OnVideoFrameReceived: func(frame []byte, duration time.Duration) {
|
||||
if currentSession != nil {
|
||||
err := currentSession.VideoTrack.WriteSample(media.Sample{Data: frame, Duration: duration})
|
||||
if err != nil {
|
||||
nativeLogger.Warn().Err(err).Msg("failed to supervise native binary")
|
||||
time.Sleep(1 * time.Second) // Add a short delay to prevent rapid successive calls
|
||||
nativeLogger.Warn().Err(err).Msg("error writing sample")
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
go func() {
|
||||
<-appCtx.Done()
|
||||
nativeLogger.Info().Int("pid", cmd.Process.Pid).Msg("killing process")
|
||||
err := cmd.Process.Kill()
|
||||
if err != nil {
|
||||
nativeLogger.Warn().Err(err).Msg("failed to kill process")
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
nativeLogger.Info().Int("pid", cmd.Process.Pid).Msg("jetkvm_native binary started")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func shouldOverwrite(destPath string, srcHash []byte) bool {
|
||||
if srcHash == nil {
|
||||
nativeLogger.Debug().Msg("error reading embedded jetkvm_native.sha256, doing overwriting")
|
||||
return true
|
||||
}
|
||||
|
||||
dstHash, err := os.ReadFile(destPath + ".sha256")
|
||||
if err != nil {
|
||||
nativeLogger.Debug().Msg("error reading existing jetkvm_native.sha256, doing overwriting")
|
||||
return true
|
||||
}
|
||||
|
||||
return !bytes.Equal(srcHash, dstHash)
|
||||
}
|
||||
|
||||
func getNativeSha256() ([]byte, error) {
|
||||
version, err := resource.ResourceFS.ReadFile("jetkvm_native.sha256")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return version, nil
|
||||
}
|
||||
|
||||
func GetNativeVersion() (string, error) {
|
||||
version, err := getNativeSha256()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return strings.TrimSpace(string(version)), nil
|
||||
}
|
||||
|
||||
func ensureBinaryUpdated(destPath string) error {
|
||||
srcFile, err := resource.ResourceFS.Open("jetkvm_native")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer srcFile.Close()
|
||||
|
||||
srcHash, err := getNativeSha256()
|
||||
if err != nil {
|
||||
nativeLogger.Debug().Msg("error reading embedded jetkvm_native.sha256, proceeding with update")
|
||||
srcHash = nil
|
||||
}
|
||||
|
||||
_, err = os.Stat(destPath)
|
||||
if shouldOverwrite(destPath, srcHash) || err != nil {
|
||||
nativeLogger.Info().
|
||||
Interface("hash", srcHash).
|
||||
Msg("writing jetkvm_native")
|
||||
|
||||
_ = os.Remove(destPath)
|
||||
destFile, err := os.OpenFile(destPath, os.O_CREATE|os.O_RDWR, 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = io.Copy(destFile, srcFile)
|
||||
destFile.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if srcHash != nil {
|
||||
err = os.WriteFile(destPath+".sha256", srcHash, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
nativeLogger.Info().Msg("jetkvm_native updated")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Restore the HDMI EDID value from the config.
|
||||
// Called after successful connection to jetkvm_native.
|
||||
func restoreHdmiEdid() {
|
||||
if config.EdidString != "" {
|
||||
nativeLogger.Info().Str("edid", config.EdidString).Msg("Restoring HDMI EDID")
|
||||
_, err := CallCtrlAction("set_edid", map[string]any{"edid": config.EdidString})
|
||||
if err != nil {
|
||||
nativeLogger.Warn().Err(err).Msg("Failed to restore HDMI EDID")
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
nativeInstance.Start()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,57 +0,0 @@
|
|||
//go:build linux
|
||||
|
||||
package kvm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
type nativeOutput struct {
|
||||
mu *sync.Mutex
|
||||
logger *zerolog.Event
|
||||
}
|
||||
|
||||
func (w *nativeOutput) Write(p []byte) (n int, err error) {
|
||||
w.mu.Lock()
|
||||
defer w.mu.Unlock()
|
||||
|
||||
w.logger.Msg(string(p))
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
func startNativeBinary(binaryPath string) (*exec.Cmd, error) {
|
||||
// Run the binary in the background
|
||||
cmd := exec.Command(binaryPath)
|
||||
|
||||
nativeOutputLock := sync.Mutex{}
|
||||
nativeStdout := &nativeOutput{
|
||||
mu: &nativeOutputLock,
|
||||
logger: nativeLogger.Info().Str("pipe", "stdout"),
|
||||
}
|
||||
nativeStderr := &nativeOutput{
|
||||
mu: &nativeOutputLock,
|
||||
logger: nativeLogger.Info().Str("pipe", "stderr"),
|
||||
}
|
||||
|
||||
// Redirect stdout and stderr to the current process
|
||||
cmd.Stdout = nativeStdout
|
||||
cmd.Stderr = nativeStderr
|
||||
|
||||
// Set the process group ID so we can kill the process and its children when this process exits
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Setpgid: true,
|
||||
Pdeathsig: syscall.SIGKILL,
|
||||
}
|
||||
|
||||
// Start the command
|
||||
if err := cmd.Start(); err != nil {
|
||||
return nil, fmt.Errorf("failed to start binary: %w", err)
|
||||
}
|
||||
|
||||
return cmd, nil
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
//go:build !linux
|
||||
|
||||
package kvm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func startNativeBinary(binaryPath string) (*exec.Cmd, error) {
|
||||
return nil, fmt.Errorf("not supported")
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package kvm
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jetkvm/kvm/internal/lldp"
|
||||
"github.com/jetkvm/kvm/internal/network"
|
||||
"github.com/jetkvm/kvm/internal/udhcpc"
|
||||
)
|
||||
|
|
@ -17,7 +18,7 @@ var (
|
|||
|
||||
func networkStateChanged(isOnline bool) {
|
||||
// do not block the main thread
|
||||
go waitCtrlAndRequestDisplayUpdate(true)
|
||||
go waitCtrlAndRequestDisplayUpdate(true, "network_state_changed")
|
||||
|
||||
if timeSync != nil {
|
||||
if networkState != nil {
|
||||
|
|
@ -123,3 +124,7 @@ func rpcSetNetworkSettings(settings network.RpcNetworkSettings) (*network.RpcNet
|
|||
func rpcRenewDHCPLease() error {
|
||||
return networkState.RpcRenewDHCPLease()
|
||||
}
|
||||
|
||||
func rpcGetLLDPNeighbors() ([]lldp.Neighbor, error) {
|
||||
return networkState.GetLLDPNeighbors()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,5 +4,5 @@ import (
|
|||
"embed"
|
||||
)
|
||||
|
||||
//go:embed jetkvm_native jetkvm_native.sha256 netboot.xyz-multiarch.iso
|
||||
//go:embed netboot.xyz-multiarch.iso
|
||||
var ResourceFS embed.FS
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
a4fca98710932aaa2765b57404e080105190cfa3af69171f4b4d95d4b78f9af0
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
{"Time":"2025-05-16T20:06:50.904437+02:00","Action":"start","Package":"github.com/jetkvm/kvm"}
|
||||
{"Time":"2025-05-16T20:06:50.904512+02:00","Action":"output","Package":"github.com/jetkvm/kvm","Output":"? \tgithub.com/jetkvm/kvm\t[no test files]\n"}
|
||||
{"Time":"2025-05-16T20:06:50.904531+02:00","Action":"skip","Package":"github.com/jetkvm/kvm","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:50.916238+02:00","Action":"start","Package":"github.com/jetkvm/kvm/cmd"}
|
||||
{"Time":"2025-05-16T20:06:50.91626+02:00","Action":"output","Package":"github.com/jetkvm/kvm/cmd","Output":"? \tgithub.com/jetkvm/kvm/cmd\t[no test files]\n"}
|
||||
{"Time":"2025-05-16T20:06:50.916272+02:00","Action":"skip","Package":"github.com/jetkvm/kvm/cmd","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.071519+02:00","Action":"start","Package":"github.com/jetkvm/kvm/internal/confparser"}
|
||||
{"Time":"2025-05-16T20:06:51.071566+02:00","Action":"start","Package":"github.com/jetkvm/kvm/internal/logging"}
|
||||
{"Time":"2025-05-16T20:06:51.071596+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/logging","Output":"? \tgithub.com/jetkvm/kvm/internal/logging\t[no test files]\n"}
|
||||
{"Time":"2025-05-16T20:06:51.07161+02:00","Action":"start","Package":"github.com/jetkvm/kvm/internal/mdns"}
|
||||
{"Time":"2025-05-16T20:06:51.071611+02:00","Action":"skip","Package":"github.com/jetkvm/kvm/internal/logging","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.071621+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/mdns","Output":"? \tgithub.com/jetkvm/kvm/internal/mdns\t[no test files]\n"}
|
||||
{"Time":"2025-05-16T20:06:51.071629+02:00","Action":"skip","Package":"github.com/jetkvm/kvm/internal/mdns","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.071645+02:00","Action":"start","Package":"github.com/jetkvm/kvm/internal/network"}
|
||||
{"Time":"2025-05-16T20:06:51.071667+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/network","Output":"? \tgithub.com/jetkvm/kvm/internal/network\t[no test files]\n"}
|
||||
{"Time":"2025-05-16T20:06:51.071676+02:00","Action":"skip","Package":"github.com/jetkvm/kvm/internal/network","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.071677+02:00","Action":"start","Package":"github.com/jetkvm/kvm/internal/timesync"}
|
||||
{"Time":"2025-05-16T20:06:51.071684+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/timesync","Output":"? \tgithub.com/jetkvm/kvm/internal/timesync\t[no test files]\n"}
|
||||
{"Time":"2025-05-16T20:06:51.071687+02:00","Action":"start","Package":"github.com/jetkvm/kvm/internal/udhcpc"}
|
||||
{"Time":"2025-05-16T20:06:51.071688+02:00","Action":"skip","Package":"github.com/jetkvm/kvm/internal/timesync","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.071709+02:00","Action":"start","Package":"github.com/jetkvm/kvm/internal/usbgadget"}
|
||||
{"Time":"2025-05-16T20:06:51.071715+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/usbgadget","Output":"? \tgithub.com/jetkvm/kvm/internal/usbgadget\t[no test files]\n"}
|
||||
{"Time":"2025-05-16T20:06:51.071721+02:00","Action":"skip","Package":"github.com/jetkvm/kvm/internal/usbgadget","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.071722+02:00","Action":"start","Package":"github.com/jetkvm/kvm/internal/websecure"}
|
||||
{"Time":"2025-05-16T20:06:51.071739+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/websecure","Output":"? \tgithub.com/jetkvm/kvm/internal/websecure\t[no test files]\n"}
|
||||
{"Time":"2025-05-16T20:06:51.071744+02:00","Action":"skip","Package":"github.com/jetkvm/kvm/internal/websecure","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.071747+02:00","Action":"start","Package":"github.com/jetkvm/kvm/resource"}
|
||||
{"Time":"2025-05-16T20:06:51.071752+02:00","Action":"output","Package":"github.com/jetkvm/kvm/resource","Output":"? \tgithub.com/jetkvm/kvm/resource\t[no test files]\n"}
|
||||
{"Time":"2025-05-16T20:06:51.071755+02:00","Action":"skip","Package":"github.com/jetkvm/kvm/resource","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.270727+02:00","Action":"run","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateConfig"}
|
||||
{"Time":"2025-05-16T20:06:51.270772+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateConfig","Output":"=== RUN TestValidateConfig\n"}
|
||||
{"Time":"2025-05-16T20:06:51.27085+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateConfig","Output":"--- PASS: TestValidateConfig (0.00s)\n"}
|
||||
{"Time":"2025-05-16T20:06:51.270864+02:00","Action":"pass","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateConfig","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.270873+02:00","Action":"run","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigNetmaskRequiredIfStatic"}
|
||||
{"Time":"2025-05-16T20:06:51.270879+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigNetmaskRequiredIfStatic","Output":"=== RUN TestValidateIPv4StaticConfigNetmaskRequiredIfStatic\n"}
|
||||
{"Time":"2025-05-16T20:06:51.270882+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigNetmaskRequiredIfStatic","Output":"--- PASS: TestValidateIPv4StaticConfigNetmaskRequiredIfStatic (0.00s)\n"}
|
||||
{"Time":"2025-05-16T20:06:51.270886+02:00","Action":"pass","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigNetmaskRequiredIfStatic","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.270889+02:00","Action":"run","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigNetmaskNotRequiredIfStatic"}
|
||||
{"Time":"2025-05-16T20:06:51.2709+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigNetmaskNotRequiredIfStatic","Output":"=== RUN TestValidateIPv4StaticConfigNetmaskNotRequiredIfStatic\n"}
|
||||
{"Time":"2025-05-16T20:06:51.270906+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigNetmaskNotRequiredIfStatic","Output":"--- PASS: TestValidateIPv4StaticConfigNetmaskNotRequiredIfStatic (0.00s)\n"}
|
||||
{"Time":"2025-05-16T20:06:51.27091+02:00","Action":"pass","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigNetmaskNotRequiredIfStatic","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.270914+02:00","Action":"run","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigRequiredIf"}
|
||||
{"Time":"2025-05-16T20:06:51.270918+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigRequiredIf","Output":"=== RUN TestValidateIPv4StaticConfigRequiredIf\n"}
|
||||
{"Time":"2025-05-16T20:06:51.270925+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigRequiredIf","Output":"--- PASS: TestValidateIPv4StaticConfigRequiredIf (0.00s)\n"}
|
||||
{"Time":"2025-05-16T20:06:51.270927+02:00","Action":"pass","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigRequiredIf","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.270929+02:00","Action":"run","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigValidateType"}
|
||||
{"Time":"2025-05-16T20:06:51.270932+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigValidateType","Output":"=== RUN TestValidateIPv4StaticConfigValidateType\n"}
|
||||
{"Time":"2025-05-16T20:06:51.270991+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigValidateType","Output":"--- PASS: TestValidateIPv4StaticConfigValidateType (0.00s)\n"}
|
||||
{"Time":"2025-05-16T20:06:51.270995+02:00","Action":"pass","Package":"github.com/jetkvm/kvm/internal/confparser","Test":"TestValidateIPv4StaticConfigValidateType","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.270997+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Output":"PASS\n"}
|
||||
{"Time":"2025-05-16T20:06:51.271289+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/confparser","Output":"ok \tgithub.com/jetkvm/kvm/internal/confparser\t0.200s\n"}
|
||||
{"Time":"2025-05-16T20:06:51.272057+02:00","Action":"pass","Package":"github.com/jetkvm/kvm/internal/confparser","Elapsed":0.201}
|
||||
{"Time":"2025-05-16T20:06:51.42069+02:00","Action":"run","Package":"github.com/jetkvm/kvm/internal/udhcpc","Test":"TestUnmarshalDHCPCLease"}
|
||||
{"Time":"2025-05-16T20:06:51.420713+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/udhcpc","Test":"TestUnmarshalDHCPCLease","Output":"=== RUN TestUnmarshalDHCPCLease\n"}
|
||||
{"Time":"2025-05-16T20:06:51.420737+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/udhcpc","Test":"TestUnmarshalDHCPCLease","Output":"--- PASS: TestUnmarshalDHCPCLease (0.00s)\n"}
|
||||
{"Time":"2025-05-16T20:06:51.420743+02:00","Action":"pass","Package":"github.com/jetkvm/kvm/internal/udhcpc","Test":"TestUnmarshalDHCPCLease","Elapsed":0}
|
||||
{"Time":"2025-05-16T20:06:51.420748+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/udhcpc","Output":"PASS\n"}
|
||||
{"Time":"2025-05-16T20:06:51.421071+02:00","Action":"output","Package":"github.com/jetkvm/kvm/internal/udhcpc","Output":"ok \tgithub.com/jetkvm/kvm/internal/udhcpc\t0.349s\n"}
|
||||
{"Time":"2025-05-16T20:06:51.422515+02:00","Action":"pass","Package":"github.com/jetkvm/kvm/internal/udhcpc","Elapsed":0.351}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
"version": "2025.09.03.2100",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": "22.15.0"
|
||||
"node": "^22.15.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "./dev_device.sh",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
import { LLDPNeighbor } from "../hooks/stores";
|
||||
// import { LifeTimeLabel } from "../routes/devices.$id.settings.network";
|
||||
|
||||
import { GridCard } from "./Card";
|
||||
|
||||
export default function LLDPNeighCard({
|
||||
neighbors,
|
||||
}: {
|
||||
neighbors: LLDPNeighbor[];
|
||||
}) {
|
||||
return (
|
||||
<GridCard>
|
||||
<div className="animate-fadeIn p-4 text-black opacity-0 animation-duration-500 dark:text-white">
|
||||
<div className="space-y-4">
|
||||
<h3 className="text-base font-bold text-slate-900 dark:text-white">
|
||||
LLDP Neighbors
|
||||
</h3>
|
||||
|
||||
<div className="space-y-3 pt-2">
|
||||
{neighbors.map(neighbor => (
|
||||
<div className="space-y-3" key={neighbor.mac}>
|
||||
<h4 className="text-sm font-semibold font-mono">{neighbor.mac}</h4>
|
||||
<div
|
||||
className="rounded-md rounded-l-none border border-slate-500/10 border-l-blue-700/50 bg-white p-4 pl-4 backdrop-blur-sm dark:bg-transparent"
|
||||
>
|
||||
<div className="grid grid-cols-2 gap-x-8 gap-y-4">
|
||||
<div className="col-span-2 flex flex-col justify-between">
|
||||
<span className="text-sm text-slate-600 dark:text-slate-400">
|
||||
Interface
|
||||
</span>
|
||||
<span className="text-sm font-medium">{neighbor.port_description}</span>
|
||||
</div>
|
||||
|
||||
{neighbor.system_name && (
|
||||
<div className="flex flex-col justify-between">
|
||||
<span className="text-sm text-slate-600 dark:text-slate-400">
|
||||
System Name
|
||||
</span>
|
||||
<span className="text-sm font-medium">{neighbor.system_name}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{neighbor.system_description && (
|
||||
<div className="col-span-2 flex flex-col justify-between">
|
||||
<span className="text-sm text-slate-600 dark:text-slate-400">
|
||||
System Description
|
||||
</span>
|
||||
<span className="text-sm font-medium">{neighbor.system_description}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
{neighbor.port_id && (
|
||||
<div className="flex flex-col justify-between">
|
||||
<span className="text-sm text-slate-600 dark:text-slate-400">
|
||||
Port ID
|
||||
</span>
|
||||
<span className="text-sm font-medium">
|
||||
{neighbor.port_id}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
{neighbor.port_description && (
|
||||
<div className="flex flex-col justify-between">
|
||||
<span className="text-sm text-slate-600 dark:text-slate-400">
|
||||
Port Description
|
||||
</span>
|
||||
<span className="text-sm font-medium">
|
||||
{neighbor.port_description}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</GridCard>
|
||||
);
|
||||
}
|
||||
|
|
@ -723,7 +723,7 @@ export type IPv6Mode =
|
|||
| "link_local"
|
||||
| "unknown";
|
||||
export type IPv4Mode = "disabled" | "static" | "dhcp" | "unknown";
|
||||
export type LLDPMode = "disabled" | "basic" | "all" | "unknown";
|
||||
export type LLDPMode = "disabled" | "basic" | "all" | "tx_only" | "rx_only" | "unknown";
|
||||
export type mDNSMode = "disabled" | "auto" | "ipv4_only" | "ipv6_only" | "unknown";
|
||||
export type TimeSyncMode =
|
||||
| "ntp_only"
|
||||
|
|
@ -744,6 +744,19 @@ export interface NetworkSettings {
|
|||
time_sync_mode: TimeSyncMode;
|
||||
}
|
||||
|
||||
export interface LLDPNeighbor {
|
||||
mac: string;
|
||||
source: string;
|
||||
chassis_id: string;
|
||||
port_id: string;
|
||||
port_description: string;
|
||||
system_name: string;
|
||||
system_description: string;
|
||||
ttl: number | null;
|
||||
management_address: string | null;
|
||||
values: Record<string, string>;
|
||||
}
|
||||
|
||||
export const useNetworkStateStore = create<NetworkState>((set, get) => ({
|
||||
setNetworkState: (state: NetworkState) => set(state),
|
||||
setDhcpLease: (lease: NetworkState["dhcp_lease"]) => set({ dhcp_lease: lease }),
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {
|
|||
IPv4Mode,
|
||||
IPv6Mode,
|
||||
LLDPMode,
|
||||
LLDPNeighbor,
|
||||
mDNSMode,
|
||||
NetworkSettings,
|
||||
NetworkState,
|
||||
|
|
@ -29,6 +30,7 @@ import AutoHeight from "../components/AutoHeight";
|
|||
import DhcpLeaseCard from "../components/DhcpLeaseCard";
|
||||
|
||||
import { SettingsItem } from "./devices.$id.settings";
|
||||
import LLDPNeighCard from "../components/LLDPNeighCard";
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
|
|
@ -89,6 +91,14 @@ export default function SettingsNetworkRoute() {
|
|||
const [customDomain, setCustomDomain] = useState<string>("");
|
||||
const [selectedDomainOption, setSelectedDomainOption] = useState<string>("dhcp");
|
||||
|
||||
const [lldpNeighbors, setLldpNeighbors] = useState<LLDPNeighbor[] | undefined>(undefined);
|
||||
useEffect(() => {
|
||||
send("getLLDPNeighbors", {}, resp => {
|
||||
if ("error" in resp) return;
|
||||
setLldpNeighbors(resp.result as LLDPNeighbor[]);
|
||||
});
|
||||
}, [send]);
|
||||
|
||||
useEffect(() => {
|
||||
if (networkSettings.domain && networkSettingsLoaded) {
|
||||
// Check if the domain is one of the predefined options
|
||||
|
|
@ -133,7 +143,7 @@ export default function SettingsNetworkRoute() {
|
|||
if ("error" in resp) {
|
||||
notifications.error(
|
||||
"Failed to save network settings: " +
|
||||
(resp.error.data ? resp.error.data : resp.error.message),
|
||||
(resp.error.data ? resp.error.data : resp.error.message),
|
||||
);
|
||||
setNetworkSettingsLoaded(true);
|
||||
return;
|
||||
|
|
@ -430,7 +440,7 @@ export default function SettingsNetworkRoute() {
|
|||
</SettingsItem>
|
||||
<AutoHeight>
|
||||
{!networkSettingsLoaded &&
|
||||
!(networkState?.ipv6_addresses && networkState.ipv6_addresses.length > 0) ? (
|
||||
!(networkState?.ipv6_addresses && networkState.ipv6_addresses.length > 0) ? (
|
||||
<GridCard>
|
||||
<div className="p-4">
|
||||
<div className="space-y-4">
|
||||
|
|
@ -456,22 +466,49 @@ export default function SettingsNetworkRoute() {
|
|||
)}
|
||||
</AutoHeight>
|
||||
</div>
|
||||
<div className="hidden space-y-4">
|
||||
<SettingsItem
|
||||
title="LLDP"
|
||||
description="Control which TLVs will be sent over Link Layer Discovery Protocol"
|
||||
>
|
||||
|
||||
<div className="space-y-4">
|
||||
<SettingsItem title="LLDP" description="Configure the LLDP mode">
|
||||
<SelectMenuBasic
|
||||
size="SM"
|
||||
value={networkSettings.lldp_mode}
|
||||
onChange={e => handleLldpModeChange(e.target.value)}
|
||||
options={filterUnknown([
|
||||
{ value: "disabled", label: "Disabled" },
|
||||
{ value: "basic", label: "Basic" },
|
||||
{ value: "all", label: "All" },
|
||||
{ value: "tx_only", label: "Tx only" },
|
||||
{ value: "rx_only", label: "Rx only" },
|
||||
{ value: "basic", label: "Tx Minimal + Rx" },
|
||||
{ value: "all", label: "Tx Detailed + Rx" },
|
||||
{ value: "enabled", label: "Enabled" },
|
||||
])}
|
||||
/>
|
||||
</SettingsItem>
|
||||
<AutoHeight>
|
||||
{lldpNeighbors === undefined ? (
|
||||
<GridCard>
|
||||
<div className="p-4">
|
||||
<div className="space-y-4">
|
||||
<h3 className="text-base font-bold text-slate-900 dark:text-white">
|
||||
LLDP Neighbors
|
||||
</h3>
|
||||
<div className="animate-pulse space-y-3">
|
||||
<div className="h-4 w-1/3 rounded bg-slate-200 dark:bg-slate-700" />
|
||||
<div className="h-4 w-1/2 rounded bg-slate-200 dark:bg-slate-700" />
|
||||
<div className="h-4 w-1/3 rounded bg-slate-200 dark:bg-slate-700" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</GridCard>
|
||||
) : lldpNeighbors.length > 0 ? (
|
||||
<LLDPNeighCard neighbors={lldpNeighbors} />
|
||||
) : (
|
||||
<EmptyCard
|
||||
IconElm={LuEthernetPort}
|
||||
headline="LLDP Neighbors"
|
||||
description="No LLDP neighbors found"
|
||||
/>
|
||||
)}
|
||||
</AutoHeight>
|
||||
</div>
|
||||
</Fieldset>
|
||||
<ConfirmDialog
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
SET(SOURCES ui_Settings_Overview_Screen.c
|
||||
ui_Home_Screen.c
|
||||
ui_Manual_Dhcp_Wizard_Screen.c
|
||||
ui_Status_Screen.c
|
||||
ui_About_Screen.c
|
||||
ui_Reset_Device_Screen.c
|
||||
ui_Network_Screen.c
|
||||
ui_Network_Setup_Failed_Screen.c
|
||||
ui_No_Network_Screen.c
|
||||
ui_Boot_Screen.c
|
||||
ui.c
|
||||
ui_comp_hook.c
|
||||
ui_helpers.c
|
||||
ui_img_352891484.c
|
||||
ui_img_jetkvm_png.c
|
||||
ui_img_cloud_png.c
|
||||
ui_img_usb_png.c
|
||||
ui_img_hdmi_png.c
|
||||
ui_img_1318103182.c
|
||||
ui_img_2138704335.c
|
||||
ui_img_536642073.c
|
||||
ui_img_1582207408.c
|
||||
ui_img_ethernet_png.c
|
||||
ui_img_1796371062.c
|
||||
ui_img_cloud_disconnected_png.c
|
||||
ui_img_d2_png.c
|
||||
fonts/ui_font_Font_Bold_30.c
|
||||
fonts/ui_font_Font_Book_16.c
|
||||
fonts/ui_font_Font_Book_18.c
|
||||
fonts/ui_font_Font_Book_20.c
|
||||
fonts/ui_font_Font_Book_24.c)
|
||||
|
||||
add_library(ui ${SOURCES})
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
ui_Settings_Overview_Screen.c
|
||||
ui_Home_Screen.c
|
||||
ui_Manual_Dhcp_Wizard_Screen.c
|
||||
ui_Status_Screen.c
|
||||
ui_About_Screen.c
|
||||
ui_Reset_Device_Screen.c
|
||||
ui_Network_Screen.c
|
||||
ui_Network_Setup_Failed_Screen.c
|
||||
ui_No_Network_Screen.c
|
||||
ui_Boot_Screen.c
|
||||
ui.c
|
||||
ui_comp_hook.c
|
||||
ui_helpers.c
|
||||
ui_img_352891484.c
|
||||
ui_img_jetkvm_png.c
|
||||
ui_img_cloud_png.c
|
||||
ui_img_usb_png.c
|
||||
ui_img_hdmi_png.c
|
||||
ui_img_1318103182.c
|
||||
ui_img_2138704335.c
|
||||
ui_img_536642073.c
|
||||
ui_img_1582207408.c
|
||||
ui_img_ethernet_png.c
|
||||
ui_img_1796371062.c
|
||||
ui_img_cloud_disconnected_png.c
|
||||
ui_img_d2_png.c
|
||||
fonts/ui_font_Font_Bold_30.c
|
||||
fonts/ui_font_Font_Book_16.c
|
||||
fonts/ui_font_Font_Book_18.c
|
||||
fonts/ui_font_Font_Book_20.c
|
||||
fonts/ui_font_Font_Book_24.c
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
#include "ui_helpers.h"
|
||||
|
||||
///////////////////// VARIABLES ////////////////////
|
||||
|
||||
// EVENTS
|
||||
lv_obj_t *ui____initial_actions0;
|
||||
|
||||
// IMAGES AND IMAGE SETS
|
||||
|
||||
///////////////////// TEST LVGL SETTINGS ////////////////////
|
||||
#if LV_COLOR_DEPTH != 16
|
||||
#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
|
||||
#endif
|
||||
#if LV_COLOR_16_SWAP !=0
|
||||
#error "LV_COLOR_16_SWAP should be 0 to match SquareLine Studio's settings"
|
||||
#endif
|
||||
|
||||
///////////////////// ANIMATIONS ////////////////////
|
||||
|
||||
///////////////////// FUNCTIONS ////////////////////
|
||||
|
||||
///////////////////// SCREENS ////////////////////
|
||||
|
||||
void ui_init( void )
|
||||
{
|
||||
lv_disp_t *dispp = lv_disp_get_default();
|
||||
lv_theme_t *theme = lv_theme_basic_init(dispp);
|
||||
lv_disp_set_theme(dispp, theme);
|
||||
ui_Settings_Overview_Screen_screen_init();
|
||||
ui_Home_Screen_screen_init();
|
||||
ui_Manual_Dhcp_Wizard_Screen_screen_init();
|
||||
ui_Status_Screen_screen_init();
|
||||
ui_About_Screen_screen_init();
|
||||
ui_Reset_Device_Screen_screen_init();
|
||||
ui_Network_Screen_screen_init();
|
||||
ui_Network_Setup_Failed_Screen_screen_init();
|
||||
ui_No_Network_Screen_screen_init();
|
||||
ui_Boot_Screen_screen_init();
|
||||
ui____initial_actions0 = lv_obj_create(NULL);
|
||||
lv_disp_load_scr( ui_Settings_Overview_Screen);
|
||||
}
|
||||
|
||||
void ui_destroy( void )
|
||||
{ui_Settings_Overview_Screen_screen_destroy();
|
||||
ui_Home_Screen_screen_destroy();
|
||||
ui_Manual_Dhcp_Wizard_Screen_screen_destroy();
|
||||
ui_Status_Screen_screen_destroy();
|
||||
ui_About_Screen_screen_destroy();
|
||||
ui_Reset_Device_Screen_screen_destroy();
|
||||
ui_Network_Screen_screen_destroy();
|
||||
ui_Network_Setup_Failed_Screen_screen_destroy();
|
||||
ui_No_Network_Screen_screen_destroy();
|
||||
ui_Boot_Screen_screen_destroy();
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef _SQUARELINE_PROJECT_UI_H
|
||||
#define _SQUARELINE_PROJECT_UI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "lvgl/lvgl.h"
|
||||
|
||||
#include "ui_helpers.h"
|
||||
#include "ui_events.h"
|
||||
|
||||
///////////////////// SCREENS ////////////////////
|
||||
#include "screens/ui_Settings_Overview_Screen.h"
|
||||
#include "screens/ui_Home_Screen.h"
|
||||
#include "screens/ui_Manual_Dhcp_Wizard_Screen.h"
|
||||
#include "screens/ui_Status_Screen.h"
|
||||
#include "screens/ui_About_Screen.h"
|
||||
#include "screens/ui_Reset_Device_Screen.h"
|
||||
#include "screens/ui_Network_Screen.h"
|
||||
#include "screens/ui_Network_Setup_Failed_Screen.h"
|
||||
#include "screens/ui_No_Network_Screen.h"
|
||||
#include "screens/ui_Boot_Screen.h"
|
||||
|
||||
///////////////////// VARIABLES ////////////////////
|
||||
|
||||
// EVENTS
|
||||
extern lv_obj_t *ui____initial_actions0;
|
||||
|
||||
// IMAGES AND IMAGE SETS
|
||||
LV_IMG_DECLARE( ui_img_352891484); // assets/back-caret.png
|
||||
LV_IMG_DECLARE( ui_img_jetkvm_png); // assets/jetkvm.png
|
||||
LV_IMG_DECLARE( ui_img_cloud_png); // assets/cloud.png
|
||||
LV_IMG_DECLARE( ui_img_usb_png); // assets/usb.png
|
||||
LV_IMG_DECLARE( ui_img_hdmi_png); // assets/hdmi.png
|
||||
LV_IMG_DECLARE( ui_img_1318103182); // assets/back-icon.png
|
||||
LV_IMG_DECLARE( ui_img_2138704335); // assets/x-icon.png
|
||||
LV_IMG_DECLARE( ui_img_536642073); // assets/check-icon.png
|
||||
LV_IMG_DECLARE( ui_img_1582207408); // assets/arrow-icon.png
|
||||
LV_IMG_DECLARE( ui_img_ethernet_png); // assets/ethernet.png
|
||||
LV_IMG_DECLARE( ui_img_1796371062); // assets/boot-logo-2.png
|
||||
LV_IMG_DECLARE( ui_img_cloud_disconnected_png); // assets/cloud_disconnected.png
|
||||
LV_IMG_DECLARE( ui_img_d2_png); // assets/d2.png
|
||||
|
||||
// FONTS
|
||||
LV_FONT_DECLARE( ui_font_Font_Bold_30);
|
||||
LV_FONT_DECLARE( ui_font_Font_Book_16);
|
||||
LV_FONT_DECLARE( ui_font_Font_Book_18);
|
||||
LV_FONT_DECLARE( ui_font_Font_Book_20);
|
||||
LV_FONT_DECLARE( ui_font_Font_Book_24);
|
||||
|
||||
// UI INIT
|
||||
void ui_init(void);
|
||||
void ui_destroy(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_About_Screen;
|
||||
lv_obj_t *ui_About_Container_0;
|
||||
lv_obj_t *ui_About_Container_1;
|
||||
lv_obj_t *ui_About_Header_Back_Button;
|
||||
lv_obj_t *ui_About_Header_Back_Button_Icon;
|
||||
lv_obj_t *ui_About_Header_Page_Name_Label;
|
||||
lv_obj_t *ui_About_Container_2;
|
||||
lv_obj_t *ui_About_Content_Operating_System_Version_Headline_Label;
|
||||
lv_obj_t *ui_About_Content_Operating_System_Version_ContentLabel;
|
||||
lv_obj_t *ui_About_Container_3;
|
||||
lv_obj_t *ui_About_Content_App_Version_Headline_Label;
|
||||
lv_obj_t *ui_About_Content_App_Version_Content_Label;
|
||||
|
||||
// event funtions
|
||||
void ui_event_About_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_RIGHT ) {
|
||||
lv_indev_wait_release(lv_indev_get_act());
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_About_Header_Back_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_About_Screen_screen_init(void)
|
||||
{
|
||||
ui_About_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_flag( ui_About_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_About_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_About_Screen, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_About_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_About_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_About_Screen, 44, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_About_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_About_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_About_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_About_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_About_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_About_Container_0 = lv_obj_create(ui_About_Screen);
|
||||
lv_obj_remove_style_all(ui_About_Container_0);
|
||||
lv_obj_set_width( ui_About_Container_0, lv_pct(100));
|
||||
lv_obj_set_height( ui_About_Container_0, LV_SIZE_CONTENT); /// 100
|
||||
lv_obj_set_x( ui_About_Container_0, 75 );
|
||||
lv_obj_set_y( ui_About_Container_0, -33 );
|
||||
lv_obj_set_align( ui_About_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_About_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_About_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_About_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_About_Container_0, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_About_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_About_Container_1 = lv_obj_create(ui_About_Container_0);
|
||||
lv_obj_remove_style_all(ui_About_Container_1);
|
||||
lv_obj_set_width( ui_About_Container_1, lv_pct(100));
|
||||
lv_obj_set_height( ui_About_Container_1, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_About_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_About_Container_1,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_About_Container_1, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
lv_obj_clear_flag( ui_About_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_About_Header_Back_Button = lv_btn_create(ui_About_Container_1);
|
||||
lv_obj_set_width( ui_About_Header_Back_Button, 32);
|
||||
lv_obj_set_height( ui_About_Header_Back_Button, 32);
|
||||
lv_obj_set_align( ui_About_Header_Back_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_About_Header_Back_Button, 10000, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_About_Header_Back_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_About_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_About_Header_Back_Button, 100000, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_About_Header_Back_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_About_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_About_Header_Back_Button_Icon = lv_img_create(ui_About_Header_Back_Button);
|
||||
lv_img_set_src(ui_About_Header_Back_Button_Icon, &ui_img_352891484);
|
||||
lv_obj_set_width( ui_About_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 8
|
||||
lv_obj_set_height( ui_About_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 12
|
||||
lv_obj_set_align( ui_About_Header_Back_Button_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_About_Header_Back_Button_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_About_Header_Back_Button_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_About_Header_Page_Name_Label = lv_label_create(ui_About_Container_1);
|
||||
lv_obj_set_width( ui_About_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_About_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_About_Header_Page_Name_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_About_Header_Page_Name_Label,"About");
|
||||
lv_obj_set_style_text_color(ui_About_Header_Page_Name_Label, lv_color_hex(0x1D4ED8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_About_Header_Page_Name_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_About_Header_Page_Name_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_About_Container_2 = lv_obj_create(ui_About_Screen);
|
||||
lv_obj_remove_style_all(ui_About_Container_2);
|
||||
lv_obj_set_width( ui_About_Container_2, lv_pct(100));
|
||||
lv_obj_set_height( ui_About_Container_2, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_About_Container_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_About_Container_2,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_About_Container_2, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_About_Container_2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_About_Container_2, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_About_Container_2, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_About_Content_Operating_System_Version_Headline_Label = lv_label_create(ui_About_Container_2);
|
||||
lv_obj_set_width( ui_About_Content_Operating_System_Version_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_About_Content_Operating_System_Version_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_About_Content_Operating_System_Version_Headline_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_About_Content_Operating_System_Version_Headline_Label,"Operating System");
|
||||
lv_obj_set_style_text_color(ui_About_Content_Operating_System_Version_Headline_Label, lv_color_hex(0x94A3B8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_About_Content_Operating_System_Version_Headline_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_About_Content_Operating_System_Version_Headline_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_About_Content_Operating_System_Version_ContentLabel = lv_label_create(ui_About_Container_2);
|
||||
lv_obj_set_width( ui_About_Content_Operating_System_Version_ContentLabel, lv_pct(100));
|
||||
lv_obj_set_height( ui_About_Content_Operating_System_Version_ContentLabel, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_About_Content_Operating_System_Version_ContentLabel, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_About_Content_Operating_System_Version_ContentLabel,"Linux 5.4.0-139-generic");
|
||||
lv_obj_set_style_text_color(ui_About_Content_Operating_System_Version_ContentLabel, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_About_Content_Operating_System_Version_ContentLabel, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_About_Content_Operating_System_Version_ContentLabel, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_About_Container_3 = lv_obj_create(ui_About_Screen);
|
||||
lv_obj_remove_style_all(ui_About_Container_3);
|
||||
lv_obj_set_width( ui_About_Container_3, lv_pct(100));
|
||||
lv_obj_set_height( ui_About_Container_3, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_About_Container_3, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_About_Container_3,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_About_Container_3, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_About_Container_3, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_clip_corner(ui_About_Container_3, false, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_About_Container_3, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_About_Container_3, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_About_Content_App_Version_Headline_Label = lv_label_create(ui_About_Container_3);
|
||||
lv_obj_set_width( ui_About_Content_App_Version_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_About_Content_App_Version_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_About_Content_App_Version_Headline_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_About_Content_App_Version_Headline_Label,"JetKVM");
|
||||
lv_obj_set_style_text_color(ui_About_Content_App_Version_Headline_Label, lv_color_hex(0x94A3B8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_About_Content_App_Version_Headline_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_About_Content_App_Version_Headline_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_About_Content_App_Version_Content_Label = lv_label_create(ui_About_Container_3);
|
||||
lv_obj_set_width( ui_About_Content_App_Version_Content_Label, lv_pct(100));
|
||||
lv_obj_set_height( ui_About_Content_App_Version_Content_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_About_Content_App_Version_Content_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_About_Content_App_Version_Content_Label,"v1.0.4");
|
||||
lv_obj_set_style_text_color(ui_About_Content_App_Version_Content_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_About_Content_App_Version_Content_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_About_Content_App_Version_Content_Label, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_add_event_cb(ui_About_Header_Back_Button, ui_event_About_Header_Back_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_About_Screen, ui_event_About_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_About_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_About_Screen) lv_obj_del(ui_About_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_About_Screen= NULL;
|
||||
ui_About_Container_0= NULL;
|
||||
ui_About_Container_1= NULL;
|
||||
ui_About_Header_Back_Button= NULL;
|
||||
ui_About_Header_Back_Button_Icon= NULL;
|
||||
ui_About_Header_Page_Name_Label= NULL;
|
||||
ui_About_Container_2= NULL;
|
||||
ui_About_Content_Operating_System_Version_Headline_Label= NULL;
|
||||
ui_About_Content_Operating_System_Version_ContentLabel= NULL;
|
||||
ui_About_Container_3= NULL;
|
||||
ui_About_Content_App_Version_Headline_Label= NULL;
|
||||
ui_About_Content_App_Version_Content_Label= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_ABOUT_SCREEN_H
|
||||
#define UI_ABOUT_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_About_Screen
|
||||
extern void ui_About_Screen_screen_init(void);
|
||||
extern void ui_About_Screen_screen_destroy(void);
|
||||
extern void ui_event_About_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_About_Screen;
|
||||
extern lv_obj_t *ui_About_Container_0;
|
||||
extern lv_obj_t *ui_About_Container_1;
|
||||
extern void ui_event_About_Header_Back_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_About_Header_Back_Button;
|
||||
extern lv_obj_t *ui_About_Header_Back_Button_Icon;
|
||||
extern lv_obj_t *ui_About_Header_Page_Name_Label;
|
||||
extern lv_obj_t *ui_About_Container_2;
|
||||
extern lv_obj_t *ui_About_Content_Operating_System_Version_Headline_Label;
|
||||
extern lv_obj_t *ui_About_Content_Operating_System_Version_ContentLabel;
|
||||
extern lv_obj_t *ui_About_Container_3;
|
||||
extern lv_obj_t *ui_About_Content_App_Version_Headline_Label;
|
||||
extern lv_obj_t *ui_About_Content_App_Version_Content_Label;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_Boot_Screen;
|
||||
lv_obj_t *ui_Boot_Container_0;
|
||||
lv_obj_t *ui_Boot_Container_1;
|
||||
lv_obj_t *ui_Boot_Logo;
|
||||
lv_obj_t *ui_Boot_Screen_Version;
|
||||
|
||||
// event funtions
|
||||
void ui_event_Boot_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_LEFT ) {
|
||||
lv_indev_wait_release(lv_indev_get_act());
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_MOVE_LEFT, 200, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_Boot_Screen_screen_init(void)
|
||||
{
|
||||
ui_Boot_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_flag( ui_Boot_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_Boot_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Boot_Screen, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_Boot_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Boot_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Boot_Screen, 44, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Boot_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Boot_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Boot_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_Boot_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Boot_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Boot_Container_0 = lv_obj_create(ui_Boot_Screen);
|
||||
lv_obj_remove_style_all(ui_Boot_Container_0);
|
||||
lv_obj_set_width( ui_Boot_Container_0, lv_pct(100));
|
||||
lv_obj_set_height( ui_Boot_Container_0, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Boot_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Boot_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Boot_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Boot_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Boot_Container_0, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Boot_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Boot_Container_1 = lv_obj_create(ui_Boot_Container_0);
|
||||
lv_obj_remove_style_all(ui_Boot_Container_1);
|
||||
lv_obj_set_width( ui_Boot_Container_1, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Boot_Container_1, 1);
|
||||
lv_obj_set_x( ui_Boot_Container_1, 19 );
|
||||
lv_obj_set_y( ui_Boot_Container_1, -5 );
|
||||
lv_obj_set_align( ui_Boot_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Boot_Container_1,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Boot_Container_1, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
lv_obj_clear_flag( ui_Boot_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Boot_Logo = lv_img_create(ui_Boot_Container_1);
|
||||
lv_img_set_src(ui_Boot_Logo, &ui_img_1796371062);
|
||||
lv_obj_set_width( ui_Boot_Logo, LV_SIZE_CONTENT); /// 174
|
||||
lv_obj_set_height( ui_Boot_Logo, LV_SIZE_CONTENT); /// 49
|
||||
lv_obj_set_align( ui_Boot_Logo, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Boot_Logo, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Boot_Logo, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Boot_Screen_Version = lv_label_create(ui_Boot_Container_1);
|
||||
lv_obj_set_width( ui_Boot_Screen_Version, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Boot_Screen_Version, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Boot_Screen_Version, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Boot_Screen_Version,"0.0.1-dev");
|
||||
lv_obj_set_style_text_color(ui_Boot_Screen_Version, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Boot_Screen_Version, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Boot_Screen_Version, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Boot_Screen_Version, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Boot_Screen_Version, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Boot_Screen_Version, 10, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Boot_Screen_Version, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_add_event_cb(ui_Boot_Screen, ui_event_Boot_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_Boot_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_Boot_Screen) lv_obj_del(ui_Boot_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_Boot_Screen= NULL;
|
||||
ui_Boot_Container_0= NULL;
|
||||
ui_Boot_Container_1= NULL;
|
||||
ui_Boot_Logo= NULL;
|
||||
ui_Boot_Screen_Version= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_BOOT_SCREEN_H
|
||||
#define UI_BOOT_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Boot_Screen
|
||||
extern void ui_Boot_Screen_screen_init(void);
|
||||
extern void ui_Boot_Screen_screen_destroy(void);
|
||||
extern void ui_event_Boot_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Boot_Screen;
|
||||
extern lv_obj_t *ui_Boot_Container_0;
|
||||
extern lv_obj_t *ui_Boot_Container_1;
|
||||
extern lv_obj_t *ui_Boot_Logo;
|
||||
extern lv_obj_t *ui_Boot_Screen_Version;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,324 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_Home_Screen;
|
||||
lv_obj_t *ui_Home_Container_0;
|
||||
lv_obj_t *ui_Home_Container_1;
|
||||
lv_obj_t *ui_Home_Header_Logo;
|
||||
lv_obj_t *ui_Home_Container_2;
|
||||
lv_obj_t *ui_Home_Header_Cloud_Status_Icon;
|
||||
lv_obj_t *ui_Home_Header_Cloud_Status_Label;
|
||||
lv_obj_t *ui_Home_Container_3;
|
||||
lv_obj_t *ui_Home_Content_Ip;
|
||||
lv_obj_t *ui_Home_Content_IPv6;
|
||||
lv_obj_t *ui_Home_Content_Mac;
|
||||
lv_obj_t *ui_Divider;
|
||||
lv_obj_t *ui_Status_Area;
|
||||
lv_obj_t *ui_USB_Status1;
|
||||
lv_obj_t *ui_USB_Inidicator;
|
||||
lv_obj_t *ui_Home_Footer_Usb_Icon;
|
||||
lv_obj_t *ui_Home_Footer_Usb_Icon_Label;
|
||||
lv_obj_t *ui_Home_Footer_Usb_Status_Label;
|
||||
lv_obj_t *ui_HDMI_Status;
|
||||
lv_obj_t *ui_HDMI_Indicator;
|
||||
lv_obj_t *ui_Home_Footer_Hdmi_Icon;
|
||||
lv_obj_t *ui_Home_Footer_Hdmi_Icon_Label;
|
||||
lv_obj_t *ui_Home_Footer_Hdmi_Status_Label;
|
||||
|
||||
// event funtions
|
||||
void ui_event_Home_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_LONG_PRESSED) {
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_Home_Screen_screen_init(void)
|
||||
{
|
||||
ui_Home_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_flag( ui_Home_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_Home_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Home_Screen, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_Home_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Home_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Home_Screen, 44, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Home_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Home_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Home_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_Home_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Home_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Home_Container_0 = lv_obj_create(ui_Home_Screen);
|
||||
lv_obj_remove_style_all(ui_Home_Container_0);
|
||||
lv_obj_set_width( ui_Home_Container_0, lv_pct(100));
|
||||
lv_obj_set_height( ui_Home_Container_0, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Home_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Home_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Home_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Home_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Home_Container_0, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Home_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Home_Container_1 = lv_obj_create(ui_Home_Container_0);
|
||||
lv_obj_remove_style_all(ui_Home_Container_1);
|
||||
lv_obj_set_width( ui_Home_Container_1, lv_pct(100));
|
||||
lv_obj_set_height( ui_Home_Container_1, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Home_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Home_Container_1,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Home_Container_1, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Home_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Home_Header_Logo = lv_img_create(ui_Home_Container_1);
|
||||
lv_img_set_src(ui_Home_Header_Logo, &ui_img_jetkvm_png);
|
||||
lv_obj_set_width( ui_Home_Header_Logo, LV_SIZE_CONTENT); /// 116
|
||||
lv_obj_set_height( ui_Home_Header_Logo, LV_SIZE_CONTENT); /// 32
|
||||
lv_obj_set_x( ui_Home_Header_Logo, -2 );
|
||||
lv_obj_set_y( ui_Home_Header_Logo, 0 );
|
||||
lv_obj_set_align( ui_Home_Header_Logo, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Home_Header_Logo, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Home_Header_Logo, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Home_Container_2 = lv_obj_create(ui_Home_Container_1);
|
||||
lv_obj_remove_style_all(ui_Home_Container_2);
|
||||
lv_obj_set_width( ui_Home_Container_2, LV_SIZE_CONTENT); /// 100
|
||||
lv_obj_set_height( ui_Home_Container_2, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Home_Container_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Home_Container_2,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Home_Container_2, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Home_Container_2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Home_Container_2, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Home_Container_2, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Home_Header_Cloud_Status_Icon = lv_img_create(ui_Home_Container_2);
|
||||
lv_img_set_src(ui_Home_Header_Cloud_Status_Icon, &ui_img_cloud_png);
|
||||
lv_obj_set_width( ui_Home_Header_Cloud_Status_Icon, 22);
|
||||
lv_obj_set_height( ui_Home_Header_Cloud_Status_Icon, 22);
|
||||
lv_obj_set_align( ui_Home_Header_Cloud_Status_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Home_Header_Cloud_Status_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Home_Header_Cloud_Status_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Home_Header_Cloud_Status_Label = lv_label_create(ui_Home_Container_2);
|
||||
lv_obj_set_width( ui_Home_Header_Cloud_Status_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Home_Header_Cloud_Status_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Home_Header_Cloud_Status_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Home_Header_Cloud_Status_Label,"2 active");
|
||||
lv_obj_set_style_text_color(ui_Home_Header_Cloud_Status_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Home_Header_Cloud_Status_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Home_Header_Cloud_Status_Label, &ui_font_Font_Book_16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Home_Container_3 = lv_obj_create(ui_Home_Container_0);
|
||||
lv_obj_remove_style_all(ui_Home_Container_3);
|
||||
lv_obj_set_width( ui_Home_Container_3, lv_pct(100));
|
||||
lv_obj_set_height( ui_Home_Container_3, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_x( ui_Home_Container_3, -1 );
|
||||
lv_obj_set_y( ui_Home_Container_3, -8 );
|
||||
lv_obj_set_align( ui_Home_Container_3, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Home_Container_3,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Home_Container_3, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Home_Container_3, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Home_Content_Ip = lv_label_create(ui_Home_Container_3);
|
||||
lv_obj_set_width( ui_Home_Content_Ip, lv_pct(100));
|
||||
lv_obj_set_height( ui_Home_Content_Ip, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_x( ui_Home_Content_Ip, 0 );
|
||||
lv_obj_set_y( ui_Home_Content_Ip, -34 );
|
||||
lv_obj_set_align( ui_Home_Content_Ip, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Home_Content_Ip,"0.0.0.0");
|
||||
lv_obj_set_style_text_color(ui_Home_Content_Ip, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Home_Content_Ip, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Home_Content_Ip, &ui_font_Font_Bold_30, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Home_Content_Ip, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_USER_1 );
|
||||
lv_obj_set_style_text_opa(ui_Home_Content_Ip, 255, LV_PART_MAIN| LV_STATE_USER_1);
|
||||
lv_obj_set_style_text_font(ui_Home_Content_Ip, &ui_font_Font_Bold_30, LV_PART_MAIN| LV_STATE_USER_1);
|
||||
lv_obj_set_style_text_font(ui_Home_Content_Ip, &ui_font_Font_Bold_30, LV_PART_MAIN| LV_STATE_USER_2);
|
||||
|
||||
ui_Home_Content_IPv6 = lv_label_create(ui_Home_Container_3);
|
||||
lv_obj_set_width( ui_Home_Content_IPv6, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Home_Content_IPv6, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_x( ui_Home_Content_IPv6, 0 );
|
||||
lv_obj_set_y( ui_Home_Content_IPv6, 2 );
|
||||
lv_obj_set_align( ui_Home_Content_IPv6, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Home_Content_IPv6,"");
|
||||
lv_obj_add_flag( ui_Home_Content_IPv6, LV_OBJ_FLAG_HIDDEN ); /// Flags
|
||||
lv_obj_set_style_text_color(ui_Home_Content_IPv6, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Home_Content_IPv6, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Home_Content_IPv6, &ui_font_Font_Book_16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Home_Content_Mac = lv_label_create(ui_Home_Container_3);
|
||||
lv_obj_set_width( ui_Home_Content_Mac, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Home_Content_Mac, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Home_Content_Mac, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Home_Content_Mac,"9a:23:b9:84:ef:20");
|
||||
lv_obj_set_style_text_color(ui_Home_Content_Mac, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Home_Content_Mac, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Home_Content_Mac, &ui_font_Font_Book_16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Divider = lv_obj_create(ui_Home_Screen);
|
||||
lv_obj_remove_style_all(ui_Divider);
|
||||
lv_obj_set_height( ui_Divider, 1);
|
||||
lv_obj_set_width( ui_Divider, lv_pct(100));
|
||||
lv_obj_set_x( ui_Divider, -57 );
|
||||
lv_obj_set_y( ui_Divider, 39 );
|
||||
lv_obj_set_align( ui_Divider, LV_ALIGN_CENTER );
|
||||
lv_obj_clear_flag( ui_Divider, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_bg_color(ui_Divider, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Divider, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Area = lv_obj_create(ui_Home_Screen);
|
||||
lv_obj_remove_style_all(ui_Status_Area);
|
||||
lv_obj_set_width( ui_Status_Area, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Area, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Status_Area, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Status_Area,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Status_Area, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Status_Area, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_USB_Status1 = lv_obj_create(ui_Status_Area);
|
||||
lv_obj_remove_style_all(ui_USB_Status1);
|
||||
lv_obj_set_width( ui_USB_Status1, lv_pct(50));
|
||||
lv_obj_set_height( ui_USB_Status1, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_USB_Status1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_USB_Status1,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_USB_Status1, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_USB_Status1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_USB_Status1, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_USB_Status1, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_USB_Inidicator = lv_obj_create(ui_USB_Status1);
|
||||
lv_obj_remove_style_all(ui_USB_Inidicator);
|
||||
lv_obj_set_width( ui_USB_Inidicator, lv_pct(100));
|
||||
lv_obj_set_height( ui_USB_Inidicator, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_USB_Inidicator, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_USB_Inidicator,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_USB_Inidicator, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_USB_Inidicator, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_USB_Inidicator, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_USB_Inidicator, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Home_Footer_Usb_Icon = lv_img_create(ui_USB_Inidicator);
|
||||
lv_img_set_src(ui_Home_Footer_Usb_Icon, &ui_img_usb_png);
|
||||
lv_obj_set_width( ui_Home_Footer_Usb_Icon, LV_SIZE_CONTENT); /// 20
|
||||
lv_obj_set_height( ui_Home_Footer_Usb_Icon, LV_SIZE_CONTENT); /// 20
|
||||
lv_obj_set_align( ui_Home_Footer_Usb_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Home_Footer_Usb_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Home_Footer_Usb_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Home_Footer_Usb_Icon_Label = lv_label_create(ui_USB_Inidicator);
|
||||
lv_obj_set_width( ui_Home_Footer_Usb_Icon_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Home_Footer_Usb_Icon_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Home_Footer_Usb_Icon_Label, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Home_Footer_Usb_Icon_Label,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Home_Footer_Usb_Icon_Label, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_label_set_text(ui_Home_Footer_Usb_Icon_Label,"USB");
|
||||
lv_obj_set_style_text_color(ui_Home_Footer_Usb_Icon_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Home_Footer_Usb_Icon_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Home_Footer_Usb_Icon_Label, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Home_Footer_Usb_Status_Label = lv_label_create(ui_USB_Status1);
|
||||
lv_obj_set_width( ui_Home_Footer_Usb_Status_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Home_Footer_Usb_Status_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Home_Footer_Usb_Status_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Home_Footer_Usb_Status_Label,"Connected");
|
||||
lv_obj_set_style_text_color(ui_Home_Footer_Usb_Status_Label, lv_color_hex(0x22C55E), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Home_Footer_Usb_Status_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Home_Footer_Usb_Status_Label, &ui_font_Font_Book_16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Home_Footer_Usb_Status_Label, lv_color_hex(0x22C55E), LV_PART_MAIN | LV_STATE_USER_1 );
|
||||
lv_obj_set_style_text_opa(ui_Home_Footer_Usb_Status_Label, 255, LV_PART_MAIN| LV_STATE_USER_1);
|
||||
lv_obj_set_style_text_color(ui_Home_Footer_Usb_Status_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_USER_2 );
|
||||
lv_obj_set_style_text_opa(ui_Home_Footer_Usb_Status_Label, 255, LV_PART_MAIN| LV_STATE_USER_2);
|
||||
|
||||
ui_HDMI_Status = lv_obj_create(ui_Status_Area);
|
||||
lv_obj_remove_style_all(ui_HDMI_Status);
|
||||
lv_obj_set_width( ui_HDMI_Status, lv_pct(50));
|
||||
lv_obj_set_height( ui_HDMI_Status, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_HDMI_Status, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_HDMI_Status,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_HDMI_Status, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_END, LV_FLEX_ALIGN_END);
|
||||
lv_obj_clear_flag( ui_HDMI_Status, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_HDMI_Status, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_HDMI_Status, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_HDMI_Indicator = lv_obj_create(ui_HDMI_Status);
|
||||
lv_obj_remove_style_all(ui_HDMI_Indicator);
|
||||
lv_obj_set_width( ui_HDMI_Indicator, lv_pct(100));
|
||||
lv_obj_set_height( ui_HDMI_Indicator, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_HDMI_Indicator, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_HDMI_Indicator,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_HDMI_Indicator, LV_FLEX_ALIGN_END, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_HDMI_Indicator, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_HDMI_Indicator, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_HDMI_Indicator, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Home_Footer_Hdmi_Icon = lv_img_create(ui_HDMI_Indicator);
|
||||
lv_img_set_src(ui_Home_Footer_Hdmi_Icon, &ui_img_hdmi_png);
|
||||
lv_obj_set_width( ui_Home_Footer_Hdmi_Icon, LV_SIZE_CONTENT); /// 20
|
||||
lv_obj_set_height( ui_Home_Footer_Hdmi_Icon, LV_SIZE_CONTENT); /// 20
|
||||
lv_obj_set_align( ui_Home_Footer_Hdmi_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Home_Footer_Hdmi_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Home_Footer_Hdmi_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Home_Footer_Hdmi_Icon_Label = lv_label_create(ui_HDMI_Indicator);
|
||||
lv_obj_set_width( ui_Home_Footer_Hdmi_Icon_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Home_Footer_Hdmi_Icon_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Home_Footer_Hdmi_Icon_Label, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Home_Footer_Hdmi_Icon_Label,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Home_Footer_Hdmi_Icon_Label, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_label_set_text(ui_Home_Footer_Hdmi_Icon_Label,"HDMI");
|
||||
lv_obj_set_style_text_color(ui_Home_Footer_Hdmi_Icon_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Home_Footer_Hdmi_Icon_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Home_Footer_Hdmi_Icon_Label, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Home_Footer_Hdmi_Status_Label = lv_label_create(ui_HDMI_Status);
|
||||
lv_obj_set_width( ui_Home_Footer_Hdmi_Status_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Home_Footer_Hdmi_Status_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Home_Footer_Hdmi_Status_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Home_Footer_Hdmi_Status_Label,"Connected");
|
||||
lv_obj_set_style_text_color(ui_Home_Footer_Hdmi_Status_Label, lv_color_hex(0x22C55E), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Home_Footer_Hdmi_Status_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Home_Footer_Hdmi_Status_Label, &ui_font_Font_Book_16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Home_Footer_Hdmi_Status_Label, lv_color_hex(0x22C55E), LV_PART_MAIN | LV_STATE_USER_1 );
|
||||
lv_obj_set_style_text_opa(ui_Home_Footer_Hdmi_Status_Label, 255, LV_PART_MAIN| LV_STATE_USER_1);
|
||||
lv_obj_set_style_text_color(ui_Home_Footer_Hdmi_Status_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_USER_2 );
|
||||
lv_obj_set_style_text_opa(ui_Home_Footer_Hdmi_Status_Label, 255, LV_PART_MAIN| LV_STATE_USER_2);
|
||||
|
||||
lv_obj_add_event_cb(ui_Home_Screen, ui_event_Home_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_Home_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_Home_Screen) lv_obj_del(ui_Home_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_Home_Screen= NULL;
|
||||
ui_Home_Container_0= NULL;
|
||||
ui_Home_Container_1= NULL;
|
||||
ui_Home_Header_Logo= NULL;
|
||||
ui_Home_Container_2= NULL;
|
||||
ui_Home_Header_Cloud_Status_Icon= NULL;
|
||||
ui_Home_Header_Cloud_Status_Label= NULL;
|
||||
ui_Home_Container_3= NULL;
|
||||
ui_Home_Content_Ip= NULL;
|
||||
ui_Home_Content_IPv6= NULL;
|
||||
ui_Home_Content_Mac= NULL;
|
||||
ui_Divider= NULL;
|
||||
ui_Status_Area= NULL;
|
||||
ui_USB_Status1= NULL;
|
||||
ui_USB_Inidicator= NULL;
|
||||
ui_Home_Footer_Usb_Icon= NULL;
|
||||
ui_Home_Footer_Usb_Icon_Label= NULL;
|
||||
ui_Home_Footer_Usb_Status_Label= NULL;
|
||||
ui_HDMI_Status= NULL;
|
||||
ui_HDMI_Indicator= NULL;
|
||||
ui_Home_Footer_Hdmi_Icon= NULL;
|
||||
ui_Home_Footer_Hdmi_Icon_Label= NULL;
|
||||
ui_Home_Footer_Hdmi_Status_Label= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_HOME_SCREEN_H
|
||||
#define UI_HOME_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Home_Screen
|
||||
extern void ui_Home_Screen_screen_init(void);
|
||||
extern void ui_Home_Screen_screen_destroy(void);
|
||||
extern void ui_event_Home_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Home_Screen;
|
||||
extern lv_obj_t *ui_Home_Container_0;
|
||||
extern lv_obj_t *ui_Home_Container_1;
|
||||
extern lv_obj_t *ui_Home_Header_Logo;
|
||||
extern lv_obj_t *ui_Home_Container_2;
|
||||
extern lv_obj_t *ui_Home_Header_Cloud_Status_Icon;
|
||||
extern lv_obj_t *ui_Home_Header_Cloud_Status_Label;
|
||||
extern lv_obj_t *ui_Home_Container_3;
|
||||
extern lv_obj_t *ui_Home_Content_Ip;
|
||||
extern lv_obj_t *ui_Home_Content_IPv6;
|
||||
extern lv_obj_t *ui_Home_Content_Mac;
|
||||
extern lv_obj_t *ui_Divider;
|
||||
extern lv_obj_t *ui_Status_Area;
|
||||
extern lv_obj_t *ui_USB_Status1;
|
||||
extern lv_obj_t *ui_USB_Inidicator;
|
||||
extern lv_obj_t *ui_Home_Footer_Usb_Icon;
|
||||
extern lv_obj_t *ui_Home_Footer_Usb_Icon_Label;
|
||||
extern lv_obj_t *ui_Home_Footer_Usb_Status_Label;
|
||||
extern lv_obj_t *ui_HDMI_Status;
|
||||
extern lv_obj_t *ui_HDMI_Indicator;
|
||||
extern lv_obj_t *ui_Home_Footer_Hdmi_Icon;
|
||||
extern lv_obj_t *ui_Home_Footer_Hdmi_Icon_Label;
|
||||
extern lv_obj_t *ui_Home_Footer_Hdmi_Status_Label;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,557 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Screen;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Container_0;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Container_1;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Header_IP_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Header_IP_Type;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Container_2;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Container_3;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Container_4;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_1;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_2;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_3;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Container_5;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_4;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_5;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_6;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Container_6;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_7;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_8;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_9;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Container_7;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_10;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_11;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_12;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Container_8;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm;
|
||||
lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label;
|
||||
|
||||
// event funtions
|
||||
void ui_event_Manual_Dhcp_Wizard_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_LEFT ) {
|
||||
lv_indev_wait_release(lv_indev_get_act());
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Manual_Dhcp_Wizard_Content_Number_Button_Cancel( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Network_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Network_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_Manual_Dhcp_Wizard_Screen_screen_init(void)
|
||||
{
|
||||
ui_Manual_Dhcp_Wizard_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_flag( ui_Manual_Dhcp_Wizard_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Screen, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Manual_Dhcp_Wizard_Screen, 36, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Manual_Dhcp_Wizard_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Manual_Dhcp_Wizard_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Manual_Dhcp_Wizard_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_Manual_Dhcp_Wizard_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Manual_Dhcp_Wizard_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Container_0 = lv_obj_create(ui_Manual_Dhcp_Wizard_Screen);
|
||||
lv_obj_remove_style_all(ui_Manual_Dhcp_Wizard_Container_0);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Container_0, lv_pct(100));
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Container_0, lv_pct(100));
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Manual_Dhcp_Wizard_Container_0, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Manual_Dhcp_Wizard_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Container_1 = lv_obj_create(ui_Manual_Dhcp_Wizard_Container_0);
|
||||
lv_obj_remove_style_all(ui_Manual_Dhcp_Wizard_Container_1);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Container_1, lv_pct(100));
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Container_1, LV_SIZE_CONTENT); /// 40
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Container_1,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Container_1, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_END, LV_FLEX_ALIGN_END);
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Header_IP_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Container_1);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Header_IP_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Header_IP_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Header_IP_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Header_IP_Label,"192.168.255.255");
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Header_IP_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Header_IP_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_letter_space(ui_Manual_Dhcp_Wizard_Header_IP_Label, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_line_space(ui_Manual_Dhcp_Wizard_Header_IP_Label, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Header_IP_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Header_IP_Type = lv_label_create(ui_Manual_Dhcp_Wizard_Container_1);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Header_IP_Type, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Header_IP_Type, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Header_IP_Type, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Header_IP_Type,"Subnet");
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Header_IP_Type, lv_color_hex(0x94A3B8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Header_IP_Type, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Header_IP_Type, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Container_2 = lv_obj_create(ui_Manual_Dhcp_Wizard_Container_0);
|
||||
lv_obj_remove_style_all(ui_Manual_Dhcp_Wizard_Container_2);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Container_2, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Container_2, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Container_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Container_2,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Container_2, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Container_2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Manual_Dhcp_Wizard_Container_2, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Manual_Dhcp_Wizard_Container_2, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Container_3 = lv_obj_create(ui_Manual_Dhcp_Wizard_Container_2);
|
||||
lv_obj_remove_style_all(ui_Manual_Dhcp_Wizard_Container_3);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Container_3, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Container_3, 1);
|
||||
lv_obj_set_x( ui_Manual_Dhcp_Wizard_Container_3, -25 );
|
||||
lv_obj_set_y( ui_Manual_Dhcp_Wizard_Container_3, -36 );
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Container_3, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Container_3,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Container_3, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Container_3, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Manual_Dhcp_Wizard_Container_3, 7, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Manual_Dhcp_Wizard_Container_3, 7, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Container_4 = lv_obj_create(ui_Manual_Dhcp_Wizard_Container_3);
|
||||
lv_obj_remove_style_all(ui_Manual_Dhcp_Wizard_Container_4);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Container_4, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Container_4, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Container_4, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Container_4,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Container_4, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Container_4, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Manual_Dhcp_Wizard_Container_4, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Manual_Dhcp_Wizard_Container_4, 7, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_1 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_4);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_1, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_1, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_1, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_1, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_1, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_1, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_1, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_1, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_1, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_1, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_1);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label,"1");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_2 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_4);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_2, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_2, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_2, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_2, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_2, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_2, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_2, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_2, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_2, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_2, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_2);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label,"2");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_3 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_4);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_3, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_3, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_3, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_3, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_3, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_3, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_3, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_3, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_3, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_3, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_3, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_3);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label,"3");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Container_5 = lv_obj_create(ui_Manual_Dhcp_Wizard_Container_3);
|
||||
lv_obj_remove_style_all(ui_Manual_Dhcp_Wizard_Container_5);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Container_5, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Container_5, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Container_5, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Container_5,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Container_5, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Container_5, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Manual_Dhcp_Wizard_Container_5, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Manual_Dhcp_Wizard_Container_5, 7, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_4 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_5);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_4, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_4, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_4, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_4, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_4, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_4, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_4, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_4, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_4, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_4, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_4, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_4);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label,"4");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_5 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_5);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_5, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_5, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_5, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_5, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_5, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_5, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_5, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_5, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_5, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_5, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_5, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_5);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label,"5");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_6 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_5);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_6, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_6, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_6, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_6, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_6, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_6, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_6, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_6, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_6, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_6, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_6, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_6);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label,"6");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Container_6 = lv_obj_create(ui_Manual_Dhcp_Wizard_Container_3);
|
||||
lv_obj_remove_style_all(ui_Manual_Dhcp_Wizard_Container_6);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Container_6, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Container_6, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Container_6, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Container_6,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Container_6, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Container_6, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Manual_Dhcp_Wizard_Container_6, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Manual_Dhcp_Wizard_Container_6, 7, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_7 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_6);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_7, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_7, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_7, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_7, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_7, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_7, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_7, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_7, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_7, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_7, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_7, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_7);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label,"7");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_8 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_6);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_8, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_8, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_8, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_8, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_8, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_8, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_8, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_8, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_8, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_8, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_8, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_8);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label,"8");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_9 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_6);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_9, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_9, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_9, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_9, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_9, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_9, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_9, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_9, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_9, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_9, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_9, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_9);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label,"9");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Container_7 = lv_obj_create(ui_Manual_Dhcp_Wizard_Container_3);
|
||||
lv_obj_remove_style_all(ui_Manual_Dhcp_Wizard_Container_7);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Container_7, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Container_7, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Container_7, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Container_7,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Container_7, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Container_7, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Manual_Dhcp_Wizard_Container_7, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Manual_Dhcp_Wizard_Container_7, 7, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_10 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_7);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_10, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_10, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_10, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_10, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_10, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_10, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_10, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_10, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_10, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_10, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_10, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_10);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label,".");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_11 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_7);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_11, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_11, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_11, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_11, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_11, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_11, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_11, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_11, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_11, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_11, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_11, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label = lv_label_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_11);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label, LV_SIZE_CONTENT); /// 0
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label,"0");
|
||||
lv_obj_set_style_text_font(ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label, lv_color_hex(0x808080), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_12 = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_7);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_12, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_12, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_12, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_12, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_12, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_12, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_12, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_12, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_12, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_12, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_12, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label = lv_img_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_12);
|
||||
lv_img_set_src(ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label, &ui_img_1318103182);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label, LV_SIZE_CONTENT); /// 17
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label, LV_SIZE_CONTENT); /// 17
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Container_8 = lv_obj_create(ui_Manual_Dhcp_Wizard_Container_2);
|
||||
lv_obj_remove_style_all(ui_Manual_Dhcp_Wizard_Container_8);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Container_8, 52);
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Container_8, lv_pct(100));
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Container_8, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Manual_Dhcp_Wizard_Container_8,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Manual_Dhcp_Wizard_Container_8, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Container_8, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Manual_Dhcp_Wizard_Container_8, 7, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Manual_Dhcp_Wizard_Container_8, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_8);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label = lv_img_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel);
|
||||
lv_img_set_src(ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label, &ui_img_2138704335);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label, LV_SIZE_CONTENT); /// 25
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label, LV_SIZE_CONTENT); /// 24
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm = lv_btn_create(ui_Manual_Dhcp_Wizard_Container_8);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, 1);
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_border_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_border_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label = lv_img_create(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm);
|
||||
lv_img_set_src(ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label, &ui_img_536642073);
|
||||
lv_obj_set_width( ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label, LV_SIZE_CONTENT); /// 19
|
||||
lv_obj_set_height( ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label, LV_SIZE_CONTENT); /// 14
|
||||
lv_obj_set_align( ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
lv_obj_add_event_cb(ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, ui_event_Manual_Dhcp_Wizard_Content_Number_Button_Cancel, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Manual_Dhcp_Wizard_Screen, ui_event_Manual_Dhcp_Wizard_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_Manual_Dhcp_Wizard_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_Manual_Dhcp_Wizard_Screen) lv_obj_del(ui_Manual_Dhcp_Wizard_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_Manual_Dhcp_Wizard_Screen= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Container_0= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Container_1= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Header_IP_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Header_IP_Type= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Container_2= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Container_3= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Container_4= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_1= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_2= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_3= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Container_5= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_4= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_5= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_6= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Container_6= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_7= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_8= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_9= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Container_7= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_10= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_11= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_12= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Container_8= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm= NULL;
|
||||
ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_MANUAL_DHCP_WIZARD_SCREEN_H
|
||||
#define UI_MANUAL_DHCP_WIZARD_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Manual_Dhcp_Wizard_Screen
|
||||
extern void ui_Manual_Dhcp_Wizard_Screen_screen_init(void);
|
||||
extern void ui_Manual_Dhcp_Wizard_Screen_screen_destroy(void);
|
||||
extern void ui_event_Manual_Dhcp_Wizard_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Screen;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Container_0;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Container_1;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Header_IP_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Header_IP_Type;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Container_2;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Container_3;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Container_4;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_1;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_1_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_2;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_2_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_3;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_3_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Container_5;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_4;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_4_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_5;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_5_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_6;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_6_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Container_6;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_7;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_7_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_8;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_8_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_9;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_9_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Container_7;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_10;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_10_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_11;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_11_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_12;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_12_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Container_8;
|
||||
extern void ui_event_Manual_Dhcp_Wizard_Content_Number_Button_Cancel( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_Cancel_Label;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm;
|
||||
extern lv_obj_t *ui_Manual_Dhcp_Wizard_Content_Number_Button_Confirm_Label;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,272 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_Network_Screen;
|
||||
lv_obj_t *ui_Network_Container_0;
|
||||
lv_obj_t *ui_Network_Container_1;
|
||||
lv_obj_t *ui_Network_Header_Back_Button;
|
||||
lv_obj_t *ui_Network_Header_Back_Button_Icon;
|
||||
lv_obj_t *ui_Network_Header_Page_Name_Label;
|
||||
lv_obj_t *ui_Network_Content_Section_Headline;
|
||||
lv_obj_t *ui_Network_Container_2;
|
||||
lv_obj_t *ui_Network_Content_IP_Automatic_Button;
|
||||
lv_obj_t *ui_Network_Content_IP_Automatic_Button_Label;
|
||||
lv_obj_t *ui_Network_Content_IP_Automatic_Button_Checkbox_Icon;
|
||||
lv_obj_t *ui_Network_Content_IP_Divider;
|
||||
lv_obj_t *ui_Network_Content_IP_Manual_Button;
|
||||
lv_obj_t *ui_Network_Content_IP_Manual_Button_Label;
|
||||
lv_obj_t *ui_Network_Content_IP_Manual_Button_Checkbox_Icon;
|
||||
lv_obj_t *ui_Network_Content_Configure_Manually_Button;
|
||||
lv_obj_t *ui_Network_Content_Configure_Manually_Button_Label;
|
||||
|
||||
// event funtions
|
||||
void ui_event_Network_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_RIGHT ) {
|
||||
lv_indev_wait_release(lv_indev_get_act());
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Network_Header_Back_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Network_Content_Configure_Manually_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Manual_Dhcp_Wizard_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Manual_Dhcp_Wizard_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_Network_Screen_screen_init(void)
|
||||
{
|
||||
ui_Network_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_flag( ui_Network_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_Network_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Network_Screen, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_Network_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Network_Screen, 44, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Network_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Network_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Network_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_Network_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Network_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Container_0 = lv_obj_create(ui_Network_Screen);
|
||||
lv_obj_remove_style_all(ui_Network_Container_0);
|
||||
lv_obj_set_width( ui_Network_Container_0, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Container_0, LV_SIZE_CONTENT); /// 100
|
||||
lv_obj_set_x( ui_Network_Container_0, 75 );
|
||||
lv_obj_set_y( ui_Network_Container_0, -33 );
|
||||
lv_obj_set_align( ui_Network_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Network_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Network_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Network_Container_0, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Network_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Container_1 = lv_obj_create(ui_Network_Container_0);
|
||||
lv_obj_remove_style_all(ui_Network_Container_1);
|
||||
lv_obj_set_width( ui_Network_Container_1, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Container_1, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Network_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Container_1,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Network_Container_1, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
lv_obj_clear_flag( ui_Network_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Network_Header_Back_Button = lv_btn_create(ui_Network_Container_1);
|
||||
lv_obj_set_width( ui_Network_Header_Back_Button, 32);
|
||||
lv_obj_set_height( ui_Network_Header_Back_Button, 32);
|
||||
lv_obj_set_align( ui_Network_Header_Back_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_add_state( ui_Network_Header_Back_Button, LV_STATE_PRESSED ); /// States
|
||||
lv_obj_set_style_radius(ui_Network_Header_Back_Button, 10000, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Network_Header_Back_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Network_Header_Back_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Network_Header_Back_Button_Icon = lv_img_create(ui_Network_Header_Back_Button);
|
||||
lv_img_set_src(ui_Network_Header_Back_Button_Icon, &ui_img_352891484);
|
||||
lv_obj_set_width( ui_Network_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 8
|
||||
lv_obj_set_height( ui_Network_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 12
|
||||
lv_obj_set_align( ui_Network_Header_Back_Button_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Network_Header_Back_Button_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Network_Header_Back_Button_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Network_Header_Page_Name_Label = lv_label_create(ui_Network_Container_1);
|
||||
lv_obj_set_width( ui_Network_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Network_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Network_Header_Page_Name_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Network_Header_Page_Name_Label,"Network");
|
||||
lv_obj_set_style_text_color(ui_Network_Header_Page_Name_Label, lv_color_hex(0x1D4ED8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Network_Header_Page_Name_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Network_Header_Page_Name_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Content_Section_Headline = lv_label_create(ui_Network_Screen);
|
||||
lv_obj_set_width( ui_Network_Content_Section_Headline, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Network_Content_Section_Headline, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Network_Content_Section_Headline, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Network_Content_Section_Headline,"IPv4 Settings");
|
||||
lv_obj_set_style_text_color(ui_Network_Content_Section_Headline, lv_color_hex(0x94A3B8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Network_Content_Section_Headline, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Network_Content_Section_Headline, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Container_2 = lv_obj_create(ui_Network_Screen);
|
||||
lv_obj_remove_style_all(ui_Network_Container_2);
|
||||
lv_obj_set_width( ui_Network_Container_2, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Container_2, LV_SIZE_CONTENT); /// 500
|
||||
lv_obj_set_align( ui_Network_Container_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Container_2,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Network_Container_2, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Network_Container_2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_radius(ui_Network_Container_2, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_clip_corner(ui_Network_Container_2, true, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_Network_Container_2, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Network_Container_2, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Content_IP_Automatic_Button = lv_btn_create(ui_Network_Container_2);
|
||||
lv_obj_set_width( ui_Network_Content_IP_Automatic_Button, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Content_IP_Automatic_Button, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Network_Content_IP_Automatic_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Content_IP_Automatic_Button,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Network_Content_IP_Automatic_Button, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_radius(ui_Network_Content_IP_Automatic_Button, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Network_Content_IP_Automatic_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Content_IP_Automatic_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Network_Content_IP_Automatic_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Network_Content_IP_Automatic_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Network_Content_IP_Automatic_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Network_Content_IP_Automatic_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Network_Content_IP_Automatic_Button, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Network_Content_IP_Automatic_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Content_IP_Automatic_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Network_Content_IP_Automatic_Button_Label = lv_label_create(ui_Network_Content_IP_Automatic_Button);
|
||||
lv_obj_set_width( ui_Network_Content_IP_Automatic_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Network_Content_IP_Automatic_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Network_Content_IP_Automatic_Button_Label, LV_ALIGN_LEFT_MID );
|
||||
lv_label_set_text(ui_Network_Content_IP_Automatic_Button_Label,"Automatic");
|
||||
lv_obj_set_style_text_color(ui_Network_Content_IP_Automatic_Button_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Network_Content_IP_Automatic_Button_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Network_Content_IP_Automatic_Button_Label, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Content_IP_Automatic_Button_Checkbox_Icon = lv_obj_create(ui_Network_Content_IP_Automatic_Button);
|
||||
lv_obj_remove_style_all(ui_Network_Content_IP_Automatic_Button_Checkbox_Icon);
|
||||
lv_obj_set_width( ui_Network_Content_IP_Automatic_Button_Checkbox_Icon, 19);
|
||||
lv_obj_set_height( ui_Network_Content_IP_Automatic_Button_Checkbox_Icon, 14);
|
||||
lv_obj_set_align( ui_Network_Content_IP_Automatic_Button_Checkbox_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_clear_flag( ui_Network_Content_IP_Automatic_Button_Checkbox_Icon, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_bg_img_src( ui_Network_Content_IP_Automatic_Button_Checkbox_Icon, &ui_img_536642073, LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_img_opa(ui_Network_Content_IP_Automatic_Button_Checkbox_Icon, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Content_IP_Divider = lv_obj_create(ui_Network_Container_2);
|
||||
lv_obj_remove_style_all(ui_Network_Content_IP_Divider);
|
||||
lv_obj_set_height( ui_Network_Content_IP_Divider, 1);
|
||||
lv_obj_set_width( ui_Network_Content_IP_Divider, lv_pct(100));
|
||||
lv_obj_set_align( ui_Network_Content_IP_Divider, LV_ALIGN_CENTER );
|
||||
lv_obj_clear_flag( ui_Network_Content_IP_Divider, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_bg_color(ui_Network_Content_IP_Divider, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Content_IP_Divider, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Content_IP_Manual_Button = lv_btn_create(ui_Network_Container_2);
|
||||
lv_obj_set_width( ui_Network_Content_IP_Manual_Button, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Content_IP_Manual_Button, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Network_Content_IP_Manual_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Content_IP_Manual_Button,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Network_Content_IP_Manual_Button, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_radius(ui_Network_Content_IP_Manual_Button, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Network_Content_IP_Manual_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Content_IP_Manual_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Network_Content_IP_Manual_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Network_Content_IP_Manual_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Network_Content_IP_Manual_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Network_Content_IP_Manual_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Network_Content_IP_Manual_Button, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Network_Content_IP_Manual_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Content_IP_Manual_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Network_Content_IP_Manual_Button_Label = lv_label_create(ui_Network_Content_IP_Manual_Button);
|
||||
lv_obj_set_width( ui_Network_Content_IP_Manual_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Network_Content_IP_Manual_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Network_Content_IP_Manual_Button_Label, LV_ALIGN_LEFT_MID );
|
||||
lv_label_set_text(ui_Network_Content_IP_Manual_Button_Label,"Manual");
|
||||
lv_obj_set_style_text_color(ui_Network_Content_IP_Manual_Button_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Network_Content_IP_Manual_Button_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Network_Content_IP_Manual_Button_Label, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Content_IP_Manual_Button_Checkbox_Icon = lv_obj_create(ui_Network_Content_IP_Manual_Button);
|
||||
lv_obj_remove_style_all(ui_Network_Content_IP_Manual_Button_Checkbox_Icon);
|
||||
lv_obj_set_width( ui_Network_Content_IP_Manual_Button_Checkbox_Icon, 19);
|
||||
lv_obj_set_height( ui_Network_Content_IP_Manual_Button_Checkbox_Icon, 14);
|
||||
lv_obj_set_align( ui_Network_Content_IP_Manual_Button_Checkbox_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_clear_flag( ui_Network_Content_IP_Manual_Button_Checkbox_Icon, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_bg_img_src( ui_Network_Content_IP_Manual_Button_Checkbox_Icon, &ui_img_536642073, LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
|
||||
ui_Network_Content_Configure_Manually_Button = lv_btn_create(ui_Network_Screen);
|
||||
lv_obj_set_width( ui_Network_Content_Configure_Manually_Button, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Content_Configure_Manually_Button, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Network_Content_Configure_Manually_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Network_Content_Configure_Manually_Button, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Network_Content_Configure_Manually_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Content_Configure_Manually_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Network_Content_Configure_Manually_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Network_Content_Configure_Manually_Button, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Network_Content_Configure_Manually_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Network_Content_Configure_Manually_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Network_Content_Configure_Manually_Button, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Network_Content_Configure_Manually_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Content_Configure_Manually_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Network_Content_Configure_Manually_Button_Label = lv_label_create(ui_Network_Content_Configure_Manually_Button);
|
||||
lv_obj_set_width( ui_Network_Content_Configure_Manually_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Network_Content_Configure_Manually_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Network_Content_Configure_Manually_Button_Label, LV_ALIGN_LEFT_MID );
|
||||
lv_label_set_text(ui_Network_Content_Configure_Manually_Button_Label,"Configure IPv4");
|
||||
lv_obj_set_style_text_color(ui_Network_Content_Configure_Manually_Button_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Network_Content_Configure_Manually_Button_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Network_Content_Configure_Manually_Button_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_add_event_cb(ui_Network_Header_Back_Button, ui_event_Network_Header_Back_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Network_Content_Configure_Manually_Button, ui_event_Network_Content_Configure_Manually_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Network_Screen, ui_event_Network_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_Network_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_Network_Screen) lv_obj_del(ui_Network_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_Network_Screen= NULL;
|
||||
ui_Network_Container_0= NULL;
|
||||
ui_Network_Container_1= NULL;
|
||||
ui_Network_Header_Back_Button= NULL;
|
||||
ui_Network_Header_Back_Button_Icon= NULL;
|
||||
ui_Network_Header_Page_Name_Label= NULL;
|
||||
ui_Network_Content_Section_Headline= NULL;
|
||||
ui_Network_Container_2= NULL;
|
||||
ui_Network_Content_IP_Automatic_Button= NULL;
|
||||
ui_Network_Content_IP_Automatic_Button_Label= NULL;
|
||||
ui_Network_Content_IP_Automatic_Button_Checkbox_Icon= NULL;
|
||||
ui_Network_Content_IP_Divider= NULL;
|
||||
ui_Network_Content_IP_Manual_Button= NULL;
|
||||
ui_Network_Content_IP_Manual_Button_Label= NULL;
|
||||
ui_Network_Content_IP_Manual_Button_Checkbox_Icon= NULL;
|
||||
ui_Network_Content_Configure_Manually_Button= NULL;
|
||||
ui_Network_Content_Configure_Manually_Button_Label= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_NETWORK_SCREEN_H
|
||||
#define UI_NETWORK_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Network_Screen
|
||||
extern void ui_Network_Screen_screen_init(void);
|
||||
extern void ui_Network_Screen_screen_destroy(void);
|
||||
extern void ui_event_Network_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Network_Screen;
|
||||
extern lv_obj_t *ui_Network_Container_0;
|
||||
extern lv_obj_t *ui_Network_Container_1;
|
||||
extern void ui_event_Network_Header_Back_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Network_Header_Back_Button;
|
||||
extern lv_obj_t *ui_Network_Header_Back_Button_Icon;
|
||||
extern lv_obj_t *ui_Network_Header_Page_Name_Label;
|
||||
extern lv_obj_t *ui_Network_Content_Section_Headline;
|
||||
extern lv_obj_t *ui_Network_Container_2;
|
||||
extern lv_obj_t *ui_Network_Content_IP_Automatic_Button;
|
||||
extern lv_obj_t *ui_Network_Content_IP_Automatic_Button_Label;
|
||||
extern lv_obj_t *ui_Network_Content_IP_Automatic_Button_Checkbox_Icon;
|
||||
extern lv_obj_t *ui_Network_Content_IP_Divider;
|
||||
extern lv_obj_t *ui_Network_Content_IP_Manual_Button;
|
||||
extern lv_obj_t *ui_Network_Content_IP_Manual_Button_Label;
|
||||
extern lv_obj_t *ui_Network_Content_IP_Manual_Button_Checkbox_Icon;
|
||||
extern void ui_event_Network_Content_Configure_Manually_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Network_Content_Configure_Manually_Button;
|
||||
extern lv_obj_t *ui_Network_Content_Configure_Manually_Button_Label;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,200 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_Network_Setup_Failed_Screen;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Container_0;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Container_1;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Header_Logo;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Container_2;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Container_3;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Container_4;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Content_Headline;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Content_Sub_Title;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Content_Button;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Content_Button_Label;
|
||||
lv_obj_t *ui_Network_Setup_Failed_Content_Button_Icon;
|
||||
|
||||
// event funtions
|
||||
void ui_event_Network_Setup_Failed_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_LEFT ) {
|
||||
lv_indev_wait_release(lv_indev_get_act());
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_MOVE_LEFT, 200, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Network_Setup_Failed_Content_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Network_Screen, LV_SCR_LOAD_ANIM_FADE_ON, 200, 0, &ui_Network_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_Network_Setup_Failed_Screen_screen_init(void)
|
||||
{
|
||||
ui_Network_Setup_Failed_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_flag( ui_Network_Setup_Failed_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_Network_Setup_Failed_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Network_Setup_Failed_Screen, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_Network_Setup_Failed_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Setup_Failed_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Network_Setup_Failed_Screen, 44, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Network_Setup_Failed_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Network_Setup_Failed_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Network_Setup_Failed_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_Network_Setup_Failed_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Network_Setup_Failed_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Setup_Failed_Container_0 = lv_obj_create(ui_Network_Setup_Failed_Screen);
|
||||
lv_obj_remove_style_all(ui_Network_Setup_Failed_Container_0);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Container_0, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Network_Setup_Failed_Container_0, 1);
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Setup_Failed_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Network_Setup_Failed_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Network_Setup_Failed_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Network_Setup_Failed_Container_0, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Network_Setup_Failed_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Setup_Failed_Container_1 = lv_obj_create(ui_Network_Setup_Failed_Container_0);
|
||||
lv_obj_remove_style_all(ui_Network_Setup_Failed_Container_1);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Container_1, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Setup_Failed_Container_1, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Setup_Failed_Container_1,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Network_Setup_Failed_Container_1, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Network_Setup_Failed_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Network_Setup_Failed_Header_Logo = lv_img_create(ui_Network_Setup_Failed_Container_1);
|
||||
lv_img_set_src(ui_Network_Setup_Failed_Header_Logo, &ui_img_jetkvm_png);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Header_Logo, LV_SIZE_CONTENT); /// 116
|
||||
lv_obj_set_height( ui_Network_Setup_Failed_Header_Logo, LV_SIZE_CONTENT); /// 32
|
||||
lv_obj_set_x( ui_Network_Setup_Failed_Header_Logo, -2 );
|
||||
lv_obj_set_y( ui_Network_Setup_Failed_Header_Logo, 0 );
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Header_Logo, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Network_Setup_Failed_Header_Logo, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Network_Setup_Failed_Header_Logo, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Network_Setup_Failed_Container_2 = lv_obj_create(ui_Network_Setup_Failed_Container_0);
|
||||
lv_obj_remove_style_all(ui_Network_Setup_Failed_Container_2);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Container_2, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Network_Setup_Failed_Container_2, 1);
|
||||
lv_obj_set_x( ui_Network_Setup_Failed_Container_2, 1 );
|
||||
lv_obj_set_y( ui_Network_Setup_Failed_Container_2, 20 );
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Container_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Setup_Failed_Container_2,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Network_Setup_Failed_Container_2, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Network_Setup_Failed_Container_2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Network_Setup_Failed_Container_3 = lv_obj_create(ui_Network_Setup_Failed_Container_2);
|
||||
lv_obj_remove_style_all(ui_Network_Setup_Failed_Container_3);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Container_3, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Network_Setup_Failed_Container_3, 1);
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Container_3, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Setup_Failed_Container_3,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Network_Setup_Failed_Container_3, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
lv_obj_clear_flag( ui_Network_Setup_Failed_Container_3, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
lv_obj_set_style_pad_row(ui_Network_Setup_Failed_Container_3, 0, LV_PART_SCROLLBAR| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Network_Setup_Failed_Container_3, 0, LV_PART_SCROLLBAR| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Setup_Failed_Container_4 = lv_obj_create(ui_Network_Setup_Failed_Container_3);
|
||||
lv_obj_remove_style_all(ui_Network_Setup_Failed_Container_4);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Container_4, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Setup_Failed_Container_4, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Container_4, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Setup_Failed_Container_4,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Network_Setup_Failed_Container_4, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Network_Setup_Failed_Container_4, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_left(ui_Network_Setup_Failed_Container_4, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Network_Setup_Failed_Container_4, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Network_Setup_Failed_Container_4, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Network_Setup_Failed_Container_4, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Setup_Failed_Content_Headline = lv_label_create(ui_Network_Setup_Failed_Container_4);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Content_Headline, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Setup_Failed_Content_Headline, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Content_Headline, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Network_Setup_Failed_Content_Headline,"DHCP Error");
|
||||
lv_obj_set_style_text_color(ui_Network_Setup_Failed_Content_Headline, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Network_Setup_Failed_Content_Headline, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(ui_Network_Setup_Failed_Content_Headline, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Network_Setup_Failed_Content_Headline, &ui_font_Font_Bold_30, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Setup_Failed_Content_Sub_Title = lv_label_create(ui_Network_Setup_Failed_Container_4);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Content_Sub_Title, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Setup_Failed_Content_Sub_Title, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Content_Sub_Title, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Network_Setup_Failed_Content_Sub_Title,"Cannot obtain IP address");
|
||||
lv_obj_set_style_text_color(ui_Network_Setup_Failed_Content_Sub_Title, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Network_Setup_Failed_Content_Sub_Title, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(ui_Network_Setup_Failed_Content_Sub_Title, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Network_Setup_Failed_Content_Sub_Title, &ui_font_Font_Book_16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Setup_Failed_Content_Button = lv_btn_create(ui_Network_Setup_Failed_Container_3);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Content_Button, lv_pct(100));
|
||||
lv_obj_set_height( ui_Network_Setup_Failed_Content_Button, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Content_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Network_Setup_Failed_Content_Button,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Network_Setup_Failed_Content_Button, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
lv_obj_set_style_radius(ui_Network_Setup_Failed_Content_Button, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Network_Setup_Failed_Content_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Setup_Failed_Content_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Network_Setup_Failed_Content_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Network_Setup_Failed_Content_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Network_Setup_Failed_Content_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Network_Setup_Failed_Content_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Network_Setup_Failed_Content_Button, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Network_Setup_Failed_Content_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Network_Setup_Failed_Content_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Network_Setup_Failed_Content_Button_Label = lv_label_create(ui_Network_Setup_Failed_Content_Button);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Content_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Network_Setup_Failed_Content_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Content_Button_Label, LV_ALIGN_LEFT_MID );
|
||||
lv_label_set_text(ui_Network_Setup_Failed_Content_Button_Label,"Network Settings");
|
||||
lv_obj_set_style_text_color(ui_Network_Setup_Failed_Content_Button_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Network_Setup_Failed_Content_Button_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Network_Setup_Failed_Content_Button_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Network_Setup_Failed_Content_Button_Icon = lv_img_create(ui_Network_Setup_Failed_Content_Button);
|
||||
lv_img_set_src(ui_Network_Setup_Failed_Content_Button_Icon, &ui_img_1582207408);
|
||||
lv_obj_set_width( ui_Network_Setup_Failed_Content_Button_Icon, LV_SIZE_CONTENT); /// 21
|
||||
lv_obj_set_height( ui_Network_Setup_Failed_Content_Button_Icon, LV_SIZE_CONTENT); /// 21
|
||||
lv_obj_set_align( ui_Network_Setup_Failed_Content_Button_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Network_Setup_Failed_Content_Button_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Network_Setup_Failed_Content_Button_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_img_set_angle(ui_Network_Setup_Failed_Content_Button_Icon,1800);
|
||||
|
||||
lv_obj_add_event_cb(ui_Network_Setup_Failed_Content_Button, ui_event_Network_Setup_Failed_Content_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Network_Setup_Failed_Screen, ui_event_Network_Setup_Failed_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_Network_Setup_Failed_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_Network_Setup_Failed_Screen) lv_obj_del(ui_Network_Setup_Failed_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_Network_Setup_Failed_Screen= NULL;
|
||||
ui_Network_Setup_Failed_Container_0= NULL;
|
||||
ui_Network_Setup_Failed_Container_1= NULL;
|
||||
ui_Network_Setup_Failed_Header_Logo= NULL;
|
||||
ui_Network_Setup_Failed_Container_2= NULL;
|
||||
ui_Network_Setup_Failed_Container_3= NULL;
|
||||
ui_Network_Setup_Failed_Container_4= NULL;
|
||||
ui_Network_Setup_Failed_Content_Headline= NULL;
|
||||
ui_Network_Setup_Failed_Content_Sub_Title= NULL;
|
||||
ui_Network_Setup_Failed_Content_Button= NULL;
|
||||
ui_Network_Setup_Failed_Content_Button_Label= NULL;
|
||||
ui_Network_Setup_Failed_Content_Button_Icon= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_NETWORK_SETUP_FAILED_SCREEN_H
|
||||
#define UI_NETWORK_SETUP_FAILED_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Network_Setup_Failed_Screen
|
||||
extern void ui_Network_Setup_Failed_Screen_screen_init(void);
|
||||
extern void ui_Network_Setup_Failed_Screen_screen_destroy(void);
|
||||
extern void ui_event_Network_Setup_Failed_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Screen;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Container_0;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Container_1;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Header_Logo;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Container_2;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Container_3;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Container_4;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Content_Headline;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Content_Sub_Title;
|
||||
extern void ui_event_Network_Setup_Failed_Content_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Content_Button;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Content_Button_Label;
|
||||
extern lv_obj_t *ui_Network_Setup_Failed_Content_Button_Icon;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_No_Network_Screen;
|
||||
lv_obj_t *ui_No_Network_Container_0;
|
||||
lv_obj_t *ui_No_Network_Container_1;
|
||||
lv_obj_t *ui_No_Network_Header_Logo;
|
||||
lv_obj_t *ui_No_Network_Container_2;
|
||||
lv_obj_t *ui_No_Network_Container_3;
|
||||
lv_obj_t *ui_No_Network_Container_4;
|
||||
lv_obj_t *ui_No_Network_Content_Icon;
|
||||
lv_obj_t *ui_No_Network_Content_Headline;
|
||||
lv_obj_t *ui_No_Network_Content_Sub_Title;
|
||||
|
||||
// event funtions
|
||||
void ui_event_No_Network_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_LEFT ) {
|
||||
lv_indev_wait_release(lv_indev_get_act());
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_MOVE_LEFT, 200, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_No_Network_Screen_screen_init(void)
|
||||
{
|
||||
ui_No_Network_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_flag( ui_No_Network_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_No_Network_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_No_Network_Screen, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_No_Network_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_No_Network_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_No_Network_Screen, 44, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_No_Network_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_No_Network_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_No_Network_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_No_Network_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_No_Network_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_No_Network_Container_0 = lv_obj_create(ui_No_Network_Screen);
|
||||
lv_obj_remove_style_all(ui_No_Network_Container_0);
|
||||
lv_obj_set_width( ui_No_Network_Container_0, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_No_Network_Container_0, 1);
|
||||
lv_obj_set_align( ui_No_Network_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_No_Network_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_No_Network_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_No_Network_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_No_Network_Container_0, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_No_Network_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_No_Network_Container_1 = lv_obj_create(ui_No_Network_Container_0);
|
||||
lv_obj_remove_style_all(ui_No_Network_Container_1);
|
||||
lv_obj_set_width( ui_No_Network_Container_1, lv_pct(100));
|
||||
lv_obj_set_height( ui_No_Network_Container_1, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_No_Network_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_No_Network_Container_1,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_No_Network_Container_1, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_No_Network_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_No_Network_Header_Logo = lv_img_create(ui_No_Network_Container_1);
|
||||
lv_img_set_src(ui_No_Network_Header_Logo, &ui_img_jetkvm_png);
|
||||
lv_obj_set_width( ui_No_Network_Header_Logo, LV_SIZE_CONTENT); /// 116
|
||||
lv_obj_set_height( ui_No_Network_Header_Logo, LV_SIZE_CONTENT); /// 32
|
||||
lv_obj_set_x( ui_No_Network_Header_Logo, -2 );
|
||||
lv_obj_set_y( ui_No_Network_Header_Logo, 0 );
|
||||
lv_obj_set_align( ui_No_Network_Header_Logo, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_No_Network_Header_Logo, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_No_Network_Header_Logo, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_No_Network_Container_2 = lv_obj_create(ui_No_Network_Container_0);
|
||||
lv_obj_remove_style_all(ui_No_Network_Container_2);
|
||||
lv_obj_set_width( ui_No_Network_Container_2, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_No_Network_Container_2, 1);
|
||||
lv_obj_set_x( ui_No_Network_Container_2, 1 );
|
||||
lv_obj_set_y( ui_No_Network_Container_2, 20 );
|
||||
lv_obj_set_align( ui_No_Network_Container_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_No_Network_Container_2,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_No_Network_Container_2, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_No_Network_Container_2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_No_Network_Container_3 = lv_obj_create(ui_No_Network_Container_2);
|
||||
lv_obj_remove_style_all(ui_No_Network_Container_3);
|
||||
lv_obj_set_width( ui_No_Network_Container_3, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_No_Network_Container_3, 1);
|
||||
lv_obj_set_align( ui_No_Network_Container_3, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_No_Network_Container_3,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_No_Network_Container_3, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
lv_obj_clear_flag( ui_No_Network_Container_3, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_No_Network_Container_4 = lv_obj_create(ui_No_Network_Container_3);
|
||||
lv_obj_remove_style_all(ui_No_Network_Container_4);
|
||||
lv_obj_set_width( ui_No_Network_Container_4, LV_SIZE_CONTENT); /// 100
|
||||
lv_obj_set_height( ui_No_Network_Container_4, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_No_Network_Container_4, LV_ALIGN_CENTER );
|
||||
lv_obj_clear_flag( ui_No_Network_Container_4, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_left(ui_No_Network_Container_4, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_No_Network_Container_4, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_No_Network_Container_4, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_No_Network_Container_4, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_No_Network_Content_Icon = lv_img_create(ui_No_Network_Container_4);
|
||||
lv_img_set_src(ui_No_Network_Content_Icon, &ui_img_ethernet_png);
|
||||
lv_obj_set_width( ui_No_Network_Content_Icon, LV_SIZE_CONTENT); /// 32
|
||||
lv_obj_set_height( ui_No_Network_Content_Icon, LV_SIZE_CONTENT); /// 32
|
||||
lv_obj_set_align( ui_No_Network_Content_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_No_Network_Content_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_No_Network_Content_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_No_Network_Content_Headline = lv_label_create(ui_No_Network_Container_3);
|
||||
lv_obj_set_width( ui_No_Network_Content_Headline, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_No_Network_Content_Headline, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_No_Network_Content_Headline, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_No_Network_Content_Headline,"No Network");
|
||||
lv_obj_set_style_text_color(ui_No_Network_Content_Headline, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_No_Network_Content_Headline, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_No_Network_Content_Headline, &ui_font_Font_Bold_30, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_No_Network_Content_Sub_Title = lv_label_create(ui_No_Network_Container_3);
|
||||
lv_obj_set_width( ui_No_Network_Content_Sub_Title, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_No_Network_Content_Sub_Title, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_No_Network_Content_Sub_Title, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_No_Network_Content_Sub_Title,"Connect Ethernet cable");
|
||||
lv_obj_set_style_text_color(ui_No_Network_Content_Sub_Title, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_No_Network_Content_Sub_Title, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_No_Network_Content_Sub_Title, &ui_font_Font_Book_16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_add_event_cb(ui_No_Network_Screen, ui_event_No_Network_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_No_Network_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_No_Network_Screen) lv_obj_del(ui_No_Network_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_No_Network_Screen= NULL;
|
||||
ui_No_Network_Container_0= NULL;
|
||||
ui_No_Network_Container_1= NULL;
|
||||
ui_No_Network_Header_Logo= NULL;
|
||||
ui_No_Network_Container_2= NULL;
|
||||
ui_No_Network_Container_3= NULL;
|
||||
ui_No_Network_Container_4= NULL;
|
||||
ui_No_Network_Content_Icon= NULL;
|
||||
ui_No_Network_Content_Headline= NULL;
|
||||
ui_No_Network_Content_Sub_Title= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_NO_NETWORK_SCREEN_H
|
||||
#define UI_NO_NETWORK_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_No_Network_Screen
|
||||
extern void ui_No_Network_Screen_screen_init(void);
|
||||
extern void ui_No_Network_Screen_screen_destroy(void);
|
||||
extern void ui_event_No_Network_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_No_Network_Screen;
|
||||
extern lv_obj_t *ui_No_Network_Container_0;
|
||||
extern lv_obj_t *ui_No_Network_Container_1;
|
||||
extern lv_obj_t *ui_No_Network_Header_Logo;
|
||||
extern lv_obj_t *ui_No_Network_Container_2;
|
||||
extern lv_obj_t *ui_No_Network_Container_3;
|
||||
extern lv_obj_t *ui_No_Network_Container_4;
|
||||
extern lv_obj_t *ui_No_Network_Content_Icon;
|
||||
extern lv_obj_t *ui_No_Network_Content_Headline;
|
||||
extern lv_obj_t *ui_No_Network_Content_Sub_Title;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_Reset_Device_Screen;
|
||||
lv_obj_t *ui_Reset_Container_0;
|
||||
lv_obj_t *ui_Reset_Container_1;
|
||||
lv_obj_t *ui_Reset_Device_Header_Back_Button;
|
||||
lv_obj_t *ui_Reset_Device_Header_Back_Button_Icon;
|
||||
lv_obj_t *ui_Reset_Device_Header_Page_Name_Label;
|
||||
lv_obj_t *ui_Reset_Container_2;
|
||||
lv_obj_t *ui_Reset_Content_Headline_Label;
|
||||
lv_obj_t *ui_Reset_Content_Button;
|
||||
lv_obj_t *ui_Reset_Content_Button_Label;
|
||||
|
||||
// event funtions
|
||||
void ui_event_Reset_Device_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_RIGHT ) {
|
||||
lv_indev_wait_release(lv_indev_get_act());
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_FADE_ON, 200, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Reset_Device_Header_Back_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_Reset_Device_Screen_screen_init(void)
|
||||
{
|
||||
ui_Reset_Device_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_flag( ui_Reset_Device_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_Reset_Device_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Reset_Device_Screen, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_Reset_Device_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Reset_Device_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Reset_Device_Screen, 44, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Reset_Device_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Reset_Device_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Reset_Device_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_Reset_Device_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Reset_Device_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Reset_Container_0 = lv_obj_create(ui_Reset_Device_Screen);
|
||||
lv_obj_remove_style_all(ui_Reset_Container_0);
|
||||
lv_obj_set_width( ui_Reset_Container_0, lv_pct(100));
|
||||
lv_obj_set_height( ui_Reset_Container_0, LV_SIZE_CONTENT); /// 100
|
||||
lv_obj_set_x( ui_Reset_Container_0, 75 );
|
||||
lv_obj_set_y( ui_Reset_Container_0, -33 );
|
||||
lv_obj_set_align( ui_Reset_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Reset_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Reset_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Reset_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Reset_Container_0, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Reset_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Reset_Container_1 = lv_obj_create(ui_Reset_Container_0);
|
||||
lv_obj_remove_style_all(ui_Reset_Container_1);
|
||||
lv_obj_set_width( ui_Reset_Container_1, lv_pct(100));
|
||||
lv_obj_set_height( ui_Reset_Container_1, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Reset_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Reset_Container_1,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Reset_Container_1, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
lv_obj_clear_flag( ui_Reset_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Reset_Device_Header_Back_Button = lv_btn_create(ui_Reset_Container_1);
|
||||
lv_obj_set_width( ui_Reset_Device_Header_Back_Button, 32);
|
||||
lv_obj_set_height( ui_Reset_Device_Header_Back_Button, 32);
|
||||
lv_obj_set_align( ui_Reset_Device_Header_Back_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Reset_Device_Header_Back_Button, 10000, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Reset_Device_Header_Back_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Reset_Device_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Reset_Device_Header_Back_Button, 10000, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Reset_Device_Header_Back_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Reset_Device_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Reset_Device_Header_Back_Button_Icon = lv_img_create(ui_Reset_Device_Header_Back_Button);
|
||||
lv_img_set_src(ui_Reset_Device_Header_Back_Button_Icon, &ui_img_352891484);
|
||||
lv_obj_set_width( ui_Reset_Device_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 8
|
||||
lv_obj_set_height( ui_Reset_Device_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 12
|
||||
lv_obj_set_align( ui_Reset_Device_Header_Back_Button_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Reset_Device_Header_Back_Button_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Reset_Device_Header_Back_Button_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Reset_Device_Header_Page_Name_Label = lv_label_create(ui_Reset_Container_1);
|
||||
lv_obj_set_width( ui_Reset_Device_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Reset_Device_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Reset_Device_Header_Page_Name_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Reset_Device_Header_Page_Name_Label,"Reset Device");
|
||||
lv_obj_set_style_text_color(ui_Reset_Device_Header_Page_Name_Label, lv_color_hex(0x1D4ED8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Reset_Device_Header_Page_Name_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Reset_Device_Header_Page_Name_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Reset_Container_2 = lv_obj_create(ui_Reset_Device_Screen);
|
||||
lv_obj_remove_style_all(ui_Reset_Container_2);
|
||||
lv_obj_set_width( ui_Reset_Container_2, lv_pct(100));
|
||||
lv_obj_set_flex_grow( ui_Reset_Container_2, 1);
|
||||
lv_obj_set_align( ui_Reset_Container_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Reset_Container_2,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Reset_Container_2, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Reset_Container_2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Reset_Container_2, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Reset_Container_2, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Reset_Content_Headline_Label = lv_label_create(ui_Reset_Container_2);
|
||||
lv_obj_set_width( ui_Reset_Content_Headline_Label, lv_pct(100));
|
||||
lv_obj_set_height( ui_Reset_Content_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Reset_Content_Headline_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Reset_Content_Headline_Label,"Press and hold for\n20 seconds");
|
||||
lv_obj_set_style_text_color(ui_Reset_Content_Headline_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Reset_Content_Headline_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_letter_space(ui_Reset_Content_Headline_Label, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_line_space(ui_Reset_Content_Headline_Label, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(ui_Reset_Content_Headline_Label, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Reset_Content_Headline_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Reset_Content_Button = lv_btn_create(ui_Reset_Container_2);
|
||||
lv_obj_set_height( ui_Reset_Content_Button, 54);
|
||||
lv_obj_set_width( ui_Reset_Content_Button, lv_pct(100));
|
||||
lv_obj_set_align( ui_Reset_Content_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Reset_Content_Button, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Reset_Content_Button, lv_color_hex(0xDC2626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Reset_Content_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_border_color(ui_Reset_Content_Button, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_border_opa(ui_Reset_Content_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_border_width(ui_Reset_Content_Button, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Reset_Content_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Reset_Content_Button, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Reset_Content_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Reset_Content_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Reset_Content_Button, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Reset_Content_Button, lv_color_hex(0xEF2A2A), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Reset_Content_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_border_color(ui_Reset_Content_Button, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_border_opa(ui_Reset_Content_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_border_width(ui_Reset_Content_Button, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_pad_left(ui_Reset_Content_Button, 16, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_pad_right(ui_Reset_Content_Button, 0, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_pad_top(ui_Reset_Content_Button, 20, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_pad_bottom(ui_Reset_Content_Button, 20, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Reset_Content_Button_Label = lv_label_create(ui_Reset_Content_Button);
|
||||
lv_obj_set_width( ui_Reset_Content_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Reset_Content_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Reset_Content_Button_Label, LV_ALIGN_LEFT_MID );
|
||||
lv_label_set_text(ui_Reset_Content_Button_Label,"Hold to reset");
|
||||
lv_obj_set_style_text_color(ui_Reset_Content_Button_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Reset_Content_Button_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Reset_Content_Button_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_add_event_cb(ui_Reset_Device_Header_Back_Button, ui_event_Reset_Device_Header_Back_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Reset_Device_Screen, ui_event_Reset_Device_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_Reset_Device_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_Reset_Device_Screen) lv_obj_del(ui_Reset_Device_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_Reset_Device_Screen= NULL;
|
||||
ui_Reset_Container_0= NULL;
|
||||
ui_Reset_Container_1= NULL;
|
||||
ui_Reset_Device_Header_Back_Button= NULL;
|
||||
ui_Reset_Device_Header_Back_Button_Icon= NULL;
|
||||
ui_Reset_Device_Header_Page_Name_Label= NULL;
|
||||
ui_Reset_Container_2= NULL;
|
||||
ui_Reset_Content_Headline_Label= NULL;
|
||||
ui_Reset_Content_Button= NULL;
|
||||
ui_Reset_Content_Button_Label= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_RESET_DEVICE_SCREEN_H
|
||||
#define UI_RESET_DEVICE_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Reset_Device_Screen
|
||||
extern void ui_Reset_Device_Screen_screen_init(void);
|
||||
extern void ui_Reset_Device_Screen_screen_destroy(void);
|
||||
extern void ui_event_Reset_Device_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Reset_Device_Screen;
|
||||
extern lv_obj_t *ui_Reset_Container_0;
|
||||
extern lv_obj_t *ui_Reset_Container_1;
|
||||
extern void ui_event_Reset_Device_Header_Back_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Reset_Device_Header_Back_Button;
|
||||
extern lv_obj_t *ui_Reset_Device_Header_Back_Button_Icon;
|
||||
extern lv_obj_t *ui_Reset_Device_Header_Page_Name_Label;
|
||||
extern lv_obj_t *ui_Reset_Container_2;
|
||||
extern lv_obj_t *ui_Reset_Content_Headline_Label;
|
||||
extern lv_obj_t *ui_Reset_Content_Button;
|
||||
extern lv_obj_t *ui_Reset_Content_Button_Label;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_Settings_Overview_Screen;
|
||||
lv_obj_t *ui_Settings_Overview_Container_0;
|
||||
lv_obj_t *ui_Settings_Overview_Container_1;
|
||||
lv_obj_t *ui_Settings_Overview_Header_Back_Button;
|
||||
lv_obj_t *ui_Settings_Overview_Header_Back_Button_Icon;
|
||||
lv_obj_t *ui_Settings_Overview_Header_Page_Name_Label;
|
||||
lv_obj_t *ui_Settings_Overview_Container_2;
|
||||
lv_obj_t *ui_Settings_Overview_Status_Button;
|
||||
lv_obj_t *ui_Settings_Overview_Status_Button_Label;
|
||||
lv_obj_t *ui_Settings_Overview_About_Button;
|
||||
lv_obj_t *ui_Settings_Overview_About_Button_Label;
|
||||
lv_obj_t *ui_Settings_Overview_Reset_Button;
|
||||
lv_obj_t *ui_Settings_Overview_Reset_Button_Label;
|
||||
|
||||
// event funtions
|
||||
void ui_event_Settings_Overview_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_RIGHT ) {
|
||||
lv_indev_wait_release(lv_indev_get_act());
|
||||
_ui_screen_change( &ui_Home_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Home_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Settings_Overview_Header_Back_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Home_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Home_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Settings_Overview_Status_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Status_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Status_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Settings_Overview_About_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_About_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_About_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Settings_Overview_Reset_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Reset_Device_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Reset_Device_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_Settings_Overview_Screen_screen_init(void)
|
||||
{
|
||||
ui_Settings_Overview_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_state( ui_Settings_Overview_Screen, LV_STATE_USER_1 ); /// States
|
||||
lv_obj_add_flag( ui_Settings_Overview_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_Settings_Overview_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Settings_Overview_Screen, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_Settings_Overview_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Settings_Overview_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Settings_Overview_Screen, 44, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Settings_Overview_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Settings_Overview_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Settings_Overview_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_Settings_Overview_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Settings_Overview_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Settings_Overview_Container_0 = lv_obj_create(ui_Settings_Overview_Screen);
|
||||
lv_obj_remove_style_all(ui_Settings_Overview_Container_0);
|
||||
lv_obj_set_width( ui_Settings_Overview_Container_0, lv_pct(100));
|
||||
lv_obj_set_height( ui_Settings_Overview_Container_0, LV_SIZE_CONTENT); /// 100
|
||||
lv_obj_set_x( ui_Settings_Overview_Container_0, 75 );
|
||||
lv_obj_set_y( ui_Settings_Overview_Container_0, -33 );
|
||||
lv_obj_set_align( ui_Settings_Overview_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Settings_Overview_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Settings_Overview_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Settings_Overview_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Settings_Overview_Container_0, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Settings_Overview_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Settings_Overview_Container_1 = lv_obj_create(ui_Settings_Overview_Container_0);
|
||||
lv_obj_remove_style_all(ui_Settings_Overview_Container_1);
|
||||
lv_obj_set_width( ui_Settings_Overview_Container_1, lv_pct(100));
|
||||
lv_obj_set_height( ui_Settings_Overview_Container_1, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Settings_Overview_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Settings_Overview_Container_1,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Settings_Overview_Container_1, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
lv_obj_clear_flag( ui_Settings_Overview_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Settings_Overview_Header_Back_Button = lv_btn_create(ui_Settings_Overview_Container_1);
|
||||
lv_obj_set_width( ui_Settings_Overview_Header_Back_Button, 32);
|
||||
lv_obj_set_height( ui_Settings_Overview_Header_Back_Button, 32);
|
||||
lv_obj_set_align( ui_Settings_Overview_Header_Back_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Settings_Overview_Header_Back_Button, 10000, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Settings_Overview_Header_Back_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Settings_Overview_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Settings_Overview_Header_Back_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Settings_Overview_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Settings_Overview_Header_Back_Button_Icon = lv_img_create(ui_Settings_Overview_Header_Back_Button);
|
||||
lv_img_set_src(ui_Settings_Overview_Header_Back_Button_Icon, &ui_img_352891484);
|
||||
lv_obj_set_width( ui_Settings_Overview_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 8
|
||||
lv_obj_set_height( ui_Settings_Overview_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 12
|
||||
lv_obj_set_align( ui_Settings_Overview_Header_Back_Button_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Settings_Overview_Header_Back_Button_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Settings_Overview_Header_Back_Button_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Settings_Overview_Header_Page_Name_Label = lv_label_create(ui_Settings_Overview_Container_1);
|
||||
lv_obj_set_width( ui_Settings_Overview_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Settings_Overview_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Settings_Overview_Header_Page_Name_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Settings_Overview_Header_Page_Name_Label,"Settings");
|
||||
lv_obj_set_style_text_color(ui_Settings_Overview_Header_Page_Name_Label, lv_color_hex(0x1D4ED8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Settings_Overview_Header_Page_Name_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Settings_Overview_Header_Page_Name_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Settings_Overview_Container_2 = lv_obj_create(ui_Settings_Overview_Screen);
|
||||
lv_obj_remove_style_all(ui_Settings_Overview_Container_2);
|
||||
lv_obj_set_width( ui_Settings_Overview_Container_2, lv_pct(100));
|
||||
lv_obj_set_height( ui_Settings_Overview_Container_2, LV_SIZE_CONTENT); /// 500
|
||||
lv_obj_set_align( ui_Settings_Overview_Container_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Settings_Overview_Container_2,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Settings_Overview_Container_2, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Settings_Overview_Container_2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Settings_Overview_Container_2, 12, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Settings_Overview_Container_2, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Settings_Overview_Status_Button = lv_btn_create(ui_Settings_Overview_Container_2);
|
||||
lv_obj_set_width( ui_Settings_Overview_Status_Button, lv_pct(100));
|
||||
lv_obj_set_height( ui_Settings_Overview_Status_Button, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Settings_Overview_Status_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Settings_Overview_Status_Button, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Settings_Overview_Status_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Settings_Overview_Status_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Settings_Overview_Status_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Settings_Overview_Status_Button, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Settings_Overview_Status_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Settings_Overview_Status_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Settings_Overview_Status_Button, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Settings_Overview_Status_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Settings_Overview_Status_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Settings_Overview_Status_Button_Label = lv_label_create(ui_Settings_Overview_Status_Button);
|
||||
lv_obj_set_width( ui_Settings_Overview_Status_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Settings_Overview_Status_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Settings_Overview_Status_Button_Label, LV_ALIGN_LEFT_MID );
|
||||
lv_label_set_text(ui_Settings_Overview_Status_Button_Label,"Status");
|
||||
lv_obj_set_style_text_color(ui_Settings_Overview_Status_Button_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Settings_Overview_Status_Button_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Settings_Overview_Status_Button_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Settings_Overview_About_Button = lv_btn_create(ui_Settings_Overview_Container_2);
|
||||
lv_obj_set_width( ui_Settings_Overview_About_Button, lv_pct(100));
|
||||
lv_obj_set_height( ui_Settings_Overview_About_Button, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Settings_Overview_About_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Settings_Overview_About_Button, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Settings_Overview_About_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Settings_Overview_About_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Settings_Overview_About_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Settings_Overview_About_Button, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Settings_Overview_About_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Settings_Overview_About_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Settings_Overview_About_Button, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Settings_Overview_About_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Settings_Overview_About_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Settings_Overview_About_Button_Label = lv_label_create(ui_Settings_Overview_About_Button);
|
||||
lv_obj_set_width( ui_Settings_Overview_About_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Settings_Overview_About_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Settings_Overview_About_Button_Label, LV_ALIGN_LEFT_MID );
|
||||
lv_label_set_text(ui_Settings_Overview_About_Button_Label,"About");
|
||||
lv_obj_set_style_text_color(ui_Settings_Overview_About_Button_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Settings_Overview_About_Button_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Settings_Overview_About_Button_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Settings_Overview_Reset_Button = lv_btn_create(ui_Settings_Overview_Container_2);
|
||||
lv_obj_set_width( ui_Settings_Overview_Reset_Button, lv_pct(100));
|
||||
lv_obj_set_height( ui_Settings_Overview_Reset_Button, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Settings_Overview_Reset_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Settings_Overview_Reset_Button, 8, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Settings_Overview_Reset_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Settings_Overview_Reset_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Settings_Overview_Reset_Button, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Settings_Overview_Reset_Button, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Settings_Overview_Reset_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Settings_Overview_Reset_Button, 20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(ui_Settings_Overview_Reset_Button, 8, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_color(ui_Settings_Overview_Reset_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Settings_Overview_Reset_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Settings_Overview_Reset_Button_Label = lv_label_create(ui_Settings_Overview_Reset_Button);
|
||||
lv_obj_set_width( ui_Settings_Overview_Reset_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Settings_Overview_Reset_Button_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Settings_Overview_Reset_Button_Label, LV_ALIGN_LEFT_MID );
|
||||
lv_label_set_text(ui_Settings_Overview_Reset_Button_Label,"Reset");
|
||||
lv_obj_set_style_text_color(ui_Settings_Overview_Reset_Button_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Settings_Overview_Reset_Button_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Settings_Overview_Reset_Button_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_add_event_cb(ui_Settings_Overview_Header_Back_Button, ui_event_Settings_Overview_Header_Back_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Settings_Overview_Status_Button, ui_event_Settings_Overview_Status_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Settings_Overview_About_Button, ui_event_Settings_Overview_About_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Settings_Overview_Reset_Button, ui_event_Settings_Overview_Reset_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Settings_Overview_Screen, ui_event_Settings_Overview_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_Settings_Overview_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_Settings_Overview_Screen) lv_obj_del(ui_Settings_Overview_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_Settings_Overview_Screen= NULL;
|
||||
ui_Settings_Overview_Container_0= NULL;
|
||||
ui_Settings_Overview_Container_1= NULL;
|
||||
ui_Settings_Overview_Header_Back_Button= NULL;
|
||||
ui_Settings_Overview_Header_Back_Button_Icon= NULL;
|
||||
ui_Settings_Overview_Header_Page_Name_Label= NULL;
|
||||
ui_Settings_Overview_Container_2= NULL;
|
||||
ui_Settings_Overview_Status_Button= NULL;
|
||||
ui_Settings_Overview_Status_Button_Label= NULL;
|
||||
ui_Settings_Overview_About_Button= NULL;
|
||||
ui_Settings_Overview_About_Button_Label= NULL;
|
||||
ui_Settings_Overview_Reset_Button= NULL;
|
||||
ui_Settings_Overview_Reset_Button_Label= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_SETTINGS_OVERVIEW_SCREEN_H
|
||||
#define UI_SETTINGS_OVERVIEW_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Settings_Overview_Screen
|
||||
extern void ui_Settings_Overview_Screen_screen_init(void);
|
||||
extern void ui_Settings_Overview_Screen_screen_destroy(void);
|
||||
extern void ui_event_Settings_Overview_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Settings_Overview_Screen;
|
||||
extern lv_obj_t *ui_Settings_Overview_Container_0;
|
||||
extern lv_obj_t *ui_Settings_Overview_Container_1;
|
||||
extern void ui_event_Settings_Overview_Header_Back_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Settings_Overview_Header_Back_Button;
|
||||
extern lv_obj_t *ui_Settings_Overview_Header_Back_Button_Icon;
|
||||
extern lv_obj_t *ui_Settings_Overview_Header_Page_Name_Label;
|
||||
extern lv_obj_t *ui_Settings_Overview_Container_2;
|
||||
extern void ui_event_Settings_Overview_Status_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Settings_Overview_Status_Button;
|
||||
extern lv_obj_t *ui_Settings_Overview_Status_Button_Label;
|
||||
extern void ui_event_Settings_Overview_About_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Settings_Overview_About_Button;
|
||||
extern lv_obj_t *ui_Settings_Overview_About_Button_Label;
|
||||
extern void ui_event_Settings_Overview_Reset_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Settings_Overview_Reset_Button;
|
||||
extern lv_obj_t *ui_Settings_Overview_Reset_Button_Label;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
lv_obj_t *ui_Status_Screen;
|
||||
lv_obj_t *ui_Status_Container_0;
|
||||
lv_obj_t *ui_Status_Container_1;
|
||||
lv_obj_t *ui_Status_Header_Back_Button;
|
||||
lv_obj_t *ui_Status_Header_Back_Button_Icon;
|
||||
lv_obj_t *ui_Status_Header_Page_Name_Label;
|
||||
lv_obj_t *ui_Status_Container_2;
|
||||
lv_obj_t *ui_Status_Content_Device_Id_Headline_Label;
|
||||
lv_obj_t *ui_Status_Content_Device_Id_Content_Label;
|
||||
lv_obj_t *ui_Status_Container_3;
|
||||
lv_obj_t *ui_Status_Content_Cloud_Account_Id_Headline_Label;
|
||||
lv_obj_t *ui_Status_Content_Cloud_Account_Id_Content_Label;
|
||||
lv_obj_t *ui_Status_Container_4;
|
||||
lv_obj_t *ui_Status_Content_IPv4_Address_Headline_Label;
|
||||
lv_obj_t *ui_Status_Content_IPv4_Address_Content_Label;
|
||||
lv_obj_t *ui_Status_Container_5;
|
||||
lv_obj_t *ui_Status_Content_IPv6_Address_Headline_Label;
|
||||
lv_obj_t *ui_Status_Content_IPv6_Address_Content_Label;
|
||||
|
||||
// event funtions
|
||||
void ui_event_Status_Screen( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_GESTURE && lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_RIGHT ) {
|
||||
lv_indev_wait_release(lv_indev_get_act());
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event_Status_Header_Back_Button( lv_event_t * e) {
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if ( event_code == LV_EVENT_CLICKED) {
|
||||
_ui_screen_change( &ui_Settings_Overview_Screen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_Settings_Overview_Screen_screen_init);
|
||||
}
|
||||
}
|
||||
|
||||
// build funtions
|
||||
|
||||
void ui_Status_Screen_screen_init(void)
|
||||
{
|
||||
ui_Status_Screen = lv_obj_create(NULL);
|
||||
lv_obj_add_flag( ui_Status_Screen, LV_OBJ_FLAG_OVERFLOW_VISIBLE ); /// Flags
|
||||
lv_obj_set_flex_flow(ui_Status_Screen,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Status_Screen, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_bg_color(ui_Status_Screen, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Status_Screen, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(ui_Status_Screen, 44, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_right(ui_Status_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_top(ui_Status_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(ui_Status_Screen, 24, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_row(ui_Status_Screen, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Status_Screen, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Container_0 = lv_obj_create(ui_Status_Screen);
|
||||
lv_obj_remove_style_all(ui_Status_Container_0);
|
||||
lv_obj_set_width( ui_Status_Container_0, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Container_0, LV_SIZE_CONTENT); /// 100
|
||||
lv_obj_set_x( ui_Status_Container_0, 75 );
|
||||
lv_obj_set_y( ui_Status_Container_0, -33 );
|
||||
lv_obj_set_align( ui_Status_Container_0, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Status_Container_0,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Status_Container_0, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Status_Container_0, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Status_Container_0, 16, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Status_Container_0, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Container_1 = lv_obj_create(ui_Status_Container_0);
|
||||
lv_obj_remove_style_all(ui_Status_Container_1);
|
||||
lv_obj_set_width( ui_Status_Container_1, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Container_1, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Status_Container_1, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Status_Container_1,LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(ui_Status_Container_1, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
lv_obj_clear_flag( ui_Status_Container_1, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Status_Header_Back_Button = lv_btn_create(ui_Status_Container_1);
|
||||
lv_obj_set_width( ui_Status_Header_Back_Button, 32);
|
||||
lv_obj_set_height( ui_Status_Header_Back_Button, 32);
|
||||
lv_obj_set_align( ui_Status_Header_Back_Button, LV_ALIGN_CENTER );
|
||||
lv_obj_set_style_radius(ui_Status_Header_Back_Button, 10000, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Status_Header_Back_Button, lv_color_hex(0x262626), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_bg_opa(ui_Status_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(ui_Status_Header_Back_Button, lv_color_hex(0x2E2E2E), LV_PART_MAIN | LV_STATE_PRESSED );
|
||||
lv_obj_set_style_bg_opa(ui_Status_Header_Back_Button, 255, LV_PART_MAIN| LV_STATE_PRESSED);
|
||||
|
||||
ui_Status_Header_Back_Button_Icon = lv_img_create(ui_Status_Header_Back_Button);
|
||||
lv_img_set_src(ui_Status_Header_Back_Button_Icon, &ui_img_352891484);
|
||||
lv_obj_set_width( ui_Status_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 8
|
||||
lv_obj_set_height( ui_Status_Header_Back_Button_Icon, LV_SIZE_CONTENT); /// 12
|
||||
lv_obj_set_align( ui_Status_Header_Back_Button_Icon, LV_ALIGN_CENTER );
|
||||
lv_obj_add_flag( ui_Status_Header_Back_Button_Icon, LV_OBJ_FLAG_ADV_HITTEST ); /// Flags
|
||||
lv_obj_clear_flag( ui_Status_Header_Back_Button_Icon, LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
|
||||
ui_Status_Header_Page_Name_Label = lv_label_create(ui_Status_Container_1);
|
||||
lv_obj_set_width( ui_Status_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Status_Header_Page_Name_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Status_Header_Page_Name_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Status_Header_Page_Name_Label,"Status");
|
||||
lv_obj_set_style_text_color(ui_Status_Header_Page_Name_Label, lv_color_hex(0x1D4ED8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Status_Header_Page_Name_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Status_Header_Page_Name_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Container_2 = lv_obj_create(ui_Status_Screen);
|
||||
lv_obj_remove_style_all(ui_Status_Container_2);
|
||||
lv_obj_set_width( ui_Status_Container_2, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Container_2, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Status_Container_2, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Status_Container_2,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Status_Container_2, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Status_Container_2, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Status_Container_2, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Status_Container_2, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Content_Device_Id_Headline_Label = lv_label_create(ui_Status_Container_2);
|
||||
lv_obj_set_width( ui_Status_Content_Device_Id_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Status_Content_Device_Id_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Status_Content_Device_Id_Headline_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Status_Content_Device_Id_Headline_Label,"Device ID");
|
||||
lv_obj_set_style_text_color(ui_Status_Content_Device_Id_Headline_Label, lv_color_hex(0x94A3B8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Status_Content_Device_Id_Headline_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Status_Content_Device_Id_Headline_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Content_Device_Id_Content_Label = lv_label_create(ui_Status_Container_2);
|
||||
lv_obj_set_width( ui_Status_Content_Device_Id_Content_Label, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Content_Device_Id_Content_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Status_Content_Device_Id_Content_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Status_Content_Device_Id_Content_Label,"64238c05ececc831-102F271723");
|
||||
lv_obj_set_style_text_color(ui_Status_Content_Device_Id_Content_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Status_Content_Device_Id_Content_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Status_Content_Device_Id_Content_Label, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Container_3 = lv_obj_create(ui_Status_Screen);
|
||||
lv_obj_remove_style_all(ui_Status_Container_3);
|
||||
lv_obj_set_width( ui_Status_Container_3, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Container_3, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Status_Container_3, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Status_Container_3,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Status_Container_3, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Status_Container_3, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Status_Container_3, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Status_Container_3, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Content_Cloud_Account_Id_Headline_Label = lv_label_create(ui_Status_Container_3);
|
||||
lv_obj_set_width( ui_Status_Content_Cloud_Account_Id_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Status_Content_Cloud_Account_Id_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Status_Content_Cloud_Account_Id_Headline_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Status_Content_Cloud_Account_Id_Headline_Label,"Cloud Account ID");
|
||||
lv_obj_set_style_text_color(ui_Status_Content_Cloud_Account_Id_Headline_Label, lv_color_hex(0x94A3B8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Status_Content_Cloud_Account_Id_Headline_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Status_Content_Cloud_Account_Id_Headline_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Content_Cloud_Account_Id_Content_Label = lv_label_create(ui_Status_Container_3);
|
||||
lv_obj_set_width( ui_Status_Content_Cloud_Account_Id_Content_Label, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Content_Cloud_Account_Id_Content_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Status_Content_Cloud_Account_Id_Content_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Status_Content_Cloud_Account_Id_Content_Label,"12387612876312673dd");
|
||||
lv_obj_set_style_text_color(ui_Status_Content_Cloud_Account_Id_Content_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Status_Content_Cloud_Account_Id_Content_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Status_Content_Cloud_Account_Id_Content_Label, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Container_4 = lv_obj_create(ui_Status_Screen);
|
||||
lv_obj_remove_style_all(ui_Status_Container_4);
|
||||
lv_obj_set_width( ui_Status_Container_4, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Container_4, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Status_Container_4, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Status_Container_4,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Status_Container_4, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Status_Container_4, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Status_Container_4, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Status_Container_4, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Content_IPv4_Address_Headline_Label = lv_label_create(ui_Status_Container_4);
|
||||
lv_obj_set_width( ui_Status_Content_IPv4_Address_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Status_Content_IPv4_Address_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Status_Content_IPv4_Address_Headline_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Status_Content_IPv4_Address_Headline_Label,"IPv4 Address");
|
||||
lv_obj_set_style_text_color(ui_Status_Content_IPv4_Address_Headline_Label, lv_color_hex(0x94A3B8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Status_Content_IPv4_Address_Headline_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Status_Content_IPv4_Address_Headline_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Content_IPv4_Address_Content_Label = lv_label_create(ui_Status_Container_4);
|
||||
lv_obj_set_width( ui_Status_Content_IPv4_Address_Content_Label, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Content_IPv4_Address_Content_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Status_Content_IPv4_Address_Content_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Status_Content_IPv4_Address_Content_Label,"");
|
||||
lv_obj_set_style_text_color(ui_Status_Content_IPv4_Address_Content_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Status_Content_IPv4_Address_Content_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Status_Content_IPv4_Address_Content_Label, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Container_5 = lv_obj_create(ui_Status_Screen);
|
||||
lv_obj_remove_style_all(ui_Status_Container_5);
|
||||
lv_obj_set_width( ui_Status_Container_5, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Container_5, LV_SIZE_CONTENT); /// 50
|
||||
lv_obj_set_align( ui_Status_Container_5, LV_ALIGN_CENTER );
|
||||
lv_obj_set_flex_flow(ui_Status_Container_5,LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_align(ui_Status_Container_5, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_clear_flag( ui_Status_Container_5, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE ); /// Flags
|
||||
lv_obj_set_style_pad_row(ui_Status_Container_5, 4, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_column(ui_Status_Container_5, 0, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Content_IPv6_Address_Headline_Label = lv_label_create(ui_Status_Container_5);
|
||||
lv_obj_set_width( ui_Status_Content_IPv6_Address_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height( ui_Status_Content_IPv6_Address_Headline_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Status_Content_IPv6_Address_Headline_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Status_Content_IPv6_Address_Headline_Label,"IPv4 Address");
|
||||
lv_obj_set_style_text_color(ui_Status_Content_IPv6_Address_Headline_Label, lv_color_hex(0x94A3B8), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Status_Content_IPv6_Address_Headline_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Status_Content_IPv6_Address_Headline_Label, &ui_font_Font_Book_20, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
ui_Status_Content_IPv6_Address_Content_Label = lv_label_create(ui_Status_Container_5);
|
||||
lv_obj_set_width( ui_Status_Content_IPv6_Address_Content_Label, lv_pct(100));
|
||||
lv_obj_set_height( ui_Status_Content_IPv6_Address_Content_Label, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align( ui_Status_Content_IPv6_Address_Content_Label, LV_ALIGN_CENTER );
|
||||
lv_label_set_text(ui_Status_Content_IPv6_Address_Content_Label,".");
|
||||
lv_obj_set_style_text_color(ui_Status_Content_IPv6_Address_Content_Label, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT );
|
||||
lv_obj_set_style_text_opa(ui_Status_Content_IPv6_Address_Content_Label, 255, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_Status_Content_IPv6_Address_Content_Label, &ui_font_Font_Book_18, LV_PART_MAIN| LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_add_event_cb(ui_Status_Header_Back_Button, ui_event_Status_Header_Back_Button, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(ui_Status_Screen, ui_event_Status_Screen, LV_EVENT_ALL, NULL);
|
||||
|
||||
}
|
||||
|
||||
void ui_Status_Screen_screen_destroy(void)
|
||||
{
|
||||
if (ui_Status_Screen) lv_obj_del(ui_Status_Screen);
|
||||
|
||||
// NULL screen variables
|
||||
ui_Status_Screen= NULL;
|
||||
ui_Status_Container_0= NULL;
|
||||
ui_Status_Container_1= NULL;
|
||||
ui_Status_Header_Back_Button= NULL;
|
||||
ui_Status_Header_Back_Button_Icon= NULL;
|
||||
ui_Status_Header_Page_Name_Label= NULL;
|
||||
ui_Status_Container_2= NULL;
|
||||
ui_Status_Content_Device_Id_Headline_Label= NULL;
|
||||
ui_Status_Content_Device_Id_Content_Label= NULL;
|
||||
ui_Status_Container_3= NULL;
|
||||
ui_Status_Content_Cloud_Account_Id_Headline_Label= NULL;
|
||||
ui_Status_Content_Cloud_Account_Id_Content_Label= NULL;
|
||||
ui_Status_Container_4= NULL;
|
||||
ui_Status_Content_IPv4_Address_Headline_Label= NULL;
|
||||
ui_Status_Content_IPv4_Address_Content_Label= NULL;
|
||||
ui_Status_Container_5= NULL;
|
||||
ui_Status_Content_IPv6_Address_Headline_Label= NULL;
|
||||
ui_Status_Content_IPv6_Address_Content_Label= NULL;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef UI_STATUS_SCREEN_H
|
||||
#define UI_STATUS_SCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Status_Screen
|
||||
extern void ui_Status_Screen_screen_init(void);
|
||||
extern void ui_Status_Screen_screen_destroy(void);
|
||||
extern void ui_event_Status_Screen( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Status_Screen;
|
||||
extern lv_obj_t *ui_Status_Container_0;
|
||||
extern lv_obj_t *ui_Status_Container_1;
|
||||
extern void ui_event_Status_Header_Back_Button( lv_event_t * e);
|
||||
extern lv_obj_t *ui_Status_Header_Back_Button;
|
||||
extern lv_obj_t *ui_Status_Header_Back_Button_Icon;
|
||||
extern lv_obj_t *ui_Status_Header_Page_Name_Label;
|
||||
extern lv_obj_t *ui_Status_Container_2;
|
||||
extern lv_obj_t *ui_Status_Content_Device_Id_Headline_Label;
|
||||
extern lv_obj_t *ui_Status_Content_Device_Id_Content_Label;
|
||||
extern lv_obj_t *ui_Status_Container_3;
|
||||
extern lv_obj_t *ui_Status_Content_Cloud_Account_Id_Headline_Label;
|
||||
extern lv_obj_t *ui_Status_Content_Cloud_Account_Id_Content_Label;
|
||||
extern lv_obj_t *ui_Status_Container_4;
|
||||
extern lv_obj_t *ui_Status_Content_IPv4_Address_Headline_Label;
|
||||
extern lv_obj_t *ui_Status_Content_IPv4_Address_Content_Label;
|
||||
extern lv_obj_t *ui_Status_Container_5;
|
||||
extern lv_obj_t *ui_Status_Content_IPv6_Address_Headline_Label;
|
||||
extern lv_obj_t *ui_Status_Content_IPv6_Address_Content_Label;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.5.2
|
||||
// LVGL version: 8.3.6
|
||||
// Project name: SquareLine_Project
|
||||
|
||||
#ifndef _UI_EVENTS_H
|
||||
#define _UI_EVENTS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue