Skip to content

Commit

Permalink
Merge pull request #22 from fbosman/main
Browse files Browse the repository at this point in the history
corrected focus presets and focus commands
  • Loading branch information
fbosman authored Oct 12, 2024
2 parents 50de56c + 992e5b8 commit b01622e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 88 deletions.
72 changes: 2 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,11 @@

See HELP.md and LICENSE

Current support is based on "HD/4K Integrated Camera Interface Specifications" version 1.12 from Apr. 27, 2020.
For more information on the axis API, please refer to:
[axis Interface Specifications, Protocol](https://eww.pass.axis.co.jp/pro-av/support/content/guide/EN/top.html)

**V1.0.7**

- Added Hanging and Desktop mode
- Added One Touch Auto Focus
- Zoom and Focus speed

**V1.0.8**

- Fixed bug with changing config settings, forcing the user to disable and re-enable the module to connect again.
- Fixed bug with OTAF missing an action

**V1.0.9**

- Cleaned up "Help.md" file
- Cleaned up "Index.js" file, by splitting it up into difrent files
- Sorted Actions in dropdown
- Fixed Auto Focus Action having wrong default
- Added Feedback Structure and Support
- Added Variables Structure and Support
- Added Auto Detect Model, and the option to specify camera type
- Made Actions Model specific, with options that match the model
- Updated all presets to work with current feedbacks and actions, and is made dynamicly based on model

**V1.0.10**

- Added Basic support for AW-HE2
- Added Config option to enable PTZ debug to the "Info" and "Warn" log window
- Added Support for Start and Stop Recording on SD Card (Only some models)

**V1.0.11**

- Added support for AW-UE4

**V1.0.12**

- Hotfix for SD Card Record Action
- Bug Fix: Tally on variable, not working on integer variables, now works with both integer and string variables

**V1.0.13**

- Bug Fix: some actions not working with defaults, due too not having a default declared
- Enabled presets on Aw-HE2

**V1.0.14**

- Updated Help.md
- Fixed bug with importing unused dependencies
- Fixed bug with Auto/Manual focus being mirrored

**V1.0.15**

- Added Auto detect TCP port based on instance ID/nr, as these will always be unique on one system. Currently, it's based on the default TCP port (31004)+ instance nr. If you only have one instance = 31004 + 1, it is the fifth instance = 31004 + 5. that should help out with errors when using more than one instance/camera. (The user selected port, gets ignored when auto mode is selected)
- Cleaned up config page
- Fix bug with tally not being reported corectly in feedbacks with AW-HE40 series camera's

**V1.0.16**

- Converted Feedbacks to Boolean Feedbacks for more flexibility

**V1.0.17 & V1.0.18**

- Minor changes, and update script fixes
For more information on the axis API, please refer to:
https://www.axis.com/vapix-library/

**V1.0.19**

- Added Action, Feedback, Preset and Variable for "Preset - Mode A, B, C"
- Fixed Tally follow variable option
- cleaned up the subscription codebase Init_tcp()
- Changed "Auto TCP" port, to be handled by node instead of an offset

**V2.0 **
Refactored for version 3
Expand Down
41 changes: 27 additions & 14 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ const zoomdefinition = {
required: true,
range: false,
};
const focusdefinition = {
type: "number",
label: "FocusSpeed",
id: "focusspeed",
min: -100,
max: 100,
default: 50,
step: 1,
required: true,
range: false,
};

var cmd = "";
var param = "";
Expand All @@ -55,10 +66,10 @@ for (let i = 1; i < 100; ++i) {
// ######################

async function sendPTZ(self, action, direction) {
//self.log("debug", "Sending PTZ " + action + ":" + direction);
self.log("debug", "Sending PTZ " + action + ":" + direction);
if (action) {
const url =
"http://" +

self.config.host +
":" +
self.config.httpPort +
Expand Down Expand Up @@ -244,7 +255,7 @@ export function getActionDefinitions(self) {



actions.home = {
actions.home = {
name: "Pan/Tilt - Home",
options: [speeddefinition],
callback: async (action) => {
Expand All @@ -259,15 +270,15 @@ export function getActionDefinitions(self) {
};

const seriesActions = {}
seriesActions.ptSpeed = false;
seriesActions.ptSpeed = true;

if (seriesActions.ptSpeed) {
actions.ptSpeedS = {
name: "Pan/Tilt - Speed",
options: [
{
type: "dropdown",
label: "speed setting",
label: "speed adjustement PT",
id: "speed",
default: 25,
choices: c.CHOICES_SPEED,
Expand Down Expand Up @@ -429,7 +440,7 @@ seriesActions.ptSpeed = false;
};
}

if (seriesActions.focus) {
//if (seriesActions.focus) {
actions.focusI = {
name: "Lens - focus In",
options: [speeddefinition],
Expand All @@ -445,9 +456,9 @@ seriesActions.ptSpeed = false;
await sendPTZ(self, cmd, param);
},
};
}
//}

if (seriesActions.focus) {
//if (seriesActions.focus) {
actions.focusO = {
name: "Lens - focus Out",
options: [speeddefinition],
Expand All @@ -461,27 +472,29 @@ seriesActions.ptSpeed = false;
await sendPTZ(self, cmd, param);
},
};
}
// }

if (seriesActions.focus) {
// if (seriesActions.focus) {
actions.focusF = {
name: "Lens - Focus Far",
options: [],
callback: async (action) => {
await sendPTZ(self, "F" + parseInt(50 + self.fSpeed));
cmd = "continuousfocusmove";
param = "0";
await sendPTZ(self, cmd, param);
},
};
}
// }

if (seriesActions.focus) {
//if (seriesActions.focus) {
actions.focusS = {
name: "Lens - Focus Stop",
options: [],
callback: async (action) => {
await sendPTZ(self, "F50");
},
};
}
//}

if (seriesActions.fSpeed) {
actions.fSpeedS = {
Expand Down
11 changes: 7 additions & 4 deletions src/presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,11 @@ export function getPresetDefinitions(self) {
{
down: [
{
actionId: "focusN",
options: {},
actionId: "focusI",
options: {
speed: 50,

},
},
],
up: [
Expand Down Expand Up @@ -656,8 +659,8 @@ export function getPresetDefinitions(self) {
{
down: [
{
actionId: "focusF",
options: {},
actionId: "focusO",
options: {speed:50,},
},
],
up: [
Expand Down

0 comments on commit b01622e

Please sign in to comment.