Commit c3472bb8 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Moved the web version to a separate repo.

parent 997988d8
This diff is collapsed.
"use strict";
class CliTable {
command: string;
qualifier: Array<string>;
constructor(command, qualifier) {
this.command = command;
this.qualifier = qualifier;
}
}
enum CliC {
SUCCESS = 1,
SYNTAX_ERROR = 2,
UNKNOWN_COMMAND = 4,
VERB_VECT_SIZE = 5,
QUALNOTFOUND = 6
}
enum State {
INIT,
VERB,
QUAL,
QUALVALUE,
SPACE,
EQUAL,
ERROR,
QUOTE_VERB,
QUOTE_QUALVALUE,
QUALVALUE_EXACT,
VERB_EXACT
}
class Cli {
verb: Array = new Array(CliC.VERB_VECT_SIZE);
qualifier: Array = new Array(30);
qualValue: Array = new Array(30);
status: number;
cliTableIndex: number;
cliQualifierIndex: Array = new Array(30);
configuredVerbs: number;
cliTable: Array<CliTable>;
constructor(cliTable) {
this.cliTable = cliTable;
}
/**
* Return the status of the last operation as a string.
* @return The status of the last operation.
*/
getStsString() {
switch (this.status) {
case CliC.SUCCESS:
return "Success";
case CliC.SYNTAX_ERROR:
return "Syntax error";
case CliC.UNKNOWN_COMMAND:
return "Unknown command verb";
case CliC.QUALNOTFOUND:
return "Unknown qualifier";
default:
return "Unknown command interpreter error";
}
}
/**
* Parse a command line and detect verbs and qualifiers.
* @param cmd Command line.
*/
parse(cmd) {
let state = State.INIT;
let start_pos = 0;
this.status = CliC.SUCCESS;
let i;
for (i = 0; i < cmd.length; i++) {
let c = cmd.charAt(i);
switch (state) {
case State.INIT:
if (c === ' ' || c === '\t') {
break;
} else {
state = State.VERB;
start_pos = i;
}
break;
case State.SPACE:
if (c === ' ' || c === '\t') {
break;
}
if (c === '/') {
state = State.QUAL;
start_pos = i;
} else if (c === '=') {
if (this.qualifier.length === 0) {
state = State.ERROR;
this.status = CliC.SYNTAX_ERROR;
break;
}
state = State.EQUAL;
} else if (c === '"') {
state = State.QUOTE_VERB;
break;
} else {
state = State.VERB;
start_pos = i;
}
break;
case State.VERB:
if (c === ' ' || c === '\t') {
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
if (this.verb.length === 0) {
this.verb.push(cmd.substring(start_pos, i).toUpperCase());
} else {
this.verb.push(cmd.substring(start_pos, i));
}
state = State.SPACE;
} else if (c === '/') {
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
this.verb.push(cmd.substring(start_pos, i).toUpperCase());
state = State.QUAL;
start_pos = i;
}
break;
case State.VERB_EXACT:
if (c === '"') {
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
this.verb.push(cmd.substring(start_pos, i));
state = State.SPACE;
}
break;
case State.QUAL:
if (c === ' ' || c === '\t') {
this.qualifier.push(cmd.substring(start_pos, i).toUpperCase());
state = State.SPACE;
} else if (c === '=') {
this.qualifier.push(cmd.substring(start_pos, i).toUpperCase());
state = State.EQUAL;
} else if (c === '/') {
this.qualifier.push(cmd.substring(start_pos, i).toUpperCase());
state = State.QUAL;
start_pos = i;
}
break;
case State.QUALVALUE:
if (c === ' ' || c === '\t') {
this.qualValue[this.qualifier.length - 1] =
cmd.substring(start_pos, i);
state = State.SPACE;
} else if (c === '/') {
this.qualValue[this.qualifier.length - 1] =
cmd.substring(start_pos, i);
state = State.QUAL;
start_pos = i;
}
break;
case State.QUALVALUE_EXACT:
if (c === '"') {
this.qualValue[this.qualifier.length - 1] =
cmd.substring(start_pos, i);
state = State.SPACE;
}
break;
case State.QUOTE_VERB:
state = State.VERB_EXACT;
start_pos = i;
break;
case State.QUOTE_QUALVALUE:
state = State.QUALVALUE_EXACT;
start_pos = i;
break;
case State.EQUAL:
if (c === ' ' || c === '\t') {
break;
}
if (c === '"') {
state = State.QUOTE_QUALVALUE;
} else {
state = State.QUALVALUE;
start_pos = i;
}
break;
}
if (state === State.ERROR) {
break;
}
}
switch (state) {
case State.INIT:
case State.ERROR:
return "";
case State.VERB:
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
if (this.verb.length === 0) {
this.verb.push(cmd.substring(start_pos, i).toUpperCase());
} else {
this.verb.push(cmd.substring(start_pos, i));
}
break;
case State.VERB_EXACT:
if (this.verb.length === CliC.VERB_VECT_SIZE) {
state = State.ERROR;
break;
}
this.verb.push(cmd.substring(start_pos, i));
break;
case State.QUAL:
this.qualifier.push(cmd.substring(start_pos, i).toUpperCase());
break;
case State.QUALVALUE:
this.qualValue[this.qualifier.length - 1] = cmd.substring(start_pos, i);
break;
case State.QUALVALUE_EXACT:
this.qualValue[this.qualifier.length - 1] = cmd.substring(start_pos, i);
break;
case State.QUOTE_VERB:
case State.QUOTE_QUALVALUE:
case State.EQUAL:
this.status = CliC.SYNTAX_ERROR;
return "";
}
if (this.verb.length === 0) {
this.status = CliC.SYNTAX_ERROR;
return "";
}
// Identify verbs and qualifiers
let found = false;
for (i = 0; i < this.cliTable.length; i++) {
if (this.verb[0].length > this.cliTable[i].command.length) {
continue;
}
if (this.verb[0] ===
(this.cliTable[i].command.substring(0, this.verb[0].length))) {
this.verb[0] = this.cliTable[i].command;
found = true;
break;
}
}
if (!found) {
this.status = CliC.UNKNOWN_COMMAND;
return "";
}
this.cliTableIndex = i;
this.configuredVerbs = 0;
if (this.cliTable[this.cliTableIndex].qualifier !== null) {
for (i = 0; i < this.cliTable[this.cliTableIndex].qualifier.length; i++) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === null) {
break;
}
for (let i = 1; i <= 5; i++) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === ("cli_arg" + String(i))) {
this.configuredVerbs++;
}
}
}
for (let j = 0; j < this.qualifier.length; j++) {
found = false;
for (i = 0; i < this.cliTable[this.cliTableIndex].qualifier.length;
i++) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === null) {
break;
}
if (this.qualifier[j].length >
this.cliTable[this.cliTableIndex].qualifier[i].length) {
continue;
}
if (this.qualifier[j] ===
(this.cliTable[this.cliTableIndex].qualifier[i].substring(0,
this.qualifier[j].length))) {
this.cliQualifierIndex[j] = i;
found = true;
this.qualifier[j] = this.cliTable[this.cliTableIndex].qualifier[i];
}
}
if (!found) {
this.status = CliC.QUALNOTFOUND;
return "";
}
}
} else if (this.qualifier.length > 0) {
this.status = CliC.QUALNOTFOUND;
return "";
}
return this.verb[0];
}
/**
* Check if a qualifier was present in the last parse operation.
* @param qual Qualifier to check.
* @return Returns true if the qualifier is present.
*/
qualifierFound(qual) {
for (let i = 1; i < 6; i++) {
if (qual == ("cli_arg" + String(i))) {
return !(this.verb.length < (i+1) || this.configuredVerbs < i);
}
}
for (let i = 0; i < this.qualifier.length; i++) {
if (qual === (this.qualifier[i])) {
return true;
}
}
return false;
}
/**
* Get the value of a qualifier in the last parse operation.
* @param qual Qualifier to check.
* @return Returns the value of the qualifier.
*/
getQualValue(qual) {
for (let i = 1; i < 6; i++) {
if (qual == ("cli_arg" + String(i))) {
if (this.verb.length < (i+1) || this.configuredVerbs < i) {
return ""
}
return this.verb[i];
}
}
for (let i = 0; i < this.qualifier.length; i++) {
if (qual === (this.qualifier[i])) {
if (this.qualValue[i] === null) {
return "";
} else {
return this.qualValue[i];
}
}
}
return "";
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
"use strict";
function even(sts) {
return sts % 2 === 0;
}
function odd(sts) {
return sts % 2 === 1;
}
function clamp(val, min, max) {
return val > max ? max : (val < min ? min : val);
}
enum Type {
Bit = (1 << 15) + 1,
Boolean = 98305,
Float32,
Float64,
Char,
Int8,
Int16,
Int32,
UInt8,
UInt16,
UInt32,
Objid,
Buffer,
String,
Enum,
Struct,
Mask,
Array,
Time,
Text,
AttrRef,
UInt64,
Int64,
ClassId,
TypeId,
VolumeId,
ObjectIx,
RefId,
DeltaTime,
Status,
NetStatus,
CastId,
ProString,
DisableAttr,
DataRef
}
enum Prv {
RtRead = 1 << 0,
RtWrite = 1 << 1,
System = 1 << 2,
Maintenance = 1 << 3,
Process = 1 << 4,
Instrument = 1 << 5,
Operator1 = 1 << 6,
Operator2 = 1 << 7,
Operator3 = 1 << 8,
Operator4 = 1 << 9,
Operator5 = 1 << 10,
Operator6 = 1 << 11,
Operator7 = 1 << 12,
Operator8 = 1 << 13,
Operator9 = 1 << 14,
Operator10 = 1 << 15,
RtEventsAck = 1 << 18,
RtPlc = 1 << 19,
RtNavigator = 1 << 20,
DevRead = 1 << 21,
DevPlc = 1 << 22,
DevConfig = 1 << 23,
DevClass = 1 << 24,
RtEventsBlock = 1 << 25,
Administrator = 1 << 26,
SevRead = 1 << 27,
SevAdmin = 1 << 28
}
enum Access {
RtRead = 1 << 0,
RtWrite = 1 << 1,
System = 1 << 2,
Maintenance = 1 << 3,
Process = 1 << 4,
Instrument = 1 << 5,
RtEventsBlock = 1 << 25,
RtEventsAck = 1 << 18,
RtPlc = 1 << 19,
RtNavigator = 1 << 20,
AllRt = 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 0 | 1 << 1 | 1 << 25 |
1 << 18 | 1 << 19 | 1 << 20 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 |
1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15,
AllOperators = 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11 |
1 << 12 | 1 << 13 | 1 << 14 | 1 << 15,
AllPwr = ~0
}
enum Adef {
Pointer = 1,
Array = 2,
Backup = 4,
Changelog = 8,
State = 16,
Const = 32,
Rtvirtual = 64,
Devbodyref = 128,
Dynamic = 256,
Publicwrite = 512,
Noedit = 1024,
Invisible = 2048,
Refdirect = 4096,
Noinvert = 8192,
Noremove = 16384,
Rtdbref = 32768,
Private = 65536,
Class = 131072,
Superclass = 262144,
Buffer = 524288,
Nowbl = 1048576,
Alwayswbl = 2097152,
Disableattr = 4194304,
Rthide = 8388608
}
enum XttMethodsFlagsMask {
IsConfigured = 1
}
enum XttOpMethodsMask {
OpenGraph = 1,
OpenObjectGraph = 2,
OpenTrend = 4,
OpenHistory = 8,
OpenFast = 16,
Camera = 32,
HistEvent = 64,
BlockEvents = 128,
Help = 256,
Photo = 512,
Note = 1024,
ParentObjectGraph = 2048
}
enum XttMntMethodsMask {
OpenObject = 1,
OpenTrace = 2,
RtNavigator = 4,
OpenCrossref = 8,
HelpClass = 16,
DataSheet = 32,
CircuitDiagram = 64,
Simulate = 1 << 31
}
class PwrtObjid {
vid: number;
oix: number;
constructor(vid, oix) {
this.oix = oix;
this.vid = vid;
}
}
class PwrtAttrRef {
objid;
offset;
body;
size;
flags;
}
class CdhrNumber {
value: number;
sts: number;
constructor(value, sts) {
this.value = value;
this.sts = sts;
}
}
enum UserVol {
Min = ((0 << 24) + (1 << 16) + (1 << 8) + 1),
Max = ((0 << 24) + (254 << 16) + (254 << 8) + 254)
}
class UserdataCbReturn {
userdata;
row;
}
class Point {
x = 0;
y = 0;
constructor() {
}
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
}
class Rect {
ll_x = 0;
ll_y = 0;
ur_x = 0;
ur_y = 0;
constructor() {
}
constructor(x: number, y: number, x2: number, y2: number) {
this.ll_x = x;
this.ll_y = y;
this.ur_x = x2;
this.ur_y = y2;
}
set(r: Rect) {
this.ll_x = r.ll_x;
this.ll_y = r.ll_y;
this.ur_x = r.ur_x;
this.ur_y = r.ur_y;
}
width() {
return this.ur_x - this.ll_x;
}
height() {
return this.ur_y - this.ll_y;
}
hit(p: Point) {
return (p.x >= this.ll_x && p.x <= this.ur_x && p.y >= this.ll_y && p.y <= this.ur_y);
}
static union(r1: Rect, r2: Rect) {
return new Rect(
Math.min(r1.ll_x, r2.ll_x),
Math.min(r1.ll_y, r2.ll_y),
Math.max(r1.ur_x, r2.ur_x),
Math.max(r1.ur_y, r2.ur_y),
);
}
}
\ No newline at end of file
...@@ -45,13 +45,7 @@ ...@@ -45,13 +45,7 @@
</div> </div>
</div> </div>
<canvas id="flowcanvas" width="1200" height="800"></canvas> <canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src="babel.min.js"></script> <script src=ev.js></script>
<script type="text/babel" src="pwr.ts"></script>
<script type="text/babel" src="cli.ts"></script>
<script type="text/babel" src="gdh.ts"></script>
<script type="text/babel" src="draw.ts"></script>
<script type="text/babel" src="plow.ts"></script>
<script type="text/babel" src="ev.ts"></script>
<hr> <hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address> <address><a href="mailto:claes@debian86.ssab.com"></a></address>
</body> </body>
......
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Trace</title> <title>Trace</title>
...@@ -21,11 +21,7 @@ ...@@ -21,11 +21,7 @@
</div> </div>
</div> </div>
<canvas id="flowcanvas" width="1200" height="800"></canvas> <canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src="babel.min.js"></script> <script src=flow.js></script>
<script type="text/babel" src="pwr.ts"></script>
<script type="text/babel" src="gdh.ts"></script>
<script type="text/babel" src="draw.ts"></script>
<script type="text/babel" src="flow.ts"></script>
<hr> <hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address> <address><a href="mailto:claes@debian86.ssab.com"></a></address>
</body> </body>
......
This diff is collapsed.
This diff is collapsed.
...@@ -7,70 +7,7 @@ ...@@ -7,70 +7,7 @@
<body> <body>
<canvas id="flowcanvas" width="1200" height="800"></canvas> <canvas id="flowcanvas" width="1200" height="800"></canvas>
<script src="babel.min.js"></script> <script src=ge.js></script>
<script type="text/babel" src="pwr.ts"></script>
<script type="text/babel" src="cli.ts"></script>
<script type="text/babel" src="gdh.ts"></script>
<script type="text/babel" src="draw.ts"></script>
<script type="text/babel" src="glow.ts"></script>
<script type="text/babel" src="glow_color.ts"></script>
<script type="text/babel" src="glow_point.ts"></script>
<script type="text/babel" src="glow_transform.ts"></script>
<script type="text/babel" src="glow_annot.ts"></script>
<script type="text/babel" src="glow_arc.ts"></script>
<script type="text/babel" src="glow_array.ts"></script>
<script type="text/babel" src="glow_arrow.ts"></script>
<script type="text/babel" src="glow_cformat.ts"></script>
<script type="text/babel" src="glow_con.ts"></script>
<script type="text/babel" src="glow_conclass.ts"></script>
<script type="text/babel" src="glow_conpoint.ts"></script>
<script type="text/babel" src="glow_line.ts"></script>
<script type="text/babel" src="glow_node.ts"></script>
<script type="text/babel" src="glow_nodeclass.ts"></script>
<script type="text/babel" src="glow_nodegroup.ts"></script>
<script type="text/babel" src="glow_polyline.ts"></script>
<script type="text/babel" src="glow_rect.ts"></script>
<script type="text/babel" src="glow_text.ts"></script>
<script type="text/babel" src="grow_node.ts"></script>
<script type="text/babel" src="grow_rect.ts"></script>
<script type="text/babel" src="grow_annot.ts"></script>
<script type="text/babel" src="grow_arc.ts"></script>
<script type="text/babel" src="grow_axis.ts"></script>
<script type="text/babel" src="grow_axisarc.ts"></script>
<script type="text/babel" src="grow_bar.ts"></script>
<script type="text/babel" src="grow_bararc.ts"></script>
<script type="text/babel" src="grow_barchart.ts"></script>
<script type="text/babel" src="grow_conglue.ts"></script>
<script type="text/babel" src="grow_conpoint.ts"></script>
<script type="text/babel" src="grow_group.ts"></script>
<script type="text/babel" src="grow_image.ts"></script>
<script type="text/babel" src="grow_line.ts"></script>
<script type="text/babel" src="grow_menu.ts"></script>
<script type="text/babel" src="grow_pie.ts"></script>
<script type="text/babel" src="grow_polyline.ts"></script>
<script type="text/babel" src="grow_rectrounded.ts"></script>
<script type="text/babel" src="grow_scrollbar.ts"></script>
<script type="text/babel" src="grow_slider.ts"></script>
<script type="text/babel" src="grow_table.ts"></script>
<script type="text/babel" src="grow_text.ts"></script>
<script type="text/babel" src="grow_toolbar.ts"></script>
<script type="text/babel" src="grow_trend.ts"></script>
<script type="text/babel" src="grow_window.ts"></script>
<script type="text/babel" src="grow_xycurve.ts"></script>
<script type="text/babel" src="grow_folder.ts"></script>
<script type="text/babel" src="grow_ctx.ts"></script>
<script type="text/babel" src="grow_frame.ts"></script>
<script type="text/babel" src="ge.ts"></script>
<script type="text/babel" src="ge_dyn.ts"></script>
<script type="text/babel" src="ge_graph.ts"></script>
<script type="text/babel" src="ge_appl.ts"></script>
<hr> <hr>
<address><a href="mailto:claes@debian86.ssab.com"></a></address> <address><a href="mailto:claes@debian86.ssab.com"></a></address>
</body> </body>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
class GlowAnnot {
ctx: GrowCtx;
number;
p: GlowPoint;
draw_type;
text_size;
annot_type;
display_level;
color_drawtype;
font;
protect;
constructor(ctx) {
this.ctx = ctx;
this.p = new GlowPoint();
}
open(lines, row) {
let i;
for (i = row; i < lines.length; i++) {
let tokens = lines[i].split(' ');
let key = parseInt(tokens[0], 10);
switch (key) {
case GlowSave.Annot:
break;
case GlowSave.Annot_number:
this.number = parseInt(tokens[1], 10);
break;
case GlowSave.Annot_draw_type:
this.draw_type = parseInt(tokens[1], 10);
break;
case GlowSave.Annot_color_drawtype:
this.color_drawtype = parseInt(tokens[1], 10);
break;
case GlowSave.Annot_text_size:
this.text_size = parseInt(tokens[1], 10);
break;
case GlowSave.Annot_display_level:
this.display_level = parseInt(tokens[1], 10);
break;
case GlowSave.Annot_p:
i = this.p.open(lines, i + 1);
break;
case GlowSave.Annot_annot_type:
this.annot_type = parseInt(tokens[1], 10);
break;
case GlowSave.Annot_font:
this.font = parseInt(tokens[1], 10);
break;
case GlowSave.Annot_protect:
this.protect = parseInt(tokens[1], 10);
break;
case GlowSave.End:
return i;
default:
console.log("Syntax error in GlowAnnot");
break;
}
}
return i;
}
}
\ No newline at end of file
class GlowArc {
ctx: GrowCtx;
ll: GlowPoint;
ur: GlowPoint;
draw_type;
angle1;
angle2;
line_width;
display_level;
fill;
border;
shadow;
constructor(ctx) {
this.ctx = ctx;
this.ll = new GlowPoint();
this.ur = new GlowPoint();
}
open(lines, row) {
let i;
for (i = row; i < lines.length; i++) {
let tokens = lines[i].split(' ');
let key = parseInt(tokens[0], 10);
switch (key) {
case GlowSave.Arc:
break;
case GlowSave.Arc_draw_type:
this.draw_type = parseInt(tokens[1], 10);
break;
case GlowSave.Arc_angle1:
this.angle1 = parseInt(tokens[1], 10);
break;
case GlowSave.Arc_angle2:
this.angle2 = parseInt(tokens[1], 10);
break;
case GlowSave.Arc_line_width:
this.line_width = parseInt(tokens[1], 10);
break;
case GlowSave.Arc_fill:
this.fill = parseInt(tokens[1], 10);
break;
case GlowSave.Arc_ll:
i = this.ll.open(lines, i + 1);
break;
case GlowSave.Arc_ur:
i = this.ur.open(lines, i + 1);
break;
case GlowSave.End:
return i;
default:
console.log("Syntax error in GlowArc");
break;
}
}
return i;
}
draw(highlight, hot) {
if (this.ctx.nodraw !== 0) {
return;
}
let ll_x = Math.floor(this.ll.x * this.ctx.mw.zoom_factor_x + 0.5) -
this.ctx.mw.offset_x;
let ll_y = Math.floor(this.ll.y * this.ctx.mw.zoom_factor_y + 0.5) -
this.ctx.mw.offset_y;
let ur_x = Math.floor(this.ur.x * this.ctx.mw.zoom_factor_x + 0.5) -
this.ctx.mw.offset_x;
let ur_y = Math.floor(this.ur.y * this.ctx.mw.zoom_factor_y + 0.5) -
this.ctx.mw.offset_y;
if (ll_x === ur_x && ll_y === ur_y) {
return;
}
let idx = Math.floor(this.ctx.mw.zoom_factor_y /
this.ctx.mw.base_zoom_factor * this.line_width - 1);
idx += hot;
idx = Math.max(0, idx);
idx = Math.min(idx, DRAW_TYPE_SIZE - 1);
this.ctx.gdraw.arc(ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, this.angle1,
this.angle2, this.draw_type, false, idx, highlight);
}
draw_shadow(border, shadow, highlight, hot) {
if (this.ctx.nodraw !== 0) {
return;
}
let ll_x = Math.floor(this.ll.x * this.ctx.mw.zoom_factor_x + 0.5) -
this.ctx.mw.offset_x;
let ll_y = Math.floor(this.ll.y * this.ctx.mw.zoom_factor_y + 0.5) -
this.ctx.mw.offset_y;
let ur_x = Math.floor(this.ur.x * this.ctx.mw.zoom_factor_x + 0.5) -
this.ctx.mw.offset_x;
let ur_y = Math.floor(this.ur.y * this.ctx.mw.zoom_factor_y + 0.5) -
this.ctx.mw.offset_y;
let idx = Math.floor(this.ctx.mw.zoom_factor_y /
this.ctx.mw.base_zoom_factor * this.line_width - 1);
idx += hot;
idx = Math.max(0, idx);
idx = Math.min(idx, DRAW_TYPE_SIZE - 1);
let ish = 1;
let offs = this.border;
if (this.shadow !== 0 && idx > 2) {
if (this.angle1 === 0) {
this.ctx.gdraw.arc(ll_x + idx / 2 - idx + offs, ll_y + idx / 2 - idx +
offs, ur_x - ll_x + idx - offs * 2, ur_y - ll_y + idx - offs *
2, this.angle1 + 45, this.angle2 - 45,
GlowColor.shift_drawtype(this.draw_type, -2, null), false, ish - 1,
highlight);
this.ctx.gdraw.arc(ll_x + idx / 2 - idx + offs, ll_y + idx / 2 - idx +
offs, ur_x - ll_x + idx - offs * 2, ur_y - ll_y + idx - offs * 2,
this.angle1, this.angle2 - 45,
GlowColor.shift_drawtype(this.draw_type, 2, null), false, ish - 1,
highlight);
this.ctx.gdraw.arc(ll_x + idx / 2 - offs, ll_y + idx / 2 - offs,
Math.max(0, ur_x - ll_x - idx + offs * 2),
Math.max(0, ur_y - ll_y - idx + offs * 2), this.angle1 +
45, this.angle2 - 45,
GlowColor.shift_drawtype(this.draw_type, 2, null), false, ish - 1,
highlight);
this.ctx.gdraw.arc(ll_x + idx / 2 - offs, ll_y + idx / 2 - offs,
Math.max(0, ur_x - ll_x - idx + offs * 2),
Math.max(0, ur_y - ll_y - idx + offs * 2), this.angle1, this.angle2 -
45, GlowColor.shift_drawtype(this.draw_type, -2, null), false, ish - 1,
highlight);
} else if (this.angle1 === 90) {
this.ctx.gdraw.arc(ll_x + idx / 2 - idx + offs, ll_y + idx / 2 - idx +
offs, ur_x - ll_x + idx - offs * 2, ur_y - ll_y + idx - offs * 2,
this.angle1, this.angle2,
GlowColor.shift_drawtype(this.draw_type, -2, null), false, ish - 1,
highlight);
this.ctx.gdraw.arc(ll_x + idx / 2 - offs, ll_y + idx / 2 - offs,
Math.max(0, ur_x - ll_x - idx + offs * 2),
Math.max(0, ur_y - ll_y - idx + offs * 2), this.angle1, this.angle2,
GlowColor.shift_drawtype(this.draw_type, 2, null), false, ish - 1,
highlight);
} else if (this.angle1 === 180) {
this.ctx.gdraw.arc(ll_x + idx / 2 - idx + offs, ll_y + idx / 2 - idx +
offs, ur_x - ll_x + idx - offs * 2, ur_y - ll_y + idx - offs *
2, this.angle1 + 45, this.angle2 - 45,
GlowColor.shift_drawtype(this.draw_type, 2, null), false, ish - 1,
highlight);
this.ctx.gdraw.arc(ll_x + idx / 2 - idx + offs, ll_y + idx / 2 - idx +
offs, ur_x - ll_x + idx - offs * 2, ur_y - ll_y + idx - offs * 2,
this.angle1, this.angle2 - 45,
GlowColor.shift_drawtype(this.draw_type, -2, null), false, ish - 1,
highlight);
this.ctx.gdraw.arc(ll_x + idx / 2 - offs, ll_y + idx / 2 - offs,
Math.max(0, ur_x - ll_x - idx + offs * 2),
Math.max(0, ur_y - ll_y - idx + offs * 2), this.angle1 +
45, this.angle2 - 45,
GlowColor.shift_drawtype(this.draw_type, -2, null), false, ish - 1,
highlight);
this.ctx.gdraw.arc(ll_x + idx / 2 - offs, ll_y + idx / 2 - offs,
Math.max(0, ur_x - ll_x - idx + offs * 2),
Math.max(0, ur_y - ll_y - idx + offs * 2), this.angle1, this.angle2 -
45, GlowColor.shift_drawtype(this.draw_type, 2, null), false, ish - 1,
highlight);
} else if (this.angle1 === 270) {
this.ctx.gdraw.arc(ll_x + idx / 2 - idx + offs, ll_y + idx / 2 - idx +
offs, ur_x - ll_x + idx - offs * 2, ur_y - ll_y + idx - offs * 2,
this.angle1, this.angle2,
GlowColor.shift_drawtype(this.draw_type, 2, null), false, ish - 1,
highlight);
this.ctx.gdraw.arc(ll_x + idx / 2 - offs, ll_y + idx / 2 - offs,
Math.max(0, ur_x - ll_x - idx + offs * 2),
Math.max(0, ur_y - ll_y - idx + offs * 2), this.angle1, this.angle2,
GlowColor.shift_drawtype(this.draw_type, -2, null), false, ish - 1,
highlight);
}
}
if (border !== 0) {
this.ctx.gdraw.arc(ll_x + idx / 2 - idx, ll_y + idx / 2 - idx, ur_x -
ll_x + idx, ur_y - ll_y + idx, this.angle1, this.angle2,
DrawType.Line, false, 0, highlight);
if (idx > 0) {
this.ctx.gdraw.arc(ll_x + idx / 2, ll_y + idx / 2,
Math.max(0, ur_x - ll_x - idx), Math.max(0, ur_y - ll_y - idx),
this.angle1, this.angle2, DrawType.Line, false, 0, highlight);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
class GlowArrow {
ctx: GrowCtx;
p_dest: GlowPoint;
p1: GlowPoint;
p2: GlowPoint;
arrow_width: Number;
arrow_length: Number;
draw_type: DrawType;
line_width: Number;
constructor(ctx) {
this.ctx = ctx;
this.p_dest = new GlowPoint();
this.p1 = new GlowPoint();
this.p2 = new GlowPoint();
}
open(lines, row) {
let i;
for (i = row; i < lines.length; i++) {
let tokens = lines[i].split(' ');
let key = parseInt(tokens[0], 10);
switch (key) {
case GlowSave.Arrow:
break;
case GlowSave.Arrow_arrow_width:
this.arrow_width = Number(tokens[1]);
break;
case GlowSave.Arrow_arrow_length:
this.arrow_length = Number(tokens[1]);
break;
case GlowSave.Arrow_draw_type:
this.draw_type = DrawType(tokens[1]);
break;
case GlowSave.Arrow_line_width:
this.line_width = parseInt(tokens[1], 10);
break;
case GlowSave.Arrow_p_dest:
i = this.p_dest.open(lines, i + 1);
break;
case GlowSave.Arrow_p1:
i = this.p1.open(lines, i + 1);
break;
case GlowSave.Arrow_p2:
i = this.p2.open(lines, i + 1);
break;
case GlowSave.End:
return i;
default:
console.log("Syntax error in GlowArrow");
break;
}
}
return i;
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
class GlowNodeGroup extends GlowNodeClass {
constructor(ctx) {
super(ctx);
}
open(lines, row) {
let i;
for (i = row; i < lines.length; i++) {
let tokens = lines[i].split(' ');
let key = parseInt(tokens[0], 10);
switch (key) {
case GlowSave.NodeGroup:
break;
case GlowSave.NodeGroup_nodeclass_part:
i = super.open(lines, i + 1);
break;
case GlowSave.End:
return i;
default:
console.log("Syntax error in GlowNodeGroup");
break;
}
}
return i;
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Operator window</title> <title>Operator window</title>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment