Fix: image creator service flowName and agentName fixes

This commit is contained in:
Lorenzo Iovino 2019-11-05 10:44:30 +01:00
parent 13d9a24d63
commit ae093c0f26
3 changed files with 20 additions and 65 deletions

74
.idea/workspace.xml generated
View file

@ -2,28 +2,9 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="603d916b-6d0f-43a7-809c-21ce2bcb2533" name="Default Changelist" comment="Feat: scaled"> <list default="true" id="603d916b-6d0f-43a7-809c-21ce2bcb2533" name="Default Changelist" comment="Feat: scaled">
<change afterPath="$PROJECT_DIR$/DataGatherer/src/index.prod.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/apacheDockerfile.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/docker-compose.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/mongoDockerfile.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/nodeDockerfile.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataGatherer/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/DataGatherer/package-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataGatherer/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/DataGatherer/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataGatherer/src/main.ts" beforeDir="false" afterPath="$PROJECT_DIR$/DataGatherer/src/main.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/DataGatherer/src/main.ts" beforeDir="false" afterPath="$PROJECT_DIR$/DataGatherer/src/main.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataGatherer/src/sender/Sender.ts" beforeDir="false" afterPath="$PROJECT_DIR$/DataGatherer/src/sender/Sender.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataGatherer/src/shared/Data.ts" beforeDir="false" afterPath="$PROJECT_DIR$/Shared/Data.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataGatherer/src/source/Source.ts" beforeDir="false" afterPath="$PROJECT_DIR$/DataGatherer/src/source/Source.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataGatherer/src/source/mouse/Mouse.ts" beforeDir="false" afterPath="$PROJECT_DIR$/DataGatherer/src/source/mouse/Mouse.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataGatherer/src/source/screen/Screen.ts" beforeDir="false" afterPath="$PROJECT_DIR$/DataGatherer/src/source/screen/Screen.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DataGenerator/src/main.ts" beforeDir="false" afterPath="$PROJECT_DIR$/DataGenerator/src/main.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Predictor/PredictorWebService/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/Predictor/PredictorWebService/package-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Predictor/PredictorWebService/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/Predictor/PredictorWebService/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Predictor/PredictorWebService/src/image-creator/ImageCreatorService.ts" beforeDir="false" afterPath="$PROJECT_DIR$/Predictor/PredictorWebService/src/image-creator/ImageCreatorService.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Predictor/PredictorWebService/src/image-creator/ImageCreatorService.ts" beforeDir="false" afterPath="$PROJECT_DIR$/Predictor/PredictorWebService/src/image-creator/ImageCreatorService.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Predictor/PredictorWebService/src/predictor-web-service/PredictorWebService.ts" beforeDir="false" afterPath="$PROJECT_DIR$/Predictor/PredictorWebService/src/predictor-web-service/PredictorWebService.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Predictor/PredictorWebService/src/predictor-web-service/main.ts" beforeDir="false" afterPath="$PROJECT_DIR$/Predictor/PredictorWebService/src/predictor-web-service/main.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Predictor/PredictorWebService/src/predictor-web-service/models/Data.ts" beforeDir="false" afterPath="$PROJECT_DIR$/Predictor/PredictorWebService/src/predictor-web-service/models/Data.ts" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -85,7 +66,7 @@
</list> </list>
</option> </option>
</component> </component>
<component name="RunManager" selected="Docker.docker-compose.yml: Compose Deployment (1)"> <component name="RunManager" selected="npm.start-imageCreator">
<configuration name="docker-compose.yml: Compose Deployment (1)" type="docker-deploy" factoryName="docker-compose.yml" temporary="true" server-name="Docker"> <configuration name="docker-compose.yml: Compose Deployment (1)" type="docker-deploy" factoryName="docker-compose.yml" temporary="true" server-name="Docker">
<deployment type="docker-compose.yml"> <deployment type="docker-compose.yml">
<settings> <settings>
@ -100,19 +81,6 @@
</deployment> </deployment>
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="docker-compose.yml.ups_gatherer: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml" temporary="true" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="services">
<list>
<option value="ups_gatherer" />
</list>
</option>
<option name="sourceFilePath" value="docker-compose.yml" />
</settings>
</deployment>
<method v="2" />
</configuration>
<configuration name="dockerfile.yml: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml"> <configuration name="dockerfile.yml: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml">
<deployment type="docker-compose.yml"> <deployment type="docker-compose.yml">
<settings> <settings>
@ -151,22 +119,32 @@
<envs /> <envs />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="start-imageCreator" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
<package-json value="$PROJECT_DIR$/Predictor/PredictorWebService/package.json" />
<command value="run" />
<scripts>
<script value="start-imageCreator" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
<list> <list>
<item itemvalue="Docker.docker-compose.yml: Compose Deployment" /> <item itemvalue="Docker.docker-compose.yml: Compose Deployment" />
<item itemvalue="Docker.dockerfile.yml: Compose Deployment" /> <item itemvalue="Docker.dockerfile.yml: Compose Deployment" />
<item itemvalue="Docker.docker-compose.yml: Compose Deployment (1)" /> <item itemvalue="Docker.docker-compose.yml: Compose Deployment (1)" />
<item itemvalue="npm.build" /> <item itemvalue="npm.build" />
<item itemvalue="Docker.docker-compose.yml.ups_gatherer: Compose Deployment" />
<item itemvalue="npm.build:prod" /> <item itemvalue="npm.build:prod" />
<item itemvalue="npm.build-ws:prod" /> <item itemvalue="npm.build-ws:prod" />
<item itemvalue="npm.start-imageCreator" />
</list> </list>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="npm.start-imageCreator" />
<item itemvalue="Docker.docker-compose.yml: Compose Deployment (1)" /> <item itemvalue="Docker.docker-compose.yml: Compose Deployment (1)" />
<item itemvalue="npm.build:prod" /> <item itemvalue="npm.build:prod" />
<item itemvalue="npm.build-ws:prod" /> <item itemvalue="npm.build-ws:prod" />
<item itemvalue="npm.build" /> <item itemvalue="npm.build" />
<item itemvalue="Docker.docker-compose.yml.ups_gatherer: Compose Deployment" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
@ -179,29 +157,6 @@
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" /> <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@1ad5b4b6" type="9fbbdea:ServiceModel$ServiceNode" /> <item name="com.intellij.execution.services.ServiceModel$ServiceNode@1ad5b4b6" type="9fbbdea:ServiceModel$ServiceNode" />
</path> </path>
<path>
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@1ad5b4b6" type="9fbbdea:ServiceModel$ServiceNode" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@516acf99" type="9fbbdea:ServiceModel$ServiceNode" />
</path>
<path>
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@1ad5b4b6" type="9fbbdea:ServiceModel$ServiceNode" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@516acf99" type="9fbbdea:ServiceModel$ServiceNode" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@4f81c280" type="9fbbdea:ServiceModel$ServiceNode" />
</path>
<path>
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@1ad5b4b6" type="9fbbdea:ServiceModel$ServiceNode" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@516acf99" type="9fbbdea:ServiceModel$ServiceNode" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@4d14d318" type="9fbbdea:ServiceModel$ServiceNode" />
</path>
<path>
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@1ad5b4b6" type="9fbbdea:ServiceModel$ServiceNode" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@516acf99" type="9fbbdea:ServiceModel$ServiceNode" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@66af67db" type="9fbbdea:ServiceModel$ServiceNode" />
</path>
</expand> </expand>
<select /> <select />
</treeState> </treeState>
@ -239,7 +194,8 @@
<workItem from="1569872860582" duration="216000" /> <workItem from="1569872860582" duration="216000" />
<workItem from="1571588208616" duration="549000" /> <workItem from="1571588208616" duration="549000" />
<workItem from="1571650740912" duration="14000" /> <workItem from="1571650740912" duration="14000" />
<workItem from="1572936055537" duration="9213000" /> <workItem from="1572936055537" duration="9527000" />
<workItem from="1572945879186" duration="1102000" />
</task> </task>
<task id="LOCAL-00001" summary="Feat: Added websocket comm. for DataGatherer and PredictorWebService"> <task id="LOCAL-00001" summary="Feat: Added websocket comm. for DataGatherer and PredictorWebService">
<created>1554992034761</created> <created>1554992034761</created>

View file

@ -21,12 +21,12 @@ function main() {
function getFlowName() { function getFlowName() {
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
return urlParams.get('flowName'); return urlParams.get('flowName') === null ? 1 : urlParams.get('flowName');
} }
function getAgentName() { function getAgentName() {
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
return urlParams.get('agentName'); return urlParams.get('agentName') === null ? 1: urlParams.get('agentName');
} }
function startPrediction(gatherer: Gatherer) { function startPrediction(gatherer: Gatherer) {
@ -44,7 +44,7 @@ function startGathering(gatherers: Array<Gatherer>) {
for(const gatherer of gatherers ) { for(const gatherer of gatherers ) {
gatherer.start(); gatherer.start();
const sender: Sender = new Sender(() => gatherer.getData(), UPS_CONFIGS.gatherer_ws_url+ '?agentName='+getAgentName()+'&flowName='+getFlowName(), 1000); const sender: Sender = new Sender(() => gatherer.getData(), UPS_CONFIGS.gatherer_ws_url+ '?agentName=bot_'+getAgentName()+'&flowName=flow'+getFlowName(), 1000);
sender.start('ws') sender.start('ws')
.subscribe( .subscribe(
val => { val => {

View file

@ -39,7 +39,7 @@ export class ImageCreatorService {
}); });
//todo da cambiare le dimensioni e renderle dinamiche //todo da cambiare le dimensioni e renderle dinamiche
const canvas = createCanvas(150, 150); const canvas = createCanvas(800, 600);
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
this.printHTMLElements(htmlElements, ctx); this.printHTMLElements(htmlElements, ctx);
this.printMouseClick(mouseClicks, ctx); this.printMouseClick(mouseClicks, ctx);
@ -175,6 +175,5 @@ export class ImageCreatorService {
} }
} }
}) })
} }
} }